@fabrika/provider-zerops 0.8.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 (102) hide show
  1. package/package.json +15 -14
  2. package/src/api/client.ts +6 -0
  3. package/src/api/types.ts +12 -0
  4. package/src/control.ts +26 -0
  5. package/src/execution.ts +147 -14
  6. package/src/installation/generated/platform-proxy-manifest.ts +20 -0
  7. package/src/manifest.ts +9 -5
  8. package/src/namespace/provisioning.ts +4 -2
  9. package/src/namespace/proxy-attempt.ts +29 -0
  10. package/src/plan.ts +1 -1
  11. package/src/provider.ts +40 -0
  12. package/types/src/api/client.d.ts +5 -0
  13. package/types/src/api/errors.d.ts +24 -0
  14. package/types/src/api/polling.d.ts +41 -0
  15. package/types/src/api/readers.d.ts +977 -0
  16. package/types/src/api/service-env-limit.d.ts +17 -0
  17. package/types/src/api/service-env-response.d.ts +23 -0
  18. package/types/src/api/types.d.ts +638 -0
  19. package/types/src/api.d.ts +6 -0
  20. package/types/src/authoring.d.ts +9 -0
  21. package/types/src/cli-args.d.ts +19 -0
  22. package/types/src/cli.d.ts +10 -0
  23. package/types/src/collaborators.d.ts +18 -0
  24. package/types/src/compile.d.ts +91 -0
  25. package/types/src/control.d.ts +41 -0
  26. package/types/src/database-budget.d.ts +38 -0
  27. package/types/src/descriptor.d.ts +28 -0
  28. package/types/src/execution.d.ts +137 -0
  29. package/types/src/exposure.d.ts +47 -0
  30. package/types/src/index.d.ts +31 -0
  31. package/types/src/installation/admin-options.d.ts +24 -0
  32. package/types/src/installation/admin.d.ts +35 -0
  33. package/types/src/installation/checker-release.d.ts +12 -0
  34. package/types/src/installation/deploy-options.d.ts +37 -0
  35. package/types/src/installation/deploy.d.ts +96 -0
  36. package/types/src/installation/generated/platform-console-schema.d.ts +2 -0
  37. package/types/src/installation/generated/platform-proxy-manifest.d.ts +2 -0
  38. package/types/src/installation/hosts.d.ts +38 -0
  39. package/types/src/installation/index.d.ts +9 -0
  40. package/types/src/installation/init-options.d.ts +38 -0
  41. package/types/src/installation/init.d.ts +60 -0
  42. package/types/src/installation/install-collaborators.d.ts +24 -0
  43. package/types/src/installation/install-environment.d.ts +70 -0
  44. package/types/src/installation/install-options.d.ts +49 -0
  45. package/types/src/installation/install-project.d.ts +13 -0
  46. package/types/src/installation/install-provisioning.d.ts +58 -0
  47. package/types/src/installation/install-secrets.d.ts +30 -0
  48. package/types/src/installation/install-token.d.ts +10 -0
  49. package/types/src/installation/install.d.ts +23 -0
  50. package/types/src/installation/installation-source.d.ts +8 -0
  51. package/types/src/installation/log.d.ts +44 -0
  52. package/types/src/installation/machine-key.d.ts +19 -0
  53. package/types/src/installation/mcp.d.ts +18 -0
  54. package/types/src/installation/placement-options.d.ts +11 -0
  55. package/types/src/installation/platform-archive.d.ts +7 -0
  56. package/types/src/installation/platform-source.d.ts +8 -0
  57. package/types/src/installation/platform-upload.d.ts +3 -0
  58. package/types/src/installation/proxy-manifest.d.ts +105 -0
  59. package/types/src/installation/secrets.d.ts +17 -0
  60. package/types/src/installation/sidecar.d.ts +51 -0
  61. package/types/src/installation/source-options.d.ts +1 -0
  62. package/types/src/installation/topology/artifacts.d.ts +8 -0
  63. package/types/src/installation/topology/index.d.ts +5 -0
  64. package/types/src/installation/topology/installation-schemas.d.ts +2242 -0
  65. package/types/src/installation/topology/invariants.d.ts +23 -0
  66. package/types/src/installation/topology/setups.d.ts +58 -0
  67. package/types/src/installation/topology/topology.d.ts +148 -0
  68. package/types/src/installation/topology/validate.d.ts +11 -0
  69. package/types/src/installation/upgrade-options.d.ts +26 -0
  70. package/types/src/installation/upgrade-output.d.ts +6 -0
  71. package/types/src/installation/upgrade.d.ts +88 -0
  72. package/types/src/managed-env.d.ts +57 -0
  73. package/types/src/manifest.d.ts +206 -0
  74. package/types/src/namespace/claims.d.ts +3 -0
  75. package/types/src/namespace/codec.d.ts +334 -0
  76. package/types/src/namespace/constants.d.ts +25 -0
  77. package/types/src/namespace/errors.d.ts +15 -0
  78. package/types/src/namespace/manifest.d.ts +4 -0
  79. package/types/src/namespace/operator.d.ts +12 -0
  80. package/types/src/namespace/provisioning.d.ts +4 -0
  81. package/types/src/namespace/proxy-attempt.d.ts +36 -0
  82. package/types/src/namespace/proxy-reads.d.ts +33 -0
  83. package/types/src/namespace/proxy-secrets.d.ts +8 -0
  84. package/types/src/namespace/proxy-source.d.ts +74 -0
  85. package/types/src/namespace/topology.d.ts +9 -0
  86. package/types/src/namespace/types.d.ts +99 -0
  87. package/types/src/namespace/update.d.ts +6 -0
  88. package/types/src/namespace/validation.d.ts +12 -0
  89. package/types/src/namespace.d.ts +9 -0
  90. package/types/src/plan.d.ts +12 -0
  91. package/types/src/provider.d.ts +65 -0
  92. package/types/src/proxy-manifest-carrier.d.ts +16 -0
  93. package/types/src/schema.generated.d.ts +376 -0
  94. package/types/src/service-names.d.ts +4 -0
  95. package/types/src/service-references.d.ts +13 -0
  96. package/types/src/source/constants.d.ts +6 -0
  97. package/types/src/source/port.d.ts +60 -0
  98. package/types/src/source/types.d.ts +4 -0
  99. package/types/src/source/validation.d.ts +19 -0
  100. package/types/src/source.d.ts +2 -0
  101. package/types/src/types.d.ts +121 -0
  102. package/types/src/version-attempt.d.ts +8 -0
