@wildo-ai/platform-config-lib 1.1.10 → 1.1.11
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/esm/_unimplemented/unimplemented-field-warning.d.ts +1 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.js +1 -1
- package/dist/esm/_unimplemented/unimplemented-field-warning.js.map +1 -1
- package/dist/esm/blueprint/anchored-region.d.ts +83 -0
- package/dist/esm/blueprint/anchored-region.d.ts.map +1 -0
- package/dist/esm/blueprint/anchored-region.js +263 -0
- package/dist/esm/blueprint/anchored-region.js.map +1 -0
- package/dist/esm/blueprint/blueprint.schemas.d.ts +689 -0
- package/dist/esm/blueprint/blueprint.schemas.d.ts.map +1 -0
- package/dist/esm/blueprint/blueprint.schemas.js +638 -0
- package/dist/esm/blueprint/blueprint.schemas.js.map +1 -0
- package/dist/esm/bootstrap/application-backend-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap-planner.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts +13 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js +6 -0
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +21 -3
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +14 -3
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +121 -0
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +129 -0
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.map +1 -1
- package/dist/esm/bootstrap/platform-store-preconnect.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-backing-service-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-policy.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-network-topology.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-platform-access.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-principal.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-response-integrity.d.ts +249 -0
- package/dist/esm/bootstrap/runtime-response-integrity.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-response-integrity.js +353 -0
- package/dist/esm/bootstrap/runtime-response-integrity.js.map +1 -0
- package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts +32 -0
- package/dist/esm/bootstrap/runtime-secret-env.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/runtime-secret-env.contracts.js +43 -0
- package/dist/esm/bootstrap/runtime-secret-env.contracts.js.map +1 -0
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
- package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts +51 -0
- package/dist/esm/canonical-json/rfc8785-canonical-json.d.ts.map +1 -0
- package/dist/esm/canonical-json/rfc8785-canonical-json.js +231 -0
- package/dist/esm/canonical-json/rfc8785-canonical-json.js.map +1 -0
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/key-management/approval-seal-verifier.d.ts +216 -0
- package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -0
- package/dist/esm/key-management/approval-seal-verifier.js +233 -0
- package/dist/esm/key-management/approval-seal-verifier.js.map +1 -0
- package/dist/esm/key-management/approval-seal.contracts.d.ts +131 -0
- package/dist/esm/key-management/approval-seal.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/approval-seal.contracts.js +115 -0
- package/dist/esm/key-management/approval-seal.contracts.js.map +1 -0
- package/dist/esm/key-management/data-key.contracts.d.ts +108 -0
- package/dist/esm/key-management/data-key.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/data-key.contracts.js +54 -0
- package/dist/esm/key-management/data-key.contracts.js.map +1 -0
- package/dist/esm/key-management/es256-jws.d.ts +60 -0
- package/dist/esm/key-management/es256-jws.d.ts.map +1 -0
- package/dist/esm/key-management/es256-jws.js +135 -0
- package/dist/esm/key-management/es256-jws.js.map +1 -0
- package/dist/esm/key-management/key-provider.spi.d.ts +151 -0
- package/dist/esm/key-management/key-provider.spi.d.ts.map +1 -0
- package/dist/esm/key-management/key-provider.spi.js +38 -0
- package/dist/esm/key-management/key-provider.spi.js.map +1 -0
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts +93 -0
- package/dist/esm/key-management/keyring-rotation.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/keyring-rotation.contracts.js +101 -0
- package/dist/esm/key-management/keyring-rotation.contracts.js.map +1 -0
- package/dist/esm/key-management/keyring-status.contracts.d.ts +66 -0
- package/dist/esm/key-management/keyring-status.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/keyring-status.contracts.js +45 -0
- package/dist/esm/key-management/keyring-status.contracts.js.map +1 -0
- package/dist/esm/key-management/signature-request.contracts.d.ts +95 -0
- package/dist/esm/key-management/signature-request.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/signature-request.contracts.js +96 -0
- package/dist/esm/key-management/signature-request.contracts.js.map +1 -0
- package/dist/esm/key-management/signing-log-export.contracts.d.ts +216 -0
- package/dist/esm/key-management/signing-log-export.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/signing-log-export.contracts.js +268 -0
- package/dist/esm/key-management/signing-log-export.contracts.js.map +1 -0
- package/dist/esm/key-management/vault-custody.contracts.d.ts +55 -0
- package/dist/esm/key-management/vault-custody.contracts.d.ts.map +1 -0
- package/dist/esm/key-management/vault-custody.contracts.js +88 -0
- package/dist/esm/key-management/vault-custody.contracts.js.map +1 -0
- package/dist/esm/lockfile/file-lock-hold.d.ts.map +1 -1
- package/dist/esm/lockfile/lockfile-io.d.ts +7 -9
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
- package/dist/esm/lockfile/lockfile-io.js +23 -22
- package/dist/esm/lockfile/lockfile-io.js.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts +17 -14
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js +9 -9
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts +26 -2
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js +27 -2
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
- package/dist/esm/project-config/application-public-pricing-catalog.loader.d.ts.map +1 -1
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js +9 -2
- package/dist/esm/project-config/application-public-pricing-catalog.loader.js.map +1 -1
- package/dist/esm/project-config/application-served-public-documents.loader.d.ts +26 -0
- package/dist/esm/project-config/application-served-public-documents.loader.d.ts.map +1 -0
- package/dist/esm/project-config/application-served-public-documents.loader.js +78 -0
- package/dist/esm/project-config/application-served-public-documents.loader.js.map +1 -0
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +236 -15
- package/dist/esm/project-config/define-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.js +104 -91
- package/dist/esm/project-config/define-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/define-minion-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts +133 -3
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +170 -19
- package/dist/esm/project-config/define-saas-config.js.map +1 -1
- package/dist/esm/project-config/define-worker-config.d.ts.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -1
- package/dist/esm/project-config/hosted-infra-env-config.js +3 -0
- package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -1
- package/dist/esm/project-config/index.d.ts +3 -0
- package/dist/esm/project-config/index.d.ts.map +1 -1
- package/dist/esm/project-config/index.js +3 -0
- package/dist/esm/project-config/index.js.map +1 -1
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/npm-version-range.d.ts.map +1 -1
- package/dist/esm/project-config/npm-version-range.js +39 -16
- package/dist/esm/project-config/npm-version-range.js.map +1 -1
- package/dist/esm/project-config/owning-package-tsconfig.d.ts +15 -0
- package/dist/esm/project-config/owning-package-tsconfig.d.ts.map +1 -0
- package/dist/esm/project-config/owning-package-tsconfig.js +29 -0
- package/dist/esm/project-config/owning-package-tsconfig.js.map +1 -0
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts +4 -4
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +13 -9
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +32 -3
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +67 -13
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/application-creation-verification.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/application-modules.utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-service-servability.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/cdn.example.d.ts.map +1 -1
- package/dist/esm/project-config/shared/cdn.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.d.ts +4 -5
- package/dist/esm/project-config/shared/csp-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-defaults.js +4 -5
- package/dist/esm/project-config/shared/csp-defaults.js.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.d.ts +1 -2
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js +1 -2
- package/dist/esm/project-config/shared/csp.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/data-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +6 -0
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +8 -1
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-service.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts +1 -0
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js +3 -0
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +4 -0
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.js +6 -2
- package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
- package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts +250 -0
- package/dist/esm/project-config/shared/platform-key-management.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/platform-key-management.schemas.js +194 -0
- package/dist/esm/project-config/shared/platform-key-management.schemas.js.map +1 -0
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/schema-version.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/service-definitions.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/index.d.ts +1 -0
- package/dist/esm/registry/index.d.ts.map +1 -1
- package/dist/esm/registry/index.js +1 -0
- package/dist/esm/registry/index.js.map +1 -1
- package/dist/esm/registry/local-checkout-source.d.ts +22 -2
- package/dist/esm/registry/local-checkout-source.d.ts.map +1 -1
- package/dist/esm/registry/local-checkout-source.js +66 -3
- package/dist/esm/registry/local-checkout-source.js.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts +10 -0
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.d.ts +23 -0
- package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.d.ts +336 -18
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.js +245 -19
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
- package/dist/esm/registry/module-search.schemas.d.ts +2 -0
- package/dist/esm/registry/module-search.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-search.schemas.js +14 -1
- package/dist/esm/registry/module-search.schemas.js.map +1 -1
- package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-errors.d.ts +22 -2
- package/dist/esm/registry/registry-errors.d.ts.map +1 -1
- package/dist/esm/registry/registry-errors.js +28 -2
- package/dist/esm/registry/registry-errors.js.map +1 -1
- package/dist/esm/registry/registry-keys.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.d.ts +5 -0
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
- package/dist/esm/registry/registry-url-resolution.d.ts +72 -0
- package/dist/esm/registry/registry-url-resolution.d.ts.map +1 -0
- package/dist/esm/registry/registry-url-resolution.js +157 -0
- package/dist/esm/registry/registry-url-resolution.js.map +1 -0
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts +55 -0
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js +53 -0
- package/dist/esm/schemas/framework-secrets.schemas.js.map +1 -1
- package/dist/esm/schemas/platform-application-config.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-application-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/platform-config.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/application-subject-manifest.d.ts.map +1 -1
- package/dist/esm/workspace-scope/index.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* writer.
|
|
4
4
|
*
|
|
5
5
|
* The envelope mirrors the existing companion-owned lockfile model:
|
|
6
|
-
* `{ schemaVersion,
|
|
6
|
+
* `{ schemaVersion, sections }`. Each subsystem owns a
|
|
7
7
|
* named section under `sections`; the envelope never promotes subsystem
|
|
8
8
|
* data to top-level keys.
|
|
9
9
|
*
|
|
@@ -641,6 +641,11 @@ export declare const SaasLockfileKnownSectionsSchema: z.ZodObject<{
|
|
|
641
641
|
serviceKey: z.ZodString;
|
|
642
642
|
path: z.ZodString;
|
|
643
643
|
}, z.core.$strict>>;
|
|
644
|
+
augments: z.ZodOptional<z.ZodString>;
|
|
645
|
+
vendorPins: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
646
|
+
heldVendorPins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
647
|
+
onlyBuiltDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
648
|
+
heldOnlyBuiltDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
644
649
|
}, z.core.$strict>>;
|
|
645
650
|
}, z.core.$strict>>;
|
|
646
651
|
}, z.core.$strict>>>;
|
|
@@ -705,10 +710,16 @@ export type SaasLockfileKnownSections = z.infer<typeof SaasLockfileKnownSections
|
|
|
705
710
|
* sections they know and preserve unknown section payloads as `unknown`.
|
|
706
711
|
* This keeps a provider-only tool from accidentally deleting `i18n` or
|
|
707
712
|
* module-registry state.
|
|
713
|
+
*
|
|
714
|
+
* The envelope carries NO timestamp, like npm's, pnpm's, Cargo's and Yarn's lockfiles: the file is
|
|
715
|
+
* committed, git already records when it changed, and a wall clock in it made equal content unequal
|
|
716
|
+
* bytes. It held a `generatedAt` until 2026-10-01, re-stamped on every write, so a `wildo registry
|
|
717
|
+
* add` + `remove` round trip that restored every section still left a diff, and two branches that
|
|
718
|
+
* each touched the lockfile always conflicted on that line (#1765). Read a file through
|
|
719
|
+
* {@link withoutRetiredLockfileEnvelopeKeys} so one written before the change still parses.
|
|
708
720
|
*/
|
|
709
721
|
export declare const SaasLockfileEnvelopeSchema: z.ZodObject<{
|
|
710
722
|
schemaVersion: z.ZodLiteral<2>;
|
|
711
|
-
generatedAt: z.ZodString;
|
|
712
723
|
sections: z.ZodObject<{
|
|
713
724
|
providers: z.ZodOptional<z.ZodObject<{
|
|
714
725
|
runtimeScopes: z.ZodObject<{
|
|
@@ -889,6 +900,11 @@ export declare const SaasLockfileEnvelopeSchema: z.ZodObject<{
|
|
|
889
900
|
serviceKey: z.ZodString;
|
|
890
901
|
path: z.ZodString;
|
|
891
902
|
}, z.core.$strict>>;
|
|
903
|
+
augments: z.ZodOptional<z.ZodString>;
|
|
904
|
+
vendorPins: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
905
|
+
heldVendorPins: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
906
|
+
onlyBuiltDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
907
|
+
heldOnlyBuiltDependencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
892
908
|
}, z.core.$strict>>;
|
|
893
909
|
}, z.core.$strict>>;
|
|
894
910
|
}, z.core.$strict>>>;
|
|
@@ -947,5 +963,13 @@ export declare const SaasLockfileEnvelopeSchema: z.ZodObject<{
|
|
|
947
963
|
}, z.core.$catchall<z.ZodUnknown>>;
|
|
948
964
|
}, z.core.$strict>;
|
|
949
965
|
export type SaasLockfileEnvelope = z.infer<typeof SaasLockfileEnvelopeSchema>;
|
|
966
|
+
/**
|
|
967
|
+
* The parsed JSON of a lockfile, without the keys the envelope no longer carries. Apply it before
|
|
968
|
+
* {@link SaasLockfileEnvelopeSchema} (which is strict) to anything read from disk: every lockfile
|
|
969
|
+
* written before 2026-10-01 carries a `generatedAt`, and refusing those would refuse every existing
|
|
970
|
+
* application's lockfile. Anything that is not a plain object is returned as it is, for the schema
|
|
971
|
+
* to refuse.
|
|
972
|
+
*/
|
|
973
|
+
export declare function withoutRetiredLockfileEnvelopeKeys(json: unknown): unknown;
|
|
950
974
|
export {};
|
|
951
975
|
//# sourceMappingURL=wildo-saas-lock.shared.schemas.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wildo-saas-lock.shared.schemas.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"wildo-saas-lock.shared.schemas.d.ts","sourceRoot":"","sources":["../../../../src/lockfile/wildo-saas-lock.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,EAEL,aAAa,EACd,MAAM,kDAAkD,CAAC;AAY1D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;uBAKG;;;;;wBAKD,4IAA4I;;;;;;;;;;;oBAf9I;;;uBAGG;;oBAEH;;;;;uBAKG;;;;;wBAKD,4IAA4I;;;;;;;;;;;oBAf9I;;;uBAGG;;oBAEH;;;;;uBAKG;;;;;wBAKD,4IAA4I;;;;;;;;;;;oBAf9I;;;uBAGG;;oBAEH;;;;;uBAKG;;;;;wBAKD,4IAA4I;;;;;YA8B9I;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkFH,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAK9E;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAOzE"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* writer.
|
|
4
4
|
*
|
|
5
5
|
* The envelope mirrors the existing companion-owned lockfile model:
|
|
6
|
-
* `{ schemaVersion,
|
|
6
|
+
* `{ schemaVersion, sections }`. Each subsystem owns a
|
|
7
7
|
* named section under `sections`; the envelope never promotes subsystem
|
|
8
8
|
* data to top-level keys.
|
|
9
9
|
*
|
|
@@ -133,10 +133,35 @@ export const SaasLockfileKnownSectionsSchema = z.object({
|
|
|
133
133
|
* sections they know and preserve unknown section payloads as `unknown`.
|
|
134
134
|
* This keeps a provider-only tool from accidentally deleting `i18n` or
|
|
135
135
|
* module-registry state.
|
|
136
|
+
*
|
|
137
|
+
* The envelope carries NO timestamp, like npm's, pnpm's, Cargo's and Yarn's lockfiles: the file is
|
|
138
|
+
* committed, git already records when it changed, and a wall clock in it made equal content unequal
|
|
139
|
+
* bytes. It held a `generatedAt` until 2026-10-01, re-stamped on every write, so a `wildo registry
|
|
140
|
+
* add` + `remove` round trip that restored every section still left a diff, and two branches that
|
|
141
|
+
* each touched the lockfile always conflicted on that line (#1765). Read a file through
|
|
142
|
+
* {@link withoutRetiredLockfileEnvelopeKeys} so one written before the change still parses.
|
|
136
143
|
*/
|
|
137
144
|
export const SaasLockfileEnvelopeSchema = z.strictObject({
|
|
138
145
|
schemaVersion: z.literal(2),
|
|
139
|
-
generatedAt: z.string().datetime({ offset: true }),
|
|
140
146
|
sections: SaasLockfileKnownSectionsSchema,
|
|
141
147
|
});
|
|
148
|
+
/** Top-level keys earlier envelopes carried. A reader drops them; the next write leaves them out. */
|
|
149
|
+
const RETIRED_LOCKFILE_ENVELOPE_KEYS = ['generatedAt'];
|
|
150
|
+
/**
|
|
151
|
+
* The parsed JSON of a lockfile, without the keys the envelope no longer carries. Apply it before
|
|
152
|
+
* {@link SaasLockfileEnvelopeSchema} (which is strict) to anything read from disk: every lockfile
|
|
153
|
+
* written before 2026-10-01 carries a `generatedAt`, and refusing those would refuse every existing
|
|
154
|
+
* application's lockfile. Anything that is not a plain object is returned as it is, for the schema
|
|
155
|
+
* to refuse.
|
|
156
|
+
*/
|
|
157
|
+
export function withoutRetiredLockfileEnvelopeKeys(json) {
|
|
158
|
+
if (json === null || typeof json !== 'object' || Array.isArray(json))
|
|
159
|
+
return json;
|
|
160
|
+
const kept = {};
|
|
161
|
+
for (const [key, value] of Object.entries(json)) {
|
|
162
|
+
if (!RETIRED_LOCKFILE_ENVELOPE_KEYS.includes(key))
|
|
163
|
+
kept[key] = value;
|
|
164
|
+
}
|
|
165
|
+
return kept;
|
|
166
|
+
}
|
|
142
167
|
//# sourceMappingURL=wildo-saas-lock.shared.schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wildo-saas-lock.shared.schemas.js","sourceRoot":"","sources":["../../../../src/lockfile/wildo-saas-lock.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sCAAsC,EA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AC,cAAc,CAAC,EAAE,0CAA0C,CAAC,QAAQ,EAAE;KACxF,CAAC,CAAC,MAAM,EAAE;CACZ,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3D,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,kCAAkC,CAAC;CACvE,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,SAAS,EAAE,kCAAkC,CAAC,QAAQ,EAAE;IACxD,OAAO,EAAE,gCAAgC,CAAC,QAAQ,EAAE;IACpD,KAAK,EAAE,8BAA8B,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;AAGzB;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC;IACvD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClD,QAAQ,EAAE,+BAA+B;CAC1C,CAAC,CAAC","sourcesContent":["/**\n * Canonical `wildo-saas.lock.json` envelope shared by every lockfile\n * writer.\n *\n * The envelope mirrors the existing companion-owned lockfile model:\n * `{ schemaVersion, generatedAt, sections }`. Each subsystem owns a\n * named section under `sections`; the envelope never promotes subsystem\n * data to top-level keys.\n *\n * Reserved section names:\n * - `i18n`: companion labelling/translation state.\n * - `providers`: provider-registration lock section.\n * - `modules`: module-registry lock section.\n * - `infra`: infra-provider planning lock section (per-environment\n * InfraCapability → InfraProvider selection + plan-contribution\n * digest). See `infra-provider-planner.md` for the design.\n */\n\nimport { z } from 'zod';\nimport { ExternalProvider_ExchangeProtocol_Kind } from '@wildo-ai/external-connectors-models';\nimport { EngineCapability } from '@wildo-ai/saas-models';\nimport { RegistryModulesLockSectionSchema } from '../registry/lockfile-modules-section.schemas';\nimport {\n InfraCapability,\n InfraProvider,\n} from '../project-config/shared/infra-providers.schemas';\n\nconst ProviderCapabilityLockValueSchema = z.string().regex(\n /^(?:[A-Z][A-Z0-9_]*(?:\\.[A-Z][A-Z0-9_]*)?|[a-z][a-z0-9]*(?:-[a-z0-9]+)*)$/,\n 'providerCapabilities must use built-in uppercase or app custom kebab-case literals',\n);\n\nconst ProviderProtocolLockValueSchema = z.union([\n z.enum(ExternalProvider_ExchangeProtocol_Kind),\n z.string().regex(/^[A-Z][A-Z0-9_]*$/, 'protocols must use known external protocol literals or backend protocol constants'),\n]);\n\n/**\n * Per-facet, per-provider locked entry. Recorded once per `(facet, ref)`.\n *\n * NEVER includes secret values. `secretsContractDigest` only digests the\n * shape of the contract: env-var names, required-ness, and descriptions.\n */\nexport const SaasLockfileProviderEntrySchema = z.strictObject({\n ref: z.string(),\n digest: z.string(),\n engineCapabilities: z.array(z.enum(EngineCapability)).default([]),\n providerCapabilities: z.array(ProviderCapabilityLockValueSchema),\n protocols: z.array(ProviderProtocolLockValueSchema),\n secretsContractDigest: z.string(),\n /**\n * The BASE ref whose connection this provider spends (#1725), present only when it is another ref — a member of\n * a declared `providers.sharedConnections` entry. Absent for every undeclared ref, which is its own connection.\n */\n connectionRef: z.string().min(1).optional(),\n /**\n * The augmentations the application opted into for this provider (#1672): third-party packages whose\n * operations run on this provider's grant. Recorded per package with its INSTALLED version and a digest of\n * the operation ids it adds, so a lock diff shows third-party code arriving, being upgraded, or changing what\n * it adds. Absent when nothing augments the provider.\n */\n augmentations: z.array(z.strictObject({\n packageName: z.string().min(1),\n packageVersion: z.string().min(1),\n operationIdsDigest: z.string().min(1),\n /** A digest of the vendor scopes it requires (#1671) — a new scope is a new thing a person may be asked to consent to. Absent when none. */\n requiredScopesDigest: z.string().min(1).optional(),\n })).optional(),\n});\nexport type SaasLockfileProviderEntry = z.infer<typeof SaasLockfileProviderEntrySchema>;\n\n/**\n * `sections.providers`: provider lock records keyed by runtime scope and\n * provider ref. Runtime scopes mirror `defineSaaSProviders({ scopes })`.\n */\nexport const SaasLockfileRuntimeScopesProvidersSchema = z.strictObject({\n backend: z.record(z.string(), SaasLockfileProviderEntrySchema).optional(),\n companion: z.record(z.string(), SaasLockfileProviderEntrySchema).optional(),\n frontendServices: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n workers: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n minions: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n});\nexport type SaasLockfileRuntimeScopesProviders = z.infer<typeof SaasLockfileRuntimeScopesProvidersSchema>;\n\nexport const SaasLockfileProvidersSectionSchema = z.strictObject({\n runtimeScopes: SaasLockfileRuntimeScopesProvidersSchema,\n /**\n * The packages from outside the names discovery walks by itself that `providers.packages` admitted (#1676), each\n * with its INSTALLED version, sorted by name. Recorded so a lock diff shows third-party code entering provider\n * discovery, or being upgraded. Absent when the application lists none.\n */\n admittedPackages: z.array(z.strictObject({\n packageName: z.string().min(1),\n packageVersion: z.string().min(1).optional(),\n })).optional(),\n});\nexport type SaasLockfileProvidersSection = z.infer<typeof SaasLockfileProvidersSectionSchema>;\n\n/**\n * `sections.infra`: infra-provider lock records keyed by environment\n * name and `InfraCapability`. Captures which `InfraProvider` was\n * selected for a capability in a given environment and the digest of\n * its `plan()` contribution at that time. Drift between authored\n * `wildo.infra.<env>.config.ts` and the lockfile fails CI (future\n * `wildo lock --check` slice).\n *\n * Decomposition is per-environment first (then capability) because\n * `wildo.infra.<env>.config.ts` is per-env: cross-env diffs read more\n * naturally as \"env A provides QUEUE via X, env B provides QUEUE via\n * Y\" than as \"QUEUE is provided by X in env A and Y in env B\".\n */\nconst SaasLockfileInfraCapabilitySelectionSchema = z.strictObject({\n provider: z.enum(InfraProvider),\n providerSelectedAt: z.string().datetime({ offset: true }),\n planContributionDigest: z.string(),\n});\nexport type SaasLockfileInfraCapabilitySelection = z.infer<\n typeof SaasLockfileInfraCapabilitySelectionSchema\n>;\n\n/**\n * Per-environment capability map. Capabilities are sparse — an env\n * only declares the capabilities its app actually selects, so each\n * `InfraCapability` slot is `.optional()`. This mirrors the pattern\n * used by `BackingServicesEnvConfigSchema` (in\n * `../project-config/shared/backing-services.schemas.ts`).\n */\nconst SaasLockfileInfraEnvironmentSchema = z.strictObject({\n capabilities: z.object({\n [InfraCapability.DOCUMENT_DATABASE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.RELATIONAL_DATABASE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.AUDIT_LOG_STORAGE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.OBJECT_STORAGE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.ANTIVIRUS_SCANNING]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.QUEUING_SYSTEM]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.CACHE_MANAGER]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.METRICS_TELEMETRY]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.BACKUP_MANAGER]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n }).strict(),\n});\nexport type SaasLockfileInfraEnvironment = z.infer<typeof SaasLockfileInfraEnvironmentSchema>;\n\nexport const SaasLockfileInfraSectionSchema = z.strictObject({\n environments: z.record(z.string(), SaasLockfileInfraEnvironmentSchema),\n});\nexport type SaasLockfileInfraSection = z.infer<typeof SaasLockfileInfraSectionSchema>;\n\nexport const SaasLockfileKnownSectionsSchema = z.object({\n providers: SaasLockfileProvidersSectionSchema.optional(),\n modules: RegistryModulesLockSectionSchema.optional(),\n infra: SaasLockfileInfraSectionSchema.optional(),\n}).catchall(z.unknown());\nexport type SaasLockfileKnownSections = z.infer<typeof SaasLockfileKnownSectionsSchema>;\n\n/**\n * Top-level lockfile envelope.\n *\n * Forward compatibility lives in `sections`: readers validate the\n * sections they know and preserve unknown section payloads as `unknown`.\n * This keeps a provider-only tool from accidentally deleting `i18n` or\n * module-registry state.\n */\nexport const SaasLockfileEnvelopeSchema = z.strictObject({\n schemaVersion: z.literal(2),\n generatedAt: z.string().datetime({ offset: true }),\n sections: SaasLockfileKnownSectionsSchema,\n});\nexport type SaasLockfileEnvelope = z.infer<typeof SaasLockfileEnvelopeSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"wildo-saas-lock.shared.schemas.js","sourceRoot":"","sources":["../../../../src/lockfile/wildo-saas-lock.shared.schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sCAAsC,EAAE,MAAM,sCAAsC,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AAChG,OAAO,EACL,eAAe,EACf,aAAa,GACd,MAAM,kDAAkD,CAAC;AAE1D,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CACxD,2EAA2E,EAC3E,oFAAoF,CACrF,CAAC;AAEF,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC;IAC9C,CAAC,CAAC,IAAI,CAAC,sCAAsC,CAAC;IAC9C,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,EAAE,mFAAmF,CAAC;CAC3H,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC5D,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,MAAM,EAAE,CAAC,CAA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AE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,QAAQ,EAAE,+BAA+B;CAC1C,CAAC,CAAC;AAGH,qGAAqG;AACrG,MAAM,8BAA8B,GAAsB,CAAC,aAAa,CAAC,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,UAAU,kCAAkC,CAAC,IAAa;IAC9D,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAClF,MAAM,IAAI,GAA4B,EAAE,CAAC;IACzC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,IAAI,CAAC,8BAA8B,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACvE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * Canonical `wildo-saas.lock.json` envelope shared by every lockfile\n * writer.\n *\n * The envelope mirrors the existing companion-owned lockfile model:\n * `{ schemaVersion, sections }`. Each subsystem owns a\n * named section under `sections`; the envelope never promotes subsystem\n * data to top-level keys.\n *\n * Reserved section names:\n * - `i18n`: companion labelling/translation state.\n * - `providers`: provider-registration lock section.\n * - `modules`: module-registry lock section.\n * - `infra`: infra-provider planning lock section (per-environment\n * InfraCapability → InfraProvider selection + plan-contribution\n * digest). See `infra-provider-planner.md` for the design.\n */\n\nimport { z } from 'zod';\nimport { ExternalProvider_ExchangeProtocol_Kind } from '@wildo-ai/external-connectors-models';\nimport { EngineCapability } from '@wildo-ai/saas-models';\nimport { RegistryModulesLockSectionSchema } from '../registry/lockfile-modules-section.schemas';\nimport {\n InfraCapability,\n InfraProvider,\n} from '../project-config/shared/infra-providers.schemas';\n\nconst ProviderCapabilityLockValueSchema = z.string().regex(\n /^(?:[A-Z][A-Z0-9_]*(?:\\.[A-Z][A-Z0-9_]*)?|[a-z][a-z0-9]*(?:-[a-z0-9]+)*)$/,\n 'providerCapabilities must use built-in uppercase or app custom kebab-case literals',\n);\n\nconst ProviderProtocolLockValueSchema = z.union([\n z.enum(ExternalProvider_ExchangeProtocol_Kind),\n z.string().regex(/^[A-Z][A-Z0-9_]*$/, 'protocols must use known external protocol literals or backend protocol constants'),\n]);\n\n/**\n * Per-facet, per-provider locked entry. Recorded once per `(facet, ref)`.\n *\n * NEVER includes secret values. `secretsContractDigest` only digests the\n * shape of the contract: env-var names, required-ness, and descriptions.\n */\nexport const SaasLockfileProviderEntrySchema = z.strictObject({\n ref: z.string(),\n digest: z.string(),\n engineCapabilities: z.array(z.enum(EngineCapability)).default([]),\n providerCapabilities: z.array(ProviderCapabilityLockValueSchema),\n protocols: z.array(ProviderProtocolLockValueSchema),\n secretsContractDigest: z.string(),\n /**\n * The BASE ref whose connection this provider spends (#1725), present only when it is another ref — a member of\n * a declared `providers.sharedConnections` entry. Absent for every undeclared ref, which is its own connection.\n */\n connectionRef: z.string().min(1).optional(),\n /**\n * The augmentations the application opted into for this provider (#1672): third-party packages whose\n * operations run on this provider's grant. Recorded per package with its INSTALLED version and a digest of\n * the operation ids it adds, so a lock diff shows third-party code arriving, being upgraded, or changing what\n * it adds. Absent when nothing augments the provider.\n */\n augmentations: z.array(z.strictObject({\n packageName: z.string().min(1),\n packageVersion: z.string().min(1),\n operationIdsDigest: z.string().min(1),\n /** A digest of the vendor scopes it requires (#1671) — a new scope is a new thing a person may be asked to consent to. Absent when none. */\n requiredScopesDigest: z.string().min(1).optional(),\n })).optional(),\n});\nexport type SaasLockfileProviderEntry = z.infer<typeof SaasLockfileProviderEntrySchema>;\n\n/**\n * `sections.providers`: provider lock records keyed by runtime scope and\n * provider ref. Runtime scopes mirror `defineSaaSProviders({ scopes })`.\n */\nexport const SaasLockfileRuntimeScopesProvidersSchema = z.strictObject({\n backend: z.record(z.string(), SaasLockfileProviderEntrySchema).optional(),\n companion: z.record(z.string(), SaasLockfileProviderEntrySchema).optional(),\n frontendServices: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n workers: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n minions: z.record(\n z.string(),\n z.record(z.string(), SaasLockfileProviderEntrySchema),\n ).optional(),\n});\nexport type SaasLockfileRuntimeScopesProviders = z.infer<typeof SaasLockfileRuntimeScopesProvidersSchema>;\n\nexport const SaasLockfileProvidersSectionSchema = z.strictObject({\n runtimeScopes: SaasLockfileRuntimeScopesProvidersSchema,\n /**\n * The packages from outside the names discovery walks by itself that `providers.packages` admitted (#1676), each\n * with its INSTALLED version, sorted by name. Recorded so a lock diff shows third-party code entering provider\n * discovery, or being upgraded. Absent when the application lists none.\n */\n admittedPackages: z.array(z.strictObject({\n packageName: z.string().min(1),\n packageVersion: z.string().min(1).optional(),\n })).optional(),\n});\nexport type SaasLockfileProvidersSection = z.infer<typeof SaasLockfileProvidersSectionSchema>;\n\n/**\n * `sections.infra`: infra-provider lock records keyed by environment\n * name and `InfraCapability`. Captures which `InfraProvider` was\n * selected for a capability in a given environment and the digest of\n * its `plan()` contribution at that time. Drift between authored\n * `wildo.infra.<env>.config.ts` and the lockfile fails CI (future\n * `wildo lock --check` slice).\n *\n * Decomposition is per-environment first (then capability) because\n * `wildo.infra.<env>.config.ts` is per-env: cross-env diffs read more\n * naturally as \"env A provides QUEUE via X, env B provides QUEUE via\n * Y\" than as \"QUEUE is provided by X in env A and Y in env B\".\n */\nconst SaasLockfileInfraCapabilitySelectionSchema = z.strictObject({\n provider: z.enum(InfraProvider),\n providerSelectedAt: z.string().datetime({ offset: true }),\n planContributionDigest: z.string(),\n});\nexport type SaasLockfileInfraCapabilitySelection = z.infer<\n typeof SaasLockfileInfraCapabilitySelectionSchema\n>;\n\n/**\n * Per-environment capability map. Capabilities are sparse — an env\n * only declares the capabilities its app actually selects, so each\n * `InfraCapability` slot is `.optional()`. This mirrors the pattern\n * used by `BackingServicesEnvConfigSchema` (in\n * `../project-config/shared/backing-services.schemas.ts`).\n */\nconst SaasLockfileInfraEnvironmentSchema = z.strictObject({\n capabilities: z.object({\n [InfraCapability.DOCUMENT_DATABASE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.RELATIONAL_DATABASE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.AUDIT_LOG_STORAGE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.OBJECT_STORAGE]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.ANTIVIRUS_SCANNING]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.QUEUING_SYSTEM]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.CACHE_MANAGER]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.METRICS_TELEMETRY]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n [InfraCapability.BACKUP_MANAGER]: SaasLockfileInfraCapabilitySelectionSchema.optional(),\n }).strict(),\n});\nexport type SaasLockfileInfraEnvironment = z.infer<typeof SaasLockfileInfraEnvironmentSchema>;\n\nexport const SaasLockfileInfraSectionSchema = z.strictObject({\n environments: z.record(z.string(), SaasLockfileInfraEnvironmentSchema),\n});\nexport type SaasLockfileInfraSection = z.infer<typeof SaasLockfileInfraSectionSchema>;\n\nexport const SaasLockfileKnownSectionsSchema = z.object({\n providers: SaasLockfileProvidersSectionSchema.optional(),\n modules: RegistryModulesLockSectionSchema.optional(),\n infra: SaasLockfileInfraSectionSchema.optional(),\n}).catchall(z.unknown());\nexport type SaasLockfileKnownSections = z.infer<typeof SaasLockfileKnownSectionsSchema>;\n\n/**\n * Top-level lockfile envelope.\n *\n * Forward compatibility lives in `sections`: readers validate the\n * sections they know and preserve unknown section payloads as `unknown`.\n * This keeps a provider-only tool from accidentally deleting `i18n` or\n * module-registry state.\n *\n * The envelope carries NO timestamp, like npm's, pnpm's, Cargo's and Yarn's lockfiles: the file is\n * committed, git already records when it changed, and a wall clock in it made equal content unequal\n * bytes. It held a `generatedAt` until 2026-10-01, re-stamped on every write, so a `wildo registry\n * add` + `remove` round trip that restored every section still left a diff, and two branches that\n * each touched the lockfile always conflicted on that line (#1765). Read a file through\n * {@link withoutRetiredLockfileEnvelopeKeys} so one written before the change still parses.\n */\nexport const SaasLockfileEnvelopeSchema = z.strictObject({\n schemaVersion: z.literal(2),\n sections: SaasLockfileKnownSectionsSchema,\n});\nexport type SaasLockfileEnvelope = z.infer<typeof SaasLockfileEnvelopeSchema>;\n\n/** Top-level keys earlier envelopes carried. A reader drops them; the next write leaves them out. */\nconst RETIRED_LOCKFILE_ENVELOPE_KEYS: readonly string[] = ['generatedAt'];\n\n/**\n * The parsed JSON of a lockfile, without the keys the envelope no longer carries. Apply it before\n * {@link SaasLockfileEnvelopeSchema} (which is strict) to anything read from disk: every lockfile\n * written before 2026-10-01 carries a `generatedAt`, and refusing those would refuse every existing\n * application's lockfile. Anything that is not a plain object is returned as it is, for the schema\n * to refuse.\n */\nexport function withoutRetiredLockfileEnvelopeKeys(json: unknown): unknown {\n if (json === null || typeof json !== 'object' || Array.isArray(json)) return json;\n const kept: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(json)) {\n if (!RETIRED_LOCKFILE_ENVELOPE_KEYS.includes(key)) kept[key] = value;\n }\n return kept;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-public-pricing-catalog.loader.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"application-public-pricing-catalog.loader.d.ts","sourceRoot":"","sources":["../../../../src/project-config/application-public-pricing-catalog.loader.ts"],"names":[],"mappings":"AA8BA,OAAO,EAAmD,KAAK,oBAAoB,EAAyB,MAAM,uBAAuB,CAAC;AAE1I,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAI5D,uGAAuG;AACvG,eAAO,MAAM,6BAA6B,WAAW,CAAC;AAEtD,MAAM,WAAW,wCAAwC;IACvD,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;IACxD,yFAAyF;IACzF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAsB,mCAAmC,CAAC,KAAK,EAAE,wCAAwC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAiCxI"}
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
* ## Why it reads SOURCE
|
|
13
13
|
*
|
|
14
14
|
* Through the ONE door the dev companion and the CLI already open — the shared library's `./companion`
|
|
15
|
-
* entry, resolved with `moduleResolution: 'framework-source'` and evaluated by `loadConfig` (jiti)
|
|
15
|
+
* entry, resolved with `moduleResolution: 'framework-source'` and evaluated by `loadConfig` (jiti) with a fresh module
|
|
16
|
+
* cache (see the call below for why the cache is never shared). A
|
|
16
17
|
* website image builds only the website (`pnpm --filter ./website run build`), so the shared library's
|
|
17
18
|
* `dist` does not exist there; and where it does exist, a dist older than its source is a price the site
|
|
18
19
|
* would advertise after the catalogue changed. Measured on Wonder Todos: the whole shared graph loads
|
|
@@ -41,7 +42,13 @@ export async function loadApplicationPublicPricingCatalog(input) {
|
|
|
41
42
|
registerStaticAssetImportNoop();
|
|
42
43
|
let modules;
|
|
43
44
|
try {
|
|
44
|
-
|
|
45
|
+
// A FRESH module graph, evaluated against the `zod` this load receives. In a process that has already loaded the
|
|
46
|
+
// application through another jiti load — `wildo website audit` loads the site's context (its saas config) before
|
|
47
|
+
// the structured data that reads this catalogue — the shared cache served `@wildo-ai/zod-decorators` as already
|
|
48
|
+
// evaluated, patched onto ANOTHER `zod` instance, and the shared library's schemas failed with
|
|
49
|
+
// `z.literal(...).systemEnum is not a function` (#2598). Fresh is also what this loader is for: the catalogue as
|
|
50
|
+
// the source states it now, never a graph some earlier load of this process evaluated.
|
|
51
|
+
const companionExports = await loadConfig(entryPath, { freshModuleCache: true });
|
|
45
52
|
if (typeof companionExports.loadSharedModules !== 'function') {
|
|
46
53
|
throw new Error(`its default export has no loadSharedModules() function`);
|
|
47
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-public-pricing-catalog.loader.js","sourceRoot":"","sources":["../../../../src/project-config/application-public-pricing-catalog.loader.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"application-public-pricing-catalog.loader.js","sourceRoot":"","sources":["../../../../src/project-config/application-public-pricing-catalog.loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAoD,MAAM,uBAAuB,CAAC;AAG1I,OAAO,EAAE,UAAU,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE3E,uGAAuG;AACvG,MAAM,CAAC,MAAM,6BAA6B,GAAG,QAAQ,CAAC;AAUtD,MAAM,CAAC,KAAK,UAAU,mCAAmC,CAAC,KAA+C;IACvG,MAAM,OAAO,GAAG,KAAK,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,6BAA6B,CAAC,CAAC;IAC5E,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;IAEhD,MAAM,WAAW,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,gCAAgC,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACrH,mGAAmG;IACnG,6BAA6B,EAAE,CAAC;IAEhC,IAAI,OAAoC,CAAC;IACzC,IAAI,CAAC;QACH,iHAAiH;QACjH,kHAAkH;QAClH,gHAAgH;QAChH,+FAA+F;QAC/F,iHAAiH;QACjH,uFAAuF;QACvF,MAAM,gBAAgB,GAAG,MAAM,UAAU,CAA4D,SAAS,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5I,IAAI,OAAO,gBAAgB,CAAC,iBAAiB,KAAK,UAAU,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,GAAG,MAAM,gBAAgB,CAAC,iBAAiB,EAAE,CAAC;IACvD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,sDAAsD,SAAS,6DAA6D;cACxH,+DAA+D,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAChG,CAAC;IACJ,CAAC;IAED,OAAO,0BAA0B,CAC/B,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC,EAC5D,KAAK,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,CAC1E,CAAC;AACJ,CAAC","sourcesContent":["/**\n * `loadApplicationPublicPricingCatalog` — the application's billing catalogue, as its public pricing\n * surfaces may state it, read at BUILD time from the application's shared library (#1835).\n *\n * ## The one source\n *\n * The catalogue an application sells is the `productDefinitions` its shared modules declare — the same\n * array the backend's catalogue sync pushes to the billing provider. A public website that advertises\n * prices must read that array, not a copy: before this, every generated site re-typed its prices, and\n * Wonder Todos' site published a tier its own catalogue does not sell.\n *\n * ## Why it reads SOURCE\n *\n * Through the ONE door the dev companion and the CLI already open — the shared library's `./companion`\n * entry, resolved with `moduleResolution: 'framework-source'` and evaluated by `loadConfig` (jiti) with a fresh module\n * cache (see the call below for why the cache is never shared). A\n * website image builds only the website (`pnpm --filter ./website run build`), so the shared library's\n * `dist` does not exist there; and where it does exist, a dist older than its source is a price the site\n * would advertise after the catalogue changed. Measured on Wonder Todos: the whole shared graph loads\n * from source in about ten seconds cold and 2.3 seconds warm, once per build, only for the pages that ask.\n *\n * ## ABSENT vs FAILED\n *\n * An application that declares no shared library has no catalogue, and gets an empty one. A shared\n * library that cannot be LOADED is not \"no plans\" — publishing an empty pricing page, or one whose\n * structured data offers nothing, would be a false statement about what the application sells — so it\n * throws, and the build stops with the reason.\n */\nimport { resolve as resolvePath } from 'node:path';\n\nimport { derivePublicPricingCatalog, describeCaughtError, type PublicPricingCatalog, type SharedSaaSModule } from '@wildo-ai/saas-models';\n\nimport type { WildoSaasConfig } from './define-saas-config';\nimport { loadConfig, resolvePackageCompanionEntryPath } from './loader';\nimport { registerStaticAssetImportNoop } from './static-asset-import-noop';\n\n/** The library id the dev companion reads shared modules from, and the one every scaffold declares. */\nexport const APPLICATION_SHARED_LIBRARY_ID = 'shared';\n\nexport interface LoadApplicationPublicPricingCatalogInput {\n /** The application root (the directory holding `wildo.saas.config.ts`). */\n readonly saasRoot: string;\n readonly saasConfig: Pick<WildoSaasConfig, 'libraries'>;\n /** Keep only plans this scope may subscribe to (a `ResourcePrimaryScope` wire value). */\n readonly targetScope?: string;\n}\n\nexport async function loadApplicationPublicPricingCatalog(input: LoadApplicationPublicPricingCatalogInput): Promise<PublicPricingCatalog> {\n const library = input.saasConfig.libraries?.[APPLICATION_SHARED_LIBRARY_ID];\n if (library === undefined) return { plans: [] };\n\n const packageRoot = resolvePath(input.saasRoot, library.path);\n const entryPath = resolvePackageCompanionEntryPath(packageRoot, undefined, { moduleResolution: 'framework-source' });\n // The shared graph reaches frontend presets that import stylesheets; Node cannot execute a `.css`.\n registerStaticAssetImportNoop();\n\n let modules: readonly SharedSaaSModule[];\n try {\n // A FRESH module graph, evaluated against the `zod` this load receives. In a process that has already loaded the\n // application through another jiti load — `wildo website audit` loads the site's context (its saas config) before\n // the structured data that reads this catalogue — the shared cache served `@wildo-ai/zod-decorators` as already\n // evaluated, patched onto ANOTHER `zod` instance, and the shared library's schemas failed with\n // `z.literal(...).systemEnum is not a function` (#2598). Fresh is also what this loader is for: the catalogue as\n // the source states it now, never a graph some earlier load of this process evaluated.\n const companionExports = await loadConfig<{ loadSharedModules?: () => Promise<SharedSaaSModule[]> }>(entryPath, { freshModuleCache: true });\n if (typeof companionExports.loadSharedModules !== 'function') {\n throw new Error(`its default export has no loadSharedModules() function`);\n }\n modules = await companionExports.loadSharedModules();\n } catch (error) {\n throw new Error(\n `Could not load the application's shared library at ${entryPath}, so the plans its pricing surfaces advertise are unknown. `\n + `Refusing to state an empty catalogue in their place. Cause: ${describeCaughtError(error)}`,\n );\n }\n\n return derivePublicPricingCatalog(\n modules.flatMap((module) => module.productDefinitions ?? []),\n input.targetScope === undefined ? {} : { targetScope: input.targetScope },\n );\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PUBLIC_GOVERNED_DOCUMENT_REFS, resolveServedPublicGovernedDocumentPath, type PublicGovernedDocumentRefName } from '@wildo-ai/saas-models';
|
|
2
|
+
import type { WildoSaasConfig } from './define-saas-config';
|
|
3
|
+
/** A public governed document's ref (`PUBLIC_GOVERNED_DOCUMENT_REFS` value), e.g. `document:public.privacy-notice`. */
|
|
4
|
+
export type ServedPublicGovernedDocumentRef = (typeof PUBLIC_GOVERNED_DOCUMENT_REFS)[PublicGovernedDocumentRefName];
|
|
5
|
+
/** The `compliance` section the served reading takes, exactly as `resolveServedPublicGovernedDocumentPath` does. */
|
|
6
|
+
export type ServedPublicGovernedDocumentCompliance = Parameters<typeof resolveServedPublicGovernedDocumentPath>[0];
|
|
7
|
+
/**
|
|
8
|
+
* The public governed documents the application serves at `at`, in `PUBLIC_GOVERNED_DOCUMENT_REFS` order.
|
|
9
|
+
*
|
|
10
|
+
* PURE, and total over the public documents: a document added to that vocabulary is answered for by every build without
|
|
11
|
+
* an edit here. Each answer is `resolveServedPublicGovernedDocumentPath`'s, never a literal path or a second reading of
|
|
12
|
+
* releases, drafts and the approval gate.
|
|
13
|
+
*/
|
|
14
|
+
export declare function deriveServedPublicGovernedDocumentRefs(compliance: ServedPublicGovernedDocumentCompliance, at: string): ServedPublicGovernedDocumentRef[];
|
|
15
|
+
export interface LoadApplicationServedPublicGovernedDocumentsInput {
|
|
16
|
+
/** The application root (the directory holding `wildo.saas.config.ts`). */
|
|
17
|
+
readonly saasRoot: string;
|
|
18
|
+
readonly saasConfig: Pick<WildoSaasConfig, 'services'>;
|
|
19
|
+
/**
|
|
20
|
+
* The instant the answer is for, as an ISO string. Defaults to now: a static site states what was served when it
|
|
21
|
+
* was BUILT, so a release that comes into force later is linked from the next build.
|
|
22
|
+
*/
|
|
23
|
+
readonly at?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function loadApplicationServedPublicGovernedDocuments(input: LoadApplicationServedPublicGovernedDocumentsInput): Promise<ServedPublicGovernedDocumentRef[] | undefined>;
|
|
26
|
+
//# sourceMappingURL=application-served-public-documents.loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-served-public-documents.loader.d.ts","sourceRoot":"","sources":["../../../../src/project-config/application-served-public-documents.loader.ts"],"names":[],"mappings":"AAwCA,OAAO,EACL,6BAA6B,EAE7B,uCAAuC,EACvC,KAAK,6BAA6B,EACnC,MAAM,uBAAuB,CAAC;AAG/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D,uHAAuH;AACvH,MAAM,MAAM,+BAA+B,GAAG,CAAC,OAAO,6BAA6B,CAAC,CAAC,6BAA6B,CAAC,CAAC;AAEpH,oHAAoH;AACpH,MAAM,MAAM,sCAAsC,GAAG,UAAU,CAAC,OAAO,uCAAuC,CAAC,CAAC,CAAC,CAAC,CAAC;AAKnH;;;;;;GAMG;AACH,wBAAgB,sCAAsC,CACpD,UAAU,EAAE,sCAAsC,EAClD,EAAE,EAAE,MAAM,GACT,+BAA+B,EAAE,CAGnC;AAED,MAAM,WAAW,iDAAiD;IAChE,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;IACvD;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,4CAA4C,CAChE,KAAK,EAAE,iDAAiD,GACvD,OAAO,CAAC,+BAA+B,EAAE,GAAG,SAAS,CAAC,CA2BxD"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `loadApplicationServedPublicGovernedDocuments` — which of the application's PUBLIC governed documents (its privacy
|
|
3
|
+
* notice, its service terms) the application's own pages serve, read at BUILD time from its backend configuration
|
|
4
|
+
* (#2987).
|
|
5
|
+
*
|
|
6
|
+
* ## Why a surface outside the application needs this
|
|
7
|
+
*
|
|
8
|
+
* The application links `/privacy` and `/terms` only while the page would render the document
|
|
9
|
+
* (`resolveServedPublicGovernedDocumentPath`, #2976): a link that lands on "unavailable" is offered as the place the
|
|
10
|
+
* information is and informs nobody. A generated marketing site's footer links the same pages on the application's
|
|
11
|
+
* origin, and before this it linked both always. The site cannot read the application's configuration in the browser,
|
|
12
|
+
* so the answer is computed here, at build time, and forwarded as plain data — the way `legalNoticeOwed` already is.
|
|
13
|
+
*
|
|
14
|
+
* ## Why it reads the BACKEND configuration, and not the generated documents module alone
|
|
15
|
+
*
|
|
16
|
+
* Whether a document is served depends on two members of `compliance`: `publicDocuments` (written by
|
|
17
|
+
* `wildo config document-releases` into a generated module) and `governedDocumentApprovalGate`, which the application
|
|
18
|
+
* authors in `saas-config.backend.ts`. The gate is ONE switch for every surface that shows a governed document
|
|
19
|
+
* (`requiresApprovedGovernedDocuments`), so reading the generated module alone would let the site link a draft the
|
|
20
|
+
* armed page withholds. The configuration the running application reads is the only object carrying both, so it is
|
|
21
|
+
* the one this loads, from SOURCE through `loadConfig` (jiti) with a fresh module graph, as
|
|
22
|
+
* `loadApplicationPublicPricingCatalog` does for the shared library and for the same reasons (a website image builds
|
|
23
|
+
* only the website, and #2598's shared-cache `zod` clash).
|
|
24
|
+
*
|
|
25
|
+
* Cost, measured on Wonder Todos (2026-10-20): about 7–12 s of CPU per evaluation, paid once per website build process
|
|
26
|
+
* that loads the site context.
|
|
27
|
+
*
|
|
28
|
+
* ## ABSENT vs FAILED
|
|
29
|
+
*
|
|
30
|
+
* - No backend service, or no `src/saas-config.backend.ts` under it: the loader cannot read what decides the answer, so
|
|
31
|
+
* it returns `undefined` and the site keeps linking every public document, as it did before. Dropping a privacy
|
|
32
|
+
* link the application may well serve is the worse error of the two. A DECLARED backend whose configuration file is
|
|
33
|
+
* missing (a website image that copied only the website) also warns, so that case is not mistaken for "no backend".
|
|
34
|
+
* - A backend configuration that cannot be LOADED throws, naming the cause: stating that nothing is served would be a
|
|
35
|
+
* guess about a legal page. What to do then is the caller's decision; the website's site-context loader warns and
|
|
36
|
+
* keeps every link.
|
|
37
|
+
*/
|
|
38
|
+
import { existsSync } from 'node:fs';
|
|
39
|
+
import { join, resolve as resolvePath } from 'node:path';
|
|
40
|
+
import { PUBLIC_GOVERNED_DOCUMENT_REFS, describeCaughtError, resolveServedPublicGovernedDocumentPath, } from '@wildo-ai/saas-models';
|
|
41
|
+
import { selectPrimaryBackendService } from '../bootstrap/runtime-topology.contracts.js';
|
|
42
|
+
import { loadConfig } from './loader.js';
|
|
43
|
+
/** The backend configuration's source, under the primary backend service's directory. */
|
|
44
|
+
const BACKEND_CONFIGURATION_SOURCE_RELATIVE_PATH = join('src', 'saas-config.backend.ts');
|
|
45
|
+
/**
|
|
46
|
+
* The public governed documents the application serves at `at`, in `PUBLIC_GOVERNED_DOCUMENT_REFS` order.
|
|
47
|
+
*
|
|
48
|
+
* PURE, and total over the public documents: a document added to that vocabulary is answered for by every build without
|
|
49
|
+
* an edit here. Each answer is `resolveServedPublicGovernedDocumentPath`'s, never a literal path or a second reading of
|
|
50
|
+
* releases, drafts and the approval gate.
|
|
51
|
+
*/
|
|
52
|
+
export function deriveServedPublicGovernedDocumentRefs(compliance, at) {
|
|
53
|
+
return Object.values(PUBLIC_GOVERNED_DOCUMENT_REFS).filter((documentRef) => resolveServedPublicGovernedDocumentPath(compliance, documentRef, at) !== undefined);
|
|
54
|
+
}
|
|
55
|
+
export async function loadApplicationServedPublicGovernedDocuments(input) {
|
|
56
|
+
// The backend is the service with no `frontendType`, chosen by the rule the website's local origins use.
|
|
57
|
+
const backend = selectPrimaryBackendService(Object.entries(input.saasConfig.services)
|
|
58
|
+
.filter(([, service]) => service.frontendType === undefined)
|
|
59
|
+
.map(([key, service]) => ({ key, path: service.path })));
|
|
60
|
+
if (backend === undefined)
|
|
61
|
+
return undefined;
|
|
62
|
+
const configPath = resolvePath(input.saasRoot, backend.path, BACKEND_CONFIGURATION_SOURCE_RELATIVE_PATH);
|
|
63
|
+
if (!existsSync(configPath)) {
|
|
64
|
+
console.warn(`[platform-config-lib] The backend service "${backend.key}" has no configuration at ${configPath}, so which public `
|
|
65
|
+
+ 'documents (privacy notice, terms) the application serves is unknown here.');
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
let backendConfig;
|
|
69
|
+
try {
|
|
70
|
+
backendConfig = await loadConfig(configPath, { freshModuleCache: true });
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
throw new Error(`Could not load the application's backend configuration at ${configPath}, so which public documents (privacy notice, `
|
|
74
|
+
+ `terms) the application serves is unknown. Cause: ${describeCaughtError(error)}`);
|
|
75
|
+
}
|
|
76
|
+
return deriveServedPublicGovernedDocumentRefs(backendConfig?.compliance, input.at ?? new Date().toISOString());
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=application-served-public-documents.loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"application-served-public-documents.loader.js","sourceRoot":"","sources":["../../../../src/project-config/application-served-public-documents.loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,uCAAuC,GAExC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAEtF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAQtC,yFAAyF;AACzF,MAAM,0CAA0C,GAAG,IAAI,CAAC,KAAK,EAAE,wBAAwB,CAAC,CAAC;AAEzF;;;;;;GAMG;AACH,MAAM,UAAU,sCAAsC,CACpD,UAAkD,EAClD,EAAU;IAEV,OAAO,MAAM,CAAC,MAAM,CAAC,6BAA6B,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CACzE,uCAAuC,CAAC,UAAU,EAAE,WAAW,EAAE,EAAE,CAAC,KAAK,SAAS,CAAC,CAAC;AACxF,CAAC;AAaD,MAAM,CAAC,KAAK,UAAU,4CAA4C,CAChE,KAAwD;IAExD,yGAAyG;IACzG,MAAM,OAAO,GAAG,2BAA2B,CACzC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC;SACtC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,KAAK,SAAS,CAAC;SAC3D,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAC1D,CAAC;IACF,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC5C,MAAM,UAAU,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,0CAA0C,CAAC,CAAC;IACzG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,IAAI,CACV,8CAA8C,OAAO,CAAC,GAAG,6BAA6B,UAAU,oBAAoB;cAChH,2EAA2E,CAChF,CAAC;QACF,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,aAA2F,CAAC;IAChG,IAAI,CAAC;QACH,aAAa,GAAG,MAAM,UAAU,CAA0D,UAAU,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CAAC;IACpI,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,6DAA6D,UAAU,+CAA+C;cAClH,oDAAoD,mBAAmB,CAAC,KAAK,CAAC,EAAE,CACrF,CAAC;IACJ,CAAC;IACD,OAAO,sCAAsC,CAAC,aAAa,EAAE,UAAU,EAAE,KAAK,CAAC,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AACjH,CAAC","sourcesContent":["/**\n * `loadApplicationServedPublicGovernedDocuments` — which of the application's PUBLIC governed documents (its privacy\n * notice, its service terms) the application's own pages serve, read at BUILD time from its backend configuration\n * (#2987).\n *\n * ## Why a surface outside the application needs this\n *\n * The application links `/privacy` and `/terms` only while the page would render the document\n * (`resolveServedPublicGovernedDocumentPath`, #2976): a link that lands on \"unavailable\" is offered as the place the\n * information is and informs nobody. A generated marketing site's footer links the same pages on the application's\n * origin, and before this it linked both always. The site cannot read the application's configuration in the browser,\n * so the answer is computed here, at build time, and forwarded as plain data — the way `legalNoticeOwed` already is.\n *\n * ## Why it reads the BACKEND configuration, and not the generated documents module alone\n *\n * Whether a document is served depends on two members of `compliance`: `publicDocuments` (written by\n * `wildo config document-releases` into a generated module) and `governedDocumentApprovalGate`, which the application\n * authors in `saas-config.backend.ts`. The gate is ONE switch for every surface that shows a governed document\n * (`requiresApprovedGovernedDocuments`), so reading the generated module alone would let the site link a draft the\n * armed page withholds. The configuration the running application reads is the only object carrying both, so it is\n * the one this loads, from SOURCE through `loadConfig` (jiti) with a fresh module graph, as\n * `loadApplicationPublicPricingCatalog` does for the shared library and for the same reasons (a website image builds\n * only the website, and #2598's shared-cache `zod` clash).\n *\n * Cost, measured on Wonder Todos (2026-10-20): about 7–12 s of CPU per evaluation, paid once per website build process\n * that loads the site context.\n *\n * ## ABSENT vs FAILED\n *\n * - No backend service, or no `src/saas-config.backend.ts` under it: the loader cannot read what decides the answer, so\n * it returns `undefined` and the site keeps linking every public document, as it did before. Dropping a privacy\n * link the application may well serve is the worse error of the two. A DECLARED backend whose configuration file is\n * missing (a website image that copied only the website) also warns, so that case is not mistaken for \"no backend\".\n * - A backend configuration that cannot be LOADED throws, naming the cause: stating that nothing is served would be a\n * guess about a legal page. What to do then is the caller's decision; the website's site-context loader warns and\n * keeps every link.\n */\nimport { existsSync } from 'node:fs';\nimport { join, resolve as resolvePath } from 'node:path';\n\nimport {\n PUBLIC_GOVERNED_DOCUMENT_REFS,\n describeCaughtError,\n resolveServedPublicGovernedDocumentPath,\n type PublicGovernedDocumentRefName,\n} from '@wildo-ai/saas-models';\n\nimport { selectPrimaryBackendService } from '../bootstrap/runtime-topology.contracts';\nimport type { WildoSaasConfig } from './define-saas-config';\nimport { loadConfig } from './loader';\n\n/** A public governed document's ref (`PUBLIC_GOVERNED_DOCUMENT_REFS` value), e.g. `document:public.privacy-notice`. */\nexport type ServedPublicGovernedDocumentRef = (typeof PUBLIC_GOVERNED_DOCUMENT_REFS)[PublicGovernedDocumentRefName];\n\n/** The `compliance` section the served reading takes, exactly as `resolveServedPublicGovernedDocumentPath` does. */\nexport type ServedPublicGovernedDocumentCompliance = Parameters<typeof resolveServedPublicGovernedDocumentPath>[0];\n\n/** The backend configuration's source, under the primary backend service's directory. */\nconst BACKEND_CONFIGURATION_SOURCE_RELATIVE_PATH = join('src', 'saas-config.backend.ts');\n\n/**\n * The public governed documents the application serves at `at`, in `PUBLIC_GOVERNED_DOCUMENT_REFS` order.\n *\n * PURE, and total over the public documents: a document added to that vocabulary is answered for by every build without\n * an edit here. Each answer is `resolveServedPublicGovernedDocumentPath`'s, never a literal path or a second reading of\n * releases, drafts and the approval gate.\n */\nexport function deriveServedPublicGovernedDocumentRefs(\n compliance: ServedPublicGovernedDocumentCompliance,\n at: string,\n): ServedPublicGovernedDocumentRef[] {\n return Object.values(PUBLIC_GOVERNED_DOCUMENT_REFS).filter((documentRef) =>\n resolveServedPublicGovernedDocumentPath(compliance, documentRef, at) !== undefined);\n}\n\nexport interface LoadApplicationServedPublicGovernedDocumentsInput {\n /** The application root (the directory holding `wildo.saas.config.ts`). */\n readonly saasRoot: string;\n readonly saasConfig: Pick<WildoSaasConfig, 'services'>;\n /**\n * The instant the answer is for, as an ISO string. Defaults to now: a static site states what was served when it\n * was BUILT, so a release that comes into force later is linked from the next build.\n */\n readonly at?: string;\n}\n\nexport async function loadApplicationServedPublicGovernedDocuments(\n input: LoadApplicationServedPublicGovernedDocumentsInput,\n): Promise<ServedPublicGovernedDocumentRef[] | undefined> {\n // The backend is the service with no `frontendType`, chosen by the rule the website's local origins use.\n const backend = selectPrimaryBackendService(\n Object.entries(input.saasConfig.services)\n .filter(([, service]) => service.frontendType === undefined)\n .map(([key, service]) => ({ key, path: service.path })),\n );\n if (backend === undefined) return undefined;\n const configPath = resolvePath(input.saasRoot, backend.path, BACKEND_CONFIGURATION_SOURCE_RELATIVE_PATH);\n if (!existsSync(configPath)) {\n console.warn(\n `[platform-config-lib] The backend service \"${backend.key}\" has no configuration at ${configPath}, so which public `\n + 'documents (privacy notice, terms) the application serves is unknown here.',\n );\n return undefined;\n }\n\n let backendConfig: { readonly compliance?: ServedPublicGovernedDocumentCompliance } | undefined;\n try {\n backendConfig = await loadConfig<{ compliance?: ServedPublicGovernedDocumentCompliance }>(configPath, { freshModuleCache: true });\n } catch (error) {\n throw new Error(\n `Could not load the application's backend configuration at ${configPath}, so which public documents (privacy notice, `\n + `terms) the application serves is unknown. Cause: ${describeCaughtError(error)}`,\n );\n }\n return deriveServedPublicGovernedDocumentRefs(backendConfig?.compliance, input.at ?? new Date().toISOString());\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define-framework-config.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"define-framework-config.d.ts","sourceRoot":"","sources":["../../../../src/project-config/define-framework-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,oBAAY,6BAA6B;IACvC,gBAAgB,qBAAqB;IACrC,mBAAmB,wBAAwB;CAC5C;AAED,oBAAY,gCAAgC;IAC1C,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,sCAAsC;;;;iBAIjD,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAEtG,eAAO,MAAM,oCAAoC;;;;iBAsB/C,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,eAAO,MAAM,uCAAuC;;;;;;;;iBAmClD,CAAC;AACH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC;AAExG,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;iBAQrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEnF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,yBAAyB,GAAG,oBAAoB,CAE7F"}
|