@opennextjs/aws 4.1.8 → 4.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/adapters/cache.d.ts +1 -1
  2. package/dist/adapters/cache.js +7 -6
  3. package/dist/adapters/composable-cache.d.ts +1 -1
  4. package/dist/adapters/composable-cache.js +2 -2
  5. package/dist/adapters/config/util.d.ts +10 -10
  6. package/dist/adapters/edge-adapter.js +2 -2
  7. package/dist/adapters/middleware.js +2 -2
  8. package/dist/build/copyTracedFiles.js +6 -2
  9. package/dist/build/edge/createEdgeBundle.d.ts +2 -2
  10. package/dist/build/installDeps.d.ts +1 -1
  11. package/dist/build/validateConfig.d.ts +1 -1
  12. package/dist/core/createGenericHandler.d.ts +2 -2
  13. package/dist/core/edgeFunctionHandler.d.ts +1 -1
  14. package/dist/core/nodeMiddlewareHandler.d.ts +1 -1
  15. package/dist/core/requestHandler.d.ts +2 -2
  16. package/dist/core/requestHandler.js +15 -7
  17. package/dist/core/resolve.d.ts +10 -10
  18. package/dist/core/routing/cacheInterceptor.d.ts +1 -1
  19. package/dist/core/routing/cacheInterceptor.js +6 -6
  20. package/dist/core/routing/i18n/index.d.ts +2 -2
  21. package/dist/core/routing/matcher.d.ts +61 -6
  22. package/dist/core/routing/matcher.js +283 -55
  23. package/dist/core/routing/middleware.d.ts +8 -4
  24. package/dist/core/routing/middleware.js +29 -12
  25. package/dist/core/routing/routeMatcher.d.ts +1 -1
  26. package/dist/core/routing/routeMatcher.js +1 -1
  27. package/dist/core/routing/util.d.ts +20 -4
  28. package/dist/core/routing/util.js +32 -15
  29. package/dist/core/routingHandler.d.ts +2 -2
  30. package/dist/core/routingHandler.js +3 -3
  31. package/dist/helpers/withCloudflare.d.ts +1 -1
  32. package/dist/helpers/withSST.d.ts +2 -2
  33. package/dist/http/openNextResponse.d.ts +1 -1
  34. package/dist/overrides/assetResolver/dummy.d.ts +1 -1
  35. package/dist/overrides/converters/aws-apigw-v1.d.ts +1 -1
  36. package/dist/overrides/converters/aws-apigw-v1.js +1 -1
  37. package/dist/overrides/converters/aws-apigw-v2.d.ts +1 -1
  38. package/dist/overrides/converters/aws-apigw-v2.js +2 -2
  39. package/dist/overrides/converters/aws-cloudfront.d.ts +1 -1
  40. package/dist/overrides/converters/aws-cloudfront.js +2 -2
  41. package/dist/overrides/converters/dummy.d.ts +1 -1
  42. package/dist/overrides/converters/edge.d.ts +2 -2
  43. package/dist/overrides/converters/edge.js +1 -1
  44. package/dist/overrides/converters/node.d.ts +1 -1
  45. package/dist/overrides/converters/sqs-revalidate.d.ts +1 -1
  46. package/dist/overrides/imageLoader/dummy.d.ts +1 -1
  47. package/dist/overrides/imageLoader/dummy.js +1 -1
  48. package/dist/overrides/imageLoader/fs-dev.js +2 -2
  49. package/dist/overrides/imageLoader/host.d.ts +1 -1
  50. package/dist/overrides/imageLoader/host.js +1 -1
  51. package/dist/overrides/imageLoader/s3-lite.d.ts +1 -1
  52. package/dist/overrides/imageLoader/s3-lite.js +1 -1
  53. package/dist/overrides/imageLoader/s3.d.ts +1 -1
  54. package/dist/overrides/imageLoader/s3.js +1 -1
  55. package/dist/overrides/incrementalCache/dummy.d.ts +1 -1
  56. package/dist/overrides/incrementalCache/dummy.js +1 -1
  57. package/dist/overrides/incrementalCache/fs-dev.js +1 -1
  58. package/dist/overrides/incrementalCache/multi-tier-ddb-s3.d.ts +1 -1
  59. package/dist/overrides/incrementalCache/multi-tier-ddb-s3.js +2 -2
  60. package/dist/overrides/incrementalCache/s3-lite.d.ts +1 -1
  61. package/dist/overrides/incrementalCache/s3-lite.js +2 -2
  62. package/dist/overrides/incrementalCache/s3.d.ts +1 -1
  63. package/dist/overrides/originResolver/dummy.d.ts +1 -1
  64. package/dist/overrides/originResolver/pattern-env.d.ts +1 -1
  65. package/dist/overrides/proxyExternalRequest/dummy.d.ts +1 -1
  66. package/dist/overrides/proxyExternalRequest/dummy.js +1 -1
  67. package/dist/overrides/proxyExternalRequest/fetch.d.ts +1 -1
  68. package/dist/overrides/proxyExternalRequest/fetch.js +1 -1
  69. package/dist/overrides/proxyExternalRequest/node.d.ts +1 -1
  70. package/dist/overrides/queue/dummy.d.ts +1 -1
  71. package/dist/overrides/queue/dummy.js +1 -1
  72. package/dist/overrides/queue/sqs-lite.d.ts +1 -1
  73. package/dist/overrides/queue/sqs-lite.js +2 -2
  74. package/dist/overrides/queue/sqs.d.ts +1 -1
  75. package/dist/overrides/tagCache/dummy.d.ts +1 -1
  76. package/dist/overrides/tagCache/dynamodb-lite.d.ts +1 -1
  77. package/dist/overrides/tagCache/dynamodb-lite.js +2 -2
  78. package/dist/overrides/tagCache/dynamodb-nextMode.d.ts +1 -1
  79. package/dist/overrides/tagCache/dynamodb-nextMode.js +2 -2
  80. package/dist/overrides/tagCache/dynamodb.d.ts +1 -1
  81. package/dist/overrides/tagCache/fs-dev-nextMode.d.ts +1 -1
  82. package/dist/overrides/tagCache/fs-dev.d.ts +1 -1
  83. package/dist/overrides/tagCache/fs-dev.js +1 -1
  84. package/dist/overrides/warmer/aws-lambda.d.ts +1 -1
  85. package/dist/overrides/warmer/dummy.d.ts +1 -1
  86. package/dist/overrides/warmer/dummy.js +1 -1
  87. package/dist/overrides/wrappers/aws-apigw-streaming.d.ts +1 -1
  88. package/dist/overrides/wrappers/aws-lambda-compressed.d.ts +1 -1
  89. package/dist/overrides/wrappers/aws-lambda-streaming.d.ts +1 -1
  90. package/dist/overrides/wrappers/aws-lambda.d.ts +1 -1
  91. package/dist/overrides/wrappers/cloudflare-edge.d.ts +2 -2
  92. package/dist/overrides/wrappers/cloudflare-node.d.ts +2 -2
  93. package/dist/overrides/wrappers/dummy.d.ts +1 -1
  94. package/dist/overrides/wrappers/express-dev.js +2 -2
  95. package/dist/overrides/wrappers/node.d.ts +1 -1
  96. package/dist/plugins/resolve.d.ts +2 -2
  97. package/dist/types/global.d.ts +1 -1
  98. package/dist/types/overrides.d.ts +1 -1
  99. package/dist/utils/cache.d.ts +1 -1
  100. package/dist/utils/promise.d.ts +1 -1
  101. package/package.json +12 -12
