@fabrika/provider-zerops 0.9.0-dev.1 → 0.9.0-dev.2

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.
Files changed (93) hide show
  1. package/package.json +15 -14
  2. package/src/execution.ts +45 -8
  3. package/types/src/api/client.d.ts +5 -0
  4. package/types/src/api/errors.d.ts +24 -0
  5. package/types/src/api/polling.d.ts +41 -0
  6. package/types/src/api/readers.d.ts +977 -0
  7. package/types/src/api/service-env-limit.d.ts +17 -0
  8. package/types/src/api/service-env-response.d.ts +23 -0
  9. package/types/src/api/types.d.ts +638 -0
  10. package/types/src/api.d.ts +6 -0
  11. package/types/src/authoring.d.ts +9 -0
  12. package/types/src/cli-args.d.ts +19 -0
  13. package/types/src/cli.d.ts +10 -0
  14. package/types/src/collaborators.d.ts +18 -0
  15. package/types/src/compile.d.ts +91 -0
  16. package/types/src/control.d.ts +41 -0
  17. package/types/src/database-budget.d.ts +38 -0
  18. package/types/src/descriptor.d.ts +28 -0
  19. package/types/src/execution.d.ts +137 -0
  20. package/types/src/exposure.d.ts +47 -0
  21. package/types/src/index.d.ts +31 -0
  22. package/types/src/installation/admin-options.d.ts +24 -0
  23. package/types/src/installation/admin.d.ts +35 -0
  24. package/types/src/installation/checker-release.d.ts +12 -0
  25. package/types/src/installation/deploy-options.d.ts +37 -0
  26. package/types/src/installation/deploy.d.ts +96 -0
  27. package/types/src/installation/generated/platform-console-schema.d.ts +2 -0
  28. package/types/src/installation/generated/platform-proxy-manifest.d.ts +2 -0
  29. package/types/src/installation/hosts.d.ts +38 -0
  30. package/types/src/installation/index.d.ts +9 -0
  31. package/types/src/installation/init-options.d.ts +38 -0
  32. package/types/src/installation/init.d.ts +60 -0
  33. package/types/src/installation/install-collaborators.d.ts +24 -0
  34. package/types/src/installation/install-environment.d.ts +70 -0
  35. package/types/src/installation/install-options.d.ts +49 -0
  36. package/types/src/installation/install-project.d.ts +13 -0
  37. package/types/src/installation/install-provisioning.d.ts +58 -0
  38. package/types/src/installation/install-secrets.d.ts +30 -0
  39. package/types/src/installation/install-token.d.ts +10 -0
  40. package/types/src/installation/install.d.ts +23 -0
  41. package/types/src/installation/installation-source.d.ts +8 -0
  42. package/types/src/installation/log.d.ts +44 -0
  43. package/types/src/installation/machine-key.d.ts +19 -0
  44. package/types/src/installation/mcp.d.ts +18 -0
  45. package/types/src/installation/placement-options.d.ts +11 -0
  46. package/types/src/installation/platform-archive.d.ts +7 -0
  47. package/types/src/installation/platform-source.d.ts +8 -0
  48. package/types/src/installation/platform-upload.d.ts +3 -0
  49. package/types/src/installation/proxy-manifest.d.ts +105 -0
  50. package/types/src/installation/secrets.d.ts +17 -0
  51. package/types/src/installation/sidecar.d.ts +51 -0
  52. package/types/src/installation/source-options.d.ts +1 -0
  53. package/types/src/installation/topology/artifacts.d.ts +8 -0
  54. package/types/src/installation/topology/index.d.ts +5 -0
  55. package/types/src/installation/topology/installation-schemas.d.ts +2242 -0
  56. package/types/src/installation/topology/invariants.d.ts +23 -0
  57. package/types/src/installation/topology/setups.d.ts +58 -0
  58. package/types/src/installation/topology/topology.d.ts +148 -0
  59. package/types/src/installation/topology/validate.d.ts +11 -0
  60. package/types/src/installation/upgrade-options.d.ts +26 -0
  61. package/types/src/installation/upgrade-output.d.ts +6 -0
  62. package/types/src/installation/upgrade.d.ts +88 -0
  63. package/types/src/managed-env.d.ts +57 -0
  64. package/types/src/manifest.d.ts +206 -0
  65. package/types/src/namespace/claims.d.ts +3 -0
  66. package/types/src/namespace/codec.d.ts +334 -0
  67. package/types/src/namespace/constants.d.ts +25 -0
  68. package/types/src/namespace/errors.d.ts +15 -0
  69. package/types/src/namespace/manifest.d.ts +4 -0
  70. package/types/src/namespace/operator.d.ts +12 -0
  71. package/types/src/namespace/provisioning.d.ts +4 -0
  72. package/types/src/namespace/proxy-attempt.d.ts +36 -0
  73. package/types/src/namespace/proxy-reads.d.ts +33 -0
  74. package/types/src/namespace/proxy-secrets.d.ts +8 -0
  75. package/types/src/namespace/proxy-source.d.ts +74 -0
  76. package/types/src/namespace/topology.d.ts +9 -0
  77. package/types/src/namespace/types.d.ts +99 -0
  78. package/types/src/namespace/update.d.ts +6 -0
  79. package/types/src/namespace/validation.d.ts +12 -0
  80. package/types/src/namespace.d.ts +9 -0
  81. package/types/src/plan.d.ts +12 -0
  82. package/types/src/provider.d.ts +65 -0
  83. package/types/src/proxy-manifest-carrier.d.ts +16 -0
  84. package/types/src/schema.generated.d.ts +376 -0
  85. package/types/src/service-names.d.ts +4 -0
  86. package/types/src/service-references.d.ts +13 -0
  87. package/types/src/source/constants.d.ts +6 -0
  88. package/types/src/source/port.d.ts +60 -0
  89. package/types/src/source/types.d.ts +4 -0
  90. package/types/src/source/validation.d.ts +19 -0
  91. package/types/src/source.d.ts +2 -0
  92. package/types/src/types.d.ts +121 -0
  93. package/types/src/version-attempt.d.ts +8 -0
