@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 +6 -0
- package/lib/dynamodb/getDynamoDbOptions.d.ts +12 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +15 -2
- package/lib/index.js.map +3 -3
- package/package.json +1 -1
- package/src/dynamodb/getDynamoDbOptions.ts +9 -0
- package/src/index.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
@@ -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';
|