@webiny/aws-sdk 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e

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 (47) hide show
  1. package/README.md +11 -0
  2. package/client-apigatewaymanagementapi/index.d.ts +2 -1
  3. package/client-apigatewaymanagementapi/index.js +1 -122
  4. package/client-cloudfront/index.js +1 -14
  5. package/client-cloudwatch/index.d.ts +3 -2
  6. package/client-cloudwatch/index.js +2 -57
  7. package/client-cognito-identity-provider/index.d.ts +2 -2
  8. package/client-cognito-identity-provider/index.js +14 -70
  9. package/client-cognito-identity-provider/index.js.map +1 -1
  10. package/client-dynamodb/getDocumentClient.js +28 -53
  11. package/client-dynamodb/getDocumentClient.js.map +1 -1
  12. package/client-dynamodb/index.d.ts +3 -3
  13. package/client-dynamodb/index.js +4 -101
  14. package/client-eventbridge/index.d.ts +2 -2
  15. package/client-eventbridge/index.js +5 -31
  16. package/client-eventbridge/index.js.map +1 -1
  17. package/client-iam/index.js +1 -14
  18. package/client-iot/index.js +1 -20
  19. package/client-lambda/index.d.ts +2 -2
  20. package/client-lambda/index.js +14 -52
  21. package/client-lambda/index.js.map +1 -1
  22. package/client-s3/index.d.ts +3 -3
  23. package/client-s3/index.js +34 -187
  24. package/client-s3/index.js.map +1 -1
  25. package/client-scheduler/index.js +16 -56
  26. package/client-scheduler/index.js.map +1 -1
  27. package/client-sfn/index.js +45 -88
  28. package/client-sfn/index.js.map +1 -1
  29. package/client-sqs/index.d.ts +2 -1
  30. package/client-sqs/index.js +1 -26
  31. package/client-sts/index.js +1 -14
  32. package/credential-providers/index.js +1 -14
  33. package/lib-storage/index.d.ts +2 -1
  34. package/lib-storage/index.js +1 -44
  35. package/package.json +39 -39
  36. package/types/index.js +1 -18
  37. package/client-apigatewaymanagementapi/index.js.map +0 -1
  38. package/client-cloudfront/index.js.map +0 -1
  39. package/client-cloudwatch/index.js.map +0 -1
  40. package/client-dynamodb/index.js.map +0 -1
  41. package/client-iam/index.js.map +0 -1
  42. package/client-iot/index.js.map +0 -1
  43. package/client-sqs/index.js.map +0 -1
  44. package/client-sts/index.js.map +0 -1
  45. package/credential-providers/index.js.map +0 -1
  46. package/lib-storage/index.js.map +0 -1
  47. package/types/index.js.map +0 -1
@@ -1,20 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "DescribeEndpointCommand", {
7
- enumerable: true,
8
- get: function () {
9
- return _clientIot.DescribeEndpointCommand;
10
- }
11
- });
12
- Object.defineProperty(exports, "IoTClient", {
13
- enumerable: true,
14
- get: function () {
15
- return _clientIot.IoTClient;
16
- }
17
- });
18
- var _clientIot = require("@aws-sdk/client-iot");
19
-
20
- //# sourceMappingURL=index.js.map
1
+ export { DescribeEndpointCommand, IoTClient } from "@aws-sdk/client-iot";
@@ -1,5 +1,5 @@
1
1
  import type { LambdaClientConfig } from "@aws-sdk/client-lambda";
2
2
  import { LambdaClient } from "@aws-sdk/client-lambda";
3
- export { LambdaClient, InvokeCommand, GetFunctionConfigurationCommand, UpdateFunctionConfigurationCommand, UpdateFunctionCodeCommand } from "@aws-sdk/client-lambda";
4
- export type { InvocationType, InvokeCommandInput, LambdaClientConfig, InvokeCommandOutput, UpdateFunctionConfigurationCommandInput, UpdateFunctionConfigurationCommandOutput, UpdateFunctionCodeCommandInput, UpdateFunctionCodeCommandOutput } from "@aws-sdk/client-lambda";
3
+ export { LambdaClient, InvokeCommand, GetFunctionConfigurationCommand, UpdateFunctionConfigurationCommand, UpdateFunctionCodeCommand, InvocationType } from "@aws-sdk/client-lambda";
4
+ export type { InvokeCommandInput, LambdaClientConfig, InvokeCommandOutput, UpdateFunctionConfigurationCommandInput, UpdateFunctionConfigurationCommandOutput, UpdateFunctionCodeCommandInput, UpdateFunctionCodeCommandOutput } from "@aws-sdk/client-lambda";
5
5
  export declare const createLambdaClient: (input?: Partial<LambdaClientConfig>) => LambdaClient;
@@ -1,58 +1,20 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "GetFunctionConfigurationCommand", {
7
- enumerable: true,
8
- get: function () {
9
- return _clientLambda.GetFunctionConfigurationCommand;
10
- }
11
- });
12
- Object.defineProperty(exports, "InvokeCommand", {
13
- enumerable: true,
14
- get: function () {
15
- return _clientLambda.InvokeCommand;
16
- }
17
- });
18
- Object.defineProperty(exports, "LambdaClient", {
19
- enumerable: true,
20
- get: function () {
21
- return _clientLambda.LambdaClient;
22
- }
23
- });
24
- Object.defineProperty(exports, "UpdateFunctionCodeCommand", {
25
- enumerable: true,
26
- get: function () {
27
- return _clientLambda.UpdateFunctionCodeCommand;
28
- }
29
- });
30
- Object.defineProperty(exports, "UpdateFunctionConfigurationCommand", {
31
- enumerable: true,
32
- get: function () {
33
- return _clientLambda.UpdateFunctionConfigurationCommand;
34
- }
35
- });
36
- exports.createLambdaClient = void 0;
37
- var _utils = require("@webiny/utils");
38
- var _clientLambda = require("@aws-sdk/client-lambda");
1
+ import { createCacheKey } from "@webiny/utils";
2
+ import { GetFunctionConfigurationCommand, InvocationType, InvokeCommand, LambdaClient, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand } from "@aws-sdk/client-lambda";
39
3
  const DEFAULT_CONFIG = {
40
- region: process.env.AWS_REGION
4
+ region: process.env.AWS_REGION
41
5
  };