@@ -0,0 +1,5 @@
1
+ import type { ZeropsApi, ZeropsApiOptions } from './types';
2
+ /** Base URL of the Zerops public REST API. */
3
+ export declare const ZEROPS_API_BASE = "https://api.app-prg1.zerops.io/api/rest/public";
4
+ /** Build the real client. Every request carries the bearer and the run's signal. */
5
+ export declare const createZeropsApi: (options: ZeropsApiOptions) => ZeropsApi;
@@ -0,0 +1,24 @@
1
+ export declare const isAppVersionNotFoundResponse: (value: unknown) => boolean;
2
+ /**
3
+ * A non-2xx answer from the Zerops API. `code` is the platform's own error identifier, so a caller can
4
+ * branch on `userDataDuplicateKey` rather than matching a prose message.
5
+ */
6
+ export declare class ZeropsApiError extends Error {
7
+ readonly status: number;
8
+ readonly code: string;
9
+ constructor(message: string, status: number, code: string);
10
+ }
11
+ /**
12
+ * The platform's code for "this service publishes no HTTP port", the answer `enableSubdomainAccess` gives
13
+ * before a service's first deploy. Exported so a caller can say what is missing instead of relaying prose.
14
+ */
15
+ export declare const ZEROPS_SERVICE_NOT_HTTP = "serviceStackIsNotHttp";
16
+ /**
17
+ * Turn a non-2xx response into a `ZeropsApiError`. Zerops answers with `{ error: { code, message, meta } }`
18
+ * (the envelope observed live; the OpenAPI `Error` schema shows the inner `{ code, message }`).
19
+ *
20
+ * `redactDetail` drops the server's MESSAGE, which a validation error can fill with the value it
21
+ * rejected. The CODE is a fixed identifier and is kept either way — without it nothing downstream can
22
+ * tell a duplicate key from a missing service.
23
+ */
24
+ export declare const apiError: (label: string, status: number, body: unknown, redactDetail: boolean) => ZeropsApiError;
@@ -0,0 +1,41 @@
1
+ import type { Sleeper } from '../collaborators';
2
+ import { type ZeropsApi, type ZeropsProcess } from './types';
3
+ /**
4
+ * Poll ONE process to completion.
5
+ *
6
+ * The same loop `deployPlatformService` (`installation/deploy.ts`) runs over `/app-version`, run over `/process`
7
+ * instead: read, decide ONLY on a status this build knows to be terminal, sleep, and give up on a deadline
8
+ * of our own rather than on a coincidence. Returns the finished process so a caller can read
9
+ * `actionName`/`appVersionId` off it.
10
+ *
11
+ * Anything outside `ZEROPS_PROCESS_TERMINAL` means "keep waiting", including a status this build has never
12
+ * seen — which is why an unpublished vocabulary (see that constant) can cost a timeout and never a false
13
+ * success. A non-`FINISHED` terminal status throws, naming the status and nothing else.
14
+ */
15
+ export declare const waitForProcess: (input: {
16
+ api: Pick<ZeropsApi, "getProcess">;
17
+ processId: string;
18
+ sleep: Sleeper;
19
+ signal: AbortSignal;
20
+ /** What to call this process in a failure or timeout message. Defaults to its id. */
21
+ label?: string;
22
+ intervalMs?: number;
23
+ attempts?: number;
24
+ }) => Promise<ZeropsProcess>;
25
+ /**
26
+ * `enableSubdomainAccess`, repeated while the service does not yet publish an HTTP port.
27
+ *
28
+ * Live-verified: right after a service's first app version reads ACTIVE the platform still answers
29
+ * `serviceStackIsNotHttp`, and a minute later the same call is accepted. The ports lag ACTIVE, so that
30
+ * answer means "not yet" for a bounded window. Past it the last refusal is rethrown unchanged, so a caller
31
+ * still names the missing port. Any other failure is rethrown at once. The 2xx still proves nothing: the
32
+ * caller decides by reading `subdomainAccess` back.
33
+ */
34
+ export declare const enableSubdomainAccessWhenHttp: (input: {
35
+ api: Pick<ZeropsApi, "enableSubdomainAccess">;
36
+ serviceId: string;
37
+ sleep: Sleeper;
38
+ signal: AbortSignal;
39
+ intervalMs?: number;
40
+ attempts?: number;
41
+ }) => Promise<void>;