@dmptool/utils 1.0.36 → 1.0.37

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.
package/dist/dynamo.d.ts CHANGED
@@ -6,6 +6,7 @@ export interface DynamoConnectionParams {
6
6
  logger: Logger;
7
7
  region: string;
8
8
  tableName: string;
9
+ endpoint?: string;
9
10
  maxAttempts: number;
10
11
  }
11
12
  export interface DMPVersionType {
package/dist/dynamo.js CHANGED
@@ -46,8 +46,11 @@ class DMPToolDynamoError extends Error {
46
46
  }
47
47
  // Initialize AWS SDK clients (outside the handler function)
48
48
  const getDynamoDBClient = (dynamoConfigParams) => {
49
- const { region, maxAttempts } = dynamoConfigParams;
50
- return new client_dynamodb_1.DynamoDBClient({ region, maxAttempts });
49
+ const { region, maxAttempts, endpoint } = dynamoConfigParams;
50
+ // If an endpoint was specified, we are running in a local environment
51
+ return endpoint === undefined
52
+ ? new client_dynamodb_1.DynamoDBClient({ region, maxAttempts })
53
+ : new client_dynamodb_1.DynamoDBClient({ region, maxAttempts, endpoint });
51
54
  };
52
55
  /**
53
56
  * Lightweight query just to check if the DMP exists.
package/dist/ssm.d.ts CHANGED
@@ -16,4 +16,4 @@ export interface SsmConnectionParams {
16
16
  * @returns The value of the variable, or undefined if the variable could not be found.
17
17
  * @throws
18
18
  */
19
- export declare const getSSMParameter: (connectionParams: SsmConnectionParams, key: string, env?: EnvironmentEnum, endpoint?: string) => Promise<string | undefined>;
19
+ export declare const getSSMParameter: (connectionParams: SsmConnectionParams, key: string, env?: EnvironmentEnum) => Promise<string | undefined>;
package/dist/ssm.js CHANGED
@@ -13,7 +13,7 @@ const client_ssm_1 = require("@aws-sdk/client-ssm");
13
13
  * @returns The value of the variable, or undefined if the variable could not be found.
14
14
  * @throws
15
15
  */
16
- const getSSMParameter = async (connectionParams, key, env = general_1.EnvironmentEnum.DEV, endpoint) => {
16
+ const getSSMParameter = async (connectionParams, key, env = general_1.EnvironmentEnum.DEV) => {
17
17
  var _a;
18
18
  if (connectionParams.logger && key && key.trim() !== '') {
19
19
  // Create an SSM client (use the endpoint if we are not using TLS - local dev)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dmptool/utils",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "Helper/Utility functions for use in the DMP Tool services. Particularly AWS tooling and maDMP serialization",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",