42
6
  const lambdaClients = {};
43
- const createLambdaClient = input => {
44
- const config = {
45
- ...DEFAULT_CONFIG,
46
- ...input
47
- };
48
- const key = (0, _utils.createCacheKey)(config);
49
- if (lambdaClients[key]) {
50
- return lambdaClients[key];
51
- }
52
- const client = new _clientLambda.LambdaClient(config);
53
- lambdaClients[key] = client;
54
- return client;
7
+ const createLambdaClient = (input)=>{
8
+ const config = {
9
+ ...DEFAULT_CONFIG,
10
+ ...input
11
+ };
12
+ const key = createCacheKey(config);
13
+ if (lambdaClients[key]) return lambdaClients[key];
14
+ const client = new LambdaClient(config);
15
+ lambdaClients[key] = client;
16
+ return client;
55
17
  };
56
- exports.createLambdaClient = createLambdaClient;
18
+ export { GetFunctionConfigurationCommand, InvocationType, InvokeCommand, LambdaClient, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, createLambdaClient };
57
19
 
58
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","_clientLambda","DEFAULT_CONFIG","region","process","env","AWS_REGION","lambdaClients","createLambdaClient","input","config","key","createCacheKey","client","LambdaClient","exports"],"sources":["index.ts"],"sourcesContent":["import { createCacheKey } from \"@webiny/utils\";\nimport type { LambdaClientConfig } from \"@aws-sdk/client-lambda\";\nimport { LambdaClient } from \"@aws-sdk/client-lambda\";\n\nexport {\n LambdaClient,\n InvokeCommand,\n GetFunctionConfigurationCommand,\n UpdateFunctionConfigurationCommand,\n UpdateFunctionCodeCommand\n} from \"@aws-sdk/client-lambda\";\n\nexport type {\n InvocationType,\n InvokeCommandInput,\n LambdaClientConfig,\n InvokeCommandOutput,\n UpdateFunctionConfigurationCommandInput,\n UpdateFunctionConfigurationCommandOutput,\n UpdateFunctionCodeCommandInput,\n UpdateFunctionCodeCommandOutput\n} from \"@aws-sdk/client-lambda\";\n\nconst DEFAULT_CONFIG: LambdaClientConfig = {\n region: process.env.AWS_REGION\n};\n\nconst lambdaClients: Record<string, LambdaClient> = {};\n\nexport const createLambdaClient = (input?: Partial<LambdaClientConfig>): LambdaClient => {\n const config: LambdaClientConfig = {\n ...DEFAULT_CONFIG,\n ...input\n };\n const key = createCacheKey(config);\n\n if (lambdaClients[key]) {\n return lambdaClients[key];\n }\n\n const client = new LambdaClient(config);\n\n lambdaClients[key] = client;\n\n return client;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AAqBA,MAAME,cAAkC,GAAG;EACvCC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC;AACxB,CAAC;AAED,MAAMC,aAA2C,GAAG,CAAC,CAAC;AAE/C,MAAMC,kBAAkB,GAAIC,KAAmC,IAAmB;EACrF,MAAMC,MAA0B,GAAG;IAC/B,GAAGR,cAAc;IACjB,GAAGO;EACP,CAAC;EACD,MAAME,GAAG,GAAG,IAAAC,qBAAc,EAACF,MAAM,CAAC;EAElC,IAAIH,aAAa,CAACI,GAAG,CAAC,EAAE;IACpB,OAAOJ,aAAa,CAACI,GAAG,CAAC;EAC7B;EAEA,MAAME,MAAM,GAAG,IAAIC,0BAAY,CAACJ,MAAM,CAAC;EAEvCH,aAAa,CAACI,GAAG,CAAC,GAAGE,MAAM;EAE3B,OAAOA,MAAM;AACjB,CAAC;AAACE,OAAA,CAAAP,kBAAA,GAAAA,kBAAA","ignoreList":[]}
1
+ {"version":3,"file":"client-lambda/index.js","sources":["../../src/client-lambda/index.ts"],"sourcesContent":["import { createCacheKey } from \"@webiny/utils\";\nimport type { LambdaClientConfig } from \"@aws-sdk/client-lambda\";\nimport { LambdaClient } from \"@aws-sdk/client-lambda\";\n\nexport {\n LambdaClient,\n InvokeCommand,\n GetFunctionConfigurationCommand,\n UpdateFunctionConfigurationCommand,\n UpdateFunctionCodeCommand,\n InvocationType\n} from \"@aws-sdk/client-lambda\";\n\nexport type {\n InvokeCommandInput,\n LambdaClientConfig,\n InvokeCommandOutput,\n UpdateFunctionConfigurationCommandInput,\n UpdateFunctionConfigurationCommandOutput,\n UpdateFunctionCodeCommandInput,\n UpdateFunctionCodeCommandOutput\n} from \"@aws-sdk/client-lambda\";\n\nconst DEFAULT_CONFIG: LambdaClientConfig = {\n region: process.env.AWS_REGION\n};\n\nconst lambdaClients: Record<string, LambdaClient> = {};\n\nexport const createLambdaClient = (input?: Partial<LambdaClientConfig>): LambdaClient => {\n const config: LambdaClientConfig = {\n ...DEFAULT_CONFIG,\n ...input\n };\n const key = createCacheKey(config);\n\n if (lambdaClients[key]) {\n return lambdaClients[key];\n }\n\n const client = new LambdaClient(config);\n\n lambdaClients[key] = client;\n\n return client;\n};\n"],"names":["DEFAULT_CONFIG","process","lambdaClients","createLambdaClient","input","config","key","createCacheKey","client","LambdaClient"],"mappings":";;AAuBA,MAAMA,iBAAqC;IACvC,QAAQC,QAAQ,GAAG,CAAC,UAAU;AAClC;AAEA,MAAMC,gBAA8C,CAAC;AAE9C,MAAMC,qBAAqB,CAACC;IAC/B,MAAMC,SAA6B;QAC/B,GAAGL,cAAc;QACjB,GAAGI,KAAK;IACZ;IACA,MAAME,MAAMC,eAAeF;IAE3B,IAAIH,aAAa,CAACI,IAAI,EAClB,OAAOJ,aAAa,CAACI,IAAI;IAG7B,MAAME,SAAS,IAAIC,aAAaJ;IAEhCH,aAAa,CAACI,IAAI,GAAGE;IAErB,OAAOA;AACX"}
@@ -1,9 +1,9 @@
1
1
  import type { S3ClientConfig as BaseS3ClientConfig } from "@aws-sdk/client-s3";
