File tree Expand file tree Collapse file tree 7 files changed +793
-15
lines changed
tests-unit/tests/core/routing Expand file tree Collapse file tree 7 files changed +793
-15
lines changed Original file line number Diff line number Diff line change 3434 " README.md"
3535 ],
3636 "dependencies" : {
37+ "@aws-sdk/client-cloudfront" : " 3.398.0" ,
3738 "@aws-sdk/client-dynamodb" : " ^3.398.0" ,
3839 "@aws-sdk/client-lambda" : " ^3.398.0" ,
3940 "@aws-sdk/client-s3" : " ^3.398.0" ,
Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ export async function createMainHandler() {
4040 ) ;
4141
4242 globalThis . cdnInvalidationHandler = await resolveCdnInvalidation (
43- thisFunction . override ?. cdnInvalidation
44- )
43+ thisFunction . override ?. cdnInvalidation ,
44+ ) ;
4545
4646 globalThis . lastModified = { } ;
4747
Original file line number Diff line number Diff line change @@ -142,16 +142,15 @@ export async function resolveProxyRequest(
142142 return m_1 . default ;
143143}
144144
145-
146145/**
147146 * @__PURE__
148147 */
149148export async function resolveCdnInvalidation (
150- cdnInvalidation : OverrideOptions [ "cdnInvalidation" ]
149+ cdnInvalidation : OverrideOptions [ "cdnInvalidation" ] ,
151150) {
152- if ( typeof cdnInvalidation === "function" ) {
153- return cdnInvalidation ( )
151+ if ( typeof cdnInvalidation === "function" ) {
152+ return cdnInvalidation ( ) ;
154153 }
155154 const m_1 = await import ( "../overrides/cdnInvalidation/dummy.js" ) ;
156- return m_1 . default
157- }
155+ return m_1 . default ;
156+ }
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export interface IPluginSettings {
2727 | IncludedOriginResolver ;
2828 warmer ?: LazyLoadedOverride < Warmer > | IncludedWarmer ;
2929 proxyExternalRequest ?: OverrideOptions [ "proxyExternalRequest" ] ;
30- cdnInvalidation ?: OverrideOptions [ "cdnInvalidation" ]
30+ cdnInvalidation ?: OverrideOptions [ "cdnInvalidation" ] ;
3131 } ;
3232 fnName ?: string ;
3333}
@@ -53,7 +53,7 @@ const nameToFolder = {
5353 originResolver : "originResolver" ,
5454 warmer : "warmer" ,
5555 proxyExternalRequest : "proxyExternalRequest" ,
56- cdnInvalidation : "cdnInvalidation"
56+ cdnInvalidation : "cdnInvalidation" ,
5757} ;
5858
5959const defaultOverrides = {
@@ -66,7 +66,7 @@ const defaultOverrides = {
6666 originResolver : "pattern-env" ,
6767 warmer : "aws-lambda" ,
6868 proxyExternalRequest : "node" ,
69- cdnInvalidation : "dummy"
69+ cdnInvalidation : "dummy" ,
7070} ;
7171
7272/**
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ export type IncludedWarmer = "aws-lambda" | "dummy";
153153
154154export type IncludedProxyExternalRequest = "node" | "fetch" | "dummy" ;
155155
156- export type IncludedCDNInvalidationHandler = "cloudfront" | "dummy"
156+ export type IncludedCDNInvalidationHandler = "cloudfront" | "dummy" ;
157157
158158export interface DefaultOverrideOptions <
159159 E extends BaseEventOrResult = InternalEvent ,
@@ -211,7 +211,7 @@ export interface OverrideOptions extends DefaultOverrideOptions {
211211 * Add possibility to override the default cdn invalidation for On Demand Revalidation
212212 * @default "dummy"
213213 */
214- cdnInvalidation ?:
214+ cdnInvalidation ?:
215215 | IncludedCDNInvalidationHandler
216216 | LazyLoadedOverride < CDNInvalidationHandler > ;
217217}
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ import {
1313 fixSWRCacheHeader ,
1414 getMiddlewareMatch ,
1515 getUrlParts ,
16+ invalidateCDNOnRequest ,
1617 isExternal ,
1718 revalidateIfRequired ,
1819 unescapeRegex ,
19- invalidateCDNOnRequest ,
2020} from "@opennextjs/aws/core/routing/util.js" ;
2121import { fromReadableStream } from "@opennextjs/aws/utils/stream.js" ;
2222import { vi } from "vitest" ;
You can’t perform that action at this time.
0 commit comments