@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@squiz/db-lib",
3
- "version": "1.67.0",
3
+ "version": "1.68.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "private": false,
@@ -0,0 +1,9 @@
1
+ export const getDynamoDbOptions = (awsRegion: string, nodeEnv: 'production' | 'development') => {
2
+ if (nodeEnv === 'production') {
3
+ return { region: awsRegion };
4
+ }
5
+ return {
6
+ credentials: { accessKeyId: 'key', secretAccessKey: 'key' },
7
+ endpoint: process.env.CI ? 'http://dynamodb-local:8000' : 'http://localhost:8000',
8
+ };
9
+ };
package/src/index.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';