Skip to content

Commit 892fc3f

Browse files
committed
refactor: types
1 parent c6fa0e8 commit 892fc3f

File tree

2 files changed

+7
-24
lines changed

2 files changed

+7
-24
lines changed

Diff for: packages/parameters/src/types/DynamoDBProvider.ts

+3-16
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
1-
import type { TransformOptions } from './BaseProvider';
1+
import type { GetOptionsInterface, GetMultipleOptionsInterface } from './BaseProvider';
22
import type { GetItemCommandInput, QueryCommandInput, DynamoDBClientConfig } from '@aws-sdk/client-dynamodb';
33

4-
// TODO: move this to BaseProvider.ts
5-
interface GetBaseOptionsInterface {
6-
maxAge?: number
7-
forceFetch?: boolean
8-
decrypt?: boolean
9-
transform?: TransformOptions
10-
}
11-
12-
// TODO: move this to BaseProvider.ts
13-
interface GetMultipleBaseOptionsInterface extends GetBaseOptionsInterface {
14-
throwOnTransformError?: boolean
15-
}
16-
174
interface DynamoDBProviderOptions {
185
tableName: string
196
keyAttr?: string
@@ -30,11 +17,11 @@ interface DynamoDBProviderOptions {
3017
* @property {boolean} decrypt - If true, the parameter will be decrypted.
3118
* @property {Partial<GetItemCommandInput>} sdkOptions - Options for the AWS SDK.
3219
*/
33-
interface DynamoDBGetOptionsInterface extends GetBaseOptionsInterface {
20+
interface DynamoDBGetOptionsInterface extends GetOptionsInterface {
3421
sdkOptions?: Omit<Partial<GetItemCommandInput>, 'Key' | 'TableName' | 'ProjectionExpression'>
3522
}
3623

37-
interface DynamoDBGetMultipleOptionsInterface extends GetMultipleBaseOptionsInterface {
24+
interface DynamoDBGetMultipleOptionsInterface extends GetMultipleOptionsInterface {
3825
sdkOptions?: Partial<QueryCommandInput>
3926
}
4027

Diff for: packages/parameters/tests/unit/DynamoDBProvider.test.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
/**
2-
* Test DynamoDBProvider class
3-
*
4-
* @group unit/parameters/DynamoDBProvider/class
5-
*/
2+
* Test DynamoDBProvider class
3+
*
4+
* @group unit/parameters/DynamoDBProvider/class
5+
*/
66
import { DynamoDBProvider } from '../../src/DynamoDBProvider';
77
import { DynamoDBClient, GetItemCommand, QueryCommand } from '@aws-sdk/client-dynamodb';
88
import type { GetItemCommandInput, QueryCommandInput } from '@aws-sdk/client-dynamodb';
99
import { marshall } from '@aws-sdk/util-dynamodb';
1010
import { mockClient } from 'aws-sdk-client-mock';
1111
import 'aws-sdk-client-mock-jest';
12-
/* import type {
13-
DynamoDBGetOptionsInterface,
14-
DynamoDBGetMultipleOptionsInterface,
15-
} from '../../src/types/DynamoDBProvider'; */
1612

1713
describe('Class: DynamoDBProvider', () => {
1814

0 commit comments

Comments
 (0)