sst 2.26.2 → 2.26.4
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/cli/commands/types.js +3 -7
- package/constructs/Api.js +2 -0
- package/constructs/ApiGatewayV1Api.js +2 -0
- package/constructs/App.d.ts +3 -1
- package/constructs/App.js +63 -62
- package/constructs/AppSyncApi.js +2 -0
- package/constructs/AstroSite.d.ts +50 -11
- package/constructs/AstroSite.js +69 -51
- package/constructs/Auth.js +2 -0
- package/constructs/Bucket.js +2 -0
- package/constructs/Cognito.js +2 -0
- package/constructs/Cron.js +2 -0
- package/constructs/EdgeFunction.d.ts +3 -4
- package/constructs/EdgeFunction.js +13 -9
- package/constructs/EventBus.js +2 -0
- package/constructs/Function.d.ts +5 -1
- package/constructs/Function.js +8 -6
- package/constructs/Job.js +3 -3
- package/constructs/KinesisStream.js +2 -0
- package/constructs/NextjsSite.d.ts +84 -22
- package/constructs/NextjsSite.js +150 -254
- package/constructs/Parameter.js +2 -0
- package/constructs/Queue.js +2 -0
- package/constructs/RDS.js +5 -4
- package/constructs/RemixSite.d.ts +65 -11
- package/constructs/RemixSite.js +112 -71
- package/constructs/Script.js +2 -0
- package/constructs/Secret.js +2 -0
- package/constructs/Service.js +4 -3
- package/constructs/SolidStartSite.d.ts +48 -9
- package/constructs/SolidStartSite.js +68 -40
- package/constructs/SsrFunction.d.ts +4 -5
- package/constructs/SsrFunction.js +18 -13
- package/constructs/SsrSite.d.ts +74 -68
- package/constructs/SsrSite.js +657 -682
- package/constructs/StaticSite.js +2 -0
- package/constructs/SvelteKitSite.d.ts +80 -12
- package/constructs/SvelteKitSite.js +90 -64
- package/constructs/Table.js +2 -0
- package/constructs/Topic.js +2 -0
- package/constructs/WebSocketApi.js +2 -0
- package/constructs/deprecated/NextjsSite.js +1 -0
- package/constructs/future/Auth.js +1 -0
- package/package.json +1 -1
- package/support/remix-site-function/edge-server.js +2 -4
- package/support/remix-site-function/regional-server.js +2 -4
package/constructs/SsrSite.d.ts
CHANGED
|
@@ -1,28 +1,44 @@
|
|
|
1
1
|
import { Construct } from "constructs";
|
|
2
2
|
import { Bucket, BucketProps, IBucket } from "aws-cdk-lib/aws-s3";
|
|
3
|
-
import { FunctionProps as CdkFunctionProps } from "aws-cdk-lib/aws-lambda";
|
|
4
|
-
import { ICachePolicy, IResponseHeadersPolicy,
|
|
5
|
-
import {
|
|
3
|
+
import { Function as CdkFunction, FunctionProps as CdkFunctionProps } from "aws-cdk-lib/aws-lambda";
|
|
4
|
+
import { ICachePolicy, IResponseHeadersPolicy, IDistribution } from "aws-cdk-lib/aws-cloudfront";
|
|
5
|
+
import { DistributionDomainProps } from "./Distribution.js";
|
|
6
6
|
import { SSTConstruct } from "./Construct.js";
|
|
7
7
|
import { NodeJSProps, FunctionProps } from "./Function.js";
|
|
8
|
-
import { SsrFunction } from "./SsrFunction.js";
|
|
9
|
-
import { EdgeFunction } from "./EdgeFunction.js";
|
|
8
|
+
import { SsrFunction, SsrFunctionProps } from "./SsrFunction.js";
|
|
9
|
+
import { EdgeFunction, EdgeFunctionProps } from "./EdgeFunction.js";
|
|
10
10
|
import { BaseSiteFileOptions, BaseSiteReplaceProps, BaseSiteCdkDistributionProps } from "./BaseSite.js";
|
|
11
11
|
import { Size } from "./util/size.js";
|
|
12
12
|
import { Duration } from "./util/duration.js";
|
|
13
13
|
import { Permissions } from "./util/permission.js";
|
|
14
14
|
import { FunctionBindingProps } from "./util/functionBinding.js";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
type CloudFrontFunctionConfig = {
|
|
16
|
+
constructId: string;
|
|
17
|
+
injections: string[];
|
|
18
|
+
};
|
|
19
|
+
type EdgeFunctionConfig = {
|
|
20
|
+
constructId: string;
|
|
21
|
+
function: EdgeFunctionProps;
|
|
22
|
+
};
|
|
23
|
+
type FunctionOriginConfig = {
|
|
24
|
+
type: "function";
|
|
25
|
+
constructId: string;
|
|
26
|
+
function: SsrFunctionProps;
|
|
27
|
+
streaming?: boolean;
|
|
28
|
+
};
|
|
29
|
+
type ImageOptimizationFunctionOriginConfig = {
|
|
30
|
+
type: "image-optimization-function";
|
|
31
|
+
function: CdkFunctionProps;
|
|
32
|
+
};
|
|
33
|
+
type S3OriginConfig = {
|
|
34
|
+
type: "s3";
|
|
35
|
+
originPath?: string;
|
|
36
|
+
copy: {
|
|
37
|
+
from: string;
|
|
38
|
+
to: string;
|
|
39
|
+
cached: boolean;
|
|
40
|
+
versionedSubDir?: string;
|
|
41
|
+
}[];
|
|
26
42
|
};
|
|
27
43
|
export interface SsrSiteNodeJSProps extends NodeJSProps {
|
|
28
44
|
}
|
|
@@ -184,7 +200,7 @@ export interface SsrSiteProps {
|
|
|
184
200
|
*/
|
|
185
201
|
id?: string;
|
|
186
202
|
/**
|
|
187
|
-
* Allows you to override default settings this construct uses internally to
|
|
203
|
+
* Allows you to override default settings this construct uses internally to create the bucket
|
|
188
204
|
*/
|
|
189
205
|
bucket?: BucketProps | IBucket;
|
|
190
206
|
/**
|
|
@@ -298,20 +314,12 @@ export declare abstract class SsrSite extends Construct implements SSTConstruct
|
|
|
298
314
|
readonly id: string;
|
|
299
315
|
protected props: SsrSiteNormalizedProps;
|
|
300
316
|
protected doNotDeploy: boolean;
|
|
301
|
-
protected
|
|
302
|
-
protected deferredTaskCallbacks: (() => void)[];
|
|
303
|
-
protected serverLambdaForEdge?: EdgeFunction;
|
|
304
|
-
protected serverLambdaForRegional?: SsrFunction;
|
|
305
|
-
private serverLambdaForDev?;
|
|
306
|
-
private serverUrlSigningFunction?;
|
|
317
|
+
protected typesPath: string;
|
|
307
318
|
protected bucket: Bucket;
|
|
308
|
-
|
|
309
|
-
private
|
|
310
|
-
private serverBehaviorOriginRequestPolicy?;
|
|
311
|
-
private staticCfFunction?;
|
|
312
|
-
private s3Origin;
|
|
319
|
+
protected serverFunction?: EdgeFunction | SsrFunction;
|
|
320
|
+
private serverFunctionForDev?;
|
|
313
321
|
private distribution;
|
|
314
|
-
constructor(scope: Construct, id: string,
|
|
322
|
+
constructor(scope: Construct, id: string, rawProps?: SsrSiteProps);
|
|
315
323
|
/**
|
|
316
324
|
* The CloudFront URL of the website.
|
|
317
325
|
*/
|
|
@@ -325,9 +333,9 @@ export declare abstract class SsrSite extends Construct implements SSTConstruct
|
|
|
325
333
|
* The internally created CDK resources.
|
|
326
334
|
*/
|
|
327
335
|
get cdk(): {
|
|
328
|
-
function: import("aws-cdk-lib/aws-lambda").IFunction | undefined;
|
|
336
|
+
function: import("aws-cdk-lib/aws-lambda").IFunction | CdkFunction | undefined;
|
|
329
337
|
bucket: Bucket;
|
|
330
|
-
distribution:
|
|
338
|
+
distribution: IDistribution;
|
|
331
339
|
hostedZone: import("aws-cdk-lib/aws-route53").IHostedZone | undefined;
|
|
332
340
|
certificate: import("aws-cdk-lib/aws-certificatemanager").ICertificate | undefined;
|
|
333
341
|
} | undefined;
|
|
@@ -357,43 +365,41 @@ export declare abstract class SsrSite extends Construct implements SSTConstruct
|
|
|
357
365
|
abstract getConstructMetadata(): ReturnType<SSTConstruct["getConstructMetadata"]>;
|
|
358
366
|
/** @internal */
|
|
359
367
|
getFunctionBinding(): FunctionBindingProps;
|
|
360
|
-
protected
|
|
361
|
-
|
|
362
|
-
protected
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
protected generateBuildId(): string;
|
|
396
|
-
protected supportsStreaming(): boolean;
|
|
368
|
+
protected useCloudFrontFunctionHostHeaderInjection(): string;
|
|
369
|
+
protected abstract plan(bucket: Bucket): ReturnType<typeof this.validatePlan>;
|
|
370
|
+
protected validatePlan<CloudFrontFunctions extends Record<string, CloudFrontFunctionConfig>, EdgeFunctions extends Record<string, EdgeFunctionConfig>, Origins extends Record<string, FunctionOriginConfig | ImageOptimizationFunctionOriginConfig | S3OriginConfig>>(input: {
|
|
371
|
+
cloudFrontFunctions?: CloudFrontFunctions;
|
|
372
|
+
edgeFunctions?: EdgeFunctions;
|
|
373
|
+
origins: Origins;
|
|
374
|
+
behaviors: {
|
|
375
|
+
cacheType: "server" | "static";
|
|
376
|
+
pattern?: string;
|
|
377
|
+
origin: keyof Origins;
|
|
378
|
+
cfFunction?: keyof CloudFrontFunctions;
|
|
379
|
+
edgeFunction?: keyof EdgeFunctions;
|
|
380
|
+
}[];
|
|
381
|
+
cachePolicyAllowedHeaders?: string[];
|
|
382
|
+
buildId?: string;
|
|
383
|
+
warmerConfig?: {
|
|
384
|
+
function: string;
|
|
385
|
+
};
|
|
386
|
+
}): {
|
|
387
|
+
cloudFrontFunctions?: CloudFrontFunctions | undefined;
|
|
388
|
+
edgeFunctions?: EdgeFunctions | undefined;
|
|
389
|
+
origins: Origins;
|
|
390
|
+
behaviors: {
|
|
391
|
+
cacheType: "server" | "static";
|
|
392
|
+
pattern?: string;
|
|
393
|
+
origin: keyof Origins;
|
|
394
|
+
cfFunction?: keyof CloudFrontFunctions;
|
|
395
|
+
edgeFunction?: keyof EdgeFunctions;
|
|
396
|
+
}[];
|
|
397
|
+
cachePolicyAllowedHeaders?: string[] | undefined;
|
|
398
|
+
buildId?: string | undefined;
|
|
399
|
+
warmerConfig?: {
|
|
400
|
+
function: string;
|
|
401
|
+
} | undefined;
|
|
402
|
+
};
|
|
397
403
|
}
|
|
398
404
|
export declare const useSites: () => {
|
|
399
405
|
add(stack: string, name: string, type: string, props: SsrSiteNormalizedProps): void;
|