@@ -31,42 +31,56 @@ export function isExternal(url, host) {
31
31
  }
32
32
  return true;
33
33
  }
34
+ /**
35
+ * Parses a raw query string into decoded scalar or repeated values.
36
+ *
37
+ * The result has the same shape the converters produce from `URLSearchParams`
38
+ * and follows Next.js's decoded query representation.
39
+ * https://github.com/vercel/next.js/blob/3439bde/packages/next/src/shared/lib/router/utils/querystring.ts#L34-L48
40
+ *
41
+ * @param query The query string without a leading question mark
42
+ * @returns The decoded scalar and repeated query values
43
+ *
44
+ * @__PURE__
45
+ */
34
46
  export function convertFromQueryString(query) {
35
47
  if (query === "")
36
48
  return {};
37
- const queryParts = query.split("&");
38
- return getQueryFromIterator(queryParts.map((p) => {
39
- const [key, value] = p.split("=");
40
- return [key, value];
41
- }));
49
+ return getQueryFromIterator(new URLSearchParams(query).entries());
42
50
  }
43
51
  /**
44
52
  * Splits an URL into its parts
45
53
  *
46
54
  * The URL is a route destination, i.e. a `path-to-regexp` pattern rather than a
47
55
  * well formed URL, so it can not be parsed with `new URL()` which would percent
48
- * encode some of the pattern characters.
56
+ * encode some of the pattern characters. Like Next.js, the fragment is kept
57
+ * separate from the query while destination parameters are interpolated.
58
+ * https://github.com/vercel/next.js/blob/3439bde/packages/next/src/shared/lib/router/utils/prepare-destination.ts#L221-L299
49
59
  *
50
60
  * @param url The URL to split
51
61
  * @param isExternal Whether the URL points to an external host
52
- * @returns The protocol, hostname, pathname and query string of the URL
62
+ * @returns The protocol, hostname, pathname, query string and fragment
53
63
  * @throws When `isExternal` is true and the URL is not an absolute HTTP(S) URL
54
64
  *
55
65
  * @__PURE__
56
66
  */
