@fabrika/provider-zerops 0.9.0-dev.1 → 0.9.0-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -14
- package/sandbox/Dockerfile +16 -0
- package/sandbox/bin/postgres-auth.sh +38 -0
- package/sandbox/bin/reset.sh +12 -0
- package/sandbox/bin/run-build.sh +35 -0
- package/sandbox/bin/run-launcher.sh +18 -0
- package/sandbox/bin/start-launcher.sh +25 -0
- package/sandbox/bin/stop.sh +47 -0
- package/sandbox/init.sh +61 -0
- package/src/api/client.ts +15 -1
- package/src/api/errors.ts +7 -3
- package/src/api/readers.ts +29 -0
- package/src/api/types.ts +52 -0
- package/src/api.ts +2 -0
- package/src/cli.ts +11 -0
- package/src/collaborators.ts +0 -14
- package/src/compile.ts +1 -1
- package/src/control.ts +159 -92
- package/src/execution.ts +45 -195
- package/src/index.ts +2 -0
- package/src/installation/admin.ts +1 -1
- package/src/installation/deploy-options.ts +10 -2
- package/src/installation/deploy.ts +241 -81
- package/src/installation/generated/platform-console-schema.ts +3 -0
- package/src/installation/generated/platform-proxy-manifest.ts +1 -1
- package/src/installation/guide.md +53 -19
- package/src/installation/hosts.ts +1 -7
- package/src/installation/index.ts +20 -16
- package/src/installation/init-options.ts +2 -1
- package/src/installation/install-environment.ts +47 -108
- package/src/installation/install-options.ts +3 -1
- package/src/installation/install-secrets.ts +24 -68
- package/src/installation/install.ts +9 -4
- package/src/installation/plain-credentials.ts +91 -0
- package/src/installation/sidecar.ts +5 -26
- package/src/installation/templates/README.md +13 -12
- package/src/installation/templates/platform.yml +3 -0
- package/src/installation/topology/setups.ts +17 -4
- package/src/installation/topology/topology.ts +33 -23
- package/src/installation/upgrade-options.ts +2 -2
- package/src/managed-env.ts +1 -174
- package/src/manifest.ts +14 -17
- package/src/namespace/claims.ts +60 -1
- package/src/namespace/codec.ts +17 -0
- package/src/namespace/errors.ts +22 -1
- package/src/namespace/manifest.ts +36 -23
- package/src/namespace/provisioning.ts +88 -114
- package/src/namespace/proxy-attempt.ts +14 -2
- package/src/namespace/proxy-reads.ts +28 -23
- package/src/namespace/proxy-secrets.ts +18 -5
- package/src/namespace/sandbox-host.ts +212 -0
- package/src/namespace/subdomain.ts +113 -0
- package/src/namespace/topology.ts +1 -1
- package/src/namespace/types.ts +13 -0
- package/src/namespace/update.ts +1 -0
- package/src/namespace-cli.ts +152 -0
- package/src/plain-credentials.ts +90 -0
- package/src/plan.ts +1 -6
- package/src/provider.ts +88 -166
- package/src/proxy-manifest-carrier.ts +39 -0
- package/src/sandbox/base-image.ts +100 -0
- package/src/sandbox/constants.ts +44 -0
- package/src/sandbox/deploy.ts +471 -0
- package/src/sandbox/dev-artifact.ts +206 -0
- package/src/sandbox/lifecycle.ts +204 -0
- package/src/sandbox/scripts.ts +26 -0
- package/src/sandbox-host.ts +28 -0
- package/src/source/port.ts +5 -0
- package/src/types.ts +6 -2
- package/src/zbox/client.ts +259 -0
- package/src/zbox/errors.ts +45 -0
- package/src/zbox/index.ts +22 -0
- package/src/zbox/types.ts +165 -0
- package/types/src/api/client.d.ts +5 -0
- package/types/src/api/errors.d.ts +26 -0
- package/types/src/api/polling.d.ts +41 -0
- package/types/src/api/readers.d.ts +1115 -0
- package/types/src/api/service-env-limit.d.ts +17 -0
- package/types/src/api/service-env-response.d.ts +23 -0
- package/types/src/api/types.d.ts +687 -0
- package/types/src/api.d.ts +6 -0
- package/types/src/authoring.d.ts +9 -0
- package/types/src/cli-args.d.ts +19 -0
- package/types/src/cli.d.ts +13 -0
- package/types/src/collaborators.d.ts +16 -0
- package/types/src/compile.d.ts +91 -0
- package/types/src/control.d.ts +51 -0
- package/types/src/database-budget.d.ts +38 -0
- package/types/src/descriptor.d.ts +28 -0
- package/types/src/execution.d.ts +114 -0
- package/types/src/exposure.d.ts +47 -0
- package/types/src/index.d.ts +31 -0
- package/types/src/installation/admin-options.d.ts +24 -0
- package/types/src/installation/admin.d.ts +35 -0
- package/types/src/installation/checker-release.d.ts +12 -0
- package/types/src/installation/deploy-options.d.ts +42 -0
- package/types/src/installation/deploy.d.ts +136 -0
- package/types/src/installation/generated/platform-console-schema.d.ts +2 -0
- package/types/src/installation/generated/platform-proxy-manifest.d.ts +2 -0
- package/types/src/installation/hosts.d.ts +34 -0
- package/types/src/installation/index.d.ts +7 -0
- package/types/src/installation/init-options.d.ts +38 -0
- package/types/src/installation/init.d.ts +60 -0
- package/types/src/installation/install-collaborators.d.ts +24 -0
- package/types/src/installation/install-environment.d.ts +63 -0
- package/types/src/installation/install-options.d.ts +49 -0
- package/types/src/installation/install-project.d.ts +13 -0
- package/types/src/installation/install-provisioning.d.ts +58 -0
- package/types/src/installation/install-secrets.d.ts +17 -0
- package/types/src/installation/install-token.d.ts +10 -0
- package/types/src/installation/install.d.ts +23 -0
- package/types/src/installation/installation-source.d.ts +8 -0
- package/types/src/installation/log.d.ts +44 -0
- package/types/src/installation/machine-key.d.ts +19 -0
- package/types/src/installation/placement-options.d.ts +11 -0
- package/types/src/installation/plain-credentials.d.ts +20 -0
- package/types/src/installation/platform-archive.d.ts +7 -0
- package/types/src/installation/platform-source.d.ts +8 -0
- package/types/src/installation/platform-upload.d.ts +3 -0
- package/types/src/installation/sidecar.d.ts +49 -0
- package/types/src/installation/source-options.d.ts +1 -0
- package/types/src/installation/topology/artifacts.d.ts +8 -0
- package/types/src/installation/topology/index.d.ts +5 -0
- package/types/src/installation/topology/installation-schemas.d.ts +2242 -0
- package/types/src/installation/topology/invariants.d.ts +23 -0
- package/types/src/installation/topology/setups.d.ts +59 -0
- package/types/src/installation/topology/topology.d.ts +153 -0
- package/types/src/installation/topology/validate.d.ts +11 -0
- package/types/src/installation/upgrade-options.d.ts +26 -0
- package/types/src/installation/upgrade-output.d.ts +6 -0
- package/types/src/installation/upgrade.d.ts +88 -0
- package/types/src/managed-env.d.ts +24 -0
- package/types/src/manifest.d.ts +199 -0
- package/types/src/namespace/claims.d.ts +16 -0
- package/types/src/namespace/codec.d.ts +352 -0
- package/types/src/namespace/constants.d.ts +25 -0
- package/types/src/namespace/errors.d.ts +25 -0
- package/types/src/namespace/manifest.d.ts +4 -0
- package/types/src/namespace/operator.d.ts +12 -0
- package/types/src/namespace/provisioning.d.ts +4 -0
- package/types/src/namespace/proxy-attempt.d.ts +39 -0
- package/types/src/namespace/proxy-reads.d.ts +27 -0
- package/types/src/namespace/proxy-secrets.d.ts +8 -0
- package/types/src/namespace/proxy-source.d.ts +74 -0
- package/types/src/namespace/sandbox-host.d.ts +23 -0
- package/types/src/namespace/subdomain.d.ts +43 -0
- package/types/src/namespace/topology.d.ts +9 -0
- package/types/src/namespace/types.d.ts +111 -0
- package/types/src/namespace/update.d.ts +6 -0
- package/types/src/namespace/validation.d.ts +12 -0
- package/types/src/namespace-cli.d.ts +2 -0
- package/types/src/namespace.d.ts +9 -0
- package/types/src/plain-credentials.d.ts +7 -0
- package/types/src/plan.d.ts +11 -0
- package/types/src/provider.d.ts +60 -0
- package/types/src/proxy-manifest-carrier.d.ts +37 -0
- package/types/src/sandbox/base-image.d.ts +28 -0
- package/types/src/sandbox/constants.d.ts +30 -0
- package/types/src/sandbox/deploy.d.ts +75 -0
- package/types/src/sandbox/dev-artifact.d.ts +51 -0
- package/types/src/sandbox/lifecycle.d.ts +27 -0
- package/types/src/sandbox/scripts.d.ts +11 -0
- package/types/src/sandbox-host.d.ts +16 -0
- package/types/src/schema.generated.d.ts +376 -0
- package/types/src/service-names.d.ts +4 -0
- package/types/src/service-references.d.ts +13 -0
- package/types/src/source/constants.d.ts +6 -0
- package/types/src/source/port.d.ts +65 -0
- package/types/src/source/types.d.ts +4 -0
- package/types/src/source/validation.d.ts +19 -0
- package/types/src/source.d.ts +2 -0
- package/types/src/types.d.ts +125 -0
- package/types/src/version-attempt.d.ts +8 -0
- package/types/src/zbox/client.d.ts +2 -0
- package/types/src/zbox/errors.d.ts +25 -0
- package/types/src/zbox/index.d.ts +3 -0
- package/types/src/zbox/types.d.ts +433 -0
- package/src/installation/mcp.ts +0 -102
- package/src/installation/proxy-manifest.ts +0 -214
- package/src/installation/secrets.ts +0 -78
|
@@ -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,65 @@
|
|
|
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
|
+
/**
|
|
40
|
+
* Present for a dev sandbox: `uploadUrl` is the sandbox host's file endpoint for one sandbox, and the PUT carries this
|
|
41
|
+
* bearer. A credential in transit, like `uploadUrl`.
|
|
42
|
+
*/
|
|
43
|
+
readonly uploadBearer?: string;
|
|
44
|
+
readonly signal: AbortSignal;
|
|
45
|
+
}
|
|
46
|
+
export interface ZeropsSourceUploadResult {
|
|
47
|
+
readonly commitSha: string;
|
|
48
|
+
readonly descriptorSha256: string;
|
|
49
|
+
/** The sha256 of the data file the archive carried; absent without one. */
|
|
50
|
+
readonly dataFileSha256?: string;
|
|
51
|
+
readonly entryCount: number;
|
|
52
|
+
readonly expandedBytes: number;
|
|
53
|
+
}
|
|
54
|
+
/** The GitHub source the Zerops composition injects; Control implements it in process. Callers verify what it returns. */
|
|
55
|
+
export interface ZeropsSourcePort {
|
|
56
|
+
resolve(input: ZeropsSourceResolveInput): Promise<ZeropsSourceResolution>;
|
|
57
|
+
upload(input: ZeropsSourceUploadInput): Promise<ZeropsSourceUploadResult>;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The source refused a read for GitHub's rate limit. The read succeeds again once the limit resets, so a namespace
|
|
61
|
+
* mutation that hits it stays retryable. The message is the user's: whose limit, when it resets, how to avoid it.
|
|
62
|
+
*/
|
|
63
|
+
export declare class ZeropsSourceRateLimitedError extends Error {
|
|
64
|
+
constructor(message: string);
|
|
65
|
+
}
|
|
@@ -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,125 @@
|
|
|
1
|
+
import type { ContractArtifact } from '@fabrika/auth-core';
|
|
2
|
+
import type { AppConfigBase } from '@fabrika/provider-contract';
|
|
3
|
+
import type { ContractProxyApp } from '@fabrika/proxy-core/manifest';
|
|
4
|
+
import type { ZeropsRuntimePackage } from './execution';
|
|
5
|
+
import type { ZeropsHealthCheck, ZeropsImportProject, ZeropsImportService, ZeropsReadinessCheck, ZeropsYamlDeploy, ZeropsYamlRun, ZeropsYamlSetup } from './schema.generated';
|
|
6
|
+
import type { ZeropsSourceRepository } from './source';
|
|
7
|
+
import type { ZeropsSourcePrivateBinding } from './source/port';
|
|
8
|
+
export interface ZeropsResourceContext {
|
|
9
|
+
env: string;
|
|
10
|
+
domain?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A probe interval or timeout, as the PLATFORM takes it — a Go duration with a unit, e.g. `30s`.
|
|
14
|
+
*
|
|
15
|
+
* The published JSON schema types all six of these as `integer`, and the platform refuses an integer:
|
|
16
|
+
* `POST /service-stack/zerops-yaml-validation` answers `yamlValidationInvalidYaml` with
|
|
17
|
+
* `cannot unmarshal !!int into time.Duration`. The account wins, so this type does. Every value is also
|
|
18
|
+
* bounded to **[10s, 1h]** — `5s` is refused with `invalid execPeriod <10s, 1h0m0s>` — which no
|
|
19
|
+
* published document states; see `docs/reference/zerops-platform.md`.
|
|
20
|
+
*/
|
|
21
|
+
export type ZeropsDuration = `${number}${'s' | 'm' | 'h'}`;
|
|
22
|
+
/** `run.healthCheck`, with the four duration fields corrected to what the platform accepts. */
|
|
23
|
+
export interface ZeropsHealthCheckSpec extends Omit<ZeropsHealthCheck, ZeropsHealthCheckDurationField> {
|
|
24
|
+
failureTimeout?: ZeropsDuration;
|
|
25
|
+
disconnectTimeout?: ZeropsDuration;
|
|
26
|
+
recoveryTimeout?: ZeropsDuration;
|
|
27
|
+
execPeriod?: ZeropsDuration;
|
|
28
|
+
}
|
|
29
|
+
type ZeropsHealthCheckDurationField = 'failureTimeout' | 'disconnectTimeout' | 'recoveryTimeout' | 'execPeriod';
|
|
30
|
+
/** `deploy.readinessCheck`, with its two duration fields corrected. */
|
|
31
|
+
export interface ZeropsReadinessCheckSpec extends Omit<ZeropsReadinessCheck, 'failureTimeout' | 'retryPeriod'> {
|
|
32
|
+
failureTimeout?: ZeropsDuration;
|
|
33
|
+
retryPeriod?: ZeropsDuration;
|
|
34
|
+
}
|
|
35
|
+
export interface ZeropsYamlRunSpec extends Omit<ZeropsYamlRun, 'healthCheck'> {
|
|
36
|
+
healthCheck?: ZeropsHealthCheckSpec;
|
|
37
|
+
}
|
|
38
|
+
export interface ZeropsYamlDeploySpec extends Omit<ZeropsYamlDeploy, 'readinessCheck'> {
|
|
39
|
+
readinessCheck?: ZeropsReadinessCheckSpec;
|
|
40
|
+
}
|
|
41
|
+
export interface ZeropsYamlSetupSpec extends Omit<ZeropsYamlSetup, 'run' | 'deploy'> {
|
|
42
|
+
run?: ZeropsYamlRunSpec;
|
|
43
|
+
deploy?: ZeropsYamlDeploySpec;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A `zerops.yaml` as fabrika AUTHORS it.
|
|
47
|
+
*
|
|
48
|
+
* Same relationship to `ZeropsYaml` that `ZeropsServiceSpec` has to `ZeropsImportService`: the generated
|
|
49
|
+
* transcription is the platform's published contract, and this is the authoring surface, which diverges
|
|
50
|
+
* from it only where a live account has proved the publication wrong.
|
|
51
|
+
*/
|
|
52
|
+
export interface ZeropsYamlSpec {
|
|
53
|
+
zerops: ZeropsYamlSetupSpec[];
|
|
54
|
+
}
|
|
55
|
+
export type ZeropsCompilerOwnedServiceField = 'envIsolation' | 'override' | 'envSecrets' | 'dotEnvSecrets' | 'mode' | 'os';
|
|
56
|
+
export type ZeropsCompilerOwnedProjectField = 'envVariables' | 'envIsolation';
|
|
57
|
+
export type ZeropsServiceSpec = Omit<ZeropsImportService, ZeropsCompilerOwnedServiceField>;
|
|
58
|
+
export type ZeropsProjectSpec = Omit<ZeropsImportProject, ZeropsCompilerOwnedProjectField>;
|
|
59
|
+
/** What the namespace proxy applies to the app: the manifest form of its compiled contract, from `contractProxyTable`. */
|
|
60
|
+
export interface ZeropsProxySpec extends Pick<ContractProxyApp, 'endpoints' | 'reservedPrefixes' | 'snapshot'> {
|
|
61
|
+
upstream: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A typed reference to the namespace-owned PostgreSQL service; it never contains its credential.
|
|
65
|
+
*
|
|
66
|
+
* The reference names its PORT, its DATABASE and its TLS MODE rather than inheriting any from the driver — see
|
|
67
|
+
* `ZEROPS_SHARED_POSTGRES_CONNECTION_STRING` in `./namespace.ts` for what the account proved about each. It is the
|
|
68
|
+
* service user's; a contract application's `FABRIKA_APP_DATABASE_URL` is generated from `hostname` instead.
|
|
69
|
+
*/
|
|
70
|
+
export interface ZeropsSharedPostgresBinding {
|
|
71
|
+
readonly resourceKey: 'service:postgres';
|
|
72
|
+
readonly hostname: 'postgres';
|
|
73
|
+
readonly connectionString: '${postgres_connectionString}/${postgres_dbName}?sslmode=disable';
|
|
74
|
+
}
|
|
75
|
+
export type ZeropsNamespaceResourceRequirement = ZeropsSharedPostgresBinding;
|
|
76
|
+
export interface ZeropsSourceTarget {
|
|
77
|
+
platform: 'zerops';
|
|
78
|
+
deployService?: string;
|
|
79
|
+
zeropsSetup?: string;
|
|
80
|
+
proxy?: ZeropsProxySpec;
|
|
81
|
+
namespaceResources?: ZeropsNamespaceResourceRequirement[];
|
|
82
|
+
/**
|
|
83
|
+
* The compiled contract of a contract application. Its presence locks the setup down (ADR-0043): the platform
|
|
84
|
+
* generates the run section and the server build, and the authored `zerops.yaml` keeps only the SPA build.
|
|
85
|
+
*/
|
|
86
|
+
contract?: ContractArtifact;
|
|
87
|
+
/** System packages for the runtime image of a contract application, from a closed list. */
|
|
88
|
+
runtimePackages?: ZeropsRuntimePackage[];
|
|
89
|
+
services: (ctx: ZeropsResourceContext) => ZeropsServiceSpec[];
|
|
90
|
+
project?: ZeropsProjectSpec;
|
|
91
|
+
/**
|
|
92
|
+
* Variable and header names whose plain value is not a credential. `fabrika app build` refuses an `envVariables` or
|
|
93
|
+
* `routing.headers` value that looks like one (its name says `TOKEN`, `PASSWORD`, `SECRET`, a key, or its value reads
|
|
94
|
+
* like a token); a name listed here is stored as written. A real credential goes in `pipeline.secrets`.
|
|
95
|
+
*/
|
|
96
|
+
notSecret?: readonly string[];
|
|
97
|
+
}
|
|
98
|
+
export interface ZeropsAppConfig extends AppConfigBase {
|
|
99
|
+
target: ZeropsSourceTarget;
|
|
100
|
+
}
|
|
101
|
+
/** Exact, credential-free source coordinates composed for one non-dry runtime invocation. */
|
|
102
|
+
export interface ZeropsRuntimeSource {
|
|
103
|
+
runId: string;
|
|
104
|
+
repository: ZeropsSourceRepository;
|
|
105
|
+
commitSha: string;
|
|
106
|
+
/** Absent for a public repository. */
|
|
107
|
+
privateBinding?: ZeropsSourcePrivateBinding;
|
|
108
|
+
}
|
|
109
|
+
/** The run checkpoint (ADR-0044): the reserved version, and whether its build request may have been sent. */
|
|
110
|
+
export interface ZeropsRunState {
|
|
111
|
+
appVersionId: string;
|
|
112
|
+
triggered: boolean;
|
|
113
|
+
}
|
|
114
|
+
/** Ephemeral runtime coordinates. This value is encoded only after credentials are composed. */
|
|
115
|
+
export interface ZeropsRuntimeTarget {
|
|
116
|
+
projectId: string;
|
|
117
|
+
serviceId: string;
|
|
118
|
+
/** The buckets the environment's registration created, from its stored target (creation evidence, ADR-0043). */
|
|
119
|
+
createdBuckets?: readonly string[];
|
|
120
|
+
accessToken: string;
|
|
121
|
+
/** Absent only for dry runs, which perform no source or Zerops mutation. */
|
|
122
|
+
source?: ZeropsRuntimeSource;
|
|
123
|
+
apiBaseUrl?: string;
|
|
124
|
+
}
|
|
125
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ZeropsApi } from './api/types';
|
|
2
|
+
export declare const isVersionNotFound: (error: unknown) => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Delete a reserved version whose build was never requested. Deletion is the barrier: a later upload to
|
|
5
|
+
* it leaves nothing buildable and a build request fails `appVersionNotFound` (ADR-0044). An already
|
|
6
|
+
* absent version counts as deleted. Never call this once a build may have been submitted.
|
|
7
|
+
*/
|
|
8
|
+
export declare function deleteVersion(api: Pick<ZeropsApi, 'deleteAppVersion'>, appVersionId: string, signal: AbortSignal): Promise<void>;
|