2
2
  import { S3, S3Client } from "@aws-sdk/client-s3";
3
- export { CopyObjectCommand, GetObjectCommand, HeadObjectCommand, ListObjectsCommand, UploadPartCopyCommand, ListObjectsV2Command, ListPartsCommand, ObjectCannedACL, Part, DeleteObjectCommand, PutObjectCommand, PutObjectCommandInput, PutObjectRequest, UploadPartCommand, AbortMultipartUploadCommand, CompleteMultipartUploadCommand, CreateMultipartUploadCommand, S3, S3Client } from "@aws-sdk/client-s3";
4
- export type { CopyObjectCommandInput, CopyObjectCommandOutput, DeleteObjectCommandInput, DeleteObjectsCommandInput, DeleteObjectsCommandOutput, AbortMultipartUploadCommandInput, CompleteMultipartUploadCommandInput, UploadPartCopyCommandInput, CreateMultipartUploadCommandInput, CompleteMultipartUploadCommandOutput, AbortMultipartUploadCommandOutput, CompleteMultipartUploadOutput, DeleteObjectOutput, GetObjectOutput, CompletedPart, GetObjectCommandOutput, HeadObjectOutput, HeadObjectCommandInput, HeadObjectCommandOutput, DeleteObjectCommandOutput, ListObjectsOutput, ListPartsCommandOutput, ListPartsOutput, PutObjectCommandOutput, UploadPartCommandOutput } from "@aws-sdk/client-s3";
3
+ export { CopyObjectCommand, GetObjectCommand, HeadObjectCommand, ListObjectsCommand, UploadPartCopyCommand, ListObjectsV2Command, ListPartsCommand, ObjectCannedACL, DeleteObjectCommand, PutObjectCommand, UploadPartCommand, AbortMultipartUploadCommand, CompleteMultipartUploadCommand, CreateMultipartUploadCommand, S3, S3Client } from "@aws-sdk/client-s3";
4
+ export type { PutObjectRequest, PutObjectCommandInput, Part, CopyObjectCommandInput, CopyObjectCommandOutput, DeleteObjectCommandInput, DeleteObjectsCommandInput, DeleteObjectsCommandOutput, AbortMultipartUploadCommandInput, CompleteMultipartUploadCommandInput, UploadPartCopyCommandInput, CreateMultipartUploadCommandInput, CompleteMultipartUploadCommandOutput, AbortMultipartUploadCommandOutput, CompleteMultipartUploadOutput, DeleteObjectOutput, GetObjectOutput, CompletedPart, GetObjectCommandOutput, HeadObjectOutput, HeadObjectCommandInput, HeadObjectCommandOutput, DeleteObjectCommandOutput, ListObjectsOutput, ListPartsCommandOutput, ListPartsOutput, PutObjectCommandOutput, UploadPartCommandOutput } from "@aws-sdk/client-s3";
5
5
  export { createPresignedPost } from "@aws-sdk/s3-presigned-post";
6
- export { PresignedPost, PresignedPostOptions } from "@aws-sdk/s3-presigned-post";
6
+ export type { PresignedPost, PresignedPostOptions } from "@aws-sdk/s3-presigned-post";
7
7
  export { getSignedUrl } from "@aws-sdk/s3-request-presigner";
