@webiny/aws-sdk 0.0.0-unstable.a9593f74dd β†’ 0.0.0-unstable.b6d7105cee

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 (52) hide show
  1. package/README.md +11 -0
  2. package/client-apigatewaymanagementapi/index.d.ts +2 -0
  3. package/client-apigatewaymanagementapi/index.js +1 -0
  4. package/client-cloudfront/index.js +1 -14
  5. package/client-cloudwatch/index.d.ts +3 -2
  6. package/client-cloudwatch/index.js +2 -57
  7. package/client-cognito-identity-provider/index.d.ts +5 -1
  8. package/client-cognito-identity-provider/index.js +18 -30
  9. package/client-cognito-identity-provider/index.js.map +1 -1
  10. package/client-dynamodb/getDocumentClient.d.ts +6 -1
  11. package/client-dynamodb/getDocumentClient.js +32 -33
  12. package/client-dynamodb/getDocumentClient.js.map +1 -1
  13. package/client-dynamodb/index.d.ts +5 -4
  14. package/client-dynamodb/index.js +4 -95
  15. package/client-eventbridge/index.d.ts +5 -2
  16. package/client-eventbridge/index.js +5 -55
  17. package/client-eventbridge/index.js.map +1 -1
  18. package/client-iam/index.js +1 -14
  19. package/client-iot/index.d.ts +1 -0
  20. package/client-iot/index.js +1 -0
  21. package/client-lambda/index.d.ts +5 -1
  22. package/client-lambda/index.js +18 -18
  23. package/client-lambda/index.js.map +1 -1
  24. package/client-s3/index.d.ts +10 -4
  25. package/client-s3/index.js +38 -169
  26. package/client-s3/index.js.map +1 -1
  27. package/client-scheduler/index.d.ts +8 -0
  28. package/client-scheduler/index.js +20 -0
  29. package/client-scheduler/index.js.map +1 -0
  30. package/client-sfn/index.d.ts +12 -7
  31. package/client-sfn/index.js +49 -45
  32. package/client-sfn/index.js.map +1 -1
  33. package/client-sqs/index.d.ts +2 -1
  34. package/client-sqs/index.js +1 -26
  35. package/client-sts/index.js +1 -14
  36. package/credential-providers/index.js +1 -14
  37. package/lib-storage/index.d.ts +1 -0
  38. package/lib-storage/index.js +1 -14
  39. package/package.json +45 -34
  40. package/types/index.d.ts +1 -0
  41. package/types/index.js +1 -0
  42. package/client-cloudfront/index.js.map +0 -1
  43. package/client-cloudwatch/index.js.map +0 -1
  44. package/client-dynamodb/index.js.map +0 -1
  45. package/client-eventbridge/types.d.ts +0 -29
  46. package/client-eventbridge/types.js +0 -7
  47. package/client-eventbridge/types.js.map +0 -1
  48. package/client-iam/index.js.map +0 -1
  49. package/client-sqs/index.js.map +0 -1
  50. package/client-sts/index.js.map +0 -1
  51. package/credential-providers/index.js.map +0 -1
  52. package/lib-storage/index.js.map +0 -1