57
67
  export function getUrlParts(url, isExternal) {
68
+ const hashIndex = url.indexOf("#");
69
+ const hash = hashIndex === -1 ? "" : url.slice(hashIndex);
70
+ const urlWithoutHash = hashIndex === -1 ? url : url.slice(0, hashIndex);
58
71
  if (!isExternal) {
59
72
  const regex = /\/([^?]*)\??(.*)/;
60
- const match = url.match(regex);
73
+ const match = urlWithoutHash.match(regex);
61
74
  return {
62
75
  hostname: "",
63
- pathname: url.startsWith("/") ? `/${match?.[1] ?? ""}` : "",
76
+ pathname: urlWithoutHash.startsWith("/") ? `/${match?.[1] ?? ""}` : "",
64
77
  protocol: "",
65
78
  queryString: match?.[2] ?? "",
79
+ hash,
66
80
  };
67
81
  }
68
82
  const regex = /^(https?:)\/\/?([^\/\s?]+)(\/[^?]*)?(\?.*)?/;
69
- const match = url.match(regex);
83
+ const match = urlWithoutHash.match(regex);
70
84
  if (!match) {
71
85
  throw new Error(`Invalid external URL: ${url}`);
72
86
  }
@@ -75,6 +89,7 @@ export function getUrlParts(url, isExternal) {
75
89
  hostname: match[2],
76
90
  pathname: match[3] ?? "",
77
91
  queryString: match[4]?.slice(1) ?? "",
92
+ hash,
78
93
  };
79
94
  }
80
95
  /**
@@ -125,20 +140,22 @@ export function convertRes(res) {
125
140
  * Make sure that multi-value query parameters are transformed to
126
141
  * ?key=value1&key=value2&... so that Next converts those parameters
127
142
  * to an array when reading the query parameters
128
- * query should be properly encoded before using this function
143
+ * Keys and values are expected decoded (as produced by the converters) and are
144
+ * percent-encoded here, so a value such as "h&m" survives as "h%26m"
129
145
  * @__PURE__
130
146
  */
131
147
  export function convertToQueryString(query) {
132
- const queryStrings = [];
148
+ const searchParams = new URLSearchParams();
133
149
  Object.entries(query).forEach(([key, value]) => {
134
150
  if (Array.isArray(value)) {
135
- value.forEach((entry) => queryStrings.push(`${key}=${entry}`));
151
+ value.forEach((entry) => searchParams.append(key, entry));
136
152
  }
137
153
  else {
138
- queryStrings.push(`${key}=${value}`);
154
+ searchParams.append(key, value);
139
155
  }
140
156
  });
141
- return queryStrings.length > 0 ? `?${queryStrings.join("&")}` : "";
157
+ const queryString = searchParams.toString();
158
+ return queryString ? `?${queryString}` : "";
142
159
  }
