@wildo-ai/platform-config-lib 1.1.4 → 1.1.5
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/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 +23 -1
- package/dist/esm/bootstrap/bootstrap.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.contracts.js +24 -0
- package/dist/esm/bootstrap/bootstrap.contracts.js.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts +70 -1
- package/dist/esm/bootstrap/bootstrap.schemas.d.ts.map +1 -1
- package/dist/esm/bootstrap/bootstrap.schemas.js +55 -4
- package/dist/esm/bootstrap/bootstrap.schemas.js.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts +12 -0
- package/dist/esm/bootstrap/platform-runtime-env.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js +12 -0
- package/dist/esm/bootstrap/platform-runtime-env.contracts.js.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-network-topology.js.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-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts +29 -0
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js +39 -0
- package/dist/esm/bootstrap/wildo-owner-organization.contracts.js.map +1 -1
- package/dist/esm/config-authoring.entry.d.ts.map +1 -1
- package/dist/esm/config-authoring.entry.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lockfile/build-parallelism.d.ts +40 -0
- package/dist/esm/lockfile/build-parallelism.d.ts.map +1 -0
- package/dist/esm/lockfile/build-parallelism.js +64 -0
- package/dist/esm/lockfile/build-parallelism.js.map +1 -0
- package/dist/esm/lockfile/lockfile-io.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts +1 -1
- package/dist/esm/lockfile/materialize-infra-section.d.ts.map +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js +1 -1
- package/dist/esm/lockfile/materialize-infra-section.js.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.d.ts.map +1 -1
- package/dist/esm/lockfile/wildo-saas-lock.shared.schemas.js.map +1 -1
- package/dist/esm/project-config/define-framework-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-infra-env-config.d.ts +899 -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 +397 -16
- 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-minion-config.js +1 -2
- package/dist/esm/project-config/define-minion-config.js.map +1 -1
- package/dist/esm/project-config/define-saas-config.d.ts +90 -25
- package/dist/esm/project-config/define-saas-config.d.ts.map +1 -1
- package/dist/esm/project-config/define-saas-config.js +165 -12
- 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 +59 -0
- package/dist/esm/project-config/hosted-infra-env-config.d.ts.map +1 -0
- package/dist/esm/project-config/hosted-infra-env-config.js +187 -0
- package/dist/esm/project-config/hosted-infra-env-config.js.map +1 -0
- 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 +24 -0
- package/dist/esm/project-config/loader.d.ts.map +1 -1
- package/dist/esm/project-config/loader.js +114 -1
- package/dist/esm/project-config/loader.js.map +1 -1
- package/dist/esm/project-config/provider-catalog-types.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.d.ts +32 -0
- package/dist/esm/project-config/provider-companion-discovery.d.ts.map +1 -1
- package/dist/esm/project-config/provider-companion-discovery.js +82 -12
- package/dist/esm/project-config/provider-companion-discovery.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +71 -22
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +135 -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 +14 -35
- package/dist/esm/project-config/shared/auth.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/auth.schemas.js +14 -35
- package/dist/esm/project-config/shared/auth.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts +17 -12
- package/dist/esm/project-config/shared/backing-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/backing-services.schemas.js +17 -12
- package/dist/esm/project-config/shared/backing-services.schemas.js.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.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp-emit.js.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.d.ts +11 -12
- package/dist/esm/project-config/shared/csp.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/csp.schemas.js +11 -12
- 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/env-example-defaults.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +152 -12
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +186 -9
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +5 -6
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.js +0 -3
- package/dist/esm/project-config/shared/infra-providers.schemas.js.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.map +1 -1
- package/dist/esm/project-config/shared/infrastructure-defaults.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.d.ts.map +1 -1
- package/dist/esm/project-config/shared/k8s-utils.js.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.d.ts.map +1 -1
- package/dist/esm/project-config/shared/minion-platform-access.vocabulary.js.map +1 -1
- package/dist/esm/project-config/shared/minion-resource-access.validation.d.ts +77 -47
- 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 +114 -52
- package/dist/esm/project-config/shared/minion-resource-access.validation.js.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts +50 -0
- package/dist/esm/project-config/shared/platform-services.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/platform-services.schemas.js +57 -0
- package/dist/esm/project-config/shared/platform-services.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts +35 -0
- package/dist/esm/project-config/shared/platform-storage.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/platform-storage.schemas.js +37 -0
- package/dist/esm/project-config/shared/platform-storage.schemas.js.map +1 -0
- 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 +81 -0
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.d.ts.map +1 -0
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.js +74 -0
- package/dist/esm/project-config/shared/systems-of-record-env.schemas.js.map +1 -0
- package/dist/esm/registry/artifact-domain.schemas.d.ts +1 -1
- package/dist/esm/registry/artifact-domain.schemas.d.ts.map +1 -1
- package/dist/esm/registry/companion-api.schemas.d.ts.map +1 -1
- package/dist/esm/registry/digest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/index.d.ts.map +1 -1
- package/dist/esm/registry/lockfile-modules-section.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-artifact.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.d.ts +10 -16
- package/dist/esm/registry/module-manifest.schemas.d.ts.map +1 -1
- package/dist/esm/registry/module-manifest.schemas.js +14 -20
- package/dist/esm/registry/module-manifest.schemas.js.map +1 -1
- package/dist/esm/registry/registry-config.schemas.d.ts.map +1 -1
- package/dist/esm/registry/registry-section-schemas.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.d.ts.map +1 -1
- package/dist/esm/release/framework-release.constants.js.map +1 -1
- package/dist/esm/schemas/framework-info.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts +12 -1
- package/dist/esm/schemas/framework-secrets.schemas.d.ts.map +1 -1
- package/dist/esm/schemas/framework-secrets.schemas.js +14 -1
- 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/dist/esm/workspace-scope/resolve-homes.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts +4 -3
- package/dist/esm/workspace-scope/workspace-homes.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-homes.schemas.js +6 -5
- package/dist/esm/workspace-scope/workspace-homes.schemas.js.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts +15 -6
- package/dist/esm/workspace-scope/workspace-scope.schemas.d.ts.map +1 -1
- package/dist/esm/workspace-scope/workspace-scope.schemas.js +23 -9
- package/dist/esm/workspace-scope/workspace-scope.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +7 -7
|
@@ -1,13 +1,562 @@
|
|
|
1
1
|
import { RuntimeEnvironment } from '@wildo-ai/saas-models';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { BackingServiceSource } from './shared/backing-services.schemas';
|
|
4
|
-
import { DatabaseEngine, WildoDeploymentRuntime, WildoLocationType } from './shared/environment.schemas';
|
|
4
|
+
import { DatabaseEngine, WildoDeploymentRuntime, WildoLocationType, WildoLocalDataStorage, WildoImageTagStrategy } from './shared/environment.schemas';
|
|
5
|
+
/**
|
|
6
|
+
* The shape of a STANDALONE environment descriptor — one that owns its infrastructure.
|
|
7
|
+
*
|
|
8
|
+
* Kept as a plain object rather than inlined into `z.object(...)` because the HOSTED descriptor
|
|
9
|
+
* ({@link WildoHostedInfraEnvConfigSchema}) is built from a subset of these same members. Zod 4 refuses
|
|
10
|
+
* `.pick()` on an object that carries refinements, so sharing the members is the only way the two
|
|
11
|
+
* descriptors can agree on what an application-owned field IS without restating it.
|
|
12
|
+
*/
|
|
13
|
+
declare const WILDO_INFRA_ENV_CONFIG_SHAPE: {
|
|
14
|
+
/**
|
|
15
|
+
* Authored schema-format version for this `wildo.infra.<env>.config.ts`,
|
|
16
|
+
* expressed as a **SemVer 2.0.0 string** (e.g. `'1.0.0'`,
|
|
17
|
+
* `'2.3.1-rc.1'`, `'1.0.0+build.42'`).
|
|
18
|
+
*
|
|
19
|
+
* @unimplemented Slice 3.5 wires a parse-time warning when this is
|
|
20
|
+
* authored. The full schema-evolution / migration tooling story is
|
|
21
|
+
* tracked under deferred-backlog **D-5**
|
|
22
|
+
* (`.cursor/plans/post-flattening-completion-fixes.md`). Symmetrical
|
|
23
|
+
* with `WildoSaasConfig.version` — both reservations land/retire
|
|
24
|
+
* together so the migration tooling, when it ships, can target both
|
|
25
|
+
* authored configs through a single mechanism. SemVer (not a bare
|
|
26
|
+
* integer) was chosen for the same reason as on the SaaS-config side
|
|
27
|
+
* — see the JSDoc on `WildoSaasConfig.version`. Field is `.optional()`
|
|
28
|
+
* (no Zod default) so unauthored configs stay silent.
|
|
29
|
+
*/
|
|
30
|
+
version: z.ZodOptional<z.ZodString>;
|
|
31
|
+
environment: z.ZodString;
|
|
32
|
+
locationType: z.ZodOptional<z.ZodEnum<typeof WildoLocationType>>;
|
|
33
|
+
runtimeEnvironment: z.ZodOptional<z.ZodEnum<typeof RuntimeEnvironment>>;
|
|
34
|
+
runtime: z.ZodEnum<typeof WildoDeploymentRuntime>;
|
|
35
|
+
/**
|
|
36
|
+
* Where the self-hosted backing services of a DOCKER_COMPOSE environment keep their data —
|
|
37
|
+
* a Docker named volume, or a bind mount onto `<saas-root>/.wildo-saas/local_data/<service>/`.
|
|
38
|
+
*
|
|
39
|
+
* Omit it and the environment takes {@link resolveDefaultLocalDataStorage}: a named volume
|
|
40
|
+
* locally (the host-filesystem crossing costs ~4 CPU cores on macOS and Windows, and a named
|
|
41
|
+
* volume costs a Linux developer nothing), a host path remotely (the operator chooses the disk
|
|
42
|
+
* the database lands on). Author it to say otherwise — a remote deployment happy with Docker's
|
|
43
|
+
* own storage, or a local developer who wants to read the files directly.
|
|
44
|
+
*
|
|
45
|
+
* Ignored by KUBERNETES environments, which take their storage from PVs rather than from here.
|
|
46
|
+
*/
|
|
47
|
+
localDataStorage: z.ZodOptional<z.ZodEnum<typeof WildoLocalDataStorage>>;
|
|
48
|
+
/**
|
|
49
|
+
* The store the PLATFORM's own data lives in (apps-manager + module-registry:
|
|
50
|
+
* users, organizations, applications, sessions, API keys).
|
|
51
|
+
*
|
|
52
|
+
* **This is a DECLARED property of the environment, and that is the whole point.** It used to
|
|
53
|
+
* exist only as an answer to an interactive prompt, persisted to the machine-local
|
|
54
|
+
* `environments.json` — so it could not be committed, reviewed, or reproduced on a second
|
|
55
|
+
* machine, and a value inferred from which backing services happened to be declared filled the
|
|
56
|
+
* gap. Authoring it here makes it travel with the repository like every other environment
|
|
57
|
+
* property.
|
|
58
|
+
*
|
|
59
|
+
* OPTIONAL. When omitted, the engine is INFERRED from the declared backing services
|
|
60
|
+
* (`inferDatabaseChoiceFromInfraConfig`), which is what every pre-existing environment relies
|
|
61
|
+
* on — so omitting this field preserves today's behaviour exactly. When authored, it is the
|
|
62
|
+
* AUTHORITY and the inference is not consulted.
|
|
63
|
+
*
|
|
64
|
+
* Authoring it is REQUIRED to express a PostgreSQL platform that ALSO runs a mongod, because the
|
|
65
|
+
* inference resolves `postgresql && mongodb` to MongoDB — so that dual-store combination is
|
|
66
|
+
* unreachable by inference, by construction. Since 2026-08-28 a PostgreSQL platform no longer has
|
|
67
|
+
* to declare `backingServices.mongodb` at all (see the refinement below), so the single-store case
|
|
68
|
+
* is now expressible too.
|
|
69
|
+
*
|
|
70
|
+
* @example A PostgreSQL platform, no mongod.
|
|
71
|
+
* ```ts
|
|
72
|
+
* database: { engine: DatabaseEngine.POSTGRESQL, source: BackingServiceSource.SELF },
|
|
73
|
+
* backingServices: { postgresql: { source: BackingServiceSource.SELF } },
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @example A DUAL-STORE platform — PostgreSQL for itself, a mongod beside it for the Mongo-backed
|
|
77
|
+
* applications it hosts. This is the shape that needs `database` authored.
|
|
78
|
+
* ```ts
|
|
79
|
+
* database: { engine: DatabaseEngine.POSTGRESQL, source: BackingServiceSource.SELF },
|
|
80
|
+
* backingServices: {
|
|
81
|
+
* mongodb: { source: BackingServiceSource.SELF },
|
|
82
|
+
* postgresql: { source: BackingServiceSource.SELF },
|
|
83
|
+
* },
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* NOTE this is the PLATFORM's engine. An APPLICATION's own store is chosen separately by that
|
|
87
|
+
* application's `DATABASE_DEFAULT_ADAPTER`; declaring `backingServices.postgresql` alone gives an
|
|
88
|
+
* application a PostgreSQL substrate without moving the platform.
|
|
89
|
+
*/
|
|
90
|
+
database: z.ZodOptional<z.ZodObject<{
|
|
91
|
+
engine: z.ZodEnum<typeof DatabaseEngine>;
|
|
92
|
+
source: z.ZodEnum<typeof BackingServiceSource>;
|
|
93
|
+
/**
|
|
94
|
+
* Managed-brand identifier when `source === MANAGED` — `'atlas'` for Mongo; one of
|
|
95
|
+
* `'aws-rds' | 'gcp-cloud-sql' | 'azure-database' | 'supabase' | 'neon' | 'render'` for
|
|
96
|
+
* Postgres. Mirrors `PlatformEnvConfigJson['database'].provider` exactly; this field is
|
|
97
|
+
* deliberately the same vocabulary rather than a parallel one.
|
|
98
|
+
*/
|
|
99
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
100
|
+
}, z.core.$strict>>;
|
|
101
|
+
/** @wildo_source:part:start platform.config.application-database facet:layer:platform facet:family:bootstrap facet:audience:app-developer */
|
|
102
|
+
/**
|
|
103
|
+
* Which declared backing store the APPLICATION's own resources persist to.
|
|
104
|
+
*
|
|
105
|
+
* ## Why this is a SEPARATE field from `database`
|
|
106
|
+
*
|
|
107
|
+
* `database` above is the PLATFORM's engine — where apps-manager's own tables live. This one is the
|
|
108
|
+
* application's, and the two move independently: a PostgreSQL platform can host a MongoDB
|
|
109
|
+
* application and vice versa. Collapsing them would make one decision imply the other, which is
|
|
110
|
+
* exactly the conflation the emitter's own contract warns against.
|
|
111
|
+
*
|
|
112
|
+
* ## Why it carries only `engine`
|
|
113
|
+
*
|
|
114
|
+
* The SUBSTRATE is already declared: `backingServices.postgresql` says where the database is and
|
|
115
|
+
* who provisions it, and `env-vars-builder` already emits `POSTGRESQL_HOST/PORT/DATABASE` to the
|
|
116
|
+
* application backend whenever the environment self-hosts one. What was missing is the SELECTION,
|
|
117
|
+
* and only the selection belongs here.
|
|
118
|
+
*
|
|
119
|
+
* ## Why an authored field rather than an env variable
|
|
120
|
+
*
|
|
121
|
+
* The emitter states the rule this field exists to satisfy: *"which store an application persists to
|
|
122
|
+
* is a deployment decision that must be legible in one place, not an emergent property of which
|
|
123
|
+
* variables happen to be set"*. Before this, the only way to select PostgreSQL for an application
|
|
124
|
+
* was to hand-edit `backend-api/.env` — machine-local, ungitted, and not reproducible on another
|
|
125
|
+
* developer's machine. That is the same defect the platform `database` field above was added to
|
|
126
|
+
* remove, and the reason both live in the authored, committed config.
|
|
127
|
+
*
|
|
128
|
+
* Absent means POSTGRESQL (`DEFAULT_APPLICATION_DATABASE_ENGINE`, decided 2026-09-24, #1571), and
|
|
129
|
+
* every reader resolves it through `resolveApplicationDatabaseEngine` rather than re-deriving it —
|
|
130
|
+
* two readers answering silence differently is what stranded an application on 2026-09-15. So an
|
|
131
|
+
* environment that authors nothing here must still declare `backingServices.postgresql`; the
|
|
132
|
+
* refinement below refuses it otherwise.
|
|
133
|
+
*
|
|
134
|
+
* @example An application on PostgreSQL, on a platform that is also on PostgreSQL.
|
|
135
|
+
* ```ts
|
|
136
|
+
* database: { engine: DatabaseEngine.POSTGRESQL, source: BackingServiceSource.SELF },
|
|
137
|
+
* applicationDatabase: { engine: DatabaseEngine.POSTGRESQL },
|
|
138
|
+
* backingServices: {
|
|
139
|
+
* postgresql: { source: BackingServiceSource.SELF, database: 'my-app-db' },
|
|
140
|
+
* },
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
applicationDatabase: z.ZodOptional<z.ZodObject<{
|
|
144
|
+
engine: z.ZodEnum<typeof DatabaseEngine>;
|
|
145
|
+
}, z.core.$strict>>;
|
|
146
|
+
/**
|
|
147
|
+
* ## Choosing PostgreSQL creates a standing obligation — MIGRATIONS
|
|
148
|
+
*
|
|
149
|
+
* This is the part that is easy to miss, and it is not a detail of deployment: on MongoDB a
|
|
150
|
+
* collection exists the moment something writes to it, so a new resource needs nothing. On
|
|
151
|
+
* PostgreSQL a resource's TABLE is built by a MIGRATION, and nothing creates it implicitly. So on
|
|
152
|
+
* this engine, adding or reshaping a resource owes an artifact:
|
|
153
|
+
*
|
|
154
|
+
* - `wildo db diff` — what separates the model from the accepted plan;
|
|
155
|
+
* - `wildo db generate --name <label>` — writes `backend-api/migrations/<timestamp>_<name>/`
|
|
156
|
+
* AND advances `backend-api/migrations/schema-plan.lock.json`, in one step. Commit them
|
|
157
|
+
* TOGETHER; either one alone is the two-artifact drift the design exists to prevent;
|
|
158
|
+
* - `wildo db migrate` — applies pending migrations by hand. Usually unnecessary: the application
|
|
159
|
+
* backend applies them at BOOT, and `wildo local dev` reconciles drift before the app starts.
|
|
160
|
+
*
|
|
161
|
+
* Skip it and nothing warns until the backend refuses to start with
|
|
162
|
+
* `postgresql_table_schema_mismatch` — an accurate message that names neither the migration nor
|
|
163
|
+
* the command. See the `application-database-migrations` skill.
|
|
164
|
+
*/
|
|
165
|
+
/** @wildo_source:part:end platform.config.application-database */
|
|
166
|
+
/**
|
|
167
|
+
* Public domain that browsers and external clients use to reach this
|
|
168
|
+
* deployment. Ingress / reverse proxy / DNS terminate here; every
|
|
169
|
+
* service-level subdomain is mounted under it via {@link serviceHosts}
|
|
170
|
+
* (`https://<serviceHost>.<publicDomain>`, e.g. `app.example.com`; a
|
|
171
|
+
* `serviceHosts` value of `''` mounts the service at the apex). Greenfield,
|
|
172
|
+
* single-app, mono-env — there is NO `<service>-<appSlug>-<env>` fan-out.
|
|
173
|
+
*
|
|
174
|
+
* Applies to BOTH `WildoDeploymentRuntime.KUBERNETES` and
|
|
175
|
+
* `WildoDeploymentRuntime.DOCKER_COMPOSE`. For compose envs without a
|
|
176
|
+
* reverse proxy, author `'localhost'` explicitly. For K8s local,
|
|
177
|
+
* author `'local.wildo.ai'` (or your `*.local` apex). For remote,
|
|
178
|
+
* author your apex (e.g. `'wonder-todos.com'`).
|
|
179
|
+
*
|
|
180
|
+
* NOT to be confused with the K8s-internal service-mesh hostname
|
|
181
|
+
* (`<service>.<namespace>.svc.cluster.local`), which stays implicit
|
|
182
|
+
* and is derived from `kubernetes.namespace` at composition time.
|
|
183
|
+
*
|
|
184
|
+
* REQUIRED — there is no read-time fallback. The default that
|
|
185
|
+
* `wildo init` writes into the generated config file lives in
|
|
186
|
+
* `PUBLIC_DOMAIN_DEFAULTS` (`infrastructure-defaults.schemas.ts`),
|
|
187
|
+
* but the schema enforces explicit authoring so a hand-edited
|
|
188
|
+
* config that drops the field fails Zod parse with a clear error
|
|
189
|
+
* instead of silently falling back.
|
|
190
|
+
*/
|
|
191
|
+
publicDomain: z.ZodString;
|
|
192
|
+
/**
|
|
193
|
+
* Per-service public hostname authoring for this environment.
|
|
194
|
+
*
|
|
195
|
+
* The app developer maps each publicly-exposed service (by its
|
|
196
|
+
* `services.<key>` in `wildo.saas.config.ts`) to the subdomain
|
|
197
|
+
* chain under `publicDomain` where it is reachable in this
|
|
198
|
+
* environment. An empty string value mounts the service at the
|
|
199
|
+
* apex of `publicDomain`.
|
|
200
|
+
*
|
|
201
|
+
* An UNMAPPED service falls back to its own key, lowercased, as its
|
|
202
|
+
* subdomain (`buildServicePublicHost`) — a defined path, not an error;
|
|
203
|
+
* nothing is derived from `frontendType`. Author an entry whenever the
|
|
204
|
+
* key is not the host you want, or is not a valid DNS label. Two
|
|
205
|
+
* services resolving to one host are refused when a REMOTE
|
|
206
|
+
* environment's ingress routes are built (`buildK8sApplicationIngressRoutes`);
|
|
207
|
+
* a local environment builds none and a CDN-served frontend is excluded
|
|
208
|
+
* from them, so neither is checked. (Corrected
|
|
209
|
+
* 2026-09-13: this comment said there was NO derivation from the key,
|
|
210
|
+
* which the resolver has not matched.) An app-dev who wants the
|
|
211
|
+
* docs service to live at `dev.example.com` (rather than the more
|
|
212
|
+
* conventional `docs.example.com`) writes
|
|
213
|
+
* `serviceHosts: { docs: 'dev' }` here; an app-dev who splits
|
|
214
|
+
* marketing across `example.com` and `landing.example.com` can
|
|
215
|
+
* author `serviceHosts: { www: '', landing: 'landing' }` without
|
|
216
|
+
* the framework second-guessing the intent.
|
|
217
|
+
*
|
|
218
|
+
* Field is `.optional()` because many projects (local dev,
|
|
219
|
+
* Docker Compose collapsed to `localhost`, single-frontend SaaS
|
|
220
|
+
* apps) do not need per-service hostname authoring. Downstream
|
|
221
|
+
* consumers (URL composers, ingress manifest generators) MUST
|
|
222
|
+
* handle both "no mapping authored" and "service key not
|
|
223
|
+
* mapped" as defined fallback paths — never as silent errors.
|
|
224
|
+
*/
|
|
225
|
+
serviceHosts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
226
|
+
kubernetes: z.ZodOptional<z.ZodObject<{
|
|
227
|
+
namespace: z.ZodString;
|
|
228
|
+
services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
229
|
+
replicas: z.ZodOptional<z.ZodNumber>;
|
|
230
|
+
}, z.core.$strict>>>;
|
|
231
|
+
ingressClass: z.ZodOptional<z.ZodLiteral<"traefik">>;
|
|
232
|
+
}, z.core.$strict>>;
|
|
233
|
+
remoteProvider: z.ZodOptional<z.ZodObject<{
|
|
234
|
+
provider: z.ZodString;
|
|
235
|
+
registryEndpoint: z.ZodString;
|
|
236
|
+
region: z.ZodOptional<z.ZodString>;
|
|
237
|
+
acmeEmail: z.ZodOptional<z.ZodEmail>;
|
|
238
|
+
tlsIssuer: z.ZodOptional<z.ZodEnum<typeof import(".").WildoTlsIssuer>>;
|
|
239
|
+
}, z.core.$strict>>;
|
|
240
|
+
deployment: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
241
|
+
branch: z.ZodString;
|
|
242
|
+
runtime: z.ZodLiteral<WildoDeploymentRuntime.DOCKER_COMPOSE>;
|
|
243
|
+
imageTagStrategy: z.ZodDefault<z.ZodEnum<typeof WildoImageTagStrategy>>;
|
|
244
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
245
|
+
branch: z.ZodString;
|
|
246
|
+
runtime: z.ZodLiteral<WildoDeploymentRuntime.KUBERNETES>;
|
|
247
|
+
namespace: z.ZodOptional<z.ZodString>;
|
|
248
|
+
imageTagStrategy: z.ZodDefault<z.ZodEnum<typeof WildoImageTagStrategy>>;
|
|
249
|
+
}, z.core.$strict>], "runtime">>;
|
|
250
|
+
backingServices: z.ZodObject<{
|
|
251
|
+
mongodb: z.ZodOptional<z.ZodObject<{
|
|
252
|
+
source: z.ZodEnum<typeof BackingServiceSource>;
|
|
253
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
254
|
+
host: z.ZodOptional<z.ZodString>;
|
|
255
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
256
|
+
database: z.ZodOptional<z.ZodString>;
|
|
257
|
+
}, z.core.$strict>>;
|
|
258
|
+
redis: z.ZodOptional<z.ZodObject<{
|
|
259
|
+
source: z.ZodEnum<typeof BackingServiceSource>;
|
|
260
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
261
|
+
host: z.ZodOptional<z.ZodString>;
|
|
262
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
263
|
+
database: z.ZodOptional<z.ZodNumber>;
|
|
264
|
+
}, z.core.$strict>>;
|
|
265
|
+
rabbitmq: z.ZodOptional<z.ZodObject<{
|
|
266
|
+
source: z.ZodEnum<typeof BackingServiceSource>;
|
|
267
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
268
|
+
host: z.ZodOptional<z.ZodString>;
|
|
269
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
270
|
+
vhost: z.ZodOptional<z.ZodString>;
|
|
271
|
+
}, z.core.$strict>>;
|
|
272
|
+
s3: z.ZodOptional<z.ZodObject<{
|
|
273
|
+
source: z.ZodEnum<typeof BackingServiceSource>;
|
|
274
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
275
|
+
host: z.ZodOptional<z.ZodString>;
|
|
276
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
277
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
278
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
279
|
+
}, z.core.$strict>>;
|
|
280
|
+
postgresql: z.ZodOptional<z.ZodObject<{
|
|
281
|
+
source: z.ZodEnum<typeof BackingServiceSource>;
|
|
282
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
283
|
+
host: z.ZodOptional<z.ZodString>;
|
|
284
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
285
|
+
database: z.ZodOptional<z.ZodString>;
|
|
286
|
+
}, z.core.$strict>>;
|
|
287
|
+
clamav: z.ZodOptional<z.ZodObject<{
|
|
288
|
+
source: z.ZodEnum<typeof BackingServiceSource>;
|
|
289
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
290
|
+
host: z.ZodOptional<z.ZodString>;
|
|
291
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
292
|
+
}, z.core.$strict>>;
|
|
293
|
+
immudb: z.ZodOptional<z.ZodObject<{
|
|
294
|
+
source: z.ZodEnum<typeof BackingServiceSource>;
|
|
295
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
296
|
+
host: z.ZodOptional<z.ZodString>;
|
|
297
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
298
|
+
database: z.ZodOptional<z.ZodString>;
|
|
299
|
+
}, z.core.$strict>>;
|
|
300
|
+
backup: z.ZodOptional<z.ZodObject<{
|
|
301
|
+
source: z.ZodEnum<typeof BackingServiceSource>;
|
|
302
|
+
provider: z.ZodOptional<z.ZodString>;
|
|
303
|
+
host: z.ZodOptional<z.ZodString>;
|
|
304
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
305
|
+
}, z.core.$strict>>;
|
|
306
|
+
}, z.core.$strict>;
|
|
307
|
+
/**
|
|
308
|
+
* Per-environment logging posture. `level` is projected to `LOG_LEVEL`
|
|
309
|
+
* by `env-vars-builder` for every long-running platform/application
|
|
310
|
+
* process (`LoggerService.loadConfiguration` reads it at boot);
|
|
311
|
+
* `formattedConsoleErrors` is projected to `LOG_FORMATTED_CONSOLE_ERRORS`
|
|
312
|
+
* and overrides the auto-detected pino-pretty / JSON branch for
|
|
313
|
+
* environments that want explicit control. Persisted into
|
|
314
|
+
* `PlatformEnvConfigJson.logging` and hydrated back by
|
|
315
|
+
* `hydrateEnvironmentFromConfig` so the runtime contract survives a
|
|
316
|
+
* `wildo config sync` cycle.
|
|
317
|
+
*/
|
|
318
|
+
logging: z.ZodOptional<z.ZodObject<{
|
|
319
|
+
level: z.ZodDefault<z.ZodEnum<{
|
|
320
|
+
error: "error";
|
|
321
|
+
debug: "debug";
|
|
322
|
+
info: "info";
|
|
323
|
+
warn: "warn";
|
|
324
|
+
}>>;
|
|
325
|
+
formattedConsoleErrors: z.ZodOptional<z.ZodBoolean>;
|
|
326
|
+
}, z.core.$strip>>;
|
|
327
|
+
/**
|
|
328
|
+
* Per-environment OTLP telemetry posture (Slice 2 Phase 5). `enabled` is projected to
|
|
329
|
+
* `OTEL_ENABLED` and drives the `--import @wildo-ai/saas-backend-lib/otel-preload` wiring;
|
|
330
|
+
* `endpoint` is projected to `OTEL_EXPORTER_OTLP_ENDPOINT`. The provider auth header
|
|
331
|
+
* (`OTEL_EXPORTER_OTLP_HEADERS`) is derived from the selected `OBSERVABILITY_TELEMETRY`
|
|
332
|
+
* provider's secret by `env-vars-builder`, not authored here. Persisted into
|
|
333
|
+
* `PlatformEnvConfigJson.observability` and hydrated by `hydrateEnvironmentFromConfig`.
|
|
334
|
+
*/
|
|
335
|
+
observability: z.ZodOptional<z.ZodObject<{
|
|
336
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
337
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
338
|
+
llmObservability: z.ZodOptional<z.ZodObject<{
|
|
339
|
+
captureContent: z.ZodDefault<z.ZodBoolean>;
|
|
340
|
+
sampleRate: z.ZodOptional<z.ZodNumber>;
|
|
341
|
+
providerEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
342
|
+
}, z.core.$strip>>;
|
|
343
|
+
}, z.core.$strip>>;
|
|
344
|
+
/**
|
|
345
|
+
* Per-environment external-provider SELECTION override. Overrides the
|
|
346
|
+
* app-wide `providers.scopes.backend.selection[capability]` primary/whenUnavailable
|
|
347
|
+
* from `wildo.saas.config.ts` for THIS environment only — e.g. author
|
|
348
|
+
* `providerSelection: { EMAIL_TRANSACTIONAL: { primary: 'email-preview' } }`
|
|
349
|
+
* in `wildo.infra.local.config.ts` so local uses the non-sending
|
|
350
|
+
* `email-preview` provider while remote envs keep the SaaS-config default
|
|
351
|
+
* (`resend`). Projected to `WILDO_PROVIDER_SELECTION_OVERRIDES` by
|
|
352
|
+
* `env-vars-builder` and applied by `ExternalProvidersRegistryBackendService`.
|
|
353
|
+
* See {@link WildoProviderSelectionOverridesSchema}.
|
|
354
|
+
*/
|
|
355
|
+
providerSelection: z.ZodOptional<z.ZodRecord<z.ZodEnum<typeof import("@wildo-ai/saas-models").EngineCapability> & z.core.$partial, z.ZodObject<{
|
|
356
|
+
primary: z.ZodString;
|
|
357
|
+
whenUnavailable: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
358
|
+
}, z.core.$strict>>>;
|
|
359
|
+
/**
|
|
360
|
+
* Per-environment provider configuration values — an OAuth client ID, a frontend SDK DSN or site key — laid over
|
|
361
|
+
* `wildo.saas.config.ts > providerConfigurations` key by key for THIS environment. Author here every value a vendor
|
|
362
|
+
* issued against one deployment; keep application policy (an agent execution profile) in the SaaS config.
|
|
363
|
+
* Never a secret: those stay in `secrets.json → providerEnv`. See
|
|
364
|
+
* {@link WildoEnvironmentProviderConfigurationsSchema}.
|
|
365
|
+
*/
|
|
366
|
+
providerConfigurations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
367
|
+
/**
|
|
368
|
+
* Per-environment origins the documentation site is BUILT against.
|
|
369
|
+
*
|
|
370
|
+
* A docs bundle is static, so the origins are compiled in: a bundle built with the
|
|
371
|
+
* wrong ones points every reader at the wrong host rather than failing. Authoring them
|
|
372
|
+
* per environment is what lets `wildo config sync` carry them, instead of an operator
|
|
373
|
+
* remembering three env vars on a build command.
|
|
374
|
+
*
|
|
375
|
+
* Projected to `WILDO_DOCS_API_BASE_URL` / `WILDO_DOCS_APP_URL` /
|
|
376
|
+
* `WILDO_DOCS_FRONTEND_SERVICE_NAME` by `env-vars-builder`.
|
|
377
|
+
* See {@link WildoDocumentationSiteConfigSchema}.
|
|
378
|
+
*/
|
|
379
|
+
documentationSite: z.ZodOptional<z.ZodObject<{
|
|
380
|
+
apiBaseUrl: z.ZodOptional<z.ZodString>;
|
|
381
|
+
appUrl: z.ZodOptional<z.ZodString>;
|
|
382
|
+
frontendServiceName: z.ZodOptional<z.ZodString>;
|
|
383
|
+
}, z.core.$strip>>;
|
|
384
|
+
/**
|
|
385
|
+
* Local-only operator configuration for application-creation verification.
|
|
386
|
+
* The authored value is snapshotted into generated `config.json` and then
|
|
387
|
+
* projected into the app-root `.env`; `.env` is never the authoring source.
|
|
388
|
+
*/
|
|
389
|
+
applicationCreationVerification: z.ZodOptional<z.ZodObject<{
|
|
390
|
+
evidenceDirectory: z.ZodString;
|
|
391
|
+
silent: z.ZodDefault<z.ZodBoolean>;
|
|
392
|
+
}, z.core.$strict>>;
|
|
393
|
+
serviceAuth: z.ZodOptional<z.ZodObject<{
|
|
394
|
+
accessTokenExpirationMinutes: z.ZodDefault<z.ZodNumber>;
|
|
395
|
+
refreshTokenExpirationDays: z.ZodDefault<z.ZodNumber>;
|
|
396
|
+
}, z.core.$strict>>;
|
|
397
|
+
/**
|
|
398
|
+
* Per-environment Content-Security-Policy overrides, keyed by SaaS-config
|
|
399
|
+
* service key (parallel to the `serviceHosts` keying convention).
|
|
400
|
+
*
|
|
401
|
+
* # Consumer wiring
|
|
402
|
+
*
|
|
403
|
+
* The generic resolver in `platform-config-lib` accepts this layer,
|
|
404
|
+
* and `wildo dev sync-csp` is the first build-time consumer that
|
|
405
|
+
* threads `parsed.csp[serviceKey]` into generated frontend CSP
|
|
406
|
+
* artifacts and nginx marker rewrites. `defineInfraEnvConfig` still
|
|
407
|
+
* emits a one-line stderr warning for authored service keys that are
|
|
408
|
+
* not explicitly declared as consumed by the current loader; known
|
|
409
|
+
* CSP-capable frontend keys are suppressed by the CLI while it loads
|
|
410
|
+
* the shared infra config.
|
|
411
|
+
*
|
|
412
|
+
* Cross-validation against SaaS-config service keys is not enforceable
|
|
413
|
+
* inside this schema alone because the infra config file is parsed
|
|
414
|
+
* independently. Consumers that load both files together must validate
|
|
415
|
+
* their own seam; `wildo dev sync-csp` rejects unknown `csp.<key>`
|
|
416
|
+
* entries before emitting generated artifacts.
|
|
417
|
+
*
|
|
418
|
+
* # Where this fits in the layered CSP cake
|
|
419
|
+
*
|
|
420
|
+
* 1. Platform default (per-`AppFrontendType` baseline) — `csp-defaults.ts`.
|
|
421
|
+
* 2. App-static (per-frontend `csp?` block) — authored on each
|
|
422
|
+
* service-definition (today: `wildo.tech-doc.config.ts.csp?` per
|
|
423
|
+
* `saas-technical-doc.md` Step 7.5).
|
|
424
|
+
* 3. **THIS FIELD** — env-specific overrides authored under
|
|
425
|
+
* `wildo.infra.<env>.config.ts.csp?[serviceKey]`. The
|
|
426
|
+
* `resolveCspPolicy({ envOverride, environmentId })` resolver
|
|
427
|
+
* in `platform-config-lib/src/project-config/shared/csp-emit.ts`
|
|
428
|
+
* accepts this shape, the schema's `superRefine` enforces the
|
|
429
|
+
* LOCAL-only `viteDevLoosening` rule, and `wildo dev sync-csp`
|
|
430
|
+
* reads `parsed.csp[serviceKey]` when generating service-local
|
|
431
|
+
* artifacts.
|
|
432
|
+
*
|
|
433
|
+
* # Why per-env overrides exist
|
|
434
|
+
*
|
|
435
|
+
* - Sentry / DataDog ingest origins differ per deployment (staging
|
|
436
|
+
* vs production violation collectors).
|
|
437
|
+
* - Vite dev mode needs `'unsafe-inline'` + `'unsafe-eval'` in
|
|
438
|
+
* `script-src` (HMR client bootstrap injects an inline `<script>`,
|
|
439
|
+
* module/sourcemap transforms run through `eval()`). The
|
|
440
|
+
* framework auto-applies this for `local` + `SAAS_APP` via the
|
|
441
|
+
* resolver's auto-default; the `viteDevLoosening` field exists
|
|
442
|
+
* only for explicit opt-out (debugging real CSP issues) or for
|
|
443
|
+
* non-canonical envs that also run Vite dev.
|
|
444
|
+
* - Per-env `reportOnly` ramping: ship `reportOnly: true` in
|
|
445
|
+
* staging while the violation collector ramps up, flip to
|
|
446
|
+
* enforcing in prod once the directive overrides settle.
|
|
447
|
+
*
|
|
448
|
+
* # Always additive (resolver contract)
|
|
449
|
+
*
|
|
450
|
+
* Env-layer entries can only LOOSEN policy (`extraDirectives` is
|
|
451
|
+
* APPEND-only over the app-static layer; `reportOnly` / `reportUri`
|
|
452
|
+
* scalars override the app-static value when present;
|
|
453
|
+
* `viteDevLoosening: true` appends `'unsafe-inline'` and
|
|
454
|
+
* `'unsafe-eval'` to `script-src`). There is no `'replace-baseline'`
|
|
455
|
+
* equivalent at this layer — env config exists to LOOSEN per-
|
|
456
|
+
* deployment, not to replace an app's chosen posture. If an env
|
|
457
|
+
* genuinely needs a different posture, the right answer is to fix
|
|
458
|
+
* the app-static layer.
|
|
459
|
+
*
|
|
460
|
+
* # `.optional()` rationale
|
|
461
|
+
*
|
|
462
|
+
* Most environments (local dev, single-frontend SaaS apps that
|
|
463
|
+
* accept the baseline policy verbatim) do not author per-service
|
|
464
|
+
* CSP overrides. Downstream consumers MUST handle both "no overrides
|
|
465
|
+
* authored" and "service key not mapped" as defined no-op fallbacks
|
|
466
|
+
* — never as silent errors.
|
|
467
|
+
*
|
|
468
|
+
* `EnvCspOverrideSchema` is itself `z.strictObject` (csp.schemas.ts),
|
|
469
|
+
* so unknown keys inside an authored override are rejected at the
|
|
470
|
+
* inner-record level — no need to re-apply `.strict()` at the
|
|
471
|
+
* `z.record` value position.
|
|
472
|
+
*/
|
|
473
|
+
csp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
474
|
+
extraDirectives: z.ZodDefault<z.ZodObject<Record<"default-src" | "script-src" | "style-src" | "img-src" | "connect-src" | "font-src" | "frame-src" | "frame-ancestors" | "object-src" | "form-action" | "base-uri" | "manifest-src" | "media-src" | "worker-src", z.ZodOptional<z.ZodArray<z.ZodString>>>, z.core.$strict>>;
|
|
475
|
+
viteDevLoosening: z.ZodOptional<z.ZodBoolean>;
|
|
476
|
+
reportOnly: z.ZodOptional<z.ZodBoolean>;
|
|
477
|
+
reportUri: z.ZodOptional<z.ZodString>;
|
|
478
|
+
}, z.core.$strict>>>;
|
|
479
|
+
/**
|
|
480
|
+
* Per-service OPT-IN to CDN serving, keyed by SaaS-config service key
|
|
481
|
+
* (same keyspace as `serviceHosts` / `csp`). Authoring an `enabled` entry
|
|
482
|
+
* makes the deploy render skip the service's nginx Deployment/Service AND
|
|
483
|
+
* its ingress / compose route — its public host is served off-cluster by a
|
|
484
|
+
* CDN fronting an object-storage bucket, while `runtime.endPoints.publicUrl`
|
|
485
|
+
* stays `<serviceHost>.<publicDomain>` (coherence preserved). See
|
|
486
|
+
* {@link WildoCdnConfigSchema}. `wildo frontend publish` uploads the built
|
|
487
|
+
* `dist/` + re-homes CSP to the edge for these services.
|
|
488
|
+
*
|
|
489
|
+
* `.optional()` — most apps serve every frontend from an nginx pod (no CDN);
|
|
490
|
+
* consumers MUST treat "no cdn authored" and "service key not mapped" as the
|
|
491
|
+
* defined no-op (nginx-served) fallback. `WildoCdnConfigSchema` is itself
|
|
492
|
+
* `z.strictObject`, so unknown keys inside an authored entry are rejected at
|
|
493
|
+
* the inner level — no `.strict()` needed at the `z.record` value position.
|
|
494
|
+
*/
|
|
495
|
+
cdn: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
496
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
497
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
498
|
+
bucketPrefix: z.ZodOptional<z.ZodString>;
|
|
499
|
+
vendor: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
500
|
+
kind: z.ZodLiteral<import(".").CdnVendor.GENERIC>;
|
|
501
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
502
|
+
kind: z.ZodLiteral<import(".").CdnVendor.CLOUDFLARE>;
|
|
503
|
+
zoneId: z.ZodString;
|
|
504
|
+
apiTokenEnvVar: z.ZodDefault<z.ZodString>;
|
|
505
|
+
}, z.core.$strict>], "kind">;
|
|
506
|
+
}, z.core.$strict>>>;
|
|
507
|
+
/**
|
|
508
|
+
* WHERE each declared system of record lives in THIS environment, keyed by the instance name the
|
|
509
|
+
* saas config declares (#1055). See {@link WildoSystemsOfRecordEnvConfigSchema}: either an address,
|
|
510
|
+
* or `{ enabled: false }` for an environment that has no access to the instance at all.
|
|
511
|
+
*
|
|
512
|
+
* `.optional()` — an application that reads nothing out of another system authors none. An instance
|
|
513
|
+
* the saas config DOES declare and this block omits is refused at `wildo config sync` and at boot,
|
|
514
|
+
* because silence is not a declaration of absence; `{ enabled: false }` is.
|
|
515
|
+
*/
|
|
516
|
+
systemsOfRecord: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
517
|
+
enabled: z.ZodLiteral<false>;
|
|
518
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
519
|
+
address: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
520
|
+
}, z.core.$strict>]>>>;
|
|
521
|
+
/**
|
|
522
|
+
* The PLATFORM tier's own object-storage bucket, REMOTE environments only (#1112). See
|
|
523
|
+
* {@link WildoPlatformStorageConfigSchema}: not this application's bucket (that is `backingServices.s3.bucket`),
|
|
524
|
+
* and refused in a local environment, whose platform bucket is a constant shared by every application.
|
|
525
|
+
*/
|
|
526
|
+
platformStorage: z.ZodOptional<z.ZodObject<{
|
|
527
|
+
bucket: z.ZodString;
|
|
528
|
+
}, z.core.$strict>>;
|
|
529
|
+
devCompanion: z.ZodOptional<z.ZodObject<{
|
|
530
|
+
host: z.ZodOptional<z.ZodString>;
|
|
531
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
532
|
+
url: z.ZodOptional<z.ZodString>;
|
|
533
|
+
}, z.core.$strict>>;
|
|
534
|
+
/**
|
|
535
|
+
* Present only on an environment RESOLVED from a hosted descriptor: this application runs on the
|
|
536
|
+
* infrastructure of another application, whose root and descriptor are named here as absolute paths.
|
|
537
|
+
*
|
|
538
|
+
* Never authored in this form. An application declares its host with a RELATIVE
|
|
539
|
+
* `infrastructureHost.applicationRoot` in a hosted descriptor (`defineHostedInfraEnvConfig`, {@link WildoHostedInfraEnvConfigSchema}),
|
|
540
|
+
* and `loadInfraEnvConfig` produces this value while merging the host's platform-level fields in. The
|
|
541
|
+
* absolute-path requirement is what keeps the two apart: a committed descriptor cannot carry a
|
|
542
|
+
* machine-local path, so it cannot pass itself off as already resolved.
|
|
543
|
+
*
|
|
544
|
+
* Every consumer that would otherwise act on SHARED infrastructure — render the platform compose file,
|
|
545
|
+
* converge containers, start or initialize the platform, write platform-service env files, bootstrap a
|
|
546
|
+
* cluster — reads this field and leaves that action to the host.
|
|
547
|
+
*/
|
|
548
|
+
infrastructureHost: z.ZodOptional<z.ZodObject<{
|
|
549
|
+
applicationRoot: z.ZodString;
|
|
550
|
+
infraConfigPath: z.ZodString;
|
|
551
|
+
}, z.core.$strict>>;
|
|
552
|
+
};
|
|
5
553
|
export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
6
554
|
version: z.ZodOptional<z.ZodString>;
|
|
7
555
|
environment: z.ZodString;
|
|
8
556
|
locationType: z.ZodOptional<z.ZodEnum<typeof WildoLocationType>>;
|
|
9
557
|
runtimeEnvironment: z.ZodOptional<z.ZodEnum<typeof RuntimeEnvironment>>;
|
|
10
558
|
runtime: z.ZodEnum<typeof WildoDeploymentRuntime>;
|
|
559
|
+
localDataStorage: z.ZodOptional<z.ZodEnum<typeof WildoLocalDataStorage>>;
|
|
11
560
|
database: z.ZodOptional<z.ZodObject<{
|
|
12
561
|
engine: z.ZodEnum<typeof DatabaseEngine>;
|
|
13
562
|
source: z.ZodEnum<typeof BackingServiceSource>;
|
|
@@ -26,10 +575,10 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
26
575
|
serviceHosts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
27
576
|
kubernetes: z.ZodOptional<z.ZodObject<{
|
|
28
577
|
namespace: z.ZodString;
|
|
29
|
-
ingressClass: z.ZodOptional<z.ZodString>;
|
|
30
578
|
services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
31
579
|
replicas: z.ZodOptional<z.ZodNumber>;
|
|
32
580
|
}, z.core.$strict>>>;
|
|
581
|
+
ingressClass: z.ZodOptional<z.ZodLiteral<"traefik">>;
|
|
33
582
|
}, z.core.$strict>>;
|
|
34
583
|
remoteProvider: z.ZodOptional<z.ZodObject<{
|
|
35
584
|
provider: z.ZodString;
|
|
@@ -41,14 +590,13 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
41
590
|
deployment: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
42
591
|
branch: z.ZodString;
|
|
43
592
|
runtime: z.ZodLiteral<WildoDeploymentRuntime.DOCKER_COMPOSE>;
|
|
44
|
-
imageTagStrategy: z.ZodDefault<z.ZodEnum<typeof
|
|
45
|
-
}, z.core.$
|
|
593
|
+
imageTagStrategy: z.ZodDefault<z.ZodEnum<typeof WildoImageTagStrategy>>;
|
|
594
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
46
595
|
branch: z.ZodString;
|
|
47
596
|
runtime: z.ZodLiteral<WildoDeploymentRuntime.KUBERNETES>;
|
|
48
|
-
registry: z.ZodOptional<z.ZodString>;
|
|
49
597
|
namespace: z.ZodOptional<z.ZodString>;
|
|
50
|
-
imageTagStrategy: z.ZodDefault<z.ZodEnum<typeof
|
|
51
|
-
}, z.core.$
|
|
598
|
+
imageTagStrategy: z.ZodDefault<z.ZodEnum<typeof WildoImageTagStrategy>>;
|
|
599
|
+
}, z.core.$strict>], "runtime">>;
|
|
52
600
|
backingServices: z.ZodObject<{
|
|
53
601
|
mongodb: z.ZodOptional<z.ZodObject<{
|
|
54
602
|
source: z.ZodEnum<typeof BackingServiceSource>;
|
|
@@ -128,6 +676,7 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
128
676
|
primary: z.ZodString;
|
|
129
677
|
whenUnavailable: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
130
678
|
}, z.core.$strict>>>;
|
|
679
|
+
providerConfigurations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
131
680
|
documentationSite: z.ZodOptional<z.ZodObject<{
|
|
132
681
|
apiBaseUrl: z.ZodOptional<z.ZodString>;
|
|
133
682
|
appUrl: z.ZodOptional<z.ZodString>;
|
|
@@ -159,17 +708,34 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
159
708
|
apiTokenEnvVar: z.ZodDefault<z.ZodString>;
|
|
160
709
|
}, z.core.$strict>], "kind">;
|
|
161
710
|
}, z.core.$strict>>>;
|
|
711
|
+
systemsOfRecord: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
712
|
+
enabled: z.ZodLiteral<false>;
|
|
713
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
714
|
+
address: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
715
|
+
}, z.core.$strict>]>>>;
|
|
716
|
+
platformStorage: z.ZodOptional<z.ZodObject<{
|
|
717
|
+
bucket: z.ZodString;
|
|
718
|
+
}, z.core.$strict>>;
|
|
162
719
|
devCompanion: z.ZodOptional<z.ZodObject<{
|
|
163
720
|
host: z.ZodOptional<z.ZodString>;
|
|
164
721
|
port: z.ZodOptional<z.ZodNumber>;
|
|
165
722
|
url: z.ZodOptional<z.ZodString>;
|
|
166
723
|
}, z.core.$strict>>;
|
|
724
|
+
infrastructureHost: z.ZodOptional<z.ZodObject<{
|
|
725
|
+
applicationRoot: z.ZodString;
|
|
726
|
+
infraConfigPath: z.ZodString;
|
|
727
|
+
}, z.core.$strict>>;
|
|
167
728
|
}, z.core.$strict>, z.ZodTransform<{
|
|
168
729
|
version: string;
|
|
169
730
|
environment: string;
|
|
170
731
|
locationType: WildoLocationType;
|
|
171
732
|
runtimeEnvironment: RuntimeEnvironment;
|
|
172
733
|
runtime: WildoDeploymentRuntime;
|
|
734
|
+
/**
|
|
735
|
+
* Resolved here rather than left `undefined` for a downstream consumer to default, so every
|
|
736
|
+
* reader sees one answer. The derivation is total over `WildoLocationType`.
|
|
737
|
+
*/
|
|
738
|
+
localDataStorage: WildoLocalDataStorage;
|
|
173
739
|
/**
|
|
174
740
|
* Projected EXPLICITLY, like every field here — this list IS the contract, and a field omitted
|
|
175
741
|
* from it is silently dropped no matter what the input schema accepted. `undefined` when the
|
|
@@ -188,10 +754,10 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
188
754
|
serviceHosts: Record<string, string>;
|
|
189
755
|
kubernetes: {
|
|
190
756
|
namespace: string;
|
|
191
|
-
ingressClass?: string;
|
|
192
757
|
services?: Record<string, {
|
|
193
758
|
replicas?: number;
|
|
194
759
|
}>;
|
|
760
|
+
ingressClass?: "traefik";
|
|
195
761
|
};
|
|
196
762
|
remoteProvider: {
|
|
197
763
|
provider: string;
|
|
@@ -203,12 +769,11 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
203
769
|
deployment: {
|
|
204
770
|
branch: string;
|
|
205
771
|
runtime: WildoDeploymentRuntime.DOCKER_COMPOSE;
|
|
206
|
-
imageTagStrategy:
|
|
772
|
+
imageTagStrategy: WildoImageTagStrategy;
|
|
207
773
|
} | {
|
|
208
774
|
branch: string;
|
|
209
775
|
runtime: WildoDeploymentRuntime.KUBERNETES;
|
|
210
|
-
imageTagStrategy:
|
|
211
|
-
registry?: string;
|
|
776
|
+
imageTagStrategy: WildoImageTagStrategy;
|
|
212
777
|
namespace?: string;
|
|
213
778
|
};
|
|
214
779
|
backingServices: {
|
|
@@ -285,6 +850,7 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
285
850
|
primary: string;
|
|
286
851
|
whenUnavailable?: string[];
|
|
287
852
|
}>>;
|
|
853
|
+
providerConfigurations: Record<string, Record<string, Record<string, unknown>>>;
|
|
288
854
|
applicationCreationVerification: {
|
|
289
855
|
evidenceDirectory: string;
|
|
290
856
|
silent: boolean;
|
|
@@ -326,6 +892,14 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
326
892
|
apiTokenEnvVar: string;
|
|
327
893
|
};
|
|
328
894
|
}>;
|
|
895
|
+
systemsOfRecord: Record<string, {
|
|
896
|
+
enabled: false;
|
|
897
|
+
} | {
|
|
898
|
+
address: Record<string, string>;
|
|
899
|
+
}>;
|
|
900
|
+
platformStorage: {
|
|
901
|
+
bucket: string;
|
|
902
|
+
};
|
|
329
903
|
documentationSite: {
|
|
330
904
|
apiBaseUrl?: string;
|
|
331
905
|
appUrl?: string;
|
|
@@ -336,6 +910,10 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
336
910
|
port?: number;
|
|
337
911
|
url?: string;
|
|
338
912
|
};
|
|
913
|
+
infrastructureHost: {
|
|
914
|
+
applicationRoot: string;
|
|
915
|
+
infraConfigPath: string;
|
|
916
|
+
};
|
|
339
917
|
}, {
|
|
340
918
|
environment: string;
|
|
341
919
|
runtime: WildoDeploymentRuntime;
|
|
@@ -400,6 +978,7 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
400
978
|
version?: string;
|
|
401
979
|
locationType?: WildoLocationType;
|
|
402
980
|
runtimeEnvironment?: RuntimeEnvironment;
|
|
981
|
+
localDataStorage?: WildoLocalDataStorage;
|
|
403
982
|
database?: {
|
|
404
983
|
engine: DatabaseEngine;
|
|
405
984
|
source: BackingServiceSource;
|
|
@@ -411,10 +990,10 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
411
990
|
serviceHosts?: Record<string, string>;
|
|
412
991
|
kubernetes?: {
|
|
413
992
|
namespace: string;
|
|
414
|
-
ingressClass?: string;
|
|
415
993
|
services?: Record<string, {
|
|
416
994
|
replicas?: number;
|
|
417
995
|
}>;
|
|
996
|
+
ingressClass?: "traefik";
|
|
418
997
|
};
|
|
419
998
|
remoteProvider?: {
|
|
420
999
|
provider: string;
|
|
@@ -426,12 +1005,11 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
426
1005
|
deployment?: {
|
|
427
1006
|
branch: string;
|
|
428
1007
|
runtime: WildoDeploymentRuntime.DOCKER_COMPOSE;
|
|
429
|
-
imageTagStrategy:
|
|
1008
|
+
imageTagStrategy: WildoImageTagStrategy;
|
|
430
1009
|
} | {
|
|
431
1010
|
branch: string;
|
|
432
1011
|
runtime: WildoDeploymentRuntime.KUBERNETES;
|
|
433
|
-
imageTagStrategy:
|
|
434
|
-
registry?: string;
|
|
1012
|
+
imageTagStrategy: WildoImageTagStrategy;
|
|
435
1013
|
namespace?: string;
|
|
436
1014
|
};
|
|
437
1015
|
logging?: {
|
|
@@ -451,6 +1029,7 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
451
1029
|
primary: string;
|
|
452
1030
|
whenUnavailable?: string[];
|
|
453
1031
|
}>>;
|
|
1032
|
+
providerConfigurations?: Record<string, Record<string, Record<string, unknown>>>;
|
|
454
1033
|
documentationSite?: {
|
|
455
1034
|
apiBaseUrl?: string;
|
|
456
1035
|
appUrl?: string;
|
|
@@ -497,14 +1076,305 @@ export declare const WildoInfraEnvConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
497
1076
|
apiTokenEnvVar: string;
|
|
498
1077
|
};
|
|
499
1078
|
}>;
|
|
1079
|
+
systemsOfRecord?: Record<string, {
|
|
1080
|
+
enabled: false;
|
|
1081
|
+
} | {
|
|
1082
|
+
address: Record<string, string>;
|
|
1083
|
+
}>;
|
|
1084
|
+
platformStorage?: {
|
|
1085
|
+
bucket: string;
|
|
1086
|
+
};
|
|
500
1087
|
devCompanion?: {
|
|
501
1088
|
host?: string;
|
|
502
1089
|
port?: number;
|
|
503
1090
|
url?: string;
|
|
504
1091
|
};
|
|
1092
|
+
infrastructureHost?: {
|
|
1093
|
+
applicationRoot: string;
|
|
1094
|
+
infraConfigPath: string;
|
|
1095
|
+
};
|
|
505
1096
|
}>>;
|
|
506
1097
|
export type WildoInfraEnvConfig = z.output<typeof WildoInfraEnvConfigSchema>;
|
|
507
1098
|
export type WildoInfraEnvConfigInput = z.input<typeof WildoInfraEnvConfigSchema>;
|
|
1099
|
+
/**
|
|
1100
|
+
* Who decides one member of an environment descriptor when the application is HOSTED.
|
|
1101
|
+
*
|
|
1102
|
+
* Several applications share one platform per environment: one application OWNS the infrastructure
|
|
1103
|
+
* (the platform services and every backing service), and the others reference it through
|
|
1104
|
+
* `infrastructureHost`. Each member of the descriptor belongs to exactly one side, and this vocabulary is
|
|
1105
|
+
* how that is stated — per member, in {@link INFRA_ENV_FIELD_OWNERSHIP}, so a member added tomorrow cannot
|
|
1106
|
+
* compile until somebody decides whose it is.
|
|
1107
|
+
*/
|
|
1108
|
+
export declare enum InfraEnvFieldOwner {
|
|
1109
|
+
/**
|
|
1110
|
+
* The hosted application authors it, and it may differ from the host's: its public domain, its CSP,
|
|
1111
|
+
* its provider choices, its companion port. Taken verbatim from the hosted descriptor.
|
|
1112
|
+
*/
|
|
1113
|
+
APPLICATION = "application",
|
|
1114
|
+
/**
|
|
1115
|
+
* The host decides it, and a hosted descriptor may not author it: the runtime, the platform database,
|
|
1116
|
+
* the cluster, the remote provider, the platform bucket. Authoring one in a hosted descriptor is
|
|
1117
|
+
* refused — two applications on one platform cannot disagree about what that platform is.
|
|
1118
|
+
*/
|
|
1119
|
+
HOST = "host",
|
|
1120
|
+
/**
|
|
1121
|
+
* Split inside the member. Backing services: the host owns each SERVER (`source`, `host`, `port`,
|
|
1122
|
+
* `provider`, `endpoint`), the application owns its NAME on that server (database, vhost, bucket).
|
|
1123
|
+
* Kubernetes: the host owns the namespace and ingress class, the application its replica counts.
|
|
1124
|
+
* Deployment: the host owns the runtime, the application its branch and image tagging.
|
|
1125
|
+
*/
|
|
1126
|
+
PARTITIONED = "partitioned",
|
|
1127
|
+
/**
|
|
1128
|
+
* Produced by resolution and never authored in its resolved form (`infrastructureHost`).
|
|
1129
|
+
*/
|
|
1130
|
+
RESOLUTION = "resolution"
|
|
1131
|
+
}
|
|
1132
|
+
/**
|
|
1133
|
+
* Whose decision each member of a standalone descriptor is, when the application is hosted.
|
|
1134
|
+
*
|
|
1135
|
+
* Total over {@link WILDO_INFRA_ENV_CONFIG_SHAPE} by type, which is the point: `providerConfigurations`
|
|
1136
|
+
* landed on the shape while this feature was being written, and a hosted descriptor built from a
|
|
1137
|
+
* hand-kept list would have dropped it silently. `hosted-infra-env-config.test.ts` pins that the hosted
|
|
1138
|
+
* schema accepts exactly the APPLICATION and PARTITIONED members.
|
|
1139
|
+
*/
|
|
1140
|
+
export declare const INFRA_ENV_FIELD_OWNERSHIP: Readonly<Record<keyof typeof WILDO_INFRA_ENV_CONFIG_SHAPE, InfraEnvFieldOwner>>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Which field of a backing-service entry names the APPLICATION'S OWN slice of a shared server.
|
|
1143
|
+
*
|
|
1144
|
+
* `mustDifferFromHost` is true where the framework's fallback for an unnamed slice is a SHARED constant —
|
|
1145
|
+
* `'wildo_app'` for a Mongo or PostgreSQL database, the default vhost `/`, the fixed platform bucket. On
|
|
1146
|
+
* those servers two applications that name the same slice are one application's data, silently, so a
|
|
1147
|
+
* hosted application must name its own and it must not be the host's. Redis is exempt: every application
|
|
1148
|
+
* already shares index 0, isolated by its own ACL principal and key prefix. Immudb's `database` has no
|
|
1149
|
+
* consumer today, so it is stripped from the host's entry and not authored by the hosted one.
|
|
1150
|
+
*/
|
|
1151
|
+
export declare const BACKING_SERVICE_APPLICATION_NAME_FIELDS: {
|
|
1152
|
+
readonly mongodb: {
|
|
1153
|
+
readonly field: "database";
|
|
1154
|
+
readonly mustDifferFromHost: true;
|
|
1155
|
+
};
|
|
1156
|
+
readonly redis: {
|
|
1157
|
+
readonly field: "database";
|
|
1158
|
+
readonly mustDifferFromHost: false;
|
|
1159
|
+
};
|
|
1160
|
+
readonly rabbitmq: {
|
|
1161
|
+
readonly field: "vhost";
|
|
1162
|
+
readonly mustDifferFromHost: true;
|
|
1163
|
+
};
|
|
1164
|
+
readonly s3: {
|
|
1165
|
+
readonly field: "bucket";
|
|
1166
|
+
readonly mustDifferFromHost: true;
|
|
1167
|
+
};
|
|
1168
|
+
readonly postgresql: {
|
|
1169
|
+
readonly field: "database";
|
|
1170
|
+
readonly mustDifferFromHost: true;
|
|
1171
|
+
};
|
|
1172
|
+
readonly clamav: any;
|
|
1173
|
+
readonly immudb: {
|
|
1174
|
+
readonly field: "database";
|
|
1175
|
+
readonly mustDifferFromHost: false;
|
|
1176
|
+
};
|
|
1177
|
+
readonly backup: any;
|
|
1178
|
+
};
|
|
1179
|
+
/**
|
|
1180
|
+
* The backing services a HOSTED application uses — each one a store its host must declare.
|
|
1181
|
+
*
|
|
1182
|
+
* Listing a kind is how the application states it NEEDS that store; the entry carries only the
|
|
1183
|
+
* application's own name on the host's server. Every name field is REQUIRED where
|
|
1184
|
+
* {@link BACKING_SERVICE_APPLICATION_NAME_FIELDS} says the unnamed fallback is shared.
|
|
1185
|
+
*/
|
|
1186
|
+
export declare const HostedBackingServicesEnvConfigSchema: z.ZodObject<{
|
|
1187
|
+
mongodb: z.ZodOptional<z.ZodObject<{
|
|
1188
|
+
database: z.ZodString;
|
|
1189
|
+
}, z.core.$strict>>;
|
|
1190
|
+
redis: z.ZodOptional<z.ZodObject<{
|
|
1191
|
+
database: z.ZodOptional<z.ZodNumber>;
|
|
1192
|
+
}, z.core.$strict>>;
|
|
1193
|
+
rabbitmq: z.ZodOptional<z.ZodObject<{
|
|
1194
|
+
vhost: z.ZodString;
|
|
1195
|
+
}, z.core.$strict>>;
|
|
1196
|
+
s3: z.ZodOptional<z.ZodObject<{
|
|
1197
|
+
bucket: z.ZodString;
|
|
1198
|
+
}, z.core.$strict>>;
|
|
1199
|
+
postgresql: z.ZodOptional<z.ZodObject<{
|
|
1200
|
+
database: z.ZodString;
|
|
1201
|
+
}, z.core.$strict>>;
|
|
1202
|
+
clamav: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
|
|
1203
|
+
immudb: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
|
|
1204
|
+
backup: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
|
|
1205
|
+
}, z.core.$strict>;
|
|
1206
|
+
export type HostedBackingServicesEnvConfig = z.output<typeof HostedBackingServicesEnvConfigSchema>;
|
|
1207
|
+
/** @wildo_source:part:start platform.config.infrastructure-host facet:layer:platform facet:family:bootstrap facet:audience:app-developer */
|
|
1208
|
+
/**
|
|
1209
|
+
* An environment descriptor for an application that runs on ANOTHER application's infrastructure.
|
|
1210
|
+
*
|
|
1211
|
+
* One application per environment owns the infrastructure — its platform services (apps-manager,
|
|
1212
|
+
* module-registry, crontabs) and every backing service. Other applications declare that owner as their
|
|
1213
|
+
* `infrastructureHost` and author only what is theirs: domain, CSP, provider choices, companion address,
|
|
1214
|
+
* and their own database/vhost/bucket names on the host's servers. Everything else comes from the host's
|
|
1215
|
+
* descriptor for the SAME environment when the descriptor is loaded, so the two cannot diverge — not in
|
|
1216
|
+
* which stores exist, not in how they are reached, not between Docker Compose and Kubernetes.
|
|
1217
|
+
*
|
|
1218
|
+
* The link is per environment: author it in `wildo.infra.local.config.ts` to share a local platform while
|
|
1219
|
+
* `staging` stays standalone, or in both.
|
|
1220
|
+
*
|
|
1221
|
+
* Refusals, all at load time, all naming both descriptors:
|
|
1222
|
+
* - the host root holds no `wildo.saas.config.ts` — a hosted application needs its host's SOURCE checked
|
|
1223
|
+
* out at that path;
|
|
1224
|
+
* - the host has no descriptor for this environment, or is itself hosted;
|
|
1225
|
+
* - a store this application lists is not declared by the host;
|
|
1226
|
+
* - a database, vhost or bucket name equals the host's.
|
|
1227
|
+
*
|
|
1228
|
+
* @example Wonder CRM on Wonder Todos' local platform.
|
|
1229
|
+
* ```ts
|
|
1230
|
+
* export default defineHostedInfraEnvConfig({
|
|
1231
|
+
* environment: WildoEnvironment.LOCAL,
|
|
1232
|
+
* infrastructureHost: { applicationRoot: '../wonder-todos' },
|
|
1233
|
+
* publicDomain: 'localhost',
|
|
1234
|
+
* applicationDatabase: { engine: DatabaseEngine.POSTGRESQL },
|
|
1235
|
+
* backingServices: {
|
|
1236
|
+
* postgresql: { database: 'wonder-crm-db' },
|
|
1237
|
+
* redis: { database: 0 },
|
|
1238
|
+
* rabbitmq: { vhost: 'wonder-crm' },
|
|
1239
|
+
* s3: { bucket: 'wonder-crm-local' },
|
|
1240
|
+
* },
|
|
1241
|
+
* devCompanion: { host: 'localhost', port: 4351 },
|
|
1242
|
+
* });
|
|
1243
|
+
* ```
|
|
1244
|
+
*/
|
|
1245
|
+
export declare const WildoHostedInfraEnvConfigSchema: z.ZodObject<{
|
|
1246
|
+
infrastructureHost: z.ZodObject<{
|
|
1247
|
+
/**
|
|
1248
|
+
* The host application's root — the directory holding its `wildo.saas.config.ts` — RELATIVE to this
|
|
1249
|
+
* application's root. Relative because the descriptor is committed: an absolute path is one machine's
|
|
1250
|
+
* checkout layout, and would break on every other.
|
|
1251
|
+
*/
|
|
1252
|
+
applicationRoot: z.ZodString;
|
|
1253
|
+
}, z.core.$strict>;
|
|
1254
|
+
version: z.ZodOptional<z.ZodString>;
|
|
1255
|
+
environment: z.ZodString;
|
|
1256
|
+
applicationDatabase: z.ZodOptional<z.ZodObject<{
|
|
1257
|
+
engine: z.ZodEnum<typeof DatabaseEngine>;
|
|
1258
|
+
}, z.core.$strict>>;
|
|
1259
|
+
publicDomain: z.ZodString;
|
|
1260
|
+
serviceHosts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1261
|
+
kubernetes: z.ZodOptional<z.ZodObject<{
|
|
1262
|
+
services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1263
|
+
replicas: z.ZodOptional<z.ZodNumber>;
|
|
1264
|
+
}, z.core.$strict>>>;
|
|
1265
|
+
}, z.core.$strict>>;
|
|
1266
|
+
deployment: z.ZodOptional<z.ZodObject<{
|
|
1267
|
+
branch: z.ZodString;
|
|
1268
|
+
imageTagStrategy: z.ZodOptional<z.ZodEnum<typeof WildoImageTagStrategy>>;
|
|
1269
|
+
}, z.core.$strict>>;
|
|
1270
|
+
backingServices: z.ZodOptional<z.ZodObject<{
|
|
1271
|
+
mongodb: z.ZodOptional<z.ZodObject<{
|
|
1272
|
+
database: z.ZodString;
|
|
1273
|
+
}, z.core.$strict>>;
|
|
1274
|
+
redis: z.ZodOptional<z.ZodObject<{
|
|
1275
|
+
database: z.ZodOptional<z.ZodNumber>;
|
|
1276
|
+
}, z.core.$strict>>;
|
|
1277
|
+
rabbitmq: z.ZodOptional<z.ZodObject<{
|
|
1278
|
+
vhost: z.ZodString;
|
|
1279
|
+
}, z.core.$strict>>;
|
|
1280
|
+
s3: z.ZodOptional<z.ZodObject<{
|
|
1281
|
+
bucket: z.ZodString;
|
|
1282
|
+
}, z.core.$strict>>;
|
|
1283
|
+
postgresql: z.ZodOptional<z.ZodObject<{
|
|
1284
|
+
database: z.ZodString;
|
|
1285
|
+
}, z.core.$strict>>;
|
|
1286
|
+
clamav: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
|
|
1287
|
+
immudb: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
|
|
1288
|
+
backup: z.ZodOptional<z.ZodObject<{}, z.core.$strict>>;
|
|
1289
|
+
}, z.core.$strict>>;
|
|
1290
|
+
logging: z.ZodOptional<z.ZodObject<{
|
|
1291
|
+
level: z.ZodDefault<z.ZodEnum<{
|
|
1292
|
+
error: "error";
|
|
1293
|
+
debug: "debug";
|
|
1294
|
+
info: "info";
|
|
1295
|
+
warn: "warn";
|
|
1296
|
+
}>>;
|
|
1297
|
+
formattedConsoleErrors: z.ZodOptional<z.ZodBoolean>;
|
|
1298
|
+
}, z.core.$strip>>;
|
|
1299
|
+
observability: z.ZodOptional<z.ZodObject<{
|
|
1300
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1301
|
+
endpoint: z.ZodOptional<z.ZodString>;
|
|
1302
|
+
llmObservability: z.ZodOptional<z.ZodObject<{
|
|
1303
|
+
captureContent: z.ZodDefault<z.ZodBoolean>;
|
|
1304
|
+
sampleRate: z.ZodOptional<z.ZodNumber>;
|
|
1305
|
+
providerEnv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
1306
|
+
}, z.core.$strip>>;
|
|
1307
|
+
}, z.core.$strip>>;
|
|
1308
|
+
providerSelection: z.ZodOptional<z.ZodRecord<z.ZodEnum<typeof import("@wildo-ai/saas-models").EngineCapability> & z.core.$partial, z.ZodObject<{
|
|
1309
|
+
primary: z.ZodString;
|
|
1310
|
+
whenUnavailable: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1311
|
+
}, z.core.$strict>>>;
|
|
1312
|
+
providerConfigurations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>>;
|
|
1313
|
+
systemsOfRecord: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
1314
|
+
enabled: z.ZodLiteral<false>;
|
|
1315
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1316
|
+
address: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
1317
|
+
}, z.core.$strict>]>>>;
|
|
1318
|
+
documentationSite: z.ZodOptional<z.ZodObject<{
|
|
1319
|
+
apiBaseUrl: z.ZodOptional<z.ZodString>;
|
|
1320
|
+
appUrl: z.ZodOptional<z.ZodString>;
|
|
1321
|
+
frontendServiceName: z.ZodOptional<z.ZodString>;
|
|
1322
|
+
}, z.core.$strip>>;
|
|
1323
|
+
applicationCreationVerification: z.ZodOptional<z.ZodObject<{
|
|
1324
|
+
evidenceDirectory: z.ZodString;
|
|
1325
|
+
silent: z.ZodDefault<z.ZodBoolean>;
|
|
1326
|
+
}, z.core.$strict>>;
|
|
1327
|
+
serviceAuth: z.ZodOptional<z.ZodObject<{
|
|
1328
|
+
accessTokenExpirationMinutes: z.ZodDefault<z.ZodNumber>;
|
|
1329
|
+
refreshTokenExpirationDays: z.ZodDefault<z.ZodNumber>;
|
|
1330
|
+
}, z.core.$strict>>;
|
|
1331
|
+
csp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1332
|
+
extraDirectives: z.ZodDefault<z.ZodObject<Record<"default-src" | "script-src" | "style-src" | "img-src" | "connect-src" | "font-src" | "frame-src" | "frame-ancestors" | "object-src" | "form-action" | "base-uri" | "manifest-src" | "media-src" | "worker-src", z.ZodOptional<z.ZodArray<z.ZodString>>>, z.core.$strict>>;
|
|
1333
|
+
viteDevLoosening: z.ZodOptional<z.ZodBoolean>;
|
|
1334
|
+
reportOnly: z.ZodOptional<z.ZodBoolean>;
|
|
1335
|
+
reportUri: z.ZodOptional<z.ZodString>;
|
|
1336
|
+
}, z.core.$strict>>>;
|
|
1337
|
+
cdn: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1338
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
1339
|
+
bucket: z.ZodOptional<z.ZodString>;
|
|
1340
|
+
bucketPrefix: z.ZodOptional<z.ZodString>;
|
|
1341
|
+
vendor: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1342
|
+
kind: z.ZodLiteral<import(".").CdnVendor.GENERIC>;
|
|
1343
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
1344
|
+
kind: z.ZodLiteral<import(".").CdnVendor.CLOUDFLARE>;
|
|
1345
|
+
zoneId: z.ZodString;
|
|
1346
|
+
apiTokenEnvVar: z.ZodDefault<z.ZodString>;
|
|
1347
|
+
}, z.core.$strict>], "kind">;
|
|
1348
|
+
}, z.core.$strict>>>;
|
|
1349
|
+
devCompanion: z.ZodOptional<z.ZodObject<{
|
|
1350
|
+
host: z.ZodOptional<z.ZodString>;
|
|
1351
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
1352
|
+
url: z.ZodOptional<z.ZodString>;
|
|
1353
|
+
}, z.core.$strict>>;
|
|
1354
|
+
}, z.core.$strict>;
|
|
1355
|
+
/** @wildo_source:part:end platform.config.infrastructure-host */
|
|
1356
|
+
export type WildoHostedInfraEnvConfig = z.output<typeof WildoHostedInfraEnvConfigSchema>;
|
|
1357
|
+
export type WildoHostedInfraEnvConfigInput = z.input<typeof WildoHostedInfraEnvConfigSchema>;
|
|
1358
|
+
/**
|
|
1359
|
+
* What an authored `wildo.infra.<env>.config.ts` evaluates to: a standalone descriptor, or a hosted one
|
|
1360
|
+
* that is NOT usable until `loadInfraEnvConfig` resolves it against its host.
|
|
1361
|
+
*/
|
|
1362
|
+
export type WildoAuthoredInfraEnvConfig = WildoInfraEnvConfig | WildoHostedInfraEnvConfig;
|
|
1363
|
+
/**
|
|
1364
|
+
* Whether an evaluated descriptor is a hosted one still awaiting resolution.
|
|
1365
|
+
*
|
|
1366
|
+
* Keyed on the AUTHORED key, exactly as {@link defineInfraEnvConfig} dispatches: an `infrastructureHost`
|
|
1367
|
+
* in its authored form, which names a relative root and no `infraConfigPath`. A RESOLVED hosted
|
|
1368
|
+
* environment carries `infraConfigPath` and is a {@link WildoInfraEnvConfig} — consumers ask
|
|
1369
|
+
* `config.infrastructureHost !== undefined` for that.
|
|
1370
|
+
*
|
|
1371
|
+
* An earlier revision keyed on the absence of `runtime`, reasoning that every standalone descriptor
|
|
1372
|
+
* requires it. That holds for a descriptor built through `defineInfraEnvConfig` and not for a plain
|
|
1373
|
+
* `export default {…}` object, which the loader also evaluates: a partial standalone descriptor with no
|
|
1374
|
+
* `runtime` was read as hosted and crashed on its missing host. Discriminate on what the author wrote,
|
|
1375
|
+
* never on what a schema happens to require.
|
|
1376
|
+
*/
|
|
1377
|
+
export declare function isHostedInfraEnvConfig(config: WildoAuthoredInfraEnvConfig): config is WildoHostedInfraEnvConfig;
|
|
508
1378
|
/**
|
|
509
1379
|
* Scope `csp.<serviceKey>` warning suppression to the current async load path.
|
|
510
1380
|
*
|
|
@@ -531,4 +1401,18 @@ export declare function withConsumedInfraCspServiceKeys<T>(serviceKeys: Iterable
|
|
|
531
1401
|
* format = single-line with backlog ID).
|
|
532
1402
|
*/
|
|
533
1403
|
export declare function defineInfraEnvConfig(config: WildoInfraEnvConfigInput): WildoInfraEnvConfig;
|
|
1404
|
+
/**
|
|
1405
|
+
* Define an environment descriptor for an application that runs on ANOTHER application's infrastructure.
|
|
1406
|
+
* See {@link WildoHostedInfraEnvConfigSchema} for what it may author and what comes from the host.
|
|
1407
|
+
*
|
|
1408
|
+
* A separate entry point rather than a variant of {@link defineInfraEnvConfig}, deliberately. "This
|
|
1409
|
+
* environment owns its platform" and "this environment runs on someone else's" are different decisions
|
|
1410
|
+
* with different fields, and one function accepting both made a type error in either shape report as "No
|
|
1411
|
+
* overload matches this call" at the call instead of at the offending property — worse feedback for every
|
|
1412
|
+
* author of every descriptor, standalone ones included.
|
|
1413
|
+
*
|
|
1414
|
+
* The result is NOT an environment yet: `loadInfraEnvConfig` resolves it against the host.
|
|
1415
|
+
*/
|
|
1416
|
+
export declare function defineHostedInfraEnvConfig(config: WildoHostedInfraEnvConfigInput): WildoHostedInfraEnvConfig;
|
|
1417
|
+
export {};
|
|
534
1418
|
//# sourceMappingURL=define-infra-env-config.d.ts.map
|