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

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 (174) hide show
  1. package/package.json +17 -14
  2. package/sandbox/Dockerfile +16 -0
  3. package/sandbox/bin/postgres-auth.sh +38 -0
  4. package/sandbox/bin/reset.sh +12 -0
  5. package/sandbox/bin/run-build.sh +35 -0
  6. package/sandbox/bin/run-launcher.sh +18 -0
  7. package/sandbox/bin/start-launcher.sh +25 -0
  8. package/sandbox/bin/stop.sh +47 -0
  9. package/sandbox/init.sh +61 -0
  10. package/src/api/client.ts +15 -1
  11. package/src/api/errors.ts +7 -3
  12. package/src/api/readers.ts +29 -0
  13. package/src/api/types.ts +52 -0
  14. package/src/api.ts +2 -0
  15. package/src/cli.ts +11 -0
  16. package/src/collaborators.ts +0 -14
  17. package/src/compile.ts +1 -1
  18. package/src/control.ts +159 -92
  19. package/src/execution.ts +45 -195
  20. package/src/index.ts +2 -0
  21. package/src/installation/admin.ts +1 -1
  22. package/src/installation/deploy-options.ts +1 -2
  23. package/src/installation/deploy.ts +225 -80
  24. package/src/installation/generated/platform-console-schema.ts +3 -0
  25. package/src/installation/generated/platform-proxy-manifest.ts +1 -1
  26. package/src/installation/guide.md +48 -18
  27. package/src/installation/hosts.ts +1 -7
  28. package/src/installation/index.ts +13 -16
  29. package/src/installation/init-options.ts +2 -1
  30. package/src/installation/install-environment.ts +47 -108
  31. package/src/installation/install-options.ts +3 -1
  32. package/src/installation/install-secrets.ts +24 -68
  33. package/src/installation/install.ts +9 -4
  34. package/src/installation/sidecar.ts +5 -26
  35. package/src/installation/topology/setups.ts +17 -4
  36. package/src/installation/topology/topology.ts +32 -22
  37. package/src/installation/upgrade-options.ts +2 -2
  38. package/src/managed-env.ts +1 -174
  39. package/src/manifest.ts +4 -16
  40. package/src/namespace/claims.ts +60 -1
  41. package/src/namespace/codec.ts +17 -0
  42. package/src/namespace/errors.ts +22 -1
  43. package/src/namespace/manifest.ts +36 -23
  44. package/src/namespace/provisioning.ts +88 -114
  45. package/src/namespace/proxy-attempt.ts +14 -2
  46. package/src/namespace/proxy-reads.ts +28 -23
  47. package/src/namespace/proxy-secrets.ts +18 -5
  48. package/src/namespace/sandbox-host.ts +212 -0
  49. package/src/namespace/subdomain.ts +113 -0
  50. package/src/namespace/topology.ts +1 -1
  51. package/src/namespace/types.ts +13 -0
  52. package/src/namespace/update.ts +1 -0
  53. package/src/namespace-cli.ts +152 -0
  54. package/src/plan.ts +1 -6
  55. package/src/provider.ts +88 -166
  56. package/src/proxy-manifest-carrier.ts +39 -0
  57. package/src/sandbox/base-image.ts +100 -0
  58. package/src/sandbox/constants.ts +44 -0
  59. package/src/sandbox/deploy.ts +471 -0
  60. package/src/sandbox/dev-artifact.ts +206 -0
  61. package/src/sandbox/lifecycle.ts +204 -0
  62. package/src/sandbox/scripts.ts +26 -0
  63. package/src/sandbox-host.ts +28 -0
  64. package/src/source/port.ts +5 -0
  65. package/src/types.ts +0 -2
  66. package/src/zbox/client.ts +259 -0
  67. package/src/zbox/errors.ts +45 -0
  68. package/src/zbox/index.ts +22 -0
  69. package/src/zbox/types.ts +165 -0
  70. package/types/src/api/client.d.ts +5 -0
  71. package/types/src/api/errors.d.ts +26 -0
  72. package/types/src/api/polling.d.ts +41 -0
  73. package/types/src/api/readers.d.ts +1115 -0
  74. package/types/src/api/service-env-limit.d.ts +17 -0
  75. package/types/src/api/service-env-response.d.ts +23 -0
  76. package/types/src/api/types.d.ts +687 -0
  77. package/types/src/api.d.ts +6 -0
  78. package/types/src/authoring.d.ts +9 -0
  79. package/types/src/cli-args.d.ts +19 -0
  80. package/types/src/cli.d.ts +13 -0
  81. package/types/src/collaborators.d.ts +16 -0
  82. package/types/src/compile.d.ts +91 -0
  83. package/types/src/control.d.ts +51 -0
  84. package/types/src/database-budget.d.ts +38 -0
  85. package/types/src/descriptor.d.ts +28 -0
  86. package/types/src/execution.d.ts +114 -0
  87. package/types/src/exposure.d.ts +47 -0
  88. package/types/src/index.d.ts +31 -0
  89. package/types/src/installation/admin-options.d.ts +24 -0
  90. package/types/src/installation/admin.d.ts +35 -0
  91. package/types/src/installation/checker-release.d.ts +12 -0
  92. package/types/src/installation/deploy-options.d.ts +37 -0
  93. package/types/src/installation/deploy.d.ts +136 -0
  94. package/types/src/installation/generated/platform-console-schema.d.ts +2 -0
  95. package/types/src/installation/generated/platform-proxy-manifest.d.ts +2 -0
  96. package/types/src/installation/hosts.d.ts +34 -0
  97. package/types/src/installation/index.d.ts +7 -0
  98. package/types/src/installation/init-options.d.ts +38 -0
  99. package/types/src/installation/init.d.ts +60 -0
  100. package/types/src/installation/install-collaborators.d.ts +24 -0
  101. package/types/src/installation/install-environment.d.ts +63 -0
  102. package/types/src/installation/install-options.d.ts +49 -0
  103. package/types/src/installation/install-project.d.ts +13 -0
  104. package/types/src/installation/install-provisioning.d.ts +58 -0
  105. package/types/src/installation/install-secrets.d.ts +17 -0
  106. package/types/src/installation/install-token.d.ts +10 -0
  107. package/types/src/installation/install.d.ts +23 -0
  108. package/types/src/installation/installation-source.d.ts +8 -0
  109. package/types/src/installation/log.d.ts +44 -0
  110. package/types/src/installation/machine-key.d.ts +19 -0
  111. package/types/src/installation/placement-options.d.ts +11 -0
  112. package/types/src/installation/platform-archive.d.ts +7 -0
  113. package/types/src/installation/platform-source.d.ts +8 -0
  114. package/types/src/installation/platform-upload.d.ts +3 -0
  115. package/types/src/installation/sidecar.d.ts +49 -0
  116. package/types/src/installation/source-options.d.ts +1 -0
  117. package/types/src/installation/topology/artifacts.d.ts +8 -0
  118. package/types/src/installation/topology/index.d.ts +5 -0
  119. package/types/src/installation/topology/installation-schemas.d.ts +2242 -0
  120. package/types/src/installation/topology/invariants.d.ts +23 -0
  121. package/types/src/installation/topology/setups.d.ts +59 -0
  122. package/types/src/installation/topology/topology.d.ts +153 -0
  123. package/types/src/installation/topology/validate.d.ts +11 -0
  124. package/types/src/installation/upgrade-options.d.ts +26 -0
  125. package/types/src/installation/upgrade-output.d.ts +6 -0
  126. package/types/src/installation/upgrade.d.ts +88 -0
  127. package/types/src/managed-env.d.ts +24 -0
  128. package/types/src/manifest.d.ts +199 -0
  129. package/types/src/namespace/claims.d.ts +16 -0
  130. package/types/src/namespace/codec.d.ts +352 -0
  131. package/types/src/namespace/constants.d.ts +25 -0
  132. package/types/src/namespace/errors.d.ts +25 -0
  133. package/types/src/namespace/manifest.d.ts +4 -0
  134. package/types/src/namespace/operator.d.ts +12 -0
  135. package/types/src/namespace/provisioning.d.ts +4 -0
  136. package/types/src/namespace/proxy-attempt.d.ts +39 -0
  137. package/types/src/namespace/proxy-reads.d.ts +27 -0
  138. package/types/src/namespace/proxy-secrets.d.ts +8 -0
  139. package/types/src/namespace/proxy-source.d.ts +74 -0
  140. package/types/src/namespace/sandbox-host.d.ts +23 -0
  141. package/types/src/namespace/subdomain.d.ts +43 -0
  142. package/types/src/namespace/topology.d.ts +9 -0
  143. package/types/src/namespace/types.d.ts +111 -0
  144. package/types/src/namespace/update.d.ts +6 -0
  145. package/types/src/namespace/validation.d.ts +12 -0
  146. package/types/src/namespace-cli.d.ts +2 -0
  147. package/types/src/namespace.d.ts +9 -0
  148. package/types/src/plan.d.ts +11 -0
  149. package/types/src/provider.d.ts +60 -0
  150. package/types/src/proxy-manifest-carrier.d.ts +37 -0
  151. package/types/src/sandbox/base-image.d.ts +28 -0
  152. package/types/src/sandbox/constants.d.ts +30 -0
  153. package/types/src/sandbox/deploy.d.ts +75 -0
  154. package/types/src/sandbox/dev-artifact.d.ts +51 -0
  155. package/types/src/sandbox/lifecycle.d.ts +27 -0
  156. package/types/src/sandbox/scripts.d.ts +11 -0
  157. package/types/src/sandbox-host.d.ts +16 -0
  158. package/types/src/schema.generated.d.ts +376 -0
  159. package/types/src/service-names.d.ts +4 -0
  160. package/types/src/service-references.d.ts +13 -0
  161. package/types/src/source/constants.d.ts +6 -0
  162. package/types/src/source/port.d.ts +65 -0
  163. package/types/src/source/types.d.ts +4 -0
  164. package/types/src/source/validation.d.ts +19 -0
  165. package/types/src/source.d.ts +2 -0
  166. package/types/src/types.d.ts +119 -0
  167. package/types/src/version-attempt.d.ts +8 -0
  168. package/types/src/zbox/client.d.ts +2 -0
  169. package/types/src/zbox/errors.d.ts +25 -0
  170. package/types/src/zbox/index.d.ts +3 -0
  171. package/types/src/zbox/types.d.ts +433 -0
  172. package/src/installation/mcp.ts +0 -102
  173. package/src/installation/proxy-manifest.ts +0 -214
  174. package/src/installation/secrets.ts +0 -78