8
8
  export interface S3ClientConfig extends BaseS3ClientConfig {
9
9
  cache?: boolean;
@@ -1,194 +1,41 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "AbortMultipartUploadCommand", {
7
- enumerable: true,
8
- get: function () {
9
- return _clientS.AbortMultipartUploadCommand;
10
- }
11
- });
12
- Object.defineProperty(exports, "CompleteMultipartUploadCommand", {
13
- enumerable: true,
14
- get: function () {
15
- return _clientS.CompleteMultipartUploadCommand;
16
- }
17
- });
18
- Object.defineProperty(exports, "CopyObjectCommand", {
19
- enumerable: true,
20
- get: function () {
21
- return _clientS.CopyObjectCommand;
22
- }
23
- });
24
- Object.defineProperty(exports, "CreateMultipartUploadCommand", {
25
- enumerable: true,
26
- get: function () {
27
- return _clientS.CreateMultipartUploadCommand;
28
- }
29
- });
30
- Object.defineProperty(exports, "DeleteObjectCommand", {
31
- enumerable: true,
32
- get: function () {
33
- return _clientS.DeleteObjectCommand;
34
- }
35
- });
36
- Object.defineProperty(exports, "GetObjectCommand", {
37
- enumerable: true,
38
- get: function () {
39
- return _clientS.GetObjectCommand;
40
- }
41
- });
42
- Object.defineProperty(exports, "HeadObjectCommand", {
43
- enumerable: true,
44
- get: function () {
45
- return _clientS.HeadObjectCommand;
46
- }
47
- });
48
- Object.defineProperty(exports, "ListObjectsCommand", {
49
- enumerable: true,
50
- get: function () {
51
- return _clientS.ListObjectsCommand;
52
- }
53
- });
54
- Object.defineProperty(exports, "ListObjectsV2Command", {
55
- enumerable: true,
56
- get: function () {
57
- return _clientS.ListObjectsV2Command;
58
- }
59
- });
60
- Object.defineProperty(exports, "ListPartsCommand", {
61
- enumerable: true,
62
- get: function () {
63
- return _clientS.ListPartsCommand;
64
- }
65
- });
66
- Object.defineProperty(exports, "ObjectCannedACL", {
67
- enumerable: true,
68
- get: function () {
69
- return _clientS.ObjectCannedACL;
70
- }
71
- });
72
- Object.defineProperty(exports, "Part", {
73
- enumerable: true,
74
- get: function () {
75
- return _clientS.Part;
76
- }
77
- });
78
- Object.defineProperty(exports, "PresignedPost", {
79
- enumerable: true,
80
- get: function () {
81
- return _s3PresignedPost.PresignedPost;
82
- }
83
- });
84
- Object.defineProperty(exports, "PresignedPostOptions", {
85
- enumerable: true,
86
- get: function () {
87
- return _s3PresignedPost.PresignedPostOptions;
88
- }
89
- });
90
- Object.defineProperty(exports, "PutObjectCommand", {
91
- enumerable: true,
92
- get: function () {
93
- return _clientS.PutObjectCommand;
94
- }
95
- });
96
- Object.defineProperty(exports, "PutObjectCommandInput", {
97
- enumerable: true,
98
- get: function () {
99
- return _clientS.PutObjectCommandInput;
100
- }
101
- });
102
- Object.defineProperty(exports, "PutObjectRequest", {
103
- enumerable: true,
104
- get: function () {
105
- return _clientS.PutObjectRequest;
106
- }
107
- });
108
- Object.defineProperty(exports, "S3", {
109
- enumerable: true,
110
- get: function () {
111
- return _clientS.S3;
112
- }
113
- });
114
- Object.defineProperty(exports, "S3Client", {
115
- enumerable: true,
116
- get: function () {
117
- return _clientS.S3Client;
118
- }
119
- });
120
- Object.defineProperty(exports, "UploadPartCommand", {
121
- enumerable: true,
122
- get: function () {
123
- return _clientS.UploadPartCommand;
124
- }
125
- });
126
- Object.defineProperty(exports, "UploadPartCopyCommand", {
127
- enumerable: true,
128
- get: function () {
129
- return _clientS.UploadPartCopyCommand;
130
- }
131
- });
132
- Object.defineProperty(exports, "createPresignedPost", {
133
- enumerable: true,
134
- get: function () {
135
- return _s3PresignedPost.createPresignedPost;
136
- }
137
- });
138
- exports.createS3Client = exports.createS3 = void 0;
139
- Object.defineProperty(exports, "getSignedUrl", {
140
- enumerable: true,
141
- get: function () {
142
- return _s3RequestPresigner.getSignedUrl;
143
- }
144
- });
145
- var _clientS = require("@aws-sdk/client-s3");
146
- var _utils = require("@webiny/utils");
147
- var _s3PresignedPost = require("@aws-sdk/s3-presigned-post");
148
- var _s3RequestPresigner = require("@aws-sdk/s3-request-presigner");
1
+ import { AbortMultipartUploadCommand, CompleteMultipartUploadCommand, CopyObjectCommand, CreateMultipartUploadCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand, ListObjectsCommand, ListObjectsV2Command, ListPartsCommand, ObjectCannedACL, PutObjectCommand, S3, S3Client, UploadPartCommand, UploadPartCopyCommand } from "@aws-sdk/client-s3";
2
+ import { createCacheKey } from "@webiny/utils";
149
3
  const s3ClientsCache = new Map();
