@looopy-ai/aws 2.1.25 → 2.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/secrets.d.ts +2 -2
- package/dist/secrets.js +4 -4
- package/package.json +2 -2
package/dist/secrets.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface LoadSecretsOptions {
|
|
2
2
|
secretKeys: string[];
|
|
3
3
|
awsRegion?: string;
|
|
4
|
-
|
|
4
|
+
stage?: string;
|
|
5
5
|
secretPrefix?: string;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
7
|
+
export declare const loadSecrets: (options: LoadSecretsOptions) => Promise<void>;
|
package/dist/secrets.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GetSecretValueCommand, SecretsManagerClient, SecretsManagerServiceException, } from '@aws-sdk/client-secrets-manager';
|
|
2
2
|
import { getLogger } from '@looopy-ai/core';
|
|
3
|
-
export async
|
|
4
|
-
const { secretKeys, awsRegion = process.env.AWS_REGION || 'us-west-2',
|
|
3
|
+
export const loadSecrets = async (options) => {
|
|
4
|
+
const { secretKeys, awsRegion = process.env.AWS_REGION || 'us-west-2', stage = (process.env.STAGE || 'dev').toLowerCase(), secretPrefix = 'agents', } = options;
|
|
5
5
|
const logger = getLogger({ component: 'secrets-loader' });
|
|
6
6
|
let client;
|
|
7
7
|
try {
|
|
@@ -12,7 +12,7 @@ export async function loadSecrets(options) {
|
|
|
12
12
|
return;
|
|
13
13
|
}
|
|
14
14
|
for (const key of secretKeys) {
|
|
15
|
-
const secretId = `${secretPrefix}/${
|
|
15
|
+
const secretId = `${secretPrefix}/${stage}/${key}`;
|
|
16
16
|
try {
|
|
17
17
|
const command = new GetSecretValueCommand({ SecretId: secretId });
|
|
18
18
|
const response = await client.send(command);
|
|
@@ -47,4 +47,4 @@ export async function loadSecrets(options) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
}
|
|
50
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@looopy-ai/aws",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.26",
|
|
4
4
|
"description": "AWS storage and providers for Looopy AI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/looopy-ai/lib"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@smithy/types": "^4.12.0",
|
|
56
56
|
"hono": "^4.10.5",
|
|
57
57
|
"pino-http": "^11.0.0",
|
|
58
|
-
"@looopy-ai/core": "2.1.
|
|
58
|
+
"@looopy-ai/core": "2.1.23"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|
|
61
61
|
"access": "public"
|