@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,6 @@
1
+ import { type ProviderNamespaceUpdates } from '@fabrika/provider-contract';
2
+ import type { ZeropsNamespaceOptions } from './types';
3
+ /** The plan field of a re-pin, which moves only the stored target; the reconcile core queues rebuilds the proxy. */
4
+ export declare const ZEROPS_PROXY_SOURCE_FIELD = "proxySource";
5
+ /** Move a ready namespace's PostgreSQL service to another profile — the one field Zerops changes in place. */
6
+ export declare const createZeropsNamespaceUpdates: (options: ZeropsNamespaceOptions) => ProviderNamespaceUpdates;
@@ -0,0 +1,12 @@
1
+ import type { ZeropsService } from '../api';
2
+ /**
3
+ * The profile a service is checked against. `declared` is what the stored target says. `changingTo` is
4
+ * set only while an update moves the service, and `unconfirmed` while it retries an earlier update whose
5
+ * outcome is unknown: a live service already on either reads as the change in progress, not as drift.
6
+ */
7
+ export interface ZeropsExpectedProfile {
8
+ readonly declared?: string;
9
+ readonly changingTo?: string;
10
+ readonly unconfirmed?: string;
11
+ }
12
+ export declare const validateService: (service: ZeropsService, projectId: string, expectedBase: string, adopting: boolean, expectedPublic?: boolean, expectedProfile?: ZeropsExpectedProfile) => void;
@@ -0,0 +1,9 @@
1
+ export { zeropsNamespaceTargetCodec } from './namespace/codec';
2
+ export { ZEROPS_NAMESPACE_IAM_ISSUER_VARIABLE, ZEROPS_NAMESPACE_IAM_KEY_VARIABLE, ZEROPS_NAMESPACE_POSTGRES_HOSTNAME, ZEROPS_NAMESPACE_PROXY_HOSTNAME, ZEROPS_NAMESPACE_SUBDOMAIN_VARIABLE, ZEROPS_SHARED_POSTGRES_CONNECTION_STRING, } from './namespace/constants';
3
+ export { ZEROPS_NAMESPACE_CANCELLED, ZEROPS_NAMESPACE_LIFECYCLE, ZEROPS_PROXY_DEPLOY_FAILED, ZEROPS_PROXY_DEPLOY_TIMEOUT, ZEROPS_SUBDOMAIN_NOT_PUBLISHED, } from './namespace/errors';
4
+ export { createZeropsNamespaceOperator } from './namespace/operator';
5
+ export { createZeropsNamespaceCapabilities } from './namespace/provisioning';
6
+ export { republishProxy, type ZeropsProxyApi, type ZeropsProxyRepublishInput } from './namespace/proxy-attempt';
7
+ export { decodeZeropsNamespaceProxySource, verifyZeropsNamespaceProxySource } from './namespace/proxy-source';
8
+ export { compileZeropsNamespaceTopology, zeropsNamespacePreset } from './namespace/topology';
9
+ export type { ZeropsNamespaceOperatorOptions, ZeropsNamespaceOptions, ZeropsNamespacePlanOptions, ZeropsNamespacePostgres, ZeropsNamespacePresetInput, ZeropsNamespaceProxyBuild, ZeropsNamespaceProxyDeployment, ZeropsNamespaceProxySource, ZeropsNamespacePublicAccess, ZeropsNamespaceTarget, ZeropsNamespaceTopology, } from './namespace/types';
@@ -0,0 +1,12 @@
1
+ import { type FabrikaManifest } from './manifest';
2
+ import type { ZeropsRuntimeTarget } from './types';
3
+ export type ZeropsStepKind = 'apply-import' | 'verify-exposure' | 'write-service-env' | 'raise-start-memory' | 'size-database' | 'reserve-version' | 'upload-source' | 'trigger-build' | 'await-version' | 'reconcile-schema';
4
+ export interface ZeropsStep {
5
+ readonly id: string;
6
+ readonly kind: ZeropsStepKind;
7
+ readonly description: string;
8
+ }
9
+ /** Resolve the one declared service that receives this repository's code. */
10
+ export declare const resolveDeployHostname: (manifest: FabrikaManifest) => string;
11
+ /** Build the provider-owned deploy order without touching the platform. */
12
+ export declare const buildZeropsPlan: (manifest: FabrikaManifest, target: ZeropsRuntimeTarget) => readonly ZeropsStep[];
@@ -0,0 +1,65 @@
1
+ import { type OperationsSourceMapUploadState } from '@fabrika/operations-contract/releases';
2
+ import { type DeployStepResult, type ProviderApprovedAccess, type ProviderDeployInput, type ProviderManagedEnvironment, type ProviderRunEvents } from '@fabrika/provider-contract';
3
+ import { type ZeropsService } from './api';
4
+ import { type ZeropsCollaboratorFactory, type ZeropsCollaborators } from './collaborators';
5
+ import { type ZeropsDevExecution } from './execution';
6
+ import { type FabrikaImportDocument, type FabrikaManifest } from './manifest';
7
+ import type { ZeropsRuntimeTarget } from './types';
8
+ export declare const CANCELLED = "deploy cancelled";
9
+ export interface ZeropsDeployRun {
10
+ readonly appId: string;
11
+ readonly env: string;
12
+ /** Every origin IAM may hand this app a session at; app-wide, because IAM's registry is keyed by app id. */
13
+ readonly returnOrigins?: readonly string[];
14
+ readonly secrets: Readonly<Record<string, string>>;
15
+ readonly vars: Readonly<Record<string, string>>;
16
+ /** Platform-owned runtime configuration, separate from operator-managed application vars. */
17
+ readonly managedEnvironment: ProviderManagedEnvironment;
18
+ readonly target: ZeropsRuntimeTarget;
19
+ readonly artifact: FabrikaManifest;
20
+ /** Control's approved access for the environment (ADR-0050); the lock-down and the IAM schema come from it. */
21
+ readonly access?: ProviderApprovedAccess;
22
+ /** The run-scoped source-map destination Control minted; the build uploads to it. */
23
+ readonly artifactUpload?: ProviderDeployInput['artifactUpload'];
24
+ /** Present for an environment of kind `dev`: the launcher starts instead of the serving entry, on one container. */
25
+ readonly dev?: ZeropsDevExecution;
26
+ readonly dryRun: boolean;
27
+ readonly signal: AbortSignal;
28
+ readonly events: ProviderRunEvents;
29
+ }
30
+ export interface ZeropsDeployResult {
31
+ readonly appId: string;
32
+ readonly env: string;
33
+ readonly status: 'succeeded' | 'failed';
34
+ readonly steps: readonly DeployStepResult[];
35
+ /** Whether the build's source maps reached Operations; absent when the run had no upload to make. */
36
+ readonly artifactState?: OperationsSourceMapUploadState;
37
+ }
38
+ /** A run stops waiting for its version this long after it started. Zerops' own pipeline limit is 1 hour. */
39
+ export declare const ZEROPS_VERSION_DEADLINE_MS: number;
40
+ /**
41
+ * Resolve the manifest's declared variables INTO THE DOCUMENT — never into the rendered YAML, where a
42
+ * value carrying a quote or a newline would be read as structure and could add a service or turn
43
+ * `envIsolation` off. Only variables the manifest declares resolve; every other placeholder fails the
44
+ * deploy, and so does a value that names a service outside the app (Zerops resolves `${host_KEY}`
45
+ * regardless of isolation). The document is re-checked here because this is the last point it is an object.
46
+ */
47
+ export declare function interpolateManifest(document: FabrikaImportDocument, declared: readonly string[], values: Record<string, string>, ownHostnames: readonly string[]): FabrikaImportDocument;
48
+ /** What raising a minimum RAM calls; the deploy's collaborators, and the live platform-facts probe of the same path. */
49
+ export interface MinRamRaise {
50
+ zerops: Pick<ZeropsCollaborators, 'api' | 'sleep'>;
51
+ signal: AbortSignal;
52
+ }
53
+ /**
54
+ * Sets `service`'s minimum RAM to `minRam` and answers the minimum it reads back. It sends the custom autoscaling it
55
+ * read WHOLE with only that field changed: the platform resets every field a request leaves out.
56
+ */
57
+ export declare const raiseMinRam: (env: MinRamRaise, service: ZeropsService, hostname: string, minRam: number, need: string) => Promise<number>;
58
+ /**
59
+ * Build a Zerops deployer over a specific collaborator FACTORY. Production passes the real one; tests pass
60
+ * `() => fakes`, which is the whole testability property — one seam, all of this driver's effects.
61
+ *
62
+ * A factory rather than a bundle because the Zerops client is authenticated with a token that lives on the
63
+ * run's target, so it cannot be constructed once at module load the way Cloudflare's bundle is.
64
+ */
65
+ export declare const createZeropsDeployer: (collaborators?: ZeropsCollaboratorFactory) => (run: ZeropsDeployRun) => Promise<ZeropsDeployResult>;
@@ -0,0 +1,16 @@
1
+ /** The path of the proxy manifest in the build archive: the archive's one data file (ADR-0045), read by the proxy build. */
2
+ export declare const ZEROPS_PROXY_MANIFEST_PATH = "proxy.manifest.json";
3
+ /**
4
+ * How a proxy build receives its manifest.
5
+ *
6
+ * - `environment`: the build lifts `FABRIKA_PROXY_MANIFEST_JSON` from the service and writes it to the file, as every
7
+ * release before the archive carrier did. A namespace pinned to such a commit keeps its descriptor (ADR-0045), so it
8
+ * gets the variable, bound by the Zerops value limit.
9
+ * - `archive`: the build reads the file the uploaded archive carries.
10
+ */
11
+ export type ZeropsProxyManifestCarrier = 'environment' | 'archive';
12
+ /**
13
+ * The carrier a descriptor's proxy setup reads. Decided by the build section Zerops applies (the selected setup's, else
14
+ * the nearest one it `extends`): a lifted `FABRIKA_PROXY_MANIFEST_JSON` would overwrite an archived file, so it wins.
15
+ */
16
+ export declare const zeropsProxyManifestCarrier: (descriptorContents: string, setup?: string) => ZeropsProxyManifestCarrier;
@@ -0,0 +1,376 @@
1
+ /** Only one project can be defined. */
2
+ export interface ZeropsImportProject {
3
+ /** The name of the new project. Duplicates are allowed. */
4
+ name: string;
5
+ /** Description of the new project. */
6
+ description?: string;
7
+ /**
8
+ * Project core package.
9
+ * Zerops default: `"LIGHT"`.
10
+ */
11
+ corePackage?: 'LIGHT' | 'SERIOUS';
12
+ /** One or more string tags. Tags do not have functional meaning, they only provide better orientation in projects. */
13
+ tags?: string[];
14
+ /** List of environment variables of project configuration. */
15
+ envVariables?: Record<string, string>;
16
+ /**
17
+ * Defines the visibility scope for environment variables. Allowed values: none (no isolation, everyone sees all
18
+ * variables), service (isolation at service level, each service can only see its own variables). Explicit variable
19
+ * referencing is still possible regardless of the isolation setting.
20
+ */
21
+ envIsolation?: string;
22
+ /**
23
+ * Defines who is authorized to access the service via SSH. Values can be combined using spaces (e.g., project vpn). To
24
+ * exclude a specific access type, use a negative prefix (e.g., -vpn). Allowed values: project (anyone from the project),
25
+ * vpn (anyone from the VPN), service (anyone from the same service), service@name (anyone from the service named "name").
26
+ */
27
+ sshIsolation?: string;
28
+ /**
29
+ * When enabled, project domain includes both AAAA records and an A record pointing to Zerops shared IPv4 address. When
30
+ * disabled, the A record is not defined. If the project has its own dedicated IPv4 address, the domain always contains an
31
+ * A record with this assigned IPv4 address.
32
+ */
33
+ sharedIpv4?: boolean;
34
+ /** Defines project's primary/fallback location'. */
35
+ location?: 'eu-central' | 'us-east-1' | 'us-west-1';
36
+ }
37
+ export interface ZeropsImportService {
38
+ /**
39
+ * The unique service identifier. Limitations: duplicates in the same project forbidden; maximum 25 characters, lowercase
40
+ * ASCII letters (a-z) or numbers (0-9) only.
41
+ */
42
+ hostname: string;
43
+ /** Specifies the service type and version. */
44
+ type: ZeropsServiceType;
45
+ /**
46
+ * Deprecated, use Type version only. Defines the operation mode of the service.
47
+ * @deprecated
48
+ */
49
+ mode?: string;
50
+ /**
51
+ * List of key-value pairs. Environment variables that are blurred by default in Zerops GUI. Can be edited or deleted in
52
+ * Zerops GUI.
53
+ */
54
+ envSecrets?: Record<string, string>;
55
+ /**
56
+ * List of key-value pairs in .env format. Environment variables that are blurred by default in Zerops GUI. Can be edited
57
+ * or deleted in Zerops GUI.
58
+ */
59
+ dotEnvSecrets?: string;
60
+ /** Insert full nginx config. */
61
+ nginxConfig?: string;
62
+ /** Object storage size in GB. */
63
+ objectStorageSize?: number;
64
+ /** Select a predefined AWS S3 bucket access policy. */
65
+ objectStoragePolicy?: 'custom' | 'private' | 'public-read' | 'public-objects-read' | 'public-write' | 'public-read-write';
66
+ /**
67
+ * Define your own AWS S3 bucket access policy. See AWS docs for details. Use {{ .BucketName }} placeholder if you need to
68
+ * use bucket name in your custom policy rules.
69
+ */
70
+ objectStorageRawPolicy?: string;
71
+ /** A URL of a Github or Gitlab repository used for a one-time build of your service. */
72
+ buildFromGit?: string;
73
+ /** Set true, if you want to start service without code. */
74
+ startWithoutCode?: boolean;
75
+ /**
76
+ * Set true, if you want to enable a public access to your service via a Zerops subdomain. Not suitable for production.
77
+ * Zerops default: `false`.
78
+ */
79
+ enableSubdomainAccess?: boolean;
80
+ /**
81
+ * Services are sorted before creation by priority in descending order, i.e. the higher the priority the sooner the service
82
+ * is created.
83
+ */
84
+ priority?: number;
85
+ /** Vertical autoscaling settings. */
86
+ verticalAutoscaling?: ZeropsVerticalAutoscaling;
87
+ /** Minimum number of containers of the service. */
88
+ minContainers?: number;
89
+ /** Maximum number of containers of the service. */
90
+ maxContainers?: number;
91
+ /** Defines the autoscaling profile for the service. */
92
+ profile?: string;
93
+ /** Json formatted list of overrides for the selected autoscaling profile. */
94
+ profileOverrides?: unknown;
95
+ /** Mount shared storages to the service, buildFromGit must be filled. */
96
+ mount?: string[];
97
+ /** Set true, if you want to enable CDN for the object storage bucket. Currently only relevant for object storage services. */
98
+ enableCdn?: boolean;
99
+ /**
100
+ * Defines the visibility scope for environment variables. Allowed values: none (no isolation, everyone sees all
101
+ * variables), service (isolation at service level, each service can only see its own variables). Explicit variable
102
+ * referencing is still possible regardless of the isolation setting. When set at the service level, these values override
103
+ * any project-level defined isolation settings.
104
+ */
105
+ envIsolation?: string;
106
+ /**
107
+ * Defines who is authorized to access the service via SSH. Values can be combined using spaces (e.g., project vpn). To
108
+ * exclude a specific access type, use a negative prefix (e.g., -vpn). Allowed values: project (anyone from the project),
109
+ * vpn (anyone from the VPN), service (anyone from the same service), service@name (anyone from the service named "name").
110
+ * When set at the service level, these values override any project-level defined isolation settings.
111
+ */
112
+ sshIsolation?: string;
113
+ /**
114
+ * Deprecated, use Type version only. Optionally specifies the OS of the runtime service imported with
115
+ * 'startWithoutCode=true'.
116
+ * @deprecated
117
+ */
118
+ os?: string;
119
+ zeropsSetup?: string;
120
+ zeropsYaml?: ZeropsYaml;
121
+ /** Override existing service. */
122
+ override?: boolean;
123
+ }
124
+ /** Specifies the service type and version. */
125
+ export type ZeropsServiceType = 'alpine/bun@1' | 'alpine/bun@1.2' | 'alpine/bun@1.2.2' | 'alpine/bun@1.3' | 'alpine/bun@1.3.9' | 'alpine/bun@canary' | 'alpine/bun@latest' | 'alpine/bun@nightly' | 'alpine/docker@26' | 'alpine/docker@26.1' | 'alpine/docker@26.1.5' | 'alpine/docker@latest' | 'alpine/dotnet@10' | 'alpine/dotnet@8' | 'alpine/dotnet@9' | 'alpine/dotnet@latest' | 'alpine/elixir@1' | 'alpine/elixir@1.16' | 'alpine/elixir@1.16.3' | 'alpine/elixir@latest' | 'alpine/gleam@1' | 'alpine/gleam@1.5' | 'alpine/gleam@1.5.1' | 'alpine/gleam@latest' | 'alpine/go@1' | 'alpine/go@1.22' | 'alpine/go@latest' | 'alpine/golang@1' | 'alpine/golang@1.22' | 'alpine/golang@latest' | 'alpine/java@17' | 'alpine/java@21' | 'alpine/java@latest' | 'alpine/nginx@1.22' | 'alpine/nginx@latest' | 'alpine/nodejs@20' | 'alpine/nodejs@22' | 'alpine/nodejs@24' | 'alpine/nodejs@latest' | 'alpine/php-apache@8.1' | 'alpine/php-apache@8.1+2.4' | 'alpine/php-apache@8.3' | 'alpine/php-apache@8.3+2.4' | 'alpine/php-apache@8.4' | 'alpine/php-apache@8.4+2.4' | 'alpine/php-apache@8.5' | 'alpine/php-apache@8.5+2.4' | 'alpine/php-apache@latest' | 'alpine/php-nginx@8.3' | 'alpine/php-nginx@8.3+1.22' | 'alpine/php-nginx@8.4' | 'alpine/php-nginx@8.4+1.22' | 'alpine/php-nginx@8.5' | 'alpine/php-nginx@8.5+1.28' | 'alpine/php-nginx@latest' | 'alpine/python@3.11' | 'alpine/python@3.12' | 'alpine/python@latest' | 'alpine/ruby@3.3' | 'alpine/ruby@3.4' | 'alpine/ruby@4.0' | 'alpine/ruby@latest' | 'alpine/rust@1' | 'alpine/rust@latest' | 'alpine/rust@nightly' | 'alpine/rust@stable' | 'alpine/static' | 'alpine/static@1.0' | 'alpine/static@latest' | 'alpine/zero@0.1' | 'alpine/zero@latest' | 'alpine/zero@nightly' | 'alpine@3.21' | 'alpine@3.22' | 'alpine@3.23' | 'alpine@3.24' | 'alpine@latest' | 'clickhouse:ha@25.3' | 'clickhouse:single@25.3' | 'elasticsearch:ha@8.16' | 'elasticsearch:ha@9.2' | 'elasticsearch:single@8.16' | 'elasticsearch:single@9.2' | 'kafka:ha@3.9' | 'kafka:single@3.9' | 'mariadb:ha@10.6' | 'mariadb:single@10.6' | 'meilisearch:single@1.10' | 'meilisearch:single@1.20' | 'meilisearch:single@1.44' | 'nats:ha@2.10' | 'nats:ha@2.12' | 'nats:single@2.10' | 'nats:single@2.12' | 'object-storage' | 'objectstorage' | 'postgresql:ha@14' | 'postgresql:ha@16' | 'postgresql:ha@17' | 'postgresql:ha@18' | 'postgresql:single@14' | 'postgresql:single@16' | 'postgresql:single@17' | 'postgresql:single@18' | 'qdrant:ha@1.10' | 'qdrant:ha@1.12' | 'qdrant:single@1.10' | 'qdrant:single@1.12' | 'seaweedfs:ha@3' | 'seaweedfs:single@3' | 'shared-storage:ha' | 'shared-storage:single' | 'sharedstorage:ha' | 'sharedstorage:single' | 'static' | 'typesense:ha@27.1' | 'typesense:ha@30.2' | 'typesense:single@27.1' | 'typesense:single@30.2' | 'ubuntu/bun@1' | 'ubuntu/bun@1.1' | 'ubuntu/bun@1.1.34' | 'ubuntu/bun@1.2' | 'ubuntu/bun@1.2.2' | 'ubuntu/bun@1.3' | 'ubuntu/bun@1.3.9' | 'ubuntu/bun@canary' | 'ubuntu/bun@latest' | 'ubuntu/bun@nightly' | 'ubuntu/deno@2' | 'ubuntu/deno@2.0' | 'ubuntu/deno@2.0.0' | 'ubuntu/deno@latest' | 'ubuntu/dotnet@10' | 'ubuntu/dotnet@8' | 'ubuntu/dotnet@9' | 'ubuntu/dotnet@latest' | 'ubuntu/elixir@1' | 'ubuntu/elixir@1.16' | 'ubuntu/elixir@1.16.2' | 'ubuntu/elixir@latest' | 'ubuntu/gleam@1' | 'ubuntu/gleam@1.5' | 'ubuntu/gleam@1.5.1' | 'ubuntu/gleam@latest' | 'ubuntu/go@1' | 'ubuntu/go@1.22' | 'ubuntu/go@latest' | 'ubuntu/golang@1' | 'ubuntu/golang@1.22' | 'ubuntu/golang@latest' | 'ubuntu/java@17' | 'ubuntu/java@21' | 'ubuntu/java@latest' | 'ubuntu/nginx@1.22' | 'ubuntu/nginx@latest' | 'ubuntu/nodejs@20' | 'ubuntu/nodejs@22' | 'ubuntu/nodejs@24' | 'ubuntu/nodejs@latest' | 'ubuntu/php-apache@8.1' | 'ubuntu/php-apache@8.1+2.4' | 'ubuntu/php-apache@8.3' | 'ubuntu/php-apache@8.3+2.4' | 'ubuntu/php-apache@8.4' | 'ubuntu/php-apache@8.4+2.4' | 'ubuntu/php-apache@8.5' | 'ubuntu/php-apache@8.5+2.4' | 'ubuntu/php-apache@latest' | 'ubuntu/php-nginx@8.3' | 'ubuntu/php-nginx@8.3+1.22' | 'ubuntu/php-nginx@8.4' | 'ubuntu/php-nginx@8.4+1.22' | 'ubuntu/php-nginx@8.5' | 'ubuntu/php-nginx@8.5+1.28' | 'ubuntu/php-nginx@latest' | 'ubuntu/python@3.11' | 'ubuntu/python@3.12' | 'ubuntu/python@3.14' | 'ubuntu/python@latest' | 'ubuntu/ruby@3.3' | 'ubuntu/ruby@3.4' | 'ubuntu/ruby@4.0' | 'ubuntu/ruby@latest' | 'ubuntu/rust@1' | 'ubuntu/rust@latest' | 'ubuntu/rust@nightly' | 'ubuntu/rust@stable' | 'ubuntu/static' | 'ubuntu/static@1.0' | 'ubuntu/static@latest' | 'ubuntu/zero@0.1' | 'ubuntu/zero@latest' | 'ubuntu/zero@nightly' | 'ubuntu@22.04' | 'ubuntu@24.04' | 'ubuntu@26.04' | 'ubuntu@latest' | 'valkey:ha@7.2' | 'valkey:single@7.2' | 'zcp@1' | 'zcp@latest';
126
+ /** Vertical autoscaling settings. */
127
+ export interface ZeropsVerticalAutoscaling {
128
+ /** Fixed CPU thread count that each container of the service will be set to. */
129
+ cpu?: number;
130
+ /** Fixed RAM in GB that each container of the service will be set to. */
131
+ ram?: number;
132
+ /** Fixed disk space in GB that each container of the service will be set to. */
133
+ disk?: number;
134
+ /** CPU mode that each container of the service will be set to. */
135
+ cpuMode?: 'DEDICATED' | 'SHARED';
136
+ /** Minimum CPU thread count that each container of the service can scale down to. */
137
+ minCpu?: number;
138
+ /** Maximum CPU thread count that each container of the service can scale up to. */
139
+ maxCpu?: number;
140
+ /** Minimum RAM in GB that each container of the service can scale down to. */
141
+ minRam?: number;
142
+ /** Maximum RAM in GB that each container of the service can scale up to. */
143
+ maxRam?: number;
144
+ /** Minimum disk space in GB that each container of the service can scale down to. */
145
+ minDisk?: number;
146
+ /** Maximum disk space in GB that each container of the service can scale up to. */
147
+ maxDisk?: number;
148
+ /** Number of CPU cores with which each container starts. */
149
+ startCpuCoreCount?: number;
150
+ /** Whether to enable swap memory for containers. Swap is enabled by default. Refer to documentation for more details. */
151
+ swapEnabled?: boolean;
152
+ /** Minimum number of unused CPU cores before a container starts scaling. */
153
+ minFreeCpuCores?: number;
154
+ /** Minimum percentage of unused CPU cores before a container starts scaling. */
155
+ minFreeCpuPercent?: number;
156
+ /** Minimum unused memory in GB before a container starts scaling. */
157
+ minFreeRamGB?: number;
158
+ /** Minimum percentage of unused memory before a container starts scaling. */
159
+ minFreeRamPercent?: number;
160
+ /** @deprecated */
161
+ minVCpu?: number;
162
+ /** @deprecated */
163
+ maxVCpu?: number;
164
+ }
165
+ export interface ZeropsYaml {
166
+ /** The top-level element is always zerops. */
167
+ zerops: ZeropsYamlSetup[];
168
+ }
169
+ export interface ZeropsYamlSetup {
170
+ /**
171
+ * The first element setup contains the hostname of your service. A runtime service with the same hostname must exist in
172
+ * Zerops. Zerops supports the definition of multiple runtime services in a single zerops.yml. This is useful when you use
173
+ * a monorepo. Just add multiple setup elements in your zerops.yml.
174
+ */
175
+ setup: string;
176
+ /** Build pipeline configuration. */
177
+ build?: ZeropsYamlBuild;
178
+ /** Deploy configuration. */
179
+ deploy?: ZeropsYamlDeploy;
180
+ /** Runtime configuration. */
181
+ run?: ZeropsYamlRun;
182
+ }
183
+ /** Build pipeline configuration. */
184
+ export interface ZeropsYamlBuild {
185
+ /** Deprecated - use base attribute. Sets the operating system for the build environment. */
186
+ os?: string;
187
+ /** Sets the base technology for the build environment. */
188
+ base?: string[];
189
+ /** Customises the build environment by installing additional dependencies or tools to the base build environment. */
190
+ prepareCommands?: string[];
191
+ /** Defines build commands. Zerops triggers each command in the defined order in a dedicated build container. */
192
+ buildCommands?: string[];
193
+ deploy?: string[];
194
+ /**
195
+ * Selects which files or folders will be deployed after the build has successfully finished. To filter out specific files
196
+ * or folders, use .deployignore file.
197
+ */
198
+ deployFiles: string[];
199
+ /** Defines which files or folders will be cached for the next build. */
200
+ cache?: unknown;
201
+ /**
202
+ * Defines what files or folders will be copied from the build container to the prepare runtime container. The prepare
203
+ * runtime container is used to customize your runtime environment.
204
+ */
205
+ addToRunPrepare?: string[];
206
+ /** Defines the environment variables for the build environment. */
207
+ envVariables?: Record<string, string>;
208
+ }
209
+ /** Deploy configuration. */
210
+ export interface ZeropsYamlDeploy {
211
+ /** Defines a readiness check. Requires either httpGet object or exec object. */
212
+ readinessCheck?: ZeropsReadinessCheck;
213
+ temporaryShutdown?: boolean;
214
+ }
215
+ /** Defines a readiness check. Requires either httpGet object or exec object. */
216
+ export interface ZeropsReadinessCheck {
217
+ /** Configures the readiness check to request a local URL using a http GET method. */
218
+ httpGet?: ZeropsHttpGetProbe;
219
+ /** Configures the readiness check to run a local command. */
220
+ exec?: ZeropsExecProbe;
221
+ /** Time until container is marked as failed. */
222
+ failureTimeout?: number;
223
+ /** Time interval between readiness check attempts. */
224
+ retryPeriod?: number;
225
+ }
226
+ /** Configures the readiness check to request a local URL using a http GET method. */
227
+ export interface ZeropsHttpGetProbe {
228
+ /**
229
+ * The readiness check is triggered from inside of your runtime container so no https is required. If your application
230
+ * requires a https request, set scheme: https
231
+ */
232
+ scheme?: string;
233
+ /**
234
+ * The readiness check is triggered from inside of your runtime container so it always uses the localhost (127.0.0.1). If
235
+ * you need to add a host to the request header, specify it in the host attribute.
236
+ */
237
+ host?: string;
238
+ /** Defines the port of the HTTP GET request. */
239
+ port: number;
240
+ /** Defines the URL path of the HTTP GET request. */
241
+ path: string;
242
+ }
243
+ /** Configures the readiness check to run a local command. */
244
+ export interface ZeropsExecProbe {
245
+ /**
246
+ * Defines a local command to be run. The command has access to the same environment variables. A single string is
247
+ * required. If you need to run multiple commands create a shell script or, use a multiline format as in the example below.
248
+ */
249
+ command: string;
250
+ }
251
+ /** Runtime configuration. */
252
+ export interface ZeropsYamlRun {
253
+ /** Defines one or more commands to be run each time a new runtime container is started or a container is restarted. */
254
+ initCommands?: string[];
255
+ /** Customises the runtime environment by installing additional dependencies or tools to the base runtime environment. */
256
+ prepareCommands?: string[];
257
+ /** Deprecated - use base attribute. Sets the operating system for the runtime environment. */
258
+ os?: string;
259
+ /**
260
+ * Sets the base technology for the runtime environment. If you don't specify the run.base attribute, Zerops keeps the
261
+ * current version for your runtime.
262
+ */
263
+ base?: string;
264
+ /** Defines the start command for your application. */
265
+ start?: string;
266
+ /**
267
+ * Customizes the folder that will be used as the root of the publicly accessible web server content. This attribute is
268
+ * available only for runtimes with webservers.
269
+ */
270
+ documentRoot?: string;
271
+ /** Sets the custom webserver configuration. This attribute is available only for runtimes with webservers. */
272
+ siteConfigPath?: string;
273
+ envReplace?: ZeropsEnvReplace;
274
+ /** Defines a health check. */
275
+ healthCheck?: ZeropsHealthCheck;
276
+ routing?: ZeropsRouting;
277
+ /** Specifies one or more internal ports on which your application will listen. */
278
+ ports?: ZeropsPort[];
279
+ /** Defines the environment variables for the runtime environment. */
280
+ envVariables?: Record<string, string>;
281
+ /** Defines the start commands for the runtime environment. */
282
+ startCommands?: ZeropsStartCommand[];
283
+ /**
284
+ * A list of cron jobs with their respective schedule (timing), the command to run (command), and additional options like
285
+ * allContainers and workingDir.
286
+ */
287
+ crontab?: ZeropsCrontabEntry[];
288
+ }
289
+ export interface ZeropsEnvReplace {
290
+ target: string[];
291
+ delimiter: string[];
292
+ }
293
+ /** Defines a health check. */
294
+ export interface ZeropsHealthCheck {
295
+ /** Configures the health check to request a local URL using a http GET method. */
296
+ httpGet?: ZeropsHttpGetProbe;
297
+ /** Configures the health check to run a local command. */
298
+ exec?: ZeropsExecProbe;
299
+ /** Time until container fails after consecutive health check failures (reset by success). */
300
+ failureTimeout?: number;
301
+ /** Time until container is disconnected and becomes publicly unavailable. */
302
+ disconnectTimeout?: number;
303
+ /** Time until container is connected and becomes publicly available. */
304
+ recoveryTimeout?: number;
305
+ /** Time interval between health check attempts. */
306
+ execPeriod?: number;
307
+ }
308
+ export interface ZeropsRouting {
309
+ root?: string;
310
+ /**
311
+ * Content of default Access-Control headers (Allow-Origin, Allow-Methods, Allow-Headers and Expose-Headers), e.g. "'*'
312
+ * always"
313
+ */
314
+ cors?: string;
315
+ redirects?: ZeropsRoutingRedirect[];
316
+ headers?: ZeropsRoutingHeader[];
317
+ }
318
+ export interface ZeropsRoutingRedirect {
319
+ /**
320
+ * Relative or an absolute (defined by with http://) path to be matched against request location. May contain * at the end
321
+ * for regex.
322
+ */
323
+ from: string;
324
+ /** Relative or an absolute (defined by with http://) path to redirect user to. */
325
+ to: string;
326
+ /**
327
+ * Which HTTP status code to use for the redirect. If not set, and To and From are relative, an internal/masked redirect
328
+ * will be used.
329
+ */
330
+ status?: number;
331
+ /**
332
+ * Whether part of the path after From should be preserved. Used to forward contents of one directory to another in
333
+ * non-masked redirects.
334
+ */
335
+ preservePath?: boolean;
336
+ /** Whether query parameters should be preserved. Used in non-masked redirects. */
337
+ preserveQuery?: boolean;
338
+ }
339
+ export interface ZeropsRoutingHeader {
340
+ /** Relative path to be matched against request location. May contain * at the end for prefix-based match. */
341
+ for: string;
342
+ /** Header name as Key and raw content as Value, e.g. "Access-Control-Allow-Origin": "'*' always" */
343
+ values: Record<string, string>;
344
+ }
345
+ export interface ZeropsPort {
346
+ /** Defines the protocol. Allowed values are TCP or UDP. Default value is TCP. */
347
+ protocol?: string;
348
+ /**
349
+ * Defines the port number. You can set any port number between 10 and 65435. Ports outside this interval are reserved for
350
+ * internal Zerops systems.
351
+ */
352
+ port: number;
353
+ description?: string;
354
+ /**
355
+ * Set to true if a web server is running on the port. Zerops uses this information for the configuration of public access.
356
+ * True is available only in combination with the TCP protocol. Default value is false.
357
+ */
358
+ httpSupport?: boolean;
359
+ }
360
+ export interface ZeropsStartCommand {
361
+ name?: string;
362
+ command: string;
363
+ workingDir?: string;
364
+ /** Defines one or more commands to be run each time a new runtime container is started or a container is restarted. */
365
+ initCommands?: string[];
366
+ }
367
+ export interface ZeropsCrontabEntry {
368
+ /** Defines when the cron job runs in standard cron format. */
369
+ timing: string;
370
+ /** Specifies the shell command to run at the scheduled time. */
371
+ command: string;
372
+ /** The directory where the command will be executed (default: /var/www) */
373
+ workingDir?: string;
374
+ /** If set to true, the job runs on all containers; otherwise, it runs on a single container (default: false) */
375
+ allContainers: boolean;
376
+ }
@@ -0,0 +1,4 @@
1
+ /** Deterministic app prefix for services placed in a shared Zerops namespace. */
2
+ export declare const zeropsSharedServicePrefix: (appId: string) => string;
3
+ /** Build one app-owned service hostname for a shared namespace. */
4
+ export declare const zeropsSharedServiceHostname: (appId: string, localService: string) => string;
@@ -0,0 +1,13 @@
1
+ /** Hosts named by cross-service references in `text`, deduplicated, in order of first appearance. */
2
+ export declare function serviceReferenceHosts(text: string): string[];
3
+ /** The hosts a service of this app may reference: its own declared hostnames plus the namespace's shared services. */
4
+ export declare function allowedReferenceHosts(ownHostnames: readonly string[]): ReadonlySet<string>;
5
+ /** The first referenced host outside `allowed`, or null when every reference stays inside the app. */
6
+ export declare function foreignReferenceHost(text: string, allowed: ReadonlySet<string>): string | null;
7
+ /**
8
+ * The first reference in `text` to a service variable only the platform may reference, or null. The key is compared
9
+ * without case, because whether Zerops resolves one case-insensitively is not measured.
10
+ */
11
+ export declare function platformOnlyServiceReference(text: string): string | null;
12
+ /** Refuse an application value that references a platform-only service variable, naming only the reference. */
13
+ export declare function assertNoPlatformOnlyReference(text: string): void;
@@ -0,0 +1,6 @@
1
+ export declare const MAX_ID_LENGTH = 128;
2
+ export declare const SHA256_PATTERN: RegExp;
3
+ export declare const COMMIT_SHA_PATTERN: RegExp;
4
+ export declare const ID_PATTERN: RegExp;
5
+ export declare const GITHUB_OWNER_PATTERN: RegExp;
6
+ export declare const GITHUB_REPOSITORY_PATTERN: RegExp;
@@ -0,0 +1,60 @@
1
+ import type { ZeropsSourceRepository } from './types';
2
+ /** A private source names its connection; an installation id alone never selects a credential (ADR-0029). */
3
+ export interface ZeropsSourcePrivateBinding {
4
+ readonly connectionId: string;
5
+ readonly installationId: number;
6
+ }
7
+ export interface ZeropsSourceResolveInput {
8
+ readonly repository: ZeropsSourceRepository;
9
+ readonly requestedRef: string;
10
+ readonly expectedCommitSha?: string;
11
+ readonly privateBinding?: ZeropsSourcePrivateBinding;
12
+ readonly descriptorSha256: string;
13
+ readonly signal: AbortSignal;
14
+ }
15
+ export interface ZeropsSourceResolution {
16
+ readonly commitSha: string;
17
+ readonly descriptorSha256: string;
18
+ }
19
+ /** ADR-0045: the one generated data file a platform archive carries beside the exact commit, at a path the commit lacks. */
20
+ export interface ZeropsSourceDataFile {
21
+ readonly path: string;
22
+ readonly contents: string;
23
+ }
24
+ /** ADR-0045: platform archives are anonymous, tree-prechecked, keep relative symlinks. */
25
+ export type ZeropsSourceArchive = {
26
+ readonly kind: 'application';
27
+ readonly privateBinding?: ZeropsSourcePrivateBinding;
28
+ } | {
29
+ readonly kind: 'platform';
30
+ readonly dataFile?: ZeropsSourceDataFile;
31
+ };
32
+ export interface ZeropsSourceUploadInput {
33
+ readonly repository: ZeropsSourceRepository;
34
+ readonly commitSha: string;
35
+ readonly descriptorSha256: string;
36
+ readonly archive: ZeropsSourceArchive;
37
+ /** A credential in transit: never logged, persisted, or returned in an error. */
38
+ readonly uploadUrl: string;
39
+ readonly signal: AbortSignal;
40
+ }
41
+ export interface ZeropsSourceUploadResult {
42
+ readonly commitSha: string;
43
+ readonly descriptorSha256: string;
44
+ /** The sha256 of the data file the archive carried; absent without one. */
45
+ readonly dataFileSha256?: string;
46
+ readonly entryCount: number;
47
+ readonly expandedBytes: number;
48
+ }
49
+ /** The GitHub source the Zerops composition injects; Control implements it in process. Callers verify what it returns. */
50
+ export interface ZeropsSourcePort {
51
+ resolve(input: ZeropsSourceResolveInput): Promise<ZeropsSourceResolution>;
52
+ upload(input: ZeropsSourceUploadInput): Promise<ZeropsSourceUploadResult>;
53
+ }
54
+ /**
55
+ * The source refused a read for GitHub's rate limit. The read succeeds again once the limit resets, so a namespace
56
+ * mutation that hits it stays retryable. The message is the user's: whose limit, when it resets, how to avoid it.
57
+ */
58
+ export declare class ZeropsSourceRateLimitedError extends Error {
59
+ constructor(message: string);
60
+ }
@@ -0,0 +1,4 @@
1
+ export interface ZeropsSourceRepository {
2
+ owner: string;
3
+ name: string;
4
+ }
@@ -0,0 +1,19 @@
1
+ import { z } from 'zod';
2
+ import type { ZeropsSourceRepository } from './types';
3
+ export declare function parseSourceWire<T>(schema: z.ZodType<T, z.ZodTypeDef, unknown>, value: unknown, label: string): T;
4
+ export declare const identifierSchema: z.ZodString;
5
+ export declare const commitShaSchema: z.ZodString;
6
+ export declare const sha256Schema: z.ZodString;
7
+ export declare const repositorySchema: z.ZodObject<{
8
+ owner: z.ZodString;
9
+ name: z.ZodEffects<z.ZodString, string, string>;
10
+ }, "strict", z.ZodTypeAny, {
11
+ name: string;
12
+ owner: string;
13
+ }, {
14
+ name: string;
15
+ owner: string;
16
+ }>;
17
+ export declare const rejectExplicitUndefined: (value: object, context: z.RefinementCtx) => void;
18
+ export declare const isZeropsUploadDestination: (value: string) => boolean;
19
+ export declare function normalizeZeropsSourceRepository(repoUrl: string): ZeropsSourceRepository;
@@ -0,0 +1,2 @@
1
+ export type { ZeropsSourceRepository } from './source/types';
2
+ export { isZeropsUploadDestination, normalizeZeropsSourceRepository } from './source/validation';