150
- const createS3Client = initial => {
151
- const options = {
152
- region: process.env.AWS_REGION,
153
- ...initial
154
- };
155
- const skipCache = options.cache === false;
156
- delete options.cache;
157
- if (skipCache) {
158
- return new _clientS.S3Client({
159
- ...options
4
+ const createS3Client = (initial)=>{
5
+ const options = {
6
+ region: process.env.AWS_REGION,
7
+ ...initial
8
+ };
9
+ const skipCache = false === options.cache;
10
+ delete options.cache;
11
+ if (skipCache) return new S3Client({
12
+ ...options
13
+ });
14
+ const key = createCacheKey(options);
15
+ if (s3ClientsCache.has(key)) return s3ClientsCache.get(key);
16
+ const instance = new S3Client({
17
+ ...options
160
18
  });
161
- }
162
- const key = (0, _utils.createCacheKey)(options);
163
- if (s3ClientsCache.has(key)) {
164
- return s3ClientsCache.get(key);
165
- }
166
- const instance = new _clientS.S3Client({
167
- ...options
168
- });
169
- s3ClientsCache.set(key, instance);
170
- return instance;
19
+ s3ClientsCache.set(key, instance);
20
+ return instance;
171
21
  };
172
- exports.createS3Client = createS3Client;
173
22
  const s3Cache = new Map();
174
- const createS3 = initial => {
175
- const options = {
176
- region: process.env.AWS_REGION,
177
- ...initial
178
- };
179
- const skipCache = options.cache === false;
180
- delete options.cache;
181
- if (skipCache) {
182
- return new _clientS.S3(options);
183
- }
184
- const key = (0, _utils.createCacheKey)(options);
185
- if (s3Cache.has(key)) {
186
- return s3Cache.get(key);
187
- }
188
- const instance = new _clientS.S3(options);
189
- s3Cache.set(key, instance);
190
- return instance;
23
+ const createS3 = (initial)=>{
24
+ const options = {
25
+ region: process.env.AWS_REGION,
26
+ ...initial
27
+ };
28
+ const skipCache = false === options.cache;
29
+ delete options.cache;
30
+ if (skipCache) return new S3(options);
31
+ const key = createCacheKey(options);
32
+ if (s3Cache.has(key)) return s3Cache.get(key);
33
+ const instance = new S3(options);
34
+ s3Cache.set(key, instance);
35
+ return instance;
191
36
  };
192
- exports.createS3 = createS3;
37
+ export { createPresignedPost } from "@aws-sdk/s3-presigned-post";
38
+ export { getSignedUrl } from "@aws-sdk/s3-request-presigner";
39
+ export { AbortMultipartUploadCommand, CompleteMultipartUploadCommand, CopyObjectCommand, CreateMultipartUploadCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand, ListObjectsCommand, ListObjectsV2Command, ListPartsCommand, ObjectCannedACL, PutObjectCommand, S3, S3Client, UploadPartCommand, UploadPartCopyCommand, createS3, createS3Client };
193
40
 
194
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clientS","require","_utils","_s3PresignedPost","_s3RequestPresigner","s3ClientsCache","Map","createS3Client","initial","options","region","process","env","AWS_REGION","skipCache","cache","S3Client","key","createCacheKey","has","get","instance","set","exports","s3Cache","createS3","S3"],"sources":["index.ts"],"sourcesContent":["import type { S3ClientConfig as BaseS3ClientConfig } from \"@aws-sdk/client-s3\";\nimport { S3, S3Client } from \"@aws-sdk/client-s3\";\nimport { createCacheKey } from \"@webiny/utils\";\n\nexport {\n CopyObjectCommand,\n GetObjectCommand,\n HeadObjectCommand,\n ListObjectsCommand,\n UploadPartCopyCommand,\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 CopyObjectCommandInput,\n CopyObjectCommandOutput,\n DeleteObjectCommandInput,\n DeleteObjectsCommandInput,\n DeleteObjectsCommandOutput,\n AbortMultipartUploadCommandInput,\n CompleteMultipartUploadCommandInput,\n UploadPartCopyCommandInput,\n CreateMultipartUploadCommandInput,\n CompleteMultipartUploadCommandOutput,\n AbortMultipartUploadCommandOutput,\n CompleteMultipartUploadOutput,\n DeleteObjectOutput,\n GetObjectOutput,\n CompletedPart,\n GetObjectCommandOutput,\n HeadObjectOutput,\n HeadObjectCommandInput,\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAoDA,IAAAE,gBAAA,GAAAF,OAAA;AAGA,IAAAG,mBAAA,GAAAH,OAAA;AAEA,MAAMI,cAAc,GAAG,IAAIC,GAAG,CAAmB,CAAC;AAM3C,MAAMC,cAAc,GAAIC,OAAwB,IAAe;EAClE,MAAMC,OAAuB,GAAG;IAC5BC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC,UAAU;IAC9B,GAAGL;EACP,CAAC;EACD,MAAMM,SAAS,GAAGL,OAAO,CAACM,KAAK,KAAK,KAAK;EACzC,OAAON,OAAO,CAACM,KAAK;EACpB,IAAID,SAAS,EAAE;IACX,OAAO,IAAIE,iBAAQ,CAAC;MAChB,GAAGP;IACP,CAAC,CAAC;EACN;EAEA,MAAMQ,GAAG,GAAG,IAAAC,qBAAc,EAACT,OAAO,CAAC;EACnC,IAAIJ,cAAc,CAACc,GAAG,CAACF,GAAG,CAAC,EAAE;IACzB,OAAOZ,cAAc,CAACe,GAAG,CAACH,GAAG,CAAC;EAClC;EAEA,MAAMI,QAAQ,GAAG,IAAIL,iBAAQ,CAAC;IAC1B,GAAGP;EACP,CAAC,CAAC;EACFJ,cAAc,CAACiB,GAAG,CAACL,GAAG,EAAEI,QAAQ,CAAC;EAEjC,OAAOA,QAAQ;AACnB,CAAC;AAACE,OAAA,CAAAhB,cAAA,GAAAA,cAAA;AAEF,MAAMiB,OAAO,GAAG,IAAIlB,GAAG,CAAa,CAAC;AAE9B,MAAMmB,QAAQ,GAAIjB,OAAwB,IAAS;EACtD,MAAMC,OAAuB,GAAG;IAC5BC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC,UAAU;IAC9B,GAAGL;EACP,CAAC;EACD,MAAMM,SAAS,GAAGL,OAAO,CAACM,KAAK,KAAK,KAAK;EACzC,OAAON,OAAO,CAACM,KAAK;EACpB,IAAID,SAAS,EAAE;IACX,OAAO,IAAIY,WAAE,CAACjB,OAAO,CAAC;EAC1B;EACA,MAAMQ,GAAG,GAAG,IAAAC,qBAAc,EAACT,OAAO,CAAC;EACnC,IAAIe,OAAO,CAACL,GAAG,CAACF,GAAG,CAAC,EAAE;IAClB,OAAOO,OAAO,CAACJ,GAAG,CAACH,GAAG,CAAC;EAC3B;EAEA,MAAMI,QAAQ,GAAG,IAAIK,WAAE,CAACjB,OAAO,CAAC;EAEhCe,OAAO,CAACF,GAAG,CAACL,GAAG,EAAEI,QAAQ,CAAC;EAC1B,OAAOA,QAAQ;AACnB,CAAC;AAACE,OAAA,CAAAE,QAAA,GAAAA,QAAA","ignoreList":[]}
1
+ {"version":3,"file":"client-s3/index.js","sources":["../../src/client-s3/index.ts"],"sourcesContent":["import type { S3ClientConfig as BaseS3ClientConfig } from \"@aws-sdk/client-s3\";\nimport { S3, S3Client } from \"@aws-sdk/client-s3\";\nimport { createCacheKey } from \"@webiny/utils\";\n\nexport {\n CopyObjectCommand,\n GetObjectCommand,\n HeadObjectCommand,\n ListObjectsCommand,\n UploadPartCopyCommand,\n ListObjectsV2Command,\n ListPartsCommand,\n ObjectCannedACL,\n DeleteObjectCommand,\n PutObjectCommand,\n UploadPartCommand,\n AbortMultipartUploadCommand,\n CompleteMultipartUploadCommand,\n CreateMultipartUploadCommand,\n S3,\n S3Client\n} from \"@aws-sdk/client-s3\";\n\nexport type {\n PutObjectRequest,\n PutObjectCommandInput,\n Part,\n CopyObjectCommandInput,\n CopyObjectCommandOutput,\n DeleteObjectCommandInput,\n DeleteObjectsCommandInput,\n DeleteObjectsCommandOutput,\n AbortMultipartUploadCommandInput,\n CompleteMultipartUploadCommandInput,\n UploadPartCopyCommandInput,\n CreateMultipartUploadCommandInput,\n CompleteMultipartUploadCommandOutput,\n AbortMultipartUploadCommandOutput,\n CompleteMultipartUploadOutput,\n DeleteObjectOutput,\n GetObjectOutput,\n CompletedPart,\n GetObjectCommandOutput,\n HeadObjectOutput,\n HeadObjectCommandInput,\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 type { 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"],"names":["s3ClientsCache","Map","createS3Client","initial","options","process","skipCache","S3Client","key","createCacheKey","instance","s3Cache","createS3","S3"],"mappings":";;AA2DA,MAAMA,iBAAiB,IAAIC;AAMpB,MAAMC,iBAAiB,CAACC;IAC3B,MAAMC,UAA0B;QAC5B,QAAQC,QAAQ,GAAG,CAAC,UAAU;QAC9B,GAAGF,OAAO;IACd;IACA,MAAMG,YAAYF,AAAkB,UAAlBA,QAAQ,KAAK;IAC/B,OAAOA,QAAQ,KAAK;IACpB,IAAIE,WACA,OAAO,IAAIC,SAAS;QAChB,GAAGH,OAAO;IACd;IAGJ,MAAMI,MAAMC,eAAeL;IAC3B,IAAIJ,eAAe,GAAG,CAACQ,MACnB,OAAOR,eAAe,GAAG,CAACQ;IAG9B,MAAME,WAAW,IAAIH,SAAS;QAC1B,GAAGH,OAAO;IACd;IACAJ,eAAe,GAAG,CAACQ,KAAKE;IAExB,OAAOA;AACX;AAEA,MAAMC,UAAU,IAAIV;AAEb,MAAMW,WAAW,CAACT;IACrB,MAAMC,UAA0B;QAC5B,QAAQC,QAAQ,GAAG,CAAC,UAAU;QAC9B,GAAGF,OAAO;IACd;IACA,MAAMG,YAAYF,AAAkB,UAAlBA,QAAQ,KAAK;IAC/B,OAAOA,QAAQ,KAAK;IACpB,IAAIE,WACA,OAAO,IAAIO,GAAGT;IAElB,MAAMI,MAAMC,eAAeL;IAC3B,IAAIO,QAAQ,GAAG,CAACH,MACZ,OAAOG,QAAQ,GAAG,CAACH;IAGvB,MAAME,WAAW,IAAIG,GAAGT;IAExBO,QAAQ,GAAG,CAACH,KAAKE;IACjB,OAAOA;AACX"}
@@ -1,60 +1,20 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "CreateScheduleCommand", {
7
- enumerable: true,
8
- get: function () {
9
- return _clientScheduler.CreateScheduleCommand;
10
- }
11
- });
12
- Object.defineProperty(exports, "DeleteScheduleCommand", {
13
- enumerable: true,
14
- get: function () {
15
- return _clientScheduler.DeleteScheduleCommand;
16
- }
17
- });
18
- Object.defineProperty(exports, "GetScheduleCommand", {
19
- enumerable: true,
20
- get: function () {
21
- return _clientScheduler.GetScheduleCommand;
22
- }
23
- });
24
- Object.defineProperty(exports, "SchedulerClient", {
25
- enumerable: true,
26
- get: function () {
27
- return _clientScheduler.SchedulerClient;
28
- }
29
- });
30
- Object.defineProperty(exports, "UpdateScheduleCommand", {
31
- enumerable: true,
32
- get: function () {
33
- return _clientScheduler.UpdateScheduleCommand;
34
- }
35
- });
36
- exports.createSchedulerClient = void 0;
37
- var _utils = require("@webiny/utils");
38
- var _clientScheduler = require("@aws-sdk/client-scheduler");
1
+ import { createCacheKey } from "@webiny/utils";
2
+ import { CreateScheduleCommand, DeleteScheduleCommand, GetScheduleCommand, SchedulerClient, UpdateScheduleCommand } from "@aws-sdk/client-scheduler";
39
3
  const clients = {};
40
- const createSchedulerClient = (input = {}) => {
41
- const options = {
42
- region: process.env.AWS_REGION,
43
- ...input
44
- };
45
- const skipCache = options.cache === false;
46
- delete options.cache;
47
- if (skipCache) {
48
- return new _clientScheduler.SchedulerClient(options);
49
- }
50
- const key = (0, _utils.createCacheKey)(options);
51
- if (clients[key]) {
52
- return clients[key];
53
- }
54
- const client = new _clientScheduler.SchedulerClient(options);
55
- clients[key] = client;
56
- return client;
4
+ const createSchedulerClient = (input = {})=>{
5
+ const options = {
6
+ region: process.env.AWS_REGION,
7
+ ...input
8
+ };
9
+ const skipCache = false === options.cache;
10
+ delete options.cache;
11
+ if (skipCache) return new SchedulerClient(options);
12
+ const key = createCacheKey(options);
13
+ if (clients[key]) return clients[key];
14
+ const client = new SchedulerClient(options);
15
+ clients[key] = client;
16
+ return client;
57
17
  };
58
- exports.createSchedulerClient = createSchedulerClient;
18
+ export { CreateScheduleCommand, DeleteScheduleCommand, GetScheduleCommand, SchedulerClient, UpdateScheduleCommand, createSchedulerClient };
59
19
 
60
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_utils","require","_clientScheduler","clients","createSchedulerClient","input","options","region","process","env","AWS_REGION","skipCache","cache","SchedulerClient","key","createCacheKey","client","exports"],"sources":["index.ts"],"sourcesContent":["import { createCacheKey } from \"@webiny/utils\";\nimport type { SchedulerClientConfig as BaseSchedulerClientConfig } from \"@aws-sdk/client-scheduler\";\nimport { SchedulerClient } from \"@aws-sdk/client-scheduler\";\n\nexport {\n SchedulerClient,\n GetScheduleCommand,\n CreateScheduleCommand,\n UpdateScheduleCommand,\n DeleteScheduleCommand\n} from \"@aws-sdk/client-scheduler\";\n\nexport type {\n GetScheduleCommandInput,\n GetScheduleCommandOutput,\n CreateScheduleCommandInput,\n CreateScheduleCommandOutput,\n UpdateScheduleCommandInput,\n UpdateScheduleCommandOutput,\n DeleteScheduleCommandInput,\n DeleteScheduleCommandOutput\n} from \"@aws-sdk/client-scheduler\";\n\nconst clients: Record<string, SchedulerClient> = {};\n\nexport interface SchedulerClientConfig extends BaseSchedulerClientConfig {\n cache?: boolean;\n}\n\nexport const createSchedulerClient = (\n input: Partial<SchedulerClientConfig> = {}\n): SchedulerClient => {\n const options: SchedulerClientConfig = {\n region: process.env.AWS_REGION,\n ...input\n };\n\n const skipCache = options.cache === false;\n delete options.cache;\n if (skipCache) {\n return new SchedulerClient(options);\n }\n\n const key = createCacheKey(options);\n\n if (clients[key]) {\n return clients[key];\n }\n\n const client = new SchedulerClient(options);\n\n clients[key] = client;\n\n return client;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAD,OAAA;AAqBA,MAAME,OAAwC,GAAG,CAAC,CAAC;AAM5C,MAAMC,qBAAqB,GAAGA,CACjCC,KAAqC,GAAG,CAAC,CAAC,KACxB;EAClB,MAAMC,OAA8B,GAAG;IACnCC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC,UAAU;IAC9B,GAAGL;EACP,CAAC;EAED,MAAMM,SAAS,GAAGL,OAAO,CAACM,KAAK,KAAK,KAAK;EACzC,OAAON,OAAO,CAACM,KAAK;EACpB,IAAID,SAAS,EAAE;IACX,OAAO,IAAIE,gCAAe,CAACP,OAAO,CAAC;EACvC;EAEA,MAAMQ,GAAG,GAAG,IAAAC,qBAAc,EAACT,OAAO,CAAC;EAEnC,IAAIH,OAAO,CAACW,GAAG,CAAC,EAAE;IACd,OAAOX,OAAO,CAACW,GAAG,CAAC;EACvB;EAEA,MAAME,MAAM,GAAG,IAAIH,gCAAe,CAACP,OAAO,CAAC;EAE3CH,OAAO,CAACW,GAAG,CAAC,GAAGE,MAAM;EAErB,OAAOA,MAAM;AACjB,CAAC;AAACC,OAAA,CAAAb,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"file":"client-scheduler/index.js","sources":["../../src/client-scheduler/index.ts"],"sourcesContent":["import { createCacheKey } from \"@webiny/utils\";\nimport type { SchedulerClientConfig as BaseSchedulerClientConfig } from \"@aws-sdk/client-scheduler\";\nimport { SchedulerClient } from \"@aws-sdk/client-scheduler\";\n\nexport {\n SchedulerClient,\n GetScheduleCommand,\n CreateScheduleCommand,\n UpdateScheduleCommand,\n DeleteScheduleCommand\n} from \"@aws-sdk/client-scheduler\";\n\nexport type {\n GetScheduleCommandInput,\n GetScheduleCommandOutput,\n CreateScheduleCommandInput,\n CreateScheduleCommandOutput,\n UpdateScheduleCommandInput,\n UpdateScheduleCommandOutput,\n DeleteScheduleCommandInput,\n DeleteScheduleCommandOutput\n} from \"@aws-sdk/client-scheduler\";\n\nconst clients: Record<string, SchedulerClient> = {};\n\nexport interface SchedulerClientConfig extends BaseSchedulerClientConfig {\n cache?: boolean;\n}\n\nexport const createSchedulerClient = (\n input: Partial<SchedulerClientConfig> = {}\n): SchedulerClient => {\n const options: SchedulerClientConfig = {\n region: process.env.AWS_REGION,\n ...input\n };\n\n const skipCache = options.cache === false;\n delete options.cache;\n if (skipCache) {\n return new SchedulerClient(options);\n }\n\n const key = createCacheKey(options);\n\n if (clients[key]) {\n return clients[key];\n }\n\n const client = new SchedulerClient(options);\n\n clients[key] = client;\n\n return client;\n};\n"],"names":["clients","createSchedulerClient","input","options","process","skipCache","SchedulerClient","key","createCacheKey","client"],"mappings":";;AAuBA,MAAMA,UAA2C,CAAC;AAM3C,MAAMC,wBAAwB,CACjCC,QAAwC,CAAC,CAAC;IAE1C,MAAMC,UAAiC;QACnC,QAAQC,QAAQ,GAAG,CAAC,UAAU;QAC9B,GAAGF,KAAK;IACZ;IAEA,MAAMG,YAAYF,AAAkB,UAAlBA,QAAQ,KAAK;IAC/B,OAAOA,QAAQ,KAAK;IACpB,IAAIE,WACA,OAAO,IAAIC,gBAAgBH;IAG/B,MAAMI,MAAMC,eAAeL;IAE3B,IAAIH,OAAO,CAACO,IAAI,EACZ,OAAOP,OAAO,CAACO,IAAI;IAGvB,MAAME,SAAS,IAAIH,gBAAgBH;IAEnCH,OAAO,CAACO,IAAI,GAAGE;IAEf,OAAOA;AACX"}
@@ -1,96 +1,53 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "DescribeExecutionCommand", {
7
- enumerable: true,
8
- get: function () {
9
- return _clientSfn.DescribeExecutionCommand;
10
- }
11
- });
12
- Object.defineProperty(exports, "ListExecutionsCommand", {
13
- enumerable: true,
14
- get: function () {
15
- return _clientSfn.ListExecutionsCommand;
16
- }
17
- });
18
- Object.defineProperty(exports, "SFNClient", {
19
- enumerable: true,
20
- get: function () {
21
- return _clientSfn.SFNClient;
22
- }
23
- });
24
- Object.defineProperty(exports, "SFNServiceException", {
25
- enumerable: true,
26
- get: function () {
27
- return _clientSfn.SFNServiceException;
28
- }
29
- });
30
- Object.defineProperty(exports, "StartExecutionCommand", {
31
- enumerable: true,
32
- get: function () {
33
- return _clientSfn.StartExecutionCommand;
34
- }
35
- });
36
- exports.triggerStepFunctionFactory = exports.listExecutionsFactory = exports.describeExecutionFactory = exports.createStepFunctionClient = void 0;
37
- var _clientSfn = require("@aws-sdk/client-sfn");
38
- var _utils = require("@webiny/utils");
1
+ import { DescribeExecutionCommand, ListExecutionsCommand, SFNClient, SFNServiceException, StartExecutionCommand } from "@aws-sdk/client-sfn";
2
+ import { createCacheKey } from "@webiny/utils";
39
3
  const stepFunctionClientsCache = new Map();