143
160
  /**
144
161
  * Given a raw query string, returns a record with key value-array pairs
@@ -1,5 +1,5 @@
1
- import type { InternalEvent, InternalResult, RoutingResult } from "../types/open-next";
2
- import type { AssetResolver } from "../types/overrides";
1
+ import type { InternalEvent, InternalResult, RoutingResult } from "../types/open-next.js";
2
+ import type { AssetResolver } from "../types/overrides.js";
3
3
  export declare const MIDDLEWARE_HEADER_PREFIX = "x-middleware-response-";
4
4
  export declare const MIDDLEWARE_HEADER_PREFIX_LEN: number;
5
5
  export declare const INTERNAL_HEADER_PREFIX = "x-opennext-";
@@ -1,9 +1,9 @@
1
- import { BuildId, ConfigHeaders, NextConfig, PrerenderManifest, RoutesManifest, } from "../adapters/config/index";
1
+ import { BuildId, ConfigHeaders, NextConfig, PrerenderManifest, RoutesManifest, } from "../adapters/config/index.js";
2
2
  import { debug, error } from "../adapters/logger";
3
3
  import { NO_STORE_CACHE_CONTROL } from "../utils/cacheHeaders";
4
4
  import { cacheInterceptor } from "./routing/cacheInterceptor";
5
5
  import { detectLocale } from "./routing/i18n";
6
- import { fixDataPage, getNextConfigHeaders, handleFallbackFalse, handleRedirects, handleRewrites, } from "./routing/matcher";
6
+ import { fixDataPage, getNextConfigHeaders, handleBeforeFilesRewrites, handleFallbackFalse, handleRedirects, handleRewrites, } from "./routing/matcher";
7
7
  import { handleMiddleware } from "./routing/middleware";
8
8
  import { dynamicRouteMatcher, staticRouteMatcher, } from "./routing/routeMatcher";
9
9
  import { constructNextUrl, normalizeLocationHeader } from "./routing/util";
@@ -116,7 +116,7 @@ export default async function routingHandler(event, { assetResolver }) {
116
116
  eventOrResult = middlewareEventOrResult;
117
117
  if (!isExternalRewrite) {
118
118
  // First rewrite to be applied
119
- const beforeRewrite = handleRewrites(eventOrResult, RoutesManifest.rewrites.beforeFiles);
119
+ const beforeRewrite = handleBeforeFilesRewrites(eventOrResult, RoutesManifest.rewrites.beforeFiles);
120
120
  eventOrResult = beforeRewrite.internalEvent;
121
121
  isExternalRewrite = beforeRewrite.isExternalRewrite;
122
122
  // Check for matching public files after `beforeFiles` rewrites
@@ -1,4 +1,4 @@
1
- import type { FunctionOptions, OpenNextConfig, RouteTemplate, SplittedFunctionOptions } from "../types/open-next";
1
+ import type { FunctionOptions, OpenNextConfig, RouteTemplate, SplittedFunctionOptions } from "../types/open-next.js";
2
2
  type CloudflareCompatibleFunction<Placement extends "regional" | "global"> = Placement extends "regional" ? FunctionOptions & {
3
3
  placement: "regional";
4
4
  } : {
@@ -1,4 +1,4 @@
1
- import type { FunctionOptions, OpenNextConfig, RouteTemplate } from "../types/open-next";
1
+ import type { FunctionOptions, OpenNextConfig, RouteTemplate } from "../types/open-next.js";
2
2
  type SSTCompatibleFunction = FunctionOptions & {
3
3
  override?: {
4
4
  wrapper?: "aws-lambda-streaming" | "aws-lambda";
@@ -45,7 +45,7 @@ export declare function withSST<Fn extends Record<string, SSTCompatibleSplittedF
45
45
  middleware?: {
46
46
  external: true;
47
47
  };
48
- dangerous?: import("../types/open-next").DangerousOptions | undefined;
48
+ dangerous?: import("../types/open-next.js").DangerousOptions | undefined;
49
49
  buildCommand?: string | undefined;
50
50
  buildOutputPath?: string | undefined;
51
51
  appPath?: string | undefined;
@@ -2,7 +2,7 @@ import type { IncomingMessage, OutgoingHttpHeader, OutgoingHttpHeaders, ServerRe
2
2
  import type { Socket } from "node:net";
3
3
  import type { TransformCallback } from "node:stream";
4
4
  import { Transform } from "node:stream";
5
- import type { StreamCreator } from "../types/open-next";
5
+ import type { StreamCreator } from "../types/open-next.js";
6
6
  export declare class OpenNextNodeResponse extends Transform implements ServerResponse {
7
7
  private fixHeadersFn;
8
8
  private onEnd;
@@ -1,4 +1,4 @@
1
- import type { AssetResolver } from "../../types/overrides";
1
+ import type { AssetResolver } from "../../types/overrides.js";
2
2
  /**
3
3
  * A dummy asset resolver.
4
4
  *
@@ -1,3 +1,3 @@
1
- import type { Converter } from "../../types/overrides";
1
+ import type { Converter } from "../../types/overrides.js";
2
2
  declare const _default: Converter;
3
3
  export default _default;
@@ -1,4 +1,4 @@
1
- import { fromReadableStream } from "../../utils/stream";
1
+ import { fromReadableStream } from "../../utils/stream.js";
2
2
  import { debug } from "../../adapters/logger";
3
3
  import { extractHostFromHeaders, removeUndefinedFromQuery } from "./utils";
4
4
  function normalizeAPIGatewayProxyEventHeaders(event) {
@@ -1,3 +1,3 @@
1
- import type { Converter } from "../../types/overrides";
1
+ import type { Converter } from "../../types/overrides.js";
2
2
  declare const _default: Converter;
3
3
  export default _default;
@@ -1,5 +1,5 @@
1
- import { parseSetCookieHeader } from "../../http/util";
2
- import { fromReadableStream } from "../../utils/stream";
1
+ import { parseSetCookieHeader } from "../../http/util.js";
2
+ import { fromReadableStream } from "../../utils/stream.js";
3
3
  import { debug } from "../../adapters/logger";
4
4
  import { convertToQuery } from "../../core/routing/util";
5
5
  import { extractHostFromHeaders, removeUndefinedFromQuery } from "./utils";
@@ -1,3 +1,3 @@
1
- import type { Converter } from "../../types/overrides";
1
+ import type { Converter } from "../../types/overrides.js";
2
2
  declare const _default: Converter;
3
3
  export default _default;
@@ -1,5 +1,5 @@
1
- import { parseSetCookieHeader } from "../../http/util";
2
- import { fromReadableStream } from "../../utils/stream";
1
+ import { parseSetCookieHeader } from "../../http/util.js";
2
+ import { fromReadableStream } from "../../utils/stream.js";
3
3
  import { debug } from "../../adapters/logger";
4
4
  import { convertToQuery, convertToQueryString } from "../../core/routing/util";
5
5
  import { extractHostFromHeaders } from "./utils";
@@ -1,4 +1,4 @@
1
- import type { Converter } from "../../types/overrides";
1
+ import type { Converter } from "../../types/overrides.js";
2
2
  type DummyEventOrResult = {
3
3
  type: "dummy";
4
4
  original: any;
@@ -1,5 +1,5 @@
1
- import type { InternalEvent, InternalResult, MiddlewareResult } from "../../types/open-next";
2
- import type { Converter } from "../../types/overrides";
1
+ import type { InternalEvent, InternalResult, MiddlewareResult } from "../../types/open-next.js";
2
+ import type { Converter } from "../../types/overrides.js";
3
3
  declare global {
4
4
  var __dangerous_ON_edge_converter_returns_request: boolean | undefined;
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { Buffer } from "node:buffer";
2
2
  import cookieParser from "cookie";
3
- import { parseSetCookieHeader } from "../../http/util";
3
+ import { parseSetCookieHeader } from "../../http/util.js";
4
4
  import { getQueryFromSearchParams } from "./utils.js";
5
5
  // https://fetch.spec.whatwg.org/#statuses
6
6
  const NULL_BODY_STATUSES = new Set([101, 103, 204, 205, 304]);
@@ -1,3 +1,3 @@
1
- import type { Converter } from "../../types/overrides";
1
+ import type { Converter } from "../../types/overrides.js";
2
2
  declare const converter: Converter;
3
3
  export default converter;
@@ -1,4 +1,4 @@
1
- import type { Converter } from "../../types/overrides";
1
+ import type { Converter } from "../../types/overrides.js";
2
2
  import type { RevalidateEvent } from "../../adapters/revalidate";
3
3
  declare const converter: Converter<RevalidateEvent, RevalidateEvent>;
4
4
  export default converter;
@@ -1,3 +1,3 @@
1
- import type { ImageLoader } from "../../types/overrides";
1
+ import type { ImageLoader } from "../../types/overrides.js";
2
2
  declare const dummyLoader: ImageLoader;
3
3
  export default dummyLoader;
@@ -1,4 +1,4 @@
1
- import { FatalError } from "../../utils/error";
1
+ import { FatalError } from "../../utils/error.js";
2
2
  const dummyLoader = {
3
3
  name: "dummy",
4
4
  load: async (_) => {
@@ -1,7 +1,7 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
- import { NextConfig } from "../../adapters/config/index";
4
- import { getMonorepoRelativePath } from "../../utils/normalize-path";
3
+ import { NextConfig } from "../../adapters/config/index.js";
4
+ import { getMonorepoRelativePath } from "../../utils/normalize-path.js";
5
5
  export default {
6
6
  name: "fs-dev",
7
7
  load: async (url) => {
@@ -1,3 +1,3 @@
1
- import type { ImageLoader } from "../../types/overrides";
1
+ import type { ImageLoader } from "../../types/overrides.js";
2
2
  declare const hostLoader: ImageLoader;
3
3
  export default hostLoader;
@@ -1,5 +1,5 @@
1
1
  import { Readable } from "node:stream";
2
- import { FatalError } from "../../utils/error";
2
+ import { FatalError } from "../../utils/error.js";
3
3
  const hostLoader = {
4
4
  name: "host",
5
5
  load: async (key) => {
@@ -1,3 +1,3 @@
1
- import type { ImageLoader } from "../../types/overrides";
1
+ import type { ImageLoader } from "../../types/overrides.js";
2
2
  declare const s3Loader: ImageLoader;
3
3
  export default s3Loader;
@@ -1,6 +1,6 @@
1
1
  import { Readable } from "node:stream";
2
2
  import { AwsClient } from "aws4fetch";
3
- import { FatalError } from "../../utils/error";
3
+ import { FatalError } from "../../utils/error.js";
4
4
  let awsClient = null;
5
5
  const { BUCKET_NAME, BUCKET_KEY_PREFIX } = process.env;
6
6
  // https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime
@@ -1,3 +1,3 @@
1
- import type { ImageLoader } from "../../types/overrides";
1
+ import type { ImageLoader } from "../../types/overrides.js";
2
2
  declare const s3Loader: ImageLoader;
3
3
  export default s3Loader;
@@ -1,5 +1,5 @@
1
1
  import { GetObjectCommand, S3Client } from "@aws-sdk/client-s3";
2
- import { FatalError } from "../../utils/error";
2
+ import { FatalError } from "../../utils/error.js";
3
3
  import { awsLogger } from "../../adapters/logger";
4
4
  const { BUCKET_NAME, BUCKET_KEY_PREFIX } = process.env;
5
5
  function ensureBucketExists() {
@@ -1,3 +1,3 @@
1
- import type { IncrementalCache } from "../../types/overrides";
1
+ import type { IncrementalCache } from "../../types/overrides.js";
2
2
  declare const dummyIncrementalCache: IncrementalCache;
3
3
  export default dummyIncrementalCache;
@@ -1,4 +1,4 @@
1
- import { IgnorableError } from "../../utils/error";
1
+ import { IgnorableError } from "../../utils/error.js";
2
2
  const dummyIncrementalCache = {
3
3
  name: "dummy",
4
4
  get: async () => {
@@ -1,6 +1,6 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { getMonorepoRelativePath } from "../../utils/normalize-path";
3
+ import { getMonorepoRelativePath } from "../../utils/normalize-path.js";
4
4
  const buildId = process.env.OPEN_NEXT_BUILD_ID;
5
5
  const basePath = path.join(getMonorepoRelativePath(), "cache");
6
6
  /**
@@ -1,4 +1,4 @@
1
- import type { IncrementalCache } from "../../types/overrides";
1
+ import type { IncrementalCache } from "../../types/overrides.js";
2
2
  /**
3
3
  * This cache implementation uses a multi-tier cache with a local cache, a DynamoDB metadata cache and an S3 cache.
4
4
  * It uses the same DynamoDB table as the default tag cache and the same S3 bucket as the default incremental cache.
@@ -1,5 +1,5 @@
1
- import { customFetchClient } from "../../utils/fetch";
2
- import { LRUCache } from "../../utils/lru";
1
+ import { customFetchClient } from "../../utils/fetch.js";
2
+ import { LRUCache } from "../../utils/lru.js";
3
3
  import { debug } from "../../adapters/logger";
4
4
  import S3Cache, { getAwsClient } from "./s3-lite";
5
5
  // TTL for the local cache in milliseconds
@@ -1,5 +1,5 @@
1
1
  import { AwsClient } from "aws4fetch";
2
- import type { IncrementalCache } from "../../types/overrides";
2
+ import type { IncrementalCache } from "../../types/overrides.js";
3
3
  export declare const getAwsClient: () => AwsClient;
4
4
  declare const incrementalCache: IncrementalCache;
5
5
  export default incrementalCache;
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
2
  import path from "node:path";
3
3
  import { AwsClient } from "aws4fetch";
4
- import { IgnorableError, RecoverableError } from "../../utils/error";
5
- import { customFetchClient } from "../../utils/fetch";
4
+ import { IgnorableError, RecoverableError } from "../../utils/error.js";
5
+ import { customFetchClient } from "../../utils/fetch.js";
6
6
  import { parseNumberFromEnv } from "../../adapters/util";
7
7
  let awsClient = null;
8
8
  export const getAwsClient = () => {
@@ -1,3 +1,3 @@
1
- import type { IncrementalCache } from "../../types/overrides";
1
+ import type { IncrementalCache } from "../../types/overrides.js";
2
2
  declare const incrementalCache: IncrementalCache;
3
3
  export default incrementalCache;
@@ -1,3 +1,3 @@
1
- import type { OriginResolver } from "../../types/overrides";
1
+ import type { OriginResolver } from "../../types/overrides.js";
2
2
  declare const dummyOriginResolver: OriginResolver;
3
3
  export default dummyOriginResolver;
@@ -1,3 +1,3 @@
1
- import type { OriginResolver } from "../../types/overrides";
1
+ import type { OriginResolver } from "../../types/overrides.js";
2
2
  declare const envLoader: OriginResolver;
3
3
  export default envLoader;
@@ -1,3 +1,3 @@
1
- import type { ProxyExternalRequest } from "../../types/overrides";
1
+ import type { ProxyExternalRequest } from "../../types/overrides.js";
2
2
  declare const DummyProxyExternalRequest: ProxyExternalRequest;
3
3
  export default DummyProxyExternalRequest;
@@ -1,4 +1,4 @@
1
- import { FatalError } from "../../utils/error";
1
+ import { FatalError } from "../../utils/error.js";
2
2
  const DummyProxyExternalRequest = {
3
3
  name: "dummy",
4
4
  proxy: async (_event) => {
@@ -1,3 +1,3 @@
1
- import type { ProxyExternalRequest } from "../../types/overrides";
1
+ import type { ProxyExternalRequest } from "../../types/overrides.js";
2
2
  declare const fetchProxy: ProxyExternalRequest;
3
3
  export default fetchProxy;
@@ -1,4 +1,4 @@
1
- import { emptyReadableStream } from "../../utils/stream";
1
+ import { emptyReadableStream } from "../../utils/stream.js";
2
2
  const fetchProxy = {
3
3
  name: "fetch-proxy",
4
4
  // @ts-ignore
@@ -1,3 +1,3 @@
1
- import type { ProxyExternalRequest } from "../../types/overrides";
1
+ import type { ProxyExternalRequest } from "../../types/overrides.js";
2
2
  declare const nodeProxy: ProxyExternalRequest;
3
3
  export default nodeProxy;
@@ -1,3 +1,3 @@
1
- import type { Queue } from "../../types/overrides";
1
+ import type { Queue } from "../../types/overrides.js";
2
2
  declare const dummyQueue: Queue;
3
3
  export default dummyQueue;
@@ -1,4 +1,4 @@
1
- import { FatalError } from "../../utils/error";
1
+ import { FatalError } from "../../utils/error.js";
2
2
  const dummyQueue = {
3
3
  name: "dummy",
4
4
  send: async () => {
@@ -1,3 +1,3 @@
1
- import type { Queue } from "../../types/overrides";
1
+ import type { Queue } from "../../types/overrides.js";
2
2
  declare const queue: Queue;
3
3
  export default queue;
@@ -1,6 +1,6 @@
1
1
  import { AwsClient } from "aws4fetch";
2
- import { RecoverableError } from "../../utils/error";
3
- import { customFetchClient } from "../../utils/fetch";
2
+ import { RecoverableError } from "../../utils/error.js";
3
+ import { customFetchClient } from "../../utils/fetch.js";
4
4
  import { error } from "../../adapters/logger";
5
5
  let awsClient = null;
6
6
  const getAwsClient = () => {
@@ -1,3 +1,3 @@
1
- import type { Queue } from "../../types/overrides";
1
+ import type { Queue } from "../../types/overrides.js";
2
2
  declare const queue: Queue;
3
3
  export default queue;
@@ -1,3 +1,3 @@
1
- import type { TagCache } from "../../types/overrides";
1
+ import type { TagCache } from "../../types/overrides.js";
2
2
  declare const dummyTagCache: TagCache;
3
3
  export default dummyTagCache;
@@ -1,3 +1,3 @@
1
- import type { TagCache } from "../../types/overrides";
1
+ import type { TagCache } from "../../types/overrides.js";
2
2
  declare const tagCache: TagCache;
3
3
  export default tagCache;
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable @typescript-eslint/no-non-null-assertion */
2
2
  import path from "node:path";
