@webiny/aws-sdk 5.41.0-dbt.0 → 5.41.0

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,6 +1,11 @@
1
- import { S3, S3ClientConfig } from "@aws-sdk/client-s3";
2
- export { CompleteMultipartUploadCommand, CompleteMultipartUploadCommandOutput, AbortMultipartUploadCommandOutput, CompleteMultipartUploadOutput, DeleteObjectOutput, GetObjectCommand, GetObjectOutput, HeadObjectCommand, HeadObjectOutput, ListObjectsOutput, ListObjectsV2Command, ListPartsCommand, ListPartsCommandOutput, ListPartsOutput, ObjectCannedACL, Part, PutObjectCommand, PutObjectCommandInput, PutObjectCommandOutput, PutObjectRequest, S3, S3Client, UploadPartCommand } from "@aws-sdk/client-s3";
1
+ import { S3, S3Client, S3ClientConfig as BaseS3ClientConfig } from "@aws-sdk/client-s3";
2
+ export { GetObjectCommand, HeadObjectCommand, ListObjectsCommand, ListObjectsV2Command, ListPartsCommand, ObjectCannedACL, Part, DeleteObjectCommand, PutObjectCommand, PutObjectCommandInput, PutObjectRequest, UploadPartCommand, AbortMultipartUploadCommand, CompleteMultipartUploadCommand, CreateMultipartUploadCommand, S3, S3Client } from "@aws-sdk/client-s3";
3
+ export type { CompleteMultipartUploadCommandOutput, AbortMultipartUploadCommandOutput, CompleteMultipartUploadOutput, DeleteObjectOutput, GetObjectOutput, GetObjectCommandOutput, HeadObjectOutput, HeadObjectCommandOutput, DeleteObjectCommandOutput, ListObjectsOutput, ListPartsCommandOutput, ListPartsOutput, PutObjectCommandOutput, UploadPartCommandOutput } from "@aws-sdk/client-s3";
3
4
  export { createPresignedPost } from "@aws-sdk/s3-presigned-post";
4
5
  export { PresignedPost, PresignedPostOptions } from "@aws-sdk/s3-presigned-post";
5
6
  export { getSignedUrl } from "@aws-sdk/s3-request-presigner";
