@void/platform 0.20.1 → 0.20.3
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 +154 -15
- package/dist/index.mjs +349 -22
- package/dist/installer.d.mts +5 -3
- package/dist/installer.mjs +14 -5
- package/dist/runtime/api/README.md +1 -1
- package/dist/runtime/api/index.js +79311 -65332
- package/dist/runtime/api/index.js.map +4 -4
- package/dist/runtime/dispatch/README.md +1 -1
- package/dist/runtime/dispatch/index.js +35 -13
- package/dist/runtime/dispatch/index.js.map +2 -2
- 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 +56 -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 +71 -12
- package/dist/runtime/proxy/README.md +1 -1
- package/dist/runtime/proxy/index.js +1646 -2240
- package/dist/runtime/proxy/index.js.map +4 -4
- package/dist/runtime/tail/README.md +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-24T06:17:14.220Z.
|
|
@@ -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: {
|
|
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 {
|
|
@@ -1090,11 +1106,15 @@ __name(extractPageDataFromHtml, "extractPageDataFromHtml");
|
|
|
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);
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1109
|
+
try {
|
|
1110
|
+
const { value, metadata } = await env.ISR_CACHE.getWithMetadata(
|
|
1111
|
+
key,
|
|
1112
|
+
"arrayBuffer"
|
|
1113
|
+
);
|
|
1114
|
+
return decodeIsrCacheEntry(value, metadata);
|
|
1115
|
+
} catch {
|
|
1116
|
+
return null;
|
|
1117
|
+
}
|
|
1098
1118
|
}
|
|
1099
1119
|
__name(readIsrCache, "readIsrCache");
|
|
1100
1120
|
async function deleteIsrCache(env, projectId, deploymentId, host, pathname, originalUrl) {
|
|
@@ -1219,8 +1239,8 @@ async function readUsageSigningKey(routing) {
|
|
|
1219
1239
|
return routing.get(USAGE_SIGNING_KEY_KV_KEY, { cacheTtl: 60 });
|
|
1220
1240
|
}
|
|
1221
1241
|
__name(readUsageSigningKey, "readUsageSigningKey");
|
|
1222
|
-
function signedPayload(source, eventId, event) {
|
|
1223
|
-
return JSON.stringify([
|
|
1242
|
+
function signedPayload(version, source, eventId, event) {
|
|
1243
|
+
return JSON.stringify([version, source, eventId, event]);
|
|
1224
1244
|
}
|
|
1225
1245
|
__name(signedPayload, "signedPayload");
|
|
1226
1246
|
async function signUsageEvent(key, source, eventId, event) {
|
|
@@ -1229,7 +1249,9 @@ async function signUsageEvent(key, source, eventId, event) {
|
|
|
1229
1249
|
source,
|
|
1230
1250
|
eventId,
|
|
1231
1251
|
event,
|
|
1232
|
-
signature: base64url(
|
|
1252
|
+
signature: base64url(
|
|
1253
|
+
await hmac(signedPayload(USAGE_PROTOCOL_VERSION, source, eventId, event), key)
|
|
1254
|
+
)
|
|
1233
1255
|
};
|
|
1234
1256
|
}
|
|
1235
1257
|
__name(signUsageEvent, "signUsageEvent");
|
|
@@ -1295,7 +1317,7 @@ function recordPlatformLog(env, data) {
|
|
|
1295
1317
|
pathname = new URL(data.url).pathname;
|
|
1296
1318
|
} catch {
|
|
1297
1319
|
}
|
|
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}.
|
|
1320
|
+
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
1321
|
try {
|
|
1300
1322
|
env.LOGS.writeDataPoint({
|
|
1301
1323
|
// `projectKey` is NOT truncated. It is the read key, so a shortened one
|
|
@@ -2020,6 +2042,7 @@ var index_default = {
|
|
|
2020
2042
|
}
|
|
2021
2043
|
const res = new Response(response.body, response);
|
|
2022
2044
|
res.headers.delete("X-Void-No-Match");
|
|
2045
|
+
res.headers.delete(SHARED_CACHE_POLICY_HEADER);
|
|
2023
2046
|
res.headers.set("X-Hosted-By", "void.cloud");
|
|
2024
2047
|
return res;
|
|
2025
2048
|
}, "meter");
|
|
@@ -2085,7 +2108,6 @@ var index_default = {
|
|
|
2085
2108
|
}
|
|
2086
2109
|
}
|
|
2087
2110
|
}
|
|
2088
|
-
ruled.headers.delete(SHARED_CACHE_POLICY_HEADER);
|
|
2089
2111
|
return meter(ruled, failureKind ? { failureKind } : void 0);
|
|
2090
2112
|
}, "finalizeAsset");
|
|
2091
2113
|
const cache = applicationEdgeCache;
|