@webiny/aws-sdk 6.3.0 → 6.4.0-beta.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.
Files changed (37) hide show
  1. package/client-apigatewaymanagementapi/index.js +1 -3
  2. package/client-cloudfront/index.js +0 -2
  3. package/client-cloudwatch/index.js +1 -3
  4. package/client-cognito-identity-provider/index.js +13 -15
  5. package/client-cognito-identity-provider/index.js.map +1 -1
  6. package/client-dynamodb/getDocumentClient.js +25 -43
  7. package/client-dynamodb/getDocumentClient.js.map +1 -1
  8. package/client-dynamodb/index.js +2 -4
  9. package/client-eventbridge/index.js +5 -7
  10. package/client-eventbridge/index.js.map +1 -1
  11. package/client-iam/index.js +0 -2
  12. package/client-iot/index.js +1 -3
  13. package/client-lambda/index.js +13 -15
  14. package/client-lambda/index.js.map +1 -1
  15. package/client-s3/index.js +33 -41
  16. package/client-s3/index.js.map +1 -1
  17. package/client-scheduler/index.js +15 -19
  18. package/client-scheduler/index.js.map +1 -1
  19. package/client-sfn/index.js +42 -46
  20. package/client-sfn/index.js.map +1 -1
  21. package/client-sqs/index.js +0 -2
  22. package/client-sts/index.js +0 -2
  23. package/credential-providers/index.js +0 -2
  24. package/lib-storage/index.js +0 -2
  25. package/package.json +25 -25
  26. package/types/index.js +0 -2
  27. package/client-apigatewaymanagementapi/index.js.map +0 -1
  28. package/client-cloudfront/index.js.map +0 -1
  29. package/client-cloudwatch/index.js.map +0 -1
  30. package/client-dynamodb/index.js.map +0 -1
  31. package/client-iam/index.js.map +0 -1
  32. package/client-iot/index.js.map +0 -1
  33. package/client-sqs/index.js.map +0 -1
  34. package/client-sts/index.js.map +0 -1
  35. package/credential-providers/index.js.map +0 -1
  36. package/lib-storage/index.js.map +0 -1
  37. package/types/index.js.map +0 -1
@@ -1,3 +1 @@
1
- export { ApiGatewayManagementApiClient, PostToConnectionCommand, DeleteConnectionCommand, GetConnectionCommand, GoneException, ForbiddenException, LimitExceededException, PayloadTooLargeException } from "@aws-sdk/client-apigatewaymanagementapi";
2
-
3
- //# sourceMappingURL=index.js.map
1
+ export { ApiGatewayManagementApiClient, DeleteConnectionCommand, ForbiddenException, GetConnectionCommand, GoneException, LimitExceededException, PayloadTooLargeException, PostToConnectionCommand } from "@aws-sdk/client-apigatewaymanagementapi";
@@ -1,3 +1 @@
1
1
  export { CloudFront } from "@aws-sdk/client-cloudfront";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,4 +1,2 @@
1
- export { CloudWatchEventsClient, DeleteRuleCommand, RemoveTargetsCommand, PutRuleCommand, PutTargetsCommand } from "@aws-sdk/client-cloudwatch-events";
1
+ export { CloudWatchEventsClient, DeleteRuleCommand, PutRuleCommand, PutTargetsCommand, RemoveTargetsCommand } from "@aws-sdk/client-cloudwatch-events";
2
2
  export { CloudWatchLogs } from "@aws-sdk/client-cloudwatch-logs";
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1,22 +1,20 @@
1
- import { CognitoIdentityProvider } from "@aws-sdk/client-cognito-identity-provider";
1
+ import { AdminCreateUserCommand, AdminDeleteUserCommand, AdminGetUserCommand, AdminUpdateUserAttributesCommand, CognitoIdentityProvider, CognitoIdentityProviderClient } from "@aws-sdk/client-cognito-identity-provider";
2
2
  import { createCacheKey } from "@webiny/utils";
3
- export { AdminGetUserCommand, AdminCreateUserCommand, AdminDeleteUserCommand, AdminUpdateUserAttributesCommand, CognitoIdentityProvider, CognitoIdentityProviderClient } from "@aws-sdk/client-cognito-identity-provider";
4
3
  const DEFAULT_CONFIG = {
5
- region: process.env.AWS_REGION
4
+ region: process.env.AWS_REGION
6
5
  };
7
6
  const cache = {};
