sst 2.0.17 → 2.0.19

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.
@@ -1,7 +1,6 @@
1
1
  import { useBootstrap } from "../bootstrap.js";
2
2
  import { useAWSCredentials } from "../credentials.js";
3
3
  import { S3Client, GetObjectCommand, PutObjectCommand, DeleteObjectCommand, } from "@aws-sdk/client-s3";
4
- import { json } from "stream/consumers";
5
4
  import { Context } from "../context/context.js";
6
5
  import { Logger } from "../logger.js";
7
6
  import { useProject } from "../project.js";
@@ -17,13 +16,12 @@ async function metadata() {
17
16
  credentials,
18
17
  });
19
18
  try {
20
- const result = await s3
21
- .send(new GetObjectCommand({
19
+ const result = await s3.send(new GetObjectCommand({
22
20
  Key: useS3Key(),
23
21
  Bucket: bootstrap.bucket,
24
- }))
25
- .then((result) => json(result.Body));
26
- return result;
22
+ }));
23
+ const body = await result.Body.transformToString();
24
+ return JSON.parse(body);
27
25
  }
28
26
  catch (ex) {
29
27
  Logger.debug("Fetching app metadata: not found");
@@ -1,7 +1,6 @@
1
1
  import { useBootstrap } from "../bootstrap.js";
2
2
  import { useAWSCredentials, useAWSCredentialsProvider, } from "../credentials.js";
3
3
  import { S3Client, GetObjectCommand, ListObjectsV2Command, } from "@aws-sdk/client-s3";
4
- import { json } from "stream/consumers";
5
4
  import { useCache } from "../cache.js";
6
5
  import { Context } from "../context/context.js";
7
6
  import { useBus } from "../bus.js";
@@ -25,13 +24,12 @@ export async function metadata() {
25
24
  }));
26
25
  const result = Object.fromEntries(await Promise.all(list.Contents?.map(async (obj) => {
27
26
  const stackID = obj.Key?.split("/").pop();
28
- const result = await s3
29
- .send(new GetObjectCommand({
27
+ const result = await s3.send(new GetObjectCommand({
30
28
  Key: obj.Key,
31
29
  Bucket: bootstrap.bucket,
32
- }))
33
- .then((result) => json(result.Body));
34
- return [stackID, result];
30
+ }));
31
+ const body = await result.Body.transformToString();
32
+ return [stackID, JSON.parse(body)];
35
33
  }) || []));
36
34
  Logger.debug("Fetched metadata from", list.KeyCount, "stacks");
37
35
  return result;
@@ -49,13 +47,12 @@ export async function metadataForStack(stackID) {
49
47
  const key = `stackMetadata/app.${project.config.name}/stage.${project.config.stage}/stack.${stackID}.json`;
50
48
  Logger.debug("Getting metadata", key, "from", bootstrap.bucket);
51
49
  try {
52
- const result = await s3
53
- .send(new GetObjectCommand({
50
+ const result = await s3.send(new GetObjectCommand({
54
51
  Key: key,
55
52
  Bucket: bootstrap.bucket,
56
- }))
57
- .then((result) => json(result.Body));
58
- return result;
53
+ }));
54
+ const body = await result.Body.transformToString();
55
+ return JSON.parse(body);
59
56
  }
60
57
  catch (ex) {
61
58
  console.error(ex);
package/stacks/synth.js CHANGED
@@ -10,6 +10,7 @@ export async function synth(opts) {
10
10
  const { App } = await import("../constructs/App.js");
11
11
  const { useNodeHandler } = await import("../runtime/handlers/node.js");
12
12
  const { useGoHandler } = await import("../runtime/handlers/go.js");
13
+ const { useRustHandler } = await import("../runtime/handlers/rust.js");
13
14
  const { usePythonHandler } = await import("../runtime/handlers/python.js");
14
15
  const { useJavaHandler } = await import("../runtime/handlers/java.js");
15
16
  useNodeHandler();
@@ -17,6 +18,7 @@ export async function synth(opts) {
17
18
  usePythonHandler();
18
19
  useJavaHandler();
19
20
  useDotnetHandler();
21
+ useRustHandler();
20
22
  const { Configuration } = await import("aws-cdk/lib/settings.js");
21
23
  const project = useProject();
22
24
  const identity = await useSTSIdentity();