@jaypie/constructs 1.2.24 → 1.2.26
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/cjs/JaypieNextJs.d.ts +11 -6
- package/dist/cjs/__tests__/JaypieApiGateway.spec.d.ts +1 -0
- package/dist/cjs/index.cjs +9 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/JaypieNextJs.d.ts +11 -6
- package/dist/esm/__tests__/JaypieApiGateway.spec.d.ts +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -26,12 +26,6 @@ export interface JaypieNextjsProps {
|
|
|
26
26
|
* This overrides any domainName configuration.
|
|
27
27
|
*/
|
|
28
28
|
domainProps?: false;
|
|
29
|
-
/**
|
|
30
|
-
* DynamoDB tables to grant read/write access to the Next.js server function.
|
|
31
|
-
* Each table is granted read/write access and if exactly one table is provided,
|
|
32
|
-
* the DYNAMODB_TABLE_NAME environment variable is set to the table name.
|
|
33
|
-
*/
|
|
34
|
-
tables?: dynamodb.ITable[];
|
|
35
29
|
/**
|
|
36
30
|
* Environment variables for the Next.js application.
|
|
37
31
|
*
|
|
@@ -56,6 +50,17 @@ export interface JaypieNextjsProps {
|
|
|
56
50
|
* (reuses existing secrets within the same scope)
|
|
57
51
|
*/
|
|
58
52
|
secrets?: SecretsArrayItem[];
|
|
53
|
+
/**
|
|
54
|
+
* Enable response streaming for the Next.js server function.
|
|
55
|
+
* When true, enables Lambda response streaming for faster TTFB.
|
|
56
|
+
*/
|
|
57
|
+
streaming?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* DynamoDB tables to grant read/write access to the Next.js server function.
|
|
60
|
+
* Each table is granted read/write access and if exactly one table is provided,
|
|
61
|
+
* the DYNAMODB_TABLE_NAME environment variable is set to the table name.
|
|
62
|
+
*/
|
|
63
|
+
tables?: dynamodb.ITable[];
|
|
59
64
|
}
|
|
60
65
|
export declare class JaypieNextJs extends Construct {
|
|
61
66
|
private readonly _nextjs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1168,6 +1168,10 @@ class JaypieApiGateway extends constructs.Construct {
|
|
|
1168
1168
|
process.env.CDK_ENV_API_HOSTED_ZONE) {
|
|
1169
1169
|
host = mergeDomain(process.env.CDK_ENV_API_SUBDOMAIN, process.env.CDK_ENV_API_HOSTED_ZONE);
|
|
1170
1170
|
}
|
|
1171
|
+
// Set PROJECT_BASE_URL on the Lambda if host is resolved and handler supports it
|
|
1172
|
+
if (host && "addEnvironment" in handler) {
|
|
1173
|
+
handler.addEnvironment("PROJECT_BASE_URL", `https://${host}`);
|
|
1174
|
+
}
|
|
1171
1175
|
const apiGatewayName = name || constructEnvName("ApiGateway");
|
|
1172
1176
|
const apiDomainName = constructEnvName("ApiDomainName");
|
|
1173
1177
|
let hostedZone;
|
|
@@ -2437,6 +2441,10 @@ class JaypieDistribution extends constructs.Construct {
|
|
|
2437
2441
|
else if (this.isIOrigin(handler)) {
|
|
2438
2442
|
origin = handler;
|
|
2439
2443
|
}
|
|
2444
|
+
// Set PROJECT_BASE_URL on the Lambda if host is resolved and handler supports it
|
|
2445
|
+
if (host && this.isIFunction(handler) && "addEnvironment" in handler) {
|
|
2446
|
+
handler.addEnvironment("PROJECT_BASE_URL", `https://${host}`);
|
|
2447
|
+
}
|
|
2440
2448
|
}
|
|
2441
2449
|
// Build default behavior
|
|
2442
2450
|
let defaultBehavior;
|
|
@@ -3282,6 +3290,7 @@ class JaypieNextJs extends constructs.Construct {
|
|
|
3282
3290
|
}),
|
|
3283
3291
|
},
|
|
3284
3292
|
}),
|
|
3293
|
+
...(props?.streaming && { streaming: true }),
|
|
3285
3294
|
environment: {
|
|
3286
3295
|
...jaypieLambdaEnv(),
|
|
3287
3296
|
...environment,
|