8
- export const createCognitoIdentityProviderClient = input => {
9
- const config = {
10
- ...DEFAULT_CONFIG,
11
- ...input
12
- };
13
- const key = createCacheKey(config);
14
- if (cache[key]) {
15
- return cache[key];
16
- }
17
- const client = new CognitoIdentityProvider(config);
18
- cache[key] = client;
19
- return client;
7
+ const createCognitoIdentityProviderClient = (input)=>{
8
+ const config = {
9
+ ...DEFAULT_CONFIG,
10
+ ...input
11
+ };
12
+ const key = createCacheKey(config);
13
+ if (cache[key]) return cache[key];
14
+ const client = new CognitoIdentityProvider(config);
15
+ cache[key] = client;
16
+ return client;
20
17
  };
18
+ export { AdminCreateUserCommand, AdminDeleteUserCommand, AdminGetUserCommand, AdminUpdateUserAttributesCommand, CognitoIdentityProvider, CognitoIdentityProviderClient, createCognitoIdentityProviderClient };
21
19
 
22
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CognitoIdentityProvider","createCacheKey","AdminGetUserCommand","AdminCreateUserCommand","AdminDeleteUserCommand","AdminUpdateUserAttributesCommand","CognitoIdentityProviderClient","DEFAULT_CONFIG","region","process","env","AWS_REGION","cache","createCognitoIdentityProviderClient","input","config","key","client"],"sources":["index.ts"],"sourcesContent":["import type { CognitoIdentityProviderClientConfig } from \"@aws-sdk/client-cognito-identity-provider\";\nimport { CognitoIdentityProvider } from \"@aws-sdk/client-cognito-identity-provider\";\nimport type { GenericRecord } from \"@webiny/utils\";\nimport { createCacheKey } from \"@webiny/utils\";\n\nexport {\n AdminGetUserCommand,\n AdminCreateUserCommand,\n AdminDeleteUserCommand,\n AdminUpdateUserAttributesCommand,\n CognitoIdentityProvider,\n CognitoIdentityProviderClient\n} from \"@aws-sdk/client-cognito-identity-provider\";\n\nexport type {\n AttributeType,\n ListUsersResponse,\n AdminCreateUserRequest,\n AdminGetUserRequest,\n UserType,\n CognitoIdentityProviderClientConfig,\n AdminGetUserCommandInput,\n AdminGetUserCommandOutput,\n AdminCreateUserCommandInput,\n AdminCreateUserCommandOutput,\n AdminDeleteUserCommandInput,\n AdminDeleteUserCommandOutput,\n AdminUpdateUserAttributesCommandInput,\n AdminUpdateUserAttributesCommandOutput\n} from \"@aws-sdk/client-cognito-identity-provider\";\n\nconst DEFAULT_CONFIG = {\n region: process.env.AWS_REGION\n};\n\nconst cache: GenericRecord<string, CognitoIdentityProvider> = {};\n\nexport const createCognitoIdentityProviderClient = (\n input?: Partial<CognitoIdentityProviderClientConfig>\n) => {\n const config: CognitoIdentityProviderClientConfig = {\n ...DEFAULT_CONFIG,\n ...input\n };\n const key = createCacheKey(config);\n if (cache[key]) {\n return cache[key];\n }\n const client = new CognitoIdentityProvider(config);\n cache[key] = client;\n return client;\n};\n"],"mappings":"AACA,SAASA,uBAAuB,QAAQ,2CAA2C;AAEnF,SAASC,cAAc,QAAQ,eAAe;AAE9C,SACIC,mBAAmB,EACnBC,sBAAsB,EACtBC,sBAAsB,EACtBC,gCAAgC,EAChCL,uBAAuB,EACvBM,6BAA6B,QAC1B,2CAA2C;AAmBlD,MAAMC,cAAc,GAAG;EACnBC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC;AACxB,CAAC;AAED,MAAMC,KAAqD,GAAG,CAAC,CAAC;AAEhE,OAAO,MAAMC,mCAAmC,GAC5CC,KAAoD,IACnD;EACD,MAAMC,MAA2C,GAAG;IAChD,GAAGR,cAAc;IACjB,GAAGO;EACP,CAAC;EACD,MAAME,GAAG,GAAGf,cAAc,CAACc,MAAM,CAAC;EAClC,IAAIH,KAAK,CAACI,GAAG,CAAC,EAAE;IACZ,OAAOJ,KAAK,CAACI,GAAG,CAAC;EACrB;EACA,MAAMC,MAAM,GAAG,IAAIjB,uBAAuB,CAACe,MAAM,CAAC;EAClDH,KAAK,CAACI,GAAG,CAAC,GAAGC,MAAM;EACnB,OAAOA,MAAM;AACjB,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"client-cognito-identity-provider/index.js","sources":["../../src/client-cognito-identity-provider/index.ts"],"sourcesContent":["import type { CognitoIdentityProviderClientConfig } from \"@aws-sdk/client-cognito-identity-provider\";\nimport { CognitoIdentityProvider } from \"@aws-sdk/client-cognito-identity-provider\";\nimport type { GenericRecord } from \"@webiny/utils\";\nimport { createCacheKey } from \"@webiny/utils\";\n\nexport {\n AdminGetUserCommand,\n AdminCreateUserCommand,\n AdminDeleteUserCommand,\n AdminUpdateUserAttributesCommand,\n CognitoIdentityProvider,\n CognitoIdentityProviderClient\n} from \"@aws-sdk/client-cognito-identity-provider\";\n\nexport type {\n AttributeType,\n ListUsersResponse,\n AdminCreateUserRequest,\n AdminGetUserRequest,\n UserType,\n CognitoIdentityProviderClientConfig,\n AdminGetUserCommandInput,\n AdminGetUserCommandOutput,\n AdminCreateUserCommandInput,\n AdminCreateUserCommandOutput,\n AdminDeleteUserCommandInput,\n AdminDeleteUserCommandOutput,\n AdminUpdateUserAttributesCommandInput,\n AdminUpdateUserAttributesCommandOutput\n} from \"@aws-sdk/client-cognito-identity-provider\";\n\nconst DEFAULT_CONFIG = {\n region: process.env.AWS_REGION\n};\n\nconst cache: GenericRecord<string, CognitoIdentityProvider> = {};\n\nexport const createCognitoIdentityProviderClient = (\n input?: Partial<CognitoIdentityProviderClientConfig>\n) => {\n const config: CognitoIdentityProviderClientConfig = {\n ...DEFAULT_CONFIG,\n ...input\n };\n const key = createCacheKey(config);\n if (cache[key]) {\n return cache[key];\n }\n const client = new CognitoIdentityProvider(config);\n cache[key] = client;\n return client;\n};\n"],"names":["DEFAULT_CONFIG","process","cache","createCognitoIdentityProviderClient","input","config","key","createCacheKey","client","CognitoIdentityProvider"],"mappings":";;AA+BA,MAAMA,iBAAiB;IACnB,QAAQC,QAAQ,GAAG,CAAC,UAAU;AAClC;AAEA,MAAMC,QAAwD,CAAC;AAExD,MAAMC,sCAAsC,CAC/CC;IAEA,MAAMC,SAA8C;QAChD,GAAGL,cAAc;QACjB,GAAGI,KAAK;IACZ;IACA,MAAME,MAAMC,eAAeF;IAC3B,IAAIH,KAAK,CAACI,IAAI,EACV,OAAOJ,KAAK,CAACI,IAAI;IAErB,MAAME,SAAS,IAAIC,wBAAwBJ;IAC3CH,KAAK,CAACI,IAAI,GAAGE;IACb,OAAOA;AACX"}
@@ -1,56 +1,38 @@
1
1
  import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
2
2
  import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
3
3
  import { createCacheKey } from "@webiny/utils";
4
- let decorateDocumentClientCallable = undefined;
4
+ let decorateDocumentClientCallable;
5
5
  const DEFAULT_CONFIG = {
6
- region: process.env.AWS_REGION
6
+ region: process.env.AWS_REGION
7
7
  };
8
8
  const documentClients = {};
9
-
10
- /**
11
- * We do not want users to be able to change these options, so we are not exposing them.
12
- */
13
9
  const documentClientConfig = {
14
- marshallOptions: {
15
- convertEmptyValues: true,
16
- removeUndefinedValues: true,
17
- convertClassInstanceToMap: true
18
- }
10
+ marshallOptions: {
11
+ convertEmptyValues: true,
12
+ removeUndefinedValues: true,
13
+ convertClassInstanceToMap: true
14
+ }
19
15
  };
