@void/platform 0.20.1 → 0.20.2

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.
Files changed (32) hide show
  1. package/README.md +10 -1
  2. package/dist/email-protocol.d.mts +48 -0
  3. package/dist/email-protocol.mjs +278 -0
  4. package/dist/index.d.mts +152 -13
  5. package/dist/index.mjs +346 -20
  6. package/dist/installer.d.mts +4 -2
  7. package/dist/installer.mjs +13 -4
  8. package/dist/runtime/api/README.md +1 -1
  9. package/dist/runtime/api/index.js +67382 -54178
  10. package/dist/runtime/api/index.js.map +4 -4
  11. package/dist/runtime/dispatch/README.md +1 -1
  12. package/dist/runtime/dispatch/index.js +26 -8
  13. package/dist/runtime/dispatch/index.js.map +2 -2
  14. package/dist/runtime/drizzle/0041_military_beyonder.sql +119 -0
  15. package/dist/runtime/drizzle/0042_dark_the_anarchist.sql +1 -0
  16. package/dist/runtime/drizzle/0043_nostalgic_meggan.sql +21 -0
  17. package/dist/runtime/drizzle/0044_smart_mentor.sql +15 -0
  18. package/dist/runtime/drizzle/0045_platform_settings.sql +5 -0
  19. package/dist/runtime/drizzle/0046_email_domains_platform_credential.sql +8 -0
  20. package/dist/runtime/drizzle/0047_email_gateway.sql +226 -0
  21. package/dist/runtime/drizzle/0048_project_teams.sql +133 -0
  22. package/dist/runtime/drizzle/compatibility.json +4 -0
  23. package/dist/runtime/drizzle/meta/_journal.json +56 -0
  24. package/dist/runtime/emailGateway/README.md +1 -0
  25. package/dist/runtime/emailGateway/index.js +5893 -0
  26. package/dist/runtime/emailGateway/index.js.map +8 -0
  27. package/dist/runtime/manifest.json +70 -11
  28. package/dist/runtime/proxy/README.md +1 -1
  29. package/dist/runtime/proxy/index.js +1629 -2242
  30. package/dist/runtime/proxy/index.js.map +4 -4
  31. package/dist/runtime/tail/README.md +1 -1
  32. package/package.json +5 -1
@@ -1 +1 @@
1
- This folder contains the built output assets for the worker "void-runtime-build-dispatch" generated at 2026-09-18T06:30:38.952Z.
1
+ This folder contains the built output assets for the worker "void-runtime-build-dispatch" generated at 2026-09-22T17:31:16.764Z.
@@ -2,6 +2,12 @@ var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
4
  // ../../home/runner/work/void/void/packages/platform/dist/index.mjs
