@void/platform 0.20.3 → 0.21.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
@@ -397,6 +397,7 @@ export declare function createPlatformWorkerConfigs(input: {
397
397
  emailGatewayUrl: string;
398
398
  resources: PlatformProvisionedResourceIds;
399
399
  runtimeEntrypoints: Readonly<Record<"api" | "dispatch" | "proxy" | "tail" | "emailGateway", string>>;
400
+ runtimeApiAssetsDirectory?: string;
400
401
  trafficState?: "enabled" | "sandbox-drain" | "staging";
401
402
  }): PlatformWorkerConfigSet;
402
403
  //#endregion
package/dist/index.mjs CHANGED
@@ -1007,6 +1007,7 @@ function createPlatformWorkerConfigs(input) {
1007
1007
  name: names.apiWorker,
1008
1008
  main: runtimeEntrypoints.api,
1009
1009
  no_bundle: true,
1010
+ ...input.runtimeApiAssetsDirectory ? { assets: { directory: input.runtimeApiAssetsDirectory } } : {},
1010
1011
  compatibility_flags: ["nodejs_compat", ...fetchWorkersDev ? ["global_fetch_strictly_public"] : []],
1011
1012
  placement: { mode: "smart" },
1012
1013
  hyperdrive: [{
@@ -4,6 +4,9 @@ export type PlatformRuntimeArtifact = Readonly<{
4
4
  sha256: string;
5
5
  size: number;
6
6
  }>;
7
+ export declare const PLATFORM_ADMIN_ASSETS_DIRECTORY = "api/assets";
8
+ export declare const PLATFORM_ADMIN_CLIENT_ASSET_PATH: string;
9
+ export declare const PLATFORM_ADMIN_STYLE_ASSET_PATH: string;
7
10
  export type PlatformRuntimeMigration = Readonly<{
8
11
  index: number;
9
12
  sha256: string;
@@ -26,6 +29,10 @@ export type PlatformRuntimeManifest = Readonly<{
26
29
  authenticationProtocolVersion?: 1;
27
30
  applicationRoutingVersion?: 1;
28
31
  artifacts: Readonly<Record<"api" | "dispatch" | "proxy" | "tail", PlatformRuntimeArtifact> & Partial<Record<"emailGateway", PlatformRuntimeArtifact>>>;
32
+ assets?: Readonly<{
33
+ adminClient: PlatformRuntimeArtifact;
34
+ adminStyle?: PlatformRuntimeArtifact;
35
+ }>;
29
36
  emailProtocolVersion?: 1;
30
37
  database: PlatformRuntimeDatabaseManifest;
31
38
  platformVersion: string;
@@ -3,6 +3,9 @@ import { readFileSync, realpathSync, statSync } from "node:fs";
3
3
  import { fileURLToPath } from "node:url";
4
4
  import { dirname, isAbsolute, join, resolve } from "pathslash";
5
5
  //#region src/installer.ts
6
+ const PLATFORM_ADMIN_ASSETS_DIRECTORY = "api/assets";
7
+ const PLATFORM_ADMIN_CLIENT_ASSET_PATH = `${PLATFORM_ADMIN_ASSETS_DIRECTORY}/admin/client.js`;
8
+ const PLATFORM_ADMIN_STYLE_ASSET_PATH = `${PLATFORM_ADMIN_ASSETS_DIRECTORY}/admin/style.css`;
6
9
  const SHA256_PATTERN = /^[0-9a-f]{64}$/;
7
10
  const TAG_PATTERN = /^[0-9]{4}_[a-z0-9_]+$/;
8
11
  function platformDatabaseSchemaDigest(lineage, migrations) {
@@ -32,6 +35,18 @@ function parsePlatformRuntimeManifest(value) {
32
35
  ...artifactsValue.emailGateway === void 0 ? [] : ["emailGateway"]
33
36
  ];
34
37
  const artifacts = Object.fromEntries(artifactNames.map((name) => [name, parseArtifact(artifactsValue[name], name)]));
38
+ let assets;
39
+ if (root.assets !== void 0) {
40
+ const assetsValue = record(root.assets, "runtime manifest assets");
41
+ const adminClient = parseArtifact(assetsValue.adminClient, "admin client asset");
42
+ if (adminClient.path !== PLATFORM_ADMIN_CLIENT_ASSET_PATH) throw new Error(`runtime manifest admin client asset path must be ${PLATFORM_ADMIN_CLIENT_ASSET_PATH}`);
43
+ const adminStyle = assetsValue.adminStyle === void 0 ? void 0 : parseArtifact(assetsValue.adminStyle, "admin style asset");
44
+ if (adminStyle && adminStyle.path !== PLATFORM_ADMIN_STYLE_ASSET_PATH) throw new Error(`runtime manifest admin style asset path must be ${PLATFORM_ADMIN_STYLE_ASSET_PATH}`);
45
+ assets = {
46
+ adminClient,
47
+ ...adminStyle ? { adminStyle } : {}
48
+ };
49
+ }
35
50
  const databaseValue = record(root.database, "runtime manifest database");
36
51
  if (databaseValue.protocolVersion !== 1) throw new Error("runtime manifest database protocolVersion must be 1");
37
52
  const lineage = nonemptyString(databaseValue.lineage, "database lineage");
@@ -65,6 +80,7 @@ function parsePlatformRuntimeManifest(value) {
65
80
  if (rollbackSafeFrom.some((entry) => !prefixDigests.has(entry.schemaDigest))) throw new Error("runtime manifest database rollback compatibility must reference this migration lineage");
66
81
  return {
67
82
  artifacts,
83
+ ...assets ? { assets } : {},
68
84
  ...root.authenticationProtocolVersion === 1 ? { authenticationProtocolVersion: 1 } : {},
69
85
  ...root.emailProtocolVersion === 1 ? { emailProtocolVersion: 1 } : {},
70
86
  ...root.applicationRoutingVersion === 1 ? { applicationRoutingVersion: 1 } : {},
@@ -182,4 +198,4 @@ function sha256(value, name) {
182
198
  return value;
183
199
  }
184
200
  //#endregion
185
- export { getPlatformRuntimeDirectory, parsePlatformRuntimeManifest, platformDatabaseSchemaDigest, readPlatformRuntimeManifest, resolvePlatformRuntime };
201
+ export { PLATFORM_ADMIN_ASSETS_DIRECTORY, PLATFORM_ADMIN_CLIENT_ASSET_PATH, PLATFORM_ADMIN_STYLE_ASSET_PATH, getPlatformRuntimeDirectory, parsePlatformRuntimeManifest, platformDatabaseSchemaDigest, readPlatformRuntimeManifest, resolvePlatformRuntime };
@@ -1 +1 @@
1
- This folder contains the built output assets for the worker "void-runtime-build-api" generated at 2026-09-24T06:17:05.394Z.
1
+ This folder contains the built output assets for the worker "void-runtime-build-api" generated at 2026-09-29T09:50:57.828Z.