20
- export { getDocumentClient as createDocumentClient };
21
- export const getDocumentClient = input => {
22
- const config = {
23
- ...DEFAULT_CONFIG,
24
- ...input
25
- };
26
- const key = createCacheKey(config);
27
- if (documentClients[key]) {
28
- return applyDecoration(documentClients[key]);
29
- }
30
- const client = new DynamoDBClient(config);
31
- const documentClient = DynamoDBDocument.from(client, documentClientConfig);
32
- return documentClients[key] = applyDecoration(documentClient);
16
+ const getDocumentClient = (input)=>{
17
+ const config = {
18
+ ...DEFAULT_CONFIG,
19
+ ...input
20
+ };
21
+ const key = createCacheKey(config);
22
+ if (documentClients[key]) return applyDecoration(documentClients[key]);
23
+ const client = new DynamoDBClient(config);
24
+ const documentClient = DynamoDBDocument.from(client, documentClientConfig);
25
+ return documentClients[key] = applyDecoration(documentClient);
33
26
  };
34
- /**
35
- * Client will not be decorated more than once.
36
- */
37
- const applyDecoration = client => {
38
- if (!decorateDocumentClientCallable) {
39
- return client;
40
- }
41
-
42
- // @ts-expect-error
43
- client.__decoratedByWebiny = true;
44
- return decorateDocumentClientCallable(client);
27
+ const applyDecoration = (client)=>{
28
+ if (!decorateDocumentClientCallable) return client;
29
+ client.__decoratedByWebiny = true;
30
+ return decorateDocumentClientCallable(client);
45
31
  };
46
- export const decorateDocumentClient = cb => {
47
- decorateDocumentClientCallable = cb;
48
- /**
49
- * Decorate already existing clients.
50
- */
51
- for (const key in documentClients) {
52
- cb(documentClients[key]);
53
- }
32
+ const decorateDocumentClient = (cb)=>{
33
+ decorateDocumentClientCallable = cb;
34
+ for(const key in documentClients)cb(documentClients[key]);
54
35
  };
36
+ export { decorateDocumentClient, getDocumentClient as createDocumentClient, getDocumentClient };
55
37
 
56
38
  //# sourceMappingURL=getDocumentClient.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DynamoDBClient","DynamoDBDocument","createCacheKey","decorateDocumentClientCallable","undefined","DEFAULT_CONFIG","region","process","env","AWS_REGION","documentClients","documentClientConfig","marshallOptions","convertEmptyValues","removeUndefinedValues","convertClassInstanceToMap","getDocumentClient","createDocumentClient","input","config","key","applyDecoration","client","documentClient","from","__decoratedByWebiny","decorateDocumentClient","cb"],"sources":["getDocumentClient.ts"],"sourcesContent":["import type { DynamoDBClientConfig } from \"@aws-sdk/client-dynamodb\";\nimport { DynamoDBClient } from \"@aws-sdk/client-dynamodb\";\nimport type { TranslateConfig } from \"@aws-sdk/lib-dynamodb\";\nimport { DynamoDBDocument } from \"@aws-sdk/lib-dynamodb\";\nimport { createCacheKey } from \"@webiny/utils\";\n\nexport interface IDecorateDocumentClientCallable {\n (client: DynamoDBDocument): DynamoDBDocument;\n}\n\nlet decorateDocumentClientCallable: IDecorateDocumentClientCallable | undefined = undefined;\n\nconst DEFAULT_CONFIG = {\n region: process.env.AWS_REGION\n};\n\nconst documentClients: Record<string, DynamoDBDocument> = {};\n\n/**\n * We do not want users to be able to change these options, so we are not exposing them.\n */\nconst documentClientConfig: TranslateConfig = {\n marshallOptions: {\n convertEmptyValues: true,\n removeUndefinedValues: true,\n convertClassInstanceToMap: true\n }\n};\n\nexport { getDocumentClient as createDocumentClient };\n\nexport const getDocumentClient = (input?: DynamoDBClientConfig): DynamoDBDocument => {\n const config: DynamoDBClientConfig = {\n ...DEFAULT_CONFIG,\n ...input\n };\n const key = createCacheKey(config);\n if (documentClients[key]) {\n return applyDecoration(documentClients[key]);\n }\n const client = new DynamoDBClient(config);\n const documentClient = DynamoDBDocument.from(client, documentClientConfig);\n return (documentClients[key] = applyDecoration(documentClient));\n};\n/**\n * Client will not be decorated more than once.\n */\nconst applyDecoration = (client: DynamoDBDocument): DynamoDBDocument => {\n if (!decorateDocumentClientCallable) {\n return client;\n }\n\n // @ts-expect-error\n client.__decoratedByWebiny = true;\n return decorateDocumentClientCallable(client);\n};\n\nexport const decorateDocumentClient = (cb: IDecorateDocumentClientCallable): void => {\n decorateDocumentClientCallable = cb;\n /**\n * Decorate already existing clients.\n */\n for (const key in documentClients) {\n cb(documentClients[key]);\n }\n};\n"],"mappings":"AACA,SAASA,cAAc,QAAQ,0BAA0B;AAEzD,SAASC,gBAAgB,QAAQ,uBAAuB;AACxD,SAASC,cAAc,QAAQ,eAAe;AAM9C,IAAIC,8BAA2E,GAAGC,SAAS;AAE3F,MAAMC,cAAc,GAAG;EACnBC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC;AACxB,CAAC;AAED,MAAMC,eAAiD,GAAG,CAAC,CAAC;;AAE5D;AACA;AACA;AACA,MAAMC,oBAAqC,GAAG;EAC1CC,eAAe,EAAE;IACbC,kBAAkB,EAAE,IAAI;IACxBC,qBAAqB,EAAE,IAAI;IAC3BC,yBAAyB,EAAE;EAC/B;AACJ,CAAC;AAED,SAASC,iBAAiB,IAAIC,oBAAoB;AAElD,OAAO,MAAMD,iBAAiB,GAAIE,KAA4B,IAAuB;EACjF,MAAMC,MAA4B,GAAG;IACjC,GAAGd,cAAc;IACjB,GAAGa;EACP,CAAC;EACD,MAAME,GAAG,GAAGlB,cAAc,CAACiB,MAAM,CAAC;EAClC,IAAIT,eAAe,CAACU,GAAG,CAAC,EAAE;IACtB,OAAOC,eAAe,CAACX,eAAe,CAACU,GAAG,CAAC,CAAC;EAChD;EACA,MAAME,MAAM,GAAG,IAAItB,cAAc,CAACmB,MAAM,CAAC;EACzC,MAAMI,cAAc,GAAGtB,gBAAgB,CAACuB,IAAI,CAACF,MAAM,EAAEX,oBAAoB,CAAC;EAC1E,OAAQD,eAAe,CAACU,GAAG,CAAC,GAAGC,eAAe,CAACE,cAAc,CAAC;AAClE,CAAC;AACD;AACA;AACA;AACA,MAAMF,eAAe,GAAIC,MAAwB,IAAuB;EACpE,IAAI,CAACnB,8BAA8B,EAAE;IACjC,OAAOmB,MAAM;EACjB;;EAEA;EACAA,MAAM,CAACG,mBAAmB,GAAG,IAAI;EACjC,OAAOtB,8BAA8B,CAACmB,MAAM,CAAC;AACjD,CAAC;AAED,OAAO,MAAMI,sBAAsB,GAAIC,EAAmC,IAAW;EACjFxB,8BAA8B,GAAGwB,EAAE;EACnC;AACJ;AACA;EACI,KAAK,MAAMP,GAAG,IAAIV,eAAe,EAAE;IAC/BiB,EAAE,CAACjB,eAAe,CAACU,GAAG,CAAC,CAAC;EAC5B;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"client-dynamodb/getDocumentClient.js","sources":["../../src/client-dynamodb/getDocumentClient.ts"],"sourcesContent":["import type { DynamoDBClientConfig } from \"@aws-sdk/client-dynamodb\";\nimport { DynamoDBClient } from \"@aws-sdk/client-dynamodb\";\nimport type { TranslateConfig } from \"@aws-sdk/lib-dynamodb\";\nimport { DynamoDBDocument } from \"@aws-sdk/lib-dynamodb\";\nimport { createCacheKey } from \"@webiny/utils\";\n\nexport interface IDecorateDocumentClientCallable {\n (client: DynamoDBDocument): DynamoDBDocument;\n}\n\nlet decorateDocumentClientCallable: IDecorateDocumentClientCallable | undefined = undefined;\n\nconst DEFAULT_CONFIG = {\n region: process.env.AWS_REGION\n};\n\nconst documentClients: Record<string, DynamoDBDocument> = {};\n\n/**\n * We do not want users to be able to change these options, so we are not exposing them.\n */\nconst documentClientConfig: TranslateConfig = {\n marshallOptions: {\n convertEmptyValues: true,\n removeUndefinedValues: true,\n convertClassInstanceToMap: true\n }\n};\n\nexport { getDocumentClient as createDocumentClient };\n\nexport const getDocumentClient = (input?: DynamoDBClientConfig): DynamoDBDocument => {\n const config: DynamoDBClientConfig = {\n ...DEFAULT_CONFIG,\n ...input\n };\n const key = createCacheKey(config);\n if (documentClients[key]) {\n return applyDecoration(documentClients[key]);\n }\n const client = new DynamoDBClient(config);\n const documentClient = DynamoDBDocument.from(client, documentClientConfig);\n return (documentClients[key] = applyDecoration(documentClient));\n};\n/**\n * Client will not be decorated more than once.\n */\nconst applyDecoration = (client: DynamoDBDocument): DynamoDBDocument => {\n if (!decorateDocumentClientCallable) {\n return client;\n }\n\n // @ts-expect-error\n client.__decoratedByWebiny = true;\n return decorateDocumentClientCallable(client);\n};\n\nexport const decorateDocumentClient = (cb: IDecorateDocumentClientCallable): void => {\n decorateDocumentClientCallable = cb;\n /**\n * Decorate already existing clients.\n */\n for (const key in documentClients) {\n cb(documentClients[key]);\n }\n};\n"],"names":["decorateDocumentClientCallable","DEFAULT_CONFIG","process","documentClients","documentClientConfig","getDocumentClient","input","config","key","createCacheKey","applyDecoration","client","DynamoDBClient","documentClient","DynamoDBDocument","decorateDocumentClient","cb"],"mappings":";;;AAUA,IAAIA;AAEJ,MAAMC,iBAAiB;IACnB,QAAQC,QAAQ,GAAG,CAAC,UAAU;AAClC;AAEA,MAAMC,kBAAoD,CAAC;AAK3D,MAAMC,uBAAwC;IAC1C,iBAAiB;QACb,oBAAoB;QACpB,uBAAuB;QACvB,2BAA2B;IAC/B;AACJ;AAIO,MAAMC,oBAAoB,CAACC;IAC9B,MAAMC,SAA+B;QACjC,GAAGN,cAAc;QACjB,GAAGK,KAAK;IACZ;IACA,MAAME,MAAMC,eAAeF;IAC3B,IAAIJ,eAAe,CAACK,IAAI,EACpB,OAAOE,gBAAgBP,eAAe,CAACK,IAAI;IAE/C,MAAMG,SAAS,IAAIC,eAAeL;IAClC,MAAMM,iBAAiBC,iBAAiB,IAAI,CAACH,QAAQP;IACrD,OAAQD,eAAe,CAACK,IAAI,GAAGE,gBAAgBG;AACnD;AAIA,MAAMH,kBAAkB,CAACC;IACrB,IAAI,CAACX,gCACD,OAAOW;IAIXA,OAAO,mBAAmB,GAAG;IAC7B,OAAOX,+BAA+BW;AAC1C;AAEO,MAAMI,yBAAyB,CAACC;IACnChB,iCAAiCgB;IAIjC,IAAK,MAAMR,OAAOL,gBACda,GAAGb,eAAe,CAACK,IAAI;AAE/B"}
@@ -1,6 +1,4 @@
1
1
  export { QueryCommand } from "@aws-sdk/client-dynamodb";
2
- export { BatchWriteCommand, BatchGetCommand, PutCommand, ScanCommand, GetCommand, UpdateCommand, DeleteCommand, DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
3
- export { unmarshall, marshall } from "@aws-sdk/util-dynamodb";
2
+ export { BatchGetCommand, BatchWriteCommand, DeleteCommand, DynamoDBDocument, GetCommand, PutCommand, ScanCommand, UpdateCommand } from "@aws-sdk/lib-dynamodb";
3
+ export { marshall, unmarshall } from "@aws-sdk/util-dynamodb";
4
4
  export { getDocumentClient } from "./getDocumentClient.js";
5
-
6
- //# sourceMappingURL=index.js.map
@@ -1,9 +1,7 @@
1
- import { EventBridgeClient } from "@aws-sdk/client-eventbridge";
2
- export { EventBridgeClient, PutEventsCommand } from "@aws-sdk/client-eventbridge";
3
- export const createEventBridgeClient = config => {
4
- return new EventBridgeClient({
5
- ...config
6
- });
7
- };
1
+ import { EventBridgeClient, PutEventsCommand } from "@aws-sdk/client-eventbridge";
2
+ const createEventBridgeClient = (config)=>new EventBridgeClient({
3
+ ...config
4
+ });
5
+ export { EventBridgeClient, PutEventsCommand, createEventBridgeClient };
8
6
 
9
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["EventBridgeClient","PutEventsCommand","createEventBridgeClient","config"],"sources":["index.ts"],"sourcesContent":["import type { EventBridgeClientConfig } from \"@aws-sdk/client-eventbridge\";\nimport { EventBridgeClient } from \"@aws-sdk/client-eventbridge\";\n\nexport { EventBridgeClient, PutEventsCommand } from \"@aws-sdk/client-eventbridge\";\n\nexport type {\n EventBridgeClientConfig,\n PutEventsRequestEntry,\n PutEventsCommandInput,\n PutEventsCommandOutput\n} from \"@aws-sdk/client-eventbridge\";\n\nexport const createEventBridgeClient = (config?: Partial<EventBridgeClientConfig>) => {\n return new EventBridgeClient({\n ...config\n });\n};\n"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,6BAA6B;AAE/D,SAASA,iBAAiB,EAAEC,gBAAgB,QAAQ,6BAA6B;AASjF,OAAO,MAAMC,uBAAuB,GAAIC,MAAyC,IAAK;EAClF,OAAO,IAAIH,iBAAiB,CAAC;IACzB,GAAGG;EACP,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"client-eventbridge/index.js","sources":["../../src/client-eventbridge/index.ts"],"sourcesContent":["import type { EventBridgeClientConfig } from \"@aws-sdk/client-eventbridge\";\nimport { EventBridgeClient } from \"@aws-sdk/client-eventbridge\";\n\nexport { EventBridgeClient, PutEventsCommand } from \"@aws-sdk/client-eventbridge\";\n\nexport type {\n EventBridgeClientConfig,\n PutEventsRequestEntry,\n PutEventsCommandInput,\n PutEventsCommandOutput\n} from \"@aws-sdk/client-eventbridge\";\n\nexport const createEventBridgeClient = (config?: Partial<EventBridgeClientConfig>) => {\n return new EventBridgeClient({\n ...config\n });\n};\n"],"names":["createEventBridgeClient","config","EventBridgeClient"],"mappings":";AAYO,MAAMA,0BAA0B,CAACC,SAC7B,IAAIC,kBAAkB;QACzB,GAAGD,MAAM;IACb"}
@@ -1,3 +1 @@
1
1
  export { IAM } from "@aws-sdk/client-iam";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,3 +1 @@
1
- export { IoTClient, DescribeEndpointCommand } from "@aws-sdk/client-iot";
2
-
3
- //# sourceMappingURL=index.js.map
1
+ export { DescribeEndpointCommand, IoTClient } from "@aws-sdk/client-iot";
@@ -1,22 +1,20 @@
1
1
  import { createCacheKey } from "@webiny/utils";
2
- import { LambdaClient } from "@aws-sdk/client-lambda";
3
- export { LambdaClient, InvokeCommand, GetFunctionConfigurationCommand, UpdateFunctionConfigurationCommand, UpdateFunctionCodeCommand, InvocationType } from "@aws-sdk/client-lambda";
2
+ import { GetFunctionConfigurationCommand, InvocationType, InvokeCommand, LambdaClient, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand } from "@aws-sdk/client-lambda";
4
3
  const DEFAULT_CONFIG = {
5
- region: process.env.AWS_REGION
4
+ region: process.env.AWS_REGION
6
5
  };
7
6
  const lambdaClients = {};
8
- export const createLambdaClient = input => {
9
- const config = {
10
- ...DEFAULT_CONFIG,
11
- ...input
12
- };
13
- const key = createCacheKey(config);
14
- if (lambdaClients[key]) {
15
- return lambdaClients[key];
16
- }
17
- const client = new LambdaClient(config);
18
- lambdaClients[key] = client;
19
- 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;
20
17
  };
18
+ export { GetFunctionConfigurationCommand, InvocationType, InvokeCommand, LambdaClient, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, createLambdaClient };
21
19
 
22
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createCacheKey","LambdaClient","InvokeCommand","GetFunctionConfigurationCommand","UpdateFunctionConfigurationCommand","UpdateFunctionCodeCommand","InvocationType","DEFAULT_CONFIG","region","process","env","AWS_REGION","lambdaClients","createLambdaClient","input","config","key","client"],"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 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"],"mappings":"AAAA,SAASA,cAAc,QAAQ,eAAe;AAE9C,SAASC,YAAY,QAAQ,wBAAwB;AAErD,SACIA,YAAY,EACZC,aAAa,EACbC,+BAA+B,EAC/BC,kCAAkC,EAClCC,yBAAyB,EACzBC,cAAc,QACX,wBAAwB;AAY/B,MAAMC,cAAkC,GAAG;EACvCC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC;AACxB,CAAC;AAED,MAAMC,aAA2C,GAAG,CAAC,CAAC;AAEtD,OAAO,MAAMC,kBAAkB,GAAIC,KAAmC,IAAmB;EACrF,MAAMC,MAA0B,GAAG;IAC/B,GAAGR,cAAc;IACjB,GAAGO;EACP,CAAC;EACD,MAAME,GAAG,GAAGhB,cAAc,CAACe,MAAM,CAAC;EAElC,IAAIH,aAAa,CAACI,GAAG,CAAC,EAAE;IACpB,OAAOJ,aAAa,CAACI,GAAG,CAAC;EAC7B;EAEA,MAAMC,MAAM,GAAG,IAAIhB,YAAY,CAACc,MAAM,CAAC;EAEvCH,aAAa,CAACI,GAAG,CAAC,GAAGC,MAAM;EAE3B,OAAOA,MAAM;AACjB,CAAC","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,49 +1,41 @@
1
- import { S3, S3Client } from "@aws-sdk/client-s3";
1
+ import { AbortMultipartUploadCommand, CompleteMultipartUploadCommand, CopyObjectCommand, CreateMultipartUploadCommand, DeleteObjectCommand, GetObjectCommand, HeadObjectCommand, ListObjectsCommand, ListObjectsV2Command, ListPartsCommand, ObjectCannedACL, PutObjectCommand, S3, S3Client, UploadPartCommand, UploadPartCopyCommand } from "@aws-sdk/client-s3";
2
2
  import { createCacheKey } from "@webiny/utils";
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 { createPresignedPost } from "@aws-sdk/s3-presigned-post";
5
- export { getSignedUrl } from "@aws-sdk/s3-request-presigner";
6
3
  const s3ClientsCache = new Map();
7
- export const createS3Client = initial => {
8
- const options = {
9
- region: process.env.AWS_REGION,
10
- ...initial
11
- };
12
- const skipCache = options.cache === false;
13
- delete options.cache;
14
- if (skipCache) {
15
- return new S3Client({
16
- ...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
17
18
  });
18
- }
19
- const key = createCacheKey(options);
20
- if (s3ClientsCache.has(key)) {
21
- return s3ClientsCache.get(key);
22
- }
23
- const instance = new S3Client({
24
- ...options
25
- });
26
- s3ClientsCache.set(key, instance);
27
- return instance;
19
+ s3ClientsCache.set(key, instance);
20
+ return instance;
28
21
  };
29
22
  const s3Cache = new Map();
30
- export const createS3 = initial => {
31
- const options = {
32
- region: process.env.AWS_REGION,
33
- ...initial
34
- };
35
- const skipCache = options.cache === false;
36
- delete options.cache;
37
- if (skipCache) {
38
- return new S3(options);
39
- }
40
- const key = createCacheKey(options);
41
- if (s3Cache.has(key)) {
42
- return s3Cache.get(key);
43
- }
44
- const instance = new S3(options);
45
- s3Cache.set(key, instance);
46
- 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;
47
36
  };
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 };
48
40
 
49
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["S3","S3Client","createCacheKey","CopyObjectCommand","GetObjectCommand","HeadObjectCommand","ListObjectsCommand","UploadPartCopyCommand","ListObjectsV2Command","ListPartsCommand","ObjectCannedACL","DeleteObjectCommand","PutObjectCommand","UploadPartCommand","AbortMultipartUploadCommand","CompleteMultipartUploadCommand","CreateMultipartUploadCommand","createPresignedPost","getSignedUrl","s3ClientsCache","Map","createS3Client","initial","options","region","process","env","AWS_REGION","skipCache","cache","key","has","get","instance","set","s3Cache","createS3"],"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 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"],"mappings":"AACA,SAASA,EAAE,EAAEC,QAAQ,QAAQ,oBAAoB;AACjD,SAASC,cAAc,QAAQ,eAAe;AAE9C,SACIC,iBAAiB,EACjBC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,EAClBC,qBAAqB,EACrBC,oBAAoB,EACpBC,gBAAgB,EAChBC,eAAe,EACfC,mBAAmB,EACnBC,gBAAgB,EAChBC,iBAAiB,EACjBC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,4BAA4B,EAC5BhB,EAAE,EACFC,QAAQ,QACL,oBAAoB;AAiC3B,SAASgB,mBAAmB,QAAQ,4BAA4B;AAGhE,SAASC,YAAY,QAAQ,+BAA+B;AAE5D,MAAMC,cAAc,GAAG,IAAIC,GAAG,CAAmB,CAAC;AAMlD,OAAO,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,IAAI3B,QAAQ,CAAC;MAChB,GAAGsB;IACP,CAAC,CAAC;EACN;EAEA,MAAMO,GAAG,GAAG5B,cAAc,CAACqB,OAAO,CAAC;EACnC,IAAIJ,cAAc,CAACY,GAAG,CAACD,GAAG,CAAC,EAAE;IACzB,OAAOX,cAAc,CAACa,GAAG,CAACF,GAAG,CAAC;EAClC;EAEA,MAAMG,QAAQ,GAAG,IAAIhC,QAAQ,CAAC;IAC1B,GAAGsB;EACP,CAAC,CAAC;EACFJ,cAAc,CAACe,GAAG,CAACJ,GAAG,EAAEG,QAAQ,CAAC;EAEjC,OAAOA,QAAQ;AACnB,CAAC;AAED,MAAME,OAAO,GAAG,IAAIf,GAAG,CAAa,CAAC;AAErC,OAAO,MAAMgB,QAAQ,GAAId,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,IAAI5B,EAAE,CAACuB,OAAO,CAAC;EAC1B;EACA,MAAMO,GAAG,GAAG5B,cAAc,CAACqB,OAAO,CAAC;EACnC,IAAIY,OAAO,CAACJ,GAAG,CAACD,GAAG,CAAC,EAAE;IAClB,OAAOK,OAAO,CAACH,GAAG,CAACF,GAAG,CAAC;EAC3B;EAEA,MAAMG,QAAQ,GAAG,IAAIjC,EAAE,CAACuB,OAAO,CAAC;EAEhCY,OAAO,CAACD,GAAG,CAACJ,GAAG,EAAEG,QAAQ,CAAC;EAC1B,OAAOA,QAAQ;AACnB,CAAC","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,24 +1,20 @@
1
1
  import { createCacheKey } from "@webiny/utils";
2
- import { SchedulerClient } from "@aws-sdk/client-scheduler";
3
- export { SchedulerClient, GetScheduleCommand, CreateScheduleCommand, UpdateScheduleCommand, DeleteScheduleCommand } from "@aws-sdk/client-scheduler";
2
+ import { CreateScheduleCommand, DeleteScheduleCommand, GetScheduleCommand, SchedulerClient, UpdateScheduleCommand } from "@aws-sdk/client-scheduler";
4
3
  const clients = {};
5
- export const createSchedulerClient = (input = {}) => {
6
- const options = {
7
- region: process.env.AWS_REGION,
8
- ...input
9
- };
10
- const skipCache = options.cache === false;
11
- delete options.cache;
12
- if (skipCache) {
13
- return new SchedulerClient(options);
14
- }
15
- const key = createCacheKey(options);
16
- if (clients[key]) {
17
- return clients[key];
18
- }
19
- const client = new SchedulerClient(options);
20
- clients[key] = client;
21
- 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;
22
17
  };
18
+ export { CreateScheduleCommand, DeleteScheduleCommand, GetScheduleCommand, SchedulerClient, UpdateScheduleCommand, createSchedulerClient };
23
19
 
24
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createCacheKey","SchedulerClient","GetScheduleCommand","CreateScheduleCommand","UpdateScheduleCommand","DeleteScheduleCommand","clients","createSchedulerClient","input","options","region","process","env","AWS_REGION","skipCache","cache","key","client"],"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,SAASA,cAAc,QAAQ,eAAe;AAE9C,SAASC,eAAe,QAAQ,2BAA2B;AAE3D,SACIA,eAAe,EACfC,kBAAkB,EAClBC,qBAAqB,EACrBC,qBAAqB,EACrBC,qBAAqB,QAClB,2BAA2B;AAalC,MAAMC,OAAwC,GAAG,CAAC,CAAC;AAMnD,OAAO,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,IAAIb,eAAe,CAACQ,OAAO,CAAC;EACvC;EAEA,MAAMO,GAAG,GAAGhB,cAAc,CAACS,OAAO,CAAC;EAEnC,IAAIH,OAAO,CAACU,GAAG,CAAC,EAAE;IACd,OAAOV,OAAO,CAACU,GAAG,CAAC;EACvB;EAEA,MAAMC,MAAM,GAAG,IAAIhB,eAAe,CAACQ,OAAO,CAAC;EAE3CH,OAAO,CAACU,GAAG,CAAC,GAAGC,MAAM;EAErB,OAAOA,MAAM;AACjB,CAAC","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,57 +1,53 @@
1
1
  import { DescribeExecutionCommand, ListExecutionsCommand, SFNClient, SFNServiceException, StartExecutionCommand } from "@aws-sdk/client-sfn";
2
2
  import { createCacheKey } from "@webiny/utils";
3
- export { SFNClient, DescribeExecutionCommand, SFNServiceException, StartExecutionCommand, ListExecutionsCommand };
4
3
  const stepFunctionClientsCache = new Map();
5
- export const createStepFunctionClient = initial => {
6
- const config = {
7
- region: process.env.AWS_REGION,
8
- ...initial
9
- };
10
- const skipCache = config.cache === false;
11
- delete config.cache;
12
- if (skipCache) {
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
13
+ });
14
+ const key = createCacheKey(config);
15
+ if (stepFunctionClientsCache.has(key)) return stepFunctionClientsCache.get(key);
13
16
  return new SFNClient({
14
- ...config
17
+ ...config
15
18
  });
16
- }
17
- const key = createCacheKey(config);
18
- if (stepFunctionClientsCache.has(key)) {
19
- return stepFunctionClientsCache.get(key);
20
- }
21
- return new SFNClient({
22
- ...config
23
- });
24
19
  };
