@air-jam/sdk 0.1.4 → 0.9.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/LICENSE +21 -0
- package/README.md +627 -57
- package/dist/agent-tooling-BSMGBix9.d.cts +123 -0
- package/dist/agent-tooling-BSMGBix9.d.ts +123 -0
- package/dist/agent-tooling.cjs +83 -0
- package/dist/agent-tooling.cjs.map +1 -0
- package/dist/agent-tooling.d.cts +2 -0
- package/dist/agent-tooling.d.ts +2 -0
- package/dist/agent-tooling.js +17 -0
- package/dist/agent-tooling.js.map +1 -0
- package/dist/arcade/bridge/controller.cjs +749 -0
- package/dist/arcade/bridge/controller.cjs.map +1 -0
- package/dist/arcade/bridge/controller.d.cts +85 -0
- package/dist/arcade/bridge/controller.d.ts +85 -0
- package/dist/arcade/bridge/controller.js +33 -0
- package/dist/arcade/bridge/controller.js.map +1 -0
- package/dist/arcade/bridge/host.cjs +421 -0
- package/dist/arcade/bridge/host.cjs.map +1 -0
- package/dist/arcade/bridge/host.d.cts +73 -0
- package/dist/arcade/bridge/host.d.ts +73 -0
- package/dist/arcade/bridge/host.js +25 -0
- package/dist/arcade/bridge/host.js.map +1 -0
- package/dist/arcade/bridge/iframe.cjs +453 -0
- package/dist/arcade/bridge/iframe.cjs.map +1 -0
- package/dist/arcade/bridge/iframe.d.cts +80 -0
- package/dist/arcade/bridge/iframe.d.ts +80 -0
- package/dist/arcade/bridge/iframe.js +28 -0
- package/dist/arcade/bridge/iframe.js.map +1 -0
- package/dist/arcade/bridge.cjs +1067 -0
- package/dist/arcade/bridge.cjs.map +1 -0
- package/dist/arcade/bridge.d.cts +11 -0
- package/dist/arcade/bridge.d.ts +11 -0
- package/dist/arcade/bridge.js +76 -0
- package/dist/arcade/bridge.js.map +1 -0
- package/dist/arcade/host.cjs +488 -0
- package/dist/arcade/host.cjs.map +1 -0
- package/dist/arcade/host.d.cts +19 -0
- package/dist/arcade/host.d.ts +19 -0
- package/dist/arcade/host.js +13 -0
- package/dist/arcade/host.js.map +1 -0
- package/dist/arcade/surface.cjs +113 -0
- package/dist/arcade/surface.cjs.map +1 -0
- package/dist/arcade/surface.d.cts +14 -0
- package/dist/arcade/surface.d.ts +14 -0
- package/dist/arcade/surface.js +27 -0
- package/dist/arcade/surface.js.map +1 -0
- package/dist/arcade/url.cjs +363 -0
- package/dist/arcade/url.cjs.map +1 -0
- package/dist/arcade/url.d.cts +68 -0
- package/dist/arcade/url.d.ts +68 -0
- package/dist/arcade/url.js +28 -0
- package/dist/arcade/url.js.map +1 -0
- package/dist/arcade-runtime-url-BW-MUAOY.d.cts +28 -0
- package/dist/arcade-runtime-url-l8qj01Pg.d.ts +28 -0
- package/dist/arcade-surface-identity-CQxDpn_w.d.cts +16 -0
- package/dist/arcade-surface-identity-CQxDpn_w.d.ts +16 -0
- package/dist/arcade.cjs +1565 -0
- package/dist/arcade.cjs.map +1 -0
- package/dist/arcade.d.cts +18 -0
- package/dist/arcade.d.ts +18 -0
- package/dist/arcade.js +122 -0
- package/dist/arcade.js.map +1 -0
- package/dist/capabilities.cjs +39 -0
- package/dist/capabilities.cjs.map +1 -0
- package/dist/capabilities.d.cts +31 -0
- package/dist/capabilities.d.ts +31 -0
- package/dist/capabilities.js +12 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/chunk-2432OL7L.js +193 -0
- package/dist/chunk-2432OL7L.js.map +1 -0
- package/dist/chunk-2J65FXEP.js +41 -0
- package/dist/chunk-2J65FXEP.js.map +1 -0
- package/dist/chunk-32NYL7XI.js +539 -0
- package/dist/chunk-32NYL7XI.js.map +1 -0
- package/dist/chunk-3USU7GY2.js +54 -0
- package/dist/chunk-3USU7GY2.js.map +1 -0
- package/dist/chunk-BE6Z4SIT.js +65 -0
- package/dist/chunk-BE6Z4SIT.js.map +1 -0
- package/dist/chunk-CQUG24WX.js +249 -0
- package/dist/chunk-CQUG24WX.js.map +1 -0
- package/dist/chunk-D3X4MN4U.js +288 -0
- package/dist/chunk-D3X4MN4U.js.map +1 -0
- package/dist/chunk-EVZJA6RN.js +140 -0
- package/dist/chunk-EVZJA6RN.js.map +1 -0
- package/dist/chunk-HFWRZVZ3.js +1438 -0
- package/dist/chunk-HFWRZVZ3.js.map +1 -0
- package/dist/chunk-IKKDONQL.js +1 -0
- package/dist/chunk-IKKDONQL.js.map +1 -0
- package/dist/chunk-JTF47B56.js +1 -0
- package/dist/chunk-JTF47B56.js.map +1 -0
- package/dist/chunk-LIXPF4P6.js +22 -0
- package/dist/chunk-LIXPF4P6.js.map +1 -0
- package/dist/chunk-MKBASO6X.js +216 -0
- package/dist/chunk-MKBASO6X.js.map +1 -0
- package/dist/chunk-MPDMJIX5.js +1 -0
- package/dist/chunk-MPDMJIX5.js.map +1 -0
- package/dist/chunk-NCL6WJCL.js +91 -0
- package/dist/chunk-NCL6WJCL.js.map +1 -0
- package/dist/chunk-NU5W6VAV.js +126 -0
- package/dist/chunk-NU5W6VAV.js.map +1 -0
- package/dist/chunk-TGRTEWYV.js +195 -0
- package/dist/chunk-TGRTEWYV.js.map +1 -0
- package/dist/chunk-VDRNNGHX.js +184 -0
- package/dist/chunk-VDRNNGHX.js.map +1 -0
- package/dist/chunk-VN5LDWVN.js +32 -0
- package/dist/chunk-VN5LDWVN.js.map +1 -0
- package/dist/chunk-W2VK36RO.js +11 -0
- package/dist/chunk-W2VK36RO.js.map +1 -0
- package/dist/chunk-X24K52DG.js +12 -0
- package/dist/chunk-X24K52DG.js.map +1 -0
- package/dist/chunk-XLUWV45V.js +25 -0
- package/dist/chunk-XLUWV45V.js.map +1 -0
- package/dist/chunk-Y4RAPKKB.js +238 -0
- package/dist/chunk-Y4RAPKKB.js.map +1 -0
- package/dist/chunk-YXHH3MQT.js +230 -0
- package/dist/chunk-YXHH3MQT.js.map +1 -0
- package/dist/chunk-ZLPL2R3R.js +183 -0
- package/dist/chunk-ZLPL2R3R.js.map +1 -0
- package/dist/chunk-ZTQ5SP4H.js +9 -0
- package/dist/chunk-ZTQ5SP4H.js.map +1 -0
- package/dist/controller-Bod8YYr1.d.cts +172 -0
- package/dist/controller-DxVchfiA.d.ts +172 -0
- package/dist/dev-log-events-CVAM29hx.d.cts +123 -0
- package/dist/dev-log-events-CVAM29hx.d.ts +123 -0
- package/dist/handshake-CC_LrK5g.d.cts +31 -0
- package/dist/handshake-CC_LrK5g.d.ts +31 -0
- package/dist/host-8hmq_Sgc.d.cts +109 -0
- package/dist/host-Cw-N6e-5.d.ts +109 -0
- package/dist/index.cjs +8507 -3523
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +676 -1070
- package/dist/index.d.ts +676 -1070
- package/dist/index.js +4890 -3196
- package/dist/index.js.map +1 -1
- package/dist/metadata.cjs +114 -0
- package/dist/metadata.cjs.map +1 -0
- package/dist/metadata.d.cts +95 -0
- package/dist/metadata.d.ts +95 -0
- package/dist/metadata.js +83 -0
- package/dist/metadata.js.map +1 -0
- package/dist/notices-CnGaaS8B.d.ts +38 -0
- package/dist/notices-NyDM5Mtz.d.cts +38 -0
- package/dist/platform-machine.cjs +425 -0
- package/dist/platform-machine.cjs.map +1 -0
- package/dist/platform-machine.d.cts +1183 -0
- package/dist/platform-machine.d.ts +1183 -0
- package/dist/platform-machine.js +309 -0
- package/dist/platform-machine.js.map +1 -0
- package/dist/platform-settings-cuor3i11.d.cts +48 -0
- package/dist/platform-settings-cuor3i11.d.ts +48 -0
- package/dist/prefabs.cjs +36 -0
- package/dist/prefabs.cjs.map +1 -0
- package/dist/prefabs.d.cts +49 -0
- package/dist/prefabs.d.ts +49 -0
- package/dist/prefabs.js +8 -0
- package/dist/prefabs.js.map +1 -0
- package/dist/preview.cjs +2609 -0
- package/dist/preview.cjs.map +1 -0
- package/dist/preview.d.cts +155 -0
- package/dist/preview.d.ts +155 -0
- package/dist/preview.js +1671 -0
- package/dist/preview.js.map +1 -0
- package/dist/protocol.cjs +621 -54
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.d.cts +76 -240
- package/dist/protocol.d.ts +76 -240
- package/dist/protocol.js +100 -2
- package/dist/protocol.js.map +1 -1
- package/dist/realtime-client-Cu8yVJFw.d.cts +15 -0
- package/dist/realtime-client-Cu8yVJFw.d.ts +15 -0
- package/dist/release.cjs +143 -0
- package/dist/release.cjs.map +1 -0
- package/dist/release.d.cts +64 -0
- package/dist/release.d.ts +64 -0
- package/dist/release.js +43 -0
- package/dist/release.js.map +1 -0
- package/dist/standard-match-phase-BucA5dYo.d.ts +44 -0
- package/dist/standard-match-phase-U2ra8J-0.d.cts +44 -0
- package/dist/sync-B6QsNrXz.d.cts +125 -0
- package/dist/sync-B6QsNrXz.d.ts +125 -0
- package/dist/ui.cjs +2827 -0
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.cts +320 -0
- package/dist/ui.d.ts +320 -0
- package/dist/ui.js +1718 -0
- package/dist/ui.js.map +1 -0
- package/dist/url-policy-C89zxgw9.d.cts +9 -0
- package/dist/url-policy-C89zxgw9.d.ts +9 -0
- package/package.json +149 -11
- package/src/agent/agent-action.ts +304 -0
- package/src/agent/agent-contract.ts +180 -0
- package/src/agent-tooling.ts +20 -0
- package/src/arcade/bridge/controller.ts +15 -0
- package/src/arcade/bridge/host.ts +12 -0
- package/src/arcade/bridge/iframe.ts +61 -0
- package/src/arcade/bridge.ts +3 -0
- package/src/arcade/host.ts +1 -0
- package/src/arcade/surface.ts +4 -0
- package/src/arcade/url.ts +60 -0
- package/src/arcade.ts +4 -0
- package/src/audio/audio-manager.ts +162 -171
- package/src/audio/hooks.tsx +218 -97
- package/src/audio/index.ts +1 -1
- package/src/audio/music.tsx +139 -0
- package/src/capabilities/manifest.ts +71 -0
- package/src/capabilities.ts +12 -0
- package/src/components/connection-status-pill.tsx +55 -0
- package/src/components/controller-player-name-field.tsx +119 -0
- package/src/components/controller-primary-action.tsx +58 -0
- package/src/components/host-mute-button.tsx +49 -0
- package/src/components/join-qr-overlay.tsx +133 -0
- package/src/components/join-url-action-buttons.tsx +95 -0
- package/src/components/join-url-controls.tsx +58 -0
- package/src/components/join-url-field.tsx +52 -0
- package/src/components/lifecycle-action-group.tsx +129 -0
- package/src/components/player-avatar-strip.tsx +65 -0
- package/src/components/player-avatar.tsx +42 -13
- package/src/components/room-qr-code.tsx +125 -0
- package/src/components/runtime-shell-header.tsx +37 -0
- package/src/components/shell-classes.ts +19 -0
- package/src/components/surface-orientation-layout.ts +60 -0
- package/src/components/surface-viewport-layout.ts +268 -0
- package/src/components/surface-viewport.tsx +314 -0
- package/src/components/ui/button.tsx +4 -6
- package/src/components/ui/slider.tsx +1 -1
- package/src/components/volume-controls.tsx +65 -6
- package/src/context/air-jam-context.tsx +209 -161
- package/src/context/index.ts +2 -2
- package/src/context/session-providers.tsx +77 -0
- package/src/context/session-scope.ts +64 -0
- package/src/context/socket-manager.ts +6 -24
- package/src/contracts/v2/bridge.ts +261 -0
- package/src/contracts/v2/handshake.ts +40 -0
- package/src/contracts/v2/index.ts +2 -0
- package/src/dev/browser-log-sink.ts +912 -0
- package/src/diagnostics.ts +128 -0
- package/src/events.ts +7 -34
- package/src/hooks/internal/use-controller-runtime-api.ts +875 -0
- package/src/hooks/internal/use-host-runtime-api.ts +1051 -0
- package/src/hooks/internal/use-runtime-control-contract.ts +15 -0
- package/src/hooks/internal/use-runtime-inspection-contract.ts +16 -0
- package/src/hooks/internal/use-runtime-observability-contract.ts +24 -0
- package/src/hooks/use-air-jam-controller.ts +155 -475
- package/src/hooks/use-air-jam-host.ts +156 -485
- package/src/hooks/use-connection-status.ts +8 -0
- package/src/hooks/use-controller-lifecycle-intents.ts +27 -0
- package/src/hooks/use-controller-lifecycle-permissions.ts +36 -0
- package/src/hooks/use-controller-shell-status.ts +40 -0
- package/src/hooks/use-controller-tick.ts +65 -0
- package/src/hooks/use-controller-toasts.ts +116 -0
- package/src/hooks/use-get-input.ts +8 -5
- package/src/hooks/use-host-arcade-restore.ts +30 -0
- package/src/hooks/use-host-join-controls.ts +152 -0
- package/src/hooks/use-host-tick.ts +171 -0
- package/src/hooks/use-input-writer.ts +83 -0
- package/src/hooks/use-lifecycle-action-group-model.ts +98 -0
- package/src/hooks/use-players.ts +12 -0
- package/src/hooks/use-room.ts +22 -0
- package/src/hooks/use-send-signal.ts +6 -2
- package/src/index.ts +205 -31
- package/src/internal/input-manager.ts +195 -215
- package/src/lifecycle/index.ts +9 -0
- package/src/lifecycle/standard-match-phase.ts +32 -0
- package/src/metadata/manifest.ts +152 -0
- package/src/metadata.ts +12 -0
- package/src/platform-machine.ts +475 -0
- package/src/prefabs/types.ts +82 -0
- package/src/prefabs.ts +12 -0
- package/src/preview/host-workspace.tsx +59 -0
- package/src/preview/identity.ts +66 -0
- package/src/preview/layout.ts +223 -0
- package/src/preview/manager.ts +577 -0
- package/src/preview/messages.ts +26 -0
- package/src/preview/ownership.ts +81 -0
- package/src/preview/url.ts +117 -0
- package/src/preview/window.tsx +490 -0
- package/src/preview/workspace.tsx +678 -0
- package/src/preview.ts +42 -0
- package/src/protocol/arcade-platform-actions.ts +29 -0
- package/src/protocol/controller.ts +187 -0
- package/src/protocol/core.ts +23 -0
- package/src/protocol/dev-log-events.ts +222 -0
- package/src/protocol/errors.ts +21 -0
- package/src/protocol/host-grant.ts +185 -0
- package/src/protocol/host.ts +138 -0
- package/src/protocol/notices.ts +43 -0
- package/src/protocol/signals.ts +38 -0
- package/src/protocol/socket-events.ts +154 -0
- package/src/protocol/sync.ts +121 -0
- package/src/protocol/url-policy.ts +63 -0
- package/src/protocol.ts +12 -386
- package/src/qrcode.d.ts +16 -0
- package/src/release.ts +99 -0
- package/src/runtime/air-jam-config.ts +287 -0
- package/src/runtime/air-jam-error-boundary.tsx +672 -0
- package/src/runtime/arcade-bridge-request-surface.ts +15 -0
- package/src/runtime/arcade-runtime-url.ts +95 -0
- package/src/runtime/arcade-surface-identity.ts +16 -0
- package/src/runtime/contracts/control.ts +68 -0
- package/src/runtime/contracts/inspection.ts +165 -0
- package/src/runtime/contracts/observability.ts +94 -0
- package/src/runtime/controller-bridge.ts +451 -0
- package/src/runtime/controller-identity.ts +132 -0
- package/src/runtime/controller-presentation.ts +24 -0
- package/src/runtime/controller-realtime-client.ts +591 -0
- package/src/runtime/create-air-jam-app.tsx +260 -0
- package/src/runtime/dev-runtime-events.ts +36 -0
- package/src/runtime/embedded-runtime-adapters.ts +68 -0
- package/src/runtime/host-bridge.ts +388 -0
- package/src/runtime/host-realtime-client.ts +550 -0
- package/src/runtime/iframe-bridge.ts +135 -0
- package/src/runtime/realtime-client.ts +20 -0
- package/src/runtime/router-basename.ts +25 -0
- package/src/runtime/runtime-owner-contexts.tsx +4 -0
- package/src/runtime/runtime-session-params.ts +169 -0
- package/src/runtime/sdk-version.ts +6 -0
- package/src/runtime/session-runtimes.tsx +188 -0
- package/src/runtime/validate-arcade-bridge-attach.ts +14 -0
- package/src/runtime-control.ts +10 -0
- package/src/runtime-inspection.ts +14 -0
- package/src/runtime-observability.ts +9 -0
- package/src/settings/platform-settings-bridge.ts +336 -0
- package/src/settings/platform-settings-runtime.tsx +387 -0
- package/src/settings/platform-settings.ts +288 -0
- package/src/state/connection-store.ts +80 -12
- package/src/store/air-jam-store-domain-constants.ts +4 -0
- package/src/store/create-air-jam-store.ts +1094 -227
- package/src/styles.css +4 -38
- package/src/ui.ts +29 -0
- package/src/utils/is-rpc-serializable.ts +56 -0
- package/src/utils/player-avatar-url.ts +48 -0
- package/src/utils/url-builder.ts +7 -0
- package/dist/.tsbuildinfo +0 -1
- package/dist/chunk-B5DURUWT.js +0 -80
- package/dist/chunk-B5DURUWT.js.map +0 -1
- package/src/AirJamClient.ts +0 -224
- package/src/audio/volume-store.ts +0 -124
- package/src/components/controller-shell.tsx +0 -346
- package/src/components/host-shell.tsx +0 -520
- package/src/components/qr-scanner-dialog.tsx +0 -373
- package/src/components/ui/alert.tsx +0 -66
- package/src/components/ui/avatar.tsx +0 -46
- package/src/components/ui/badge.tsx +0 -47
- package/src/components/ui/card.tsx +0 -92
- package/src/components/ui/dialog.tsx +0 -122
- package/src/components/ui/tabs.tsx +0 -64
- package/src/hooks/use-air-jam-shell.ts +0 -379
- package/src/hooks/use-fullscreen.ts +0 -108
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Canonical game metadata contract.
|
|
5
|
+
*
|
|
6
|
+
* This is the typed shape a creator declares once for their game. The platform
|
|
7
|
+
* and Arcade consume it to render catalog entries, validate compatibility, and
|
|
8
|
+
* (later) power filtering, moderation, and recommendation.
|
|
9
|
+
*
|
|
10
|
+
* Scope is intentionally narrow at v1. Additions require a schema change so
|
|
11
|
+
* consumers can keep assuming the shape is stable. External creators should be
|
|
12
|
+
* able to target this contract before the first third-party catalog submission.
|
|
13
|
+
*
|
|
14
|
+
* This contract is distinct from `@air-jam/sdk/capabilities` — capabilities
|
|
15
|
+
* describe what a game exposes at runtime (actions, state, evaluation seams);
|
|
16
|
+
* metadata describes what the catalog needs to present the game.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/** Broad taxonomy for catalog filtering and landing-page grouping. */
|
|
20
|
+
export const GAME_CATEGORIES = [
|
|
21
|
+
"party",
|
|
22
|
+
"arcade",
|
|
23
|
+
"puzzle",
|
|
24
|
+
"music",
|
|
25
|
+
"sports",
|
|
26
|
+
"strategy",
|
|
27
|
+
"creative",
|
|
28
|
+
"showcase",
|
|
29
|
+
"other",
|
|
30
|
+
] as const;
|
|
31
|
+
|
|
32
|
+
export type AirJamGameCategory = (typeof GAME_CATEGORIES)[number];
|
|
33
|
+
|
|
34
|
+
/** How the controller is expected to be used. Multi-select, at least one entry. */
|
|
35
|
+
export const GAME_INPUT_MODALITIES = [
|
|
36
|
+
"buttons",
|
|
37
|
+
"joystick",
|
|
38
|
+
"touch",
|
|
39
|
+
"motion",
|
|
40
|
+
"text",
|
|
41
|
+
"audio",
|
|
42
|
+
] as const;
|
|
43
|
+
|
|
44
|
+
export type AirJamGameInputModality = (typeof GAME_INPUT_MODALITIES)[number];
|
|
45
|
+
|
|
46
|
+
const slugSchema = z
|
|
47
|
+
.string()
|
|
48
|
+
.min(2)
|
|
49
|
+
.max(64)
|
|
50
|
+
.regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, {
|
|
51
|
+
message: "slug must be lowercase kebab-case (e.g. `my-cool-game`)",
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const playerCountSchema = z.number().int().min(1).max(16);
|
|
55
|
+
|
|
56
|
+
// Accept any npm-style semver range (e.g. "^1.0.0", ">=1.2 <2", "1.x"). We do
|
|
57
|
+
// not resolve it here — consumers like the platform will compare against the
|
|
58
|
+
// live SDK version at listing/build time.
|
|
59
|
+
const semverRangeSchema = z
|
|
60
|
+
.string()
|
|
61
|
+
.min(1)
|
|
62
|
+
.max(64)
|
|
63
|
+
.regex(/^[\^~<>=\d][\d\w\s.\-+<>=^~|*x]*$/, {
|
|
64
|
+
message: "supportedSdkRange must be a valid semver range",
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const maintainerSchema = z.object({
|
|
68
|
+
name: z.string().min(1).max(80),
|
|
69
|
+
handle: z.string().min(1).max(80).optional(),
|
|
70
|
+
url: z.string().url().max(500).optional(),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export type AirJamGameMaintainer = z.infer<typeof maintainerSchema>;
|
|
74
|
+
|
|
75
|
+
export const airJamGameMetadataSchema = z
|
|
76
|
+
.object({
|
|
77
|
+
/** Fixed identifier for the contract version. Lets us evolve safely later. */
|
|
78
|
+
version: z.literal(1).default(1),
|
|
79
|
+
/** Stable URL-safe slug. */
|
|
80
|
+
slug: slugSchema,
|
|
81
|
+
/** Human-readable display name shown in the catalog. */
|
|
82
|
+
name: z.string().min(1).max(80),
|
|
83
|
+
/** One- to two-sentence description for catalog cards. Keep under ~240 chars. */
|
|
84
|
+
tagline: z.string().min(1).max(240),
|
|
85
|
+
/** Broad taxonomy category. Use `other` sparingly. */
|
|
86
|
+
category: z.enum(GAME_CATEGORIES),
|
|
87
|
+
/** Inclusive minimum player count. */
|
|
88
|
+
minPlayers: playerCountSchema,
|
|
89
|
+
/** Inclusive maximum player count. */
|
|
90
|
+
maxPlayers: playerCountSchema,
|
|
91
|
+
/** At least one input modality the controller uses. */
|
|
92
|
+
inputModalities: z
|
|
93
|
+
.array(z.enum(GAME_INPUT_MODALITIES))
|
|
94
|
+
.min(1)
|
|
95
|
+
.max(GAME_INPUT_MODALITIES.length),
|
|
96
|
+
/** Semver range of `@air-jam/sdk` this game is known to run against. */
|
|
97
|
+
supportedSdkRange: semverRangeSchema,
|
|
98
|
+
/** The person or team responsible for this game. */
|
|
99
|
+
maintainer: maintainerSchema,
|
|
100
|
+
/** Optional content advisory for age-sensitive catalog sorting. */
|
|
101
|
+
ageRating: z.enum(["all-ages", "teen", "mature"]).optional(),
|
|
102
|
+
/** Optional short list of keyword tags for search. */
|
|
103
|
+
tags: z.array(z.string().min(1).max(32)).max(12).optional(),
|
|
104
|
+
})
|
|
105
|
+
.refine((value) => value.minPlayers <= value.maxPlayers, {
|
|
106
|
+
message: "minPlayers must be <= maxPlayers",
|
|
107
|
+
path: ["minPlayers"],
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export type AirJamGameMetadata = z.infer<typeof airJamGameMetadataSchema>;
|
|
111
|
+
|
|
112
|
+
export type DefineAirJamGameMetadataInput = Omit<
|
|
113
|
+
z.input<typeof airJamGameMetadataSchema>,
|
|
114
|
+
"inputModalities" | "tags" | "version"
|
|
115
|
+
> & {
|
|
116
|
+
inputModalities: readonly AirJamGameInputModality[];
|
|
117
|
+
tags?: readonly string[];
|
|
118
|
+
version?: 1;
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Validate and freeze a metadata object. Throws `ZodError` on invalid input.
|
|
123
|
+
*
|
|
124
|
+
* Call this once in `airjam.config.ts` (or the equivalent entry for your game)
|
|
125
|
+
* so the shape is checked at build time instead of at catalog ingestion.
|
|
126
|
+
*/
|
|
127
|
+
export const defineAirJamGameMetadata = (
|
|
128
|
+
input: DefineAirJamGameMetadataInput,
|
|
129
|
+
): AirJamGameMetadata =>
|
|
130
|
+
Object.freeze(
|
|
131
|
+
airJamGameMetadataSchema.parse({
|
|
132
|
+
version: 1,
|
|
133
|
+
...input,
|
|
134
|
+
}),
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Lenient parser for read-side consumption (e.g. the platform reading stored
|
|
139
|
+
* metadata). Returns a `{ ok, data } | { ok, error }` discriminated result so
|
|
140
|
+
* the caller can surface validation failures without throwing.
|
|
141
|
+
*/
|
|
142
|
+
export const parseAirJamGameMetadata = (
|
|
143
|
+
value: unknown,
|
|
144
|
+
):
|
|
145
|
+
| { ok: true; data: AirJamGameMetadata }
|
|
146
|
+
| { ok: false; error: z.ZodError } => {
|
|
147
|
+
const result = airJamGameMetadataSchema.safeParse(value);
|
|
148
|
+
if (result.success) {
|
|
149
|
+
return { ok: true, data: result.data };
|
|
150
|
+
}
|
|
151
|
+
return { ok: false, error: result.error };
|
|
152
|
+
};
|
package/src/metadata.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export {
|
|
2
|
+
GAME_CATEGORIES,
|
|
3
|
+
GAME_INPUT_MODALITIES,
|
|
4
|
+
airJamGameMetadataSchema,
|
|
5
|
+
defineAirJamGameMetadata,
|
|
6
|
+
parseAirJamGameMetadata,
|
|
7
|
+
type AirJamGameCategory,
|
|
8
|
+
type AirJamGameInputModality,
|
|
9
|
+
type AirJamGameMaintainer,
|
|
10
|
+
type AirJamGameMetadata,
|
|
11
|
+
type DefineAirJamGameMetadataInput,
|
|
12
|
+
} from "./metadata/manifest";
|
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import {
|
|
3
|
+
gameReleaseSourceKindSchema,
|
|
4
|
+
gameReleaseStatusSchema,
|
|
5
|
+
releaseCheckKindSchema,
|
|
6
|
+
releaseCheckStatusSchema,
|
|
7
|
+
releaseReportSourceSchema,
|
|
8
|
+
releaseReportStatusSchema,
|
|
9
|
+
} from "./release";
|
|
10
|
+
|
|
11
|
+
export const platformMachineErrorCodeValues = [
|
|
12
|
+
"invalid_request",
|
|
13
|
+
"authorization_pending",
|
|
14
|
+
"expired_token",
|
|
15
|
+
"access_denied",
|
|
16
|
+
"invalid_token",
|
|
17
|
+
"unauthorized",
|
|
18
|
+
"forbidden",
|
|
19
|
+
"not_found",
|
|
20
|
+
"conflict",
|
|
21
|
+
"validation_failed",
|
|
22
|
+
"rate_limited",
|
|
23
|
+
] as const;
|
|
24
|
+
|
|
25
|
+
export const platformMachineErrorCodeSchema = z.enum(
|
|
26
|
+
platformMachineErrorCodeValues,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export type PlatformMachineErrorCode = z.infer<
|
|
30
|
+
typeof platformMachineErrorCodeSchema
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
export const platformMachineApiErrorSchema = z.object({
|
|
34
|
+
error: platformMachineErrorCodeSchema,
|
|
35
|
+
message: z.string().min(1),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export type PlatformMachineApiError = z.infer<
|
|
39
|
+
typeof platformMachineApiErrorSchema
|
|
40
|
+
>;
|
|
41
|
+
|
|
42
|
+
export const platformMachineDeviceGrantStatusValues = [
|
|
43
|
+
"pending",
|
|
44
|
+
"approved",
|
|
45
|
+
"completed",
|
|
46
|
+
] as const;
|
|
47
|
+
|
|
48
|
+
export const platformMachineDeviceGrantStatusSchema = z.enum(
|
|
49
|
+
platformMachineDeviceGrantStatusValues,
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
export type PlatformMachineDeviceGrantStatus = z.infer<
|
|
53
|
+
typeof platformMachineDeviceGrantStatusSchema
|
|
54
|
+
>;
|
|
55
|
+
|
|
56
|
+
export const platformMachineUserSchema = z.object({
|
|
57
|
+
id: z.string().min(1),
|
|
58
|
+
name: z.string().min(1),
|
|
59
|
+
email: z.string().email(),
|
|
60
|
+
role: z.enum(["creator", "ops_admin"]),
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export type PlatformMachineUser = z.infer<typeof platformMachineUserSchema>;
|
|
64
|
+
|
|
65
|
+
export const platformMachineSessionSchema = z.object({
|
|
66
|
+
id: z.string().min(1),
|
|
67
|
+
token: z.string().min(1),
|
|
68
|
+
expiresAt: z.string().min(1),
|
|
69
|
+
createdAt: z.string().min(1),
|
|
70
|
+
userAgent: z.string().min(1),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
export type PlatformMachineSession = z.infer<
|
|
74
|
+
typeof platformMachineSessionSchema
|
|
75
|
+
>;
|
|
76
|
+
|
|
77
|
+
export const platformMachineDeviceStartInputSchema = z.object({
|
|
78
|
+
clientName: z.string().trim().min(1).max(120).optional(),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export type PlatformMachineDeviceStartInput = z.infer<
|
|
82
|
+
typeof platformMachineDeviceStartInputSchema
|
|
83
|
+
>;
|
|
84
|
+
|
|
85
|
+
export const platformMachineDeviceStartResultSchema = z.object({
|
|
86
|
+
deviceCode: z.string().min(1),
|
|
87
|
+
userCode: z.string().min(1),
|
|
88
|
+
verificationUrl: z.string().url(),
|
|
89
|
+
verificationUriComplete: z.string().url(),
|
|
90
|
+
expiresAt: z.string().min(1),
|
|
91
|
+
intervalSeconds: z.number().int().positive(),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
export type PlatformMachineDeviceStartResult = z.infer<
|
|
95
|
+
typeof platformMachineDeviceStartResultSchema
|
|
96
|
+
>;
|
|
97
|
+
|
|
98
|
+
export const platformMachineDevicePollInputSchema = z.object({
|
|
99
|
+
deviceCode: z.string().trim().min(1),
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
export type PlatformMachineDevicePollInput = z.infer<
|
|
103
|
+
typeof platformMachineDevicePollInputSchema
|
|
104
|
+
>;
|
|
105
|
+
|
|
106
|
+
export const platformMachineDevicePollResultSchema = z.object({
|
|
107
|
+
platformBaseUrl: z.string().url(),
|
|
108
|
+
user: platformMachineUserSchema,
|
|
109
|
+
session: platformMachineSessionSchema,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
export type PlatformMachineDevicePollResult = z.infer<
|
|
113
|
+
typeof platformMachineDevicePollResultSchema
|
|
114
|
+
>;
|
|
115
|
+
|
|
116
|
+
export const platformMachineMeResultSchema = z.object({
|
|
117
|
+
platformBaseUrl: z.string().url(),
|
|
118
|
+
user: platformMachineUserSchema,
|
|
119
|
+
session: platformMachineSessionSchema.omit({ token: true }),
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export type PlatformMachineMeResult = z.infer<
|
|
123
|
+
typeof platformMachineMeResultSchema
|
|
124
|
+
>;
|
|
125
|
+
|
|
126
|
+
export const platformMachineLogoutResultSchema = z.object({
|
|
127
|
+
ok: z.literal(true),
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
export type PlatformMachineLogoutResult = z.infer<
|
|
131
|
+
typeof platformMachineLogoutResultSchema
|
|
132
|
+
>;
|
|
133
|
+
|
|
134
|
+
export const platformMachineOwnedGameSummarySchema = z.object({
|
|
135
|
+
id: z.string().min(1),
|
|
136
|
+
slug: z.string().min(1).nullable(),
|
|
137
|
+
name: z.string().min(1),
|
|
138
|
+
description: z.string().nullable(),
|
|
139
|
+
url: z.string().url().nullable(),
|
|
140
|
+
arcadeVisibility: z.enum(["hidden", "listed"]),
|
|
141
|
+
sourceUrl: z.string().url().nullable(),
|
|
142
|
+
templateId: z.string().min(1).nullable(),
|
|
143
|
+
createdAt: z.string().min(1),
|
|
144
|
+
updatedAt: z.string().min(1),
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
export type PlatformMachineOwnedGameSummary = z.infer<
|
|
148
|
+
typeof platformMachineOwnedGameSummarySchema
|
|
149
|
+
>;
|
|
150
|
+
|
|
151
|
+
export const platformMachineGameMediaKindSchema = z.enum([
|
|
152
|
+
"thumbnail",
|
|
153
|
+
"cover",
|
|
154
|
+
"preview_video",
|
|
155
|
+
]);
|
|
156
|
+
|
|
157
|
+
export type PlatformMachineGameMediaKind = z.infer<
|
|
158
|
+
typeof platformMachineGameMediaKindSchema
|
|
159
|
+
>;
|
|
160
|
+
|
|
161
|
+
export const platformMachineGameMediaStatusSchema = z.enum([
|
|
162
|
+
"draft",
|
|
163
|
+
"uploading",
|
|
164
|
+
"ready",
|
|
165
|
+
"failed",
|
|
166
|
+
"archived",
|
|
167
|
+
]);
|
|
168
|
+
|
|
169
|
+
export type PlatformMachineGameMediaStatus = z.infer<
|
|
170
|
+
typeof platformMachineGameMediaStatusSchema
|
|
171
|
+
>;
|
|
172
|
+
|
|
173
|
+
export const platformMachineOwnedGameMediaActiveSchema = z.object({
|
|
174
|
+
thumbnailMediaAssetId: z.string().min(1).nullable(),
|
|
175
|
+
coverMediaAssetId: z.string().min(1).nullable(),
|
|
176
|
+
previewVideoMediaAssetId: z.string().min(1).nullable(),
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
export type PlatformMachineOwnedGameMediaActive = z.infer<
|
|
180
|
+
typeof platformMachineOwnedGameMediaActiveSchema
|
|
181
|
+
>;
|
|
182
|
+
|
|
183
|
+
export const platformMachineOwnedGameMediaAssetSchema = z.object({
|
|
184
|
+
id: z.string().min(1),
|
|
185
|
+
gameId: z.string().min(1),
|
|
186
|
+
kind: platformMachineGameMediaKindSchema,
|
|
187
|
+
status: platformMachineGameMediaStatusSchema,
|
|
188
|
+
originalFilename: z.string().min(1),
|
|
189
|
+
mimeType: z.string().min(1),
|
|
190
|
+
sizeBytes: z.number().int().nonnegative(),
|
|
191
|
+
checksum: z.string().min(1).nullable(),
|
|
192
|
+
width: z.number().int().nullable(),
|
|
193
|
+
height: z.number().int().nullable(),
|
|
194
|
+
durationSeconds: z.number().int().nullable(),
|
|
195
|
+
createdAt: z.string().min(1),
|
|
196
|
+
updatedAt: z.string().min(1),
|
|
197
|
+
activeAssetId: z.string().min(1).nullable(),
|
|
198
|
+
isActive: z.boolean(),
|
|
199
|
+
publicUrl: z.string().url().nullable(),
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
export type PlatformMachineOwnedGameMediaAsset = z.infer<
|
|
203
|
+
typeof platformMachineOwnedGameMediaAssetSchema
|
|
204
|
+
>;
|
|
205
|
+
|
|
206
|
+
export const platformMachineGetOwnedGameMediaResultSchema = z.object({
|
|
207
|
+
game: platformMachineOwnedGameSummarySchema,
|
|
208
|
+
active: platformMachineOwnedGameMediaActiveSchema,
|
|
209
|
+
assets: z.array(platformMachineOwnedGameMediaAssetSchema),
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
export type PlatformMachineGetOwnedGameMediaResult = z.infer<
|
|
213
|
+
typeof platformMachineGetOwnedGameMediaResultSchema
|
|
214
|
+
>;
|
|
215
|
+
|
|
216
|
+
export const platformMachineRequestOwnedGameMediaUploadTargetInputSchema =
|
|
217
|
+
z.object({
|
|
218
|
+
kind: platformMachineGameMediaKindSchema,
|
|
219
|
+
originalFilename: z.string().trim().min(1).max(255),
|
|
220
|
+
contentType: z.string().trim().min(1).max(120),
|
|
221
|
+
sizeBytes: z.number().int().positive(),
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
export type PlatformMachineRequestOwnedGameMediaUploadTargetInput = z.infer<
|
|
225
|
+
typeof platformMachineRequestOwnedGameMediaUploadTargetInputSchema
|
|
226
|
+
>;
|
|
227
|
+
|
|
228
|
+
export const platformMachineReleaseArtifactSchema = z.object({
|
|
229
|
+
id: z.string().min(1),
|
|
230
|
+
releaseId: z.string().min(1),
|
|
231
|
+
originalFilename: z.string().min(1),
|
|
232
|
+
contentType: z.string().min(1),
|
|
233
|
+
sizeBytes: z.number().int().nonnegative(),
|
|
234
|
+
extractedSizeBytes: z.number().int().nonnegative().nullable(),
|
|
235
|
+
fileCount: z.number().int().nonnegative().nullable(),
|
|
236
|
+
entryPath: z.string().min(1),
|
|
237
|
+
contentHash: z.string().min(1).nullable(),
|
|
238
|
+
createdAt: z.string().min(1),
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
export type PlatformMachineReleaseArtifact = z.infer<
|
|
242
|
+
typeof platformMachineReleaseArtifactSchema
|
|
243
|
+
>;
|
|
244
|
+
|
|
245
|
+
export const platformMachineReleaseCheckSchema = z.object({
|
|
246
|
+
id: z.string().min(1),
|
|
247
|
+
releaseId: z.string().min(1),
|
|
248
|
+
kind: releaseCheckKindSchema,
|
|
249
|
+
status: releaseCheckStatusSchema,
|
|
250
|
+
summary: z.string().nullable(),
|
|
251
|
+
payload: z.record(z.string(), z.unknown()),
|
|
252
|
+
createdAt: z.string().min(1),
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
export type PlatformMachineReleaseCheck = z.infer<
|
|
256
|
+
typeof platformMachineReleaseCheckSchema
|
|
257
|
+
>;
|
|
258
|
+
|
|
259
|
+
export const platformMachineReleaseReportSchema = z.object({
|
|
260
|
+
id: z.string().min(1),
|
|
261
|
+
releaseId: z.string().min(1),
|
|
262
|
+
status: releaseReportStatusSchema,
|
|
263
|
+
source: releaseReportSourceSchema,
|
|
264
|
+
reason: z.string().min(1),
|
|
265
|
+
details: z.string().nullable(),
|
|
266
|
+
reporterEmail: z.string().nullable(),
|
|
267
|
+
createdAt: z.string().min(1),
|
|
268
|
+
reviewedAt: z.string().nullable(),
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
export type PlatformMachineReleaseReport = z.infer<
|
|
272
|
+
typeof platformMachineReleaseReportSchema
|
|
273
|
+
>;
|
|
274
|
+
|
|
275
|
+
export const platformMachineReleaseSummarySchema = z.object({
|
|
276
|
+
id: z.string().min(1),
|
|
277
|
+
gameId: z.string().min(1),
|
|
278
|
+
sourceKind: gameReleaseSourceKindSchema,
|
|
279
|
+
status: gameReleaseStatusSchema,
|
|
280
|
+
versionLabel: z.string().nullable(),
|
|
281
|
+
createdAt: z.string().min(1),
|
|
282
|
+
uploadedAt: z.string().nullable(),
|
|
283
|
+
checkedAt: z.string().nullable(),
|
|
284
|
+
publishedAt: z.string().nullable(),
|
|
285
|
+
quarantinedAt: z.string().nullable(),
|
|
286
|
+
archivedAt: z.string().nullable(),
|
|
287
|
+
game: platformMachineOwnedGameSummarySchema,
|
|
288
|
+
artifact: platformMachineReleaseArtifactSchema.nullable(),
|
|
289
|
+
checks: z.array(platformMachineReleaseCheckSchema),
|
|
290
|
+
reports: z.array(platformMachineReleaseReportSchema),
|
|
291
|
+
hostUrl: z.string().url().nullable(),
|
|
292
|
+
controllerUrl: z.string().url().nullable(),
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
export type PlatformMachineReleaseSummary = z.infer<
|
|
296
|
+
typeof platformMachineReleaseSummarySchema
|
|
297
|
+
>;
|
|
298
|
+
|
|
299
|
+
export const platformMachineListOwnedGamesResultSchema = z.object({
|
|
300
|
+
games: z.array(platformMachineOwnedGameSummarySchema),
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
export type PlatformMachineListOwnedGamesResult = z.infer<
|
|
304
|
+
typeof platformMachineListOwnedGamesResultSchema
|
|
305
|
+
>;
|
|
306
|
+
|
|
307
|
+
export const platformMachineGetOwnedGameResultSchema = z.object({
|
|
308
|
+
game: platformMachineOwnedGameSummarySchema,
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
export type PlatformMachineGetOwnedGameResult = z.infer<
|
|
312
|
+
typeof platformMachineGetOwnedGameResultSchema
|
|
313
|
+
>;
|
|
314
|
+
|
|
315
|
+
export const platformMachineCreateOwnedGameInputSchema = z.object({
|
|
316
|
+
name: z.string().trim().min(1).max(80),
|
|
317
|
+
slug: z.string().trim().min(1).max(64).optional(),
|
|
318
|
+
description: z.string().trim().max(240).optional(),
|
|
319
|
+
url: z.string().url().optional(),
|
|
320
|
+
arcadeVisibility: z.enum(["hidden", "listed"]).optional(),
|
|
321
|
+
sourceUrl: z.string().url().optional(),
|
|
322
|
+
templateId: z
|
|
323
|
+
.string()
|
|
324
|
+
.trim()
|
|
325
|
+
.min(1)
|
|
326
|
+
.max(64)
|
|
327
|
+
.regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
|
|
328
|
+
.optional(),
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
export type PlatformMachineCreateOwnedGameInput = z.infer<
|
|
332
|
+
typeof platformMachineCreateOwnedGameInputSchema
|
|
333
|
+
>;
|
|
334
|
+
|
|
335
|
+
export const platformMachineCreateOwnedGameResultSchema = z.object({
|
|
336
|
+
game: platformMachineOwnedGameSummarySchema,
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
export type PlatformMachineCreateOwnedGameResult = z.infer<
|
|
340
|
+
typeof platformMachineCreateOwnedGameResultSchema
|
|
341
|
+
>;
|
|
342
|
+
|
|
343
|
+
export const platformMachineUpdateOwnedGameInputSchema = z
|
|
344
|
+
.object({
|
|
345
|
+
name: z.string().trim().min(1).max(80).optional(),
|
|
346
|
+
slug: z.string().trim().min(1).max(64).optional(),
|
|
347
|
+
description: z.string().trim().max(240).nullable().optional(),
|
|
348
|
+
url: z.string().url().nullable().optional(),
|
|
349
|
+
arcadeVisibility: z.enum(["hidden", "listed"]).optional(),
|
|
350
|
+
sourceUrl: z.string().url().nullable().optional(),
|
|
351
|
+
templateId: z
|
|
352
|
+
.string()
|
|
353
|
+
.trim()
|
|
354
|
+
.min(1)
|
|
355
|
+
.max(64)
|
|
356
|
+
.regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)
|
|
357
|
+
.nullable()
|
|
358
|
+
.optional(),
|
|
359
|
+
})
|
|
360
|
+
.refine((value) => Object.keys(value).length > 0, {
|
|
361
|
+
message: "At least one field must be provided.",
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
export type PlatformMachineUpdateOwnedGameInput = z.infer<
|
|
365
|
+
typeof platformMachineUpdateOwnedGameInputSchema
|
|
366
|
+
>;
|
|
367
|
+
|
|
368
|
+
export const platformMachineUpdateOwnedGameResultSchema = z.object({
|
|
369
|
+
game: platformMachineOwnedGameSummarySchema,
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
export type PlatformMachineUpdateOwnedGameResult = z.infer<
|
|
373
|
+
typeof platformMachineUpdateOwnedGameResultSchema
|
|
374
|
+
>;
|
|
375
|
+
|
|
376
|
+
export const platformMachineListReleasesResultSchema = z.object({
|
|
377
|
+
game: platformMachineOwnedGameSummarySchema,
|
|
378
|
+
releases: z.array(platformMachineReleaseSummarySchema),
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
export type PlatformMachineListReleasesResult = z.infer<
|
|
382
|
+
typeof platformMachineListReleasesResultSchema
|
|
383
|
+
>;
|
|
384
|
+
|
|
385
|
+
export const platformMachineGetReleaseResultSchema = z.object({
|
|
386
|
+
release: platformMachineReleaseSummarySchema,
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
export type PlatformMachineGetReleaseResult = z.infer<
|
|
390
|
+
typeof platformMachineGetReleaseResultSchema
|
|
391
|
+
>;
|
|
392
|
+
|
|
393
|
+
export const platformMachineCreateReleaseDraftInputSchema = z.object({
|
|
394
|
+
slugOrId: z.string().trim().min(1),
|
|
395
|
+
versionLabel: z.string().trim().min(1).max(100).optional(),
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
export type PlatformMachineCreateReleaseDraftInput = z.infer<
|
|
399
|
+
typeof platformMachineCreateReleaseDraftInputSchema
|
|
400
|
+
>;
|
|
401
|
+
|
|
402
|
+
export const platformMachineCreateReleaseDraftResultSchema = z.object({
|
|
403
|
+
release: platformMachineReleaseSummarySchema,
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
export type PlatformMachineCreateReleaseDraftResult = z.infer<
|
|
407
|
+
typeof platformMachineCreateReleaseDraftResultSchema
|
|
408
|
+
>;
|
|
409
|
+
|
|
410
|
+
export const platformMachineRequestReleaseUploadTargetInputSchema = z.object({
|
|
411
|
+
originalFilename: z.string().trim().min(1).max(255),
|
|
412
|
+
sizeBytes: z.number().int().positive(),
|
|
413
|
+
});
|
|
414
|
+
|
|
415
|
+
export type PlatformMachineRequestReleaseUploadTargetInput = z.infer<
|
|
416
|
+
typeof platformMachineRequestReleaseUploadTargetInputSchema
|
|
417
|
+
>;
|
|
418
|
+
|
|
419
|
+
export const platformMachineReleaseUploadTargetSchema = z.object({
|
|
420
|
+
key: z.string().min(1),
|
|
421
|
+
method: z.literal("PUT"),
|
|
422
|
+
url: z.string().url(),
|
|
423
|
+
headers: z.record(z.string(), z.string()),
|
|
424
|
+
expiresAt: z.string().min(1),
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
export type PlatformMachineReleaseUploadTarget = z.infer<
|
|
428
|
+
typeof platformMachineReleaseUploadTargetSchema
|
|
429
|
+
>;
|
|
430
|
+
|
|
431
|
+
export const platformMachineRequestReleaseUploadTargetResultSchema = z.object({
|
|
432
|
+
release: platformMachineReleaseSummarySchema,
|
|
433
|
+
upload: platformMachineReleaseUploadTargetSchema,
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
export type PlatformMachineRequestReleaseUploadTargetResult = z.infer<
|
|
437
|
+
typeof platformMachineRequestReleaseUploadTargetResultSchema
|
|
438
|
+
>;
|
|
439
|
+
|
|
440
|
+
export const platformMachineRequestOwnedGameMediaUploadTargetResultSchema =
|
|
441
|
+
z.object({
|
|
442
|
+
game: platformMachineOwnedGameSummarySchema,
|
|
443
|
+
asset: platformMachineOwnedGameMediaAssetSchema,
|
|
444
|
+
upload: platformMachineReleaseUploadTargetSchema,
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
export type PlatformMachineRequestOwnedGameMediaUploadTargetResult = z.infer<
|
|
448
|
+
typeof platformMachineRequestOwnedGameMediaUploadTargetResultSchema
|
|
449
|
+
>;
|
|
450
|
+
|
|
451
|
+
export const platformMachineMutateOwnedGameMediaAssetResultSchema = z.object({
|
|
452
|
+
game: platformMachineOwnedGameSummarySchema,
|
|
453
|
+
active: platformMachineOwnedGameMediaActiveSchema,
|
|
454
|
+
asset: platformMachineOwnedGameMediaAssetSchema,
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
export type PlatformMachineMutateOwnedGameMediaAssetResult = z.infer<
|
|
458
|
+
typeof platformMachineMutateOwnedGameMediaAssetResultSchema
|
|
459
|
+
>;
|
|
460
|
+
|
|
461
|
+
export const platformMachineFinalizeReleaseUploadResultSchema = z.object({
|
|
462
|
+
release: platformMachineReleaseSummarySchema,
|
|
463
|
+
});
|
|
464
|
+
|
|
465
|
+
export type PlatformMachineFinalizeReleaseUploadResult = z.infer<
|
|
466
|
+
typeof platformMachineFinalizeReleaseUploadResultSchema
|
|
467
|
+
>;
|
|
468
|
+
|
|
469
|
+
export const platformMachinePublishReleaseResultSchema = z.object({
|
|
470
|
+
release: platformMachineReleaseSummarySchema,
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
export type PlatformMachinePublishReleaseResult = z.infer<
|
|
474
|
+
typeof platformMachinePublishReleaseResultSchema
|
|
475
|
+
>;
|