@geekmidas/cli 10.0.0-alpha.68 → 10.0.0-alpha.69
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/{LegacyStateStore-C39UKwmf.mjs → LegacyStateStore-BE1Et8RS.mjs} +2 -2
- package/dist/{LegacyStateStore-C39UKwmf.mjs.map → LegacyStateStore-BE1Et8RS.mjs.map} +1 -1
- package/dist/{LegacyStateStore-BZiO9-Lw.cjs → LegacyStateStore-LS_uTO8D.cjs} +2 -2
- package/dist/{LegacyStateStore-BZiO9-Lw.cjs.map → LegacyStateStore-LS_uTO8D.cjs.map} +1 -1
- package/dist/{LocalStateStore-DHVsZLyF.cjs → LocalStateStore-CV6phNMZ.cjs} +2 -2
- package/dist/{LocalStateStore-DHVsZLyF.cjs.map → LocalStateStore-CV6phNMZ.cjs.map} +1 -1
- package/dist/{LocalStateStore-Dk3Wbvzk.mjs → LocalStateStore-DAnFc708.mjs} +2 -2
- package/dist/{LocalStateStore-Dk3Wbvzk.mjs.map → LocalStateStore-DAnFc708.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-BmUAcR7d.mjs → OpenApiTsGenerator-CSaXs-dB.mjs} +2 -2
- package/dist/{OpenApiTsGenerator-BmUAcR7d.mjs.map → OpenApiTsGenerator-CSaXs-dB.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-B2zrdyP4.cjs → OpenApiTsGenerator-CxB8mqXz.cjs} +2 -2
- package/dist/{OpenApiTsGenerator-B2zrdyP4.cjs.map → OpenApiTsGenerator-CxB8mqXz.cjs.map} +1 -1
- package/dist/{S3StateStore-B_ZF9eHt.mjs → S3StateStore-8kJEGnTh.mjs} +2 -2
- package/dist/{S3StateStore-B_ZF9eHt.mjs.map → S3StateStore-8kJEGnTh.mjs.map} +1 -1
- package/dist/{S3StateStore--4tYVMAL.cjs → S3StateStore-dA34LAYm.cjs} +2 -2
- package/dist/{S3StateStore--4tYVMAL.cjs.map → S3StateStore-dA34LAYm.cjs.map} +1 -1
- package/dist/{SSMStateStore-ACZ8hRvZ.cjs → SSMStateStore-DBzlfc-S.cjs} +2 -2
- package/dist/{SSMStateStore-ACZ8hRvZ.cjs.map → SSMStateStore-DBzlfc-S.cjs.map} +1 -1
- package/dist/{SSMStateStore-DjPuKqrm.mjs → SSMStateStore-Dkdw-fPL.mjs} +2 -2
- package/dist/{SSMStateStore-DjPuKqrm.mjs.map → SSMStateStore-Dkdw-fPL.mjs.map} +1 -1
- package/dist/add-CoIr2wgv.cjs +568 -0
- package/dist/add-CoIr2wgv.cjs.map +1 -0
- package/dist/add-Dzk23476.mjs +566 -0
- package/dist/add-Dzk23476.mjs.map +1 -0
- package/dist/{bundler-C1pnNrR0.cjs → bundler-CSR2nM4m.cjs} +5 -5
- package/dist/{bundler-C1pnNrR0.cjs.map → bundler-CSR2nM4m.cjs.map} +1 -1
- package/dist/{bundler-C-w7aGoZ.mjs → bundler-Cn0JF5G0.mjs} +5 -5
- package/dist/{bundler-C-w7aGoZ.mjs.map → bundler-Cn0JF5G0.mjs.map} +1 -1
- package/dist/{cli-BLyD4c0O.cjs → cli-IoM2-x48.cjs} +4 -4
- package/dist/{cli-BLyD4c0O.cjs.map → cli-IoM2-x48.cjs.map} +1 -1
- package/dist/{cli-Ce4pLL5O.mjs → cli-ij8Lwlww.mjs} +4 -4
- package/dist/{cli-Ce4pLL5O.mjs.map → cli-ij8Lwlww.mjs.map} +1 -1
- package/dist/{compose-DFxuYhn6.mjs → compose-CZtinmtw.mjs} +12 -11
- package/dist/compose-CZtinmtw.mjs.map +1 -0
- package/dist/{compose-DvsgumY2.cjs → compose-DfIioFX0.cjs} +12 -11
- package/dist/compose-DfIioFX0.cjs.map +1 -0
- package/dist/config.cjs +3 -3
- package/dist/config.mjs +3 -3
- package/dist/credentialSchemas-BcNL1N5R.cjs +271 -0
- package/dist/credentialSchemas-BcNL1N5R.cjs.map +1 -0
- package/dist/credentialSchemas-BmYxnEz_.mjs +236 -0
- package/dist/credentialSchemas-BmYxnEz_.mjs.map +1 -0
- package/dist/deploy/public.cjs +7 -7
- package/dist/deploy/public.d.cts.map +1 -1
- package/dist/deploy/public.d.mts.map +1 -1
- package/dist/deploy/public.mjs +7 -7
- package/dist/{deploy-D-EVOWvu.mjs → deploy-BzqbkJ3o.mjs} +6 -6
- package/dist/{deploy-D-EVOWvu.mjs.map → deploy-BzqbkJ3o.mjs.map} +1 -1
- package/dist/{deploy-C08GONYW.cjs → deploy-Dpz9raPM.cjs} +6 -6
- package/dist/{deploy-C08GONYW.cjs.map → deploy-Dpz9raPM.cjs.map} +1 -1
- package/dist/{discover-OEfZ9OkA.cjs → discover-B4VjaFJk.cjs} +2 -2
- package/dist/{discover-OEfZ9OkA.cjs.map → discover-B4VjaFJk.cjs.map} +1 -1
- package/dist/{discover-BFoJWKGD.mjs → discover-Buwf1z4P.mjs} +2 -2
- package/dist/{discover-BFoJWKGD.mjs.map → discover-Buwf1z4P.mjs.map} +1 -1
- package/dist/{dokploy-CZ6nfSV9.cjs → dokploy-B6O-J1fb.cjs} +2 -2
- package/dist/{dokploy-CZ6nfSV9.cjs.map → dokploy-B6O-J1fb.cjs.map} +1 -1
- package/dist/{dokploy-DU-XJsoT.mjs → dokploy-DkwcORbv.mjs} +2 -2
- package/dist/{dokploy-DU-XJsoT.mjs.map → dokploy-DkwcORbv.mjs.map} +1 -1
- package/dist/{encryption-DSiLau1-.mjs → encryption-7m1mKcRy.mjs} +3 -3
- package/dist/{encryption-DSiLau1-.mjs.map → encryption-7m1mKcRy.mjs.map} +1 -1
- package/dist/{encryption-CCcBSLZs.cjs → encryption-C8Ic5t0C.cjs} +3 -3
- package/dist/{encryption-CCcBSLZs.cjs.map → encryption-C8Ic5t0C.cjs.map} +1 -1
- package/dist/{engine-llWnMZH5.mjs → engine-62Kl70Pj.mjs} +14 -6
- package/dist/{engine-llWnMZH5.mjs.map → engine-62Kl70Pj.mjs.map} +1 -1
- package/dist/{engine-BM9Dy_DT.cjs → engine-BR9qlS7A.cjs} +14 -6
- package/dist/engine-BR9qlS7A.cjs.map +1 -0
- package/dist/{github-ZoMam0OH.cjs → github-CmGIZjhu.cjs} +3 -3
- package/dist/{github-ZoMam0OH.cjs.map → github-CmGIZjhu.cjs.map} +1 -1
- package/dist/{github-yy6WpHIl.mjs → github-DtymyOcH.mjs} +3 -3
- package/dist/{github-yy6WpHIl.mjs.map → github-DtymyOcH.mjs.map} +1 -1
- package/dist/index.cjs +86 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +86 -47
- package/dist/index.mjs.map +1 -1
- package/dist/{migrate-BWPuwiXk.mjs → migrate-CEzq6DjL.mjs} +4 -4
- package/dist/{migrate-BWPuwiXk.mjs.map → migrate-CEzq6DjL.mjs.map} +1 -1
- package/dist/{migrate-tOwxQBTI.cjs → migrate-CYC-hBOU.cjs} +4 -4
- package/dist/{migrate-tOwxQBTI.cjs.map → migrate-CYC-hBOU.cjs.map} +1 -1
- package/dist/openapi.cjs +1 -1
- package/dist/openapi.mjs +1 -1
- package/dist/{ready-2s3-CndS.mjs → ready-DeYaSoNN.mjs} +3 -3
- package/dist/{ready-2s3-CndS.mjs.map → ready-DeYaSoNN.mjs.map} +1 -1
- package/dist/{ready-B6uHr4sm.cjs → ready-QGgjmcuN.cjs} +3 -3
- package/dist/{ready-B6uHr4sm.cjs.map → ready-QGgjmcuN.cjs.map} +1 -1
- package/dist/reconcile/public.cjs +1 -1
- package/dist/reconcile/public.mjs +1 -1
- package/dist/{resolve-BymzGtuT.cjs → resolve-BDsMffvz.cjs} +3 -3
- package/dist/{resolve-BymzGtuT.cjs.map → resolve-BDsMffvz.cjs.map} +1 -1
- package/dist/{resolve-pIvXlZ1h.mjs → resolve-Dn5wGf1r.mjs} +3 -3
- package/dist/{resolve-pIvXlZ1h.mjs.map → resolve-Dn5wGf1r.mjs.map} +1 -1
- package/dist/{rollback-zdfi6Reg.cjs → rollback-5XHaBDxW.cjs} +5 -5
- package/dist/{rollback-zdfi6Reg.cjs.map → rollback-5XHaBDxW.cjs.map} +1 -1
- package/dist/{rollback-ZlsbQOvj.mjs → rollback-DDfaqv7P.mjs} +5 -5
- package/dist/{rollback-ZlsbQOvj.mjs.map → rollback-DDfaqv7P.mjs.map} +1 -1
- package/dist/sandbox/credentials-worker.cjs +54 -0
- package/dist/sandbox/credentials-worker.cjs.map +1 -0
- package/dist/sandbox/credentials-worker.d.cts +1 -0
- package/dist/sandbox/credentials-worker.d.mts +1 -0
- package/dist/sandbox/credentials-worker.mjs +55 -0
- package/dist/sandbox/credentials-worker.mjs.map +1 -0
- package/dist/sandbox/discover-worker.cjs +1 -1
- package/dist/sandbox/discover-worker.mjs +1 -1
- package/dist/sandbox/migrate-worker.cjs +1 -1
- package/dist/sandbox/migrate-worker.mjs +1 -1
- package/dist/{schemas-RUlKHu27.cjs → schemas-BObwxB_t.cjs} +164 -3
- package/dist/schemas-BObwxB_t.cjs.map +1 -0
- package/dist/{schemas-Cfhtpdo0.mjs → schemas-D-xeKJDD.mjs} +153 -4
- package/dist/schemas-D-xeKJDD.mjs.map +1 -0
- package/dist/{sniffer-D66HIvi9.cjs → sniffer-Bc0nNBDF.cjs} +7 -7
- package/dist/{sniffer-D66HIvi9.cjs.map → sniffer-Bc0nNBDF.cjs.map} +1 -1
- package/dist/{sniffer-BdFeLSmA.mjs → sniffer-DMqi2b1q.mjs} +7 -7
- package/dist/{sniffer-BdFeLSmA.mjs.map → sniffer-DMqi2b1q.mjs.map} +1 -1
- package/dist/{state-CHZqCDRC.cjs → state-8RgXeX5Y.cjs} +116 -62
- package/dist/{state-CHZqCDRC.cjs.map → state-8RgXeX5Y.cjs.map} +1 -1
- package/dist/{state-Bn5JDMFT.mjs → state-DClnPZt5.mjs} +105 -63
- package/dist/{state-Bn5JDMFT.mjs.map → state-DClnPZt5.mjs.map} +1 -1
- package/dist/target/public.cjs +1 -1
- package/dist/target/public.mjs +1 -1
- package/dist/{terminal-C3cv-OQu.mjs → terminal-C6TBo_SA.mjs} +2 -2
- package/dist/{terminal-C3cv-OQu.mjs.map → terminal-C6TBo_SA.mjs.map} +1 -1
- package/dist/{terminal-DjzgLu6m.cjs → terminal-CFO3xWoF.cjs} +2 -2
- package/dist/{terminal-DjzgLu6m.cjs.map → terminal-CFO3xWoF.cjs.map} +1 -1
- package/dist/vitest.cjs +1 -1
- package/dist/vitest.mjs +1 -1
- package/dist/workspace/index.cjs +1 -1
- package/dist/workspace/index.mjs +1 -1
- package/dist/{workspace-ON-bqiJz.cjs → workspace-8NuAjaXJ.cjs} +2 -2
- package/dist/{workspace-ON-bqiJz.cjs.map → workspace-8NuAjaXJ.cjs.map} +1 -1
- package/dist/{workspace-Be6uBhlF.mjs → workspace-B2UK_rVP.mjs} +2 -2
- package/dist/{workspace-Be6uBhlF.mjs.map → workspace-B2UK_rVP.mjs.map} +1 -1
- package/package.json +16 -13
- package/dist/compose-DFxuYhn6.mjs.map +0 -1
- package/dist/compose-DvsgumY2.cjs.map +0 -1
- package/dist/engine-BM9Dy_DT.cjs.map +0 -1
- package/dist/schemas-Cfhtpdo0.mjs.map +0 -1
- package/dist/schemas-RUlKHu27.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentialSchemas-BcNL1N5R.cjs","names":["provideKey","decodeCredentials","activeSandbox","runWorker","ConstructDiscoveryFailed","discover"],"sources":["../src/secrets/credentialSchemas.ts"],"sourcesContent":["/**\n * A third party's credentials, checked against the schema of the construct\n * that reads them — before they are stored, and before a deploy builds\n * anything with them.\n *\n * The schema lives on the construct (`ExternalApi.credentialsSchema`,\n * `Credential.credentialsSchema`), which is the project's code. So the\n * constructs are loaded where a deploy loads them: in the run's sandbox when\n * there is one, here otherwise. What comes back is data only — each schema as\n * JSON Schema where it can say so, and `{ ok, issues }` for each value asked\n * about — because a live schema cannot cross an isolating sandbox. A value\n * asked about goes in as a secret file, never an argument, and no issue\n * carries it back: an issue is a path and a message.\n */\n\nimport { decodeCredentials } from '@geekmidas/constructs/credential';\nimport { type ConstructManifest, provideKey } from '@geekmidas/manifest';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { z } from 'zod';\nimport {\n\tConstructDiscoveryFailed,\n\ttype ConstructSource,\n\tdiscover,\n} from '../reconcile/discover';\nimport { activeSandbox } from '../sandbox/sandbox';\nimport { runWorker } from '../sandbox/worker';\n\n/** One thing a schema refused: where in the value, and why. */\nexport interface CredentialIssue {\n\t/** Dotted, from the value's root — `apiKey`, `keys.0`; empty for the root. */\n\tpath: string;\n\tmessage: string;\n}\n\n/** What a candidate value came to. */\nexport interface CredentialCheck {\n\tok: boolean;\n\tissues: CredentialIssue[];\n}\n\n/** A construct's credentials key, and its schema as data. */\nexport interface CredentialSchemaInfo {\n\tkey: string;\n\tid: string;\n\tkind: 'external-api' | 'credential';\n\t/**\n\t * The schema as JSON Schema, where the schema can say — zod's, or any\n\t * Standard JSON Schema. Absent otherwise: the value is asked for as JSON.\n\t */\n\tjsonSchema?: Record<string, unknown>;\n}\n\n/** What loading the constructs answers. */\nexport interface CredentialInspection {\n\tschemas: CredentialSchemaInfo[];\n\t/** Each value asked about, by key. */\n\tchecks: Record<string, CredentialCheck>;\n}\n\n/** A construct whose credentials have a schema. */\ninterface LiveCredential {\n\tkey: string;\n\tid: string;\n\tkind: 'external-api' | 'credential';\n\tschema: StandardSchemaV1;\n}\n\n/** The credentials keys a manifest declares, by the construct that reads each. */\nexport function credentialKeys(\n\tmanifest: ConstructManifest,\n): { key: string; id: string; kind: 'external-api' | 'credential' }[] {\n\treturn Object.entries(manifest).flatMap(([id, declaration]) =>\n\t\tdeclaration.kind === 'external-api' || declaration.kind === 'credential'\n\t\t\t? [{ key: provideKey(id, 'credentials'), id, kind: declaration.kind }]\n\t\t\t: [],\n\t);\n}\n\n/** The constructs that read a third party's credentials, with their schemas. */\nexport function liveCredentials(\n\tmanifest: ConstructManifest,\n\tsources: Readonly<Record<string, ConstructSource>>,\n): LiveCredential[] {\n\treturn credentialKeys(manifest).flatMap(({ key, id, kind }) => {\n\t\tconst schema = (sources[id]?.construct as { credentialsSchema?: unknown })\n\t\t\t?.credentialsSchema;\n\t\treturn isStandardSchema(schema) ? [{ key, id, kind, schema }] : [];\n\t});\n}\n\nfunction isStandardSchema(value: unknown): value is StandardSchemaV1 {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof (value as StandardSchemaV1)['~standard']?.validate === 'function'\n\t);\n}\n\n/**\n * A schema as JSON Schema: through the Standard JSON Schema extension where\n * the schema has it, as zod 4's does, else zod's own converter — or nothing,\n * for a schema neither can describe.\n */\nexport function jsonSchemaOf(\n\tschema: StandardSchemaV1,\n): Record<string, unknown> | undefined {\n\tconst standard = schema['~standard'] as StandardSchemaV1['~standard'] & {\n\t\tjsonSchema?: {\n\t\t\tinput?: (options: { target: string }) => Record<string, unknown>;\n\t\t};\n\t};\n\ttry {\n\t\tconst described = standard.jsonSchema?.input?.({\n\t\t\ttarget: 'draft-2020-12',\n\t\t});\n\t\tif (described) return described;\n\t} catch {\n\t\t// A type JSON Schema cannot express: try zod's converter, then nothing.\n\t}\n\tif (typeof schema === 'object' && schema !== null && '_zod' in schema) {\n\t\ttry {\n\t\t\treturn z.toJSONSchema(schema as unknown as z.ZodType, {\n\t\t\t\tio: 'input',\n\t\t\t}) as Record<string, unknown>;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/** A stored value against its schema, read the way the construct reads it. */\nexport async function checkCredential(\n\tschema: StandardSchemaV1,\n\traw: string,\n): Promise<CredentialCheck> {\n\tconst result = await schema['~standard'].validate(decodeCredentials(raw));\n\tif (!result.issues) return { ok: true, issues: [] };\n\treturn {\n\t\tok: false,\n\t\tissues: result.issues.map((issue) => ({\n\t\t\tpath: (issue.path ?? [])\n\t\t\t\t.map((segment) =>\n\t\t\t\t\ttypeof segment === 'object' ? String(segment.key) : String(segment),\n\t\t\t\t)\n\t\t\t\t.join('.'),\n\t\t\tmessage: issue.message,\n\t\t})),\n\t};\n}\n\n/** What a set of live credentials says about some values: data only. */\nexport async function inspectLive(\n\tlive: readonly LiveCredential[],\n\tvalues: Readonly<Record<string, string>>,\n): Promise<CredentialInspection> {\n\tconst checks: Record<string, CredentialCheck> = {};\n\tfor (const credential of live) {\n\t\tconst value = values[credential.key];\n\t\tif (value === undefined) continue;\n\t\tchecks[credential.key] = await checkCredential(credential.schema, value);\n\t}\n\treturn {\n\t\tschemas: live.map(({ key, id, kind, schema }) => {\n\t\t\tconst jsonSchema = jsonSchemaOf(schema);\n\t\t\treturn { key, id, kind, ...(jsonSchema ? { jsonSchema } : {}) };\n\t\t}),\n\t\tchecks,\n\t};\n}\n\nexport interface InspectOptions {\n\t/** The workspace root. */\n\troot: string;\n\t/** Its construct globs. */\n\tpatterns: readonly string[];\n\t/** The values to check, by key. Only credentials keys are looked at. */\n\tvalues?: Readonly<Record<string, string>>;\n}\n\nconst Issue = z.object({ path: z.string(), message: z.string() });\n\n/** What the credentials worker answers. Checked: the worker ran project code. */\nconst CredentialsAnswer = z.discriminatedUnion('reason', [\n\tz.object({\n\t\treason: z.literal('inspected'),\n\t\tschemas: z.array(\n\t\t\tz.object({\n\t\t\t\tkey: z.string(),\n\t\t\t\tid: z.string(),\n\t\t\t\tkind: z.enum(['external-api', 'credential']),\n\t\t\t\tjsonSchema: z.record(z.string(), z.unknown()).optional(),\n\t\t\t}),\n\t\t),\n\t\tchecks: z.record(\n\t\t\tz.string(),\n\t\t\tz.object({ ok: z.boolean(), issues: z.array(Issue) }),\n\t\t),\n\t}),\n\tz.object({\n\t\treason: z.literal('failed'),\n\t\terror: z.object({ name: z.string(), message: z.string() }).loose(),\n\t}),\n]);\n\n/** How long loading the constructs to check credentials may take. */\nconst INSPECT_TIMEOUT_MS = 60_000;\n\n/**\n * The workspace's credential schemas, and what each of `values` comes to —\n * loaded in the run's sandbox when there is one, here otherwise.\n */\nexport async function inspectCredentials(\n\toptions: InspectOptions,\n): Promise<CredentialInspection> {\n\tconst sandbox = activeSandbox();\n\tif (!sandbox) {\n\t\treturn (await loadCredentialSchemasHere(options)).inspect(\n\t\t\toptions.values ?? {},\n\t\t);\n\t}\n\n\tconst secrets = Object.fromEntries(\n\t\tObject.entries(options.values ?? {}).filter(([key]) =>\n\t\t\tkey.endsWith('_CREDENTIALS'),\n\t\t),\n\t);\n\tconst { value } = await runWorker(sandbox, 'credentials check', {\n\t\tname: 'credentials-worker',\n\t\targs: [JSON.stringify({ patterns: options.patterns, cwd: options.root })],\n\t\tcwd: options.root,\n\t\ttimeoutMs: INSPECT_TIMEOUT_MS,\n\t\tschema: CredentialsAnswer,\n\t\t...(Object.keys(secrets).length > 0 ? { secrets } : {}),\n\t});\n\tif (value.reason === 'failed') {\n\t\tthrow new ConstructDiscoveryFailed(value.error.name, value.error.message);\n\t}\n\tconst { schemas, checks } = value;\n\treturn {\n\t\tschemas: schemas.map(({ jsonSchema, ...rest }) => ({\n\t\t\t...rest,\n\t\t\t...(jsonSchema ? { jsonSchema } : {}),\n\t\t})),\n\t\tchecks,\n\t};\n}\n\n/** The constructs loaded once, here, and asked about as often as needed. */\nasync function loadCredentialSchemasHere(options: InspectOptions): Promise<{\n\tinspect(\n\t\tvalues: Readonly<Record<string, string>>,\n\t): Promise<CredentialInspection>;\n}> {\n\tconst sources: Record<string, ConstructSource> = {};\n\tconst manifest = await discover({\n\t\tpatterns: [...options.patterns],\n\t\tcwd: options.root,\n\t\tsources,\n\t});\n\tconst live = liveCredentials(manifest, sources);\n\treturn { inspect: (values) => inspectLive(live, values) };\n}\n\n/** The schemas, and a check of one candidate value at a time. */\nexport interface CredentialSchemas {\n\tschemas: CredentialSchemaInfo[];\n\t/** `raw` against `key`'s schema; ok for a key no schema describes. */\n\tcheck(key: string, raw: string): Promise<CredentialCheck>;\n}\n\n/**\n * The workspace's credential schemas, for a command that checks values one\n * at a time as they are typed. In-process the constructs are loaded once;\n * in a sandbox each check is a run of the worker.\n */\nexport async function loadCredentialSchemas(\n\toptions: Omit<InspectOptions, 'values'>,\n): Promise<CredentialSchemas> {\n\tconst here = activeSandbox()\n\t\t? undefined\n\t\t: await loadCredentialSchemasHere(options);\n\tconst inspect = (values: Readonly<Record<string, string>>) =>\n\t\there ? here.inspect(values) : inspectCredentials({ ...options, values });\n\n\tconst { schemas } = await inspect({});\n\treturn {\n\t\tschemas,\n\t\tasync check(key, raw) {\n\t\t\tif (!schemas.some((s) => s.key === key)) return { ok: true, issues: [] };\n\t\t\tconst { checks } = await inspect({ [key]: raw });\n\t\t\treturn checks[key] ?? { ok: true, issues: [] };\n\t\t},\n\t};\n}\n\n/** One stored credential its schema refuses. */\nexport interface InvalidCredential {\n\tkey: string;\n\tissues: CredentialIssue[];\n}\n\n/** An issue as the line that names it: `SHIPPING_CREDENTIALS.apiKey: …`. */\nexport function issueLine(key: string, issue: CredentialIssue): string {\n\treturn `${key}${issue.path ? `.${issue.path}` : ''}: ${issue.message}`;\n}\n\n/**\n * Credentials their construct's schema refuses — on their way into the\n * stage's secrets, or already there when a deploy reads them. The values are\n * never in the message: only where each is wrong, and why.\n */\nexport class CredentialsInvalid extends Error {\n\tconstructor(\n\t\treadonly stage: string,\n\t\treadonly invalid: readonly InvalidCredential[],\n\t\t/** Whether a value was being set (and was not saved), or deployed. */\n\t\treadonly during: 'set' | 'deploy',\n\t) {\n\t\tconst lines = invalid.flatMap(({ key, issues }) =>\n\t\t\tissues.map((issue) => ` ${issueLine(key, issue)}`),\n\t\t);\n\t\tconst keys = invalid.map((i) => i.key);\n\t\tsuper(\n\t\t\tduring === 'set'\n\t\t\t\t? `${keys.join(', ')} is not what its construct's schema describes, ` +\n\t\t\t\t\t\t`so nothing was saved:\\n\\n${lines.join('\\n')}\\n\\n` +\n\t\t\t\t\t\t`Set a value that matches, or let gkm ask for each field: ` +\n\t\t\t\t\t\t`gkm secrets:add --stage ${stage}`\n\t\t\t\t: `The stage '${stage}' holds ${keys.length === 1 ? 'a credential' : 'credentials'} ` +\n\t\t\t\t\t\t`${keys.length === 1 ? \"its construct's schema refuses\" : \"their constructs' schemas refuse\"}, ` +\n\t\t\t\t\t\t`and every app reading ${keys.length === 1 ? 'it' : 'them'} would fail ` +\n\t\t\t\t\t\t`as it starts:\\n\\n${lines.join('\\n')}\\n\\n` +\n\t\t\t\t\t\t`Set ${keys.length === 1 ? 'it' : 'them'} again, field by field: ` +\n\t\t\t\t\t\t`gkm secrets:add --stage ${stage}`,\n\t\t);\n\t\tthis.name = 'CredentialsInvalid';\n\t}\n}\n\n/**\n * Every credential the stage holds for a construct, against its schema —\n * before a deploy builds anything with one the app would refuse as it\n * starts. Loads nothing when the stage holds none.\n *\n * @throws {CredentialsInvalid} naming each key and every issue\n */\nexport async function assertStageCredentials(options: {\n\troot: string;\n\tpatterns: readonly string[];\n\tmanifest: ConstructManifest;\n\tstage: string;\n\tsupplied: Readonly<Record<string, string>>;\n}): Promise<void> {\n\tconst values = Object.fromEntries(\n\t\tcredentialKeys(options.manifest)\n\t\t\t.map(({ key }) => [key, options.supplied[key]] as const)\n\t\t\t.filter((entry): entry is [string, string] => entry[1] !== undefined),\n\t);\n\tif (Object.keys(values).length === 0) return;\n\n\tconst { checks } = await inspectCredentials({\n\t\troot: options.root,\n\t\tpatterns: options.patterns,\n\t\tvalues,\n\t});\n\tconst invalid = Object.entries(checks)\n\t\t.filter(([, check]) => !check.ok)\n\t\t.map(([key, check]) => ({ key, issues: check.issues }))\n\t\t.sort((a, b) => a.key.localeCompare(b.key));\n\tif (invalid.length > 0) {\n\t\tthrow new CredentialsInvalid(options.stage, invalid, 'deploy');\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoEA,SAAgB,eACf,UACqE;CACrE,OAAO,OAAO,QAAQ,QAAQ,CAAC,CAAC,SAAS,CAAC,IAAI,iBAC7C,YAAY,SAAS,kBAAkB,YAAY,SAAS,eACzD,CAAC;EAAE,MAAA,GAAKA,oBAAAA,WAAAA,CAAW,IAAI,aAAa;EAAG;EAAI,MAA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CACtE;CACA,IAAI,OAAO,KAAK,MAAM,CAAC,CAAC,WAAW,GAAG;CAEtC,MAAM,EAAE,WAAW,MAAM,mBAAmB;EAC3C,MAAM,QAAQ;EACd,UAAU,QAAQ;EAClB;CACD,CAAC;CACD,MAAM,UAAU,OAAO,QAAQ,MAAM,CAAC,CACpC,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAChC,KAAK,CAAC,KAAK,YAAY;EAAE;EAAK,QAAQ,MAAM;CAAO,EAAE,CAAC,CACtD,MAAM,GAAG,MAAM,EAAE,IAAI,cAAc,EAAE,GAAG,CAAC;CAC3C,IAAI,QAAQ,SAAS,GACpB,MAAM,IAAI,mBAAmB,QAAQ,OAAO,SAAS,QAAQ;AAE/D"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { _ as toJSONSchema, a as discriminatedUnion, d as record, f as string, h as unknown, n as array, r as boolean, s as literal, t as _enum, u as object } from "./schemas-D-xeKJDD.mjs";
|
|
2
|
+
import { c as runWorker, r as discover, t as ConstructDiscoveryFailed } from "./discover-Buwf1z4P.mjs";
|
|
3
|
+
import { i as activeSandbox } from "./sandbox-Dm247NGx.mjs";
|
|
4
|
+
import { provideKey } from "@geekmidas/manifest";
|
|
5
|
+
import { decodeCredentials } from "@geekmidas/constructs/credential";
|
|
6
|
+
//#region src/secrets/credentialSchemas.ts
|
|
7
|
+
/**
|
|
8
|
+
* A third party's credentials, checked against the schema of the construct
|
|
9
|
+
* that reads them — before they are stored, and before a deploy builds
|
|
10
|
+
* anything with them.
|
|
11
|
+
*
|
|
12
|
+
* The schema lives on the construct (`ExternalApi.credentialsSchema`,
|
|
13
|
+
* `Credential.credentialsSchema`), which is the project's code. So the
|
|
14
|
+
* constructs are loaded where a deploy loads them: in the run's sandbox when
|
|
15
|
+
* there is one, here otherwise. What comes back is data only — each schema as
|
|
16
|
+
* JSON Schema where it can say so, and `{ ok, issues }` for each value asked
|
|
17
|
+
* about — because a live schema cannot cross an isolating sandbox. A value
|
|
18
|
+
* asked about goes in as a secret file, never an argument, and no issue
|
|
19
|
+
* carries it back: an issue is a path and a message.
|
|
20
|
+
*/
|
|
21
|
+
/** The credentials keys a manifest declares, by the construct that reads each. */
|
|
22
|
+
function credentialKeys(manifest) {
|
|
23
|
+
return Object.entries(manifest).flatMap(([id, declaration]) => declaration.kind === "external-api" || declaration.kind === "credential" ? [{
|
|
24
|
+
key: provideKey(id, "credentials"),
|
|
25
|
+
id,
|
|
26
|
+
kind: declaration.kind
|
|
27
|
+
}] : []);
|
|
28
|
+
}
|
|
29
|
+
/** The constructs that read a third party's credentials, with their schemas. */
|
|
30
|
+
function liveCredentials(manifest, sources) {
|
|
31
|
+
return credentialKeys(manifest).flatMap(({ key, id, kind }) => {
|
|
32
|
+
const schema = (sources[id]?.construct)?.credentialsSchema;
|
|
33
|
+
return isStandardSchema(schema) ? [{
|
|
34
|
+
key,
|
|
35
|
+
id,
|
|
36
|
+
kind,
|
|
37
|
+
schema
|
|
38
|
+
}] : [];
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function isStandardSchema(value) {
|
|
42
|
+
return typeof value === "object" && value !== null && typeof value["~standard"]?.validate === "function";
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A schema as JSON Schema: through the Standard JSON Schema extension where
|
|
46
|
+
* the schema has it, as zod 4's does, else zod's own converter — or nothing,
|
|
47
|
+
* for a schema neither can describe.
|
|
48
|
+
*/
|
|
49
|
+
function jsonSchemaOf(schema) {
|
|
50
|
+
const standard = schema["~standard"];
|
|
51
|
+
try {
|
|
52
|
+
const described = standard.jsonSchema?.input?.({ target: "draft-2020-12" });
|
|
53
|
+
if (described) return described;
|
|
54
|
+
} catch {}
|
|
55
|
+
if (typeof schema === "object" && schema !== null && "_zod" in schema) try {
|
|
56
|
+
return toJSONSchema(schema, { io: "input" });
|
|
57
|
+
} catch {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** A stored value against its schema, read the way the construct reads it. */
|
|
62
|
+
async function checkCredential(schema, raw) {
|
|
63
|
+
const result = await schema["~standard"].validate(decodeCredentials(raw));
|
|
64
|
+
if (!result.issues) return {
|
|
65
|
+
ok: true,
|
|
66
|
+
issues: []
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
ok: false,
|
|
70
|
+
issues: result.issues.map((issue) => ({
|
|
71
|
+
path: (issue.path ?? []).map((segment) => typeof segment === "object" ? String(segment.key) : String(segment)).join("."),
|
|
72
|
+
message: issue.message
|
|
73
|
+
}))
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/** What a set of live credentials says about some values: data only. */
|
|
77
|
+
async function inspectLive(live, values) {
|
|
78
|
+
const checks = {};
|
|
79
|
+
for (const credential of live) {
|
|
80
|
+
const value = values[credential.key];
|
|
81
|
+
if (value === void 0) continue;
|
|
82
|
+
checks[credential.key] = await checkCredential(credential.schema, value);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
schemas: live.map(({ key, id, kind, schema }) => {
|
|
86
|
+
const jsonSchema = jsonSchemaOf(schema);
|
|
87
|
+
return {
|
|
88
|
+
key,
|
|
89
|
+
id,
|
|
90
|
+
kind,
|
|
91
|
+
...jsonSchema ? { jsonSchema } : {}
|
|
92
|
+
};
|
|
93
|
+
}),
|
|
94
|
+
checks
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const Issue = object({
|
|
98
|
+
path: string(),
|
|
99
|
+
message: string()
|
|
100
|
+
});
|
|
101
|
+
/** What the credentials worker answers. Checked: the worker ran project code. */
|
|
102
|
+
const CredentialsAnswer = discriminatedUnion("reason", [object({
|
|
103
|
+
reason: literal("inspected"),
|
|
104
|
+
schemas: array(object({
|
|
105
|
+
key: string(),
|
|
106
|
+
id: string(),
|
|
107
|
+
kind: _enum(["external-api", "credential"]),
|
|
108
|
+
jsonSchema: record(string(), unknown()).optional()
|
|
109
|
+
})),
|
|
110
|
+
checks: record(string(), object({
|
|
111
|
+
ok: boolean(),
|
|
112
|
+
issues: array(Issue)
|
|
113
|
+
}))
|
|
114
|
+
}), object({
|
|
115
|
+
reason: literal("failed"),
|
|
116
|
+
error: object({
|
|
117
|
+
name: string(),
|
|
118
|
+
message: string()
|
|
119
|
+
}).loose()
|
|
120
|
+
})]);
|
|
121
|
+
/** How long loading the constructs to check credentials may take. */
|
|
122
|
+
const INSPECT_TIMEOUT_MS = 6e4;
|
|
123
|
+
/**
|
|
124
|
+
* The workspace's credential schemas, and what each of `values` comes to —
|
|
125
|
+
* loaded in the run's sandbox when there is one, here otherwise.
|
|
126
|
+
*/
|
|
127
|
+
async function inspectCredentials(options) {
|
|
128
|
+
const sandbox = activeSandbox();
|
|
129
|
+
if (!sandbox) return (await loadCredentialSchemasHere(options)).inspect(options.values ?? {});
|
|
130
|
+
const secrets = Object.fromEntries(Object.entries(options.values ?? {}).filter(([key]) => key.endsWith("_CREDENTIALS")));
|
|
131
|
+
const { value } = await runWorker(sandbox, "credentials check", {
|
|
132
|
+
name: "credentials-worker",
|
|
133
|
+
args: [JSON.stringify({
|
|
134
|
+
patterns: options.patterns,
|
|
135
|
+
cwd: options.root
|
|
136
|
+
})],
|
|
137
|
+
cwd: options.root,
|
|
138
|
+
timeoutMs: INSPECT_TIMEOUT_MS,
|
|
139
|
+
schema: CredentialsAnswer,
|
|
140
|
+
...Object.keys(secrets).length > 0 ? { secrets } : {}
|
|
141
|
+
});
|
|
142
|
+
if (value.reason === "failed") throw new ConstructDiscoveryFailed(value.error.name, value.error.message);
|
|
143
|
+
const { schemas, checks } = value;
|
|
144
|
+
return {
|
|
145
|
+
schemas: schemas.map(({ jsonSchema, ...rest }) => ({
|
|
146
|
+
...rest,
|
|
147
|
+
...jsonSchema ? { jsonSchema } : {}
|
|
148
|
+
})),
|
|
149
|
+
checks
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/** The constructs loaded once, here, and asked about as often as needed. */
|
|
153
|
+
async function loadCredentialSchemasHere(options) {
|
|
154
|
+
const sources = {};
|
|
155
|
+
const live = liveCredentials(await discover({
|
|
156
|
+
patterns: [...options.patterns],
|
|
157
|
+
cwd: options.root,
|
|
158
|
+
sources
|
|
159
|
+
}), sources);
|
|
160
|
+
return { inspect: (values) => inspectLive(live, values) };
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The workspace's credential schemas, for a command that checks values one
|
|
164
|
+
* at a time as they are typed. In-process the constructs are loaded once;
|
|
165
|
+
* in a sandbox each check is a run of the worker.
|
|
166
|
+
*/
|
|
167
|
+
async function loadCredentialSchemas(options) {
|
|
168
|
+
const here = activeSandbox() ? void 0 : await loadCredentialSchemasHere(options);
|
|
169
|
+
const inspect = (values) => here ? here.inspect(values) : inspectCredentials({
|
|
170
|
+
...options,
|
|
171
|
+
values
|
|
172
|
+
});
|
|
173
|
+
const { schemas } = await inspect({});
|
|
174
|
+
return {
|
|
175
|
+
schemas,
|
|
176
|
+
async check(key, raw) {
|
|
177
|
+
if (!schemas.some((s) => s.key === key)) return {
|
|
178
|
+
ok: true,
|
|
179
|
+
issues: []
|
|
180
|
+
};
|
|
181
|
+
const { checks } = await inspect({ [key]: raw });
|
|
182
|
+
return checks[key] ?? {
|
|
183
|
+
ok: true,
|
|
184
|
+
issues: []
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/** An issue as the line that names it: `SHIPPING_CREDENTIALS.apiKey: …`. */
|
|
190
|
+
function issueLine(key, issue) {
|
|
191
|
+
return `${key}${issue.path ? `.${issue.path}` : ""}: ${issue.message}`;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Credentials their construct's schema refuses — on their way into the
|
|
195
|
+
* stage's secrets, or already there when a deploy reads them. The values are
|
|
196
|
+
* never in the message: only where each is wrong, and why.
|
|
197
|
+
*/
|
|
198
|
+
var CredentialsInvalid = class extends Error {
|
|
199
|
+
stage;
|
|
200
|
+
invalid;
|
|
201
|
+
during;
|
|
202
|
+
constructor(stage, invalid, during) {
|
|
203
|
+
const lines = invalid.flatMap(({ key, issues }) => issues.map((issue) => ` ${issueLine(key, issue)}`));
|
|
204
|
+
const keys = invalid.map((i) => i.key);
|
|
205
|
+
super(during === "set" ? `${keys.join(", ")} is not what its construct's schema describes, so nothing was saved:\n\n${lines.join("\n")}\n\nSet a value that matches, or let gkm ask for each field: gkm secrets:add --stage ${stage}` : `The stage '${stage}' holds ${keys.length === 1 ? "a credential" : "credentials"} ${keys.length === 1 ? "its construct's schema refuses" : "their constructs' schemas refuse"}, and every app reading ${keys.length === 1 ? "it" : "them"} would fail as it starts:\n\n${lines.join("\n")}\n\nSet ${keys.length === 1 ? "it" : "them"} again, field by field: gkm secrets:add --stage ${stage}`);
|
|
206
|
+
this.stage = stage;
|
|
207
|
+
this.invalid = invalid;
|
|
208
|
+
this.during = during;
|
|
209
|
+
this.name = "CredentialsInvalid";
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Every credential the stage holds for a construct, against its schema —
|
|
214
|
+
* before a deploy builds anything with one the app would refuse as it
|
|
215
|
+
* starts. Loads nothing when the stage holds none.
|
|
216
|
+
*
|
|
217
|
+
* @throws {CredentialsInvalid} naming each key and every issue
|
|
218
|
+
*/
|
|
219
|
+
async function assertStageCredentials(options) {
|
|
220
|
+
const values = Object.fromEntries(credentialKeys(options.manifest).map(({ key }) => [key, options.supplied[key]]).filter((entry) => entry[1] !== void 0));
|
|
221
|
+
if (Object.keys(values).length === 0) return;
|
|
222
|
+
const { checks } = await inspectCredentials({
|
|
223
|
+
root: options.root,
|
|
224
|
+
patterns: options.patterns,
|
|
225
|
+
values
|
|
226
|
+
});
|
|
227
|
+
const invalid = Object.entries(checks).filter(([, check]) => !check.ok).map(([key, check]) => ({
|
|
228
|
+
key,
|
|
229
|
+
issues: check.issues
|
|
230
|
+
})).sort((a, b) => a.key.localeCompare(b.key));
|
|
231
|
+
if (invalid.length > 0) throw new CredentialsInvalid(options.stage, invalid, "deploy");
|
|
232
|
+
}
|
|
233
|
+
//#endregion
|
|
234
|
+
export { liveCredentials as a, issueLine as i, assertStageCredentials as n, loadCredentialSchemas as o, inspectLive as r, CredentialsInvalid as t };
|
|
235
|
+
|
|
236
|
+
//# sourceMappingURL=credentialSchemas-BmYxnEz_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentialSchemas-BmYxnEz_.mjs","names":["z.toJSONSchema","z.object","z.string","z.discriminatedUnion","z.literal","z.array","z.enum","z.record","z.unknown","z.boolean"],"sources":["../src/secrets/credentialSchemas.ts"],"sourcesContent":["/**\n * A third party's credentials, checked against the schema of the construct\n * that reads them — before they are stored, and before a deploy builds\n * anything with them.\n *\n * The schema lives on the construct (`ExternalApi.credentialsSchema`,\n * `Credential.credentialsSchema`), which is the project's code. So the\n * constructs are loaded where a deploy loads them: in the run's sandbox when\n * there is one, here otherwise. What comes back is data only — each schema as\n * JSON Schema where it can say so, and `{ ok, issues }` for each value asked\n * about — because a live schema cannot cross an isolating sandbox. A value\n * asked about goes in as a secret file, never an argument, and no issue\n * carries it back: an issue is a path and a message.\n */\n\nimport { decodeCredentials } from '@geekmidas/constructs/credential';\nimport { type ConstructManifest, provideKey } from '@geekmidas/manifest';\nimport type { StandardSchemaV1 } from '@standard-schema/spec';\nimport { z } from 'zod';\nimport {\n\tConstructDiscoveryFailed,\n\ttype ConstructSource,\n\tdiscover,\n} from '../reconcile/discover';\nimport { activeSandbox } from '../sandbox/sandbox';\nimport { runWorker } from '../sandbox/worker';\n\n/** One thing a schema refused: where in the value, and why. */\nexport interface CredentialIssue {\n\t/** Dotted, from the value's root — `apiKey`, `keys.0`; empty for the root. */\n\tpath: string;\n\tmessage: string;\n}\n\n/** What a candidate value came to. */\nexport interface CredentialCheck {\n\tok: boolean;\n\tissues: CredentialIssue[];\n}\n\n/** A construct's credentials key, and its schema as data. */\nexport interface CredentialSchemaInfo {\n\tkey: string;\n\tid: string;\n\tkind: 'external-api' | 'credential';\n\t/**\n\t * The schema as JSON Schema, where the schema can say — zod's, or any\n\t * Standard JSON Schema. Absent otherwise: the value is asked for as JSON.\n\t */\n\tjsonSchema?: Record<string, unknown>;\n}\n\n/** What loading the constructs answers. */\nexport interface CredentialInspection {\n\tschemas: CredentialSchemaInfo[];\n\t/** Each value asked about, by key. */\n\tchecks: Record<string, CredentialCheck>;\n}\n\n/** A construct whose credentials have a schema. */\ninterface LiveCredential {\n\tkey: string;\n\tid: string;\n\tkind: 'external-api' | 'credential';\n\tschema: StandardSchemaV1;\n}\n\n/** The credentials keys a manifest declares, by the construct that reads each. */\nexport function credentialKeys(\n\tmanifest: ConstructManifest,\n): { key: string; id: string; kind: 'external-api' | 'credential' }[] {\n\treturn Object.entries(manifest).flatMap(([id, declaration]) =>\n\t\tdeclaration.kind === 'external-api' || declaration.kind === 'credential'\n\t\t\t? [{ key: provideKey(id, 'credentials'), id, kind: declaration.kind }]\n\t\t\t: [],\n\t);\n}\n\n/** The constructs that read a third party's credentials, with their schemas. */\nexport function liveCredentials(\n\tmanifest: ConstructManifest,\n\tsources: Readonly<Record<string, ConstructSource>>,\n): LiveCredential[] {\n\treturn credentialKeys(manifest).flatMap(({ key, id, kind }) => {\n\t\tconst schema = (sources[id]?.construct as { credentialsSchema?: unknown })\n\t\t\t?.credentialsSchema;\n\t\treturn isStandardSchema(schema) ? [{ key, id, kind, schema }] : [];\n\t});\n}\n\nfunction isStandardSchema(value: unknown): value is StandardSchemaV1 {\n\treturn (\n\t\ttypeof value === 'object' &&\n\t\tvalue !== null &&\n\t\ttypeof (value as StandardSchemaV1)['~standard']?.validate === 'function'\n\t);\n}\n\n/**\n * A schema as JSON Schema: through the Standard JSON Schema extension where\n * the schema has it, as zod 4's does, else zod's own converter — or nothing,\n * for a schema neither can describe.\n */\nexport function jsonSchemaOf(\n\tschema: StandardSchemaV1,\n): Record<string, unknown> | undefined {\n\tconst standard = schema['~standard'] as StandardSchemaV1['~standard'] & {\n\t\tjsonSchema?: {\n\t\t\tinput?: (options: { target: string }) => Record<string, unknown>;\n\t\t};\n\t};\n\ttry {\n\t\tconst described = standard.jsonSchema?.input?.({\n\t\t\ttarget: 'draft-2020-12',\n\t\t});\n\t\tif (described) return described;\n\t} catch {\n\t\t// A type JSON Schema cannot express: try zod's converter, then nothing.\n\t}\n\tif (typeof schema === 'object' && schema !== null && '_zod' in schema) {\n\t\ttry {\n\t\t\treturn z.toJSONSchema(schema as unknown as z.ZodType, {\n\t\t\t\tio: 'input',\n\t\t\t}) as Record<string, unknown>;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/** A stored value against its schema, read the way the construct reads it. */\nexport async function checkCredential(\n\tschema: StandardSchemaV1,\n\traw: string,\n): Promise<CredentialCheck> {\n\tconst result = await schema['~standard'].validate(decodeCredentials(raw));\n\tif (!result.issues) return { ok: true, issues: [] };\n\treturn {\n\t\tok: false,\n\t\tissues: result.issues.map((issue) => ({\n\t\t\tpath: (issue.path ?? [])\n\t\t\t\t.map((segment) =>\n\t\t\t\t\ttypeof segment === 'object' ? String(segment.key) : String(segment),\n\t\t\t\t)\n\t\t\t\t.join('.'),\n\t\t\tmessage: issue.message,\n\t\t})),\n\t};\n}\n\n/** What a set of live credentials says about some values: data only. */\nexport async function inspectLive(\n\tlive: readonly LiveCredential[],\n\tvalues: Readonly<Record<string, string>>,\n): Promise<CredentialInspection> {\n\tconst checks: Record<string, CredentialCheck> = {};\n\tfor (const credential of live) {\n\t\tconst value = values[credential.key];\n\t\tif (value === undefined) continue;\n\t\tchecks[credential.key] = await checkCredential(credential.schema, value);\n\t}\n\treturn {\n\t\tschemas: live.map(({ key, id, kind, schema }) => {\n\t\t\tconst jsonSchema = jsonSchemaOf(schema);\n\t\t\treturn { key, id, kind, ...(jsonSchema ? { jsonSchema } : {}) };\n\t\t}),\n\t\tchecks,\n\t};\n}\n\nexport interface InspectOptions {\n\t/** The workspace root. */\n\troot: string;\n\t/** Its construct globs. */\n\tpatterns: readonly string[];\n\t/** The values to check, by key. Only credentials keys are looked at. */\n\tvalues?: Readonly<Record<string, string>>;\n}\n\nconst Issue = z.object({ path: z.string(), message: z.string() });\n\n/** What the credentials worker answers. Checked: the worker ran project code. */\nconst CredentialsAnswer = z.discriminatedUnion('reason', [\n\tz.object({\n\t\treason: z.literal('inspected'),\n\t\tschemas: z.array(\n\t\t\tz.object({\n\t\t\t\tkey: z.string(),\n\t\t\t\tid: z.string(),\n\t\t\t\tkind: z.enum(['external-api', 'credential']),\n\t\t\t\tjsonSchema: z.record(z.string(), z.unknown()).optional(),\n\t\t\t}),\n\t\t),\n\t\tchecks: z.record(\n\t\t\tz.string(),\n\t\t\tz.object({ ok: z.boolean(), issues: z.array(Issue) }),\n\t\t),\n\t}),\n\tz.object({\n\t\treason: z.literal('failed'),\n\t\terror: z.object({ name: z.string(), message: z.string() }).loose(),\n\t}),\n]);\n\n/** How long loading the constructs to check credentials may take. */\nconst INSPECT_TIMEOUT_MS = 60_000;\n\n/**\n * The workspace's credential schemas, and what each of `values` comes to —\n * loaded in the run's sandbox when there is one, here otherwise.\n */\nexport async function inspectCredentials(\n\toptions: InspectOptions,\n): Promise<CredentialInspection> {\n\tconst sandbox = activeSandbox();\n\tif (!sandbox) {\n\t\treturn (await loadCredentialSchemasHere(options)).inspect(\n\t\t\toptions.values ?? {},\n\t\t);\n\t}\n\n\tconst secrets = Object.fromEntries(\n\t\tObject.entries(options.values ?? {}).filter(([key]) =>\n\t\t\tkey.endsWith('_CREDENTIALS'),\n\t\t),\n\t);\n\tconst { value } = await runWorker(sandbox, 'credentials check', {\n\t\tname: 'credentials-worker',\n\t\targs: [JSON.stringify({ patterns: options.patterns, cwd: options.root })],\n\t\tcwd: options.root,\n\t\ttimeoutMs: INSPECT_TIMEOUT_MS,\n\t\tschema: CredentialsAnswer,\n\t\t...(Object.keys(secrets).length > 0 ? { secrets } : {}),\n\t});\n\tif (value.reason === 'failed') {\n\t\tthrow new ConstructDiscoveryFailed(value.error.name, value.error.message);\n\t}\n\tconst { schemas, checks } = value;\n\treturn {\n\t\tschemas: schemas.map(({ jsonSchema, ...rest }) => ({\n\t\t\t...rest,\n\t\t\t...(jsonSchema ? { jsonSchema } : {}),\n\t\t})),\n\t\tchecks,\n\t};\n}\n\n/** The constructs loaded once, here, and asked about as often as needed. */\nasync function loadCredentialSchemasHere(options: InspectOptions): Promise<{\n\tinspect(\n\t\tvalues: Readonly<Record<string, string>>,\n\t): Promise<CredentialInspection>;\n}> {\n\tconst sources: Record<string, ConstructSource> = {};\n\tconst manifest = await discover({\n\t\tpatterns: [...options.patterns],\n\t\tcwd: options.root,\n\t\tsources,\n\t});\n\tconst live = liveCredentials(manifest, sources);\n\treturn { inspect: (values) => inspectLive(live, values) };\n}\n\n/** The schemas, and a check of one candidate value at a time. */\nexport interface CredentialSchemas {\n\tschemas: CredentialSchemaInfo[];\n\t/** `raw` against `key`'s schema; ok for a key no schema describes. */\n\tcheck(key: string, raw: string): Promise<CredentialCheck>;\n}\n\n/**\n * The workspace's credential schemas, for a command that checks values one\n * at a time as they are typed. In-process the constructs are loaded once;\n * in a sandbox each check is a run of the worker.\n */\nexport async function loadCredentialSchemas(\n\toptions: Omit<InspectOptions, 'values'>,\n): Promise<CredentialSchemas> {\n\tconst here = activeSandbox()\n\t\t? undefined\n\t\t: await loadCredentialSchemasHere(options);\n\tconst inspect = (values: Readonly<Record<string, string>>) =>\n\t\there ? here.inspect(values) : inspectCredentials({ ...options, values });\n\n\tconst { schemas } = await inspect({});\n\treturn {\n\t\tschemas,\n\t\tasync check(key, raw) {\n\t\t\tif (!schemas.some((s) => s.key === key)) return { ok: true, issues: [] };\n\t\t\tconst { checks } = await inspect({ [key]: raw });\n\t\t\treturn checks[key] ?? { ok: true, issues: [] };\n\t\t},\n\t};\n}\n\n/** One stored credential its schema refuses. */\nexport interface InvalidCredential {\n\tkey: string;\n\tissues: CredentialIssue[];\n}\n\n/** An issue as the line that names it: `SHIPPING_CREDENTIALS.apiKey: …`. */\nexport function issueLine(key: string, issue: CredentialIssue): string {\n\treturn `${key}${issue.path ? `.${issue.path}` : ''}: ${issue.message}`;\n}\n\n/**\n * Credentials their construct's schema refuses — on their way into the\n * stage's secrets, or already there when a deploy reads them. The values are\n * never in the message: only where each is wrong, and why.\n */\nexport class CredentialsInvalid extends Error {\n\tconstructor(\n\t\treadonly stage: string,\n\t\treadonly invalid: readonly InvalidCredential[],\n\t\t/** Whether a value was being set (and was not saved), or deployed. */\n\t\treadonly during: 'set' | 'deploy',\n\t) {\n\t\tconst lines = invalid.flatMap(({ key, issues }) =>\n\t\t\tissues.map((issue) => ` ${issueLine(key, issue)}`),\n\t\t);\n\t\tconst keys = invalid.map((i) => i.key);\n\t\tsuper(\n\t\t\tduring === 'set'\n\t\t\t\t? `${keys.join(', ')} is not what its construct's schema describes, ` +\n\t\t\t\t\t\t`so nothing was saved:\\n\\n${lines.join('\\n')}\\n\\n` +\n\t\t\t\t\t\t`Set a value that matches, or let gkm ask for each field: ` +\n\t\t\t\t\t\t`gkm secrets:add --stage ${stage}`\n\t\t\t\t: `The stage '${stage}' holds ${keys.length === 1 ? 'a credential' : 'credentials'} ` +\n\t\t\t\t\t\t`${keys.length === 1 ? \"its construct's schema refuses\" : \"their constructs' schemas refuse\"}, ` +\n\t\t\t\t\t\t`and every app reading ${keys.length === 1 ? 'it' : 'them'} would fail ` +\n\t\t\t\t\t\t`as it starts:\\n\\n${lines.join('\\n')}\\n\\n` +\n\t\t\t\t\t\t`Set ${keys.length === 1 ? 'it' : 'them'} again, field by field: ` +\n\t\t\t\t\t\t`gkm secrets:add --stage ${stage}`,\n\t\t);\n\t\tthis.name = 'CredentialsInvalid';\n\t}\n}\n\n/**\n * Every credential the stage holds for a construct, against its schema —\n * before a deploy builds anything with one the app would refuse as it\n * starts. Loads nothing when the stage holds none.\n *\n * @throws {CredentialsInvalid} naming each key and every issue\n */\nexport async function assertStageCredentials(options: {\n\troot: string;\n\tpatterns: readonly string[];\n\tmanifest: ConstructManifest;\n\tstage: string;\n\tsupplied: Readonly<Record<string, string>>;\n}): Promise<void> {\n\tconst values = Object.fromEntries(\n\t\tcredentialKeys(options.manifest)\n\t\t\t.map(({ key }) => [key, options.supplied[key]] as const)\n\t\t\t.filter((entry): entry is [string, string] => entry[1] !== undefined),\n\t);\n\tif (Object.keys(values).length === 0) return;\n\n\tconst { checks } = await inspectCredentials({\n\t\troot: options.root,\n\t\tpatterns: options.patterns,\n\t\tvalues,\n\t});\n\tconst invalid = Object.entries(checks)\n\t\t.filter(([, check]) => !check.ok)\n\t\t.map(([key, check]) => ({ key, issues: check.issues }))\n\t\t.sort((a, b) => a.key.localeCompare(b.key));\n\tif (invalid.length > 0) {\n\t\tthrow new CredentialsInvalid(options.stage, invalid, 'deploy');\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAoEA,SAAgB,eACf,UACqE;CACrE,OAAO,OAAO,QAAQ,QAAQ,CAAC,CAAC,SAAS,CAAC,IAAI,iBAC7C,YAAY,SAAS,kBAAkB,YAAY,SAAS,eACzD,CAAC;EAAE,KAAK,WAAW,IAAI,aAAa;EAAG;EAAI,MAAM,YAAY;CAAK,CAAC,IACnE,CAAC,CACL;AACD;;AAGA,SAAgB,gBACf,UACA,SACmB;CACnB,OAAO,eAAe,QAAQ,CAAC,CAAC,SAAS,EAAE,KAAK,IAAI,WAAW;EAC9D,MAAM,UAAU,QAAQ,GAAG,EAAE,UAAA,EAC1B;EACH,OAAO,iBAAiB,MAAM,IAAI,CAAC;GAAE;GAAK;GAAI;GAAM;EAAO,CAAC,IAAI,CAAC;CAClE,CAAC;AACF;AAEA,SAAS,iBAAiB,OAA2C;CACpE,OACC,OAAO,UAAU,YACjB,UAAU,QACV,OAAQ,MAA2B,YAAY,EAAE,aAAa;AAEhE;;;;;;AAOA,SAAgB,aACf,QACsC;CACtC,MAAM,WAAW,OAAO;CAKxB,IAAI;EACH,MAAM,YAAY,SAAS,YAAY,QAAQ,EAC9C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M,UAAU,KAAK,WAAW,IAAI,iBAAiB,cAAc,GAC9E,KAAK,WAAW,IAAI,mCAAmC,mCAAmC,0BACpE,KAAK,WAAW,IAAI,OAAO,OAAO,+BACvC,MAAM,KAAK,IAAI,EAAE,UAC9B,KAAK,WAAW,IAAI,OAAO,OAAO,kDACd,OAC/B;EArBS,KAAA,QAAA;EACA,KAAA,UAAA;EAEA,KAAA,SAAA;EAmBT,KAAK,OAAO;CACb;AACD;;;;;;;;AASA,eAAsB,uBAAuB,SAM3B;CACjB,MAAM,SAAS,OAAO,YACrB,eAAe,QAAQ,QAAQ,CAAC,CAC9B,KAAK,EAAE,UAAU,CAAC,KAAK,QAAQ,SAAS,IAAI,CAAU,CAAC,CACvD,QAAQ,UAAqC,MAAM,OAAO,KAAA,CAAS,CACtE;CACA,IAAI,OAAO,KAAK,MAAM,CAAC,CAAC,WAAW,GAAG;CAEtC,MAAM,EAAE,WAAW,MAAM,mBAAmB;EAC3C,MAAM,QAAQ;EACd,UAAU,QAAQ;EAClB;CACD,CAAC;CACD,MAAM,UAAU,OAAO,QAAQ,MAAM,CAAC,CACpC,QAAQ,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAChC,KAAK,CAAC,KAAK,YAAY;EAAE;EAAK,QAAQ,MAAM;CAAO,EAAE,CAAC,CACtD,MAAM,GAAG,MAAM,EAAE,IAAI,cAAc,EAAE,GAAG,CAAC;CAC3C,IAAI,QAAQ,SAAS,GACpB,MAAM,IAAI,mBAAmB,QAAQ,OAAO,SAAS,QAAQ;AAE/D"}
|
package/dist/deploy/public.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_run = require("../run-fVZ-rLnc.cjs");
|
|
3
3
|
const require_credentials = require("../credentials-BVs7mrtw.cjs");
|
|
4
|
-
const require_discover = require("../discover-
|
|
4
|
+
const require_discover = require("../discover-B4VjaFJk.cjs");
|
|
5
5
|
const require_sandbox = require("../sandbox-CL--ZDui.cjs");
|
|
6
6
|
const require_define = require("../define-DzRz8FgH.cjs");
|
|
7
7
|
const require_config = require("../config.cjs");
|
|
8
|
-
const require_state = require("../state-
|
|
9
|
-
const require_sniffer = require("../sniffer-
|
|
10
|
-
const require_resolve = require("../resolve-
|
|
11
|
-
const require_deploy = require("../deploy-
|
|
12
|
-
const require_engine = require("../engine-
|
|
13
|
-
const require_rollback = require("../rollback-
|
|
8
|
+
const require_state = require("../state-8RgXeX5Y.cjs");
|
|
9
|
+
const require_sniffer = require("../sniffer-Bc0nNBDF.cjs");
|
|
10
|
+
const require_resolve = require("../resolve-BDsMffvz.cjs");
|
|
11
|
+
const require_deploy = require("../deploy-Dpz9raPM.cjs");
|
|
12
|
+
const require_engine = require("../engine-BR9qlS7A.cjs");
|
|
13
|
+
const require_rollback = require("../rollback-5XHaBDxW.cjs");
|
|
14
14
|
const require_provider = require("../provider-C9_-45d5.cjs");
|
|
15
15
|
const require_sst = require("../sst-hBrKouBy.cjs");
|
|
16
16
|
let node_path = require("node:path");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.cts","names":[],"sources":["../../src/home.ts","../../src/run.ts","../../src/sandbox/env.ts","../../src/docker/templates.ts","../../src/sandbox/install.ts","../../src/sandbox/local.ts","../../src/sandbox/worker.ts","../../src/target/dokploy/dokploy-api.ts","../../src/target/dokploy/engine.ts","../../src/target/dokploy/health.ts","../../src/target/dokploy/migrations.ts","../../src/target/dokploy/rollback.ts","../../src/target/sst/health.ts","../../src/target/sst/outputs.ts","../../src/target/sst/index.ts","../../src/deploy/deploy.ts","../../src/deploy/orchestrate.ts","../../src/deploy/ownership.ts","../../src/deploy/registry.ts"],"mappings":";;;;;;;;;;;;;;;;;;qBAaa;;wBAGG,QAAQ,MAAK,OAAO;;;;qBCuBvB,sBAAsB;WAExB;WACA;WACA;WACA,QAAQ,OAAO;EAJzB,YACU,iBACA,yBACA,yBACA,QAAQ,OAAO;;;qBAUb,wBAAwB;WAE1B;WACA;WACA;EAHV,YACU,iBACA,yBACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBC3BE,0CAA0C;;;;;wBAyDvC,eACf,SAAQ,OAAO,YACf,4BACE;;;KCvFS;;;;qBCeC;UAEI;;EAEhB;;EAEA,iBAAiB;;;;;;;EAOjB;;;;;EAKA;;EAEA,MAAM,SAAS;;EAEf;;EAEA,SAAS;EACT,SAAS;;;qBAIG,oCAAoC;WAC3B;EAArB,YAAqB;;;qBAWT,2CAA2C;WAE7C;WACA;EAFV,YACU,wBACA;;;;;;;;;;;;;;;;;;;;wBAqJW,oBACrB,SAAS,SACT,UAAS,iBACP,QAAQ;;;UCpMM;;EAEhB;;;;;;;;;EASA;;;;;EAKA;;EAEA,UAAU,OAAO;;;;;;;;;;;;;;;;;qBA0BL,wBAAwB;WAC3B;WACA;WACA,KAAK,SAAS;EAEvB,YAAY,SAAS;EAUf,KACL,iBACA,yBACA,SAAS,qBACP,QAAQ;;;;;qBCpBC,4BAA4B;WAE9B;WACA;WACA;EAHV,YACU,cACA,yBACA;;;;;qBCqBE,yBAAyB;WAE3B;WACA,YAAY;EAFtB,YACU,uBACA,YAAY;;;qBAYV,2BAA2B;WAE7B;WACA;;WAEA,YAAY;EAJtB,YACU,uBACA,mBAEA;;EAAA,YAAY;;KA0vCX;;UAOK;EAChB;EACA,QAAQ;;EAER;EACA;EACA;;;;;
|
|
1
|
+
{"version":3,"file":"public.d.cts","names":[],"sources":["../../src/home.ts","../../src/run.ts","../../src/sandbox/env.ts","../../src/docker/templates.ts","../../src/sandbox/install.ts","../../src/sandbox/local.ts","../../src/sandbox/worker.ts","../../src/target/dokploy/dokploy-api.ts","../../src/target/dokploy/engine.ts","../../src/target/dokploy/health.ts","../../src/target/dokploy/migrations.ts","../../src/target/dokploy/rollback.ts","../../src/target/sst/health.ts","../../src/target/sst/outputs.ts","../../src/target/sst/index.ts","../../src/deploy/deploy.ts","../../src/deploy/orchestrate.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AEA;;EAAA;;;;;qBChBE,8BAA8B;WACrB;EAArB,YAAqB;;;qBAUT,yBAAyB;WAChB;EAArB,YAAqB;;;qBAUT,0BAA0B;WAE5B;WACA;EAFV,YACU,kBACA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.mts","names":[],"sources":["../../src/home.ts","../../src/run.ts","../../src/sandbox/env.ts","../../src/docker/templates.ts","../../src/sandbox/install.ts","../../src/sandbox/local.ts","../../src/sandbox/worker.ts","../../src/target/dokploy/dokploy-api.ts","../../src/target/dokploy/engine.ts","../../src/target/dokploy/health.ts","../../src/target/dokploy/migrations.ts","../../src/target/dokploy/rollback.ts","../../src/target/sst/health.ts","../../src/target/sst/outputs.ts","../../src/target/sst/index.ts","../../src/deploy/deploy.ts","../../src/deploy/orchestrate.ts","../../src/deploy/ownership.ts","../../src/deploy/registry.ts"],"mappings":";;;;;;;;;;;;;;;;;;qBAaa;;wBAGG,QAAQ,MAAK,OAAO;;;;qBCuBvB,sBAAsB;WAExB;WACA;WACA;WACA,QAAQ,OAAO;EAJzB,YACU,iBACA,yBACA,yBACA,QAAQ,OAAO;;;qBAUb,wBAAwB;WAE1B;WACA;WACA;EAHV,YACU,iBACA,yBACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBC3BE,0CAA0C;;;;;wBAyDvC,eACf,SAAQ,OAAO,YACf,4BACE;;;KCvFS;;;;qBCeC;UAEI;;EAEhB;;EAEA,iBAAiB;;;;;;;EAOjB;;;;;EAKA;;EAEA,MAAM,SAAS;;EAEf;;EAEA,SAAS;EACT,SAAS;;;qBAIG,oCAAoC;WAC3B;EAArB,YAAqB;;;qBAWT,2CAA2C;WAE7C;WACA;EAFV,YACU,wBACA;;;;;;;;;;;;;;;;;;;;wBAqJW,oBACrB,SAAS,SACT,UAAS,iBACP,QAAQ;;;UCpMM;;EAEhB;;;;;;;;;EASA;;;;;EAKA;;EAEA,UAAU,OAAO;;;;;;;;;;;;;;;;;qBA0BL,wBAAwB;WAC3B;WACA;WACA,KAAK,SAAS;EAEvB,YAAY,SAAS;EAUf,KACL,iBACA,yBACA,SAAS,qBACP,QAAQ;;;;;qBCpBC,4BAA4B;WAE9B;WACA;WACA;EAHV,YACU,cACA,yBACA;;;;;qBCqBE,yBAAyB;WAE3B;WACA,YAAY;EAFtB,YACU,uBACA,YAAY;;;qBAYV,2BAA2B;WAE7B;WACA;;WAEA,YAAY;EAJtB,YACU,uBACA,mBAEA;;EAAA,YAAY;;KA0vCX;;UAOK;EAChB;EACA,QAAQ;;EAER;EACA;EACA;;;;;
|
|
1
|
+
{"version":3,"file":"public.d.mts","names":[],"sources":["../../src/home.ts","../../src/run.ts","../../src/sandbox/env.ts","../../src/docker/templates.ts","../../src/sandbox/install.ts","../../src/sandbox/local.ts","../../src/sandbox/worker.ts","../../src/target/dokploy/dokploy-api.ts","../../src/target/dokploy/engine.ts","../../src/target/dokploy/health.ts","../../src/target/dokploy/migrations.ts","../../src/target/dokploy/rollback.ts","../../src/target/sst/health.ts","../../src/target/sst/outputs.ts","../../src/target/sst/index.ts","../../src/deploy/deploy.ts","../../src/deploy/orchestrate.ts","../../src/deploy/ownership.ts","../../src/deploy/registry.ts"],"mappings":";;;;;;;;;;;;;;;;;;qBAaa;;wBAGG,QAAQ,MAAK,OAAO;;;;qBCuBvB,sBAAsB;WAExB;WACA;WACA;WACA,QAAQ,OAAO;EAJzB,YACU,iBACA,yBACA,yBACA,QAAQ,OAAO;;;qBAUb,wBAAwB;WAE1B;WACA;WACA;EAHV,YACU,iBACA,yBACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBC3BE,0CAA0C;;;;;wBAyDvC,eACf,SAAQ,OAAO,YACf,4BACE;;;KCvFS;;;;qBCeC;UAEI;;EAEhB;;EAEA,iBAAiB;;;;;;;EAOjB;;;;;EAKA;;EAEA,MAAM,SAAS;;EAEf;;EAEA,SAAS;EACT,SAAS;;;qBAIG,oCAAoC;WAC3B;EAArB,YAAqB;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IACR;IACA;IACA;IACA;;;;;;qBCZU,6BAA6B;WAE/B;WACA;EAFV,YACU,cACA;;;;;qBC2BE,0BAA0B;WACjB;EAArB,YAAqB;;;;;;;;UCrBL;EAChB,KAAK;EACL,KAAK;EACL,OAAO;;UAGS;;;;;EAKhB;;;;;EAKA;;;;;EAKA;;;;;;EAMA,UAAU,eAAe;;EAEzB;;EAEA;;;;;;EAMA;;;;;;EAMA;;;;;;EAMA,cAAc;;;;;;;;;;;EAWd;;EAEA,SAAS;;;;;;EAMT,SAAS;;;;;EAKT;;;;;EAKA;;;;;;;;;;;;EAYA,UAAU;;;UAIM,kBAAkB,cAAc;;;;;;WAMvC,QAAQ,QAAQ;;;;;;;;;;;;;;;;;;wBAqEV,OAAO,OAAO,cAAc;;;;qBCxH/B,0BAA0B;WAE5B;WACA;EAFV,YACU,yBACA;;;qBAWE,yBAAyB;WAE3B;WACA;EAFV,YACU,eACA;;;qBAUE,uBAAuB;WAEzB;;WAEA;EAHV,YACU,gBAEA;;EAAA,kBACT;;;;;;;;qBCnFW,wBAAwB;WAE1B;WACA;WACA;;WAEA;EALV,YACU,qBACA,mBACA,kBAEA;;EAAA;;;;;qBChBE,8BAA8B;WACrB;EAArB,YAAqB;;;qBAUT,yBAAyB;WAChB;EAArB,YAAqB;;;qBAUT,0BAA0B;WAE5B;WACA;EAFV,YACU,kBACA"}
|
package/dist/deploy/public.mjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { n as CommandTimedOut, o as GKM_HOME_ENV, s as gkmHome, t as CommandFailed } from "../run-BJLIerMM.mjs";
|
|
2
2
|
import { a as SANDBOX_ENV_ALLOWLIST, i as LocalSandbox, n as chainCredentials, o as allowlistedEnv, r as storedCredentials, t as MissingCredential } from "../credentials-pAtB70k3.mjs";
|
|
3
|
-
import { n as ConstructsNotSerializable, o as SandboxWorkerFailed, t as ConstructDiscoveryFailed } from "../discover-
|
|
3
|
+
import { n as ConstructsNotSerializable, o as SandboxWorkerFailed, t as ConstructDiscoveryFailed } from "../discover-Buwf1z4P.mjs";
|
|
4
4
|
import { n as SandboxCwdEscape, o as confineCwd, r as SecretNameInvalid, t as SECRETS_DIR_ENV } from "../sandbox-Dm247NGx.mjs";
|
|
5
5
|
import { a as UnknownDeployTarget, i as DeployTargetNotYetSupported } from "../define-DR8xGYfL.mjs";
|
|
6
6
|
import { ConfigLoadFailed, ConfigObjectNotSerializable } from "../config.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { a as DeploymentTimedOut, d as StateLocked, i as DeploymentFailed, m as StateVersionConflict } from "../sniffer-
|
|
9
|
-
import { i as TargetRuntimeMismatch, l as TargetPackageNotFound, n as TargetEntryInvalid, r as TargetPackageInvalid, s as TargetRuntimeUndeclared, t as InvalidTargetOptions } from "../resolve-
|
|
10
|
-
import { i as UnknownDeployApps, n as NoDeployableApps, r as RollbackFailed, t as deploy } from "../deploy-
|
|
11
|
-
import { _ as RegistryNotConfigured, g as RegistryAmbiguous, h as HealthCheckTimedOut, m as DeployMigrationsFailed, n as FrontendDeployFailed, r as MissingEnvVars, t as BackendDeployFailed, v as RegistryNotFound, y as ProjectNotOwned } from "../engine-
|
|
12
|
-
import { i as rollbackStage, n as RollbackNeedsApp, r as StageNeverDeployed, t as NothingToRollBack } from "../rollback-
|
|
7
|
+
import { D as ExternalServicesNotConfigured, E as DevServicesNeedServerTarget, Ht as deployIdentity, T as DEV_SERVICES, ht as detectPackageManager, k as UnknownDevService } from "../state-DClnPZt5.mjs";
|
|
8
|
+
import { a as DeploymentTimedOut, d as StateLocked, i as DeploymentFailed, m as StateVersionConflict } from "../sniffer-DMqi2b1q.mjs";
|
|
9
|
+
import { i as TargetRuntimeMismatch, l as TargetPackageNotFound, n as TargetEntryInvalid, r as TargetPackageInvalid, s as TargetRuntimeUndeclared, t as InvalidTargetOptions } from "../resolve-Dn5wGf1r.mjs";
|
|
10
|
+
import { i as UnknownDeployApps, n as NoDeployableApps, r as RollbackFailed, t as deploy } from "../deploy-BzqbkJ3o.mjs";
|
|
11
|
+
import { _ as RegistryNotConfigured, g as RegistryAmbiguous, h as HealthCheckTimedOut, m as DeployMigrationsFailed, n as FrontendDeployFailed, r as MissingEnvVars, t as BackendDeployFailed, v as RegistryNotFound, y as ProjectNotOwned } from "../engine-62Kl70Pj.mjs";
|
|
12
|
+
import { i as rollbackStage, n as RollbackNeedsApp, r as StageNeverDeployed, t as NothingToRollBack } from "../rollback-DDfaqv7P.mjs";
|
|
13
13
|
import { t as ProviderRemoved } from "../provider-q4lsYzYG.mjs";
|
|
14
14
|
import { i as SurfacesUnhealthy, r as SstOutputsUnreadable, t as SstConfigNotFound } from "../sst-DRi3H5TB.mjs";
|
|
15
15
|
import { join, resolve } from "node:path";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { s as gkmHome } from "./run-BJLIerMM.mjs";
|
|
2
2
|
import { i as LocalSandbox, r as storedCredentials } from "./credentials-pAtB70k3.mjs";
|
|
3
|
-
import { f as withOutput, r as discover } from "./discover-
|
|
3
|
+
import { f as withOutput, r as discover } from "./discover-Buwf1z4P.mjs";
|
|
4
4
|
import { c as withSandbox } from "./sandbox-Dm247NGx.mjs";
|
|
5
5
|
import { n as derivedApps } from "./derive-B4vDpzgP.mjs";
|
|
6
6
|
import { o as builtinTarget } from "./define-DR8xGYfL.mjs";
|
|
7
|
-
import { k as assertDeployedStage, s as getAppBuildOrder } from "./workspace-
|
|
7
|
+
import { k as assertDeployedStage, s as getAppBuildOrder } from "./workspace-B2UK_rVP.mjs";
|
|
8
8
|
import { findWorkspaceRoot, loadWorkspaceConfig } from "./config.mjs";
|
|
9
|
-
import {
|
|
10
|
-
import { g as createStateStore, v as eventError } from "./sniffer-
|
|
11
|
-
import { a as parseTargetOptions, o as resolveTarget } from "./resolve-
|
|
9
|
+
import { E as DevServicesNeedServerTarget, Ht as deployIdentity, P as parseDevServices, Pt as secretsStoreFor, U as constructGlobs, Vt as applicationName } from "./state-DClnPZt5.mjs";
|
|
10
|
+
import { g as createStateStore, v as eventError } from "./sniffer-DMqi2b1q.mjs";
|
|
11
|
+
import { a as parseTargetOptions, o as resolveTarget } from "./resolve-Dn5wGf1r.mjs";
|
|
12
12
|
import { resolve } from "node:path";
|
|
13
13
|
//#region src/target/secrets.ts
|
|
14
14
|
/**
|
|
@@ -489,4 +489,4 @@ async function load(input, sandbox) {
|
|
|
489
489
|
//#endregion
|
|
490
490
|
export { UnknownDeployApps as i, NoDeployableApps as n, RollbackFailed as r, deploy as t };
|
|
491
491
|
|
|
492
|
-
//# sourceMappingURL=deploy-
|
|
492
|
+
//# sourceMappingURL=deploy-BzqbkJ3o.mjs.map
|