package/README.md ADDED
@@ -0,0 +1,11 @@
1
+ # @webiny/aws-sdk
2
+
3
+ > [!NOTE]
4
+ > This package is part of the [Webiny](https://www.webiny.com) monorepo.
5
+ > It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
6
+
7
+ πŸ“˜ **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
8
+
9
+ ---
10
+
11
+ _This README file is automatically generated during the publish process._
@@ -0,0 +1,2 @@
1
+ export { ApiGatewayManagementApiClient, PostToConnectionCommand, DeleteConnectionCommand, GetConnectionCommand, GoneException, ForbiddenException, LimitExceededException, PayloadTooLargeException } from "@aws-sdk/client-apigatewaymanagementapi";
2
+ export type { PostToConnectionCommandInput, PostToConnectionRequest, PostToConnectionCommandOutput, PostToConnectionCommandInputType, DeleteConnectionCommandInput, DeleteConnectionRequest, DeleteConnectionCommandOutput, GetConnectionCommandInput, GetConnectionCommandOutput, GetConnectionRequest, GetConnectionResponse } from "@aws-sdk/client-apigatewaymanagementapi";
@@ -0,0 +1 @@
1
+ export { ApiGatewayManagementApiClient, DeleteConnectionCommand, ForbiddenException, GetConnectionCommand, GoneException, LimitExceededException, PayloadTooLargeException, PostToConnectionCommand } from "@aws-sdk/client-apigatewaymanagementapi";
@@ -1,14 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "CloudFront", {
7
- enumerable: true,
8
- get: function get() {
9
- return _clientCloudfront.CloudFront;
10
- }
11
- });
12
- var _clientCloudfront = require("@aws-sdk/client-cloudfront");
13
-
14
- //# sourceMappingURL=index.js.map
1
+ export { CloudFront } from "@aws-sdk/client-cloudfront";
@@ -1,2 +1,3 @@
1
- export { CloudWatchEventsClient, DeleteRuleCommand, RemoveTargetsCommand, PutRuleCommand, PutTargetsCommand, PutRuleCommandInput } from "@aws-sdk/client-cloudwatch-events";
2
- export { CloudWatchLogs, GetLogEventsRequest } from "@aws-sdk/client-cloudwatch-logs";
1
+ export { CloudWatchEventsClient, DeleteRuleCommand, RemoveTargetsCommand, PutRuleCommand, PutTargetsCommand } from "@aws-sdk/client-cloudwatch-events";
2
+ export type { PutRuleCommandInput } from "@aws-sdk/client-cloudwatch-events";
3
+ export { CloudWatchLogs, type GetLogEventsRequest } from "@aws-sdk/client-cloudwatch-logs";
@@ -1,57 +1,2 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "CloudWatchEventsClient", {
7
- enumerable: true,
8
- get: function get() {
9
- return _clientCloudwatchEvents.CloudWatchEventsClient;
10
- }
11
- });
12
- Object.defineProperty(exports, "CloudWatchLogs", {
13
- enumerable: true,
14
- get: function get() {
15
- return _clientCloudwatchLogs.CloudWatchLogs;
16
- }
17
- });
18
- Object.defineProperty(exports, "DeleteRuleCommand", {
19
- enumerable: true,
20
- get: function get() {
21
- return _clientCloudwatchEvents.DeleteRuleCommand;
22
- }
23
- });
24
- Object.defineProperty(exports, "GetLogEventsRequest", {
25
- enumerable: true,
26
- get: function get() {
27
- return _clientCloudwatchLogs.GetLogEventsRequest;
28
- }
29
- });
30
- Object.defineProperty(exports, "PutRuleCommand", {
31
- enumerable: true,
32
- get: function get() {
33
- return _clientCloudwatchEvents.PutRuleCommand;
34
- }
35
- });
36
- Object.defineProperty(exports, "PutRuleCommandInput", {
37
- enumerable: true,
38
- get: function get() {
39
- return _clientCloudwatchEvents.PutRuleCommandInput;
40
- }
41
- });
42
- Object.defineProperty(exports, "PutTargetsCommand", {
43
- enumerable: true,
44
- get: function get() {
45
- return _clientCloudwatchEvents.PutTargetsCommand;
46
- }
47
- });
48
- Object.defineProperty(exports, "RemoveTargetsCommand", {
49
- enumerable: true,
50
- get: function get() {
51
- return _clientCloudwatchEvents.RemoveTargetsCommand;
52
- }
53
- });
54
- var _clientCloudwatchEvents = require("@aws-sdk/client-cloudwatch-events");
55
- var _clientCloudwatchLogs = require("@aws-sdk/client-cloudwatch-logs");
56
-
57
- //# sourceMappingURL=index.js.map
1
+ export { CloudWatchEventsClient, DeleteRuleCommand, PutRuleCommand, PutTargetsCommand, RemoveTargetsCommand } from "@aws-sdk/client-cloudwatch-events";
2
+ export { CloudWatchLogs } from "@aws-sdk/client-cloudwatch-logs";
@@ -1 +1,5 @@
1
- export { AdminCreateUserRequest, CognitoIdentityProvider, ListUsersResponse, UserType } from "@aws-sdk/client-cognito-identity-provider";
1
+ import type { CognitoIdentityProviderClientConfig } from "@aws-sdk/client-cognito-identity-provider";
2
+ import { CognitoIdentityProvider } from "@aws-sdk/client-cognito-identity-provider";
3
+ export { AdminGetUserCommand, AdminCreateUserCommand, AdminDeleteUserCommand, AdminUpdateUserAttributesCommand, CognitoIdentityProvider, CognitoIdentityProviderClient } from "@aws-sdk/client-cognito-identity-provider";
4
+ export type { AttributeType, ListUsersResponse, AdminCreateUserRequest, AdminGetUserRequest, UserType, CognitoIdentityProviderClientConfig, AdminGetUserCommandInput, AdminGetUserCommandOutput, AdminCreateUserCommandInput, AdminCreateUserCommandOutput, AdminDeleteUserCommandInput, AdminDeleteUserCommandOutput, AdminUpdateUserAttributesCommandInput, AdminUpdateUserAttributesCommandOutput } from "@aws-sdk/client-cognito-identity-provider";
5
+ export declare const createCognitoIdentityProviderClient: (input?: Partial<CognitoIdentityProviderClientConfig>) => CognitoIdentityProvider;
@@ -1,32 +1,20 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "AdminCreateUserRequest", {
7
- enumerable: true,
8
- get: function get() {
9
- return _clientCognitoIdentityProvider.AdminCreateUserRequest;
10
- }
11
- });
12
- Object.defineProperty(exports, "CognitoIdentityProvider", {
13
- enumerable: true,
14
- get: function get() {
15
- return _clientCognitoIdentityProvider.CognitoIdentityProvider;
16
- }
17
- });
18
- Object.defineProperty(exports, "ListUsersResponse", {
19
- enumerable: true,
20
- get: function get() {
21
- return _clientCognitoIdentityProvider.ListUsersResponse;
22
- }
23
- });
24
- Object.defineProperty(exports, "UserType", {
25
- enumerable: true,
26
- get: function get() {
27
- return _clientCognitoIdentityProvider.UserType;
28
- }
29
- });
30
- var _clientCognitoIdentityProvider = require("@aws-sdk/client-cognito-identity-provider");
1
+ import { AdminCreateUserCommand, AdminDeleteUserCommand, AdminGetUserCommand, AdminUpdateUserAttributesCommand, CognitoIdentityProvider, CognitoIdentityProviderClient } from "@aws-sdk/client-cognito-identity-provider";
2
+ import { createCacheKey } from "@webiny/utils";
3
+ const DEFAULT_CONFIG = {
4
+ region: process.env.AWS_REGION
5
+ };
6
+ const cache = {};
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;
17
+ };
18
+ export { AdminCreateUserCommand, AdminDeleteUserCommand, AdminGetUserCommand, AdminUpdateUserAttributesCommand, CognitoIdentityProvider, CognitoIdentityProviderClient, createCognitoIdentityProviderClient };
31
19
 