3
3
  import { AwsClient } from "aws4fetch";
4
- import { RecoverableError } from "../../utils/error";
5
- import { customFetchClient } from "../../utils/fetch";
4
+ import { RecoverableError } from "../../utils/error.js";
5
+ import { customFetchClient } from "../../utils/fetch.js";
6
6
  import { debug, error } from "../../adapters/logger";
7
7
  import { chunk, parseNumberFromEnv } from "../../adapters/util";
8
8
  import { MAX_DYNAMO_BATCH_WRITE_ITEM_COUNT, getDynamoBatchWriteCommandConcurrency, } from "./constants";
@@ -4,6 +4,6 @@ declare const _default: {
4
4
  getLastRevalidated: (tags: string[]) => Promise<number>;
5
5
  hasBeenRevalidated: (tags: string[], lastModified?: number) => Promise<boolean>;
6
6
  isStale: (tags: string[], lastModified?: number) => Promise<boolean>;
7
- writeTags: (tags: import("../../types/overrides").NextModeTagCacheWriteInput[]) => Promise<void>;
7
+ writeTags: (tags: import("../../types/overrides.js").NextModeTagCacheWriteInput[]) => Promise<void>;
8
8
  };
9
9
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { AwsClient } from "aws4fetch";
2
- import { RecoverableError } from "../../utils/error";
3
- import { customFetchClient } from "../../utils/fetch";
2
+ import { RecoverableError } from "../../utils/error.js";
3
+ import { customFetchClient } from "../../utils/fetch.js";
4
4
  import path from "node:path";
