sst 2.24.14 → 2.24.16

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 (40) hide show
  1. package/bootstrap.js +1 -0
  2. package/cli/commands/bind.js +302 -293
  3. package/cli/commands/bootstrap.js +8 -2
  4. package/cli/commands/build.js +16 -10
  5. package/cli/commands/connect.js +41 -34
  6. package/cli/commands/console.js +17 -11
  7. package/cli/commands/deploy.js +83 -72
  8. package/cli/commands/dev.js +294 -277
  9. package/cli/commands/diff.js +64 -58
  10. package/cli/commands/remove.js +46 -36
  11. package/cli/commands/secrets/get.d.ts +1 -1
  12. package/cli/commands/secrets/get.js +4 -1
  13. package/cli/commands/secrets/list.js +58 -51
  14. package/cli/commands/secrets/load.js +34 -28
  15. package/cli/commands/secrets/remove.js +4 -0
  16. package/cli/commands/secrets/secrets.d.ts +1 -1
  17. package/cli/commands/secrets/secrets.js +5 -5
  18. package/cli/commands/secrets/set.js +32 -26
  19. package/cli/commands/telemetry.js +13 -6
  20. package/cli/commands/transform.js +12 -5
  21. package/cli/commands/types.js +18 -12
  22. package/cli/commands/update.js +94 -88
  23. package/cli/commands/version.js +12 -5
  24. package/cli/program.d.ts +4 -0
  25. package/cli/program.js +36 -1
  26. package/cli/sst.js +8 -7
  27. package/cli/telemetry/telemetry.d.ts +16 -1
  28. package/cli/telemetry/telemetry.js +13 -3
  29. package/constructs/App.js +2 -5
  30. package/constructs/Function.js +1 -1
  31. package/constructs/SsrSite.js +1 -1
  32. package/constructs/deprecated/NextjsSite.js +3 -4
  33. package/error.d.ts +3 -0
  34. package/error.js +5 -0
  35. package/node/future/auth/handler.d.ts +9 -18
  36. package/node/future/auth/handler.js +14 -29
  37. package/node/future/auth/session.d.ts +31 -0
  38. package/node/future/auth/session.js +39 -0
  39. package/package.json +2 -2
  40. package/support/signing-function/index.mjs +3 -3
@@ -106,3 +106,42 @@ export const Session = {
106
106
  create,
107
107
  verify,
108
108
  };
109
+ export function createSessionBuilder() {
110
+ return {
111
+ create(type, properties, options) {
112
+ // @ts-expect-error
113
+ const key = Config[process.env.AUTH_ID + "PrivateKey"];
114
+ const signer = createSigner({
115
+ ...options,
116
+ key,
117
+ algorithm: "RS512",
118
+ });
119
+ const token = signer({
120
+ type: type,
121
+ properties: properties,
122
+ });
123
+ return token;
124
+ },
125
+ verify(token) {
126
+ if (token) {
127
+ try {
128
+ const jwt = createVerifier({
129
+ algorithms: ["RS512"],
130
+ key: getPublicKey(),
131
+ })(token);
132
+ return jwt;
133
+ }
134
+ catch (e) { }
135
+ }
136
+ return {
137
+ type: "public",
138
+ properties: {},
139
+ };
140
+ },
141
+ use() {
142
+ const ctx = SessionMemo();
143
+ return ctx;
144
+ },
145
+ $type: {},
146
+ };
147
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "sideEffects": false,
3
3
  "name": "sst",
4
- "version": "2.24.14",
4
+ "version": "2.24.16",
5
5
  "bin": {
6
6
  "sst": "cli/sst.js"
7
7
  },
@@ -71,7 +71,7 @@
71
71
  "dotenv": "^16.0.3",
72
72
  "esbuild": "0.18.13",
73
73
  "express": "^4.18.2",
74
- "fast-jwt": "^1.6.1",
74
+ "fast-jwt": "^3.1.1",
75
75
  "get-port": "^6.1.2",
76
76
  "glob": "^8.0.3",
77
77
  "graphql": "*",
@@ -40,7 +40,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
40
40
  ));
41
41
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
42
42
 
43
- // ../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs
43
+ // ../../node_modules/.pnpm/tslib@2.6.1/node_modules/tslib/tslib.es6.mjs
44
44
  var tslib_es6_exports = {};
45
45
  __export(tslib_es6_exports, {
46
46
  __addDisposableResource: () => __addDisposableResource,
@@ -460,7 +460,7 @@ function __classPrivateFieldIn(state, receiver) {
460
460
  }
461
461
  function __addDisposableResource(env, value, async) {
462
462
  if (value !== null && value !== void 0) {
463
- if (typeof value !== "object")
463
+ if (typeof value !== "object" && typeof value !== "function")
464
464
  throw new TypeError("Object expected.");
465
465
  var dispose;
466
466
  if (async) {
@@ -507,7 +507,7 @@ function __disposeResources(env) {
507
507
  }
508
508
  var extendStatics, __assign, __createBinding, __setModuleDefault, _SuppressedError, tslib_es6_default;
509
509
  var init_tslib_es6 = __esm({
510
- "../../node_modules/.pnpm/tslib@2.6.0/node_modules/tslib/tslib.es6.mjs"() {
510
+ "../../node_modules/.pnpm/tslib@2.6.1/node_modules/tslib/tslib.es6.mjs"() {
511
511
  extendStatics = function(d, b) {
512
512
  extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d2, b2) {
513
513
  d2.__proto__ = b2;