@void/platform 0.20.0 → 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.
- package/README.md +10 -1
- package/dist/email-protocol.d.mts +48 -0
- package/dist/email-protocol.mjs +278 -0
- package/dist/index.d.mts +152 -13
- package/dist/index.mjs +346 -20
- package/dist/installer.d.mts +4 -2
- package/dist/installer.mjs +13 -4
- package/dist/runtime/api/README.md +1 -1
- package/dist/runtime/api/index.js +67906 -52205
- package/dist/runtime/api/index.js.map +5 -5
- package/dist/runtime/dispatch/README.md +1 -1
- package/dist/runtime/dispatch/index.js +44 -26
- package/dist/runtime/dispatch/index.js.map +3 -3
- package/dist/runtime/drizzle/0039_email_domains.sql +32 -0
- package/dist/runtime/drizzle/0040_productive_vector.sql +1 -0
- package/dist/runtime/drizzle/0041_military_beyonder.sql +119 -0
- package/dist/runtime/drizzle/0042_dark_the_anarchist.sql +1 -0
- package/dist/runtime/drizzle/0043_nostalgic_meggan.sql +21 -0
- package/dist/runtime/drizzle/0044_smart_mentor.sql +15 -0
- package/dist/runtime/drizzle/0045_platform_settings.sql +5 -0
- package/dist/runtime/drizzle/0046_email_domains_platform_credential.sql +8 -0
- package/dist/runtime/drizzle/0047_email_gateway.sql +226 -0
- package/dist/runtime/drizzle/0048_project_teams.sql +133 -0
- package/dist/runtime/drizzle/compatibility.json +4 -0
- package/dist/runtime/drizzle/meta/_journal.json +70 -0
- package/dist/runtime/emailGateway/README.md +1 -0
- package/dist/runtime/emailGateway/index.js +5893 -0
- package/dist/runtime/emailGateway/index.js.map +8 -0
- package/dist/runtime/manifest.json +84 -13
- package/dist/runtime/proxy/README.md +1 -1
- package/dist/runtime/proxy/index.js +1786 -1523
- package/dist/runtime/proxy/index.js.map +5 -5
- package/dist/runtime/tail/README.md +1 -1
- package/dist/runtime/tail/index.js +1 -1
- package/dist/runtime/tail/index.js.map +1 -1
- 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-
|
|
1
|
+
This folder contains the built output assets for the worker "void-runtime-build-dispatch" generated at 2026-09-22T17:31:16.764Z.
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
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: {
|
|
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 =
|
|
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 {
|
|
@@ -183,7 +199,7 @@ function platformProjectWorkersDevHostname(project, workersDev) {
|
|
|
183
199
|
}
|
|
184
200
|
__name(platformProjectWorkersDevHostname, "platformProjectWorkersDevHostname");
|
|
185
201
|
|
|
186
|
-
//
|
|
202
|
+
// ../../home/runner/work/void/void/platform/packages/dispatch/src/error-page.ts
|
|
187
203
|
var DEFAULT_FONT_STACK = 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif';
|
|
188
204
|
function escapeHtml(value) {
|
|
189
205
|
return value.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """);
|
|
@@ -284,7 +300,7 @@ function createErrorResponse(request, status, title, headers) {
|
|
|
284
300
|
}
|
|
285
301
|
__name(createErrorResponse, "createErrorResponse");
|
|
286
302
|
|
|
287
|
-
//
|
|
303
|
+
// ../../home/runner/work/void/void/packages/edge/src/pattern.ts
|
|
288
304
|
var MAX_CACHE = 256;
|
|
289
305
|
var compileCache = /* @__PURE__ */ new Map();
|
|
290
306
|
var REGEX_SPECIAL = /[.+?^${}()|[\]\\]/;
|
|
@@ -413,7 +429,7 @@ function substituteParams(destination, params) {
|
|
|
413
429
|
}
|
|
414
430
|
__name(substituteParams, "substituteParams");
|
|
415
431
|
|
|
416
|
-
//
|
|
432
|
+
// ../../home/runner/work/void/void/packages/edge/src/headers.ts
|
|
417
433
|
var BLOCKED_HEADERS = /* @__PURE__ */ new Set(["set-cookie"]);
|
|
418
434
|
function parseQuotedString(member) {
|
|
419
435
|
if (member.length < 2 || member[0] !== '"' || member[member.length - 1] !== '"') {
|
|
@@ -520,7 +536,7 @@ function applyHeaderRules(response, pathname, rules, policy) {
|
|
|
520
536
|
}
|
|
521
537
|
__name(applyHeaderRules, "applyHeaderRules");
|
|
522
538
|
|
|
523
|
-
//
|
|
539
|
+
// ../../home/runner/work/void/void/packages/edge/src/routing-rules.ts
|
|
524
540
|
function applyRoutingRules(pathname, rules, requestHost) {
|
|
525
541
|
if (!rules?.length) {
|
|
526
542
|
return null;
|
|
@@ -576,7 +592,7 @@ function mergeQueryIntoLocation(destination, requestSearch) {
|
|
|
576
592
|
}
|
|
577
593
|
__name(mergeQueryIntoLocation, "mergeQueryIntoLocation");
|
|
578
594
|
|
|
579
|
-
//
|
|
595
|
+
// ../../home/runner/work/void/void/packages/edge/src/static.ts
|
|
580
596
|
function safeDecodePathname(pathname) {
|
|
581
597
|
let decoded;
|
|
582
598
|
try {
|
|
@@ -765,7 +781,7 @@ function resolveAssetContentType(stored, path) {
|
|
|
765
781
|
}
|
|
766
782
|
__name(resolveAssetContentType, "resolveAssetContentType");
|
|
767
783
|
|
|
768
|
-
//
|
|
784
|
+
// ../../home/runner/work/void/void/packages/isr/src/index.ts
|
|
769
785
|
var ISR_CACHE_KEY_VERSION = "v3";
|
|
770
786
|
function normalizeIsrPath(pathname) {
|
|
771
787
|
let normalized = pathname;
|
|
@@ -849,7 +865,7 @@ function buildIsrEdgeCacheUrl(hostname, pathname, deploymentId, variant, variant
|
|
|
849
865
|
}
|
|
850
866
|
__name(buildIsrEdgeCacheUrl, "buildIsrEdgeCacheUrl");
|
|
851
867
|
|
|
852
|
-
//
|
|
868
|
+
// ../../home/runner/work/void/void/packages/isr/src/core.ts
|
|
853
869
|
var SHARED_CACHE_POLICY_VERSION = 1;
|
|
854
870
|
var SHARED_CACHE_POLICY_HEADER = "x-void-shared-cache-policy";
|
|
855
871
|
function markSharedCachePolicy(headers) {
|
|
@@ -1086,7 +1102,7 @@ function extractPageDataFromHtml(html) {
|
|
|
1086
1102
|
}
|
|
1087
1103
|
__name(extractPageDataFromHtml, "extractPageDataFromHtml");
|
|
1088
1104
|
|
|
1089
|
-
//
|
|
1105
|
+
// ../../home/runner/work/void/void/platform/packages/dispatch/src/isr.ts
|
|
1090
1106
|
var MAX_ISR_VARIANTS_PER_PATH = 200;
|
|
1091
1107
|
async function readIsrCache(env, projectId, deploymentId, host, pathname, originalUrl) {
|
|
1092
1108
|
const key = isrCacheKey(projectId, deploymentId, host, pathname, originalUrl);
|
|
@@ -1191,7 +1207,7 @@ function isrEdgeCacheKeyJson(request, pathname, deploymentId, originalUrl) {
|
|
|
1191
1207
|
}
|
|
1192
1208
|
__name(isrEdgeCacheKeyJson, "isrEdgeCacheKeyJson");
|
|
1193
1209
|
|
|
1194
|
-
//
|
|
1210
|
+
// ../../home/runner/work/void/void/platform/packages/api/src/usage-auth.ts
|
|
1195
1211
|
var USAGE_PROTOCOL_VERSION = PLATFORM_USAGE_PROTOCOL_VERSION;
|
|
1196
1212
|
var USAGE_SIGNING_KEY_KV_KEY = "__void:usage-signing-key:v1";
|
|
1197
1213
|
var SANDBOX_USAGE_RETENTION_MS = 8 * 24 * 60 * 6e4;
|
|
@@ -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([
|
|
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,12 +1245,14 @@ async function signUsageEvent(key, source, eventId, event) {
|
|
|
1229
1245
|
source,
|
|
1230
1246
|
eventId,
|
|
1231
1247
|
event,
|
|
1232
|
-
signature: base64url(
|
|
1248
|
+
signature: base64url(
|
|
1249
|
+
await hmac(signedPayload(USAGE_PROTOCOL_VERSION, source, eventId, event), key)
|
|
1250
|
+
)
|
|
1233
1251
|
};
|
|
1234
1252
|
}
|
|
1235
1253
|
__name(signUsageEvent, "signUsageEvent");
|
|
1236
1254
|
|
|
1237
|
-
//
|
|
1255
|
+
// ../../home/runner/work/void/void/platform/packages/dispatch/src/metering.ts
|
|
1238
1256
|
function recordRequest(env, data) {
|
|
1239
1257
|
env.ANALYTICS.writeDataPoint({
|
|
1240
1258
|
indexes: [data.projectId],
|
|
@@ -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}.
|
|
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
|
|
@@ -1328,14 +1346,14 @@ async function sendUsageEvent(env, data) {
|
|
|
1328
1346
|
}
|
|
1329
1347
|
__name(sendUsageEvent, "sendUsageEvent");
|
|
1330
1348
|
|
|
1331
|
-
//
|
|
1349
|
+
// ../../home/runner/work/void/void/platform/packages/dispatch/src/platform-lifecycle.ts
|
|
1332
1350
|
var PLATFORM_DISABLED_KEY = "__void/platform/disabled/v1";
|
|
1333
1351
|
var PLATFORM_DISABLED_VALUE = "disabled";
|
|
1334
1352
|
|
|
1335
|
-
//
|
|
1353
|
+
// ../../home/runner/work/void/void/platform/packages/dispatch/src/constants.ts
|
|
1336
1354
|
var SITE_DOMAIN = "void.app";
|
|
1337
1355
|
|
|
1338
|
-
//
|
|
1356
|
+
// ../../home/runner/work/void/void/platform/packages/dispatch/src/hostname.ts
|
|
1339
1357
|
function extractSlug(hostname, baseHostname = SITE_DOMAIN) {
|
|
1340
1358
|
const suffix = `.${baseHostname}`;
|
|
1341
1359
|
if (!hostname.endsWith(suffix)) {
|
|
@@ -1352,7 +1370,7 @@ function extractSlug(hostname, baseHostname = SITE_DOMAIN) {
|
|
|
1352
1370
|
}
|
|
1353
1371
|
__name(extractSlug, "extractSlug");
|
|
1354
1372
|
|
|
1355
|
-
//
|
|
1373
|
+
// ../../home/runner/work/void/void/platform/packages/dispatch/src/project-hostname.ts
|
|
1356
1374
|
async function resolveProjectHostname(hostname, env) {
|
|
1357
1375
|
const application = readPlatformApplication(env);
|
|
1358
1376
|
const isWorkersDev = !!application.workersDev && hostname.endsWith(`.${application.workersDev.subdomain}.workers.dev`);
|
|
@@ -1389,7 +1407,7 @@ var applicationEdgeCache = {
|
|
|
1389
1407
|
}
|
|
1390
1408
|
};
|
|
1391
1409
|
|
|
1392
|
-
//
|
|
1410
|
+
// ../../home/runner/work/void/void/platform/packages/dispatch/src/request-type.ts
|
|
1393
1411
|
function hasExtension(pathname) {
|
|
1394
1412
|
return pathname.slice(pathname.lastIndexOf("/") + 1).includes(".");
|
|
1395
1413
|
}
|
|
@@ -1405,7 +1423,7 @@ function classifyDynamicRequestType(pathname, ssr) {
|
|
|
1405
1423
|
}
|
|
1406
1424
|
__name(classifyDynamicRequestType, "classifyDynamicRequestType");
|
|
1407
1425
|
|
|
1408
|
-
//
|
|
1426
|
+
// ../../home/runner/work/void/void/platform/packages/dispatch/src/with-timeout.ts
|
|
1409
1427
|
var DispatchTimeoutError = class extends Error {
|
|
1410
1428
|
static {
|
|
1411
1429
|
__name(this, "DispatchTimeoutError");
|
|
@@ -1557,7 +1575,7 @@ function resolveTimeoutMs(raw, fallback = 1e4) {
|
|
|
1557
1575
|
}
|
|
1558
1576
|
__name(resolveTimeoutMs, "resolveTimeoutMs");
|
|
1559
1577
|
|
|
1560
|
-
//
|
|
1578
|
+
// ../../home/runner/work/void/void/platform/packages/dispatch/src/index.ts
|
|
1561
1579
|
var CLIENT_REVALIDATE_CACHE_CONTROL = "public, max-age=0, must-revalidate";
|
|
1562
1580
|
var STATIC_ASSET_HEDGE_DELAY_MS = 1e3;
|
|
1563
1581
|
var PLATFORM_QUEUE_RETRY_DELAY_SECONDS = 300;
|
|
@@ -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;
|