@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.
- package/README.md +11 -0
- package/client-apigatewaymanagementapi/index.d.ts +2 -1
- package/client-apigatewaymanagementapi/index.js +1 -122
- package/client-cloudfront/index.js +1 -14
- package/client-cloudwatch/index.d.ts +3 -2
- package/client-cloudwatch/index.js +2 -57
- package/client-cognito-identity-provider/index.d.ts +2 -2
- package/client-cognito-identity-provider/index.js +14 -70
- package/client-cognito-identity-provider/index.js.map +1 -1
- package/client-dynamodb/getDocumentClient.js +28 -53
- package/client-dynamodb/getDocumentClient.js.map +1 -1
- package/client-dynamodb/index.d.ts +3 -3
- package/client-dynamodb/index.js +4 -101
- package/client-eventbridge/index.d.ts +2 -2
- package/client-eventbridge/index.js +5 -31
- package/client-eventbridge/index.js.map +1 -1
- package/client-iam/index.js +1 -14
- package/client-iot/index.js +1 -20
- package/client-lambda/index.d.ts +2 -2
- package/client-lambda/index.js +14 -52
- package/client-lambda/index.js.map +1 -1
- package/client-s3/index.d.ts +3 -3
- package/client-s3/index.js +34 -187
- package/client-s3/index.js.map +1 -1
- package/client-scheduler/index.js +16 -56
- package/client-scheduler/index.js.map +1 -1
- package/client-sfn/index.js +45 -88
- package/client-sfn/index.js.map +1 -1
- package/client-sqs/index.d.ts +2 -1
- package/client-sqs/index.js +1 -26
- package/client-sts/index.js +1 -14
- package/credential-providers/index.js +1 -14
- package/lib-storage/index.d.ts +2 -1
- package/lib-storage/index.js +1 -44
- package/package.json +39 -39
- package/types/index.js +1 -18
- package/client-apigatewaymanagementapi/index.js.map +0 -1
- package/client-cloudfront/index.js.map +0 -1
- package/client-cloudwatch/index.js.map +0 -1
- package/client-dynamodb/index.js.map +0 -1
- package/client-iam/index.js.map +0 -1
- package/client-iot/index.js.map +0 -1
- package/client-sqs/index.js.map +0 -1
- package/client-sts/index.js.map +0 -1
- package/credential-providers/index.js.map +0 -1
- package/lib-storage/index.js.map +0 -1
- package/types/index.js.map +0 -1
package/client-iot/index.js
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
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";
|
package/client-lambda/index.d.ts
CHANGED
|
@@ -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 {
|
|
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;
|
package/client-lambda/index.js
CHANGED
|
@@ -1,58 +1,20 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
4
|
+
region: process.env.AWS_REGION
|
|
41
5
|
};
|
|
42
6
|
const lambdaClients = {};
|
|
43
|
-
const createLambdaClient = input
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
-
|
|
18
|
+
export { GetFunctionConfigurationCommand, InvocationType, InvokeCommand, LambdaClient, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, createLambdaClient };
|
|
57
19
|
|
|
58
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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"}
|
package/client-s3/index.d.ts
CHANGED
|
@@ -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,
|
|
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;
|
package/client-s3/index.js
CHANGED
|
@@ -1,194 +1,41 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
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
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
return
|
|
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
|
-
|
|
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
|
package/client-s3/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
return
|
|
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
|
-
|
|
18
|
+
export { CreateScheduleCommand, DeleteScheduleCommand, GetScheduleCommand, SchedulerClient, UpdateScheduleCommand, createSchedulerClient };
|
|
59
19
|
|
|
60
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
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"}
|
package/client-sfn/index.js
CHANGED
|
@@ -1,96 +1,53 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
51
|
+
export { DescribeExecutionCommand, ListExecutionsCommand, SFNClient, SFNServiceException, StartExecutionCommand, createStepFunctionClient, describeExecutionFactory, listExecutionsFactory, triggerStepFunctionFactory };
|
|
95
52
|
|
|
96
53
|
//# sourceMappingURL=index.js.map
|