@void/platform 1.5.0 → 1.6.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/dist/index.d.mts CHANGED
@@ -220,6 +220,11 @@ type PlatformResourceNames = Readonly<{
220
220
  usageQueue: string;
221
221
  }>;
222
222
  type PlatformAppAccess = "public" | "platform" | "custom";
223
+ /**
224
+ * `minimal` keeps request URLs, console messages and exception messages out of
225
+ * Workers Logs and the platform's request log rows. Omitted means `full`.
226
+ */
227
+ type PlatformRuntimeLogs = "minimal";
223
228
  type PlatformDeploymentManifest = Readonly<{
224
229
  /** Initial app-access choice. Omitted on installations created before guided setup. */
225
230
  appAccess?: PlatformAppAccess;
@@ -238,7 +243,9 @@ type PlatformDeploymentManifest = Readonly<{
238
243
  displayName: string;
239
244
  installationSlug: string;
240
245
  resources: PlatformResourceNames;
241
- schemaVersion: typeof PLATFORM_DEPLOYMENT_SCHEMA_VERSION | 2 | 3 | 4;
246
+ /** Requires schema version 5, so an older CLI refuses the manifest instead of dropping it. */
247
+ runtimeLogs?: PlatformRuntimeLogs;
248
+ schemaVersion: typeof PLATFORM_DEPLOYMENT_SCHEMA_VERSION | 2 | 3 | 4 | 5;
242
249
  }>;
243
250
  type PlatformDeploymentManifestInput = Readonly<{
244
251
  appAccess?: PlatformAppAccess;
@@ -261,6 +268,7 @@ type PlatformDeploymentManifestInput = Readonly<{
261
268
  displayName: string;
262
269
  installationSlug: string;
263
270
  resources?: Partial<PlatformResourceNames>;
271
+ runtimeLogs?: PlatformRuntimeLogs;
264
272
  }>;
265
273
  type PlatformApplicationRoute = Readonly<{
266
274
  pattern: string;
@@ -465,4 +473,4 @@ export declare function createPlatformWorkerConfigs(input: {
465
473
  runtimeApiAssetsDirectory?: string;
466
474
  trafficState?: "enabled" | "sandbox-drain" | "staging";
467
475
  }): PlatformWorkerConfigSet;
468
- export { BUILD_INSTANCE_FREE, BUILD_INSTANCE_LARGE, BuildInstanceType, BuiltinPlanId, EditablePlanLimit, type InstallationResource, type InstallationResourceKind, type InstallationStatus, type InstallationStep, PLAN_EDITABLE_LIMIT_KEYS, PLAN_LIMITS, PlanId, PlanLimits, PlanLimitsPatch, type PlatformAccessProtection, type PlatformAdmissionPolicy, type PlatformAppAccess, type PlatformAppAccessSetup, type PlatformApplication, type PlatformApplicationProject, type PlatformApplicationRoute, type PlatformAuthenticationDiscovery, type PlatformAuthenticationRecovery, type PlatformAuthenticationSetup, type PlatformCapabilities, type PlatformControlPlane, type PlatformDeploymentManifest, type PlatformDeploymentManifestInput, type PlatformDiscoveryDocument, type PlatformInstallationEndpoints, type PlatformInstallationManifest, type PlatformLifecycleOperation, type PlatformLoginConfiguration, type PlatformLoginDescriptor, type PlatformLoginKind, PlatformPlanCatalog, PlatformPlanDefinition, PlatformPlanReconciliation, type PlatformProvisionedResourceIds, type PlatformResourceNames, type PlatformResourceOwnershipMarker, type PlatformRuntimeProvenance, type PlatformSignupAllowlistEntry, type PlatformSignupIdentity, type PlatformWorkerConfigSet, type ResourceOwnership, createDefaultPlanCatalog, parseBuildInstanceType, parsePlanLimitsPatch, parsePlanName, parsePlatformPlanCatalog, parsePlatformPlanId, validatePlanLimits };
476
+ export { BUILD_INSTANCE_FREE, BUILD_INSTANCE_LARGE, BuildInstanceType, BuiltinPlanId, EditablePlanLimit, type InstallationResource, type InstallationResourceKind, type InstallationStatus, type InstallationStep, PLAN_EDITABLE_LIMIT_KEYS, PLAN_LIMITS, PlanId, PlanLimits, PlanLimitsPatch, type PlatformAccessProtection, type PlatformAdmissionPolicy, type PlatformAppAccess, type PlatformAppAccessSetup, type PlatformApplication, type PlatformApplicationProject, type PlatformApplicationRoute, type PlatformAuthenticationDiscovery, type PlatformAuthenticationRecovery, type PlatformAuthenticationSetup, type PlatformCapabilities, type PlatformControlPlane, type PlatformDeploymentManifest, type PlatformDeploymentManifestInput, type PlatformDiscoveryDocument, type PlatformInstallationEndpoints, type PlatformInstallationManifest, type PlatformLifecycleOperation, type PlatformLoginConfiguration, type PlatformLoginDescriptor, type PlatformLoginKind, PlatformPlanCatalog, PlatformPlanDefinition, PlatformPlanReconciliation, type PlatformProvisionedResourceIds, type PlatformResourceNames, type PlatformResourceOwnershipMarker, type PlatformRuntimeLogs, type PlatformRuntimeProvenance, type PlatformSignupAllowlistEntry, type PlatformSignupIdentity, type PlatformWorkerConfigSet, type ResourceOwnership, createDefaultPlanCatalog, parseBuildInstanceType, parsePlanLimitsPatch, parsePlanName, parsePlatformPlanCatalog, parsePlatformPlanId, validatePlanLimits };
package/dist/index.mjs CHANGED
@@ -411,6 +411,7 @@ function createPlatformDeploymentManifest(input) {
411
411
  "platform",
412
412
  "custom"
413
413
  ].includes(input.appAccess)) throw new Error("appAccess must be public, platform, or custom.");
414
+ if (input.runtimeLogs !== void 0 && input.runtimeLogs !== "minimal") throw new Error("runtimeLogs must be minimal when set.");
414
415
  const providers = input.authentication?.providers ?? ["github"];
415
416
  if (providers.some((provider) => !PLATFORM_LOGIN_KINDS.includes(provider)) || new Set(providers).size !== providers.length) throw new Error("Authentication providers must be unique supported login kinds.");
416
417
  const configurable = input.authentication?.configurable === true || input.authentication?.accessProtection === true || providers.some((provider) => provider === "oidc" || provider === "cloudflare-access");
@@ -446,7 +447,8 @@ function createPlatformDeploymentManifest(input) {
446
447
  displayName: requiredString(input.displayName, "displayName").trim(),
447
448
  installationSlug,
448
449
  resources,
449
- schemaVersion: input.appAccess !== void 0 ? 4 : configurable ? 3 : workersDev ? 2 : 1
450
+ ...input.runtimeLogs ? { runtimeLogs: input.runtimeLogs } : {},
451
+ schemaVersion: input.runtimeLogs ? 5 : input.appAccess !== void 0 ? 4 : configurable ? 3 : workersDev ? 2 : 1
450
452
  };
451
453
  createApplicationRoutes(manifest.application);
452
454
  for (const [key, value] of Object.entries(manifest.controlPlane)) {
@@ -462,7 +464,7 @@ function createPlatformDeploymentManifest(input) {
462
464
  }
463
465
  function parsePlatformDeploymentManifest(value) {
464
466
  assertRecord(value, "Platform deployment manifest");
465
- if (value.schemaVersion !== 1 && value.schemaVersion !== 2 && value.schemaVersion !== 3 && value.schemaVersion !== 4) throw new Error(`Unsupported platform deployment schema version: ${String(value.schemaVersion)}.`);
467
+ if (value.schemaVersion !== 1 && value.schemaVersion !== 2 && value.schemaVersion !== 3 && value.schemaVersion !== 4 && value.schemaVersion !== 5) throw new Error(`Unsupported platform deployment schema version: ${String(value.schemaVersion)}.`);
466
468
  const application = value.application;
467
469
  const authentication = value.authentication;
468
470
  const rawCapabilities = value.capabilities;
@@ -470,7 +472,7 @@ function parsePlatformDeploymentManifest(value) {
470
472
  const rawResources = value.resources;
471
473
  assertRecord(application, "application");
472
474
  let workersDev;
473
- if (value.schemaVersion === 2 || (value.schemaVersion === 3 || value.schemaVersion === 4) && application.workersDev !== void 0) {
475
+ if (value.schemaVersion === 2 || Number(value.schemaVersion) >= 3 && application.workersDev !== void 0) {
474
476
  assertRecord(application.workersDev, "application.workersDev");
475
477
  workersDev = {
476
478
  subdomain: requiredString(application.workersDev.subdomain, "workersDev.subdomain"),
@@ -489,14 +491,19 @@ function parsePlatformDeploymentManifest(value) {
489
491
  capabilities[key] = entry;
490
492
  }
491
493
  const providers = authentication.providers;
492
- if (!Array.isArray(providers) || providers.some((provider) => !PLATFORM_LOGIN_KINDS.includes(provider) || value.schemaVersion !== 3 && value.schemaVersion !== 4 && provider !== "github" && provider !== "google")) throw new Error("authentication.providers must contain only github or google.");
493
- if (value.schemaVersion === 3 && authentication.configurable !== true || value.schemaVersion !== 3 && value.schemaVersion !== 4 && (authentication.configurable !== void 0 || authentication.accessProtection !== void 0) || authentication.accessProtection !== void 0 && authentication.accessProtection !== true) throw new Error("Configurable authentication requires deployment schema version 3.");
494
+ if (!Array.isArray(providers) || providers.some((provider) => !PLATFORM_LOGIN_KINDS.includes(provider) || Number(value.schemaVersion) < 3 && provider !== "github" && provider !== "google")) throw new Error("authentication.providers must contain only github or google.");
495
+ if (value.schemaVersion === 3 && authentication.configurable !== true || Number(value.schemaVersion) < 3 && (authentication.configurable !== void 0 || authentication.accessProtection !== void 0) || authentication.accessProtection !== void 0 && authentication.accessProtection !== true) throw new Error("Configurable authentication requires deployment schema version 3.");
494
496
  if (value.schemaVersion === 4 ? ![
495
497
  "public",
496
498
  "platform",
497
499
  "custom"
500
+ ].includes(String(value.appAccess)) : value.schemaVersion === 5 ? value.appAccess !== void 0 && ![
501
+ "public",
502
+ "platform",
503
+ "custom"
498
504
  ].includes(String(value.appAccess)) : value.appAccess !== void 0) throw new Error("Guided app access requires deployment schema version 4 and a valid appAccess choice.");
499
505
  if (authentication.configurable !== void 0 && authentication.configurable !== true) throw new Error("Invalid configurable authentication flag.");
506
+ if (value.schemaVersion === 5 ? value.runtimeLogs !== "minimal" : value.runtimeLogs !== void 0) throw new Error("Minimal runtime logs require deployment schema version 5.");
500
507
  const resourceDefaults = createPlatformResourceNames(requiredString(value.installationSlug, "installationSlug"));
501
508
  const resources = {};
502
509
  for (const key of Object.keys(resourceDefaults)) resources[key] = requiredString(rawResources[key] ?? (key === "emailGatewayWorker" || key === "deploymentQueue" ? resourceDefaults[key] : void 0), `resources.${key}`);
@@ -505,7 +512,7 @@ function parsePlatformDeploymentManifest(value) {
505
512
  return hostname === null ? null : requiredString(hostname, `controlPlane.${key}`);
506
513
  };
507
514
  return createPlatformDeploymentManifest({
508
- ...value.schemaVersion === 4 ? { appAccess: value.appAccess } : {},
515
+ ...Number(value.schemaVersion) >= 4 && value.appAccess !== void 0 ? { appAccess: value.appAccess } : {},
509
516
  application: {
510
517
  baseDomain: requiredString(application.baseDomain, "application.baseDomain"),
511
518
  dedicatedZone: application.dedicatedZone === true,
@@ -529,7 +536,8 @@ function parsePlatformDeploymentManifest(value) {
529
536
  },
530
537
  displayName: requiredString(value.displayName, "displayName"),
531
538
  installationSlug: requiredString(value.installationSlug, "installationSlug"),
532
- resources
539
+ resources,
540
+ ...value.schemaVersion === 5 ? { runtimeLogs: "minimal" } : {}
533
541
  });
534
542
  }
535
543
  // src/installation.ts
@@ -1126,10 +1134,11 @@ function createPlatformWorkerConfigs(input) {
1126
1134
  resourceKind: "worker",
1127
1135
  resourceName
1128
1136
  })) });
1137
+ const runtimeLogs = deployment.runtimeLogs ? { PLATFORM_RUNTIME_LOGS: deployment.runtimeLogs } : {};
1129
1138
  const common = {
1130
1139
  account_id: accountId,
1131
1140
  compatibility_date: "2026-02-24",
1132
- observability: { enabled: true },
1141
+ observability: { enabled: !deployment.runtimeLogs },
1133
1142
  preview_urls: publicEndpoints && !deployment.authentication.accessProtection,
1134
1143
  workers_dev: publicEndpoints
1135
1144
  };
@@ -1275,6 +1284,7 @@ function createPlatformWorkerConfigs(input) {
1275
1284
  PLATFORM_HEALTH_PROBE_TOKEN: healthProbeToken,
1276
1285
  ...deployment.appAccess ? { PLATFORM_APP_ACCESS: deployment.appAccess } : {},
1277
1286
  PLATFORM_INSTALLATION_ID: installationId,
1287
+ ...runtimeLogs,
1278
1288
  PLATFORM_TRAFFIC_STATE: trafficState,
1279
1289
  ...ownershipVars("api-worker", names.apiWorker),
1280
1290
  PLATFORM_VERSION: platformVersion,
@@ -1370,6 +1380,7 @@ function createPlatformWorkerConfigs(input) {
1370
1380
  }],
1371
1381
  vars: {
1372
1382
  PLATFORM_DISPATCH_WORKER_NAME: names.dispatchWorker,
1383
+ ...runtimeLogs,
1373
1384
  ...ownershipVars("tail-worker", names.tailWorker)
1374
1385
  }
1375
1386
  },
@@ -1407,6 +1418,7 @@ function createPlatformWorkerConfigs(input) {
1407
1418
  PLATFORM_HEALTH_PROBE_TOKEN: healthProbeToken,
1408
1419
  PLATFORM_INSTALLATION_ID: installationId,
1409
1420
  PLATFORM_TRAFFIC_STATE: trafficState,
1421
+ ...runtimeLogs,
1410
1422
  ...ownershipVars("dispatch-worker", names.dispatchWorker)
1411
1423
  }
1412
1424
  }
@@ -26,6 +26,8 @@ export type PlatformRuntimeDatabaseManifest = Readonly<{
26
26
  }>;
27
27
  export type PlatformRuntimeManifest = Readonly<{
28
28
  appAccessSetup?: 1;
29
+ /** The runtime honours `runtimeLogs: minimal` (PLATFORM_RUNTIME_LOGS). */
30
+ runtimeLogs?: 1;
29
31
  /** Durable deployment Queue payload and PostgreSQL operation journal contract. */
30
32
  deploymentExecution?: 1;
31
33
  authenticationProtocolVersion?: 1;
@@ -25,6 +25,7 @@ function parsePlatformRuntimeManifest(value) {
25
25
  if (root.privatePreviews !== void 0 && root.privatePreviews !== 1) throw new Error("Unsupported private preview protocol.");
26
26
  if (root.schemaVersion !== 2) throw new Error("runtime manifest schemaVersion must be 2");
27
27
  if (root.appAccessSetup !== void 0 && root.appAccessSetup !== 1) throw new Error("Unsupported app access setup protocol.");
28
+ if (root.runtimeLogs !== void 0 && root.runtimeLogs !== 1) throw new Error("Unsupported runtime logs protocol.");
28
29
  if (root.deploymentExecution !== void 0 && root.deploymentExecution !== 1) throw new Error("Unsupported deployment execution protocol.");
29
30
  if (root.authenticationProtocolVersion !== void 0 && root.authenticationProtocolVersion !== 1) throw new Error("Unsupported authentication protocol version.");
30
31
  if (root.emailProtocolVersion !== void 0 && root.emailProtocolVersion !== 1) throw new Error("Unsupported email protocol version.");
@@ -85,6 +86,7 @@ function parsePlatformRuntimeManifest(value) {
85
86
  return {
86
87
  artifacts,
87
88
  ...root.appAccessSetup === 1 ? { appAccessSetup: 1 } : {},
89
+ ...root.runtimeLogs === 1 ? { runtimeLogs: 1 } : {},
88
90
  ...root.deploymentExecution === 1 ? { deploymentExecution: 1 } : {},
89
91
  ...assets ? { assets } : {},
90
92
  ...root.authenticationProtocolVersion === 1 ? { authenticationProtocolVersion: 1 } : {},