5
5
  import { debug, error } from "../../adapters/logger";
6
6
  import { chunk, parseNumberFromEnv } from "../../adapters/util";
@@ -1,3 +1,3 @@
1
- import type { TagCache } from "../../types/overrides";
1
+ import type { TagCache } from "../../types/overrides.js";
2
2
  declare const tagCache: TagCache;
3
3
  export default tagCache;
@@ -4,6 +4,6 @@ declare const _default: {
4
4
  getLastRevalidated: (tags: string[]) => Promise<number>;
5
5
  hasBeenRevalidated: (tags: string[], lastModified?: number) => Promise<boolean>;
6
6
  isStale: (tags: string[], lastModified?: number) => Promise<boolean>;
7
- writeTags: (tags: import("../../types/overrides").NextModeTagCacheWriteInput[]) => Promise<void>;
7
+ writeTags: (tags: import("../../types/overrides.js").NextModeTagCacheWriteInput[]) => Promise<void>;
8
8
  };
9
9
  export default _default;
@@ -1,3 +1,3 @@
1
- import type { TagCache } from "../../types/overrides";
1
+ import type { TagCache } from "../../types/overrides.js";
2
2
  declare const tagCache: TagCache;
3
3
  export default tagCache;
@@ -1,6 +1,6 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
- import { getMonorepoRelativePath } from "../../utils/normalize-path";
3
+ import { getMonorepoRelativePath } from "../../utils/normalize-path.js";
4
4
  const tagFile = path.join(getMonorepoRelativePath(), "dynamodb-provider/dynamodb-cache.json");
