@void/platform 1.0.3 → 1.1.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/dist/index.d.mts CHANGED
@@ -464,6 +464,7 @@ export declare function createPlatformWorkerConfigs(input: {
464
464
  platformVersion: string;
465
465
  proxyHealthBinding?: boolean;
466
466
  publicEndpoints?: boolean;
467
+ privatePreviews?: boolean;
467
468
  proxyUrl: string;
468
469
  emailGatewayUrl: string;
469
470
  resources: PlatformProvisionedResourceIds;
package/dist/index.mjs CHANGED
@@ -1154,10 +1154,14 @@ function createPlatformWorkerConfigs(input) {
1154
1154
  ].some((url) => new URL(url).hostname.endsWith(".workers.dev"));
1155
1155
  const api = {
1156
1156
  ...common,
1157
- ...input.proxyHealthBinding && publicEndpoints && trafficState === "enabled" ? { services: [{
1157
+ ...(input.privatePreviews || input.proxyHealthBinding) && publicEndpoints && trafficState === "enabled" ? { services: [...input.privatePreviews ? [{
1158
+ binding: "PREVIEW_DISPATCH",
1159
+ service: names.dispatchWorker,
1160
+ entrypoint: "PreviewDispatcher"
1161
+ }] : [], ...input.proxyHealthBinding ? [{
1158
1162
  binding: "PLATFORM_PROXY",
1159
1163
  service: names.proxyWorker
1160
- }] } : {},
1164
+ }] : []] } : {},
1161
1165
  version_metadata: { binding: "VERSION_METADATA" },
1162
1166
  workers_dev: publicEndpoints && (!deployment.authentication.accessProtection || new URL(apiUrl).hostname.endsWith(".workers.dev")),
1163
1167
  name: names.apiWorker,
@@ -1363,6 +1367,10 @@ function createPlatformWorkerConfigs(input) {
1363
1367
  },
1364
1368
  dispatch: {
1365
1369
  ...common,
1370
+ ...input.privatePreviews ? { services: [{
1371
+ binding: "PREVIEW_API",
1372
+ service: names.apiWorker
1373
+ }] } : {},
1366
1374
  name: names.dispatchWorker,
1367
1375
  main: runtimeEntrypoints.dispatch,
1368
1376
  no_bundle: true,
@@ -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;
@@ -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,