32
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clientCognitoIdentityProvider","require"],"sources":["index.ts"],"sourcesContent":["export {\n AdminCreateUserRequest,\n CognitoIdentityProvider,\n ListUsersResponse,\n UserType\n} from \"@aws-sdk/client-cognito-identity-provider\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA"}
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,3 +1,8 @@
1
- import { DynamoDBClientConfig } from "@aws-sdk/client-dynamodb";
1
+ import type { DynamoDBClientConfig } from "@aws-sdk/client-dynamodb";
2
2
  import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
3
+ export interface IDecorateDocumentClientCallable {
4
+ (client: DynamoDBDocument): DynamoDBDocument;
5
+ }
6
+ export { getDocumentClient as createDocumentClient };
3
7
  export declare const getDocumentClient: (input?: DynamoDBClientConfig) => DynamoDBDocument;
8
+ export declare const decorateDocumentClient: (cb: IDecorateDocumentClientCallable) => void;
@@ -1,39 +1,38 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.getDocumentClient = void 0;
8
- var _clientDynamodb = require("@aws-sdk/client-dynamodb");
9
- var _libDynamodb = require("@aws-sdk/lib-dynamodb");
10
- var _crypto = _interopRequireDefault(require("crypto"));
11
- var DEFAULT_CONFIG = {
12
- region: process.env.AWS_REGION
13
- };
14
- var createKey = function createKey(config) {
15
- var key = JSON.stringify(config);
16
- var hash = _crypto.default.createHash("sha1");
17
- hash.update(key);
18
- return hash.digest("hex");
1
+ import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
2
+ import { DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
3
+ import { createCacheKey } from "@webiny/utils";
4
+ let decorateDocumentClientCallable;
5
+ const DEFAULT_CONFIG = {
6
+ region: process.env.AWS_REGION
19
7
  };
20
- var documentClients = {};
21
- var getDocumentClient = function getDocumentClient(input) {
22
- var config = input || DEFAULT_CONFIG;
23
- var key = createKey(config);
24
- if (documentClients[key]) {
25
- return documentClients[key];
26
- }
27
- var client = new _clientDynamodb.DynamoDBClient(config);
28
- var documentClient = _libDynamodb.DynamoDBDocument.from(client, {
8
+ const documentClients = {};
9
+ const documentClientConfig = {
29
10
  marshallOptions: {
30
- convertEmptyValues: true,
31
- removeUndefinedValues: true
11
+ convertEmptyValues: true,
12
+ removeUndefinedValues: true,
13
+ convertClassInstanceToMap: true
32
14
  }
33
- });
34
- documentClients[key] = documentClient;
35
- return documentClient;
36
15
  };
37
- exports.getDocumentClient = getDocumentClient;
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);
26
+ };
27
+ const applyDecoration = (client)=>{
28
+ if (!decorateDocumentClientCallable) return client;
29
+ client.__decoratedByWebiny = true;
30
+ return decorateDocumentClientCallable(client);
31
+ };
32
+ const decorateDocumentClient = (cb)=>{
33
+ decorateDocumentClientCallable = cb;
34
+ for(const key in documentClients)cb(documentClients[key]);
35
+ };
36
+ export { decorateDocumentClient, getDocumentClient as createDocumentClient, getDocumentClient };
38
37
 
39
38
  //# sourceMappingURL=getDocumentClient.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clientDynamodb","require","_libDynamodb","_crypto","_interopRequireDefault","DEFAULT_CONFIG","region","process","env","AWS_REGION","createKey","config","key","JSON","stringify","hash","crypto","createHash","update","digest","documentClients","getDocumentClient","input","client","DynamoDBClient","documentClient","DynamoDBDocument","from","marshallOptions","convertEmptyValues","removeUndefinedValues","exports"],"sources":["getDocumentClient.ts"],"sourcesContent":["import { DynamoDBClient, DynamoDBClientConfig } from \"@aws-sdk/client-dynamodb\";\nimport { DynamoDBDocument } from \"@aws-sdk/lib-dynamodb\";\nimport crypto from \"crypto\";\n\nconst DEFAULT_CONFIG = {\n region: process.env.AWS_REGION\n};\n\nconst createKey = (config: DynamoDBClientConfig): string => {\n const key = JSON.stringify(config);\n const hash = crypto.createHash(\"sha1\");\n hash.update(key);\n return hash.digest(\"hex\");\n};\n\nconst documentClients: Record<string, DynamoDBDocument> = {};\n\nexport const getDocumentClient = (input?: DynamoDBClientConfig) => {\n const config = input || DEFAULT_CONFIG;\n const key = createKey(config);\n if (documentClients[key]) {\n return documentClients[key];\n }\n const client = new DynamoDBClient(config);\n const documentClient = DynamoDBDocument.from(client, {\n marshallOptions: {\n convertEmptyValues: true,\n removeUndefinedValues: true\n }\n });\n documentClients[key] = documentClient;\n return documentClient;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAMI,cAAc,GAAG;EACnBC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC;AACxB,CAAC;AAED,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAIC,MAA4B,EAAa;EACxD,IAAMC,GAAG,GAAGC,IAAI,CAACC,SAAS,CAACH,MAAM,CAAC;EAClC,IAAMI,IAAI,GAAGC,eAAM,CAACC,UAAU,CAAC,MAAM,CAAC;EACtCF,IAAI,CAACG,MAAM,CAACN,GAAG,CAAC;EAChB,OAAOG,IAAI,CAACI,MAAM,CAAC,KAAK,CAAC;AAC7B,CAAC;AAED,IAAMC,eAAiD,GAAG,CAAC,CAAC;AAErD,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,KAA4B,EAAK;EAC/D,IAAMX,MAAM,GAAGW,KAAK,IAAIjB,cAAc;EACtC,IAAMO,GAAG,GAAGF,SAAS,CAACC,MAAM,CAAC;EAC7B,IAAIS,eAAe,CAACR,GAAG,CAAC,EAAE;IACtB,OAAOQ,eAAe,CAACR,GAAG,CAAC;EAC/B;EACA,IAAMW,MAAM,GAAG,IAAIC,8BAAc,CAACb,MAAM,CAAC;EACzC,IAAMc,cAAc,GAAGC,6BAAgB,CAACC,IAAI,CAACJ,MAAM,EAAE;IACjDK,eAAe,EAAE;MACbC,kBAAkB,EAAE,IAAI;MACxBC,qBAAqB,EAAE;IAC3B;EACJ,CAAC,CAAC;EACFV,eAAe,CAACR,GAAG,CAAC,GAAGa,cAAc;EACrC,OAAOA,cAAc;AACzB,CAAC;AAACM,OAAA,CAAAV,iBAAA,GAAAA,iBAAA"}
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,7 @@
1
- export { QueryCommand, ScanInput, ScanOutput, WriteRequest } from "@aws-sdk/client-dynamodb";
2
- export type { DynamoDBClient, DynamoDBClientConfig, AttributeValue } from "@aws-sdk/client-dynamodb";
1
+ export { QueryCommand } from "@aws-sdk/client-dynamodb";
2
+ export type { ScanInput, ScanOutput, WriteRequest, DynamoDBClient, DynamoDBClientConfig, AttributeValue } from "@aws-sdk/client-dynamodb";
3
3
  export type { StreamRecord } from "@aws-sdk/client-dynamodb-streams";
4
- export { GetCommandOutput, BatchWriteCommand, PutCommand, GetCommand, UpdateCommand, DeleteCommand, DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
4
+ export { BatchWriteCommand, BatchGetCommand, PutCommand, ScanCommand, GetCommand, UpdateCommand, DeleteCommand, DynamoDBDocument } from "@aws-sdk/lib-dynamodb";
5
+ export type { BatchWriteCommandInput, BatchWriteCommandOutput, BatchGetCommandInput, BatchGetCommandOutput, PutCommandInput, PutCommandOutput, UpdateCommandInput, GetCommandInput, GetCommandOutput, DeleteCommandInput, DeleteCommandOutput, ScanCommandInput, ScanCommandOutput, QueryCommandOutput } from "@aws-sdk/lib-dynamodb";
5
6
  export { unmarshall, marshall } from "@aws-sdk/util-dynamodb";
6
- export { getDocumentClient } from "./getDocumentClient";
7
+ export { getDocumentClient } from "./getDocumentClient.js";
@@ -1,95 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "BatchWriteCommand", {
7
- enumerable: true,
8
- get: function get() {
9
- return _libDynamodb.BatchWriteCommand;
10
- }
11
- });
12
- Object.defineProperty(exports, "DeleteCommand", {
13
- enumerable: true,
14
- get: function get() {
15
- return _libDynamodb.DeleteCommand;
16
- }
17
- });
18
- Object.defineProperty(exports, "DynamoDBDocument", {
19
- enumerable: true,
20
- get: function get() {
21
- return _libDynamodb.DynamoDBDocument;
22
- }
23
- });
24
- Object.defineProperty(exports, "GetCommand", {
25
- enumerable: true,
26
- get: function get() {
27
- return _libDynamodb.GetCommand;
28
- }
29
- });
30
- Object.defineProperty(exports, "GetCommandOutput", {
31
- enumerable: true,
32
- get: function get() {
33
- return _libDynamodb.GetCommandOutput;
34
- }
35
- });
36
- Object.defineProperty(exports, "PutCommand", {
37
- enumerable: true,
38
- get: function get() {
39
- return _libDynamodb.PutCommand;
40
- }
41
- });
42
- Object.defineProperty(exports, "QueryCommand", {
43
- enumerable: true,
44
- get: function get() {
45
- return _clientDynamodb.QueryCommand;
46
- }
47
- });
48
- Object.defineProperty(exports, "ScanInput", {
49
- enumerable: true,
50
- get: function get() {
51
- return _clientDynamodb.ScanInput;
52
- }
53
- });
54
- Object.defineProperty(exports, "ScanOutput", {
55
- enumerable: true,
56
- get: function get() {
57
- return _clientDynamodb.ScanOutput;
58
- }
59
- });
60
- Object.defineProperty(exports, "UpdateCommand", {
61
- enumerable: true,
62
- get: function get() {
63
- return _libDynamodb.UpdateCommand;
64
- }
65
- });
66
- Object.defineProperty(exports, "WriteRequest", {
67
- enumerable: true,
68
- get: function get() {
69
- return _clientDynamodb.WriteRequest;
70
- }
71
- });
72
- Object.defineProperty(exports, "getDocumentClient", {
73
- enumerable: true,
74
- get: function get() {
75
- return _getDocumentClient.getDocumentClient;
76
- }
77
- });
78
- Object.defineProperty(exports, "marshall", {
79
- enumerable: true,
80
- get: function get() {
81
- return _utilDynamodb.marshall;
82
- }
83
- });
84
- Object.defineProperty(exports, "unmarshall", {
85
- enumerable: true,
86
- get: function get() {
87
- return _utilDynamodb.unmarshall;
88
- }
89
- });
90
- var _clientDynamodb = require("@aws-sdk/client-dynamodb");
91
- var _libDynamodb = require("@aws-sdk/lib-dynamodb");
92
- var _utilDynamodb = require("@aws-sdk/util-dynamodb");
93
- var _getDocumentClient = require("./getDocumentClient");
94
-
95
- //# sourceMappingURL=index.js.map
1
+ export { QueryCommand } from "@aws-sdk/client-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
+ export { getDocumentClient } from "./getDocumentClient.js";
@@ -1,2 +1,5 @@
1
- export { EventBridgeClient, PutEventsRequestEntry, PutEventsCommand, PutEventsCommandInput, PutEventsCommandOutput } from "@aws-sdk/client-eventbridge";
2
- export * from "./types";
1
+ import type { EventBridgeClientConfig } from "@aws-sdk/client-eventbridge";
2
+ import { EventBridgeClient } from "@aws-sdk/client-eventbridge";
3
+ export { EventBridgeClient, PutEventsCommand } from "@aws-sdk/client-eventbridge";
4
+ export type { EventBridgeClientConfig, PutEventsRequestEntry, PutEventsCommandInput, PutEventsCommandOutput } from "@aws-sdk/client-eventbridge";
5
+ export declare const createEventBridgeClient: (config?: Partial<EventBridgeClientConfig>) => EventBridgeClient;
@@ -1,57 +1,7 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _exportNames = {
7
- EventBridgeClient: true,
8
- PutEventsRequestEntry: true,
9
- PutEventsCommand: true,
10
- PutEventsCommandInput: true,
11
- PutEventsCommandOutput: true
12
- };
13
- Object.defineProperty(exports, "EventBridgeClient", {
14
- enumerable: true,
15
- get: function get() {
16
- return _clientEventbridge.EventBridgeClient;
17
- }
18
- });
19
- Object.defineProperty(exports, "PutEventsCommand", {
20
- enumerable: true,
21
- get: function get() {
22
- return _clientEventbridge.PutEventsCommand;
23
- }
24
- });
25
- Object.defineProperty(exports, "PutEventsCommandInput", {
26
- enumerable: true,
27
- get: function get() {
28
- return _clientEventbridge.PutEventsCommandInput;
29
- }
30
- });
31
- Object.defineProperty(exports, "PutEventsCommandOutput", {
32
- enumerable: true,
33
- get: function get() {
34
- return _clientEventbridge.PutEventsCommandOutput;
35
- }
36
- });
37
- Object.defineProperty(exports, "PutEventsRequestEntry", {
38
- enumerable: true,
39
- get: function get() {
40
- return _clientEventbridge.PutEventsRequestEntry;
41
- }
42
- });
43
- var _clientEventbridge = require("@aws-sdk/client-eventbridge");
44
- var _types = require("./types");
45
- Object.keys(_types).forEach(function (key) {
46
- if (key === "default" || key === "__esModule") return;
47
- if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
48
- if (key in exports && exports[key] === _types[key]) return;
49
- Object.defineProperty(exports, key, {
50
- enumerable: true,
51
- get: function get() {
52
- return _types[key];
53
- }
54
- });
55
- });
1
+ import { EventBridgeClient, PutEventsCommand } from "@aws-sdk/client-eventbridge";
2
+ const createEventBridgeClient = (config)=>new EventBridgeClient({
3
+ ...config
4
+ });
5
+ export { EventBridgeClient, PutEventsCommand, createEventBridgeClient };
56
6
 
57
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clientEventbridge","require","_types","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["export {\n EventBridgeClient,\n PutEventsRequestEntry,\n PutEventsCommand,\n PutEventsCommandInput,\n PutEventsCommandOutput\n} from \"@aws-sdk/client-eventbridge\";\n\nexport * from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,MAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,MAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAZ,MAAA,CAAAI,GAAA;IAAA;EAAA;AAAA"}
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,14 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "IAM", {
7
- enumerable: true,
8
- get: function get() {
9
- return _clientIam.IAM;
10
- }
11
- });
12
- var _clientIam = require("@aws-sdk/client-iam");
13
-
14
- //# sourceMappingURL=index.js.map
1
+ export { IAM } from "@aws-sdk/client-iam";
@@ -0,0 +1 @@
1
+ export { IoTClient, DescribeEndpointCommand } from "@aws-sdk/client-iot";
@@ -0,0 +1 @@
1
+ export { DescribeEndpointCommand, IoTClient } from "@aws-sdk/client-iot";
@@ -1 +1,5 @@
1
- export { LambdaClient, InvokeCommand } from "@aws-sdk/client-lambda";
1
+ import type { LambdaClientConfig } from "@aws-sdk/client-lambda";
2
+ import { LambdaClient } from "@aws-sdk/client-lambda";
3
+ export { LambdaClient, InvokeCommand, GetFunctionConfigurationCommand, UpdateFunctionConfigurationCommand, UpdateFunctionCodeCommand, InvocationType } from "@aws-sdk/client-lambda";
4
+ export type { InvokeCommandInput, LambdaClientConfig, InvokeCommandOutput, UpdateFunctionConfigurationCommandInput, UpdateFunctionConfigurationCommandOutput, UpdateFunctionCodeCommandInput, UpdateFunctionCodeCommandOutput } from "@aws-sdk/client-lambda";
5
+ export declare const createLambdaClient: (input?: Partial<LambdaClientConfig>) => LambdaClient;
@@ -1,20 +1,20 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "InvokeCommand", {
7
- enumerable: true,
8
- get: function get() {
9
- return _clientLambda.InvokeCommand;
10
- }
11
- });
12
- Object.defineProperty(exports, "LambdaClient", {
13
- enumerable: true,
14
- get: function get() {
15
- return _clientLambda.LambdaClient;
16
- }
17
- });
18
- 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";
3
+ const DEFAULT_CONFIG = {
4
+ region: process.env.AWS_REGION
5
+ };
6
+ const lambdaClients = {};
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;
17
+ };
18
+ export { GetFunctionConfigurationCommand, InvocationType, InvokeCommand, LambdaClient, UpdateFunctionCodeCommand, UpdateFunctionConfigurationCommand, createLambdaClient };
19
19
 