@@ -0,0 +1,352 @@
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
+ sandboxHost: z.ZodOptional<z.ZodOptional<z.ZodObject<{
138
+ serviceId: z.ZodString;
139
+ apiOrigin: z.ZodEffects<z.ZodString, string, string>;
140
+ }, "strict", z.ZodTypeAny, {
141
+ serviceId: string;
142
+ apiOrigin: string;
143
+ }, {
144
+ serviceId: string;
145
+ apiOrigin: string;
146
+ }>>>;
147
+ ready: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
148
+ } & {
149
+ postgres: z.ZodOptional<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
150
+ type: z.ZodLiteral<"postgresql:ha@18">;
151
+ profile: z.ZodOptional<z.ZodEnum<["oltp-staging", "oltp-production", "oltp-enterprise", "olap-production", "writeheavy-production"]>>;
152
+ }, "strict", z.ZodTypeAny, {
153
+ type: "postgresql:ha@18";
154
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
155
+ }, {
156
+ type: "postgresql:ha@18";
157
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
158
+ }>, z.ZodObject<{
159
+ type: z.ZodLiteral<"postgresql:single@18">;
160
+ profile: z.ZodOptional<z.ZodEnum<["oltp-hobby", "oltp-staging", "oltp-production", "olap-production", "writeheavy-production"]>>;
161
+ }, "strict", z.ZodTypeAny, {
162
+ type: "postgresql:single@18";
163
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
164
+ }, {
165
+ type: "postgresql:single@18";
166
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
167
+ }>]>>;
168
+ proxySource: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"current">, z.ZodEffects<z.ZodObject<{
169
+ repository: z.ZodObject<{
170
+ owner: z.ZodString;
171
+ name: z.ZodEffects<z.ZodString, string, string>;
172
+ }, "strict", z.ZodTypeAny, {
173
+ name: string;
174
+ owner: string;
175
+ }, {
176
+ name: string;
177
+ owner: string;
178
+ }>;
179
+ commitSha: z.ZodString;
180
+ descriptor: z.ZodObject<{
181
+ path: z.ZodLiteral<"zerops.yaml">;
182
+ contents: z.ZodEffects<z.ZodString, string, string>;
183
+ sha256: z.ZodString;
184
+ }, "strict", z.ZodTypeAny, {
185
+ sha256: string;
186
+ path: "zerops.yaml";
187
+ contents: string;
188
+ }, {
189
+ sha256: string;
190
+ path: "zerops.yaml";
191
+ contents: string;
192
+ }>;
193
+ }, "strict", z.ZodTypeAny, {
194
+ commitSha: string;
195
+ repository: {
196
+ name: string;
197
+ owner: string;
198
+ };
199
+ descriptor: {
200
+ sha256: string;
201
+ path: "zerops.yaml";
202
+ contents: string;
203
+ };
204
+ }, {
205
+ commitSha: string;
206
+ repository: {
207
+ name: string;
208
+ owner: string;
209
+ };
210
+ descriptor: {
211
+ sha256: string;
212
+ path: "zerops.yaml";
213
+ contents: string;
214
+ };
215
+ }>, {
216
+ commitSha: string;
217
+ repository: {
218
+ name: string;
219
+ owner: string;
220
+ };
221
+ descriptor: {
222
+ sha256: string;
223
+ path: "zerops.yaml";
224
+ contents: string;
225
+ };
226
+ }, {
227
+ commitSha: string;
228
+ repository: {
229
+ name: string;
230
+ owner: string;
231
+ };
232
+ descriptor: {
233
+ sha256: string;
234
+ path: "zerops.yaml";
235
+ contents: string;
236
+ };
237
+ }>]>>;
238
+ }, "strict", z.ZodTypeAny, {
239
+ corePackage?: "LIGHT" | "SERIOUS" | undefined;
240
+ postgres?: {
241
+ type: "postgresql:ha@18";
242
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
243
+ } | {
244
+ type: "postgresql:single@18";
245
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
246
+ } | undefined;
247
+ projectId?: string | undefined;
248
+ projectName?: string | undefined;
249
+ proxySource?: "current" | {
250
+ commitSha: string;
251
+ repository: {
252
+ name: string;
253
+ owner: string;
254
+ };
255
+ descriptor: {
256
+ sha256: string;
257
+ path: "zerops.yaml";
258
+ contents: string;
259
+ };
260
+ } | undefined;
261
+ proxyBuild?: {
262
+ appVersionId: string;
263
+ triggered: boolean;
264
+ manifestSha256?: string | undefined;
265
+ } | undefined;
266
+ proxyDeployment?: {
267
+ commitSha: string;
268
+ appVersionId: string;
269
+ repository: {
270
+ name: string;
271
+ owner: string;
272
+ };
273
+ descriptorSha256: string;
274
+ manifestSha256?: string | undefined;
275
+ } | undefined;
276
+ publicAccess?: "custom-domain" | "zerops-subdomain" | undefined;
277
+ managed?: boolean | undefined;
278
+ proxyServiceId?: string | undefined;
279
+ postgresServiceId?: string | undefined;
280
+ proxyConfigured?: boolean | undefined;
281
+ proxyBaselineSequence?: number | undefined;
282
+ proxyAppVersionId?: string | undefined;
283
+ proxyHosts?: {
284
+ port: number;
285
+ host: string;
286
+ }[] | undefined;
287
+ sandboxHost?: {
288
+ serviceId: string;
289
+ apiOrigin: string;
290
+ } | undefined;
291
+ ready?: boolean | undefined;
292
+ }, {
293
+ corePackage?: "LIGHT" | "SERIOUS" | undefined;
294
+ postgres?: {
295
+ type: "postgresql:ha@18";
296
+ profile?: "oltp-staging" | "oltp-production" | "oltp-enterprise" | "olap-production" | "writeheavy-production" | undefined;
297
+ } | {
298
+ type: "postgresql:single@18";
299
+ profile?: "oltp-staging" | "oltp-production" | "olap-production" | "writeheavy-production" | "oltp-hobby" | undefined;
300
+ } | undefined;
301
+ projectId?: string | undefined;
302
+ projectName?: string | undefined;
303
+ proxySource?: "current" | {
304
+ commitSha: string;
305
+ repository: {
306
+ name: string;
307
+ owner: string;
308
+ };
309
+ descriptor: {
310
+ sha256: string;
311
+ path: "zerops.yaml";
312
+ contents: string;
313
+ };
314
+ } | undefined;
315
+ proxyBuild?: {
316
+ appVersionId: string;
317
+ triggered: boolean;
318
+ manifestSha256?: string | undefined;
319
+ } | undefined;
320
+ proxyDeployment?: {
321
+ commitSha: string;
322
+ appVersionId: string;
323
+ repository: {
324
+ name: string;
325
+ owner: string;
326
+ };
327
+ descriptorSha256: string;
328
+ manifestSha256?: string | undefined;
329
+ } | undefined;
330
+ publicAccess?: "custom-domain" | "zerops-subdomain" | undefined;
331
+ managed?: boolean | undefined;
332
+ proxyServiceId?: string | undefined;
333
+ postgresServiceId?: string | undefined;
334
+ proxyConfigured?: boolean | undefined;
335
+ proxyBaselineSequence?: number | undefined;
336
+ proxyAppVersionId?: string | undefined;
337
+ proxyHosts?: {
338
+ port: number;
339
+ host: string;
340
+ }[] | undefined;
341
+ sandboxHost?: {
342
+ serviceId: string;
343
+ apiOrigin: string;
344
+ } | undefined;
345
+ ready?: boolean | undefined;
346
+ }>;
347
+ export declare const zeropsNamespaceTargetCodec: ProviderCodec<ZeropsNamespaceTarget>;
348
+ export declare const envelope: (target: ZeropsNamespaceTarget) => ProviderEnvelope;
349
+ export declare const decodeEnvelope: (value: ProviderEnvelope) => ZeropsNamespaceTarget;
350
+ export declare const normalizeTarget: (namespace: ProviderDeploymentNamespace, options: ZeropsNamespaceOptions) => NormalizedZeropsNamespaceTarget;
351
+ export declare const normalizedNamespace: (namespace: ProviderDeploymentNamespace, options: ZeropsNamespaceOptions) => ProviderDeploymentNamespace;
352
+ 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,25 @@
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
+ /** A dev sandbox entry would be published to a namespace whose pinned proxy cannot parse one. */
14
+ export declare const ZEROPS_PROXY_SANDBOXES_UNSUPPORTED = "proxySandboxesUnsupported";
15
+ /** A sandbox host was asked of a namespace that serves no custom domain, which a dev environment's wildcard needs. */
16
+ export declare const ZEROPS_SANDBOX_HOST_UNSUPPORTED = "sandboxHostUnsupported";
17
+ /** The Box API did not accept the namespace's key after the service restarted with it. */
18
+ export declare const ZEROPS_SANDBOX_HOST_KEY_REFUSED = "sandboxHostKeyRefused";
19
+ /** The Box API answered a request that carried no key, even after a restart with the namespace's key. */
20
+ export declare const ZEROPS_SANDBOX_HOST_API_OPEN = "sandboxHostApiOpen";
21
+ /** A dev environment an older release registered with its own Zerops service, which runs in no sandbox. */
22
+ export declare const ZEROPS_DEV_TARGET_RETIRED = "devTargetRetired";
23
+ export declare const namespaceError: (code: string, message: string, retryable: boolean, detail?: string) => ProviderNamespaceError;
24
+ /** Every namespace lifecycle failure leaves this provider as one typed, coded error. */
25
+ export declare const asNamespaceError: (cause: unknown, mode: "provision" | "reconcile" | "update" | "claim check") => 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,39 @@
1
+ import type { InstallationBrand } from '@fabrika/proxy-core/brand';
2
+ import { type ProxyManifest } from '@fabrika/proxy-core/manifest';
3
+ import { type ZeropsApi } from '../api';
4
+ import type { Sleeper } from '../collaborators';
5
+ import type { ZeropsSourcePort } from '../source/port';
6
+ import type { ZeropsNamespaceTarget } from './types';
7
+ export type ZeropsProxyApi = Pick<ZeropsApi, 'listServiceEnv' | 'putServiceEnv' | 'deleteServiceEnv' | 'createAppVersion' | 'deleteAppVersion' | 'buildAndDeployAppVersion' | 'getAppVersion'>;
8
+ export interface ZeropsProxyRepublishInput {
9
+ /** The namespace's id, named in the one refusal an operator acts on: re-pin it. */
10
+ readonly namespaceId: string;
11
+ readonly target: ZeropsNamespaceTarget;
12
+ readonly manifest: ProxyManifest;
13
+ /** The installation's client logo (ADR-0066); added to the manifest only when the pinned proxy can parse it. */
14
+ readonly brand?: InstallationBrand | null;
15
+ readonly source?: ZeropsSourcePort;
16
+ readonly api: ZeropsProxyApi;
17
+ readonly iamUrl: string;
18
+ readonly iamKey: string;
19
+ /** Proxy service variable → the secret of one contract application (`namespaceProxySecrets`); none without one. */
20
+ readonly proxySecrets?: ReadonlyMap<string, string>;
21
+ /** Aborts with `lease_lost` when the namespace lease goes, and with `cancel_requested` when a deploy is cancelled. */
22
+ readonly signal: AbortSignal;
23
+ readonly wait: 'started' | 'active';
24
+ /**
25
+ * Reuse the proxy's ACTIVE version when it was built from this pin with this manifest identity. A deploy and a
26
+ * registry change pass true; provisioning and reconcile rebuild, so an operator's repair always reaches the platform.
27
+ */
28
+ readonly reuseActive: boolean;
29
+ /** Persist the target; the caller fences the write on the namespace lease. */
30
+ readonly checkpoint: (target: ZeropsNamespaceTarget) => Promise<void>;
31
+ readonly boundary: () => Promise<void>;
32
+ readonly sleep: Sleeper;
33
+ }
34
+ /**
35
+ * Rebuild the namespace proxy with `manifest` (ADR-0044). The attempt is recorded as `proxyBuild` and never
36
+ * resumed: an inherited attempt not yet `triggered` is deleted, a triggered one is polled to a terminal state.
37
+ * A lost lease deletes nothing; a cancelled deploy leaves a triggered attempt recorded for reconciliation.
38
+ */
39
+ export declare function republishProxy(input: ZeropsProxyRepublishInput): Promise<ZeropsNamespaceTarget>;
@@ -0,0 +1,27 @@
1
+ import { type ProviderApprovedAccess } from '@fabrika/provider-contract';
2
+ import { type OlderProxyReaders } from '@fabrika/proxy-core/manifest';
3
+ import type { ZeropsNamespaceProxySource } from './types';
4
+ export type { OlderProxyReader, OlderProxyReaders } from '@fabrika/proxy-core/manifest';
5
+ /**
6
+ * What of the approved contract's manifest entry no older release's proxy parses, as the namespace publishes it: each
7
+ * such row by its id, and `csp` when no older proxy parses the entry's CSP (`workerSrc`, which only this release knows).
8
+ * A contract that declares a terminal adds `terminal` when no older proxy serves the sign-out its sessions end at
9
+ * (ADR-0067 §5).
10
+ */
11
+ export declare function entriesNeedingCurrentProxy(access: ProviderApprovedAccess, olderProxies: OlderProxyReaders): string[];
12
+ /** This control plane's own proxy source, and the parsers of the older releases a pinned proxy may run. */
13
+ export interface PlatformProxies {
14
+ readonly proxySource: ZeropsNamespaceProxySource;
15
+ readonly olderProxies: OlderProxyReaders;
16
+ }
17
+ /**
18
+ * 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
19
+ * one this control plane deploys new placements from. `platform` is absent where this control plane manages no
20
+ * namespace proxy, which then has nothing to compare.
21
+ */
22
+ export declare function assertNamespaceProxyReads(namespace: string, access: ProviderApprovedAccess | undefined, pinned: ZeropsNamespaceProxySource, platform: PlatformProxies | undefined): void;
23
+ /**
24
+ * Refuses dev sandbox entries for a namespace whose pinned proxy cannot parse their `audience` and `upstreamHost`: its
25
+ * strict parser would fail the proxy build. The row and CSP judges above see neither field, so this marker is their gate.
26
+ */
27
+ export declare function assertNamespaceProxyAcceptsSandboxes(namespace: string, pinned: ZeropsNamespaceProxySource): 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 entry 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,23 @@
1
+ import { type ZeropsApi } from '../api';
2
+ import { type Sleeper } from '../collaborators';
3
+ import { type ZboxFetch } from '../zbox';
4
+ import type { NormalizedZeropsNamespaceTarget, ZeropsNamespaceSandboxHost } from './types';
5
+ export type ZeropsSandboxHostApi = Pick<ZeropsApi, 'listProjectServices' | 'importServices' | 'getProcess' | 'getService' | 'putServiceEnv' | 'startService' | 'stopService' | 'enableSubdomainAccess' | 'listServiceEnv'>;
6
+ export interface ZeropsSandboxHostInput {
7
+ readonly namespaceId: string;
8
+ readonly target: NormalizedZeropsNamespaceTarget;
9
+ /** The Box API key Control composed from its vault; written to the service, sent as a bearer, never read back. */
10
+ readonly sandboxKey: string;
11
+ readonly api: ZeropsSandboxHostApi;
12
+ readonly zboxFetch?: ZboxFetch;
13
+ readonly sleep?: Sleeper;
14
+ readonly signal: AbortSignal;
15
+ }
16
+ /** A sandbox host on a `zerops-subdomain` namespace is refused: a dev environment's wildcard needs a custom domain. */
17
+ export declare const assertSandboxHostAllowed: (namespaceId: string, target: NormalizedZeropsNamespaceTarget) => void;
18
+ /**
19
+ * Bring the namespace's sandbox host to what a dev environment needs: the `zbox` service, its key and its API
20
+ * subdomain. The router routes the bare `Host` the proxy sends, so the host needs no domain. Each step decides by
21
+ * reading back, so a reconcile converges a host any earlier attempt left half done and changes nothing on a complete one.
22
+ */
23
+ export declare const ensureSandboxHost: (input: ZeropsSandboxHostInput) => Promise<ZeropsNamespaceSandboxHost>;
@@ -0,0 +1,43 @@
1
+ import type { ProviderNamespaceHost } from '@fabrika/provider-contract';
2
+ import { type ZeropsApi } from '../api';
3
+ import { type Sleeper } from '../collaborators';
4
+ /**
5
+ * One host per published HTTP port, out of the newline-separated URLs the platform writes.
6
+ *
7
+ * The form is `<hostname>-<hash>-<port>.<region>.zerops.app` (e.g. `proxy-2ec8-8080`). Read as URLs
8
+ * rather than split on `-`, so a hostname whose own first label ends in digits cannot be misread; a line
9
+ * that is not a URL, or whose first label carries no trailing port — the single portless line a proxy
10
+ * that has never deployed publishes — is skipped rather than guessed at.
11
+ */
12
+ export declare const parseZeropsSubdomainHosts: (value: string) => ProviderNamespaceHost[];
13
+ /** The hosts a service publishes, off the platform-owned `zeropsSubdomain` variable; none while it names none. */
14
+ export declare const readSubdomainHosts: (api: Pick<ZeropsApi, "listServiceEnv">, serviceId: string, signal: AbortSignal) => Promise<ProviderNamespaceHost[]>;
15
+ export interface SubdomainAccessInput {
16
+ readonly api: Pick<ZeropsApi, 'getService' | 'enableSubdomainAccess'>;
17
+ readonly serviceId: string;
18
+ /** Names the service in a refusal, e.g. `Zerops namespace proxy`. */
19
+ readonly label: string;
20
+ /** What is missing when the subdomain stays off, e.g. `the namespace has no public entry point`. */
21
+ readonly consequence: string;
22
+ readonly sleep?: Sleeper;
23
+ readonly signal: AbortSignal;
24
+ }
25
+ /**
26
+ * Publish a service on its `*.zerops.app` subdomain — the ONE thing the import document cannot do.
27
+ *
28
+ * `enableSubdomainAccess: true` is accepted by the import and then silently dropped, on a service the
29
+ * document CREATES as much as on one `override` leaves alone; a service imported with it reads back
30
+ * `subdomainAccess: false` for ever. The subdomain is established by
31
+ * `PUT /service-stack/{id}/enable-subdomain-access` and by nothing else, and that call needs a DEPLOYED
32
+ * HTTP port.
33
+ *
34
+ * It runs on RECONCILE too, so a subdomain someone turned off in the GUI comes back, and it either
35
+ * observes `subdomainAccess === true` or throws naming what is missing.
36
+ *
37
+ * The decision is the READ-BACK, never the call returning. On an already-published service the platform
38
+ * answers 2xx and then fails the process it handed back — live-verified — so a 2xx proves nothing.
39
+ *
40
+ * The HTTP ports lag the service's ACTIVE version, so `serviceStackIsNotHttp` is retried for a bounded
41
+ * window (`enableSubdomainAccessWhenHttp`) before it fails the namespace.
42
+ */
43
+ export declare const ensureSubdomainAccess: (input: SubdomainAccessInput) => 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;