@void/platform 0.20.0
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/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/index.d.mts +264 -0
- package/dist/index.mjs +895 -0
- package/dist/installer.d.mts +49 -0
- package/dist/installer.mjs +176 -0
- package/dist/runtime/api/README.md +1 -0
- package/dist/runtime/api/index.js +70824 -0
- package/dist/runtime/api/index.js.map +8 -0
- package/dist/runtime/dispatch/README.md +1 -0
- package/dist/runtime/dispatch/index.js +3289 -0
- package/dist/runtime/dispatch/index.js.map +8 -0
- package/dist/runtime/drizzle/0000_confused_starjammers.sql +66 -0
- package/dist/runtime/drizzle/0001_famous_magus.sql +15 -0
- package/dist/runtime/drizzle/0002_glorious_morgan_stark.sql +17 -0
- package/dist/runtime/drizzle/0003_awesome_ares.sql +3 -0
- package/dist/runtime/drizzle/0004_talented_mimic.sql +1 -0
- package/dist/runtime/drizzle/0005_legal_red_ghost.sql +15 -0
- package/dist/runtime/drizzle/0006_wonderful_madame_masque.sql +17 -0
- package/dist/runtime/drizzle/0007_normal_skin.sql +4 -0
- package/dist/runtime/drizzle/0008_auth_codes.sql +5 -0
- package/dist/runtime/drizzle/0009_chubby_masked_marvel.sql +1 -0
- package/dist/runtime/drizzle/0010_wild_aqueduct.sql +10 -0
- package/dist/runtime/drizzle/0011_curly_stryfe.sql +2 -0
- package/dist/runtime/drizzle/0012_eminent_mystique.sql +1 -0
- package/dist/runtime/drizzle/0013_quick_selene.sql +3 -0
- package/dist/runtime/drizzle/0014_mysterious_medusa.sql +1 -0
- package/dist/runtime/drizzle/0015_backfill_accepted_invitations.sql +14 -0
- package/dist/runtime/drizzle/0016_verified_phoenix.sql +1 -0
- package/dist/runtime/drizzle/0017_gorgeous_johnny_blaze.sql +3 -0
- package/dist/runtime/drizzle/0018_project_migrations.sql +21 -0
- package/dist/runtime/drizzle/0019_project_database_credentials.sql +10 -0
- package/dist/runtime/drizzle/0027_github_deploy.sql +82 -0
- package/dist/runtime/drizzle/0028_check_runs.sql +1 -0
- package/dist/runtime/drizzle/0029_fluffy_justin_hammer.sql +1 -0
- package/dist/runtime/drizzle/0030_smooth_marvel_boy.sql +13 -0
- package/dist/runtime/drizzle/0031_thankful_madame_masque.sql +9 -0
- package/dist/runtime/drizzle/0032_remarkable_skullbuster.sql +10 -0
- package/dist/runtime/drizzle/0033_operator_sessions_and_events.sql +21 -0
- package/dist/runtime/drizzle/0034_email_destinations.sql +21 -0
- package/dist/runtime/drizzle/0035_invitation_actor_history.sql +5 -0
- package/dist/runtime/drizzle/0036_flowery_master_chief.sql +2 -0
- package/dist/runtime/drizzle/0037_unusual_bloodaxe.sql +14 -0
- package/dist/runtime/drizzle/0038_deployment_admission_protocol.sql +25 -0
- package/dist/runtime/drizzle/compatibility.json +26 -0
- package/dist/runtime/drizzle/meta/_journal.json +230 -0
- package/dist/runtime/manifest.json +254 -0
- package/dist/runtime/proxy/README.md +1 -0
- package/dist/runtime/proxy/index.js +5416 -0
- package/dist/runtime/proxy/index.js.map +8 -0
- package/dist/runtime/tail/README.md +1 -0
- package/dist/runtime/tail/index.js +61 -0
- package/dist/runtime/tail/index.js.map +8 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026-present, Cloudflare, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @void/platform
|
|
2
|
+
|
|
3
|
+
Public, target-neutral contracts and packaged runtime artifacts for installing a Void company platform in a Cloudflare account.
|
|
4
|
+
|
|
5
|
+
For a first installation, follow [Install a Void Platform](../../docs/guide/self-hosted-platform.md). It explains how to prepare the Cloudflare account, domain, PostgreSQL database, and credentials before deploying. Void creates the platform resources and database tables.
|
|
6
|
+
|
|
7
|
+
The CLI provides direct credential setup links in plans and opens missing-credential pages during an approved interactive install. The runtime-token link preselects all required account permissions, including Workers Tail, Hyperdrive, and AI Gateway when needed, with a readable fallback summary. Local credential drafts preserve the final Worker names and OAuth callback before provisioning, with partial secrets encrypted by the existing recovery store. A completed credential-setup marker separates these drafts from database-claimed installation recovery.
|
|
8
|
+
|
|
9
|
+
Interactive installation lists unfinished installs, including interrupted provisioning, and offers to continue one or start a new platform install. Entering an existing unfinished name asks to resume it; declining returns to name entry. New installs leave previous setup, credentials, and resources untouched. Completed platforms are excluded. Explicit `--resume` skips the choice; non-interactive recovery requires it. Read-only plans do not save drafts.
|
|
10
|
+
|
|
11
|
+
New platforms use readable resource names such as `void-team-api` and `void-team-routing`, without random suffixes. Choose an installation name that is unused in the selected account. Conflicting resources are never silently adopted, overwritten, or bypassed by choosing random names. Existing installations keep their recorded resource names, including older suffixed names; application/user resource naming is independent.
|
|
12
|
+
|
|
13
|
+
The packaged API also serves the `void platform` commands for managing users,
|
|
14
|
+
projects, access, and logs. The installer applies the database migration needed
|
|
15
|
+
for administrator sessions and audit records. See
|
|
16
|
+
[Platform Administration](../../docs/guide/platform-administration.md) to operate
|
|
17
|
+
an installed platform from your terminal.
|
|
18
|
+
|
|
19
|
+
The package contains:
|
|
20
|
+
|
|
21
|
+
- versioned deployment and installation manifests
|
|
22
|
+
- deterministic resource naming and application-route generation
|
|
23
|
+
- discovery-document and capability contracts
|
|
24
|
+
- Cloudflare Worker configuration generation for the core API, proxy, tail, and dispatch Workers
|
|
25
|
+
- A shared installation-owned traffic-disable protocol used by lifecycle-safe retained Workers
|
|
26
|
+
- integrity-checked, deployable Worker bundles plus a schema-versioned PostgreSQL migration and rollback-compatibility manifest under the `./installer` export
|
|
27
|
+
|
|
28
|
+
The `void` CLI consumes this package for `void platform install`, `repair`, `upgrade`, `discover`, and `uninstall`. Platform implementation sources remain under `platform/packages/*`; their deployable core output is bundled here so a user installs one normal public `void` package rather than cloning or deploying the repository.
|
|
29
|
+
|
|
30
|
+
Interactive lifecycle operations authenticate the human operator through Cloudflare browser sign-in with OS-keychain storage. Wrangler browser OAuth has Zone Read, so plans that create a zone or DNS record require an explicit management API token with the corresponding Zone Edit and DNS Edit permissions. A new account must finish Workers onboarding and choose its workers.dev subdomain before planning. The installed control plane receives a separate scoped runtime token. Its core permissions include Hyperdrive: Write at account scope and Cache Purge: Purge on the application zone; SSL and Certificates: Edit is needed only by a custom runtime that enables custom project domains. The installer preflights account and Hyperdrive access and, for an existing zone, verifies cache-purge access with a unique nonexistent URL. Local recovery checkpoints are AES-256-GCM encrypted with a key held in the OS keychain; normal upgrades preserve existing Cloudflare Worker secrets rather than downloading or rewriting them.
|
|
31
|
+
|
|
32
|
+
Fresh installations require a unique JWT signing secret with at least 32 bytes of random material and a unique, canonical base64-encoded 32-byte project-encryption key from the operator's durable secret manager. The installer never makes an ephemeral workstation or CI registry the only custodian of these installation identity keys. Existing Workers preserve their deployed values during routine lifecycle operations.
|
|
33
|
+
|
|
34
|
+
Browser OAuth cannot manage AI Gateway. Installation previews mark an inaccessible gateway as requiring inspection; apply rechecks it with the already-required runtime token (AI Gateway: Edit) before provisioning. All other provider operations keep the operator credential. Later OAuth lifecycle operations can reuse that token from encrypted local recovery storage. On another workstation, use a management API token with AI Gateway access or supply the runtime token explicitly for that check.
|
|
35
|
+
|
|
36
|
+
Runtime and installation manifests record the last usage protocol proven live across the complete Worker set. A protocol transition gates traffic before the first Worker update and opens it only after target health and immutable versions pass; interrupted transitions remain gated and resumable.
|
|
37
|
+
|
|
38
|
+
Application-addressing contracts preserve schema v1 for existing domain installations. Schema v2 records an optional workers.dev installation identity, retained when a domain is added. Project ingress names include the stable project ID so a deleted project's hostname cannot be inherited by a later project with the same slug.
|
|
39
|
+
|
|
40
|
+
`void platform install --workers-dev` is the explicit test path; the interactive default recommends a domain. `void platform domain set <domain>` records pending setup separately and publishes the active routing configuration only after DNS, runtime-token permissions, and HTTPS pass. It preserves the API origin and existing test URLs. The test hostnames bypass the additional edge response cache while retaining shared ISR storage; custom-domain traffic keeps the normal cache path.
|
|
41
|
+
|
|
42
|
+
Maintainers and platform forks can build the same runtime from source with `vp run --filter @void/platform build` and deploy it using `void platform upgrade --runtime packages/platform/dist/runtime`. The custom path does not bypass release safety: its manifest, Worker bundles, migration journal, and SQL files receive the same integrity and compatibility verification as packaged artifacts. Builds from a Git checkout automatically record `HEAD` in the runtime provenance, with a `-dirty` suffix when the checkout has uncommitted files. Build systems can set `VOID_PLATFORM_SOURCE_REVISION` to override automatic detection with another commit or build identifier; source archives without Git metadata leave it unrecorded.
|
|
43
|
+
|
|
44
|
+
Runtime artifacts include migration SQL, the journal, and compatibility metadata. Drizzle authoring snapshots stay in the source tree and are excluded from the published runtime.
|
|
45
|
+
|
|
46
|
+
Platform migrations are forward-only. `platform/packages/api/drizzle/compatibility.json` declares exact source-version/schema-digest edges whose old Workers are safe against the target schema. The runtime build validates that each source digest is a prefix of the same PostgreSQL lineage and hashes the journal and every SQL file. When adding a migration, use an expand-compatible change, add only edges verified against the old runtime, and keep destructive contract cleanup for a later release after rollback to the old Workers is no longer possible.
|
|
47
|
+
|
|
48
|
+
Post-success rollback uses the installed runtime's integrity-checked compatibility manifest and an explicitly supplied earlier runtime. The installation checkpoint records running-runtime provenance separately from the actual forward-only database schema. Rollback never reverses migrations, and it rejects a target whose declared safety protocols are older than the installation or authoritative database state.
|
|
49
|
+
|
|
50
|
+
See the [self-hosted platform guide](../../docs/guide/self-hosted-platform.md) for the supported core feature set, Cloudflare footprint, and lifecycle commands.
|
|
51
|
+
|
|
52
|
+
Use the application zone's apex for the simplest certificate setup. Nested app
|
|
53
|
+
domains require an active edge wildcard certificate; planning checks coverage
|
|
54
|
+
before provisioning and explains the required certificate product and read
|
|
55
|
+
permission when coverage is missing.
|
|
56
|
+
|
|
57
|
+
For local changes, fork CI, and a complete source-runtime example, see
|
|
58
|
+
[Platform Development](../../docs/guide/platform-development.md).
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
//#region src/application.d.ts
|
|
2
|
+
/** Public application addressing, independent of the platform API's origin. */
|
|
3
|
+
type PlatformApplication = Readonly<{
|
|
4
|
+
baseDomain: string;
|
|
5
|
+
dedicatedZone: boolean;
|
|
6
|
+
/** Empty only for an explicitly selected workers.dev installation. */
|
|
7
|
+
zoneName: string;
|
|
8
|
+
zoneId?: string;
|
|
9
|
+
/** Retained after adding a domain so existing test URLs keep working. */
|
|
10
|
+
workersDev?: Readonly<{
|
|
11
|
+
subdomain: string;
|
|
12
|
+
installationId: string;
|
|
13
|
+
}>;
|
|
14
|
+
}>;
|
|
15
|
+
type PlatformApplicationProject = Readonly<{
|
|
16
|
+
id: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
}>;
|
|
19
|
+
/** Minimal public-origin adapter; request policy remains in the service-bound dispatcher. */
|
|
20
|
+
export declare const PLATFORM_PROJECT_INGRESS_SOURCE: string;
|
|
21
|
+
export declare function readPlatformApplication(env: Readonly<{
|
|
22
|
+
PLATFORM_APPLICATION?: string;
|
|
23
|
+
SITE_DOMAIN?: string;
|
|
24
|
+
BASE_HOSTNAME?: string;
|
|
25
|
+
}>): PlatformApplication;
|
|
26
|
+
export declare function platformWorkersDevAliasKey(hostname: string): string;
|
|
27
|
+
export declare const PLATFORM_APPLICATION_KEY = "__void/platform/application/v1";
|
|
28
|
+
export declare function resolvePlatformApplicationEnvironment<T extends {
|
|
29
|
+
PLATFORM_APPLICATION?: string;
|
|
30
|
+
ROUTING: {
|
|
31
|
+
get(key: string): Promise<string | null>;
|
|
32
|
+
};
|
|
33
|
+
}>(env: T): Promise<T>;
|
|
34
|
+
export declare function platformProjectIngressName(project: PlatformApplicationProject, workersDev: NonNullable<PlatformApplication["workersDev"]>): string;
|
|
35
|
+
export declare function platformProjectWorkersDevHostname(project: PlatformApplicationProject, workersDev: NonNullable<PlatformApplication["workersDev"]>): string;
|
|
36
|
+
export declare function platformProjectHostname(project: PlatformApplicationProject, application: PlatformApplication): string;
|
|
37
|
+
export declare function platformProjectHostnames(project: PlatformApplicationProject, application: PlatformApplication): ReadonlyArray<string>;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/manifest.d.ts
|
|
40
|
+
export declare const PLATFORM_DEPLOYMENT_SCHEMA_VERSION: 1;
|
|
41
|
+
type PlatformCapabilities = Readonly<{
|
|
42
|
+
ai: boolean;
|
|
43
|
+
customDomains: boolean;
|
|
44
|
+
email: boolean;
|
|
45
|
+
githubActions: boolean;
|
|
46
|
+
githubOAuth: boolean;
|
|
47
|
+
googleOAuth: boolean;
|
|
48
|
+
managedBuilds: boolean;
|
|
49
|
+
sandbox: boolean;
|
|
50
|
+
}>;
|
|
51
|
+
type PlatformControlPlane = Readonly<{
|
|
52
|
+
apiHostname: string | null;
|
|
53
|
+
dashboardHostname: string | null;
|
|
54
|
+
proxyHostname: string | null;
|
|
55
|
+
}>;
|
|
56
|
+
type PlatformResourceNames = Readonly<{
|
|
57
|
+
aiGateway: string;
|
|
58
|
+
apiWorker: string;
|
|
59
|
+
assetsBucket: string;
|
|
60
|
+
cronQueue: string;
|
|
61
|
+
dashboardWorker: string;
|
|
62
|
+
dispatchNamespace: string;
|
|
63
|
+
dispatchWorker: string;
|
|
64
|
+
hyperdrive: string;
|
|
65
|
+
isrCacheKv: string;
|
|
66
|
+
legacyAssetsKv: string;
|
|
67
|
+
logsDataset: string;
|
|
68
|
+
proxyWorker: string;
|
|
69
|
+
requestsDataset: string;
|
|
70
|
+
routingKv: string;
|
|
71
|
+
tailWorker: string;
|
|
72
|
+
usageQueue: string;
|
|
73
|
+
}>;
|
|
74
|
+
type PlatformDeploymentManifest = Readonly<{
|
|
75
|
+
application: PlatformApplication;
|
|
76
|
+
authentication: Readonly<{
|
|
77
|
+
providers: ReadonlyArray<"github" | "google">;
|
|
78
|
+
}>;
|
|
79
|
+
capabilities: PlatformCapabilities;
|
|
80
|
+
controlPlane: PlatformControlPlane;
|
|
81
|
+
displayName: string;
|
|
82
|
+
installationSlug: string;
|
|
83
|
+
resources: PlatformResourceNames;
|
|
84
|
+
schemaVersion: typeof PLATFORM_DEPLOYMENT_SCHEMA_VERSION | 2;
|
|
85
|
+
}>;
|
|
86
|
+
type PlatformDeploymentManifestInput = Readonly<{
|
|
87
|
+
application: Readonly<{
|
|
88
|
+
baseDomain: string;
|
|
89
|
+
dedicatedZone?: boolean;
|
|
90
|
+
zoneName: string;
|
|
91
|
+
workersDev?: PlatformApplication["workersDev"];
|
|
92
|
+
zoneId?: string;
|
|
93
|
+
}>;
|
|
94
|
+
authentication?: Readonly<{
|
|
95
|
+
providers?: ReadonlyArray<"github" | "google">;
|
|
96
|
+
}>;
|
|
97
|
+
capabilities?: Partial<PlatformCapabilities>;
|
|
98
|
+
controlPlane?: Partial<PlatformControlPlane>;
|
|
99
|
+
displayName: string;
|
|
100
|
+
installationSlug: string;
|
|
101
|
+
resources?: Partial<PlatformResourceNames>;
|
|
102
|
+
}>;
|
|
103
|
+
type PlatformApplicationRoute = Readonly<{
|
|
104
|
+
pattern: string;
|
|
105
|
+
zoneName: string;
|
|
106
|
+
}>;
|
|
107
|
+
export declare function normalizeInstallationSlug(value: string): string;
|
|
108
|
+
export declare function normalizeApplicationDomain(value: string): string;
|
|
109
|
+
export declare function createPlatformResourceNames(installationSlug: string): PlatformResourceNames;
|
|
110
|
+
export declare function createApplicationRoutes(application: PlatformDeploymentManifest["application"]): ReadonlyArray<PlatformApplicationRoute>;
|
|
111
|
+
export declare function createPlatformDeploymentManifest(input: PlatformDeploymentManifestInput): PlatformDeploymentManifest;
|
|
112
|
+
export declare function parsePlatformDeploymentManifest(value: unknown): PlatformDeploymentManifest;
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/installation.d.ts
|
|
115
|
+
export declare const PLATFORM_INSTALLATION_SCHEMA_VERSION: 1;
|
|
116
|
+
export declare const PLATFORM_DISABLED_KEY = "__void/platform/disabled/v1";
|
|
117
|
+
export declare const PLATFORM_DISABLED_VALUE = "disabled";
|
|
118
|
+
export declare const PLATFORM_REMOTE_INSTALLATION_MANIFEST_KEY = "__void/platform/installation/v1";
|
|
119
|
+
export declare const PLATFORM_SANDBOX_DRAIN_KEY = "__void/platform/sandbox-drain/v1";
|
|
120
|
+
export declare const PLATFORM_R2_OWNERSHIP_MARKER_KEY = "__void/platform/ownership/v1";
|
|
121
|
+
export declare const PLATFORM_RESOURCE_OWNERSHIP_SCHEMA_VERSION: 1;
|
|
122
|
+
export declare const PLATFORM_USAGE_PROTOCOL_VERSION: 1;
|
|
123
|
+
type InstallationStatus = "draft" | "planned" | "provisioning" | "waiting-for-dns" | "waiting-for-oauth" | "deploying" | "verifying" | "installed" | "disabling" | "disabled" | "uninstalling" | "uninstalled" | "failed";
|
|
124
|
+
type ResourceOwnership = "created" | "adopted" | "external";
|
|
125
|
+
type InstallationResourceKind = "ai-gateway" | "analytics-dataset" | "dispatch-namespace" | "dns-record" | "hyperdrive" | "kv-namespace" | "queue" | "r2-bucket" | "worker" | "worker-custom-domain" | "worker-route" | "zone";
|
|
126
|
+
type InstallationResource = Readonly<{
|
|
127
|
+
configHash: string;
|
|
128
|
+
id: string;
|
|
129
|
+
key: string;
|
|
130
|
+
kind: InstallationResourceKind;
|
|
131
|
+
name: string;
|
|
132
|
+
ownership: ResourceOwnership;
|
|
133
|
+
state: "ready" | "retained" | "deleted";
|
|
134
|
+
}>;
|
|
135
|
+
type InstallationStep = Readonly<{
|
|
136
|
+
completedAt: string;
|
|
137
|
+
key: string;
|
|
138
|
+
resultHash: string;
|
|
139
|
+
}>;
|
|
140
|
+
type PlatformInstallationEndpoints = Readonly<{
|
|
141
|
+
apiUrl: string | null;
|
|
142
|
+
dashboardUrl: string | null;
|
|
143
|
+
proxyUrl: string | null;
|
|
144
|
+
}>;
|
|
145
|
+
type PlatformRuntimeProvenance = Readonly<{
|
|
146
|
+
manifestSha256: string;
|
|
147
|
+
source: "custom" | "package";
|
|
148
|
+
sourceRevision: string | null;
|
|
149
|
+
}>;
|
|
150
|
+
type PlatformInstallationManifest = Readonly<{
|
|
151
|
+
account: Readonly<{
|
|
152
|
+
id: string;
|
|
153
|
+
name: string;
|
|
154
|
+
}>;
|
|
155
|
+
createdAt: string;
|
|
156
|
+
/** Actual forward-only PostgreSQL schema, independent of the running runtime. */
|
|
157
|
+
databaseSchemaDigest: string | null;
|
|
158
|
+
deployment: PlatformDeploymentManifest;
|
|
159
|
+
/** Desired domain while DNS/TLS activation is pending; current addressing remains live. */
|
|
160
|
+
pendingDomain?: PlatformDeploymentManifest["application"];
|
|
161
|
+
desiredState: "enabled" | "disabled";
|
|
162
|
+
endpoints: PlatformInstallationEndpoints;
|
|
163
|
+
id: string;
|
|
164
|
+
ownershipNonce: string;
|
|
165
|
+
platformVersion: string;
|
|
166
|
+
resources: ReadonlyArray<InstallationResource>;
|
|
167
|
+
runtime: PlatformRuntimeProvenance | null;
|
|
168
|
+
safetyProtocols: Readonly<{
|
|
169
|
+
sandboxDrain: 0 | 1 | 2;
|
|
170
|
+
}>;
|
|
171
|
+
schemaVersion: typeof PLATFORM_INSTALLATION_SCHEMA_VERSION;
|
|
172
|
+
status: InstallationStatus;
|
|
173
|
+
steps: ReadonlyArray<InstallationStep>;
|
|
174
|
+
updatedAt: string;
|
|
175
|
+
/** Last usage protocol proven live across the installed Worker set. */
|
|
176
|
+
usageProtocolVersion: 0 | 1;
|
|
177
|
+
}>;
|
|
178
|
+
type PlatformResourceOwnershipMarker = Readonly<{
|
|
179
|
+
accountId: string;
|
|
180
|
+
installationId: string;
|
|
181
|
+
ownershipNonce: string;
|
|
182
|
+
resourceId: string;
|
|
183
|
+
resourceKey: string;
|
|
184
|
+
resourceKind: InstallationResourceKind;
|
|
185
|
+
resourceName: string;
|
|
186
|
+
schemaVersion: typeof PLATFORM_RESOURCE_OWNERSHIP_SCHEMA_VERSION;
|
|
187
|
+
}>;
|
|
188
|
+
export declare function createPlatformResourceOwnershipMarker(input: {
|
|
189
|
+
accountId: string;
|
|
190
|
+
installationId: string;
|
|
191
|
+
ownershipNonce: string;
|
|
192
|
+
resourceId: string;
|
|
193
|
+
resourceKey: string;
|
|
194
|
+
resourceKind: InstallationResourceKind;
|
|
195
|
+
resourceName: string;
|
|
196
|
+
}): PlatformResourceOwnershipMarker;
|
|
197
|
+
export declare function parsePlatformResourceOwnershipMarker(value: unknown): PlatformResourceOwnershipMarker;
|
|
198
|
+
export declare function createPlatformInstallationManifest(input: {
|
|
199
|
+
account: {
|
|
200
|
+
id: string;
|
|
201
|
+
name: string;
|
|
202
|
+
};
|
|
203
|
+
createdAt: string;
|
|
204
|
+
deployment: PlatformDeploymentManifest;
|
|
205
|
+
id: string;
|
|
206
|
+
ownershipNonce: string;
|
|
207
|
+
platformVersion: string;
|
|
208
|
+
safetyProtocols?: Readonly<{
|
|
209
|
+
sandboxDrain: 0 | 1 | 2;
|
|
210
|
+
}>;
|
|
211
|
+
usageProtocolVersion?: 0 | 1;
|
|
212
|
+
}): PlatformInstallationManifest;
|
|
213
|
+
export declare function setInstallationDesiredState(manifest: PlatformInstallationManifest, desiredState: PlatformInstallationManifest["desiredState"], updatedAt: string): PlatformInstallationManifest;
|
|
214
|
+
export declare function setInstallationEndpoints(manifest: PlatformInstallationManifest, endpoints: PlatformInstallationEndpoints, updatedAt: string): PlatformInstallationManifest;
|
|
215
|
+
export declare function transitionInstallation(manifest: PlatformInstallationManifest, status: InstallationStatus, updatedAt: string): PlatformInstallationManifest;
|
|
216
|
+
export declare function recordInstallationResource(manifest: PlatformInstallationManifest, resource: InstallationResource, updatedAt: string): PlatformInstallationManifest;
|
|
217
|
+
export declare function recordInstallationStep(manifest: PlatformInstallationManifest, step: InstallationStep, updatedAt: string): PlatformInstallationManifest;
|
|
218
|
+
export declare function parsePlatformInstallationManifest(value: unknown): PlatformInstallationManifest;
|
|
219
|
+
//#endregion
|
|
220
|
+
//#region src/discovery.d.ts
|
|
221
|
+
export declare const PLATFORM_DISCOVERY_SCHEMA_VERSION: 1;
|
|
222
|
+
type PlatformDiscoveryDocument = Readonly<{
|
|
223
|
+
apiUrl: string;
|
|
224
|
+
applicationDomain: string;
|
|
225
|
+
applicationRouting?: PlatformApplication;
|
|
226
|
+
authenticationProviders: ReadonlyArray<"github" | "google">;
|
|
227
|
+
capabilities: PlatformCapabilities;
|
|
228
|
+
displayName: string;
|
|
229
|
+
installationId: string | null;
|
|
230
|
+
platformVersion: string;
|
|
231
|
+
proxyUrl: string;
|
|
232
|
+
schemaVersion: typeof PLATFORM_DISCOVERY_SCHEMA_VERSION | 2;
|
|
233
|
+
usageProtocolVersion: 0 | 1;
|
|
234
|
+
}>;
|
|
235
|
+
export declare function createPlatformDiscoveryDocument(input: Omit<PlatformDiscoveryDocument, "schemaVersion" | "usageProtocolVersion"> & {
|
|
236
|
+
usageProtocolVersion?: 0 | 1;
|
|
237
|
+
}): PlatformDiscoveryDocument;
|
|
238
|
+
export declare function parsePlatformDiscoveryDocument(value: unknown): PlatformDiscoveryDocument;
|
|
239
|
+
//#endregion
|
|
240
|
+
//#region src/worker-config.d.ts
|
|
241
|
+
type PlatformProvisionedResourceIds = Readonly<{
|
|
242
|
+
hyperdrive: string;
|
|
243
|
+
isrCacheKv: string;
|
|
244
|
+
legacyAssetsKv: string;
|
|
245
|
+
routingKv: string;
|
|
246
|
+
zone: string;
|
|
247
|
+
}>;
|
|
248
|
+
type PlatformWorkerConfigSet = Readonly<Record<"api" | "dispatch" | "proxy" | "tail", Record<string, unknown>>>;
|
|
249
|
+
export declare function createPlatformWorkerConfigs(input: {
|
|
250
|
+
accountId: string;
|
|
251
|
+
apiUrl: string;
|
|
252
|
+
deployment: PlatformDeploymentManifest;
|
|
253
|
+
healthProbeToken: string;
|
|
254
|
+
installationId: string;
|
|
255
|
+
ownershipNonce: string;
|
|
256
|
+
platformVersion: string;
|
|
257
|
+
publicEndpoints?: boolean;
|
|
258
|
+
proxyUrl: string;
|
|
259
|
+
resources: PlatformProvisionedResourceIds;
|
|
260
|
+
runtimeEntrypoints: Readonly<Record<"api" | "dispatch" | "proxy" | "tail", string>>;
|
|
261
|
+
trafficState?: "enabled" | "sandbox-drain" | "staging";
|
|
262
|
+
}): PlatformWorkerConfigSet;
|
|
263
|
+
//#endregion
|
|
264
|
+
export type { InstallationResource, InstallationResourceKind, InstallationStatus, InstallationStep, PlatformApplication, PlatformApplicationProject, PlatformApplicationRoute, PlatformCapabilities, PlatformControlPlane, PlatformDeploymentManifest, PlatformDeploymentManifestInput, PlatformDiscoveryDocument, PlatformInstallationEndpoints, PlatformInstallationManifest, PlatformProvisionedResourceIds, PlatformResourceNames, PlatformResourceOwnershipMarker, PlatformRuntimeProvenance, PlatformWorkerConfigSet, ResourceOwnership };
|