5
+ var PLATFORM_LOGIN_KINDS = [
6
+ "github",
7
+ "google",
8
+ "oidc",
9
+ "cloudflare-access"
10
+ ];
5
11
  var CORE_CAPABILITIES = {
6
12
  ai: true,
7
13
  customDomains: false,
@@ -47,6 +53,7 @@ function createPlatformResourceNames(installationSlug) {
47
53
  dashboardWorker: `${prefix}-dashboard`,
48
54
  dispatchNamespace: `${prefix}-users`,
49
55
  dispatchWorker: `${prefix}-dispatch`,
56
+ emailGatewayWorker: `${prefix}-email-gateway`,
50
57
  hyperdrive: `${prefix}-database`,
51
58
  isrCacheKv: `${prefix}-isr-cache`,
52
59
  legacyAssetsKv: `${prefix}-legacy-assets`,
@@ -88,6 +95,7 @@ function createApplicationRoutes(application) {
88
95
  }
89
96
  __name(createApplicationRoutes, "createApplicationRoutes");
90
97
  function createPlatformDeploymentManifest(input) {
98
+ if (input.emailSharedZoneId === void 0 !== (input.emailSenderDomain === void 0)) throw new Error("Shared email configuration requires both emailSenderDomain and emailSharedZoneId.");
91
99
  const installationSlug = normalizeInstallationSlug(input.installationSlug);
92
100
  const baseDomain = normalizeApplicationDomain(input.application.baseDomain);
93
101
  const workersDev = input.application.workersDev;
@@ -104,6 +112,8 @@ function createPlatformDeploymentManifest(input) {
104
112
  };
105
113
  if (capabilities.managedBuilds && !capabilities.githubActions) throw new Error("Managed builds require the GitHub Actions capability.");
106
114
  const providers = input.authentication?.providers ?? ["github"];
115
+ 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.");
116
+ const configurable = input.authentication?.configurable === true || input.authentication?.accessProtection === true || providers.some((provider) => provider === "oidc" || provider === "cloudflare-access");
107
117
  if (providers.length === 0) throw new Error("At least one authentication provider is required.");
108
118
  if (providers.includes("github") !== capabilities.githubOAuth) throw new Error("The GitHub provider and githubOAuth capability must agree.");
109
119
  if (providers.includes("google") !== capabilities.googleOAuth) throw new Error("The Google provider and googleOAuth capability must agree.");
@@ -115,8 +125,14 @@ function createPlatformDeploymentManifest(input) {
115
125
  ...workersDev ? { workersDev: { ...workersDev } } : {},
116
126
  ...input.application.zoneId ? { zoneId: requiredString$1(input.application.zoneId, "application.zoneId") } : {}
117
127
  },
118
- authentication: { providers: [...providers] },
128
+ authentication: {
129
+ providers: [...providers],
130
+ ...configurable ? { configurable: true } : {},
131
+ ...input.authentication?.accessProtection ? { accessProtection: true } : {}
132
+ },
119
133
  capabilities,
134
+ ...input.emailSharedZoneId !== void 0 ? { emailSharedZoneId: requiredString$1(input.emailSharedZoneId, "emailSharedZoneId") } : {},
135
+ ...input.emailSenderDomain !== void 0 ? { emailSenderDomain: normalizeApplicationDomain(input.emailSenderDomain) } : {},
120
136
  controlPlane: {
121
137
  ...CONTROL_PLANE_DEFAULTS,
122
138
  ...input.controlPlane
@@ -124,7 +140,7 @@ function createPlatformDeploymentManifest(input) {
124
140
  displayName: requiredString$1(input.displayName, "displayName").trim(),
125
141
  installationSlug,
126
142
  resources,
127
- schemaVersion: workersDev ? 2 : 1
143
+ schemaVersion: configurable ? 3 : workersDev ? 2 : 1
128
144
  };
129
145
  createApplicationRoutes(manifest.application);
130
146
  for (const [key, value] of Object.entries(manifest.controlPlane)) {
@@ -135,7 +151,7 @@ function createPlatformDeploymentManifest(input) {
135
151
  return manifest;
136
152
  }
137
153
  __name(createPlatformDeploymentManifest, "createPlatformDeploymentManifest");
138
- var PLATFORM_USAGE_PROTOCOL_VERSION = 1;
154
+ var PLATFORM_USAGE_PROTOCOL_VERSION = 2;
139
155
  function readPlatformApplication(env) {
140
156
  const baseDomain = env.SITE_DOMAIN ?? env.BASE_HOSTNAME ?? "void.app";
141
157
  if (!env.PLATFORM_APPLICATION) return {
@@ -1219,8 +1235,8 @@ async function readUsageSigningKey(routing) {
1219
1235
  return routing.get(USAGE_SIGNING_KEY_KV_KEY, { cacheTtl: 60 });
1220
1236
  }
1221
1237
  __name(readUsageSigningKey, "readUsageSigningKey");
1222
- function signedPayload(source, eventId, event) {
1223
- return JSON.stringify([USAGE_PROTOCOL_VERSION, source, eventId, event]);
1238
+ function signedPayload(version, source, eventId, event) {
1239
+ return JSON.stringify([version, source, eventId, event]);
1224
1240
  }
1225
1241
  __name(signedPayload, "signedPayload");
1226
1242
  async function signUsageEvent(key, source, eventId, event) {
@@ -1229,7 +1245,9 @@ async function signUsageEvent(key, source, eventId, event) {
1229
1245
  source,
1230
1246
  eventId,
1231
1247
  event,
1232
- signature: base64url(await hmac(signedPayload(source, eventId, event), key))
1248
+ signature: base64url(
1249
+ await hmac(signedPayload(USAGE_PROTOCOL_VERSION, source, eventId, event), key)
1250
+ )
1233
1251
  };
1234
1252
  }
1235
1253
  __name(signUsageEvent, "signUsageEvent");
@@ -1295,7 +1313,7 @@ function recordPlatformLog(env, data) {
1295
1313
  pathname = new URL(data.url).pathname;
1296
1314
  } catch {
1297
1315
  }
1298
- const message = `Void platform: your worker did not respond within ${data.timeoutMs} ms. ${data.method} ${truncateUtf8(pathname, MAX_LOG_PATH_BYTES)} was cut short and returned ${data.status}. Your code keeps running to completion; the platform does not cancel it.`;
1316
+ const message = `Void platform: your worker did not respond within ${data.timeoutMs} ms. ${data.method} ${truncateUtf8(pathname, MAX_LOG_PATH_BYTES)} was cut short and returned ${data.status}. The operation may still have side effects; check its outcome before retrying.`;
1299
1317
  try {
1300
1318
  env.LOGS.writeDataPoint({
1301
1319
  // `projectKey` is NOT truncated. It is the read key, so a shortened one
@@ -2020,6 +2038,7 @@ var index_default = {
2020
2038
  }
2021
2039
  const res = new Response(response.body, response);
2022
2040
  res.headers.delete("X-Void-No-Match");
2041
+ res.headers.delete(SHARED_CACHE_POLICY_HEADER);
2023
2042
  res.headers.set("X-Hosted-By", "void.cloud");
2024
2043
  return res;
2025
2044
  }, "meter");
@@ -2085,7 +2104,6 @@ var index_default = {
2085
2104
  }
2086
2105
  }
2087
2106
  }
2088
- ruled.headers.delete(SHARED_CACHE_POLICY_HEADER);
2089
2107
  return meter(ruled, failureKind ? { failureKind } : void 0);
2090
2108
  }, "finalizeAsset");
2091
2109
  const cache = applicationEdgeCache;