@webiny/aws-sdk 0.0.0-unstable.2696f9d9e8 → 0.0.0-unstable.a9593f74dd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- export { EventBridgeClient, PutEventsRequestEntry, PutEventsCommand, PutEventsCommandInput } from "@aws-sdk/client-eventbridge";
1
+ export { EventBridgeClient, PutEventsRequestEntry, PutEventsCommand, PutEventsCommandInput, PutEventsCommandOutput } from "@aws-sdk/client-eventbridge";
2
2
  export * from "./types";
@@ -7,7 +7,8 @@ var _exportNames = {
7
7
  EventBridgeClient: true,
8
8
  PutEventsRequestEntry: true,
9
9
  PutEventsCommand: true,
10
- PutEventsCommandInput: true
10
+ PutEventsCommandInput: true,
11
+ PutEventsCommandOutput: true
11
12
  };
12
13
  Object.defineProperty(exports, "EventBridgeClient", {
13
14
  enumerable: true,
@@ -27,6 +28,12 @@ Object.defineProperty(exports, "PutEventsCommandInput", {
27
28
  return _clientEventbridge.PutEventsCommandInput;
28
29
  }
29
30
  });
31
+ Object.defineProperty(exports, "PutEventsCommandOutput", {
32
+ enumerable: true,
33
+ get: function get() {
34
+ return _clientEventbridge.PutEventsCommandOutput;
35
+ }
36
+ });
30
37
  Object.defineProperty(exports, "PutEventsRequestEntry", {
31
38
  enumerable: true,
32
39
  get: function get() {
@@ -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} from \"@aws-sdk/client-eventbridge\";\n\nexport * from \"./types\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAOA,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,"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,4 +1,6 @@
1
+ import { S3, S3ClientConfig } from "@aws-sdk/client-s3";
1
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";
2
3
  export { createPresignedPost } from "@aws-sdk/s3-presigned-post";
3
4
  export { PresignedPost, PresignedPostOptions } from "@aws-sdk/s3-presigned-post";
4
5
  export { getSignedUrl } from "@aws-sdk/s3-request-presigner";
6
+ export declare const createS3Client: (initial?: S3ClientConfig) => S3;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
@@ -141,14 +142,31 @@ Object.defineProperty(exports, "createPresignedPost", {
141
142
  return _s3PresignedPost.createPresignedPost;
142
143
  }
143
144
  });
145
+ exports.createS3Client = void 0;
144
146
  Object.defineProperty(exports, "getSignedUrl", {
145
147
  enumerable: true,
146
148
  get: function get() {
147
149
  return _s3RequestPresigner.getSignedUrl;
148
150
  }
149
151
  });
152
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
150
153
  var _clientS = require("@aws-sdk/client-s3");
154
+ var _utils = require("@webiny/utils");
151
155
  var _s3PresignedPost = require("@aws-sdk/s3-presigned-post");
152
156
  var _s3RequestPresigner = require("@aws-sdk/s3-request-presigner");
157
+ var clients = new Map();
158
+ var createS3Client = function createS3Client(initial) {
159
+ var options = (0, _objectSpread2.default)({
160
+ region: process.env.AWS_REGION
161
+ }, initial);
162
+ var key = (0, _utils.createCacheKey)(options);
163
+ if (clients.has(key)) {
164
+ return clients.get(key);
165
+ }
166
+ var instance = new _clientS.S3(options);
167
+ clients.set(key, instance);
168
+ return instance;
169
+ };
170
+ exports.createS3Client = createS3Client;
153
171
 
154
172
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clientS","require","_s3PresignedPost","_s3RequestPresigner"],"sources":["index.ts"],"sourcesContent":["export {\n CompleteMultipartUploadCommandOutput,\n CompleteMultipartUploadOutput,\n DeleteObjectOutput,\n GetObjectCommand,\n GetObjectOutput,\n HeadObjectCommand,\n HeadObjectOutput,\n ListObjectsOutput,\n ListPartsCommand,\n ListPartsCommandOutput,\n ListPartsOutput,\n ObjectCannedACL,\n Part,\n PutObjectCommand,\n PutObjectCommandInput,\n PutObjectCommandOutput,\n PutObjectRequest,\n S3,\n S3Client,\n UploadPartCommand\n} from \"@aws-sdk/client-s3\";\n\nexport { createPresignedPost } from \"@aws-sdk/s3-presigned-post\";\nexport { PresignedPost, PresignedPostOptions } from \"@aws-sdk/s3-presigned-post\";\n\nexport { getSignedUrl } from \"@aws-sdk/s3-request-presigner\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAuBA,IAAAC,gBAAA,GAAAD,OAAA;AAGA,IAAAE,mBAAA,GAAAF,OAAA"}
1
+ {"version":3,"names":["_clientS","require","_utils","_s3PresignedPost","_s3RequestPresigner","clients","Map","createS3Client","initial","options","_objectSpread2","default","region","process","env","AWS_REGION","key","createCacheKey","has","get","instance","S3","set","exports"],"sources":["index.ts"],"sourcesContent":["import { S3, S3ClientConfig } from \"@aws-sdk/client-s3\";\nimport { createCacheKey } from \"@webiny/utils\";\n\nexport {\n CompleteMultipartUploadCommandOutput,\n CompleteMultipartUploadOutput,\n DeleteObjectOutput,\n GetObjectCommand,\n GetObjectOutput,\n HeadObjectCommand,\n HeadObjectOutput,\n ListObjectsOutput,\n ListPartsCommand,\n ListPartsCommandOutput,\n ListPartsOutput,\n ObjectCannedACL,\n Part,\n PutObjectCommand,\n PutObjectCommandInput,\n PutObjectCommandOutput,\n PutObjectRequest,\n S3,\n S3Client,\n UploadPartCommand\n} from \"@aws-sdk/client-s3\";\n\nexport { createPresignedPost } from \"@aws-sdk/s3-presigned-post\";\nexport { PresignedPost, PresignedPostOptions } from \"@aws-sdk/s3-presigned-post\";\n\nexport { getSignedUrl } from \"@aws-sdk/s3-request-presigner\";\n\nconst clients = new Map<string, S3>();\n\nexport const createS3Client = (initial?: S3ClientConfig): S3 => {\n const options = {\n region: process.env.AWS_REGION,\n ...initial\n };\n const key = createCacheKey(options);\n if (clients.has(key)) {\n return clients.get(key) as S3;\n }\n\n const instance = new S3(options);\n clients.set(key, instance);\n return instance;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAyBA,IAAAE,gBAAA,GAAAF,OAAA;AAGA,IAAAG,mBAAA,GAAAH,OAAA;AAEA,IAAMI,OAAO,GAAG,IAAIC,GAAG,CAAa,CAAC;AAE9B,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,OAAwB,EAAS;EAC5D,IAAMC,OAAO,OAAAC,cAAA,CAAAC,OAAA;IACTC,MAAM,EAAEC,OAAO,CAACC,GAAG,CAACC;EAAU,GAC3BP,OAAO,CACb;EACD,IAAMQ,GAAG,GAAG,IAAAC,qBAAc,EAACR,OAAO,CAAC;EACnC,IAAIJ,OAAO,CAACa,GAAG,CAACF,GAAG,CAAC,EAAE;IAClB,OAAOX,OAAO,CAACc,GAAG,CAACH,GAAG,CAAC;EAC3B;EAEA,IAAMI,QAAQ,GAAG,IAAIC,WAAE,CAACZ,OAAO,CAAC;EAChCJ,OAAO,CAACiB,GAAG,CAACN,GAAG,EAAEI,QAAQ,CAAC;EAC1B,OAAOA,QAAQ;AACnB,CAAC;AAACG,OAAA,CAAAhB,cAAA,GAAAA,cAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/aws-sdk",
3
- "version": "0.0.0-unstable.2696f9d9e8",
3
+ "version": "0.0.0-unstable.a9593f74dd",
4
4
  "description": "Wrapper for AWS SDK",
5
5
  "main": "index.js",
6
6
  "license": "MIT",
@@ -24,13 +24,14 @@
24
24
  "@aws-sdk/lib-storage": "3.451.0",
25
25
  "@aws-sdk/s3-presigned-post": "3.425.0",
26
26
  "@aws-sdk/s3-request-presigner": "3.425.0",
27
- "@aws-sdk/util-dynamodb": "3.425.0"
27
+ "@aws-sdk/util-dynamodb": "3.425.0",
28
+ "@webiny/utils": "0.0.0-unstable.a9593f74dd"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@babel/cli": "7.22.6",
31
32
  "@babel/core": "7.22.8",
32
- "@webiny/cli": "0.0.0-unstable.2696f9d9e8",
33
- "@webiny/project-utils": "0.0.0-unstable.2696f9d9e8",
33
+ "@webiny/cli": "0.0.0-unstable.a9593f74dd",
34
+ "@webiny/project-utils": "0.0.0-unstable.a9593f74dd",
34
35
  "rimraf": "3.0.2",
35
36
  "typescript": "4.7.4"
36
37
  },
@@ -42,5 +43,5 @@
42
43
  "build": "yarn webiny run build",
43
44
  "watch": "yarn webiny run watch"
44
45
  },
45
- "gitHead": "2696f9d9e84ad621e1412a05e1252b5ca9c245fb"
46
+ "gitHead": "a9593f74ddf9ce93263eadb0ddc0807ed343f5ee"
46
47
  }