25
- export const triggerStepFunctionFactory = input => {
26
- const client = input instanceof SFNClient ? input : createStepFunctionClient(input);
27
- return async params => {
28
- const cmd = new StartExecutionCommand({
29
- ...params,
30
- stateMachineArn: params.stateMachineArn || process.env.BG_TASK_SFN_ARN,
31
- name: params.name,
32
- input: JSON.stringify(params.input)
33
- });
34
- return await client.send(cmd);
35
- };
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
+ };
36
31
  };
37
- export const listExecutionsFactory = input => {
38
- const client = input instanceof SFNClient ? input : createStepFunctionClient(input);
39
- return async params => {
40
- const cmd = new ListExecutionsCommand({
41
- ...params,
42
- stateMachineArn: params.stateMachineArn || process.env.BG_TASK_SFN_ARN
43
- });
44
- return await client.send(cmd);
45
- };
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
+ };
46
41
  };
47
- export const describeExecutionFactory = input => {
48
- const client = input instanceof SFNClient ? input : createStepFunctionClient(input);
49
- return async params => {
50
- const cmd = new DescribeExecutionCommand({
51
- ...params
52
- });
53
- return await client.send(cmd);
54
- };
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
+ };
55
50
  };
51
+ export { DescribeExecutionCommand, ListExecutionsCommand, SFNClient, SFNServiceException, StartExecutionCommand, createStepFunctionClient, describeExecutionFactory, listExecutionsFactory, triggerStepFunctionFactory };
56
52
 
