@socket.tech/dl-common 1.0.3-test.27 → 1.0.3-test.28

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,3 @@
1
1
  export declare const initS3Client: (region: string) => Promise<void>;
2
2
  export declare const getFileFromS3: (bucket: string, filePath: string) => Promise<any>;
3
+ export declare const getS3Config: (deploymentMode: string, region?: string) => Promise<any>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFileFromS3 = exports.initS3Client = void 0;
3
+ exports.getS3Config = exports.getFileFromS3 = exports.initS3Client = void 0;
4
4
  const client_s3_1 = require("@aws-sdk/client-s3");
5
5
  // Set your AWS credentials and region
6
6
  let s3Client;
@@ -32,3 +32,10 @@ const getFileFromS3 = async (bucket, filePath) => {
32
32
  }
33
33
  };
34
34
  exports.getFileFromS3 = getFileFromS3;
35
+ const getS3Config = async (deploymentMode, region = "us-east-1") => {
36
+ const S3_BUCKET_NAME = "socket-dl-" + deploymentMode;
37
+ const S3_RPC_CONFIG_FILE_PATH = deploymentMode + "RpcConfig.json";
38
+ (0, exports.initS3Client)(region);
39
+ return await (0, exports.getFileFromS3)(S3_BUCKET_NAME, S3_RPC_CONFIG_FILE_PATH);
40
+ };
41
+ exports.getS3Config = getS3Config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socket.tech/dl-common",
3
- "version": "1.0.3-test.27",
3
+ "version": "1.0.3-test.28",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "description": "common utilities for socket data layer.",