@squiz/db-lib 1.67.0 → 1.68.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 1.68.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bd553fe: fix dynamdb integration test issues
8
+
3
9
  ## 1.67.0
4
10
 
5
11
  ### Minor Changes
@@ -0,0 +1,12 @@
1
+ export declare const getDynamoDbOptions: (awsRegion: string, nodeEnv: 'production' | 'development') => {
2
+ region: string;
3
+ credentials?: undefined;
4
+ endpoint?: undefined;
5
+ } | {
6
+ credentials: {
7
+ accessKeyId: string;
8
+ secretAccessKey: string;
9
+ };
10
+ endpoint: string;
11
+ region?: undefined;
12
+ };
package/lib/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from './AbstractRepository';
2
2
  export * from './ConnectionManager';
3
3
  export * from './dynamodb/DynamoDbManager';
4
4
  export * from './dynamodb/AbstractDynamoDbRepository';
5
+ export * from './dynamodb/getDynamoDbOptions';
5
6
  export * from './Migrator';
6
7
  export * from './Repositories';
7
8
  export * from './getConnectionInfo';
package/lib/index.js CHANGED
@@ -55678,7 +55678,8 @@ __export(src_exports, {
55678
55678
  PoolClient: () => import_pg2.PoolClient,
55679
55679
  PostgresErrorCode: () => PostgresErrorCode,
55680
55680
  TransactionError: () => TransactionError,
55681
- getConnectionInfo: () => getConnectionInfo
55681
+ getConnectionInfo: () => getConnectionInfo,
55682
+ getDynamoDbOptions: () => getDynamoDbOptions
55682
55683
  });
55683
55684
  module.exports = __toCommonJS(src_exports);
55684
55685
 
@@ -56462,6 +56463,17 @@ var AbstractDynamoDbRepository = class {
56462
56463
  }
56463
56464
  };
56464
56465
 
56466
+ // src/dynamodb/getDynamoDbOptions.ts
56467
+ var getDynamoDbOptions = (awsRegion, nodeEnv) => {
56468
+ if (nodeEnv === "production") {
56469
+ return { region: awsRegion };
56470
+ }
56471
+ return {
56472
+ credentials: { accessKeyId: "key", secretAccessKey: "key" },
56473
+ endpoint: process.env.CI ? "http://dynamodb-local:8000" : "http://localhost:8000"
56474
+ };
56475
+ };
56476
+
56465
56477
  // src/getConnectionInfo.ts
56466
56478
  var import_client_secrets_manager = __toESM(require_dist_cjs53());
56467
56479
  async function getConnectionInfo(config) {
@@ -56804,7 +56816,8 @@ var import_pg2 = __toESM(require_lib7());
56804
56816
  PoolClient,
56805
56817
  PostgresErrorCode,
56806
56818
  TransactionError,
56807
- getConnectionInfo
56819
+ getConnectionInfo,
56820
+ getDynamoDbOptions
56808
56821
  });
56809
56822
  /*! Bundled license information:
56810
56823