@void/platform 1.1.0 → 1.1.12
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/dist/index.d.mts +13 -2
- package/dist/index.mjs +27 -3
- package/dist/installer.d.mts +1 -0
- package/dist/installer.mjs +2 -0
- package/dist/runtime/api/assets/admin/client.js +42 -42
- package/dist/runtime/api/assets/admin/style.css +1 -1
- package/dist/runtime/api/index.js +267 -261
- package/dist/runtime/dispatch/index.js +7 -7
- package/dist/runtime/drizzle/0060_private_previews.sql +16 -0
- package/dist/runtime/drizzle/compatibility.json +12 -0
- package/dist/runtime/drizzle/meta/_journal.json +7 -0
- package/dist/runtime/emailGateway/index.js +3 -3
- package/dist/runtime/manifest.json +33 -14
- package/dist/runtime/proxy/index.js +3 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -432,15 +432,25 @@ type PlatformDiscoveryDocument = Readonly<{
|
|
|
432
432
|
capabilities: PlatformCapabilities;
|
|
433
433
|
displayName: string;
|
|
434
434
|
dashboardUrl?: string;
|
|
435
|
+
/**
|
|
436
|
+
* The API accepts Worker modules uploaded to R2 through
|
|
437
|
+
* `POST /projects/:id/deploy/worker-upload-urls`. Older platforms omit it.
|
|
438
|
+
*/
|
|
439
|
+
directWorkerUpload?: boolean;
|
|
435
440
|
installationId: string | null;
|
|
436
441
|
platformVersion: string;
|
|
437
442
|
proxyUrl: string;
|
|
438
443
|
schemaVersion: typeof PLATFORM_DISCOVERY_SCHEMA_VERSION | 2 | 3;
|
|
439
444
|
usageProtocolVersion: 0 | 1 | 2;
|
|
440
445
|
}>;
|
|
441
|
-
|
|
446
|
+
type PlatformDiscoveryInput = Omit<PlatformDiscoveryDocument, "directWorkerUpload" | "schemaVersion" | "usageProtocolVersion"> & {
|
|
442
447
|
usageProtocolVersion?: 0 | 1 | 2;
|
|
443
|
-
}
|
|
448
|
+
};
|
|
449
|
+
/**
|
|
450
|
+
* Builds the document a platform serves at `/.well-known/void-platform`.
|
|
451
|
+
* Every platform built from this source accepts direct Worker uploads.
|
|
452
|
+
*/
|
|
453
|
+
export declare function createPlatformDiscoveryDocument(input: PlatformDiscoveryInput): PlatformDiscoveryDocument;
|
|
444
454
|
export declare function parsePlatformDiscoveryDocument(value: unknown): PlatformDiscoveryDocument;
|
|
445
455
|
//#endregion
|
|
446
456
|
//#region src/worker-config.d.ts
|
|
@@ -464,6 +474,7 @@ export declare function createPlatformWorkerConfigs(input: {
|
|
|
464
474
|
platformVersion: string;
|
|
465
475
|
proxyHealthBinding?: boolean;
|
|
466
476
|
publicEndpoints?: boolean;
|
|
477
|
+
privatePreviews?: boolean;
|
|
467
478
|
proxyUrl: string;
|
|
468
479
|
emailGatewayUrl: string;
|
|
469
480
|
resources: PlatformProvisionedResourceIds;
|
package/dist/index.mjs
CHANGED
|
@@ -1005,7 +1005,17 @@ function normalizeOrigin(value, name) {
|
|
|
1005
1005
|
if (url.pathname !== "" && url.pathname !== "/" || url.search || url.hash) throw new Error(`${name} must be an origin without a path, query, or fragment.`);
|
|
1006
1006
|
return url.origin;
|
|
1007
1007
|
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Builds the document a platform serves at `/.well-known/void-platform`.
|
|
1010
|
+
* Every platform built from this source accepts direct Worker uploads.
|
|
1011
|
+
*/
|
|
1008
1012
|
function createPlatformDiscoveryDocument(input) {
|
|
1013
|
+
return {
|
|
1014
|
+
...normalizeDiscoveryDocument(input),
|
|
1015
|
+
directWorkerUpload: true
|
|
1016
|
+
};
|
|
1017
|
+
}
|
|
1018
|
+
function normalizeDiscoveryDocument(input) {
|
|
1009
1019
|
if (!input.displayName.trim()) throw new Error("displayName must not be empty.");
|
|
1010
1020
|
if (!input.platformVersion.trim()) throw new Error("platformVersion must not be empty.");
|
|
1011
1021
|
if (input.applicationRouting) {
|
|
@@ -1069,7 +1079,9 @@ function parsePlatformDiscoveryDocument(value) {
|
|
|
1069
1079
|
};
|
|
1070
1080
|
const apiUrl = string("apiUrl");
|
|
1071
1081
|
const proxyUrl = string("proxyUrl");
|
|
1072
|
-
|
|
1082
|
+
const directWorkerUpload = document.directWorkerUpload;
|
|
1083
|
+
if (directWorkerUpload !== void 0 && typeof directWorkerUpload !== "boolean") throw new Error("directWorkerUpload must be a boolean.");
|
|
1084
|
+
const parsed = normalizeDiscoveryDocument({
|
|
1073
1085
|
apiUrl,
|
|
1074
1086
|
applicationDomain: string("applicationDomain"),
|
|
1075
1087
|
...document.applicationRouting !== void 0 ? { applicationRouting: parsePlatformApplication(document.applicationRouting) } : {},
|
|
@@ -1083,6 +1095,10 @@ function parsePlatformDiscoveryDocument(value) {
|
|
|
1083
1095
|
proxyUrl,
|
|
1084
1096
|
usageProtocolVersion: parseUsageProtocolVersion(document.usageProtocolVersion)
|
|
1085
1097
|
});
|
|
1098
|
+
return directWorkerUpload === void 0 ? parsed : {
|
|
1099
|
+
...parsed,
|
|
1100
|
+
directWorkerUpload
|
|
1101
|
+
};
|
|
1086
1102
|
}
|
|
1087
1103
|
function parseAuthentication(value) {
|
|
1088
1104
|
const authentication = record(value, "Authentication discovery");
|
|
@@ -1154,10 +1170,14 @@ function createPlatformWorkerConfigs(input) {
|
|
|
1154
1170
|
].some((url) => new URL(url).hostname.endsWith(".workers.dev"));
|
|
1155
1171
|
const api = {
|
|
1156
1172
|
...common,
|
|
1157
|
-
...input.proxyHealthBinding && publicEndpoints && trafficState === "enabled" ? { services: [{
|
|
1173
|
+
...(input.privatePreviews || input.proxyHealthBinding) && publicEndpoints && trafficState === "enabled" ? { services: [...input.privatePreviews ? [{
|
|
1174
|
+
binding: "PREVIEW_DISPATCH",
|
|
1175
|
+
service: names.dispatchWorker,
|
|
1176
|
+
entrypoint: "PreviewDispatcher"
|
|
1177
|
+
}] : [], ...input.proxyHealthBinding ? [{
|
|
1158
1178
|
binding: "PLATFORM_PROXY",
|
|
1159
1179
|
service: names.proxyWorker
|
|
1160
|
-
}] } : {},
|
|
1180
|
+
}] : []] } : {},
|
|
1161
1181
|
version_metadata: { binding: "VERSION_METADATA" },
|
|
1162
1182
|
workers_dev: publicEndpoints && (!deployment.authentication.accessProtection || new URL(apiUrl).hostname.endsWith(".workers.dev")),
|
|
1163
1183
|
name: names.apiWorker,
|
|
@@ -1363,6 +1383,10 @@ function createPlatformWorkerConfigs(input) {
|
|
|
1363
1383
|
},
|
|
1364
1384
|
dispatch: {
|
|
1365
1385
|
...common,
|
|
1386
|
+
...input.privatePreviews ? { services: [{
|
|
1387
|
+
binding: "PREVIEW_API",
|
|
1388
|
+
service: names.apiWorker
|
|
1389
|
+
}] } : {},
|
|
1366
1390
|
name: names.dispatchWorker,
|
|
1367
1391
|
main: runtimeEntrypoints.dispatch,
|
|
1368
1392
|
no_bundle: true,
|
package/dist/installer.d.mts
CHANGED
|
@@ -31,6 +31,7 @@ export type PlatformRuntimeManifest = Readonly<{
|
|
|
31
31
|
deploymentExecution?: 1;
|
|
32
32
|
authenticationProtocolVersion?: 1;
|
|
33
33
|
applicationRoutingVersion?: 1;
|
|
34
|
+
privatePreviews?: 1;
|
|
34
35
|
artifacts: Readonly<Record<"api" | "dispatch" | "proxy" | "tail", PlatformRuntimeArtifact> & Partial<Record<"emailGateway", PlatformRuntimeArtifact>>>;
|
|
35
36
|
assets?: Readonly<{
|
|
36
37
|
adminClient: PlatformRuntimeArtifact;
|
package/dist/installer.mjs
CHANGED
|
@@ -22,6 +22,7 @@ function platformDatabaseSchemaDigest(lineage, migrations) {
|
|
|
22
22
|
}
|
|
23
23
|
function parsePlatformRuntimeManifest(value) {
|
|
24
24
|
const root = record(value, "runtime manifest");
|
|
25
|
+
if (root.privatePreviews !== void 0 && root.privatePreviews !== 1) throw new Error("Unsupported private preview protocol.");
|
|
25
26
|
if (root.schemaVersion !== 2) throw new Error("runtime manifest schemaVersion must be 2");
|
|
26
27
|
if (root.appAccessSetup !== void 0 && root.appAccessSetup !== 1) throw new Error("Unsupported app access setup protocol.");
|
|
27
28
|
if (root.deploymentExecution !== void 0 && root.deploymentExecution !== 1) throw new Error("Unsupported deployment execution protocol.");
|
|
@@ -89,6 +90,7 @@ function parsePlatformRuntimeManifest(value) {
|
|
|
89
90
|
...root.authenticationProtocolVersion === 1 ? { authenticationProtocolVersion: 1 } : {},
|
|
90
91
|
...root.emailProtocolVersion === 1 ? { emailProtocolVersion: 1 } : {},
|
|
91
92
|
...root.applicationRoutingVersion === 1 ? { applicationRoutingVersion: 1 } : {},
|
|
93
|
+
...root.privatePreviews === 1 ? { privatePreviews: 1 } : {},
|
|
92
94
|
database: {
|
|
93
95
|
journalSha256: sha256(databaseValue.journalSha256, "database journal digest"),
|
|
94
96
|
lineage,
|