ag-common 0.0.29 → 0.0.30

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,5 +1,6 @@
1
1
  import { Blob } from 'aws-sdk/lib/dynamodb/document_client';
2
2
  import AWS from 'aws-sdk';
3
+ export declare const setS3: (region: string) => void;
3
4
  export declare const getS3Object: ({ fileurl, }: {
4
5
  fileurl: {
5
6
  Bucket: string;
@@ -12,9 +12,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.putS3Object = exports.getS3Object = void 0;
15
+ exports.putS3Object = exports.getS3Object = exports.setS3 = void 0;
16
16
  const aws_sdk_1 = __importDefault(require("aws-sdk"));
17
- const s3 = new aws_sdk_1.default.S3();
17
+ let s3 = new aws_sdk_1.default.S3();
18
+ const setS3 = (region) => {
19
+ s3 = new aws_sdk_1.default.S3({ region });
20
+ };
21
+ exports.setS3 = setS3;
18
22
  const getS3Object = ({ fileurl, }) => __awaiter(void 0, void 0, void 0, function* () {
19
23
  const content = yield s3.getObject(fileurl).promise();
20
24
  return content;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ag-common",
3
- "version": "0.0.29",
3
+ "version": "0.0.30",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "author": "Andrei Gec <@andreigec> (https://gec.dev/)",