sst 4.15.0 → 4.15.1

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,7 @@
1
1
  import { AwsClient } from "aws4fetch";
2
2
  type AwsFetchOptions = Exclude<Parameters<AwsClient["fetch"]>[1], null | undefined>;
3
3
  export type AwsOptions = Exclude<Parameters<AwsClient["fetch"]>[1], null | undefined>["aws"];
4
- export declare function client(): Promise<AwsClient>;
4
+ export declare function client(aws?: AwsOptions): Promise<AwsClient>;
5
5
  export declare function awsFetch(service: string, path: string, init: Omit<AwsFetchOptions, "aws">, options?: {
6
6
  aws?: AwsOptions;
7
7
  }): Promise<Response>;
@@ -13,7 +13,17 @@ async function getCredentials(url) {
13
13
  cachedCredentials = credentials;
14
14
  return credentials;
15
15
  }
16
- export async function client() {
16
+ export async function client(aws) {
17
+ if (aws?.accessKeyId && aws.secretAccessKey) {
18
+ return new AwsClient({
19
+ accessKeyId: aws.accessKeyId,
20
+ secretAccessKey: aws.secretAccessKey,
21
+ sessionToken: aws.sessionToken,
22
+ service: aws.service,
23
+ region: aws.region ?? process.env.AWS_REGION,
24
+ cache: aws.cache,
25
+ });
26
+ }
17
27
  if (process.env.AWS_ACCESS_KEY_ID && process.env.AWS_SECRET_ACCESS_KEY) {
18
28
  return new AwsClient({
19
29
  accessKeyId: process.env.AWS_ACCESS_KEY_ID,
@@ -35,7 +45,7 @@ export async function client() {
35
45
  throw new Error("No AWS credentials found");
36
46
  }
37
47
  export async function awsFetch(service, path, init, options) {
38
- const c = await client();
48
+ const c = await client(options?.aws);
39
49
  const region = options?.aws?.region ?? c.region;
40
50
  return c.fetch(`https://${service}.${region}.amazonaws.com${path}`, {
41
51
  ...init,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "sst",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
- "version": "4.15.0",
6
+ "version": "4.15.1",
7
7
  "main": "./dist/index.js",
8
8
  "repository": {
9
9
  "type": "git",
@@ -55,14 +55,14 @@
55
55
  "sst": "./bin/sst.mjs"
56
56
  },
57
57
  "optionalDependencies": {
58
- "sst-linux-x64": "4.15.0",
59
- "sst-linux-x86": "4.15.0",
60
- "sst-darwin-x64": "4.15.0",
61
- "sst-linux-arm64": "4.15.0",
62
- "sst-darwin-arm64": "4.15.0",
63
- "sst-win32-x64": "4.15.0",
64
- "sst-win32-x86": "4.15.0",
65
- "sst-win32-arm64": "4.15.0"
58
+ "sst-linux-x64": "4.15.1",
59
+ "sst-linux-x86": "4.15.1",
60
+ "sst-darwin-x64": "4.15.1",
61
+ "sst-linux-arm64": "4.15.1",
62
+ "sst-darwin-arm64": "4.15.1",
63
+ "sst-win32-x64": "4.15.1",
64
+ "sst-win32-x86": "4.15.1",
65
+ "sst-win32-arm64": "4.15.1"
66
66
  },
67
67
  "dependencies": {
68
68
  "@aws/durable-execution-sdk-js": "1.0.2",