|
1 | 1 | import type { GetOptionsInterface } from './BaseProvider';
|
2 | 2 | import type { SecretsManagerClient, SecretsManagerClientConfig, GetSecretValueCommandInput } from '@aws-sdk/client-secrets-manager';
|
3 | 3 |
|
| 4 | +/** |
| 5 | + * Base interface for SecretsProviderOptions. |
| 6 | + * |
| 7 | + * @interface |
| 8 | + * @property {SecretsManagerClientConfig} [clientConfig] - Optional configuration to pass during client initialization, e.g. AWS region. |
| 9 | + * @property {never} [awsSdkV3Client] - This property should never be passed. |
| 10 | + */ |
4 | 11 | interface SecretsProviderOptionsWithClientConfig {
|
5 | 12 | clientConfig?: SecretsManagerClientConfig
|
6 | 13 | awsSdkV3Client?: never
|
7 | 14 | }
|
8 | 15 |
|
| 16 | +/** |
| 17 | + * Interface for SecretsProviderOptions with awsSdkV3Client property. |
| 18 | + * |
| 19 | + * @interface |
| 20 | + * @extends SecretsProviderOptionsWithClientConfig |
| 21 | + * @property {SecretsManagerClient} [awsSdkV3Client] - Optional AWS SDK v3 client to pass during SecretsProvider class instantiation |
| 22 | + * @property {never} [clientConfig] - This property should never be passed. |
| 23 | + */ |
9 | 24 | interface SecretsProviderOptionsWithClientInstance {
|
10 | 25 | awsSdkV3Client?: SecretsManagerClient
|
11 | 26 | clientConfig?: never
|
12 | 27 | }
|
13 | 28 |
|
14 | 29 | /**
|
15 |
| - * Options to configure the SecretsProvider. |
| 30 | + * Options for the SecretsProvider class constructor. |
| 31 | + * |
| 32 | + * @type SecretsProviderOptions |
| 33 | + * @property {AppConfigDataClientConfig} [clientConfig] - Optional configuration to pass during client initialization, e.g. AWS region. Mutually exclusive with awsSdkV3Client. |
| 34 | + * @property {AppConfigDataClient} [awsSdkV3Client] - Optional AWS SDK v3 client to pass during SecretsProvider class instantiation. Mutually exclusive with clientConfig. |
16 | 35 | */
|
17 | 36 | type SecretsProviderOptions = SecretsProviderOptionsWithClientConfig | SecretsProviderOptionsWithClientInstance;
|
18 | 37 |
|
19 | 38 | /**
|
20 | 39 | * Options to configure the retrieval of a secret.
|
21 | 40 | *
|
| 41 | + * @interface SecretsGetOptionsInterface |
| 42 | + * @extends {GetOptionsInterface} |
22 | 43 | * @property {number} maxAge - Maximum age of the value in the cache, in seconds.
|
23 | 44 | * @property {boolean} forceFetch - Force fetch the value from the parameter store, ignoring the cache.
|
24 |
| - * @property {Omit<Partial<GetSecretValueCommandInput>, 'SecretId'>} sdkOptions - Options to pass to the underlying SDK. |
| 45 | + * @property {GetSecretValueCommandInput} sdkOptions - Options to pass to the underlying SDK. |
25 | 46 | * @property {TransformOptions} transform - Transform to be applied, can be 'json' or 'binary'.
|
26 | 47 | */
|
27 | 48 | interface SecretsGetOptionsInterface extends GetOptionsInterface {
|
|
0 commit comments