5
5
  const tagContent = fs.readFileSync(tagFile, "utf-8");
6
6
  let tags = JSON.parse(tagContent);
@@ -1,3 +1,3 @@
1
- import type { Warmer } from "../../types/overrides";
1
+ import type { Warmer } from "../../types/overrides.js";
2
2
  declare const lambdaWarmerInvoke: Warmer;
3
3
  export default lambdaWarmerInvoke;
@@ -1,3 +1,3 @@
1
- import type { Warmer } from "../../types/overrides";
1
+ import type { Warmer } from "../../types/overrides.js";
2
2
  declare const dummyWarmer: Warmer;
3
3
  export default dummyWarmer;
@@ -1,4 +1,4 @@
1
- import { FatalError } from "../../utils/error";
1
+ import { FatalError } from "../../utils/error.js";
2
2
  const dummyWarmer = {
3
3
  name: "dummy",
4
4
  invoke: async (_) => {
@@ -1,4 +1,4 @@
1
- import type { WrapperHandler } from "../../types/overrides";
1
+ import type { WrapperHandler } from "../../types/overrides.js";
2
2
  declare const _default: {
3
3
  wrapper: WrapperHandler;
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import type { WrapperHandler } from "../../types/overrides";
1
+ import type { WrapperHandler } from "../../types/overrides.js";
2
2
  declare const _default: {
3
3
  wrapper: WrapperHandler;
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import type { WrapperHandler } from "../../types/overrides";
1
+ import type { WrapperHandler } from "../../types/overrides.js";
2
2
  declare const _default: {
3
3
  wrapper: WrapperHandler;
4
4
  name: string;
@@ -1,4 +1,4 @@
1
- import type { WrapperHandler } from "../../types/overrides";
1
+ import type { WrapperHandler } from "../../types/overrides.js";
2
2
  import type { WarmerEvent, WarmerResponse } from "../../adapters/warmer-function";
3
3
  export declare function formatWarmerResponse(event: WarmerEvent): Promise<WarmerResponse>;
4
4
  declare const _default: {