57
53
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["DescribeExecutionCommand","ListExecutionsCommand","SFNClient","SFNServiceException","StartExecutionCommand","createCacheKey","stepFunctionClientsCache","Map","createStepFunctionClient","initial","config","region","process","env","AWS_REGION","skipCache","cache","key","has","get","triggerStepFunctionFactory","input","client","params","cmd","stateMachineArn","BG_TASK_SFN_ARN","name","JSON","stringify","send","listExecutionsFactory","describeExecutionFactory"],"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, type GenericRecord } from \"@webiny/utils\";\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> extends Partial<\n Omit<StartExecutionCommandInput, \"input\">\n> {\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,SACIA,wBAAwB,EACxBC,qBAAqB,EACrBC,SAAS,EACTC,mBAAmB,EACnBC,qBAAqB,QAClB,qBAAqB;AAC5B,SAASC,cAAc,QAA4B,eAAe;AAElE,SACIH,SAAS,EACTF,wBAAwB,EACxBG,mBAAmB,EACnBC,qBAAqB,EACrBH,qBAAqB;AAsBzB,MAAMK,wBAAwB,GAAG,IAAIC,GAAG,CAAoB,CAAC;AAE7D,OAAO,MAAMC,wBAAwB,GAAIC,OAAyB,IAAgB;EAC9E,MAAMC,MAAuB,GAAG;IAC5BC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC,UAAU;IAC9B,GAAGL;EACP,CAAC;EACD,MAAMM,SAAS,GAAGL,MAAM,CAACM,KAAK,KAAK,KAAK;EACxC,OAAON,MAAM,CAACM,KAAK;EACnB,IAAID,SAAS,EAAE;IACX,OAAO,IAAIb,SAAS,CAAC;MACjB,GAAGQ;IACP,CAAC,CAAC;EACN;EAEA,MAAMO,GAAG,GAAGZ,cAAc,CAACK,MAAM,CAAC;EAClC,IAAIJ,wBAAwB,CAACY,GAAG,CAACD,GAAG,CAAC,EAAE;IACnC,OAAOX,wBAAwB,CAACa,GAAG,CAACF,GAAG,CAAC;EAC5C;EAEA,OAAO,IAAIf,SAAS,CAAC;IACjB,GAAGQ;EACP,CAAC,CAAC;AACN,CAAC;AAED,OAAO,MAAMU,0BAA0B,GAAIC,KAAmC,IAAK;EAC/E,MAAMC,MAAM,GAAGD,KAAK,YAAYnB,SAAS,GAAGmB,KAAK,GAAGb,wBAAwB,CAACa,KAAK,CAAC;EACnF,OAAO,MACHE,MAAoC,IACG;IACvC,MAAMC,GAAG,GAAG,IAAIpB,qBAAqB,CAAC;MAClC,GAAGmB,MAAM;MACTE,eAAe,EAAEF,MAAM,CAACE,eAAe,IAAIb,OAAO,CAACC,GAAG,CAACa,eAAe;MACtEC,IAAI,EAAEJ,MAAM,CAACI,IAAI;MACjBN,KAAK,EAAEO,IAAI,CAACC,SAAS,CAACN,MAAM,CAACF,KAAK;IACtC,CAAC,CAAC;IACF,OAAO,MAAMC,MAAM,CAACQ,IAAI,CAACN,GAAG,CAAC;EACjC,CAAC;AACL,CAAC;AAED,OAAO,MAAMO,qBAAqB,GAAIV,KAAmC,IAAK;EAC1E,MAAMC,MAAM,GAAGD,KAAK,YAAYnB,SAAS,GAAGmB,KAAK,GAAGb,wBAAwB,CAACa,KAAK,CAAC;EACnF,OAAO,MAAOE,MAAkC,IAA2C;IACvF,MAAMC,GAAG,GAAG,IAAIvB,qBAAqB,CAAC;MAClC,GAAGsB,MAAM;MACTE,eAAe,EAAEF,MAAM,CAACE,eAAe,IAAIb,OAAO,CAACC,GAAG,CAACa;IAC3D,CAAC,CAAC;IACF,OAAO,MAAMJ,MAAM,CAACQ,IAAI,CAACN,GAAG,CAAC;EACjC,CAAC;AACL,CAAC;AAED,OAAO,MAAMQ,wBAAwB,GAAIX,KAAmC,IAAK;EAC7E,MAAMC,MAAM,GAAGD,KAAK,YAAYnB,SAAS,GAAGmB,KAAK,GAAGb,wBAAwB,CAACa,KAAK,CAAC;EACnF,OAAO,MACHE,MAAqC,IACK;IAC1C,MAAMC,GAAG,GAAG,IAAIxB,wBAAwB,CAAC;MACrC,GAAGuB;IACP,CAAC,CAAC;IACF,OAAO,MAAMD,MAAM,CAACQ,IAAI,CAACN,GAAG,CAAC;EACjC,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"client-sfn/index.js","sources":["../../src/client-sfn/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, type GenericRecord } from \"@webiny/utils\";\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> extends Partial<\n Omit<StartExecutionCommandInput, \"input\">\n> {\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"],"names":["stepFunctionClientsCache","Map","createStepFunctionClient","initial","config","process","skipCache","SFNClient","key","createCacheKey","triggerStepFunctionFactory","input","client","params","cmd","StartExecutionCommand","JSON","listExecutionsFactory","ListExecutionsCommand","describeExecutionFactory","DescribeExecutionCommand"],"mappings":";;AA6CA,MAAMA,2BAA2B,IAAIC;AAE9B,MAAMC,2BAA2B,CAACC;IACrC,MAAMC,SAA0B;QAC5B,QAAQC,QAAQ,GAAG,CAAC,UAAU;QAC9B,GAAGF,OAAO;IACd;IACA,MAAMG,YAAYF,AAAiB,UAAjBA,OAAO,KAAK;IAC9B,OAAOA,OAAO,KAAK;IACnB,IAAIE,WACA,OAAO,IAAIC,UAAU;QACjB,GAAGH,MAAM;IACb;IAGJ,MAAMI,MAAMC,eAAeL;IAC3B,IAAIJ,yBAAyB,GAAG,CAACQ,MAC7B,OAAOR,yBAAyB,GAAG,CAACQ;IAGxC,OAAO,IAAID,UAAU;QACjB,GAAGH,MAAM;IACb;AACJ;AAEO,MAAMM,6BAA6B,CAACC;IACvC,MAAMC,SAASD,iBAAiBJ,YAAYI,QAAQT,yBAAyBS;IAC7E,OAAO,OACHE;QAEA,MAAMC,MAAM,IAAIC,sBAAsB;YAClC,GAAGF,MAAM;YACT,iBAAiBA,OAAO,eAAe,IAAIR,QAAQ,GAAG,CAAC,eAAe;YACtE,MAAMQ,OAAO,IAAI;YACjB,OAAOG,KAAK,SAAS,CAACH,OAAO,KAAK;QACtC;QACA,OAAO,MAAMD,OAAO,IAAI,CAACE;IAC7B;AACJ;AAEO,MAAMG,wBAAwB,CAACN;IAClC,MAAMC,SAASD,iBAAiBJ,YAAYI,QAAQT,yBAAyBS;IAC7E,OAAO,OAAOE;QACV,MAAMC,MAAM,IAAII,sBAAsB;YAClC,GAAGL,MAAM;YACT,iBAAiBA,OAAO,eAAe,IAAIR,QAAQ,GAAG,CAAC,eAAe;QAC1E;QACA,OAAO,MAAMO,OAAO,IAAI,CAACE;IAC7B;AACJ;AAEO,MAAMK,2BAA2B,CAACR;IACrC,MAAMC,SAASD,iBAAiBJ,YAAYI,QAAQT,yBAAyBS;IAC7E,OAAO,OACHE;QAEA,MAAMC,MAAM,IAAIM,yBAAyB;YACrC,GAAGP,MAAM;QACb;QACA,OAAO,MAAMD,OAAO,IAAI,CAACE;IAC7B;AACJ"}
@@ -1,3 +1 @@
1
1
  export { SQSClient, SendMessageBatchCommand } from "@aws-sdk/client-sqs";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,3 +1 @@
