@augmenting-integrations/db-secret-loader 0.0.1
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/README.md +32 -0
- package/dist/index.cjs +65 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @augmenting-integrations/db-secret-loader
|
|
2
|
+
|
|
3
|
+
Resolve a Prisma `DATABASE_URL` from AWS Secrets Manager.
|
|
4
|
+
|
|
5
|
+
The Prisma client is generated from your spoke's schema, so this package does
|
|
6
|
+
NOT instantiate `PrismaClient` for you -- it only assembles the connection
|
|
7
|
+
string. Wire it up in your spoke's `src/lib/db.ts`:
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { PrismaClient } from "@prisma/client";
|
|
11
|
+
import { loadDatabaseUrl } from "@augmenting-integrations/db-secret-loader";
|
|
12
|
+
|
|
13
|
+
let _db: Promise<PrismaClient> | undefined;
|
|
14
|
+
export function getDb(): Promise<PrismaClient> {
|
|
15
|
+
if (!_db) {
|
|
16
|
+
_db = (async () => {
|
|
17
|
+
const url = await loadDatabaseUrl({
|
|
18
|
+
secretArn: process.env.DB_SECRET_ARN,
|
|
19
|
+
host: process.env.DB_HOST,
|
|
20
|
+
dbName: process.env.DB_NAME,
|
|
21
|
+
fallbackUrl: process.env.DATABASE_URL,
|
|
22
|
+
});
|
|
23
|
+
return new PrismaClient({ datasources: { db: { url } } });
|
|
24
|
+
})();
|
|
25
|
+
}
|
|
26
|
+
return _db;
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The secret payload must be a JSON object with at least `username` and
|
|
31
|
+
`password` keys -- the shape RDS Aurora ships when you create a managed
|
|
32
|
+
master secret.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
loadDatabaseUrl: () => loadDatabaseUrl
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(index_exports);
|
|
26
|
+
var import_client_secrets_manager = require("@aws-sdk/client-secrets-manager");
|
|
27
|
+
var cache = /* @__PURE__ */ new Map();
|
|
28
|
+
var secretsClient;
|
|
29
|
+
async function loadDatabaseUrl(opts) {
|
|
30
|
+
if (opts.fallbackUrl) return opts.fallbackUrl;
|
|
31
|
+
const { secretArn, host, dbName } = opts;
|
|
32
|
+
if (!secretArn || !host || !dbName) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
`[db-secret-loader] loadDatabaseUrl requires either fallbackUrl or (secretArn + host + dbName). Got secretArn=${!!secretArn}, host=${!!host}, dbName=${!!dbName}.`
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
const cacheKey = `${secretArn}|${host}|${dbName}|${opts.port ?? 5432}`;
|
|
38
|
+
const cached = cache.get(cacheKey);
|
|
39
|
+
if (cached) return cached;
|
|
40
|
+
secretsClient ??= new import_client_secrets_manager.SecretsManagerClient({});
|
|
41
|
+
const res = await secretsClient.send(
|
|
42
|
+
new import_client_secrets_manager.GetSecretValueCommand({ SecretId: secretArn })
|
|
43
|
+
);
|
|
44
|
+
if (!res.SecretString) {
|
|
45
|
+
throw new Error(`[db-secret-loader] secret ${secretArn} has no SecretString`);
|
|
46
|
+
}
|
|
47
|
+
const { username, password } = JSON.parse(res.SecretString);
|
|
48
|
+
if (!username || !password) {
|
|
49
|
+
throw new Error(
|
|
50
|
+
`[db-secret-loader] secret ${secretArn} JSON is missing username or password`
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
const userEnc = encodeURIComponent(username);
|
|
54
|
+
const passEnc = encodeURIComponent(password);
|
|
55
|
+
const port = opts.port ?? 5432;
|
|
56
|
+
const qs = opts.queryString ?? "schema=public&sslmode=require";
|
|
57
|
+
const url = `postgresql://${userEnc}:${passEnc}@${host}:${port}/${dbName}?${qs}`;
|
|
58
|
+
cache.set(cacheKey, url);
|
|
59
|
+
return url;
|
|
60
|
+
}
|
|
61
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
62
|
+
0 && (module.exports = {
|
|
63
|
+
loadDatabaseUrl
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n SecretsManagerClient,\n GetSecretValueCommand,\n} from \"@aws-sdk/client-secrets-manager\";\n\n// =============================================================================\n// db-secret-loader -- assemble a Prisma DATABASE_URL from AWS Secrets Manager\n//\n// The library DOES NOT instantiate PrismaClient -- the Prisma client is\n// generated from the spoke's schema and lives in the spoke's node_modules.\n// We only resolve the connection string here. The spoke does:\n//\n// const url = await loadDatabaseUrl({ ... });\n// return new PrismaClient({ datasources: { db: { url } } });\n//\n// Lambda containers are reused across invocations, so the secret fetch is\n// cached at the module level (per-container lifetime). Caller is expected to\n// cache the resulting PrismaClient on globalThis or similar.\n// =============================================================================\n\nexport type LoadDatabaseUrlOptions = {\n /** AWS Secrets Manager ARN holding `{username, password}` JSON. */\n secretArn?: string;\n /** Aurora endpoint host (RDS Proxy host typically). */\n host?: string;\n /** Database name (the `dbname` in `postgresql://.../dbname`). */\n dbName?: string;\n /** Port; defaults to 5432. */\n port?: number;\n /**\n * Local-dev fallback. If set, used as-is and the secret fetch is skipped.\n * Typical local value: `postgresql://postgres:postgres@localhost:5432/app`.\n */\n fallbackUrl?: string;\n /**\n * Query-string fragment appended to the assembled URL (without leading `?`).\n * Defaults to `schema=public&sslmode=require`.\n */\n queryString?: string;\n};\n\nconst cache = new Map<string, string>();\nlet secretsClient: SecretsManagerClient | undefined;\n\n/**\n * Resolve a Prisma `DATABASE_URL`. Caches by `secretArn` for the container\n * lifetime. Throws with an actionable message when neither `fallbackUrl` nor\n * the full `secretArn + host + dbName` triple is provided.\n */\nexport async function loadDatabaseUrl(opts: LoadDatabaseUrlOptions): Promise<string> {\n if (opts.fallbackUrl) return opts.fallbackUrl;\n\n const { secretArn, host, dbName } = opts;\n if (!secretArn || !host || !dbName) {\n throw new Error(\n `[db-secret-loader] loadDatabaseUrl requires either fallbackUrl or (secretArn + host + dbName). Got secretArn=${!!secretArn}, host=${!!host}, dbName=${!!dbName}.`,\n );\n }\n\n const cacheKey = `${secretArn}|${host}|${dbName}|${opts.port ?? 5432}`;\n const cached = cache.get(cacheKey);\n if (cached) return cached;\n\n secretsClient ??= new SecretsManagerClient({});\n const res = await secretsClient.send(\n new GetSecretValueCommand({ SecretId: secretArn }),\n );\n if (!res.SecretString) {\n throw new Error(`[db-secret-loader] secret ${secretArn} has no SecretString`);\n }\n const { username, password } = JSON.parse(res.SecretString) as {\n username?: string;\n password?: string;\n };\n if (!username || !password) {\n throw new Error(\n `[db-secret-loader] secret ${secretArn} JSON is missing username or password`,\n );\n }\n const userEnc = encodeURIComponent(username);\n const passEnc = encodeURIComponent(password);\n const port = opts.port ?? 5432;\n const qs = opts.queryString ?? \"schema=public&sslmode=require\";\n const url = `postgresql://${userEnc}:${passEnc}@${host}:${port}/${dbName}?${qs}`;\n cache.set(cacheKey, url);\n return url;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oCAGO;AAsCP,IAAM,QAAQ,oBAAI,IAAoB;AACtC,IAAI;AAOJ,eAAsB,gBAAgB,MAA+C;AACnF,MAAI,KAAK,YAAa,QAAO,KAAK;AAElC,QAAM,EAAE,WAAW,MAAM,OAAO,IAAI;AACpC,MAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ;AAClC,UAAM,IAAI;AAAA,MACR,gHAAgH,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,MAAM;AAAA,IACjK;AAAA,EACF;AAEA,QAAM,WAAW,GAAG,SAAS,IAAI,IAAI,IAAI,MAAM,IAAI,KAAK,QAAQ,IAAI;AACpE,QAAM,SAAS,MAAM,IAAI,QAAQ;AACjC,MAAI,OAAQ,QAAO;AAEnB,oBAAkB,IAAI,mDAAqB,CAAC,CAAC;AAC7C,QAAM,MAAM,MAAM,cAAc;AAAA,IAC9B,IAAI,oDAAsB,EAAE,UAAU,UAAU,CAAC;AAAA,EACnD;AACA,MAAI,CAAC,IAAI,cAAc;AACrB,UAAM,IAAI,MAAM,6BAA6B,SAAS,sBAAsB;AAAA,EAC9E;AACA,QAAM,EAAE,UAAU,SAAS,IAAI,KAAK,MAAM,IAAI,YAAY;AAI1D,MAAI,CAAC,YAAY,CAAC,UAAU;AAC1B,UAAM,IAAI;AAAA,MACR,6BAA6B,SAAS;AAAA,IACxC;AAAA,EACF;AACA,QAAM,UAAU,mBAAmB,QAAQ;AAC3C,QAAM,UAAU,mBAAmB,QAAQ;AAC3C,QAAM,OAAO,KAAK,QAAQ;AAC1B,QAAM,KAAK,KAAK,eAAe;AAC/B,QAAM,MAAM,gBAAgB,OAAO,IAAI,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM,IAAI,EAAE;AAC9E,QAAM,IAAI,UAAU,GAAG;AACvB,SAAO;AACT;","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type LoadDatabaseUrlOptions = {
|
|
2
|
+
/** AWS Secrets Manager ARN holding `{username, password}` JSON. */
|
|
3
|
+
secretArn?: string;
|
|
4
|
+
/** Aurora endpoint host (RDS Proxy host typically). */
|
|
5
|
+
host?: string;
|
|
6
|
+
/** Database name (the `dbname` in `postgresql://.../dbname`). */
|
|
7
|
+
dbName?: string;
|
|
8
|
+
/** Port; defaults to 5432. */
|
|
9
|
+
port?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Local-dev fallback. If set, used as-is and the secret fetch is skipped.
|
|
12
|
+
* Typical local value: `postgresql://postgres:postgres@localhost:5432/app`.
|
|
13
|
+
*/
|
|
14
|
+
fallbackUrl?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Query-string fragment appended to the assembled URL (without leading `?`).
|
|
17
|
+
* Defaults to `schema=public&sslmode=require`.
|
|
18
|
+
*/
|
|
19
|
+
queryString?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Resolve a Prisma `DATABASE_URL`. Caches by `secretArn` for the container
|
|
23
|
+
* lifetime. Throws with an actionable message when neither `fallbackUrl` nor
|
|
24
|
+
* the full `secretArn + host + dbName` triple is provided.
|
|
25
|
+
*/
|
|
26
|
+
export declare function loadDatabaseUrl(opts: LoadDatabaseUrlOptions): Promise<string>;
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,MAAM,MAAM,sBAAsB,GAAG;IACnC,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAKF;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAqCnF"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
SecretsManagerClient,
|
|
4
|
+
GetSecretValueCommand
|
|
5
|
+
} from "@aws-sdk/client-secrets-manager";
|
|
6
|
+
var cache = /* @__PURE__ */ new Map();
|
|
7
|
+
var secretsClient;
|
|
8
|
+
async function loadDatabaseUrl(opts) {
|
|
9
|
+
if (opts.fallbackUrl) return opts.fallbackUrl;
|
|
10
|
+
const { secretArn, host, dbName } = opts;
|
|
11
|
+
if (!secretArn || !host || !dbName) {
|
|
12
|
+
throw new Error(
|
|
13
|
+
`[db-secret-loader] loadDatabaseUrl requires either fallbackUrl or (secretArn + host + dbName). Got secretArn=${!!secretArn}, host=${!!host}, dbName=${!!dbName}.`
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
const cacheKey = `${secretArn}|${host}|${dbName}|${opts.port ?? 5432}`;
|
|
17
|
+
const cached = cache.get(cacheKey);
|
|
18
|
+
if (cached) return cached;
|
|
19
|
+
secretsClient ??= new SecretsManagerClient({});
|
|
20
|
+
const res = await secretsClient.send(
|
|
21
|
+
new GetSecretValueCommand({ SecretId: secretArn })
|
|
22
|
+
);
|
|
23
|
+
if (!res.SecretString) {
|
|
24
|
+
throw new Error(`[db-secret-loader] secret ${secretArn} has no SecretString`);
|
|
25
|
+
}
|
|
26
|
+
const { username, password } = JSON.parse(res.SecretString);
|
|
27
|
+
if (!username || !password) {
|
|
28
|
+
throw new Error(
|
|
29
|
+
`[db-secret-loader] secret ${secretArn} JSON is missing username or password`
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
const userEnc = encodeURIComponent(username);
|
|
33
|
+
const passEnc = encodeURIComponent(password);
|
|
34
|
+
const port = opts.port ?? 5432;
|
|
35
|
+
const qs = opts.queryString ?? "schema=public&sslmode=require";
|
|
36
|
+
const url = `postgresql://${userEnc}:${passEnc}@${host}:${port}/${dbName}?${qs}`;
|
|
37
|
+
cache.set(cacheKey, url);
|
|
38
|
+
return url;
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
loadDatabaseUrl
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["import {\n SecretsManagerClient,\n GetSecretValueCommand,\n} from \"@aws-sdk/client-secrets-manager\";\n\n// =============================================================================\n// db-secret-loader -- assemble a Prisma DATABASE_URL from AWS Secrets Manager\n//\n// The library DOES NOT instantiate PrismaClient -- the Prisma client is\n// generated from the spoke's schema and lives in the spoke's node_modules.\n// We only resolve the connection string here. The spoke does:\n//\n// const url = await loadDatabaseUrl({ ... });\n// return new PrismaClient({ datasources: { db: { url } } });\n//\n// Lambda containers are reused across invocations, so the secret fetch is\n// cached at the module level (per-container lifetime). Caller is expected to\n// cache the resulting PrismaClient on globalThis or similar.\n// =============================================================================\n\nexport type LoadDatabaseUrlOptions = {\n /** AWS Secrets Manager ARN holding `{username, password}` JSON. */\n secretArn?: string;\n /** Aurora endpoint host (RDS Proxy host typically). */\n host?: string;\n /** Database name (the `dbname` in `postgresql://.../dbname`). */\n dbName?: string;\n /** Port; defaults to 5432. */\n port?: number;\n /**\n * Local-dev fallback. If set, used as-is and the secret fetch is skipped.\n * Typical local value: `postgresql://postgres:postgres@localhost:5432/app`.\n */\n fallbackUrl?: string;\n /**\n * Query-string fragment appended to the assembled URL (without leading `?`).\n * Defaults to `schema=public&sslmode=require`.\n */\n queryString?: string;\n};\n\nconst cache = new Map<string, string>();\nlet secretsClient: SecretsManagerClient | undefined;\n\n/**\n * Resolve a Prisma `DATABASE_URL`. Caches by `secretArn` for the container\n * lifetime. Throws with an actionable message when neither `fallbackUrl` nor\n * the full `secretArn + host + dbName` triple is provided.\n */\nexport async function loadDatabaseUrl(opts: LoadDatabaseUrlOptions): Promise<string> {\n if (opts.fallbackUrl) return opts.fallbackUrl;\n\n const { secretArn, host, dbName } = opts;\n if (!secretArn || !host || !dbName) {\n throw new Error(\n `[db-secret-loader] loadDatabaseUrl requires either fallbackUrl or (secretArn + host + dbName). Got secretArn=${!!secretArn}, host=${!!host}, dbName=${!!dbName}.`,\n );\n }\n\n const cacheKey = `${secretArn}|${host}|${dbName}|${opts.port ?? 5432}`;\n const cached = cache.get(cacheKey);\n if (cached) return cached;\n\n secretsClient ??= new SecretsManagerClient({});\n const res = await secretsClient.send(\n new GetSecretValueCommand({ SecretId: secretArn }),\n );\n if (!res.SecretString) {\n throw new Error(`[db-secret-loader] secret ${secretArn} has no SecretString`);\n }\n const { username, password } = JSON.parse(res.SecretString) as {\n username?: string;\n password?: string;\n };\n if (!username || !password) {\n throw new Error(\n `[db-secret-loader] secret ${secretArn} JSON is missing username or password`,\n );\n }\n const userEnc = encodeURIComponent(username);\n const passEnc = encodeURIComponent(password);\n const port = opts.port ?? 5432;\n const qs = opts.queryString ?? \"schema=public&sslmode=require\";\n const url = `postgresql://${userEnc}:${passEnc}@${host}:${port}/${dbName}?${qs}`;\n cache.set(cacheKey, url);\n return url;\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAsCP,IAAM,QAAQ,oBAAI,IAAoB;AACtC,IAAI;AAOJ,eAAsB,gBAAgB,MAA+C;AACnF,MAAI,KAAK,YAAa,QAAO,KAAK;AAElC,QAAM,EAAE,WAAW,MAAM,OAAO,IAAI;AACpC,MAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,QAAQ;AAClC,UAAM,IAAI;AAAA,MACR,gHAAgH,CAAC,CAAC,SAAS,UAAU,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,MAAM;AAAA,IACjK;AAAA,EACF;AAEA,QAAM,WAAW,GAAG,SAAS,IAAI,IAAI,IAAI,MAAM,IAAI,KAAK,QAAQ,IAAI;AACpE,QAAM,SAAS,MAAM,IAAI,QAAQ;AACjC,MAAI,OAAQ,QAAO;AAEnB,oBAAkB,IAAI,qBAAqB,CAAC,CAAC;AAC7C,QAAM,MAAM,MAAM,cAAc;AAAA,IAC9B,IAAI,sBAAsB,EAAE,UAAU,UAAU,CAAC;AAAA,EACnD;AACA,MAAI,CAAC,IAAI,cAAc;AACrB,UAAM,IAAI,MAAM,6BAA6B,SAAS,sBAAsB;AAAA,EAC9E;AACA,QAAM,EAAE,UAAU,SAAS,IAAI,KAAK,MAAM,IAAI,YAAY;AAI1D,MAAI,CAAC,YAAY,CAAC,UAAU;AAC1B,UAAM,IAAI;AAAA,MACR,6BAA6B,SAAS;AAAA,IACxC;AAAA,EACF;AACA,QAAM,UAAU,mBAAmB,QAAQ;AAC3C,QAAM,UAAU,mBAAmB,QAAQ;AAC3C,QAAM,OAAO,KAAK,QAAQ;AAC1B,QAAM,KAAK,KAAK,eAAe;AAC/B,QAAM,MAAM,gBAAgB,OAAO,IAAI,OAAO,IAAI,IAAI,IAAI,IAAI,IAAI,MAAM,IAAI,EAAE;AAC9E,QAAM,IAAI,UAAU,GAAG;AACvB,SAAO;AACT;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@augmenting-integrations/db-secret-loader",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Resolve a Prisma DATABASE_URL from AWS Secrets Manager (or a fallback env var). The spoke still owns `new PrismaClient()`; this package only assembles the connection string from the SecretsManager JSON shape that RDS Aurora ships with.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
9
|
+
"sideEffects": false,
|
|
10
|
+
"main": "./dist/index.cjs",
|
|
11
|
+
"module": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
|
+
"require": "./dist/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsup",
|
|
26
|
+
"clean": "rm -rf dist",
|
|
27
|
+
"test": "vitest run --passWithNoTests"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@aws-sdk/client-secrets-manager": "^3.700.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"tsup": "^8.3.5",
|
|
34
|
+
"typescript": "^5.7.2",
|
|
35
|
+
"vitest": "^4.1.5"
|
|
36
|
+
}
|
|
37
|
+
}
|