6
- export declare const createS3Client: (initial?: S3ClientConfig) => S3;
7
+ export interface S3ClientConfig extends BaseS3ClientConfig {
8
+ cache?: boolean;
9
+ }
10
+ export declare const createS3Client: (initial?: S3ClientConfig) => S3Client;
11
+ export declare const createS3: (initial?: S3ClientConfig) => S3;
@@ -4,10 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- Object.defineProperty(exports, "AbortMultipartUploadCommandOutput", {
7
+ Object.defineProperty(exports, "AbortMultipartUploadCommand", {
8
8
  enumerable: true,
9
9
  get: function get() {
10
- return _clientS.AbortMultipartUploadCommandOutput;
10
+ return _clientS.AbortMultipartUploadCommand;
11
11
  }
12
12
  });
13
13
  Object.defineProperty(exports, "CompleteMultipartUploadCommand", {
@@ -16,22 +16,16 @@ Object.defineProperty(exports, "CompleteMultipartUploadCommand", {
16
16
  return _clientS.CompleteMultipartUploadCommand;
17
17
  }
18
18
  });
19
- Object.defineProperty(exports, "CompleteMultipartUploadCommandOutput", {
19
+ Object.defineProperty(exports, "CreateMultipartUploadCommand", {
20
20
  enumerable: true,
21
21
  get: function get() {
22
- return _clientS.CompleteMultipartUploadCommandOutput;
22
+ return _clientS.CreateMultipartUploadCommand;
23
23
  }
24
24
  });
25
- Object.defineProperty(exports, "CompleteMultipartUploadOutput", {
25
+ Object.defineProperty(exports, "DeleteObjectCommand", {
26
26
  enumerable: true,
27
27
  get: function get() {
28
- return _clientS.CompleteMultipartUploadOutput;
29
- }
30
- });
31
- Object.defineProperty(exports, "DeleteObjectOutput", {
32
- enumerable: true,
33
- get: function get() {
34
- return _clientS.DeleteObjectOutput;
28
+ return _clientS.DeleteObjectCommand;
35
29
  }
36
30
  });
37
31
  Object.defineProperty(exports, "GetObjectCommand", {
@@ -40,28 +34,16 @@ Object.defineProperty(exports, "GetObjectCommand", {
40
34
  return _clientS.GetObjectCommand;
41
35
  }
42
36
  });
43
- Object.defineProperty(exports, "GetObjectOutput", {
44
- enumerable: true,
45
- get: function get() {
46
- return _clientS.GetObjectOutput;
47
- }
48
- });
49
37
  Object.defineProperty(exports, "HeadObjectCommand", {
50
38
  enumerable: true,
51
39
  get: function get() {
52
40
  return _clientS.HeadObjectCommand;
53
41
  }
54
42
  });
55
- Object.defineProperty(exports, "HeadObjectOutput", {
43
+ Object.defineProperty(exports, "ListObjectsCommand", {
56
44
  enumerable: true,
57
45
  get: function get() {
58
- return _clientS.HeadObjectOutput;
59
- }
60
- });
61
- Object.defineProperty(exports, "ListObjectsOutput", {
62
- enumerable: true,
63
- get: function get() {
64
- return _clientS.ListObjectsOutput;
46
+ return _clientS.ListObjectsCommand;
65
47
  }
66
48
  });
67
49
  Object.defineProperty(exports, "ListObjectsV2Command", {
@@ -76,18 +58,6 @@ Object.defineProperty(exports, "ListPartsCommand", {
76
58
  return _clientS.ListPartsCommand;
77
59
  }
78
60
  });
79
- Object.defineProperty(exports, "ListPartsCommandOutput", {
80
- enumerable: true,
81
- get: function get() {
82
- return _clientS.ListPartsCommandOutput;
83
- }
84
- });
85
- Object.defineProperty(exports, "ListPartsOutput", {
86
- enumerable: true,
87
- get: function get() {
88
- return _clientS.ListPartsOutput;
89
- }
90
- });
91
61
  Object.defineProperty(exports, "ObjectCannedACL", {
92
62
  enumerable: true,
93
63
  get: function get() {
@@ -124,12 +94,6 @@ Object.defineProperty(exports, "PutObjectCommandInput", {
124
94
  return _clientS.PutObjectCommandInput;
125
95
  }
126
96
  });
127
- Object.defineProperty(exports, "PutObjectCommandOutput", {
128
- enumerable: true,
129
- get: function get() {
130
- return _clientS.PutObjectCommandOutput;
131
- }
132
- });
133
97
  Object.defineProperty(exports, "PutObjectRequest", {
134
98
  enumerable: true,
135
99
  get: function get() {
@@ -160,7 +124,7 @@ Object.defineProperty(exports, "createPresignedPost", {
160
124
  return _s3PresignedPost.createPresignedPost;
161
125
  }
162
126
  });
163
- exports.createS3Client = void 0;
127
+ exports.createS3Client = exports.createS3 = void 0;
164
128
  Object.defineProperty(exports, "getSignedUrl", {
165
129
  enumerable: true,
166
130
  get: function get() {
@@ -172,17 +136,40 @@ var _clientS = require("@aws-sdk/client-s3");
172
136
  var _utils = require("@webiny/utils");
173
137
  var _s3PresignedPost = require("@aws-sdk/s3-presigned-post");
174
138
  var _s3RequestPresigner = require("@aws-sdk/s3-request-presigner");
175
- var clients = new Map();
139
+ var s3ClientsCache = new Map();
176
140
  var createS3Client = exports.createS3Client = function createS3Client(initial) {
177
141
  var options = (0, _objectSpread2.default)({
178
142
  region: process.env.AWS_REGION
179
143
  }, initial);
144
+ var skipCache = options.cache === false;
145
+ delete options.cache;
146
+ if (skipCache) {
147
+ return new _clientS.S3Client((0, _objectSpread2.default)({}, options));
148
+ }
149
+ var key = (0, _utils.createCacheKey)(options);
150
+ if (s3ClientsCache.has(key)) {
151
+ return s3ClientsCache.get(key);
152
+ }
153
+ var instance = new _clientS.S3Client((0, _objectSpread2.default)({}, options));
154
+ s3ClientsCache.set(key, instance);
155
+ return instance;
156
+ };
157
+ var s3Cache = new Map();
158
+ var createS3 = exports.createS3 = function createS3(initial) {
159
+ var options = (0, _objectSpread2.default)({
160
+ region: process.env.AWS_REGION
161
+ }, initial);
162
+ var skipCache = options.cache === false;
163
+ delete options.cache;
164
+ if (skipCache) {
165
+ return new _clientS.S3(options);
166
+ }
180
167
  var key = (0, _utils.createCacheKey)(options);
181
- if (clients.has(key)) {
182
- return clients.get(key);
168
+ if (s3Cache.has(key)) {
169
+ return s3Cache.get(key);
183
170
  }
184
171
  var instance = new _clientS.S3(options);
185
- clients.set(key, instance);
172
+ s3Cache.set(key, instance);
186
173
  return instance;
187
174
  };
188
175
 
@@ -1 +1 @@
1
- {"version":3,"names":["_clientS","require","_utils","_s3PresignedPost","_s3RequestPresigner","clients","Map","createS3Client","exports","initial","options","_objectSpread2","default","region","process","env","AWS_REGION","key","createCacheKey","has","get","instance","S3","set"],"sources":["index.ts"],"sourcesContent":["import { S3, S3ClientConfig } from \"@aws-sdk/client-s3\";\nimport { createCacheKey } from \"@webiny/utils\";\n\nexport {\n CompleteMultipartUploadCommand,\n CompleteMultipartUploadCommandOutput,\n AbortMultipartUploadCommandOutput,\n CompleteMultipartUploadOutput,\n DeleteObjectOutput,\n GetObjectCommand,\n GetObjectOutput,\n HeadObjectCommand,\n HeadObjectOutput,\n ListObjectsOutput,\n ListObjectsV2Command,\n ListPartsCommand,\n ListPartsCommandOutput,\n ListPartsOutput,\n ObjectCannedACL,\n Part,\n PutObjectCommand,\n PutObjectCommandInput,\n PutObjectCommandOutput,\n PutObjectRequest,\n S3,\n S3Client,\n UploadPartCommand\n} from \"@aws-sdk/client-s3\";\n\nexport { createPresignedPost } from \"@aws-sdk/s3-presigned-post\";\nexport { PresignedPost, PresignedPostOptions } from \"@aws-sdk/s3-presigned-post\";\n\nexport { getSignedUrl } from \"@aws-sdk/s3-request-presigner\";\n\nconst clients = new Map<string, S3>();\n\nexport const createS3Client = (initial?: S3ClientConfig): S3 => {\n const options = {\n region: process.env.AWS_REGION,\n ...initial\n };\n const key = createCacheKey(options);\n if (clients.has(key)) {\n return clients.get(key) as S3;\n }\n\n const instance = new S3(options);\n clients.set(key, instance);\n return instance;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AA4BA,IAAAE,gBAAA,GAAAF,OAAA;AAGA,IAAAG,mBAAA,GAAAH,OAAA;AAEA,IAAMI,OAAO,GAAG,IAAIC,GAAG,CAAa,CAAC;AAE9B,IAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,SAAjBA,cAAcA,CAAIE,OAAwB,EAAS;EAC5D,IAAMC,OAAO,OAAAC,cAAA,CAAAC,OAAA;IACTC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC;EAAU,GAC3BP,OAAO,CACb;EACD,IAAMQ,GAAG,GAAG,IAAAC,qBAAc,EAACR,OAAO,CAAC;EACnC,IAAIL,OAAO,CAACc,GAAG,CAACF,GAAG,CAAC,EAAE;IAClB,OAAOZ,OAAO,CAACe,GAAG,CAACH,GAAG,CAAC;EAC3B;EAEA,IAAMI,QAAQ,GAAG,IAAIC,WAAE,CAACZ,OAAO,CAAC;EAChCL,OAAO,CAACkB,GAAG,CAACN,GAAG,EAAEI,QAAQ,CAAC;EAC1B,OAAOA,QAAQ;AACnB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clientS","require","_utils","_s3PresignedPost","_s3RequestPresigner","s3ClientsCache","Map","createS3Client","exports","initial","options","_objectSpread2","default","region","process","env","AWS_REGION","skipCache","cache","S3Client","key","createCacheKey","has","get","instance","set","s3Cache","createS3","S3"],"sources":["index.ts"],"sourcesContent":["import { S3, S3Client, S3ClientConfig as BaseS3ClientConfig } from \"@aws-sdk/client-s3\";\nimport { createCacheKey } from \"@webiny/utils\";\n\nexport {\n GetObjectCommand,\n HeadObjectCommand,\n ListObjectsCommand,\n ListObjectsV2Command,\n ListPartsCommand,\n ObjectCannedACL,\n Part,\n DeleteObjectCommand,\n PutObjectCommand,\n PutObjectCommandInput,\n PutObjectRequest,\n UploadPartCommand,\n AbortMultipartUploadCommand,\n CompleteMultipartUploadCommand,\n CreateMultipartUploadCommand,\n S3,\n S3Client\n} from \"@aws-sdk/client-s3\";\n\nexport type {\n CompleteMultipartUploadCommandOutput,\n AbortMultipartUploadCommandOutput,\n CompleteMultipartUploadOutput,\n DeleteObjectOutput,\n GetObjectOutput,\n GetObjectCommandOutput,\n HeadObjectOutput,\n HeadObjectCommandOutput,\n DeleteObjectCommandOutput,\n ListObjectsOutput,\n ListPartsCommandOutput,\n ListPartsOutput,\n PutObjectCommandOutput,\n UploadPartCommandOutput\n} from \"@aws-sdk/client-s3\";\n\nexport { createPresignedPost } from \"@aws-sdk/s3-presigned-post\";\nexport { PresignedPost, PresignedPostOptions } from \"@aws-sdk/s3-presigned-post\";\n\nexport { getSignedUrl } from \"@aws-sdk/s3-request-presigner\";\n\nconst s3ClientsCache = new Map<string, S3Client>();\n\nexport interface S3ClientConfig extends BaseS3ClientConfig {\n cache?: boolean;\n}\n\nexport const createS3Client = (initial?: S3ClientConfig): S3Client => {\n const options: S3ClientConfig = {\n region: process.env.AWS_REGION,\n ...initial\n };\n const skipCache = options.cache === false;\n delete options.cache;\n if (skipCache) {\n return new S3Client({\n ...options\n });\n }\n\n const key = createCacheKey(options);\n if (s3ClientsCache.has(key)) {\n return s3ClientsCache.get(key) as S3Client;\n }\n\n const instance = new S3Client({\n ...options\n });\n s3ClientsCache.set(key, instance);\n\n return instance;\n};\n\nconst s3Cache = new Map<string, S3>();\n\nexport const createS3 = (initial?: S3ClientConfig): S3 => {\n const options: S3ClientConfig = {\n region: process.env.AWS_REGION,\n ...initial\n };\n const skipCache = options.cache === false;\n delete options.cache;\n if (skipCache) {\n return new S3(options);\n }\n const key = createCacheKey(options);\n if (s3Cache.has(key)) {\n return s3Cache.get(key) as S3;\n }\n\n const instance = new S3(options);\n\n s3Cache.set(key, instance);\n return instance;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAuCA,IAAAE,gBAAA,GAAAF,OAAA;AAGA,IAAAG,mBAAA,GAAAH,OAAA;AAEA,IAAMI,cAAc,GAAG,IAAIC,GAAG,CAAmB,CAAC;AAM3C,IAAMC,cAAc,GAAAC,OAAA,CAAAD,cAAA,GAAG,SAAjBA,cAAcA,CAAIE,OAAwB,EAAe;EAClE,IAAMC,OAAuB,OAAAC,cAAA,CAA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AAMI,QAAQ,GAAG,IAAII,WAAE,CAAClB,OAAO,CAAC;EAEhCgB,OAAO,CAACD,GAAG,CAACL,GAAG,EAAEI,QAAQ,CAAC;EAC1B,OAAOA,QAAQ;AACnB,CAAC","ignoreList":[]}
@@ -1,10 +1,15 @@
1
- import { SFNClient, SFNClientConfig, StartExecutionCommandInput } from "@aws-sdk/client-sfn";
2
- export { SFNClient, StartExecutionCommand, SFNServiceException } from "@aws-sdk/client-sfn";
3
- export type GenericData = string | number | boolean | null | undefined;
4
- export interface GenericStepFunctionData {
5
- [key: string]: GenericData | GenericData[];
1
+ import type { DescribeExecutionCommandInput, DescribeExecutionCommandOutput, ListExecutionsCommandInput, ListExecutionsCommandOutput, SFNClientConfig as BaseSFNClientConfig, StartExecutionCommandInput, StartExecutionCommandOutput } from "@aws-sdk/client-sfn";
2
+ import { DescribeExecutionCommand, ListExecutionsCommand, SFNClient, SFNServiceException, StartExecutionCommand } from "@aws-sdk/client-sfn";
3
+ import { GenericRecord } from "@webiny/cli/types";
4
+ export { SFNClient, DescribeExecutionCommand, SFNServiceException, StartExecutionCommand, ListExecutionsCommand };
5
+ export type { DescribeExecutionCommandInput, DescribeExecutionCommandOutput, StartExecutionCommandInput, StartExecutionCommandOutput, ListExecutionsCommandInput, ListExecutionsCommandOutput };
6
+ export interface SFNClientConfig extends BaseSFNClientConfig {
7
+ cache?: boolean;
6
8
  }
7
- export interface TriggerStepFunctionParams<T extends GenericStepFunctionData = GenericStepFunctionData> extends Partial<Omit<StartExecutionCommandInput, "input">> {
9
+ export interface TriggerStepFunctionParams<T extends GenericRecord = GenericRecord> extends Partial<Omit<StartExecutionCommandInput, "input">> {
8
10
  input: T;
9
11
  }
10
- export declare const triggerStepFunctionFactory: (config: SFNClient | SFNClientConfig) => <T extends GenericStepFunctionData = GenericStepFunctionData>(params: TriggerStepFunctionParams<T>) => Promise<import("@aws-sdk/client-sfn").StartExecutionCommandOutput>;
12
+ export declare const createStepFunctionClient: (initial?: SFNClientConfig) => SFNClient;
13
+ export declare const triggerStepFunctionFactory: (input?: SFNClient | SFNClientConfig) => <T extends GenericRecord<import("@webiny/cli/types").GenericRecordKey, any> = GenericRecord<import("@webiny/cli/types").GenericRecordKey, any>>(params: TriggerStepFunctionParams<T>) => Promise<StartExecutionCommandOutput>;
14
+ export declare const listExecutionsFactory: (input?: SFNClient | SFNClientConfig) => (params: ListExecutionsCommandInput) => Promise<ListExecutionsCommandOutput>;
15
+ export declare const describeExecutionFactory: (input?: SFNClient | SFNClientConfig) => (params: DescribeExecutionCommandInput) => Promise<DescribeExecutionCommandOutput>;
@@ -4,6 +4,18 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ Object.defineProperty(exports, "DescribeExecutionCommand", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _clientSfn.DescribeExecutionCommand;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, "ListExecutionsCommand", {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return _clientSfn.ListExecutionsCommand;
17
+ }
18
+ });
7
19
  Object.defineProperty(exports, "SFNClient", {
8
20
  enumerable: true,
9
21
  get: function get() {
@@ -22,19 +34,28 @@ Object.defineProperty(exports, "StartExecutionCommand", {
22
34
  return _clientSfn.StartExecutionCommand;
23
35
  }
24
36
  });
25
- exports.triggerStepFunctionFactory = void 0;
37
+ exports.triggerStepFunctionFactory = exports.listExecutionsFactory = exports.describeExecutionFactory = exports.createStepFunctionClient = void 0;
26
38
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
27
39
  var _clientSfn = require("@aws-sdk/client-sfn");
28
- var getClient = function getClient(config) {
29
- if (config instanceof _clientSfn.SFNClient) {
30
- return config;
40
+ var _utils = require("@webiny/utils");
41
+ var stepFunctionClientsCache = new Map();
42
+ var createStepFunctionClient = exports.createStepFunctionClient = function createStepFunctionClient(initial) {
43
+ var config = (0, _objectSpread2.default)({
44
+ region: process.env.AWS_REGION
45
+ }, initial);
46
+ var skipCache = config.cache === false;
47
+ delete config.cache;
48
+ if (skipCache) {
49
+ return new _clientSfn.SFNClient((0, _objectSpread2.default)({}, config));
50
+ }
51
+ var key = (0, _utils.createCacheKey)(config);
52
+ if (stepFunctionClientsCache.has(key)) {
53
+ return stepFunctionClientsCache.get(key);
31
54
  }
32
- return new _clientSfn.SFNClient((0, _objectSpread2.default)((0, _objectSpread2.default)({}, config), {}, {
33
- region: config.region || process.env.AWS_REGION
34
- }));
55
+ return new _clientSfn.SFNClient((0, _objectSpread2.default)({}, config));
35
56
  };
36
- var triggerStepFunctionFactory = exports.triggerStepFunctionFactory = function triggerStepFunctionFactory(config) {
37
- var client = getClient(config);
57
+ var triggerStepFunctionFactory = exports.triggerStepFunctionFactory = function triggerStepFunctionFactory(input) {
58
+ var client = input instanceof _clientSfn.SFNClient ? input : createStepFunctionClient(input);
38
59
  return async function (params) {
39
60
  var cmd = new _clientSfn.StartExecutionCommand((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
40
61
  stateMachineArn: params.stateMachineArn || process.env.BG_TASK_SFN_ARN,
@@ -44,5 +65,21 @@ var triggerStepFunctionFactory = exports.triggerStepFunctionFactory = function t
44
65
  return await client.send(cmd);
45
66
  };
46
67
  };
68
+ var listExecutionsFactory = exports.listExecutionsFactory = function listExecutionsFactory(input) {
69
+ var client = input instanceof _clientSfn.SFNClient ? input : createStepFunctionClient(input);
70
+ return async function (params) {
71
+ var cmd = new _clientSfn.ListExecutionsCommand((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
72
+ stateMachineArn: params.stateMachineArn || process.env.BG_TASK_SFN_ARN
73
+ }));
74
+ return await client.send(cmd);
75
+ };
76
+ };
77
+ var describeExecutionFactory = exports.describeExecutionFactory = function describeExecutionFactory(input) {
78
+ var client = input instanceof _clientSfn.SFNClient ? input : createStepFunctionClient(input);
79
+ return async function (params) {
80
+ var cmd = new _clientSfn.DescribeExecutionCommand((0, _objectSpread2.default)({}, params));
81
+ return await client.send(cmd);
82
+ };
83
+ };
47
84
 
48
85
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clientSfn","require","getClient","config","SFNClient","_objectSpread2","default","region","process","env","AWS_REGION","triggerStepFunctionFactory","exports","client","params","cmd","StartExecutionCommand","stateMachineArn","BG_TASK_SFN_ARN","name","input","JSON","stringify","send"],"sources":["index.ts"],"sourcesContent":["import {\n SFNClient,\n SFNClientConfig,\n StartExecutionCommand,\n StartExecutionCommandInput\n} from \"@aws-sdk/client-sfn\";\n\nexport { SFNClient, StartExecutionCommand, SFNServiceException } from \"@aws-sdk/client-sfn\";\n\nexport type GenericData = string | number | boolean | null | undefined;\n\nexport interface GenericStepFunctionData {\n [key: string]: GenericData | GenericData[];\n}\n\nexport interface TriggerStepFunctionParams<\n T extends GenericStepFunctionData = GenericStepFunctionData\n> extends Partial<Omit<StartExecutionCommandInput, \"input\">> {\n input: T;\n}\n\nconst getClient = (config: SFNClient | SFNClientConfig): SFNClient => {\n if (config instanceof SFNClient) {\n return config;\n }\n return new SFNClient({\n ...config,\n region: config.region || process.env.AWS_REGION\n });\n};\n\nexport const triggerStepFunctionFactory = (config: SFNClient | SFNClientConfig) => {\n const client = getClient(config);\n return async <T extends GenericStepFunctionData = GenericStepFunctionData>(\n params: TriggerStepFunctionParams<T>\n ) => {\n const cmd = new StartExecutionCommand({\n ...params,\n stateMachineArn: params.stateMachineArn || process.env.BG_TASK_SFN_ARN,\n name: params.name,\n input: JSON.stringify(params.input)\n });\n return await client.send(cmd);\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAqBA,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAIC,MAAmC,EAAgB;EAClE,IAAIA,MAAM,YAAYC,oBAAS,EAAE;IAC7B,OAAOD,MAAM;EACjB;EACA,OAAO,IAAIC,oBAAS,KAAAC,cAAA,CAAAC,OAAA,MAAAD,cAAA,CAAAC,OAAA,MACbH,MAAM;IACTI,MAAM,EAAEJ,MAAM,CAACI,MAAM,IAAIC,OAAO,CAACC,GAAG,CAACC;EAAU,EAClD,CAAC;AACN,CAAC;AAEM,IAAMC,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,GAAG,SAA7BA,0BAA0BA,CAAIR,MAAmC,EAAK;EAC/E,IAAMU,MAAM,GAAGX,SAAS,CAACC,MAAM,CAAC;EAChC,OAAO,gBACHW,MAAoC,EACnC;IACD,IAAMC,GAAG,GAAG,IAAIC,gCAAqB,KAAAX,cAAA,CAAAC,OAAA,MAAAD,cAAA,CAAAC,OAAA,MAC9BQ,MAAM;MACTG,eAAe,EAAEH,MAAM,CAACG,eAAe,IAAIT,OAAO,CAACC,GAAG,CAACS,eAAe;MACtEC,IAAI,EAAEL,MAAM,CAACK,IAAI;MACjBC,KAAK,EAAEC,IAAI,CAACC,SAAS,CAACR,MAAM,CAACM,KAAK;IAAC,EACtC,CAAC;IACF,OAAO,MAAMP,MAAM,CAACU,IAAI,CAACR,GAAG,CAAC;EACjC,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_clientSfn","require","_utils","stepFunctionClientsCache","Map","createStepFunctionClient","exports","initial","config","_objectSpread2","default","region","process","env","AWS_REGION","skipCache","cache","SFNClient","key","createCacheKey","has","get","triggerStepFunctionFactory","input","client","params","cmd","StartExecutionCommand","stateMachineArn","BG_TASK_SFN_ARN","name","JSON","stringify","send","listExecutionsFactory","ListExecutionsCommand","describeExecutionFactory","DescribeExecutionCommand"],"sources":["index.ts"],"sourcesContent":["import type {\n DescribeExecutionCommandInput,\n DescribeExecutionCommandOutput,\n ListExecutionsCommandInput,\n ListExecutionsCommandOutput,\n SFNClientConfig as BaseSFNClientConfig,\n StartExecutionCommandInput,\n StartExecutionCommandOutput\n} from \"@aws-sdk/client-sfn\";\nimport {\n DescribeExecutionCommand,\n ListExecutionsCommand,\n SFNClient,\n SFNServiceException,\n StartExecutionCommand\n} from \"@aws-sdk/client-sfn\";\nimport { createCacheKey } from \"@webiny/utils\";\nimport { GenericRecord } from \"@webiny/cli/types\";\n\nexport {\n SFNClient,\n DescribeExecutionCommand,\n SFNServiceException,\n StartExecutionCommand,\n ListExecutionsCommand\n};\n\nexport type {\n DescribeExecutionCommandInput,\n DescribeExecutionCommandOutput,\n StartExecutionCommandInput,\n StartExecutionCommandOutput,\n ListExecutionsCommandInput,\n ListExecutionsCommandOutput\n};\n\nexport interface SFNClientConfig extends BaseSFNClientConfig {\n cache?: boolean;\n}\n\nexport interface TriggerStepFunctionParams<T extends GenericRecord = GenericRecord>\n extends Partial<Omit<StartExecutionCommandInput, \"input\">> {\n input: T;\n}\n\nconst stepFunctionClientsCache = new Map<string, SFNClient>();\n\nexport const createStepFunctionClient = (initial?: SFNClientConfig): SFNClient => {\n const config: SFNClientConfig = {\n region: process.env.AWS_REGION,\n ...initial\n };\n const skipCache = config.cache === false;\n delete config.cache;\n if (skipCache) {\n return new SFNClient({\n ...config\n });\n }\n\n const key = createCacheKey(config);\n if (stepFunctionClientsCache.has(key)) {\n return stepFunctionClientsCache.get(key) as SFNClient;\n }\n\n return new SFNClient({\n ...config\n });\n};\n\nexport const triggerStepFunctionFactory = (input?: SFNClient | SFNClientConfig) => {\n const client = input instanceof SFNClient ? input : createStepFunctionClient(input);\n return async <T extends GenericRecord = GenericRecord>(\n params: TriggerStepFunctionParams<T>\n ): Promise<StartExecutionCommandOutput> => {\n const cmd = new StartExecutionCommand({\n ...params,\n stateMachineArn: params.stateMachineArn || process.env.BG_TASK_SFN_ARN,\n name: params.name,\n input: JSON.stringify(params.input)\n });\n return await client.send(cmd);\n };\n};\n\nexport const listExecutionsFactory = (input?: SFNClient | SFNClientConfig) => {\n const client = input instanceof SFNClient ? input : createStepFunctionClient(input);\n return async (params: ListExecutionsCommandInput): Promise<ListExecutionsCommandOutput> => {\n const cmd = new ListExecutionsCommand({\n ...params,\n stateMachineArn: params.stateMachineArn || process.env.BG_TASK_SFN_ARN\n });\n return await client.send(cmd);\n };\n};\n\nexport const describeExecutionFactory = (input?: SFNClient | SFNClientConfig) => {\n const client = input instanceof SFNClient ? input : createStepFunctionClient(input);\n return async (\n params: DescribeExecutionCommandInput\n ): Promise<DescribeExecutionCommandOutput> => {\n const cmd = new DescribeExecutionCommand({\n ...params\n });\n return await client.send(cmd);\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAAA,UAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAD,OAAA;AA6BA,IAAME,wBAAwB,GAAG,IAAIC,GAAG,CAAoB,CAAC;AAEtD,IAAMC,wBAAwB,GAAAC,OAAA,CAAAD,wBAAA,GAAG,SAA3BA,wBAAwBA,CAAIE,OAAyB,EAAgB;EAC9E,IAAMC,MAAuB,OAAAC,cAAA,CAAAC,OAAA;IACzBC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC;EAAU,GAC3BP,OAAO,CACb;EACD,IAAMQ,SAAS,GAAGP,MAAM,CAACQ,KAAK,KAAK,KAAK;EACxC,OAAOR,MAAM,CAACQ,KAAK;EACnB,IAAID,SAAS,EAAE;IACX,OAAO,IAAIE,oBAAS,KAAAR,cAAA,CAAAC,OAAA,MACbF,MAAM,CACZ,CAAC;EACN;EAEA,IAAMU,GAAG,GAAG,IAAAC,qBAAc,EAACX,MAAM,CAAC;EAClC,IAAIL,wBAAwB,CAACiB,GAAG,CAACF,GAAG,CAAC,EAAE;IACnC,OAAOf,wBAAwB,CAACkB,GAAG,CAACH,GAAG,CAAC;EAC5C;EAEA,OAAO,IAAID,oBAAS,KAAAR,cAAA,CAAAC,OAAA,MACbF,MAAM,CACZ,CAAC;AACN,CAAC;AAEM,IAAMc,0BAA0B,GAAAhB,OAAA,CAAAgB,0BAAA,GAAG,SAA7BA,0BAA0BA,CAAIC,KAAmC,EAAK;EAC/E,IAAMC,MAAM,GAA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GAAG,GAAG,IAAIW,mCAAwB,KAAA5B,cAAA,CAAAC,OAAA,MACjCe,MAAM,CACZ,CAAC;IACF,OAAO,MAAMD,MAAM,CAACS,IAAI,CAACP,GAAG,CAAC;EACjC,CAAC;AACL,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,39 +1,39 @@
1
1
  {
2
2
  "name": "@webiny/aws-sdk",
3
- "version": "5.41.0-dbt.0",
3
+ "version": "5.41.0",
4
4
  "description": "Wrapper for AWS SDK",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
7
7
  "author": "Webiny Ltd.",
8
8
  "dependencies": {
9
- "@aws-sdk/client-apigatewaymanagementapi": "3.621.0",
10
- "@aws-sdk/client-cloudfront": "3.621.0",
11
- "@aws-sdk/client-cloudwatch-events": "3.621.0",
12
- "@aws-sdk/client-cloudwatch-logs": "3.621.0",
13
- "@aws-sdk/client-cognito-identity-provider": "3.621.0",
14
- "@aws-sdk/client-dynamodb": "3.621.0",
15
- "@aws-sdk/client-dynamodb-streams": "3.621.0",
16
- "@aws-sdk/client-eventbridge": "3.621.0",
17
- "@aws-sdk/client-iam": "3.621.0",
18
- "@aws-sdk/client-iot": "3.621.0",
19
- "@aws-sdk/client-lambda": "3.621.0",
20
- "@aws-sdk/client-s3": "3.621.0",
21
- "@aws-sdk/client-sfn": "3.621.0",
22
- "@aws-sdk/client-sqs": "3.621.0",
23
- "@aws-sdk/client-sts": "3.621.0",
24
- "@aws-sdk/credential-providers": "3.621.0",
25
- "@aws-sdk/lib-dynamodb": "3.621.0",
26
- "@aws-sdk/lib-storage": "3.621.0",
27
- "@aws-sdk/s3-presigned-post": "3.621.0",
28
- "@aws-sdk/s3-request-presigner": "3.621.0",
29
- "@aws-sdk/util-dynamodb": "3.621.0",
30
- "@webiny/utils": "5.41.0-dbt.0"
9
+ "@aws-sdk/client-apigatewaymanagementapi": "3.670.0",
10
+ "@aws-sdk/client-cloudfront": "3.670.0",
11
+ "@aws-sdk/client-cloudwatch-events": "3.670.0",
12
+ "@aws-sdk/client-cloudwatch-logs": "3.670.0",
13
+ "@aws-sdk/client-cognito-identity-provider": "3.670.0",
14
+ "@aws-sdk/client-dynamodb": "3.670.0",
15
+ "@aws-sdk/client-dynamodb-streams": "3.670.0",
16
+ "@aws-sdk/client-eventbridge": "3.670.0",
17
+ "@aws-sdk/client-iam": "3.670.0",
18
+ "@aws-sdk/client-iot": "3.670.0",
19
+ "@aws-sdk/client-lambda": "3.670.0",
20
+ "@aws-sdk/client-s3": "3.670.0",
21
+ "@aws-sdk/client-sfn": "3.670.0",
22
+ "@aws-sdk/client-sqs": "3.670.0",
23
+ "@aws-sdk/client-sts": "3.670.0",
24
+ "@aws-sdk/credential-providers": "3.670.0",
25
+ "@aws-sdk/lib-dynamodb": "3.670.0",
26
+ "@aws-sdk/lib-storage": "3.670.0",
27
+ "@aws-sdk/s3-presigned-post": "3.670.0",
28
+ "@aws-sdk/s3-request-presigner": "3.670.0",
29
+ "@aws-sdk/util-dynamodb": "3.670.0",
30
+ "@webiny/utils": "5.41.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@babel/cli": "7.24.1",
34
34
  "@babel/core": "7.24.3",
35
- "@webiny/cli": "5.41.0-dbt.0",
36
- "@webiny/project-utils": "5.41.0-dbt.0",
35
+ "@webiny/cli": "5.41.0",
36
+ "@webiny/project-utils": "5.41.0",
37
37
  "rimraf": "5.0.5",
38
38
  "typescript": "4.9.5"
39
39
  },
@@ -45,5 +45,5 @@
45
45
  "build": "yarn webiny run build",
46
46
  "watch": "yarn webiny run watch"
47
47
  },
48
- "gitHead": "bbaec4dd1685579548c08bbde386aee5d96b80f8"
48
+ "gitHead": "a542f4d0806744c5e2333b3786478c4af3b6b750"
49
49
  }