40
- const createStepFunctionClient = initial => {
41
- const config = {
42
- region: process.env.AWS_REGION,
43
- ...initial
44
- };
45
- const skipCache = config.cache === false;
46
- delete config.cache;
47
- if (skipCache) {
48
- return new _clientSfn.SFNClient({
49
- ...config
4
+ const createStepFunctionClient = (initial)=>{
5
+ const config = {
6
+ region: process.env.AWS_REGION,
7
+ ...initial
8
+ };
9
+ const skipCache = false === config.cache;
10
+ delete config.cache;
11
+ if (skipCache) return new SFNClient({
12
+ ...config
50
13
  });
51
- }
52
- const key = (0, _utils.createCacheKey)(config);
53
- if (stepFunctionClientsCache.has(key)) {
54
- return stepFunctionClientsCache.get(key);
55
- }
56
- return new _clientSfn.SFNClient({
57
- ...config
58
- });
59
- };
60
- exports.createStepFunctionClient = createStepFunctionClient;
61
- const triggerStepFunctionFactory = input => {
62
- const client = input instanceof _clientSfn.SFNClient ? input : createStepFunctionClient(input);
63
- return async params => {
64
- const cmd = new _clientSfn.StartExecutionCommand({
65
- ...params,
66
- stateMachineArn: params.stateMachineArn || process.env.BG_TASK_SFN_ARN,
67
- name: params.name,
68
- input: JSON.stringify(params.input)
14
+ const key = createCacheKey(config);
15
+ if (stepFunctionClientsCache.has(key)) return stepFunctionClientsCache.get(key);
16
+ return new SFNClient({
17
+ ...config
69
18
  });
70
- return await client.send(cmd);
71
- };
72
19
  };
73
- exports.triggerStepFunctionFactory = triggerStepFunctionFactory;
74
- const listExecutionsFactory = input => {
75
- const client = input instanceof _clientSfn.SFNClient ? input : createStepFunctionClient(input);
76
- return async params => {
77
- const cmd = new _clientSfn.ListExecutionsCommand({
78
- ...params,
79
- stateMachineArn: params.stateMachineArn || process.env.BG_TASK_SFN_ARN
80
- });
81
- return await client.send(cmd);
82
- };
20
+ const triggerStepFunctionFactory = (input)=>{
21
+ const client = input instanceof SFNClient ? input : createStepFunctionClient(input);
22
+ return async (params)=>{
23
+ const cmd = new StartExecutionCommand({
24
+ ...params,
25
+ stateMachineArn: params.stateMachineArn || process.env.BG_TASK_SFN_ARN,
26
+ name: params.name,
27
+ input: JSON.stringify(params.input)
28
+ });
29
+ return await client.send(cmd);
30
+ };
83
31
  };
84
- exports.listExecutionsFactory = listExecutionsFactory;
85
- const describeExecutionFactory = input => {
86
- const client = input instanceof _clientSfn.SFNClient ? input : createStepFunctionClient(input);
87
- return async params => {
88
- const cmd = new _clientSfn.DescribeExecutionCommand({
89
- ...params
90
- });
91
- return await client.send(cmd);
92
- };
32
+ const listExecutionsFactory = (input)=>{
33
+ const client = input instanceof SFNClient ? input : createStepFunctionClient(input);
34
+ return async (params)=>{
35
+ const cmd = new ListExecutionsCommand({
36
+ ...params,
37
+ stateMachineArn: params.stateMachineArn || process.env.BG_TASK_SFN_ARN
38
+ });
39
+ return await client.send(cmd);
40
+ };
41
+ };
42
+ const describeExecutionFactory = (input)=>{
43
+ const client = input instanceof SFNClient ? input : createStepFunctionClient(input);
44
+ return async (params)=>{
45
+ const cmd = new DescribeExecutionCommand({
46
+ ...params
47
+ });
48
+ return await client.send(cmd);
49
+ };
93
50
  };
94
- exports.describeExecutionFactory = describeExecutionFactory;
51
+ export { DescribeExecutionCommand, ListExecutionsCommand, SFNClient, SFNServiceException, StartExecutionCommand, createStepFunctionClient, describeExecutionFactory, listExecutionsFactory, triggerStepFunctionFactory };
95
52
 
96
53
  //# sourceMappingURL=index.js.map