20
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clientLambda","require"],"sources":["index.ts"],"sourcesContent":["export { LambdaClient, InvokeCommand } from \"@aws-sdk/client-lambda\";\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA"}
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,6 +1,12 @@
1
- import { S3, S3ClientConfig } from "@aws-sdk/client-s3";
2
- export { CompleteMultipartUploadCommandOutput, CompleteMultipartUploadOutput, DeleteObjectOutput, GetObjectCommand, GetObjectOutput, HeadObjectCommand, HeadObjectOutput, ListObjectsOutput, ListPartsCommand, ListPartsCommandOutput, ListPartsOutput, ObjectCannedACL, Part, PutObjectCommand, PutObjectCommandInput, PutObjectCommandOutput, PutObjectRequest, S3, S3Client, UploadPartCommand } from "@aws-sdk/client-s3";
1
+ import type { S3ClientConfig as BaseS3ClientConfig } from "@aws-sdk/client-s3";
2
+ import { S3, S3Client } 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";
3
5
  export { createPresignedPost } from "@aws-sdk/s3-presigned-post";
4
- export { PresignedPost, PresignedPostOptions } from "@aws-sdk/s3-presigned-post";
6
+ export type { PresignedPost, PresignedPostOptions } from "@aws-sdk/s3-presigned-post";
5
7
  export { getSignedUrl } from "@aws-sdk/s3-request-presigner";
6
- export declare const createS3Client: (initial?: S3ClientConfig) => S3;
8
+ export interface S3ClientConfig extends BaseS3ClientConfig {
9
+ cache?: boolean;
10
+ }
11
+ export declare const createS3Client: (initial?: S3ClientConfig) => S3Client;
12
+ export declare const createS3: (initial?: S3ClientConfig) => S3;