1
1
  export { STS } from "@aws-sdk/client-sts";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,3 +1 @@
1
1
  export { fromTemporaryCredentials } from "@aws-sdk/credential-providers";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,3 +1 @@
1
1
  export { Upload } from "@aws-sdk/lib-storage";
2
-
3
- //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/aws-sdk",
3
- "version": "6.3.0",
3
+ "version": "6.4.0-beta.0",
4
4
  "type": "module",
5
5
  "description": "Wrapper for AWS SDK",
6
6
  "exports": {
@@ -9,33 +9,33 @@
9
9
  "license": "MIT",
10
10
  "author": "Webiny Ltd.",
11
11
  "dependencies": {
12
- "@aws-sdk/client-apigatewaymanagementapi": "3.1042.0",
13
- "@aws-sdk/client-cloudfront": "3.1042.0",
14
- "@aws-sdk/client-cloudwatch-events": "3.1042.0",
15
- "@aws-sdk/client-cloudwatch-logs": "3.1042.0",
16
- "@aws-sdk/client-cognito-identity-provider": "3.1042.0",
17
- "@aws-sdk/client-dynamodb": "3.1042.0",
18
- "@aws-sdk/client-dynamodb-streams": "3.1042.0",
19
- "@aws-sdk/client-eventbridge": "3.1042.0",
20
- "@aws-sdk/client-iam": "3.1042.0",
21
- "@aws-sdk/client-iot": "3.1042.0",
22
- "@aws-sdk/client-lambda": "3.1042.0",
23
- "@aws-sdk/client-s3": "3.1042.0",
24
- "@aws-sdk/client-scheduler": "3.1042.0",
25
- "@aws-sdk/client-sfn": "3.1042.0",
26
- "@aws-sdk/client-sqs": "3.1042.0",
27
- "@aws-sdk/client-sts": "3.1042.0",
28
- "@aws-sdk/credential-providers": "3.1042.0",
29
- "@aws-sdk/lib-dynamodb": "3.1042.0",
30
- "@aws-sdk/lib-storage": "3.1042.0",
31
- "@aws-sdk/s3-presigned-post": "3.1042.0",
32
- "@aws-sdk/s3-request-presigner": "3.1042.0",
12
+ "@aws-sdk/client-apigatewaymanagementapi": "3.1045.0",
13
+ "@aws-sdk/client-cloudfront": "3.1045.0",
14
+ "@aws-sdk/client-cloudwatch-events": "3.1045.0",
15
+ "@aws-sdk/client-cloudwatch-logs": "3.1045.0",
16
+ "@aws-sdk/client-cognito-identity-provider": "3.1045.0",
17
+ "@aws-sdk/client-dynamodb": "3.1045.0",
18
+ "@aws-sdk/client-dynamodb-streams": "3.1045.0",
19
+ "@aws-sdk/client-eventbridge": "3.1045.0",
20
+ "@aws-sdk/client-iam": "3.1045.0",
21
+ "@aws-sdk/client-iot": "3.1045.0",
22
+ "@aws-sdk/client-lambda": "3.1045.0",
23
+ "@aws-sdk/client-s3": "3.1045.0",
24
+ "@aws-sdk/client-scheduler": "3.1045.0",
25
+ "@aws-sdk/client-sfn": "3.1045.0",
26
+ "@aws-sdk/client-sqs": "3.1045.0",
27
+ "@aws-sdk/client-sts": "3.1045.0",
28
+ "@aws-sdk/credential-providers": "3.1045.0",
29
+ "@aws-sdk/lib-dynamodb": "3.1045.0",
30
+ "@aws-sdk/lib-storage": "3.1045.0",
31
+ "@aws-sdk/s3-presigned-post": "3.1045.0",
32
+ "@aws-sdk/s3-request-presigner": "3.1045.0",
33
33
  "@aws-sdk/util-dynamodb": "3.996.2",
34
34
  "@types/aws-lambda": "8.10.161",
35
- "@webiny/utils": "6.3.0"
35
+ "@webiny/utils": "6.4.0-beta.0"
36
36
  },
37
37
  "devDependencies": {
38
- "@webiny/build-tools": "6.3.0",
38
+ "@webiny/build-tools": "6.4.0-beta.0",
39
39
  "rimraf": "6.1.3",
40
40
  "typescript": "6.0.3"
41
41
  },
@@ -53,5 +53,5 @@
53
53
  ]