@@ -0,0 +1,334 @@
1
+ import type { ProviderCodec, ProviderDeploymentNamespace, ProviderEnvelope, ProviderNamespaceMutationInput } from '@fabrika/provider-contract';
2
+ import { z } from 'zod';
3
+ import type { NormalizedZeropsNamespaceTarget, ZeropsNamespaceOptions, ZeropsNamespaceTarget } from './types';
4
+ /** The one value an update may give `proxySource`: re-pin the namespace's proxy to the installation's default. */
5
+ export declare const ZEROPS_PROXY_SOURCE_CURRENT = "current";
6
+ export declare const postgresSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
7
+ type: z.ZodLiteral<"postgresql:ha@18">;
8
+ profile: z.ZodOptional<z.ZodEnum<["oltp-staging", "oltp-production", "oltp-enterprise", "olap-production", "writeheavy-production"]>>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ type: "postgresql:ha@18";
11
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
12
+ }, {
13
+ type: "postgresql:ha@18";
14
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
15
+ }>, z.ZodObject<{
16
+ type: z.ZodLiteral<"postgresql:single@18">;
17
+ profile: z.ZodOptional<z.ZodEnum<["oltp-hobby", "oltp-staging", "oltp-production", "olap-production", "writeheavy-production"]>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ type: "postgresql:single@18";
20
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
21
+ }, {
22
+ type: "postgresql:single@18";
23
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
24
+ }>]>, {
25
+ type: "postgresql:ha@18";
26
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
27
+ } | {
28
+ type: "postgresql:single@18";
29
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
30
+ }, {
31
+ type: "postgresql:ha@18";
32
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
33
+ } | {
34
+ type: "postgresql:single@18";
35
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
36
+ }>;
37
+ /**
38
+ * What an update request's payload may name: any target field, each optional, and no field the target
39
+ * does not have — at the top level or inside `postgres`. The target schema STRIPS an unknown key, which
40
+ * would turn a misspelt field into a silent no-op. `proxySource` also takes `current`, the installation's
41
+ * default pin; the plan refuses any other pin than that one (ADR-0045).
42
+ */
43
+ export declare const namespaceUpdatePayloadSchema: z.ZodObject<{
44
+ proxyDeployment: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodObject<{
45
+ manifestSha256: z.ZodOptional<z.ZodString>;
46
+ appVersionId: z.ZodString;
47
+ repository: z.ZodObject<{
48
+ owner: z.ZodString;
49
+ name: z.ZodEffects<z.ZodString, string, string>;
50
+ }, "strict", z.ZodTypeAny, {
51
+ name: string;
52
+ owner: string;
53
+ }, {
54
+ name: string;
55
+ owner: string;
56
+ }>;
57
+ commitSha: z.ZodString;
58
+ descriptorSha256: z.ZodString;
59
+ }, "strict", z.ZodTypeAny, {
60
+ commitSha: string;
61
+ appVersionId: string;
62
+ repository: {
63
+ name: string;
64
+ owner: string;
65
+ };
66
+ descriptorSha256: string;
67
+ manifestSha256?: string | undefined;
68
+ }, {
69
+ commitSha: string;
70
+ appVersionId: string;
71
+ repository: {
72
+ name: string;
73
+ owner: string;
74
+ };
75
+ descriptorSha256: string;
76
+ manifestSha256?: string | undefined;
77
+ }>, {
78
+ commitSha: string;
79
+ appVersionId: string;
80
+ repository: {
81
+ name: string;
82
+ owner: string;
83
+ };
84
+ descriptorSha256: string;
85
+ manifestSha256?: string | undefined;
86
+ }, {
87
+ commitSha: string;
88
+ appVersionId: string;
89
+ repository: {
90
+ name: string;
91
+ owner: string;
92
+ };
93
+ descriptorSha256: string;
94
+ manifestSha256?: string | undefined;
95
+ }>>>;
96
+ proxyBuild: z.ZodOptional<z.ZodOptional<z.ZodEffects<z.ZodObject<{
97
+ appVersionId: z.ZodString;
98
+ triggered: z.ZodBoolean;
99
+ manifestSha256: z.ZodOptional<z.ZodString>;
100
+ }, "strict", z.ZodTypeAny, {
101
+ appVersionId: string;
102
+ triggered: boolean;
103
+ manifestSha256?: string | undefined;
104
+ }, {
105
+ appVersionId: string;
106
+ triggered: boolean;
107
+ manifestSha256?: string | undefined;
108
+ }>, {
109
+ appVersionId: string;
110
+ triggered: boolean;
111
+ manifestSha256?: string | undefined;
112
+ }, {
113
+ appVersionId: string;
114
+ triggered: boolean;
115
+ manifestSha256?: string | undefined;
116
+ }>>>;
117
+ projectName: z.ZodOptional<z.ZodOptional<z.ZodString>>;
118
+ corePackage: z.ZodOptional<z.ZodOptional<z.ZodEnum<["LIGHT", "SERIOUS"]>>>;
119
+ publicAccess: z.ZodOptional<z.ZodOptional<z.ZodEnum<["custom-domain", "zerops-subdomain"]>>>;
120
+ managed: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
121
+ projectId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
122
+ proxyServiceId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
123
+ postgresServiceId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
124
+ proxyConfigured: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
125
+ proxyBaselineSequence: z.ZodOptional<z.ZodOptional<z.ZodNumber>>;
126
+ proxyAppVersionId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
127
+ proxyHosts: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
128
+ host: z.ZodString;
129
+ port: z.ZodNumber;
130
+ }, "strip", z.ZodTypeAny, {
131
+ port: number;
132
+ host: string;
133
+ }, {
134
+ port: number;
135
+ host: string;
136
+ }>, "many">>>;
137
+ ready: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
138
+ } & {
139
+ postgres: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
140
+ type: z.ZodLiteral<"postgresql:ha@18">;
141
+ profile: z.ZodOptional<z.ZodEnum<["oltp-staging", "oltp-production", "oltp-enterprise", "olap-production", "writeheavy-production"]>>;
142
+ }, "strict", z.ZodTypeAny, {
143
+ type: "postgresql:ha@18";
144
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
145
+ }, {
146
+ type: "postgresql:ha@18";
147
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
148
+ }>, z.ZodObject<{
149
+ type: z.ZodLiteral<"postgresql:single@18">;
150
+ profile: z.ZodOptional<z.ZodEnum<["oltp-hobby", "oltp-staging", "oltp-production", "olap-production", "writeheavy-production"]>>;
151
+ }, "strict", z.ZodTypeAny, {
152
+ type: "postgresql:single@18";
153
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
154
+ }, {
155
+ type: "postgresql:single@18";
156
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
157
+ }>]>>;
158
+ proxySource: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"current">, z.ZodEffects<z.ZodObject<{
159
+ repository: z.ZodObject<{
160
+ owner: z.ZodString;
161
+ name: z.ZodEffects<z.ZodString, string, string>;
162
+ }, "strict", z.ZodTypeAny, {
163
+ name: string;
164
+ owner: string;
165
+ }, {
166
+ name: string;
167
+ owner: string;
168
+ }>;
169
+ commitSha: z.ZodString;
170
+ descriptor: z.ZodObject<{
171
+ path: z.ZodLiteral<"zerops.yaml">;
172
+ contents: z.ZodEffects<z.ZodString, string, string>;
173
+ sha256: z.ZodString;
174
+ }, "strict", z.ZodTypeAny, {
175
+ sha256: string;
176
+ path: "zerops.yaml";
177
+ contents: string;
178
+ }, {
179
+ sha256: string;
180
+ path: "zerops.yaml";
181
+ contents: string;
182
+ }>;
183
+ }, "strict", z.ZodTypeAny, {
184
+ commitSha: string;
185
+ repository: {
186
+ name: string;
187
+ owner: string;
188
+ };
189
+ descriptor: {
190
+ sha256: string;
191
+ path: "zerops.yaml";
192
+ contents: string;
193
+ };
194
+ }, {
195
+ commitSha: string;
196
+ repository: {
197
+ name: string;
198
+ owner: string;
199
+ };
200
+ descriptor: {
201
+ sha256: string;
202
+ path: "zerops.yaml";
203
+ contents: string;
204
+ };
205
+ }>, {
206
+ commitSha: string;
207
+ repository: {
208
+ name: string;
209
+ owner: string;
210
+ };
211
+ descriptor: {
212
+ sha256: string;
213
+ path: "zerops.yaml";
214
+ contents: string;
215
+ };
216
+ }, {
217
+ commitSha: string;
218
+ repository: {
219
+ name: string;
220
+ owner: string;
221
+ };
222
+ descriptor: {
223
+ sha256: string;
224
+ path: "zerops.yaml";
225
+ contents: string;
226
+ };
227
+ }>]>>;
228
+ }, "strict", z.ZodTypeAny, {
229
+ corePackage?: "LIGHT" | "SERIOUS" | undefined;
230
+ postgres?: {
231
+ type: "postgresql:ha@18";
232
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
233
+ } | {
234
+ type: "postgresql:single@18";
235
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
236
+ } | undefined;
237
+ projectId?: string | undefined;
238
+ projectName?: string | undefined;
239
+ proxySource?: {
240
+ commitSha: string;
241
+ repository: {
242
+ name: string;
243
+ owner: string;
244
+ };
245
+ descriptor: {
246
+ sha256: string;
247
+ path: "zerops.yaml";
248
+ contents: string;
249
+ };
250
+ } | "current" | undefined;
251
+ proxyBuild?: {
252
+ appVersionId: string;
253
+ triggered: boolean;
254
+ manifestSha256?: string | undefined;
255
+ } | undefined;
256
+ proxyDeployment?: {
257
+ commitSha: string;
258
+ appVersionId: string;
259
+ repository: {
260
+ name: string;
261
+ owner: string;
262
+ };
263
+ descriptorSha256: string;
264
+ manifestSha256?: string | undefined;
265
+ } | undefined;
266
+ publicAccess?: "custom-domain" | "zerops-subdomain" | undefined;
267
+ managed?: boolean | undefined;
268
+ proxyServiceId?: string | undefined;
269
+ postgresServiceId?: string | undefined;
270
+ proxyConfigured?: boolean | undefined;
271
+ proxyBaselineSequence?: number | undefined;
272
+ proxyAppVersionId?: string | undefined;
273
+ proxyHosts?: {
274
+ port: number;
275
+ host: string;
276
+ }[] | undefined;
277
+ ready?: boolean | undefined;
278
+ }, {
279
+ corePackage?: "LIGHT" | "SERIOUS" | undefined;
280
+ postgres?: {
281
+ type: "postgresql:ha@18";
282
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
283
+ } | {
284
+ type: "postgresql:single@18";
285
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
286
+ } | undefined;
287
+ projectId?: string | undefined;
288
+ projectName?: string | undefined;
289
+ proxySource?: {
290
+ commitSha: string;
291
+ repository: {
292
+ name: string;
293
+ owner: string;
294
+ };
295
+ descriptor: {
296
+ sha256: string;
297
+ path: "zerops.yaml";
298
+ contents: string;
299
+ };
300
+ } | "current" | undefined;
301
+ proxyBuild?: {
302
+ appVersionId: string;
303
+ triggered: boolean;
304
+ manifestSha256?: string | undefined;
305
+ } | undefined;
306
+ proxyDeployment?: {
307
+ commitSha: string;
308
+ appVersionId: string;
309
+ repository: {
310
+ name: string;
311
+ owner: string;
312
+ };
313
+ descriptorSha256: string;
314
+ manifestSha256?: string | undefined;
315
+ } | undefined;
316
+ publicAccess?: "custom-domain" | "zerops-subdomain" | undefined;
317
+ managed?: boolean | undefined;
318
+ proxyServiceId?: string | undefined;
319
+ postgresServiceId?: string | undefined;
320
+ proxyConfigured?: boolean | undefined;
321
+ proxyBaselineSequence?: number | undefined;
322
+ proxyAppVersionId?: string | undefined;
323
+ proxyHosts?: {
324
+ port: number;
325
+ host: string;
326
+ }[] | undefined;
327
+ ready?: boolean | undefined;
328
+ }>;
329
+ export declare const zeropsNamespaceTargetCodec: ProviderCodec<ZeropsNamespaceTarget>;
330
+ export declare const envelope: (target: ZeropsNamespaceTarget) => ProviderEnvelope;
331
+ export declare const decodeEnvelope: (value: ProviderEnvelope) => ZeropsNamespaceTarget;
332
+ export declare const normalizeTarget: (namespace: ProviderDeploymentNamespace, options: ZeropsNamespaceOptions) => NormalizedZeropsNamespaceTarget;
333
+ export declare const normalizedNamespace: (namespace: ProviderDeploymentNamespace, options: ZeropsNamespaceOptions) => ProviderDeploymentNamespace;
334
+ export declare const checkpoint: (input: ProviderNamespaceMutationInput, namespace: ProviderDeploymentNamespace, target: ZeropsNamespaceTarget) => Promise<ProviderDeploymentNamespace>;
@@ -0,0 +1,25 @@
1
+ export declare const ZEROPS_NAMESPACE_PROXY_HOSTNAME = "proxy";
2
+ export declare const ZEROPS_NAMESPACE_POSTGRES_HOSTNAME = "postgres";
3
+ export declare const ZEROPS_NAMESPACE_IAM_ISSUER_VARIABLE = "FABRIKA_IAM_ISSUER";
4
+ export declare const ZEROPS_NAMESPACE_IAM_KEY_VARIABLE = "FABRIKA_IAM_KEY";
5
+ /** The platform-owned variable naming one URL per published HTTP port. READ_ONLY, written by Zerops. */
6
+ export declare const ZEROPS_NAMESPACE_SUBDOMAIN_VARIABLE = "zeropsSubdomain";
7
+ /**
8
+ * How an app reaches the namespace-owned PostgreSQL service as its own user `db` — port, database and TLS mode NAMED,
9
+ * not defaulted. Every part settled against a live account, none of it safe to infer:
10
+ *
11
+ * • `${x_connectionString}` is `postgresql://${user}:${password}@${hostname}:${port}` — no database path. With
12
+ * none, the libpq/postgres.js convention falls back to the USER name.
13
+ * • `dbName` and `user` are both literally `db` on EVERY PostgreSQL service, whatever its hostname (checked on a
14
+ * service named `wu2db`). `/${x_dbName}` says it out loud rather than relying on that fallback.
15
+ * • THE DIRECT PORT, NOT `portTls`. `portTls` (6432) is pgBouncer with a static user list: only `db`, `postgres` and
16
+ * `zps` log in there, and a role fabrika creates is refused (`08P01`, measured 2026-10-15). A contract
17
+ * application's runtime role reuses its database URL's host and port, so only the direct port serves it.
18
+ * • `sslmode=disable`, the one mode that connects on both service types: `postgresql:ha@18` answers `require` on the
19
+ * direct port with "Server does not support SSL", and `Bun.SQL`'s `prefer` waits out its 30 s connection timeout
20
+ * against a server without TLS instead of falling back. The direct port stays inside the project's network.
21
+ *
22
+ * A contract application does not connect with this: its `FABRIKA_APP_DATABASE_URL` names the service's superuser,
23
+ * the provisioning credential of its role family (ADR-0017, `zeropsProvisioningDatabaseUrl` in `../manifest.ts`).
24
+ */
25
+ export declare const ZEROPS_SHARED_POSTGRES_CONNECTION_STRING = "${postgres_connectionString}/${postgres_dbName}?sslmode=disable";
@@ -0,0 +1,15 @@
1
+ import { ProviderNamespaceError } from '@fabrika/provider-contract';
2
+ /**
3
+ * Lifecycle codes this provider defines where the platform has none of its own. They are an
4
+ * operator-facing vocabulary, so they are stable identifiers rather than prose (backlog 72): a
5
+ * platform code such as `insufficientPermissions` and one of these read the same way downstream.
6
+ */
7
+ export declare const ZEROPS_NAMESPACE_CANCELLED = "namespaceCancelled";
8
+ export declare const ZEROPS_NAMESPACE_LIFECYCLE = "namespaceLifecycle";
9
+ export declare const ZEROPS_PROXY_DEPLOY_TIMEOUT = "proxyDeployTimeout";
10
+ export declare const ZEROPS_PROXY_DEPLOY_FAILED = "proxyDeployFailed";
11
+ export declare const ZEROPS_SUBDOMAIN_NOT_PUBLISHED = "subdomainNotPublished";
12
+ export declare const ZEROPS_SOURCE_RATE_LIMITED = "githubRateLimited";
13
+ export declare const namespaceError: (code: string, message: string, retryable: boolean, detail?: string) => ProviderNamespaceError;
14
+ /** Every namespace lifecycle failure leaves this provider as one typed, coded error. */
15
+ export declare const asNamespaceError: (cause: unknown, mode: "provision" | "reconcile" | "update") => ProviderNamespaceError;
@@ -0,0 +1,4 @@
1
+ import { type ProviderNamespaceMember } from '@fabrika/provider-contract';
2
+ import { type ProxyManifest } from '@fabrika/proxy-core/manifest';
3
+ /** Compile every public member of one deployment namespace into its strict proxy manifest. */
4
+ export declare function compileNamespaceProxyManifest(namespaceId: string, members: readonly ProviderNamespaceMember[]): ProxyManifest;
@@ -0,0 +1,12 @@
1
+ import type { ProviderNamespaceOperator } from '@fabrika/provider-contract';
2
+ import type { ZeropsNamespaceOperatorOptions } from './types';
3
+ /**
4
+ * The Zerops project a namespace creates when the plan names none: `fabrika-<env>-<id>`, beside the `fabrika-<env>` that
5
+ * `platform install` creates for the installation, so a namespace reads as fabrika's in the Zerops GUI.
6
+ */
7
+ export declare const defaultZeropsNamespaceProjectName: (namespace: {
8
+ readonly id: string;
9
+ readonly env: string;
10
+ }) => string;
11
+ /** Build the provider-owned namespace planning surface without any network collaborators. */
12
+ export declare const createZeropsNamespaceOperator: (options: ZeropsNamespaceOperatorOptions) => ProviderNamespaceOperator;
@@ -0,0 +1,4 @@
1
+ import { type ProviderNamespaceCapabilities } from '@fabrika/provider-contract';
2
+ import type { ZeropsNamespaceOptions } from './types';
3
+ /** Build the provider-owned namespace lifecycle capability. */
4
+ export declare const createZeropsNamespaceCapabilities: (options: ZeropsNamespaceOptions) => ProviderNamespaceCapabilities;
@@ -0,0 +1,36 @@
1
+ import { type ProxyManifest } from '@fabrika/proxy-core/manifest';
2
+ import { type ZeropsApi } from '../api';
3
+ import type { Sleeper } from '../collaborators';
4
+ import type { ZeropsSourcePort } from '../source/port';
5
+ import type { ZeropsNamespaceTarget } from './types';
6
+ export type ZeropsProxyApi = Pick<ZeropsApi, 'listServiceEnv' | 'putServiceEnv' | 'deleteServiceEnv' | 'createAppVersion' | 'deleteAppVersion' | 'buildAndDeployAppVersion' | 'getAppVersion'>;
7
+ export interface ZeropsProxyRepublishInput {
8
+ /** The namespace's id, named in the one refusal an operator acts on: re-pin it. */
9
+ readonly namespaceId: string;
10
+ readonly target: ZeropsNamespaceTarget;
11
+ readonly manifest: ProxyManifest;
12
+ readonly source?: ZeropsSourcePort;
13
+ readonly api: ZeropsProxyApi;
14
+ readonly iamUrl: string;
15
+ readonly iamKey: string;
16
+ /** Proxy service variable → the secret of one contract application (`namespaceProxySecrets`); none without one. */
17
+ readonly proxySecrets?: ReadonlyMap<string, string>;
18
+ /** Aborts with `lease_lost` when the namespace lease goes, and with `cancel_requested` when a deploy is cancelled. */
19
+ readonly signal: AbortSignal;
20
+ readonly wait: 'started' | 'active';
21
+ /**
22
+ * Reuse the proxy's ACTIVE version when it was built from this pin with this manifest identity. A deploy and a
23
+ * registry change pass true; provisioning and reconcile rebuild, so an operator's repair always reaches the platform.
24
+ */
25
+ readonly reuseActive: boolean;
26
+ /** Persist the target; the caller fences the write on the namespace lease. */
27
+ readonly checkpoint: (target: ZeropsNamespaceTarget) => Promise<void>;
28
+ readonly boundary: () => Promise<void>;
29
+ readonly sleep: Sleeper;
30
+ }
31
+ /**
32
+ * Rebuild the namespace proxy with `manifest` (ADR-0044). The attempt is recorded as `proxyBuild` and never
33
+ * resumed: an inherited attempt not yet `triggered` is deleted, a triggered one is polled to a terminal state.
34
+ * A lost lease deletes nothing; a cancelled deploy leaves a triggered attempt recorded for reconciliation.
35
+ */
36
+ export declare function republishProxy(input: ZeropsProxyRepublishInput): Promise<ZeropsNamespaceTarget>;
@@ -0,0 +1,33 @@
1
+ import type { ProviderApprovedAccess } from '@fabrika/provider-contract';
2
+ import type { CspOrigins } from '@fabrika/proxy-core/headers';
3
+ import { type ProxyEndpointRow } from '@fabrika/proxy-core/manifest';
4
+ import type { ZeropsNamespaceProxySource } from './types';
5
+ /**
6
+ * What the namespace proxy of one older platform release parses of an application's manifest entry: a row, and the
7
+ * entry's CSP directives, each by that release's own parser.
8
+ */
9
+ export interface OlderProxyReader {
10
+ readonly row: (row: ProxyEndpointRow) => boolean;
11
+ readonly csp: (csp: CspOrigins) => boolean;
12
+ }
13
+ /**
14
+ * The namespace proxies of the older releases this platform serves (ADR-0062). Control holds their parsers, as it holds
15
+ * their contract readers; a pin's release is not recorded, so what any of them reads is what the pin may read.
16
+ */
17
+ export type OlderProxyReaders = readonly [OlderProxyReader, ...OlderProxyReader[]];
18
+ /**
19
+ * What of the approved contract's manifest entry no older release's proxy parses, as the namespace publishes it: each
20
+ * such row by its id, and `csp` when no older proxy parses the entry's CSP (`workerSrc`, which only this release knows).
21
+ */
22
+ export declare function entriesNeedingCurrentProxy(access: ProviderApprovedAccess, olderProxies: OlderProxyReaders): string[];
23
+ /** This control plane's own proxy source, and the parsers of the older releases a pinned proxy may run. */
24
+ export interface PlatformProxies {
25
+ readonly proxySource: ZeropsNamespaceProxySource;
26
+ readonly olderProxies: OlderProxyReaders;
27
+ }
28
+ /**
29
+ * Refuses a deploy whose approved contract holds a row or a CSP directive the namespace's pinned proxy may not read: its source is not the
30
+ * one this control plane deploys new placements from. `platform` is absent where this control plane manages no
31
+ * namespace proxy, which then has nothing to compare.
32
+ */
33
+ export declare function assertNamespaceProxyReads(namespace: string, access: ProviderApprovedAccess | undefined, pinned: ZeropsNamespaceProxySource, platform: PlatformProxies | undefined): void;
@@ -0,0 +1,8 @@
1
+ import type { ProviderNamespaceMember } from '@fabrika/provider-contract';
2
+ import { type ProxyManifest } from '@fabrika/proxy-core/manifest';
3
+ /**
4
+ * The proxy service variables a manifest needs: for each contract application, the secret Caddy sends it
5
+ * (ADR-0022 rule 5), keyed by `proxySecretVariable`. A contract member without a secret is refused, because
6
+ * its application would refuse every request the proxy sends.
7
+ */
8
+ export declare function namespaceProxySecrets(manifest: ProxyManifest, members: readonly ProviderNamespaceMember[]): ReadonlyMap<string, string>;
@@ -0,0 +1,74 @@
1
+ import { z } from 'zod';
2
+ import type { ZeropsNamespaceProxySource } from './types';
3
+ export declare const namespaceProxySourceSchema: z.ZodEffects<z.ZodObject<{
4
+ repository: z.ZodObject<{
5
+ owner: z.ZodString;
6
+ name: z.ZodEffects<z.ZodString, string, string>;
7
+ }, "strict", z.ZodTypeAny, {
8
+ name: string;
9
+ owner: string;
10
+ }, {
11
+ name: string;
12
+ owner: string;
13
+ }>;
14
+ commitSha: z.ZodString;
15
+ descriptor: z.ZodObject<{
16
+ path: z.ZodLiteral<"zerops.yaml">;
17
+ contents: z.ZodEffects<z.ZodString, string, string>;
18
+ sha256: z.ZodString;
19
+ }, "strict", z.ZodTypeAny, {
20
+ sha256: string;
21
+ path: "zerops.yaml";
22
+ contents: string;
23
+ }, {
24
+ sha256: string;
25
+ path: "zerops.yaml";
26
+ contents: string;
27
+ }>;
28
+ }, "strict", z.ZodTypeAny, {
29
+ commitSha: string;
30
+ repository: {
31
+ name: string;
32
+ owner: string;
33
+ };
34
+ descriptor: {
35
+ sha256: string;
36
+ path: "zerops.yaml";
37
+ contents: string;
38
+ };
39
+ }, {
40
+ commitSha: string;
41
+ repository: {
42
+ name: string;
43
+ owner: string;
44
+ };
45
+ descriptor: {
46
+ sha256: string;
47
+ path: "zerops.yaml";
48
+ contents: string;
49
+ };
50
+ }>, {
51
+ commitSha: string;
52
+ repository: {
53
+ name: string;
54
+ owner: string;
55
+ };
56
+ descriptor: {
57
+ sha256: string;
58
+ path: "zerops.yaml";
59
+ contents: string;
60
+ };
61
+ }, {
62
+ commitSha: string;
63
+ repository: {
64
+ name: string;
65
+ owner: string;
66
+ };
67
+ descriptor: {
68
+ sha256: string;
69
+ path: "zerops.yaml";
70
+ contents: string;
71
+ };
72
+ }>;
73
+ export declare const decodeZeropsNamespaceProxySource: (value: unknown) => ZeropsNamespaceProxySource;
74
+ export declare const verifyZeropsNamespaceProxySource: (source: ZeropsNamespaceProxySource) => Promise<void>;
@@ -0,0 +1,9 @@
1
+ import type { ProviderDeploymentNamespace } from '@fabrika/provider-contract';
2
+ import type { ZeropsNamespacePolicy, ZeropsNamespacePresetInput, ZeropsNamespaceTarget, ZeropsNamespaceTopology } from './types';
3
+ export declare const PROXY_TYPE = "alpine@3.21";
4
+ /** A preset's project and service policy, without the proxy source pin (ADR-0045). */
5
+ export declare const zeropsNamespacePolicy: (input: Omit<ZeropsNamespacePresetInput, "proxySource">) => ZeropsNamespacePolicy;
6
+ export declare const zeropsNamespacePreset: (input: ZeropsNamespacePresetInput) => ZeropsNamespaceTarget;
7
+ export declare const projectMarker: (namespace: ProviderDeploymentNamespace) => string;
8
+ /** Compile the one project and its namespace-owned services without depending on private deploy code. */
9
+ export declare const compileZeropsNamespaceTopology: (namespace: ProviderDeploymentNamespace, target: ZeropsNamespacePolicy) => ZeropsNamespaceTopology;
@@ -0,0 +1,99 @@
1
+ import type { ProviderNamespaceHost } from '@fabrika/provider-contract';
2
+ import type { ZeropsApi, ZeropsProjectMode } from '../api';
3
+ import type { Sleeper } from '../collaborators';
4
+ import type { ZeropsArtifactSourceDescriptor } from '../manifest';
5
+ import type { ZeropsSourceRepository } from '../source';
6
+ import type { ZeropsSourcePort } from '../source/port';
7
+ import type { ZeropsSourceTarget } from '../types';
8
+ export type ZeropsNamespacePublicAccess = 'custom-domain' | 'zerops-subdomain';
9
+ export interface ZeropsNamespaceProxySource {
10
+ readonly repository: ZeropsSourceRepository;
11
+ readonly commitSha: string;
12
+ readonly descriptor: ZeropsArtifactSourceDescriptor;
13
+ }
14
+ /** The proxy attempt in flight (ADR-0044): a version not `triggered` is deleted, a triggered one is polled. */
15
+ export interface ZeropsNamespaceProxyBuild {
16
+ readonly appVersionId: string;
17
+ readonly triggered: boolean;
18
+ readonly manifestSha256?: string;
19
+ }
20
+ export interface ZeropsNamespaceProxyDeployment {
21
+ readonly manifestSha256?: string;
22
+ readonly appVersionId: string;
23
+ readonly repository: ZeropsSourceRepository;
24
+ readonly commitSha: string;
25
+ readonly descriptorSha256: string;
26
+ }
27
+ export type ZeropsNamespacePostgres = {
28
+ readonly type: 'postgresql:ha@18';
29
+ readonly profile?: 'oltp-staging' | 'oltp-production' | 'oltp-enterprise' | 'olap-production' | 'writeheavy-production';
30
+ } | {
31
+ readonly type: 'postgresql:single@18';
32
+ readonly profile?: 'oltp-hobby' | 'oltp-staging' | 'oltp-production' | 'olap-production' | 'writeheavy-production';
33
+ };
34
+ /**
35
+ * Provider-owned namespace state. Optional fields are durable progress checkpoints; values that are
36
+ * absent are resolved by `normalize()` before a mutation starts.
37
+ */
38
+ export interface ZeropsNamespaceTarget {
39
+ readonly proxySource: ZeropsNamespaceProxySource;
40
+ readonly proxyBuild?: ZeropsNamespaceProxyBuild;
41
+ readonly proxyDeployment?: ZeropsNamespaceProxyDeployment;
42
+ readonly projectName?: string;
43
+ readonly corePackage?: ZeropsProjectMode;
44
+ readonly publicAccess?: ZeropsNamespacePublicAccess;
45
+ readonly postgres?: ZeropsNamespacePostgres;
46
+ readonly managed?: boolean;
47
+ readonly projectId?: string;
48
+ readonly proxyServiceId?: string;
49
+ readonly postgresServiceId?: string;
50
+ readonly proxyConfigured?: boolean;
51
+ readonly proxyBaselineSequence?: number;
52
+ readonly proxyAppVersionId?: string;
53
+ /** The hosts the published proxy answers on, recorded once so a namespace read needs no platform call. */
54
+ readonly proxyHosts?: readonly ProviderNamespaceHost[];
55
+ readonly ready?: boolean;
56
+ }
57
+ export type ZeropsNamespacePolicy = Omit<ZeropsNamespaceTarget, 'proxySource'>;
58
+ export interface NormalizedZeropsNamespaceTarget extends ZeropsNamespaceTarget {
59
+ readonly projectName: string;
60
+ readonly corePackage: ZeropsProjectMode;
61
+ readonly publicAccess: ZeropsNamespacePublicAccess;
62
+ readonly managed: boolean;
63
+ readonly ready: boolean;
64
+ }
65
+ export interface ZeropsNamespaceOptions {
66
+ readonly proxySource: ZeropsNamespaceProxySource;
67
+ readonly source?: ZeropsSourcePort;
68
+ readonly clientId: string;
69
+ /** Public IAM origin reachable from an app project. */
70
+ readonly iamUrl: string;
71
+ /** Same credential IAM receives as `FABRIKA_IAM_PROXY_KEY`. */
72
+ readonly iamKey: string;
73
+ readonly api: ZeropsApi;
74
+ readonly sleep?: Sleeper;
75
+ }
76
+ export interface ZeropsNamespaceTopology {
77
+ readonly source: ZeropsSourceTarget;
78
+ readonly createYaml: string;
79
+ readonly servicesProvisionYaml: string;
80
+ readonly servicesSteadyYaml: string;
81
+ }
82
+ export interface ZeropsNamespacePresetInput {
83
+ readonly proxySource: ZeropsNamespaceProxySource;
84
+ readonly preset: 'cheap' | 'mid' | 'full';
85
+ readonly env: string;
86
+ readonly projectName: string;
87
+ readonly corePackage?: ZeropsProjectMode;
88
+ readonly publicAccess?: ZeropsNamespacePublicAccess;
89
+ readonly postgres?: ZeropsNamespacePostgres;
90
+ }
91
+ export interface ZeropsNamespaceOperatorOptions {
92
+ readonly proxySource: ZeropsNamespaceProxySource;
93
+ }
94
+ export interface ZeropsNamespacePlanOptions {
95
+ readonly projectName?: string;
96
+ readonly corePackage?: ZeropsProjectMode;
97
+ readonly publicAccess?: ZeropsNamespacePublicAccess;
98
+ readonly postgres?: ZeropsNamespacePostgres;
99
+ }