sst 2.24.26 → 2.24.28

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.
@@ -25,6 +25,34 @@ export interface NextjsSiteProps extends Omit<SsrSiteProps, "nodejs"> {
25
25
  warm?: number;
26
26
  cdk?: SsrSiteProps["cdk"] & {
27
27
  revalidation?: Pick<FunctionProps, "vpc" | "vpcSubnets">;
28
+ /**
29
+ * Override the CloudFront cache policy properties for responses from the
30
+ * server rendering Lambda.
31
+ *
32
+ * @default
33
+ * By default, the cache policy is configured to cache all responses from
34
+ * the server rendering Lambda based on the query-key only. If you're using
35
+ * cookie or header based authentication, you'll need to override the
36
+ * cache policy to cache based on those values as well.
37
+ *
38
+ * ```js
39
+ * serverCachePolicy: new CachePolicy(this, "ServerCache", {
40
+ * queryStringBehavior: CacheQueryStringBehavior.all()
41
+ * headerBehavior: CacheHeaderBehavior.allowList(
42
+ * "accept",
43
+ * "rsc",
44
+ * "next-router-prefetch",
45
+ * "next-router-state-tree",
46
+ * "next-url",
47
+ * ),
48
+ * cookieBehavior: CacheCookieBehavior.none()
49
+ * defaultTtl: Duration.days(0)
50
+ * maxTtl: Duration.days(365)
51
+ * minTtl: Duration.days(0)
52
+ * })
53
+ * ```
54
+ */
55
+ serverCachePolicy?: NonNullable<SsrSiteProps["cdk"]>["serverCachePolicy"];
28
56
  };
29
57
  }
30
58
  /**
@@ -190,8 +190,22 @@ export interface SsrSiteProps {
190
190
  * Override the CloudFront cache policy properties for responses from the
191
191
  * server rendering Lambda.
192
192
  *
193
- * @note The default cache policy that is used in the abscene of this property
194
- * is one that performs no caching of the server response.
193
+ * @default
194
+ * By default, the cache policy is configured to cache all responses from
195
+ * the server rendering Lambda based on the query-key only. If you're using
196
+ * cookie or header based authentication, you'll need to override the
197
+ * cache policy to cache based on those values as well.
198
+ *
199
+ * ```js
200
+ * serverCachePolicy: new CachePolicy(this, "ServerCache", {
201
+ * queryStringBehavior: CacheQueryStringBehavior.all()
202
+ * headerBehavior: CacheHeaderBehavior.none()
203
+ * cookieBehavior: CacheCookieBehavior.none()
204
+ * defaultTtl: Duration.days(0)
205
+ * maxTtl: Duration.days(365)
206
+ * minTtl: Duration.days(0)
207
+ * })
208
+ * ```
195
209
  */
196
210
  serverCachePolicy?: ICachePolicy;
197
211
  /**
@@ -378,7 +378,7 @@ export class SsrSite extends Construct {
378
378
  const uploader = new CdkFunction(this, "S3Uploader", {
379
379
  code: Code.fromAsset(path.join(__dirname, "../support/base-site-custom-resource")),
380
380
  layers: [cliLayer],
381
- runtime: Runtime.PYTHON_3_7,
381
+ runtime: Runtime.PYTHON_3_11,
382
382
  handler: "s3-upload.handler",
383
383
  timeout: CdkDuration.minutes(15),
384
384
  memorySize: 1024,
@@ -389,7 +389,7 @@ export class SsrSite extends Construct {
389
389
  const handler = new CdkFunction(this, "S3Handler", {
390
390
  code: Code.fromAsset(path.join(__dirname, "../support/base-site-custom-resource")),
391
391
  layers: [cliLayer],
392
- runtime: Runtime.PYTHON_3_7,
392
+ runtime: Runtime.PYTHON_3_11,
393
393
  handler: "s3-handler.handler",
394
394
  timeout: CdkDuration.minutes(15),
395
395
  memorySize: 1024,
@@ -2,6 +2,7 @@ import { Construct } from "constructs";
2
2
  import { Api, ApiProps } from "../Api.js";
3
3
  import { FunctionDefinition } from "../Function.js";
4
4
  import { SSTConstruct } from "../Construct.js";
5
+ import { Secret } from "../Secret.js";
5
6
  import { FunctionBindingProps } from "../util/functionBinding.js";
6
7
  export interface AuthProps {
7
8
  /**
@@ -65,8 +66,8 @@ export declare class Auth extends Construct implements SSTConstruct {
65
66
  readonly id: string;
66
67
  private readonly authenticator;
67
68
  private api;
68
- private publicKey;
69
- private privateKey;
69
+ publicKey: Secret;
70
+ privateKey: Secret;
70
71
  constructor(scope: Construct, id: string, props: AuthProps);
71
72
  get url(): string;
72
73
  /** @internal */
package/logger.js CHANGED
@@ -1,12 +1,12 @@
1
- import fs from "fs/promises";
1
+ import fs from "fs";
2
2
  import path from "path";
3
3
  import { Context } from "./context/context.js";
4
4
  import { useProject } from "./project.js";
5
5
  let previous = new Date();
6
- const useFile = Context.memo(async () => {
6
+ const useFile = Context.memo(() => {
7
7
  const project = useProject();
8
8
  const filePath = path.join(project.paths.out, "debug.log");
9
- const file = await fs.open(filePath, "w");
9
+ const file = fs.createWriteStream(filePath);
10
10
  return file;
11
11
  });
12
12
  export const Logger = {
@@ -26,8 +26,7 @@ export const Logger = {
26
26
  ];
27
27
  if (process.env.SST_VERBOSE)
28
28
  console.log(...line);
29
- useFile().then((file) => {
30
- file.write(line.join(" ") + "\n");
31
- });
29
+ const file = useFile();
30
+ file.write(line.join(" ") + "\n");
32
31
  },
33
32
  };
@@ -66,12 +66,6 @@ export declare function createSessionBuilder<SessionTypes extends Record<string,
66
66
  type: "public";
67
67
  properties: {};
68
68
  };
69
- $type: { [type in keyof SessionTypes]: {
70
- type: type;
71
- properties: SessionTypes[type];
72
- }; }[keyof SessionTypes] | {
73
- type: "public";
74
- properties: {};
75
- };
69
+ $type: SessionTypes;
76
70
  };
77
71
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.24.26",
4
+ "version": "2.24.28",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
package/stacks/build.js CHANGED
@@ -5,7 +5,8 @@ import { dynamicImport } from "../util/module.js";
5
5
  import { findAbove } from "../util/fs.js";
6
6
  import { VisibleError } from "../error.js";
7
7
  import babel from "@babel/core";
8
- import generate from "@babel/generator";
8
+ const _ = await import("@babel/generator");
9
+ const generate = _.default?.default ?? _.default;
9
10
  // @ts-expect-error
10
11
  import ts from "@babel/plugin-syntax-typescript";
11
12
  export async function load(input, shallow) {
@@ -65,7 +66,7 @@ export async function load(input, shallow) {
65
66
  },
66
67
  });
67
68
  return {
68
- contents: generate.default(ast).code,
69
+ contents: generate(ast).code,
69
70
  loader: "ts",
70
71
  };
71
72
  });
@@ -1,12 +1,10 @@
1
1
  import subprocess
2
2
  import os
3
3
  import tempfile
4
- import json
5
4
  import glob
6
5
  import logging
7
6
  import shutil
8
7
  import boto3
9
- import asyncio
10
8
  from uuid import uuid4
11
9
  from zipfile import ZipFile
12
10