54
54
  }
55
55
  },
56
- "gitHead": "7cefe15431dbd65504e1f58147dc9e55bcbfa693"
56
+ "gitHead": "a545d7529828af07d08d49c3da1bcb967483b9ce"
57
57
  }
package/types/index.js CHANGED
@@ -1,3 +1 @@
1
1
  export * from "aws-lambda";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ApiGatewayManagementApiClient","PostToConnectionCommand","DeleteConnectionCommand","GetConnectionCommand","GoneException","ForbiddenException","LimitExceededException","PayloadTooLargeException"],"sources":["index.ts"],"sourcesContent":["export {\n ApiGatewayManagementApiClient,\n PostToConnectionCommand,\n DeleteConnectionCommand,\n GetConnectionCommand,\n GoneException,\n ForbiddenException,\n LimitExceededException,\n PayloadTooLargeException\n} from \"@aws-sdk/client-apigatewaymanagementapi\";\nexport type {\n PostToConnectionCommandInput,\n PostToConnectionRequest,\n PostToConnectionCommandOutput,\n PostToConnectionCommandInputType,\n DeleteConnectionCommandInput,\n DeleteConnectionRequest,\n DeleteConnectionCommandOutput,\n GetConnectionCommandInput,\n GetConnectionCommandOutput,\n GetConnectionRequest,\n GetConnectionResponse\n} from \"@aws-sdk/client-apigatewaymanagementapi\";\n"],"mappings":"AAAA,SACIA,6BAA6B,EAC7BC,uBAAuB,EACvBC,uBAAuB,EACvBC,oBAAoB,EACpBC,aAAa,EACbC,kBAAkB,EAClBC,sBAAsB,EACtBC,wBAAwB,QACrB,yCAAyC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["CloudFront"],"sources":["index.ts"],"sourcesContent":["export { CloudFront } from \"@aws-sdk/client-cloudfront\";\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,4BAA4B","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["CloudWatchEventsClient","DeleteRuleCommand","RemoveTargetsCommand","PutRuleCommand","PutTargetsCommand","CloudWatchLogs"],"sources":["index.ts"],"sourcesContent":["export {\n CloudWatchEventsClient,\n DeleteRuleCommand,\n RemoveTargetsCommand,\n PutRuleCommand,\n PutTargetsCommand\n} from \"@aws-sdk/client-cloudwatch-events\";\nexport type { PutRuleCommandInput } from \"@aws-sdk/client-cloudwatch-events\";\n\nexport { CloudWatchLogs, type GetLogEventsRequest } from \"@aws-sdk/client-cloudwatch-logs\";\n"],"mappings":"AAAA,SACIA,sBAAsB,EACtBC,iBAAiB,EACjBC,oBAAoB,EACpBC,cAAc,EACdC,iBAAiB,QACd,mCAAmC;AAG1C,SAASC,cAAc,QAAkC,iCAAiC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["QueryCommand","BatchWriteCommand","BatchGetCommand","PutCommand","ScanCommand","GetCommand","UpdateCommand","DeleteCommand","DynamoDBDocument","unmarshall","marshall","getDocumentClient"],"sources":["index.ts"],"sourcesContent":["export { QueryCommand } from \"@aws-sdk/client-dynamodb\";\nexport type {\n ScanInput,\n ScanOutput,\n WriteRequest,\n DynamoDBClient,\n DynamoDBClientConfig,\n AttributeValue\n} from \"@aws-sdk/client-dynamodb\";\n\nexport type { StreamRecord } from \"@aws-sdk/client-dynamodb-streams\";\n\nexport {\n BatchWriteCommand,\n BatchGetCommand,\n PutCommand,\n ScanCommand,\n GetCommand,\n UpdateCommand,\n DeleteCommand,\n DynamoDBDocument\n} from \"@aws-sdk/lib-dynamodb\";\n\nexport type {\n BatchWriteCommandInput,\n BatchWriteCommandOutput,\n BatchGetCommandInput,\n BatchGetCommandOutput,\n PutCommandInput,\n PutCommandOutput,\n UpdateCommandInput,\n GetCommandInput,\n GetCommandOutput,\n DeleteCommandInput,\n DeleteCommandOutput,\n ScanCommandInput,\n ScanCommandOutput,\n QueryCommandOutput\n} from \"@aws-sdk/lib-dynamodb\";\n\nexport { unmarshall, marshall } from \"@aws-sdk/util-dynamodb\";\n\nexport { getDocumentClient } from \"./getDocumentClient.js\";\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,0BAA0B;AAYvD,SACIC,iBAAiB,EACjBC,eAAe,EACfC,UAAU,EACVC,WAAW,EACXC,UAAU,EACVC,aAAa,EACbC,aAAa,EACbC,gBAAgB,QACb,uBAAuB;AAmB9B,SAASC,UAAU,EAAEC,QAAQ,QAAQ,wBAAwB;AAE7D,SAASC,iBAAiB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["IAM"],"sources":["index.ts"],"sourcesContent":["export { IAM } from \"@aws-sdk/client-iam\";\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,qBAAqB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["IoTClient","DescribeEndpointCommand"],"sources":["index.ts"],"sourcesContent":["export { IoTClient, DescribeEndpointCommand } from \"@aws-sdk/client-iot\";\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,uBAAuB,QAAQ,qBAAqB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["SQSClient","SendMessageBatchCommand"],"sources":["index.ts"],"sourcesContent":["export { SQSClient, SendMessageBatchCommand } from \"@aws-sdk/client-sqs\";\nexport type { SendMessageBatchRequestEntry } from \"@aws-sdk/client-sqs\";\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,uBAAuB,QAAQ,qBAAqB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["STS"],"sources":["index.ts"],"sourcesContent":["export { STS } from \"@aws-sdk/client-sts\";\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,qBAAqB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["fromTemporaryCredentials"],"sources":["index.ts"],"sourcesContent":["export { fromTemporaryCredentials } from \"@aws-sdk/credential-providers\";\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAQ,+BAA+B","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["Upload"],"sources":["index.ts"],"sourcesContent":["export { Upload } from \"@aws-sdk/lib-storage\";\nexport type {\n Options,\n Progress,\n BodyDataTypes,\n RawDataPart,\n Configuration\n} from \"@aws-sdk/lib-storage\";\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,sBAAsB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"aws-lambda\";\n"],"mappings":"AAAA,cAAc,YAAY","ignoreList":[]}