@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.
- package/dist/adapters/cache.d.ts +1 -1
- package/dist/adapters/cache.js +7 -6
- package/dist/adapters/composable-cache.d.ts +1 -1
- package/dist/adapters/composable-cache.js +2 -2
- package/dist/adapters/config/util.d.ts +10 -10
- package/dist/adapters/edge-adapter.js +2 -2
- package/dist/adapters/middleware.js +2 -2
- package/dist/build/copyTracedFiles.js +6 -2
- package/dist/build/edge/createEdgeBundle.d.ts +2 -2
- package/dist/build/installDeps.d.ts +1 -1
- package/dist/build/validateConfig.d.ts +1 -1
- package/dist/core/createGenericHandler.d.ts +2 -2
- package/dist/core/edgeFunctionHandler.d.ts +1 -1
- package/dist/core/nodeMiddlewareHandler.d.ts +1 -1
- package/dist/core/requestHandler.d.ts +2 -2
- package/dist/core/requestHandler.js +15 -7
- package/dist/core/resolve.d.ts +10 -10
- package/dist/core/routing/cacheInterceptor.d.ts +1 -1
- package/dist/core/routing/cacheInterceptor.js +6 -6
- package/dist/core/routing/i18n/index.d.ts +2 -2
- package/dist/core/routing/matcher.d.ts +61 -6
- package/dist/core/routing/matcher.js +283 -55
- package/dist/core/routing/middleware.d.ts +8 -4
- package/dist/core/routing/middleware.js +29 -12
- package/dist/core/routing/routeMatcher.d.ts +1 -1
- package/dist/core/routing/routeMatcher.js +1 -1
- package/dist/core/routing/util.d.ts +20 -4
- package/dist/core/routing/util.js +32 -15
- package/dist/core/routingHandler.d.ts +2 -2
- package/dist/core/routingHandler.js +3 -3
- package/dist/helpers/withCloudflare.d.ts +1 -1
- package/dist/helpers/withSST.d.ts +2 -2
- package/dist/http/openNextResponse.d.ts +1 -1
- package/dist/overrides/assetResolver/dummy.d.ts +1 -1
- package/dist/overrides/converters/aws-apigw-v1.d.ts +1 -1
- package/dist/overrides/converters/aws-apigw-v1.js +1 -1
- package/dist/overrides/converters/aws-apigw-v2.d.ts +1 -1
- package/dist/overrides/converters/aws-apigw-v2.js +2 -2
- package/dist/overrides/converters/aws-cloudfront.d.ts +1 -1
- package/dist/overrides/converters/aws-cloudfront.js +2 -2
- package/dist/overrides/converters/dummy.d.ts +1 -1
- package/dist/overrides/converters/edge.d.ts +2 -2
- package/dist/overrides/converters/edge.js +1 -1
- package/dist/overrides/converters/node.d.ts +1 -1
- package/dist/overrides/converters/sqs-revalidate.d.ts +1 -1
- package/dist/overrides/imageLoader/dummy.d.ts +1 -1
- package/dist/overrides/imageLoader/dummy.js +1 -1
- package/dist/overrides/imageLoader/fs-dev.js +2 -2
- package/dist/overrides/imageLoader/host.d.ts +1 -1
- package/dist/overrides/imageLoader/host.js +1 -1
- package/dist/overrides/imageLoader/s3-lite.d.ts +1 -1
- package/dist/overrides/imageLoader/s3-lite.js +1 -1
- package/dist/overrides/imageLoader/s3.d.ts +1 -1
- package/dist/overrides/imageLoader/s3.js +1 -1
- package/dist/overrides/incrementalCache/dummy.d.ts +1 -1
- package/dist/overrides/incrementalCache/dummy.js +1 -1
- package/dist/overrides/incrementalCache/fs-dev.js +1 -1
- package/dist/overrides/incrementalCache/multi-tier-ddb-s3.d.ts +1 -1
- package/dist/overrides/incrementalCache/multi-tier-ddb-s3.js +2 -2
- package/dist/overrides/incrementalCache/s3-lite.d.ts +1 -1
- package/dist/overrides/incrementalCache/s3-lite.js +2 -2
- package/dist/overrides/incrementalCache/s3.d.ts +1 -1
- package/dist/overrides/originResolver/dummy.d.ts +1 -1
- package/dist/overrides/originResolver/pattern-env.d.ts +1 -1
- package/dist/overrides/proxyExternalRequest/dummy.d.ts +1 -1
- package/dist/overrides/proxyExternalRequest/dummy.js +1 -1
- package/dist/overrides/proxyExternalRequest/fetch.d.ts +1 -1
- package/dist/overrides/proxyExternalRequest/fetch.js +1 -1
- package/dist/overrides/proxyExternalRequest/node.d.ts +1 -1
- package/dist/overrides/queue/dummy.d.ts +1 -1
- package/dist/overrides/queue/dummy.js +1 -1
- package/dist/overrides/queue/sqs-lite.d.ts +1 -1
- package/dist/overrides/queue/sqs-lite.js +2 -2
- package/dist/overrides/queue/sqs.d.ts +1 -1
- package/dist/overrides/tagCache/dummy.d.ts +1 -1
- package/dist/overrides/tagCache/dynamodb-lite.d.ts +1 -1
- package/dist/overrides/tagCache/dynamodb-lite.js +2 -2
- package/dist/overrides/tagCache/dynamodb-nextMode.d.ts +1 -1
- package/dist/overrides/tagCache/dynamodb-nextMode.js +2 -2
- package/dist/overrides/tagCache/dynamodb.d.ts +1 -1
- package/dist/overrides/tagCache/fs-dev-nextMode.d.ts +1 -1
- package/dist/overrides/tagCache/fs-dev.d.ts +1 -1
- package/dist/overrides/tagCache/fs-dev.js +1 -1
- package/dist/overrides/warmer/aws-lambda.d.ts +1 -1
- package/dist/overrides/warmer/dummy.d.ts +1 -1
- package/dist/overrides/warmer/dummy.js +1 -1
- package/dist/overrides/wrappers/aws-apigw-streaming.d.ts +1 -1
- package/dist/overrides/wrappers/aws-lambda-compressed.d.ts +1 -1
- package/dist/overrides/wrappers/aws-lambda-streaming.d.ts +1 -1
- package/dist/overrides/wrappers/aws-lambda.d.ts +1 -1
- package/dist/overrides/wrappers/cloudflare-edge.d.ts +2 -2
- package/dist/overrides/wrappers/cloudflare-node.d.ts +2 -2
- package/dist/overrides/wrappers/dummy.d.ts +1 -1
- package/dist/overrides/wrappers/express-dev.js +2 -2
- package/dist/overrides/wrappers/node.d.ts +1 -1
- package/dist/plugins/resolve.d.ts +2 -2
- package/dist/types/global.d.ts +1 -1
- package/dist/types/overrides.d.ts +1 -1
- package/dist/utils/cache.d.ts +1 -1
- package/dist/utils/promise.d.ts +1 -1
- 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
|
-
|
|
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
|
|
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 =
|
|
73
|
+
const match = urlWithoutHash.match(regex);
|
|
61
74
|
return {
|
|
62
75
|
hostname: "",
|
|
63
|
-
pathname:
|
|
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 =
|
|
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
|
-
*
|
|
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
|
|
148
|
+
const searchParams = new URLSearchParams();
|
|
133
149
|
Object.entries(query).forEach(([key, value]) => {
|
|
134
150
|
if (Array.isArray(value)) {
|
|
135
|
-
value.forEach((entry) =>
|
|
151
|
+
value.forEach((entry) => searchParams.append(key, entry));
|
|
136
152
|
}
|
|
137
153
|
else {
|
|
138
|
-
|
|
154
|
+
searchParams.append(key, value);
|
|
139
155
|
}
|
|
140
156
|
});
|
|
141
|
-
|
|
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 =
|
|
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 { 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,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,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,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,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,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,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,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,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,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,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";
|
|
@@ -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 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,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: {
|