@geekmidas/cli 10.0.0-alpha.4 → 10.0.0-alpha.41
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 +52 -74
- package/bin/adjacent-tsconfig.mjs +97 -0
- package/bin/gkm.mjs +7 -1
- package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
- package/dist/HostingerProvider-BZFGYYVA.cjs.map +1 -0
- package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-Bh6K7QYz.mjs} +20 -21
- package/dist/HostingerProvider-Bh6K7QYz.mjs.map +1 -0
- package/dist/{LocalStateProvider-Db9SEjyH.cjs → LocalStateProvider-7HR6SS2t.cjs} +11 -6
- package/dist/LocalStateProvider-7HR6SS2t.cjs.map +1 -0
- package/dist/{LocalStateProvider-Bn6tS-oL.mjs → LocalStateProvider-D7QyJoLM.mjs} +10 -4
- package/dist/LocalStateProvider-D7QyJoLM.mjs.map +1 -0
- package/dist/{openapi-CA0yJUTN.cjs → OpenApiTsGenerator-B4Kj_qNU.cjs} +142 -303
- package/dist/OpenApiTsGenerator-B4Kj_qNU.cjs.map +1 -0
- package/dist/{openapi-kkQbsRVj.mjs → OpenApiTsGenerator-CEh3EKN3.mjs} +113 -255
- package/dist/OpenApiTsGenerator-CEh3EKN3.mjs.map +1 -0
- package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
- package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
- package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
- package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
- package/dist/{SSMStateProvider-BRt2py-A.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
- package/dist/{SSMStateProvider-DyX8s9HI.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
- package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
- package/dist/aws-DkHdTV-p.cjs +61 -0
- package/dist/aws-DkHdTV-p.cjs.map +1 -0
- package/dist/aws-DojzQnLd.mjs +61 -0
- package/dist/aws-DojzQnLd.mjs.map +1 -0
- package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
- package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
- package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
- package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
- package/dist/{bundler-Be8Zg4Wd.mjs → bundler--fyybf1N.mjs} +19 -30
- package/dist/bundler--fyybf1N.mjs.map +1 -0
- package/dist/{bundler-BY1OmV1e.cjs → bundler-By6_sXiL.cjs} +20 -32
- package/dist/bundler-By6_sXiL.cjs.map +1 -0
- package/dist/{config-WRdsQYZK.mjs → config-5watB1D0.mjs} +142 -154
- package/dist/config-5watB1D0.mjs.map +1 -0
- package/dist/{config-C21ocYNd.cjs → config-CJ-PAb7M.cjs} +209 -210
- package/dist/config-CJ-PAb7M.cjs.map +1 -0
- package/dist/config.cjs +9 -6
- package/dist/config.d.cts +62 -33
- package/dist/config.d.cts.map +1 -1
- package/dist/config.d.mts +62 -33
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +3 -5
- package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
- package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
- package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
- package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
- package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
- package/dist/deploy/sniffer-hooks.cjs +13 -7
- package/dist/deploy/sniffer-hooks.cjs.map +1 -1
- package/dist/deploy/sniffer-hooks.d.cts +1 -2
- package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
- package/dist/deploy/sniffer-hooks.d.mts +1 -2
- package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
- package/dist/deploy/sniffer-hooks.mjs +9 -2
- package/dist/deploy/sniffer-hooks.mjs.map +1 -1
- package/dist/deploy/sniffer-loader.cjs +16 -7
- package/dist/deploy/sniffer-loader.cjs.map +1 -1
- package/dist/deploy/sniffer-loader.d.cts +1 -1
- package/dist/deploy/sniffer-loader.d.mts +1 -1
- package/dist/deploy/sniffer-loader.mjs +13 -2
- package/dist/deploy/sniffer-loader.mjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +11 -11
- package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
- package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
- package/dist/deploy/sniffer-routes-worker.mjs +3 -3
- package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
- package/dist/deploy/sniffer-worker.cjs +15 -6
- package/dist/deploy/sniffer-worker.cjs.map +1 -1
- package/dist/deploy/sniffer-worker.d.cts +1 -3
- package/dist/deploy/sniffer-worker.d.cts.map +1 -1
- package/dist/deploy/sniffer-worker.d.mts +1 -3
- package/dist/deploy/sniffer-worker.d.mts.map +1 -1
- package/dist/deploy/sniffer-worker.mjs +15 -4
- package/dist/deploy/sniffer-worker.mjs.map +1 -1
- package/dist/{discover-DTmFeloL.cjs → discover-B0f_kuNN.cjs} +118 -66
- package/dist/discover-B0f_kuNN.cjs.map +1 -0
- package/dist/{discover-CAlFgYec.mjs → discover-BLhf7V_J.mjs} +67 -22
- package/dist/discover-BLhf7V_J.mjs.map +1 -0
- package/dist/{emit-CbcRolsa.cjs → emit-BdoPFjZf.cjs} +53 -36
- package/dist/emit-BdoPFjZf.cjs.map +1 -0
- package/dist/{emit-CiZS_5Ub.mjs → emit-Bzq7JsMP.mjs} +24 -6
- package/dist/emit-Bzq7JsMP.mjs.map +1 -0
- package/dist/github-BAr8WGkR.cjs +213 -0
- package/dist/github-BAr8WGkR.cjs.map +1 -0
- package/dist/github-D5MthUlR.mjs +213 -0
- package/dist/github-D5MthUlR.mjs.map +1 -0
- package/dist/{index-DCtipn2h.d.cts → index-B3PeGOQp.d.cts} +4 -23
- package/dist/index-B3PeGOQp.d.cts.map +1 -0
- package/dist/{index-BThUzEIp.d.mts → index-BOyaGcCm.d.mts} +4 -23
- package/dist/index-BOyaGcCm.d.mts.map +1 -0
- package/dist/index.cjs +7071 -4519
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +7117 -4586
- package/dist/index.mjs.map +1 -1
- package/dist/migrate-BVI3yqcE.mjs +736 -0
- package/dist/migrate-BVI3yqcE.mjs.map +1 -0
- package/dist/migrate-CFOUApUt.cjs +743 -0
- package/dist/migrate-CFOUApUt.cjs.map +1 -0
- package/dist/openapi.cjs +197 -8
- package/dist/openapi.cjs.map +1 -0
- package/dist/openapi.d.cts +47 -14
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +47 -14
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +191 -5
- package/dist/openapi.mjs.map +1 -0
- package/dist/ready-D8UXsP6q.mjs +516 -0
- package/dist/ready-D8UXsP6q.mjs.map +1 -0
- package/dist/ready-mcxamf73.cjs +563 -0
- package/dist/ready-mcxamf73.cjs.map +1 -0
- package/dist/reconcile/public.cjs +4 -4
- package/dist/reconcile/public.d.cts +27 -26
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +27 -26
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -4
- package/dist/{reconcile-CFs8C_1a.mjs → reconcile--I7V4Klj.mjs} +4 -7
- package/dist/reconcile--I7V4Klj.mjs.map +1 -0
- package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
- package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
- package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
- package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
- package/dist/storage-BzaUxmqe.mjs +124 -0
- package/dist/storage-BzaUxmqe.mjs.map +1 -0
- package/dist/storage-CSGoC3bK.cjs +152 -0
- package/dist/storage-CSGoC3bK.cjs.map +1 -0
- package/dist/store-DQgxT_WR.cjs +211 -0
- package/dist/store-DQgxT_WR.cjs.map +1 -0
- package/dist/store-DeGATCS-.mjs +182 -0
- package/dist/store-DeGATCS-.mjs.map +1 -0
- package/dist/types-0R124hrY.d.mts +6324 -0
- package/dist/types-0R124hrY.d.mts.map +1 -0
- package/dist/types-DfdYe31u.d.cts +6325 -0
- package/dist/types-DfdYe31u.d.cts.map +1 -0
- package/dist/vitest.cjs +65 -0
- package/dist/vitest.cjs.map +1 -0
- package/dist/vitest.d.cts +29 -0
- package/dist/vitest.d.cts.map +1 -0
- package/dist/vitest.d.mts +29 -0
- package/dist/vitest.d.mts.map +1 -0
- package/dist/vitest.mjs +65 -0
- package/dist/vitest.mjs.map +1 -0
- package/dist/workspace/index.cjs +3 -4
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -3
- package/dist/{credentials-G1JwBoXH.cjs → workspace-BIqeeqcR.cjs} +2248 -1809
- package/dist/workspace-BIqeeqcR.cjs.map +1 -0
- package/dist/{workspace-BFMrAKqI.mjs → workspace-DOmIhiau.mjs} +863 -952
- package/dist/workspace-DOmIhiau.mjs.map +1 -0
- package/dist/{credentials-BBIRJVp4.mjs → workspace-DwS1JK5u.mjs} +2114 -1706
- package/dist/workspace-DwS1JK5u.mjs.map +1 -0
- package/dist/{workspace-BcucjwvA.cjs → workspace-RYSYtHP7.cjs} +1032 -1098
- package/dist/workspace-RYSYtHP7.cjs.map +1 -0
- package/package.json +29 -20
- package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
- package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
- package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
- package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
- package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
- package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
- package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
- package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
- package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
- package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
- package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
- package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
- package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
- package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
- package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
- package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
- package/dist/bundler-BY1OmV1e.cjs.map +0 -1
- package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
- package/dist/chunk-Duj1WY3L.mjs +0 -7
- package/dist/config-C21ocYNd.cjs.map +0 -1
- package/dist/config-WRdsQYZK.mjs.map +0 -1
- package/dist/credentials-B5zRHdAl.mjs +0 -141
- package/dist/credentials-B5zRHdAl.mjs.map +0 -1
- package/dist/credentials-BBIRJVp4.mjs.map +0 -1
- package/dist/credentials-BapzjyV5.cjs +0 -195
- package/dist/credentials-BapzjyV5.cjs.map +0 -1
- package/dist/credentials-G1JwBoXH.cjs.map +0 -1
- package/dist/discover-CAlFgYec.mjs.map +0 -1
- package/dist/discover-DTmFeloL.cjs.map +0 -1
- package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
- package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
- package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
- package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
- package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
- package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
- package/dist/emit-CbcRolsa.cjs.map +0 -1
- package/dist/emit-CiZS_5Ub.mjs.map +0 -1
- package/dist/encryption-C6jaU0hE.cjs +0 -54
- package/dist/encryption-C6jaU0hE.cjs.map +0 -1
- package/dist/encryption-CHzzeR8a.cjs +0 -4
- package/dist/encryption-CQUncu7v.mjs +0 -3
- package/dist/encryption-D-abyhZx.mjs +0 -42
- package/dist/encryption-D-abyhZx.mjs.map +0 -1
- package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
- package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
- package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
- package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
- package/dist/generator-CNzBw7g5.cjs +0 -289
- package/dist/generator-CNzBw7g5.cjs.map +0 -1
- package/dist/generator-VE2JrFlY.mjs +0 -253
- package/dist/generator-VE2JrFlY.mjs.map +0 -1
- package/dist/index-BThUzEIp.d.mts.map +0 -1
- package/dist/index-DCtipn2h.d.cts.map +0 -1
- package/dist/openapi-CA0yJUTN.cjs.map +0 -1
- package/dist/openapi-kkQbsRVj.mjs.map +0 -1
- package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
- package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
- package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
- package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
- package/dist/openapi-react-query.cjs +0 -4
- package/dist/openapi-react-query.d.cts +0 -11
- package/dist/openapi-react-query.d.cts.map +0 -1
- package/dist/openapi-react-query.d.mts +0 -11
- package/dist/openapi-react-query.d.mts.map +0 -1
- package/dist/openapi-react-query.mjs +0 -4
- package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
- package/dist/reconcile-D0pimNiy.cjs.map +0 -1
- package/dist/setup-B5_oHHUj.cjs +0 -11
- package/dist/setup-Cm2UnAdh.cjs +0 -473
- package/dist/setup-Cm2UnAdh.cjs.map +0 -1
- package/dist/setup-DXvRLTZN.mjs +0 -443
- package/dist/setup-DXvRLTZN.mjs.map +0 -1
- package/dist/setup-ZijS4qeC.mjs +0 -11
- package/dist/storage-BJmzYxt8.cjs +0 -363
- package/dist/storage-BJmzYxt8.cjs.map +0 -1
- package/dist/storage-BM9hGpgv.cjs +0 -7
- package/dist/storage-Bi24WfoW.mjs +0 -297
- package/dist/storage-Bi24WfoW.mjs.map +0 -1
- package/dist/storage-CYlGwWTj.mjs +0 -3
- package/dist/sync-CmEuNZsB.mjs +0 -76
- package/dist/sync-CmEuNZsB.mjs.map +0 -1
- package/dist/sync-D306yOWu.cjs +0 -4
- package/dist/sync-SizaChmC.cjs +0 -93
- package/dist/sync-SizaChmC.cjs.map +0 -1
- package/dist/sync-hOqAWHR6.mjs +0 -3
- package/dist/types-BhIl-COG.d.cts +0 -2184
- package/dist/types-BhIl-COG.d.cts.map +0 -1
- package/dist/types-C-arnQ1r.d.mts +0 -2184
- package/dist/types-C-arnQ1r.d.mts.map +0 -1
- package/dist/workspace-BFMrAKqI.mjs.map +0 -1
- package/dist/workspace-BcucjwvA.cjs.map +0 -1
- package/dist/workspace-DdJss8I6.cjs +0 -9
- package/dist/workspace-k4l3rsFh.mjs +0 -8
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_discover = require("../discover-B0f_kuNN.cjs");
|
|
3
|
+
const require_emit = require("../emit-BdoPFjZf.cjs");
|
|
4
4
|
exports.MANIFEST_PATH = require_emit.MANIFEST_PATH;
|
|
5
5
|
exports.discover = require_discover.discover;
|
|
6
6
|
exports.isDeclarable = require_discover.isDeclarable;
|
|
7
7
|
exports.manifestModule = require_emit.manifestModule;
|
|
8
8
|
exports.withRoutes = require_emit.withRoutes;
|
|
9
|
-
exports.writeManifestModule = require_emit.writeManifestModule;
|
|
9
|
+
exports.writeManifestModule = require_emit.writeManifestModule;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as EmailBackend, t as CacheBackend } from "../types-DfdYe31u.cjs";
|
|
2
2
|
import { ConstructManifest, Declaration, RouteInfo } from "@geekmidas/manifest";
|
|
3
|
-
|
|
4
3
|
//#region src/reconcile/discover.d.ts
|
|
5
|
-
|
|
6
4
|
/** The construct face discovery needs: an id, and the ability to declare. */
|
|
7
5
|
interface Declarable {
|
|
8
6
|
id: string;
|
|
@@ -15,7 +13,7 @@ interface Declarable {
|
|
|
15
13
|
* `service` is still a construct, and requiring one would exclude the kinds that
|
|
16
14
|
* own no address.
|
|
17
15
|
*/
|
|
18
|
-
declare function isDeclarable(value: unknown): value is Declarable;
|
|
16
|
+
export declare function isDeclarable(value: unknown): value is Declarable;
|
|
19
17
|
interface DiscoverOptions {
|
|
20
18
|
/** The glob(s) to search. One pattern, not one per kind. */
|
|
21
19
|
patterns: string | readonly string[];
|
|
@@ -39,6 +37,18 @@ interface DiscoverOptions {
|
|
|
39
37
|
* caller, which wants the manifest and nothing else, is unchanged.
|
|
40
38
|
*/
|
|
41
39
|
sources?: Record<string, ConstructSource>;
|
|
40
|
+
/**
|
|
41
|
+
* Filled in, when provided, with the ids each owner's runnables declared an
|
|
42
|
+
* edge to — keyed by the surface an endpoint was built from, or the worker
|
|
43
|
+
* a cron or subscriber was.
|
|
44
|
+
*
|
|
45
|
+
* A runnable is not a declaration: a surface's endpoints are found by the
|
|
46
|
+
* glob, not listed by the surface, so its node says `endpoints: []` until a
|
|
47
|
+
* build folds the routes in. Anything deciding what an app's process reaches
|
|
48
|
+
* — which keys its container is given — needs those edges before any build,
|
|
49
|
+
* and discovery is already importing the files they are in.
|
|
50
|
+
*/
|
|
51
|
+
runnables?: Record<string, string[]>;
|
|
42
52
|
}
|
|
43
53
|
/** Where a construct was declared, and under what name. */
|
|
44
54
|
interface ConstructSource {
|
|
@@ -46,6 +56,13 @@ interface ConstructSource {
|
|
|
46
56
|
file: string;
|
|
47
57
|
/** The name it was exported as — what an import statement has to say. */
|
|
48
58
|
exportName: string;
|
|
59
|
+
/**
|
|
60
|
+
* The exported construct itself.
|
|
61
|
+
*
|
|
62
|
+
* What a declaration cannot say — whether it serves itself — the object can
|
|
63
|
+
* be asked, and discovery already imported it.
|
|
64
|
+
*/
|
|
65
|
+
construct: unknown;
|
|
49
66
|
}
|
|
50
67
|
/**
|
|
51
68
|
* Build the construct manifest for a project.
|
|
@@ -55,12 +72,11 @@ interface ConstructSource {
|
|
|
55
72
|
*
|
|
56
73
|
* @throws {DuplicateConstruct} when two exports claim one id.
|
|
57
74
|
*/
|
|
58
|
-
declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
|
|
59
|
-
/** Two constructs claiming one id. */
|
|
75
|
+
export declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
|
|
60
76
|
//#endregion
|
|
61
77
|
//#region src/reconcile/emit.d.ts
|
|
62
78
|
/** Where the build writes it, relative to the app root. */
|
|
63
|
-
declare const MANIFEST_PATH = ".gkm/manifest.ts";
|
|
79
|
+
export declare const MANIFEST_PATH = ".gkm/manifest.ts";
|
|
64
80
|
/**
|
|
65
81
|
* Fold the build's generated routes into the surface that serves them.
|
|
66
82
|
*
|
|
@@ -89,37 +105,22 @@ declare const MANIFEST_PATH = ".gkm/manifest.ts";
|
|
|
89
105
|
* document's contents depend on which `--provider` ran last. A manifest must not
|
|
90
106
|
* do that.
|
|
91
107
|
*/
|
|
92
|
-
declare function withRoutes(manifest: ConstructManifest, routes: readonly RouteInfo[], options: {
|
|
108
|
+
export declare function withRoutes(manifest: ConstructManifest, routes: readonly RouteInfo[], options: {
|
|
93
109
|
perRoute: boolean;
|
|
94
110
|
}): ConstructManifest;
|
|
95
|
-
/**
|
|
96
|
-
* Fold in the compute the build generated: functions, crons, queue workers and
|
|
97
|
-
* topic subscribers.
|
|
98
|
-
*
|
|
99
|
-
* All four are named by their *export*, the same way an endpoint's handler is —
|
|
100
|
-
* `CronGenerator` uses the export key as the name — so none of them can declare
|
|
101
|
-
* themselves and all of them are the build's to add. That is why a `Function`
|
|
102
|
-
* has no `declare()` and never will.
|
|
103
|
-
*
|
|
104
|
-
* A worker and a subscriber **nest** inside the queue or topic that triggers
|
|
105
|
-
* them, because position carries the trigger. A function and a cron are
|
|
106
|
-
* top-level, because nothing triggers them but a caller or a clock.
|
|
107
|
-
*/
|
|
108
|
-
|
|
109
111
|
/**
|
|
110
112
|
* The manifest as TypeScript source.
|
|
111
113
|
*
|
|
112
114
|
* Pure, so what gets written can be asserted without touching a filesystem.
|
|
113
115
|
*/
|
|
114
|
-
declare function manifestModule(manifest: ConstructManifest, backends?: Backends): string;
|
|
116
|
+
export declare function manifestModule(manifest: ConstructManifest, backends?: Backends): string;
|
|
115
117
|
/** Write it where the deploy config expects to import it from. */
|
|
116
|
-
declare function writeManifestModule(manifest: ConstructManifest, appRoot: string, backends?: Backends): Promise<string>;
|
|
118
|
+
export declare function writeManifestModule(manifest: ConstructManifest, appRoot: string, backends?: Backends): Promise<string>;
|
|
117
119
|
/** The choices that are deployment config rather than declaration. */
|
|
118
120
|
interface Backends {
|
|
119
121
|
cache?: CacheBackend;
|
|
120
122
|
email?: EmailBackend;
|
|
121
123
|
}
|
|
122
|
-
//# sourceMappingURL=emit.d.ts.map
|
|
123
124
|
//#endregion
|
|
124
|
-
export { DiscoverOptions
|
|
125
|
+
export type { DiscoverOptions };
|
|
125
126
|
//# sourceMappingURL=public.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.cts","names":[],"sources":["../../src/reconcile/discover.ts","../../src/reconcile/emit.ts"],"
|
|
1
|
+
{"version":3,"file":"public.d.cts","names":[],"sources":["../../src/reconcile/discover.ts","../../src/reconcile/emit.ts"],"mappings":";;;;UA8BU;EACT;EACA,WAAW;;;;;;;;;wBAUI,aAAa,iBAAiB,SAAS;UAYtC;;EAEhB;EACA;;;;;;;EAOA;;;;;;;;;;;;EAYA,UAAU,eAAe;;;;;;;;;;;;EAYzB,YAAY;;;UAII;;EAEhB;;EAEA;;;;;;;EAOA;;;;;;;;;;wBAWqB,SACrB,SAAS,kBACP,QAAQ;;;;qBC/EE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8BG,WACf,UAAU,mBACV,iBAAiB,aACjB;EAAW;IACT;;;;;;wBA2Ja,eACf,UAAU,mBACV,WAAU;;wBA8BW,oBACrB,UAAU,mBACV,iBACA,WAAU,WACR;;UAUc;EAChB,QAAQ;EACR,QAAQ"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as EmailBackend, t as CacheBackend } from "../types-0R124hrY.mjs";
|
|
2
2
|
import { ConstructManifest, Declaration, RouteInfo } from "@geekmidas/manifest";
|
|
3
|
-
|
|
4
3
|
//#region src/reconcile/discover.d.ts
|
|
5
|
-
|
|
6
4
|
/** The construct face discovery needs: an id, and the ability to declare. */
|
|
7
5
|
interface Declarable {
|
|
8
6
|
id: string;
|
|
@@ -15,7 +13,7 @@ interface Declarable {
|
|
|
15
13
|
* `service` is still a construct, and requiring one would exclude the kinds that
|
|
16
14
|
* own no address.
|
|
17
15
|
*/
|
|
18
|
-
declare function isDeclarable(value: unknown): value is Declarable;
|
|
16
|
+
export declare function isDeclarable(value: unknown): value is Declarable;
|
|
19
17
|
interface DiscoverOptions {
|
|
20
18
|
/** The glob(s) to search. One pattern, not one per kind. */
|
|
21
19
|
patterns: string | readonly string[];
|
|
@@ -39,6 +37,18 @@ interface DiscoverOptions {
|
|
|
39
37
|
* caller, which wants the manifest and nothing else, is unchanged.
|
|
40
38
|
*/
|
|
41
39
|
sources?: Record<string, ConstructSource>;
|
|
40
|
+
/**
|
|
41
|
+
* Filled in, when provided, with the ids each owner's runnables declared an
|
|
42
|
+
* edge to — keyed by the surface an endpoint was built from, or the worker
|
|
43
|
+
* a cron or subscriber was.
|
|
44
|
+
*
|
|
45
|
+
* A runnable is not a declaration: a surface's endpoints are found by the
|
|
46
|
+
* glob, not listed by the surface, so its node says `endpoints: []` until a
|
|
47
|
+
* build folds the routes in. Anything deciding what an app's process reaches
|
|
48
|
+
* — which keys its container is given — needs those edges before any build,
|
|
49
|
+
* and discovery is already importing the files they are in.
|
|
50
|
+
*/
|
|
51
|
+
runnables?: Record<string, string[]>;
|
|
42
52
|
}
|
|
43
53
|
/** Where a construct was declared, and under what name. */
|
|
44
54
|
interface ConstructSource {
|
|
@@ -46,6 +56,13 @@ interface ConstructSource {
|
|
|
46
56
|
file: string;
|
|
47
57
|
/** The name it was exported as — what an import statement has to say. */
|
|
48
58
|
exportName: string;
|
|
59
|
+
/**
|
|
60
|
+
* The exported construct itself.
|
|
61
|
+
*
|
|
62
|
+
* What a declaration cannot say — whether it serves itself — the object can
|
|
63
|
+
* be asked, and discovery already imported it.
|
|
64
|
+
*/
|
|
65
|
+
construct: unknown;
|
|
49
66
|
}
|
|
50
67
|
/**
|
|
51
68
|
* Build the construct manifest for a project.
|
|
@@ -55,12 +72,11 @@ interface ConstructSource {
|
|
|
55
72
|
*
|
|
56
73
|
* @throws {DuplicateConstruct} when two exports claim one id.
|
|
57
74
|
*/
|
|
58
|
-
declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
|
|
59
|
-
/** Two constructs claiming one id. */
|
|
75
|
+
export declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
|
|
60
76
|
//#endregion
|
|
61
77
|
//#region src/reconcile/emit.d.ts
|
|
62
78
|
/** Where the build writes it, relative to the app root. */
|
|
63
|
-
declare const MANIFEST_PATH = ".gkm/manifest.ts";
|
|
79
|
+
export declare const MANIFEST_PATH = ".gkm/manifest.ts";
|
|
64
80
|
/**
|
|
65
81
|
* Fold the build's generated routes into the surface that serves them.
|
|
66
82
|
*
|
|
@@ -89,37 +105,22 @@ declare const MANIFEST_PATH = ".gkm/manifest.ts";
|
|
|
89
105
|
* document's contents depend on which `--provider` ran last. A manifest must not
|
|
90
106
|
* do that.
|
|
91
107
|
*/
|
|
92
|
-
declare function withRoutes(manifest: ConstructManifest, routes: readonly RouteInfo[], options: {
|
|
108
|
+
export declare function withRoutes(manifest: ConstructManifest, routes: readonly RouteInfo[], options: {
|
|
93
109
|
perRoute: boolean;
|
|
94
110
|
}): ConstructManifest;
|
|
95
|
-
/**
|
|
96
|
-
* Fold in the compute the build generated: functions, crons, queue workers and
|
|
97
|
-
* topic subscribers.
|
|
98
|
-
*
|
|
99
|
-
* All four are named by their *export*, the same way an endpoint's handler is —
|
|
100
|
-
* `CronGenerator` uses the export key as the name — so none of them can declare
|
|
101
|
-
* themselves and all of them are the build's to add. That is why a `Function`
|
|
102
|
-
* has no `declare()` and never will.
|
|
103
|
-
*
|
|
104
|
-
* A worker and a subscriber **nest** inside the queue or topic that triggers
|
|
105
|
-
* them, because position carries the trigger. A function and a cron are
|
|
106
|
-
* top-level, because nothing triggers them but a caller or a clock.
|
|
107
|
-
*/
|
|
108
|
-
|
|
109
111
|
/**
|
|
110
112
|
* The manifest as TypeScript source.
|
|
111
113
|
*
|
|
112
114
|
* Pure, so what gets written can be asserted without touching a filesystem.
|
|
113
115
|
*/
|
|
114
|
-
declare function manifestModule(manifest: ConstructManifest, backends?: Backends): string;
|
|
116
|
+
export declare function manifestModule(manifest: ConstructManifest, backends?: Backends): string;
|
|
115
117
|
/** Write it where the deploy config expects to import it from. */
|
|
116
|
-
declare function writeManifestModule(manifest: ConstructManifest, appRoot: string, backends?: Backends): Promise<string>;
|
|
118
|
+
export declare function writeManifestModule(manifest: ConstructManifest, appRoot: string, backends?: Backends): Promise<string>;
|
|
117
119
|
/** The choices that are deployment config rather than declaration. */
|
|
118
120
|
interface Backends {
|
|
119
121
|
cache?: CacheBackend;
|
|
120
122
|
email?: EmailBackend;
|
|
121
123
|
}
|
|
122
|
-
//# sourceMappingURL=emit.d.ts.map
|
|
123
124
|
//#endregion
|
|
124
|
-
export { DiscoverOptions
|
|
125
|
+
export type { DiscoverOptions };
|
|
125
126
|
//# sourceMappingURL=public.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.mts","names":[],"sources":["../../src/reconcile/discover.ts","../../src/reconcile/emit.ts"],"
|
|
1
|
+
{"version":3,"file":"public.d.mts","names":[],"sources":["../../src/reconcile/discover.ts","../../src/reconcile/emit.ts"],"mappings":";;;;UA8BU;EACT;EACA,WAAW;;;;;;;;;wBAUI,aAAa,iBAAiB,SAAS;UAYtC;;EAEhB;EACA;;;;;;;EAOA;;;;;;;;;;;;EAYA,UAAU,eAAe;;;;;;;;;;;;EAYzB,YAAY;;;UAII;;EAEhB;;EAEA;;;;;;;EAOA;;;;;;;;;;wBAWqB,SACrB,SAAS,kBACP,QAAQ;;;;qBC/EE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8BG,WACf,UAAU,mBACV,iBAAiB,aACjB;EAAW;IACT;;;;;;wBA2Ja,eACf,UAAU,mBACV,WAAU;;wBA8BW,oBACrB,UAAU,mBACV,iBACA,WAAU,WACR;;UAUc;EAChB,QAAQ;EACR,QAAQ"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export { MANIFEST_PATH, discover, isDeclarable, manifestModule, withRoutes, writeManifestModule };
|
|
1
|
+
import { r as isDeclarable, t as discover } from "../discover-BLhf7V_J.mjs";
|
|
2
|
+
import { a as writeManifestModule, i as withRoutes, n as manifestModule, t as MANIFEST_PATH } from "../emit-Bzq7JsMP.mjs";
|
|
3
|
+
export { MANIFEST_PATH, discover, isDeclarable, manifestModule, withRoutes, writeManifestModule };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { generateFullstackCustomSecrets } from "./fullstack-secrets-D1o9-G5l.mjs";
|
|
3
|
-
|
|
1
|
+
import { t as generateFullstackCustomSecrets } from "./index.mjs";
|
|
4
2
|
//#region src/secrets/reconcile.ts
|
|
5
3
|
/**
|
|
6
4
|
* Reconcile missing custom secrets for a workspace.
|
|
@@ -12,8 +10,7 @@ import { generateFullstackCustomSecrets } from "./fullstack-secrets-D1o9-G5l.mjs
|
|
|
12
10
|
* @returns ReconcileResult if keys were added, null if secrets are up-to-date
|
|
13
11
|
*/
|
|
14
12
|
function reconcileMissingSecrets(secrets, workspace, containers = []) {
|
|
15
|
-
|
|
16
|
-
if (!isMultiApp) return null;
|
|
13
|
+
if (!(Object.keys(workspace.apps).length > 1)) return null;
|
|
17
14
|
const expectedCustom = generateFullstackCustomSecrets(workspace, containers);
|
|
18
15
|
const addedKeys = [];
|
|
19
16
|
const mergedCustom = { ...secrets.custom };
|
|
@@ -31,7 +28,7 @@ function reconcileMissingSecrets(secrets, workspace, containers = []) {
|
|
|
31
28
|
addedKeys
|
|
32
29
|
};
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
//#endregion
|
|
36
32
|
export { reconcileMissingSecrets };
|
|
37
|
-
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=reconcile--I7V4Klj.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile--I7V4Klj.mjs","names":[],"sources":["../src/secrets/reconcile.ts"],"sourcesContent":["import { generateFullstackCustomSecrets } from '../setup/fullstack-secrets.js';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\nimport type { StageSecrets } from './types.js';\n\nexport interface ReconcileResult {\n\t/** The updated secrets with missing keys backfilled */\n\tsecrets: StageSecrets;\n\t/** Keys that were added */\n\taddedKeys: string[];\n}\n\n/**\n * Reconcile missing custom secrets for a workspace.\n *\n * Compares current secrets against what generateFullstackCustomSecrets()\n * would produce and backfills any missing keys without overwriting\n * existing values.\n *\n * @returns ReconcileResult if keys were added, null if secrets are up-to-date\n */\nexport function reconcileMissingSecrets(\n\tsecrets: StageSecrets,\n\tworkspace: NormalizedWorkspace,\n\tcontainers: readonly string[] = [],\n): ReconcileResult | null {\n\tconst isMultiApp = Object.keys(workspace.apps).length > 1;\n\tif (!isMultiApp) {\n\t\treturn null;\n\t}\n\n\tconst expectedCustom = generateFullstackCustomSecrets(workspace, containers);\n\tconst addedKeys: string[] = [];\n\tconst mergedCustom = { ...secrets.custom };\n\n\tfor (const [key, value] of Object.entries(expectedCustom)) {\n\t\tif (!(key in mergedCustom)) {\n\t\t\tmergedCustom[key] = value;\n\t\t\taddedKeys.push(key);\n\t\t}\n\t}\n\n\tif (addedKeys.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tsecrets: {\n\t\t\t...secrets,\n\t\t\tupdatedAt: new Date().toISOString(),\n\t\t\tcustom: mergedCustom,\n\t\t},\n\t\taddedKeys,\n\t};\n}\n"],"mappings":";;;;;;;;;;;AAoBA,SAAgB,wBACf,SACA,WACA,aAAgC,CAAC,GACR;CAEzB,IAAI,EADe,OAAO,KAAK,UAAU,IAAI,CAAC,CAAC,SAAS,IAEvD,OAAO;CAGR,MAAM,iBAAiB,+BAA+B,WAAW,UAAU;CAC3E,MAAM,YAAsB,CAAC;CAC7B,MAAM,eAAe,EAAE,GAAG,QAAQ,OAAO;CAEzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,cAAc,GACvD,IAAI,EAAE,OAAO,eAAe;EAC3B,aAAa,OAAO;EACpB,UAAU,KAAK,GAAG;CACnB;CAGD,IAAI,UAAU,WAAW,GACxB,OAAO;CAGR,OAAO;EACN,SAAS;GACR,GAAG;GACH,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;GAClC,QAAQ;EACT;EACA;CACD;AACD"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
require(
|
|
2
|
-
const require_fullstack_secrets = require('./fullstack-secrets-C-GGohke.cjs');
|
|
3
|
-
|
|
1
|
+
const require_index = require("./index.cjs");
|
|
4
2
|
//#region src/secrets/reconcile.ts
|
|
5
3
|
/**
|
|
6
4
|
* Reconcile missing custom secrets for a workspace.
|
|
@@ -12,9 +10,8 @@ const require_fullstack_secrets = require('./fullstack-secrets-C-GGohke.cjs');
|
|
|
12
10
|
* @returns ReconcileResult if keys were added, null if secrets are up-to-date
|
|
13
11
|
*/
|
|
14
12
|
function reconcileMissingSecrets(secrets, workspace, containers = []) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const expectedCustom = require_fullstack_secrets.generateFullstackCustomSecrets(workspace, containers);
|
|
13
|
+
if (!(Object.keys(workspace.apps).length > 1)) return null;
|
|
14
|
+
const expectedCustom = require_index.generateFullstackCustomSecrets(workspace, containers);
|
|
18
15
|
const addedKeys = [];
|
|
19
16
|
const mergedCustom = { ...secrets.custom };
|
|
20
17
|
for (const [key, value] of Object.entries(expectedCustom)) if (!(key in mergedCustom)) {
|
|
@@ -31,7 +28,7 @@ function reconcileMissingSecrets(secrets, workspace, containers = []) {
|
|
|
31
28
|
addedKeys
|
|
32
29
|
};
|
|
33
30
|
}
|
|
34
|
-
|
|
35
31
|
//#endregion
|
|
36
32
|
exports.reconcileMissingSecrets = reconcileMissingSecrets;
|
|
37
|
-
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=reconcile-CuCQBa5-.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reconcile-CuCQBa5-.cjs","names":["generateFullstackCustomSecrets"],"sources":["../src/secrets/reconcile.ts"],"sourcesContent":["import { generateFullstackCustomSecrets } from '../setup/fullstack-secrets.js';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\nimport type { StageSecrets } from './types.js';\n\nexport interface ReconcileResult {\n\t/** The updated secrets with missing keys backfilled */\n\tsecrets: StageSecrets;\n\t/** Keys that were added */\n\taddedKeys: string[];\n}\n\n/**\n * Reconcile missing custom secrets for a workspace.\n *\n * Compares current secrets against what generateFullstackCustomSecrets()\n * would produce and backfills any missing keys without overwriting\n * existing values.\n *\n * @returns ReconcileResult if keys were added, null if secrets are up-to-date\n */\nexport function reconcileMissingSecrets(\n\tsecrets: StageSecrets,\n\tworkspace: NormalizedWorkspace,\n\tcontainers: readonly string[] = [],\n): ReconcileResult | null {\n\tconst isMultiApp = Object.keys(workspace.apps).length > 1;\n\tif (!isMultiApp) {\n\t\treturn null;\n\t}\n\n\tconst expectedCustom = generateFullstackCustomSecrets(workspace, containers);\n\tconst addedKeys: string[] = [];\n\tconst mergedCustom = { ...secrets.custom };\n\n\tfor (const [key, value] of Object.entries(expectedCustom)) {\n\t\tif (!(key in mergedCustom)) {\n\t\t\tmergedCustom[key] = value;\n\t\t\taddedKeys.push(key);\n\t\t}\n\t}\n\n\tif (addedKeys.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tsecrets: {\n\t\t\t...secrets,\n\t\t\tupdatedAt: new Date().toISOString(),\n\t\t\tcustom: mergedCustom,\n\t\t},\n\t\taddedKeys,\n\t};\n}\n"],"mappings":";;;;;;;;;;;AAoBA,SAAgB,wBACf,SACA,WACA,aAAgC,CAAC,GACR;CAEzB,IAAI,EADe,OAAO,KAAK,UAAU,IAAI,CAAC,CAAC,SAAS,IAEvD,OAAO;CAGR,MAAM,iBAAiBA,cAAAA,+BAA+B,WAAW,UAAU;CAC3E,MAAM,YAAsB,CAAC;CAC7B,MAAM,eAAe,EAAE,GAAG,QAAQ,OAAO;CAEzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,cAAc,GACvD,IAAI,EAAE,OAAO,eAAe;EAC3B,aAAa,OAAO;EACpB,UAAU,KAAK,GAAG;CACnB;CAGD,IAAI,UAAU,WAAW,GACxB,OAAO;CAGR,OAAO;EACN,SAAS;GACR,GAAG;GACH,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;GAClC,QAAQ;EACT;EACA;CACD;AACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __exportAll = (all, no_symbols) => {
|
|
5
|
+
let target = {};
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
return target;
|
|
12
|
+
};
|
|
13
|
+
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
14
|
+
//#endregion
|
|
15
|
+
export { __require as n, __exportAll as t };
|
|
@@ -1,10 +1,19 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __exportAll = (all, no_symbols) => {
|
|
9
|
+
let target = {};
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
15
|
+
return target;
|
|
16
|
+
};
|
|
8
17
|
var __copyProps = (to, from, except, desc) => {
|
|
9
18
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
19
|
key = keys[i];
|
|
@@ -15,16 +24,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
24
|
}
|
|
16
25
|
return to;
|
|
17
26
|
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
28
|
value: mod,
|
|
20
29
|
enumerable: true
|
|
21
30
|
}) : target, mod));
|
|
22
|
-
|
|
23
31
|
//#endregion
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
Object.defineProperty(exports, "__exportAll", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function() {
|
|
35
|
+
return __exportAll;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "__toESM", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function() {
|
|
41
|
+
return __toESM;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
|
|
2
|
+
//#region src/secrets/storage.ts
|
|
3
|
+
var storage_exports = /* @__PURE__ */ __exportAll({
|
|
4
|
+
initStageSecrets: () => initStageSecrets,
|
|
5
|
+
maskPassword: () => maskPassword,
|
|
6
|
+
toEmbeddableSecrets: () => toEmbeddableSecrets,
|
|
7
|
+
validateEnvironmentVariables: () => validateEnvironmentVariables,
|
|
8
|
+
withCustomSecret: () => withCustomSecret
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* Initialize an empty StageSecrets object for a stage.
|
|
12
|
+
*/
|
|
13
|
+
function initStageSecrets(stage) {
|
|
14
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
15
|
+
return {
|
|
16
|
+
stage,
|
|
17
|
+
createdAt: now,
|
|
18
|
+
updatedAt: now,
|
|
19
|
+
services: {},
|
|
20
|
+
urls: {},
|
|
21
|
+
custom: {}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Convert StageSecrets to embeddable format (flat key-value pairs).
|
|
26
|
+
* This is what gets encrypted and embedded in the bundle.
|
|
27
|
+
*/
|
|
28
|
+
function toEmbeddableSecrets(secrets) {
|
|
29
|
+
return {
|
|
30
|
+
...secrets.urls,
|
|
31
|
+
...secrets.custom,
|
|
32
|
+
...secrets.services.postgres && {
|
|
33
|
+
POSTGRES_USER: secrets.services.postgres.username,
|
|
34
|
+
POSTGRES_PASSWORD: secrets.services.postgres.password,
|
|
35
|
+
POSTGRES_DB: secrets.services.postgres.database ?? "app",
|
|
36
|
+
POSTGRES_HOST: secrets.services.postgres.host,
|
|
37
|
+
POSTGRES_PORT: String(secrets.services.postgres.port)
|
|
38
|
+
},
|
|
39
|
+
...secrets.services.redis && {
|
|
40
|
+
REDIS_PASSWORD: secrets.services.redis.password,
|
|
41
|
+
REDIS_HOST: secrets.services.redis.host,
|
|
42
|
+
REDIS_PORT: String(secrets.services.redis.port)
|
|
43
|
+
},
|
|
44
|
+
...secrets.services.minio && {
|
|
45
|
+
STORAGE_ACCESS_KEY_ID: secrets.services.minio.username,
|
|
46
|
+
STORAGE_SECRET_ACCESS_KEY: secrets.services.minio.password,
|
|
47
|
+
STORAGE_BUCKET: secrets.services.minio.bucket ?? "app",
|
|
48
|
+
STORAGE_REGION: "eu-west-1",
|
|
49
|
+
STORAGE_FORCE_PATH_STYLE: "true"
|
|
50
|
+
},
|
|
51
|
+
...secrets.services.mailpit && {
|
|
52
|
+
SMTP_HOST: secrets.services.mailpit.host,
|
|
53
|
+
SMTP_PORT: String(secrets.services.mailpit.port),
|
|
54
|
+
SMTP_USER: secrets.services.mailpit.username,
|
|
55
|
+
SMTP_PASS: secrets.services.mailpit.password,
|
|
56
|
+
SMTP_SECURE: "false",
|
|
57
|
+
MAIL_FROM: "noreply@localhost"
|
|
58
|
+
},
|
|
59
|
+
...secrets.services.localstack && {
|
|
60
|
+
AWS_ACCESS_KEY_ID: secrets.services.localstack.accessKeyId ?? secrets.services.localstack.username,
|
|
61
|
+
AWS_SECRET_ACCESS_KEY: secrets.services.localstack.password,
|
|
62
|
+
AWS_REGION: secrets.services.localstack.region ?? "us-east-1",
|
|
63
|
+
AWS_ENDPOINT_URL: `http://${secrets.services.localstack.host}:${secrets.services.localstack.port}`
|
|
64
|
+
},
|
|
65
|
+
...secrets.services.pgboss && {
|
|
66
|
+
PGBOSS_DB_USER: secrets.services.pgboss.username,
|
|
67
|
+
PGBOSS_DB_PASSWORD: secrets.services.pgboss.password
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/** The same secrets with one custom value set, and `updatedAt` moved on. */
|
|
72
|
+
function withCustomSecret(secrets, key, value) {
|
|
73
|
+
return {
|
|
74
|
+
...secrets,
|
|
75
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
76
|
+
custom: {
|
|
77
|
+
...secrets.custom,
|
|
78
|
+
[key]: value
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Mask a password for display (show first 4 and last 2 chars).
|
|
84
|
+
*/
|
|
85
|
+
function maskPassword(password) {
|
|
86
|
+
if (password.length <= 8) return "********";
|
|
87
|
+
return `${password.slice(0, 4)}${"*".repeat(password.length - 6)}${password.slice(-2)}`;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Validate that all required environment variables are present in secrets.
|
|
91
|
+
*
|
|
92
|
+
* @param requiredVars - Array of environment variable names required by the application
|
|
93
|
+
* @param secrets - Stage secrets to validate against
|
|
94
|
+
* @returns Validation result with missing and provided variables
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* const required = ['DATABASE_URL', 'API_KEY', 'JWT_SECRET'];
|
|
99
|
+
* const secrets = await secretsStoreFor(workspace, 'production').then((s) => s.read('production'));
|
|
100
|
+
* const result = validateEnvironmentVariables(required, secrets);
|
|
101
|
+
*
|
|
102
|
+
* if (!result.valid) {
|
|
103
|
+
* console.error(`Missing environment variables: ${result.missing.join(', ')}`);
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
function validateEnvironmentVariables(requiredVars, secrets) {
|
|
108
|
+
const embeddable = toEmbeddableSecrets(secrets);
|
|
109
|
+
const availableVars = new Set(Object.keys(embeddable));
|
|
110
|
+
const missing = [];
|
|
111
|
+
const provided = [];
|
|
112
|
+
for (const varName of requiredVars) if (availableVars.has(varName)) provided.push(varName);
|
|
113
|
+
else missing.push(varName);
|
|
114
|
+
return {
|
|
115
|
+
valid: missing.length === 0,
|
|
116
|
+
missing: missing.sort(),
|
|
117
|
+
provided: provided.sort(),
|
|
118
|
+
required: [...requiredVars].sort()
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
export { withCustomSecret as a, toEmbeddableSecrets as i, maskPassword as n, storage_exports as r, initStageSecrets as t };
|
|
123
|
+
|
|
124
|
+
//# sourceMappingURL=storage-BzaUxmqe.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage-BzaUxmqe.mjs","names":[],"sources":["../src/secrets/storage.ts"],"sourcesContent":["/**\n * What a stage's secrets are, independent of where they are kept: building\n * them, changing them, and handing them to a process. Where they are kept is a\n * {@link SecretsStore}'s business — see `secretsStoreFor`.\n */\n\nimport type { SecretsStore } from './store.js';\nimport type { EmbeddableSecrets, StageSecrets } from './types';\n\n/**\n * Initialize an empty StageSecrets object for a stage.\n */\nexport function initStageSecrets(stage: string): StageSecrets {\n\tconst now = new Date().toISOString();\n\treturn {\n\t\tstage,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now,\n\t\tservices: {},\n\t\turls: {},\n\t\tcustom: {},\n\t};\n}\n\n/**\n * Convert StageSecrets to embeddable format (flat key-value pairs).\n * This is what gets encrypted and embedded in the bundle.\n */\nexport function toEmbeddableSecrets(secrets: StageSecrets): EmbeddableSecrets {\n\treturn {\n\t\t...secrets.urls,\n\t\t...secrets.custom,\n\t\t// Also include individual service credentials if needed\n\t\t...(secrets.services.postgres && {\n\t\t\tPOSTGRES_USER: secrets.services.postgres.username,\n\t\t\tPOSTGRES_PASSWORD: secrets.services.postgres.password,\n\t\t\tPOSTGRES_DB: secrets.services.postgres.database ?? 'app',\n\t\t\tPOSTGRES_HOST: secrets.services.postgres.host,\n\t\t\tPOSTGRES_PORT: String(secrets.services.postgres.port),\n\t\t}),\n\t\t...(secrets.services.redis && {\n\t\t\tREDIS_PASSWORD: secrets.services.redis.password,\n\t\t\tREDIS_HOST: secrets.services.redis.host,\n\t\t\tREDIS_PORT: String(secrets.services.redis.port),\n\t\t}),\n\t\t...(secrets.services.minio && {\n\t\t\tSTORAGE_ACCESS_KEY_ID: secrets.services.minio.username,\n\t\t\tSTORAGE_SECRET_ACCESS_KEY: secrets.services.minio.password,\n\t\t\tSTORAGE_BUCKET: secrets.services.minio.bucket ?? 'app',\n\t\t\tSTORAGE_REGION: 'eu-west-1',\n\t\t\tSTORAGE_FORCE_PATH_STYLE: 'true',\n\t\t}),\n\t\t...(secrets.services.mailpit && {\n\t\t\tSMTP_HOST: secrets.services.mailpit.host,\n\t\t\tSMTP_PORT: String(secrets.services.mailpit.port),\n\t\t\tSMTP_USER: secrets.services.mailpit.username,\n\t\t\tSMTP_PASS: secrets.services.mailpit.password,\n\t\t\tSMTP_SECURE: 'false',\n\t\t\tMAIL_FROM: 'noreply@localhost',\n\t\t}),\n\t\t...(secrets.services.localstack && {\n\t\t\tAWS_ACCESS_KEY_ID:\n\t\t\t\tsecrets.services.localstack.accessKeyId ??\n\t\t\t\tsecrets.services.localstack.username,\n\t\t\tAWS_SECRET_ACCESS_KEY: secrets.services.localstack.password,\n\t\t\tAWS_REGION: secrets.services.localstack.region ?? 'us-east-1',\n\t\t\tAWS_ENDPOINT_URL: `http://${secrets.services.localstack.host}:${secrets.services.localstack.port}`,\n\t\t}),\n\t\t...(secrets.services.pgboss && {\n\t\t\tPGBOSS_DB_USER: secrets.services.pgboss.username,\n\t\t\tPGBOSS_DB_PASSWORD: secrets.services.pgboss.password,\n\t\t}),\n\t};\n}\n\n/** The same secrets with one custom value set, and `updatedAt` moved on. */\nexport function withCustomSecret(\n\tsecrets: StageSecrets,\n\tkey: string,\n\tvalue: string,\n): StageSecrets {\n\treturn {\n\t\t...secrets,\n\t\tupdatedAt: new Date().toISOString(),\n\t\tcustom: { ...secrets.custom, [key]: value },\n\t};\n}\n\n/**\n * Mask a password for display (show first 4 and last 2 chars).\n */\nexport function maskPassword(password: string): string {\n\tif (password.length <= 8) {\n\t\treturn '********';\n\t}\n\treturn `${password.slice(0, 4)}${'*'.repeat(password.length - 6)}${password.slice(-2)}`;\n}\n\n/**\n * Result of environment variable validation.\n */\nexport interface EnvValidationResult {\n\t/** Whether all required environment variables are present */\n\tvalid: boolean;\n\t/** List of missing environment variable names */\n\tmissing: string[];\n\t/** List of environment variables that are provided */\n\tprovided: string[];\n\t/** List of environment variables that were required */\n\trequired: string[];\n}\n\n/**\n * Validate that all required environment variables are present in secrets.\n *\n * @param requiredVars - Array of environment variable names required by the application\n * @param secrets - Stage secrets to validate against\n * @returns Validation result with missing and provided variables\n *\n * @example\n * ```typescript\n * const required = ['DATABASE_URL', 'API_KEY', 'JWT_SECRET'];\n * const secrets = await secretsStoreFor(workspace, 'production').then((s) => s.read('production'));\n * const result = validateEnvironmentVariables(required, secrets);\n *\n * if (!result.valid) {\n * console.error(`Missing environment variables: ${result.missing.join(', ')}`);\n * }\n * ```\n */\nexport function validateEnvironmentVariables(\n\trequiredVars: string[],\n\tsecrets: StageSecrets,\n): EnvValidationResult {\n\tconst embeddable = toEmbeddableSecrets(secrets);\n\tconst availableVars = new Set(Object.keys(embeddable));\n\n\tconst missing: string[] = [];\n\tconst provided: string[] = [];\n\n\tfor (const varName of requiredVars) {\n\t\tif (availableVars.has(varName)) {\n\t\t\tprovided.push(varName);\n\t\t} else {\n\t\t\tmissing.push(varName);\n\t\t}\n\t}\n\n\treturn {\n\t\tvalid: missing.length === 0,\n\t\tmissing: missing.sort(),\n\t\tprovided: provided.sort(),\n\t\trequired: [...requiredVars].sort(),\n\t};\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgB,iBAAiB,OAA6B;CAC7D,MAAM,uBAAM,IAAI,KAAK,EAAA,CAAE,YAAY;CACnC,OAAO;EACN;EACA,WAAW;EACX,WAAW;EACX,UAAU,CAAC;EACX,MAAM,CAAC;EACP,QAAQ,CAAC;CACV;AACD;;;;;AAMA,SAAgB,oBAAoB,SAA0C;CAC7E,OAAO;EACN,GAAG,QAAQ;EACX,GAAG,QAAQ;EAEX,GAAI,QAAQ,SAAS,YAAY;GAChC,eAAe,QAAQ,SAAS,SAAS;GACzC,mBAAmB,QAAQ,SAAS,SAAS;GAC7C,aAAa,QAAQ,SAAS,SAAS,YAAY;GACnD,eAAe,QAAQ,SAAS,SAAS;GACzC,eAAe,OAAO,QAAQ,SAAS,SAAS,IAAI;EACrD;EACA,GAAI,QAAQ,SAAS,SAAS;GAC7B,gBAAgB,QAAQ,SAAS,MAAM;GACvC,YAAY,QAAQ,SAAS,MAAM;GACnC,YAAY,OAAO,QAAQ,SAAS,MAAM,IAAI;EAC/C;EACA,GAAI,QAAQ,SAAS,SAAS;GAC7B,uBAAuB,QAAQ,SAAS,MAAM;GAC9C,2BAA2B,QAAQ,SAAS,MAAM;GAClD,gBAAgB,QAAQ,SAAS,MAAM,UAAU;GACjD,gBAAgB;GAChB,0BAA0B;EAC3B;EACA,GAAI,QAAQ,SAAS,WAAW;GAC/B,WAAW,QAAQ,SAAS,QAAQ;GACpC,WAAW,OAAO,QAAQ,SAAS,QAAQ,IAAI;GAC/C,WAAW,QAAQ,SAAS,QAAQ;GACpC,WAAW,QAAQ,SAAS,QAAQ;GACpC,aAAa;GACb,WAAW;EACZ;EACA,GAAI,QAAQ,SAAS,cAAc;GAClC,mBACC,QAAQ,SAAS,WAAW,eAC5B,QAAQ,SAAS,WAAW;GAC7B,uBAAuB,QAAQ,SAAS,WAAW;GACnD,YAAY,QAAQ,SAAS,WAAW,UAAU;GAClD,kBAAkB,UAAU,QAAQ,SAAS,WAAW,KAAK,GAAG,QAAQ,SAAS,WAAW;EAC7F;EACA,GAAI,QAAQ,SAAS,UAAU;GAC9B,gBAAgB,QAAQ,SAAS,OAAO;GACxC,oBAAoB,QAAQ,SAAS,OAAO;EAC7C;CACD;AACD;;AAGA,SAAgB,iBACf,SACA,KACA,OACe;CACf,OAAO;EACN,GAAG;EACH,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;EAClC,QAAQ;GAAE,GAAG,QAAQ;IAAS,MAAM;EAAM;CAC3C;AACD;;;;AAKA,SAAgB,aAAa,UAA0B;CACtD,IAAI,SAAS,UAAU,GACtB,OAAO;CAER,OAAO,GAAG,SAAS,MAAM,GAAG,CAAC,IAAI,IAAI,OAAO,SAAS,SAAS,CAAC,IAAI,SAAS,MAAM,EAAE;AACrF;;;;;;;;;;;;;;;;;;;AAkCA,SAAgB,6BACf,cACA,SACsB;CACtB,MAAM,aAAa,oBAAoB,OAAO;CAC9C,MAAM,gBAAgB,IAAI,IAAI,OAAO,KAAK,UAAU,CAAC;CAErD,MAAM,UAAoB,CAAC;CAC3B,MAAM,WAAqB,CAAC;CAE5B,KAAK,MAAM,WAAW,cACrB,IAAI,cAAc,IAAI,OAAO,GAC5B,SAAS,KAAK,OAAO;MAErB,QAAQ,KAAK,OAAO;CAItB,OAAO;EACN,OAAO,QAAQ,WAAW;EAC1B,SAAS,QAAQ,KAAK;EACtB,UAAU,SAAS,KAAK;EACxB,UAAU,CAAC,GAAG,YAAY,CAAC,CAAC,KAAK;CAClC;AACD"}
|