@diffenderfer-games/hub 2.0.0-next.0 → 2.0.0-next.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/CHANGELOG.md +36 -0
- package/LICENSE +21 -21
- package/README.md +206 -139
- package/dist/auto.d.ts +6 -6
- package/dist/auto.js +2 -2
- package/dist/doctor/cli.mjs +62 -25
- package/dist/doctor/cli.mjs.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +2 -2
- package/dist/mp.d.ts +3 -3
- package/dist/race.d.ts +1 -1
- package/dist/rooms.d.ts +3 -3
- package/dist/shared/bridge.js +9 -3
- package/dist/shared/bridge.js.map +1 -1
- package/dist/shared/client-version.gen.js +1 -1
- package/dist/shared/daily.d.ts +10 -4
- package/dist/shared/daily.d.ts.map +1 -1
- package/dist/shared/daily.js +12 -2
- package/dist/shared/daily.js.map +1 -1
- package/dist/shared/globals.js +8 -3
- package/dist/shared/globals.js.map +1 -1
- package/dist/shared/index.d.ts +314 -35
- package/dist/shared/index.d.ts.map +1 -1
- package/dist/shared/input.js +7 -2
- package/dist/shared/input.js.map +1 -1
- package/dist/shared/latest-state.js +1 -1
- package/dist/shared/mp.js +10 -2
- package/dist/shared/mp.js.map +1 -1
- package/dist/shared/multiplayer-types.d.ts +15 -2
- package/dist/shared/multiplayer-types.d.ts.map +1 -1
- package/dist/shared/race-types.d.ts +1 -1
- package/dist/shared/race.js +1 -1
- package/dist/shared/room-types.d.ts +28 -3
- package/dist/shared/room-types.d.ts.map +1 -1
- package/dist/shared/rooms.d.ts.map +1 -1
- package/dist/shared/rooms.js +10 -2
- package/dist/shared/rooms.js.map +1 -1
- package/dist/shared/runtime-opener.js +1 -1
- package/dist/shared/social.d.ts +23 -8
- package/dist/shared/social.d.ts.map +1 -1
- package/dist/shared/social.js +6 -1
- package/dist/shared/social.js.map +1 -1
- package/dist/shared/src.js +1588 -388
- package/dist/shared/src.js.map +1 -1
- package/dist/shared/wire-types.d.ts +6 -2
- package/dist/shared/wire-types.d.ts.map +1 -1
- package/dist/social.d.ts +5 -5
- package/dist/social.js +1 -1
- package/package.json +89 -89
- package/src/auto.ts +39 -39
- package/src/core/connection.ts +394 -299
- package/src/core/errors.ts +147 -147
- package/src/core/game-data.ts +40 -38
- package/src/core/hub-economy.ts +216 -179
- package/src/core/hub-progress.ts +202 -205
- package/src/core/hub.ts +133 -131
- package/src/core/menu-control.ts +61 -61
- package/src/core/offline/events.ts +50 -50
- package/src/core/offline/favorites.ts +21 -21
- package/src/core/offline/hub-kinds/daily-kind.ts +68 -0
- package/src/core/offline/hub-kinds/economy-kinds.ts +86 -0
- package/src/core/offline/hub-kinds/game-fields.ts +2 -0
- package/src/core/offline/hub-kinds/index.ts +35 -0
- package/src/core/offline/hub-kinds/legacy-ops.ts +37 -0
- package/src/core/offline/hub-kinds/progress-kinds.ts +148 -0
- package/src/core/offline/kind-adapters.ts +48 -0
- package/src/core/offline/local-inventory.ts +64 -0
- package/src/core/offline/local-store.ts +259 -261
- package/src/core/offline/offline-api.ts +65 -0
- package/src/core/offline/outbox-entry.ts +59 -0
- package/src/core/offline/outbox-kinds.ts +78 -0
- package/src/core/offline/outbox-merge.ts +39 -0
- package/src/core/offline/outbox-replayer.ts +141 -0
- package/src/core/offline/outbox-store.ts +85 -0
- package/src/core/offline/outbox.ts +232 -0
- package/src/core/offline/queue.ts +126 -171
- package/src/core/offline/replay-lease.ts +87 -0
- package/src/core/offline/replay-policy.ts +52 -0
- package/src/core/page.ts +74 -74
- package/src/core/rest/endpoint-types.ts +22 -22
- package/src/core/rest/rest-client.ts +163 -152
- package/src/core/rest/routes.gen.ts +108 -87
- package/src/core/storage/json-guards.ts +80 -74
- package/src/core/storage/key-value.ts +66 -66
- package/src/core/ticket.ts +43 -43
- package/src/core/types.ts +134 -134
- package/src/core/version/client-version.gen.ts +1 -1
- package/src/core/version/hub-version.ts +62 -62
- package/src/core/version/semver.ts +97 -97
- package/src/daily/daily-system.ts +168 -161
- package/src/daily/page-daily.ts +36 -36
- package/src/daily/types.ts +68 -67
- package/src/daily.ts +10 -10
- package/src/doctor/checks.ts +86 -76
- package/src/doctor/cli.ts +98 -106
- package/src/doctor/hub-version-fetch.ts +43 -0
- package/src/doctor/tsconfig.json +12 -12
- package/src/globals.ts +115 -110
- package/src/index.ts +55 -50
- package/src/input/device-state.ts +146 -146
- package/src/input/edges.ts +55 -55
- package/src/input/gamepad.ts +61 -61
- package/src/input/input-events.ts +32 -32
- package/src/input/input-registry.ts +171 -164
- package/src/input/input-system.ts +393 -393
- package/src/input/legacy-controls.ts +64 -64
- package/src/input/nav-state.ts +191 -191
- package/src/input/navigator.ts +171 -171
- package/src/input/on-screen-controls.ts +101 -101
- package/src/input/page-control.ts +43 -43
- package/src/input/page-input.ts +193 -193
- package/src/input/player-remaps.ts +77 -77
- package/src/input/source-values.ts +116 -116
- package/src/input/spatial.ts +47 -47
- package/src/input/types.ts +331 -331
- package/src/input/zero-config.ts +177 -177
- package/src/input.ts +22 -22
- package/src/mp.ts +10 -10
- package/src/overlay/controls-panel.ts +163 -163
- package/src/overlay/dom.ts +46 -46
- package/src/overlay/layout-clusters.ts +162 -162
- package/src/overlay/layout-geometry.ts +136 -136
- package/src/overlay/layout.ts +203 -203
- package/src/overlay/listener-scope.ts +23 -23
- package/src/overlay/on-screen-keyboard.ts +137 -137
- package/src/overlay/overlay.ts +208 -208
- package/src/overlay/styles.ts +9 -9
- package/src/overlay/virtual-controls.ts +262 -262
- package/src/race.ts +10 -10
- package/src/realtime/bridge.ts +126 -121
- package/src/realtime/cross-bundle.ts +29 -29
- package/src/realtime/fallback-notice.ts +48 -48
- package/src/realtime/hub-link.ts +65 -65
- package/src/realtime/latest-state.ts +33 -33
- package/src/realtime/multiplayer-forwarder.ts +40 -28
- package/src/realtime/multiplayer-types.ts +66 -52
- package/src/realtime/page-runtime.ts +60 -60
- package/src/realtime/race-forwarder.ts +59 -59
- package/src/realtime/race-types.ts +132 -132
- package/src/realtime/room-types.ts +151 -125
- package/src/realtime/rooms-forwarder.ts +91 -79
- package/src/realtime/runtime-api.ts +60 -49
- package/src/realtime/runtime-opener.ts +61 -61
- package/src/realtime/social-forwarder.ts +77 -72
- package/src/realtime/social-types.ts +86 -78
- package/src/realtime/types.ts +53 -53
- package/src/realtime/wire-types.ts +79 -72
- package/src/rooms.ts +10 -10
- package/src/social.ts +18 -18
- package/src/types.ts +13 -13
- package/src/uistack/page-stack.ts +45 -45
- package/src/uistack/play-suspension.ts +82 -82
- package/src/uistack/types.ts +76 -76
- package/src/uistack/ui-stack.ts +144 -144
package/dist/doctor/cli.mjs
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
import { join, resolve } from "node:path";
|
|
4
4
|
import { parseArgs } from "node:util";
|
|
5
|
-
import { GamePackageJson, HubVersion } from "@diffenderfer-games/hub-contract";
|
|
5
|
+
import { GAME_LABELS, GamePackageJson, HubVersion, splitGameLabels } from "@diffenderfer-games/hub-contract";
|
|
6
6
|
//#region src/core/version/client-version.gen.ts
|
|
7
7
|
/** This client's package version, sent as `x-hub-client` on REST calls and `client` in `hello`. */
|
|
8
|
-
const HUB_CLIENT_VERSION = "2.0.0-next.
|
|
8
|
+
const HUB_CLIENT_VERSION = "2.0.0-next.2";
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/core/version/semver.ts
|
|
11
11
|
const VERSION_PATTERN = /^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;
|
|
@@ -81,6 +81,39 @@ function clientSupport(hubVersion, version = HUB_CLIENT_VERSION) {
|
|
|
81
81
|
return satisfiesRange(version, hubVersion.deprecated) ? "deprecated" : "supported";
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
|
+
//#region src/doctor/hub-version-fetch.ts
|
|
85
|
+
/**
|
|
86
|
+
* Reading the hub's `GET /_api/version` for `hub-doctor`, with a timeout so a
|
|
87
|
+
* hung or unreachable hub fails a game's CI quickly instead of stalling it.
|
|
88
|
+
*/
|
|
89
|
+
/** How long the doctor waits for the hub by default, ms. */
|
|
90
|
+
const DEFAULT_HUB_TIMEOUT_MS = 1e4;
|
|
91
|
+
/** Whether a version lookup failed. */
|
|
92
|
+
function isHubUnreachable(lookup) {
|
|
93
|
+
return lookup !== null && "unreachableUrl" in lookup;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The hub's version: `null` for a hub from before versioning (404), a
|
|
97
|
+
* {@link HubUnreachable} when it can't be read within `timeoutMs`.
|
|
98
|
+
*/
|
|
99
|
+
async function fetchHubVersion(hubUrl, timeoutMs = DEFAULT_HUB_TIMEOUT_MS) {
|
|
100
|
+
const url = new URL("/_api/version", hubUrl).toString();
|
|
101
|
+
try {
|
|
102
|
+
const response = await fetch(url, { signal: AbortSignal.timeout(timeoutMs) });
|
|
103
|
+
if (response.status === 404) return null;
|
|
104
|
+
if (!response.ok) return {
|
|
105
|
+
unreachableUrl: url,
|
|
106
|
+
reason: `HTTP ${String(response.status)}`
|
|
107
|
+
};
|
|
108
|
+
return HubVersion.parse(await response.json());
|
|
109
|
+
} catch (failure) {
|
|
110
|
+
return {
|
|
111
|
+
unreachableUrl: url,
|
|
112
|
+
reason: failure instanceof Error && (failure.name === "TimeoutError" || failure.name === "AbortError") ? `timed out after ${String(timeoutMs)} ms` : failure instanceof Error ? failure.message : String(failure)
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
//#endregion
|
|
84
117
|
//#region src/doctor/checks.ts
|
|
85
118
|
/**
|
|
86
119
|
* The checks `hub-doctor` runs on a game (plan §4.3.7). Each returns
|
|
@@ -90,14 +123,15 @@ function clientSupport(hubVersion, version = HUB_CLIENT_VERSION) {
|
|
|
90
123
|
const UPDATE_FIX = "run `npm update @diffenderfer-games/hub`";
|
|
91
124
|
/**
|
|
92
125
|
* The installed client against the hub's `/_api/version`: outside
|
|
93
|
-
* `supported` is an error, `deprecated` a warning
|
|
94
|
-
* versioning)
|
|
126
|
+
* `supported` is an error, `deprecated` a warning, `null` (a hub from before
|
|
127
|
+
* versioning) is only reported. An unreachable or slow hub is an error, so a
|
|
128
|
+
* game's CI notices (`--offline` skips the check).
|
|
95
129
|
*/
|
|
96
130
|
function checkClientVersion(installedVersion, hubVersion) {
|
|
97
|
-
if (hubVersion
|
|
98
|
-
level: "
|
|
131
|
+
if (isHubUnreachable(hubVersion)) return [{
|
|
132
|
+
level: "error",
|
|
99
133
|
check: "version",
|
|
100
|
-
message: `
|
|
134
|
+
message: `hub unreachable at ${hubVersion.unreachableUrl} (${hubVersion.reason}); check --hub, or pass --offline to skip the version check`
|
|
101
135
|
}];
|
|
102
136
|
switch (clientSupport(hubVersion, installedVersion)) {
|
|
103
137
|
case "unsupported": return [{
|
|
@@ -140,11 +174,18 @@ function checkVendoredCopies(gameDir) {
|
|
|
140
174
|
/** The `package.json` `game.*` block against the contract's manifest schema. */
|
|
141
175
|
function checkManifest(packageJson) {
|
|
142
176
|
const parsed = GamePackageJson.safeParse(packageJson);
|
|
143
|
-
if (parsed.success)
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
177
|
+
if (parsed.success) {
|
|
178
|
+
const unknownLabels = splitGameLabels(parsed.data.game.labels ?? []).unknown;
|
|
179
|
+
return [{
|
|
180
|
+
level: "info",
|
|
181
|
+
check: "manifest",
|
|
182
|
+
message: `the game.* block is valid (${parsed.data.game.type})`
|
|
183
|
+
}, ...unknownLabels.map((label) => ({
|
|
184
|
+
level: "warning",
|
|
185
|
+
check: "manifest",
|
|
186
|
+
message: `game.labels: "${label}" is not a known label (the catalog ignores it); use any of ${GAME_LABELS.join(", ")}`
|
|
187
|
+
}))];
|
|
188
|
+
}
|
|
148
189
|
return parsed.error.issues.map((issue) => ({
|
|
149
190
|
level: "error",
|
|
150
191
|
check: "manifest",
|
|
@@ -158,7 +199,7 @@ function checkManifest(packageJson) {
|
|
|
158
199
|
* game's folder, in CI and before pushing:
|
|
159
200
|
*
|
|
160
201
|
* ```sh
|
|
161
|
-
* npx hub-doctor [--dir <game folder>] [--hub <url>] [--offline] [--json]
|
|
202
|
+
* npx hub-doctor [--dir <game folder>] [--hub <url>] [--timeout <ms>] [--offline] [--json]
|
|
162
203
|
* ```
|
|
163
204
|
*
|
|
164
205
|
* - the installed `@diffenderfer-games/hub` against the hub's
|
|
@@ -174,6 +215,7 @@ function readOptions() {
|
|
|
174
215
|
const { values } = parseArgs({ options: {
|
|
175
216
|
dir: { type: "string" },
|
|
176
217
|
hub: { type: "string" },
|
|
218
|
+
timeout: { type: "string" },
|
|
177
219
|
offline: {
|
|
178
220
|
type: "boolean",
|
|
179
221
|
default: false
|
|
@@ -183,9 +225,15 @@ function readOptions() {
|
|
|
183
225
|
default: false
|
|
184
226
|
}
|
|
185
227
|
} });
|
|
228
|
+
const timeoutMs = values.timeout === void 0 ? DEFAULT_HUB_TIMEOUT_MS : Number(values.timeout);
|
|
229
|
+
if (!Number.isFinite(timeoutMs) || timeoutMs <= 0) {
|
|
230
|
+
process.stderr.write("hub-doctor: --timeout must be a positive number of milliseconds\n");
|
|
231
|
+
process.exit(2);
|
|
232
|
+
}
|
|
186
233
|
return {
|
|
187
234
|
gameDir: resolve(values.dir ?? "."),
|
|
188
235
|
hubUrl: values.hub ?? DEFAULT_HUB_URL,
|
|
236
|
+
timeoutMs,
|
|
189
237
|
isOffline: values.offline,
|
|
190
238
|
isJson: values.json
|
|
191
239
|
};
|
|
@@ -201,20 +249,9 @@ function installedClientVersion(gameDir) {
|
|
|
201
249
|
} catch {}
|
|
202
250
|
return HUB_CLIENT_VERSION;
|
|
203
251
|
}
|
|
204
|
-
/** The hub's `/_api/version`: `null` for a hub without it, an `Error` when unreachable. */
|
|
205
|
-
async function fetchHubVersion(hubUrl) {
|
|
206
|
-
try {
|
|
207
|
-
const response = await fetch(new URL("/_api/version", hubUrl));
|
|
208
|
-
if (response.status === 404) return null;
|
|
209
|
-
if (!response.ok) return /* @__PURE__ */ new Error(`HTTP ${String(response.status)}`);
|
|
210
|
-
return HubVersion.parse(await response.json());
|
|
211
|
-
} catch (failure) {
|
|
212
|
-
return failure instanceof Error ? failure : new Error(String(failure));
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
252
|
async function runDoctor(options) {
|
|
216
253
|
const findings = [];
|
|
217
|
-
if (!options.isOffline) findings.push(...checkClientVersion(installedClientVersion(options.gameDir), await fetchHubVersion(options.hubUrl)));
|
|
254
|
+
if (!options.isOffline) findings.push(...checkClientVersion(installedClientVersion(options.gameDir), await fetchHubVersion(options.hubUrl, options.timeoutMs)));
|
|
218
255
|
findings.push(...checkVendoredCopies(options.gameDir));
|
|
219
256
|
try {
|
|
220
257
|
findings.push(...checkManifest(readJsonFile(join(options.gameDir, "package.json"))));
|
package/dist/doctor/cli.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.mjs","names":[],"sources":["../../src/core/version/client-version.gen.ts","../../src/core/version/semver.ts","../../src/core/version/hub-version.ts","../../src/doctor/checks.ts","../../src/doctor/cli.ts"],"mappings":";;;;;;;AAEA,MAAa,qBAAqB;;;ACclC,MAAM,kBAAkB;;AAGxB,SAAgB,aAAa,MAAyC;CACpE,MAAM,QAAQ,gBAAgB,KAAK,KAAK,KAAK,CAAC;CAC9C,IAAI,UAAU,MACZ;CAEF,MAAM,GAAG,QAAQ,KAAK,QAAQ,KAAK,QAAQ,KAAK,cAAc;CAC9D,OAAO;EAAE,SAAS;GAAC,OAAO,KAAK;GAAG,OAAO,KAAK;GAAG,OAAO,KAAK;EAAC;EAAG,YAAY,eAAe,KAAA,IAAY,CAAC,IAAI,WAAW,MAAM,GAAG;CAAE;AACrI;;AAGA,SAAS,mBAAmB,OAAe,QAAwB;CACjE,MAAM,iBAAiB,QAAQ,KAAK,KAAK;CACzC,MAAM,kBAAkB,QAAQ,KAAK,MAAM;CAC3C,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Q;EACzB,SAAS,OAAO,UAAU;CAC5B;AACF;;AAGA,SAAgB,eAAe,aAAqB,OAAwB;CAC1E,MAAM,UAAU,aAAa,WAAW;CACxC,IAAI,YAAY,KAAA,GACd,OAAO;CAET,OAAO,MAAM,MAAM,IAAI,CAAC,CAAC,MAAM,gBAAgB;EAC7C,MAAM,cAAc,YAAY,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,QAAQ,eAAe,eAAe,EAAE;EAC5F,OAAO,YAAY,SAAS,KAAK,YAAY,OAAO,eAAe,gBAAgB,SAAS,UAAU,CAAC;CACzG,CAAC;AACH;;;;ACzEA,SAAgB,cAAc,YAA+B,UAAkB,oBAAmC;CAChH,IAAI,eAAe,MACjB,OAAO;CAET,IAAI,CAAC,eAAe,SAAS,WAAW,SAAS,GAC/C,OAAO;CAET,OAAO,eAAe,SAAS,WAAW,UAAU,IAAI,eAAe;AACzE;;;;;;;;
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../../src/core/version/client-version.gen.ts","../../src/core/version/semver.ts","../../src/core/version/hub-version.ts","../../src/doctor/hub-version-fetch.ts","../../src/doctor/checks.ts","../../src/doctor/cli.ts"],"mappings":";;;;;;;AAEA,MAAa,qBAAqB;;;ACclC,MAAM,kBAAkB;;AAGxB,SAAgB,aAAa,MAAyC;CACpE,MAAM,QAAQ,gBAAgB,KAAK,KAAK,KAAK,CAAC;CAC9C,IAAI,UAAU,MACZ;CAEF,MAAM,GAAG,QAAQ,KAAK,QAAQ,KAAK,QAAQ,KAAK,cAAc;CAC9D,OAAO;EAAE,SAAS;GAAC,OAAO,KAAK;GAAG,OAAO,KAAK;GAAG,OAAO,KAAK;EAAC;EAAG,YAAY,eAAe,KAAA,IAAY,CAAC,IAAI,WAAW,MAAM,GAAG;CAAE;AACrI;;AAGA,SAAS,mBAAmB,OAAe,QAAwB;CACjE,MAAM,iBAAiB,QAAQ,KAAK,KAAK;CACzC,MAAM,kBAAkB,QAAQ,KAAK,MAA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AQ,CAER;CACA,OAAO;AACT;AAEA,eAAe,UAAU,SAA4C;CACnE,MAAM,WAAsB,CAAC;CAC7B,IAAI,CAAC,QAAQ,WACX,SAAS,KAAK,GAAG,mBAAmB,uBAAuB,QAAQ,OAAO,GAAG,MAAM,gBAAgB,QAAQ,QAAQ,QAAQ,SAAS,CAAC,CAAC;CAExI,SAAS,KAAK,GAAG,oBAAoB,QAAQ,OAAO,CAAC;CACrD,IAAI;EACF,SAAS,KAAK,GAAG,cAAc,aAAa,KAAK,QAAQ,SAAS,cAAc,CAAC,CAAC,CAAC;CACrF,SAAS,SAAS;EAChB,SAAS,KAAK;GAAE,OAAO;GAAS,OAAO;GAAY,SAAS,gCAAgC,mBAAmB,QAAQ,QAAQ,UAAU,OAAO,OAAO;EAAI,CAAC;CAC9J;CACA,OAAO;AACT;AAEA,MAAM,UAAU,YAAY;AAC5B,MAAM,WAAW,MAAM,UAAU,OAAO;AACxC,IAAI,QAAQ,QACV,QAAQ,OAAO,MAAM,GAAG,KAAK,UAAU,EAAE,SAAS,GAAG,MAAM,CAAC,EAAE,GAAG;KAEjE,KAAK,MAAM,WAAW,UACpB,QAAQ,OAAO,MAAM,GAAG,QAAQ,MAAM,OAAO,CAAC,EAAE,GAAG,QAAQ,MAAM,IAAI,QAAQ,QAAQ,GAAG;AAG5F,QAAQ,WAAW,SAAS,MAAM,YAAY,QAAQ,UAAU,OAAO,IAAI,IAAI"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as RaceRecordPlayer, c as RealtimeErrorShape, d as RoomSeat, f as RoomSeatChange, g as Snapshot, h as ServerEvents, i as RaceHistory, l as RoomChatLine, m as SchemaOutput, n as InviteLink, o as RaceResultPlayer, p as RoomStateChange, r as Notice, s as RaceStatusEvent, t as InviteCreated, u as RoomMessage } from "./shared/wire-types.js";
|
|
2
2
|
import { _ as DailyStatus, a as isDailySystem, c as DailyAll, d as DailyCompletionMeta, f as DailyDefinition, g as DailyStartResponse, h as DailyHost, i as getDaily, l as DailyChallenge, m as DailyGameStatus, n as DailyCompletions, o as DAILY_START_EVENT, p as DailyEventDetail, r as DAILY_SINGLETON_API, s as DailySystem, t as DailyCompletion, u as DailyCompleteResponse } from "./shared/daily.js";
|
|
3
3
|
import { $ as VirtualControlType, A as AxisSide, B as InputReading, C as parseInputOverrides, D as isPageInputControl, E as PageInputControl, F as InputConfig, G as NavElement, H as MenuBridge, I as InputDef, J as NavTarget, K as NavElementKind, L as InputEvents, M as EdgeOffsets, N as GamepadMapping, O as Anchor, P as GroupDef, Q as Vector, R as InputHost, S as isInputSystem, T as InputSystemOptions, U as MouseMapping, V as InputSource, W as NavBlurEvent, X as Rect, Y as NavigableDef, Z as TouchMapping, _ as boxesTouch, a as OverlayEdge, b as InputOptions, c as OverlayReason, d as LayoutOptions, et as VirtualDef, f as layoutControls, g as LayoutItem, h as LayoutBox, i as AutoPauseOptions, j as DraggedSpot, k as AxisDef, l as UiStack, m as Insets, n as getUiStack, nt as VirtualOverride, o as OverlayEvent, p as Overlay, q as NavFocusEvent, r as isUiStack, s as OverlayListener, t as UI_STACK_VERSION, tt as VirtualInputs, u as UiStackHandoff, v as controlSize, w as InputSystem, x as getInput, y as INPUT_SINGLETON_API, z as InputOverrides } from "./shared/input.js";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as InviteResult, i as InviteOptions, n as HubMpApi, o as JoinInfoEvent, r as InviteLinkMethods, t as BusyOptions } from "./shared/multiplayer-types.js";
|
|
5
5
|
import { o as multiplayerForwarder } from "./shared/mp.js";
|
|
6
|
-
import { a as RoomEvents, c as
|
|
6
|
+
import { a as RoomEvents, c as RoomSelf, d as RoomStateOptions, i as RoomCreateOptions, l as RoomSendOptions, n as HubRoomsApi, o as RoomListOptions, r as JoinOptions, s as RoomReclaimMethods, t as HubRoom, u as RoomState } from "./shared/room-types.js";
|
|
7
7
|
import { a as RaceHistoryQuery, c as RaceRuntimeApi, i as RaceEvents, l as RaceStart, n as RaceCreateOptions, o as RaceHistoryViewOptions, r as RaceDefinition, s as RaceHudPlace, t as HubRaceApi } from "./shared/race-types.js";
|
|
8
8
|
import { f as raceForwarder } from "./shared/race.js";
|
|
9
9
|
import { n as roomsForwarder } from "./shared/rooms.js";
|
|
10
|
-
import { $ as HubNotifyApi, A as RacerState, B as SuggestionStatus, C as RaceRecord, D as RaceStats, E as RaceState, F as ReportReason, G as REALTIME_READY_EVENT, H as isRealtimeApi, I as RoomInfo, J as RealtimeHubLink, K as REALTIME_SINGLETON_API, L as SocialConfig, M as Relation, N as ReportInput, O as Racer, P as ReportKind, Q as socialForwarder, R as SocialMe, S as RaceParams, T as RaceStatValue, U as REALTIME_FAILED_EVENT, V as findRealtimeApi, W as REALTIME_FEATURE_VERSION, X as notifyForwarder, Y as linkRealtimeToHub, Z as presenceForwarder, _ as PlayerLite, a as ErrorBody, at as
|
|
11
|
-
import { $ as
|
|
12
|
-
export { type Anchor, type Audience, type AuthResponse, type AutoPauseOptions, type AxisDef, type AxisSide, type Board, type BoardWithTop, type BufferedEvent, type BusyOptions, CLIENT_VERSION_HEADER, type ChatMode, type ClientSupport, ContentRejectedError, type Conversation, type Counts, DAILY_SINGLETON_API, DAILY_START_EVENT, type DailyAll, type DailyChallenge, type DailyCompleteResponse, type DailyCompletion, type DailyCompletionMeta, type DailyCompletions, type DailyDefinition, type DailyEventDetail, type DailyGameStatus, type DailyHost, type DailyStartResponse, type DailyStatus, DailySystem, type DraggedSpot, type EdgeOffsets, type EndpointFields, type EndpointName, type EndpointReply, type ErrorBody, type FriendEntry, type GameAnalytics, type GameInfo, type GameLeaderboards, type GamePayload, type GameRecords, type GamepadMapping, type GlobalAnalytics, type GrantBundle, type GroupDef, HUB_CLIENT_VERSION, Hub, HubError, type HubErrorCode, type HubErrorDetails, type HubMenuControl, type HubMpApi, type HubNotifyApi, type HubOptions, type HubPresenceApi, type HubRaceApi, type HubRoom, type HubRoomsApi, type HubSocialApi, type HubStatus, INPUT_SINGLETON_API, type InputConfig, type InputDef, type InputEvents, type InputHost, type InputOptions, type InputOverrides, type InputReading, type InputSource, InputSystem, type InputSystemOptions, type Insets, type Inventory, type InventorySnapshot, type Invite, type InviteCreated, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type JoinOptions, type Json, type Launch, type LaunchTicket, type LayoutBox, type LayoutItem, type LayoutOptions, type LeaderboardEntry, type LeaderboardResult, type MeResponse, type MenuBridge, type Message, type MessagesPage, type Metrics, type MouseMapping, type NavBlurEvent, type NavElement, type NavElementKind, type NavFocusEvent, type NavTarget, type NavigableDef, type Notice, type NotifyChange, type NotifyPrefs, OfflineError, type OpenInviteOptions, Overlay, type OverlayEdge, type OverlayEvent, type OverlayListener, type OverlayReason, type PageInputControl, type Party, type PlayerCard, type PlayerLite, type PlayerRef, type Presence, type PresenceInput, type PresenceKind, type Profile, type ProfilePatch, type ProfileSummary, type ProfileUpdate, type QueueOp, type QueueOpInput, type QueuedScoreOptions, type REALTIME_FAILED_EVENT, type REALTIME_FEATURE_VERSION, type REALTIME_READY_EVENT, type REALTIME_SINGLETON_API, type RaceCreateOptions, type RaceDefinition, type RaceEvents, type RaceHistory, type RaceHistoryQuery, type RaceHistoryViewOptions, type RaceHudPlace, type RaceOutcome, type RaceParams, type RaceRecord, type RaceRecordPlayer, type RaceResult, type RaceResultPlayer, type RaceRuntimeApi, type RaceStart, type RaceStatValue, type RaceState, type RaceStats, type RaceStatusEvent, type Racer, type RacerResult, type RacerState, type RealtimeApi, type RealtimeErrorShape, type RealtimeHubLink, type RecentPlayer, type Rect, type Relation, type ReportInput, type ReportKind, type ReportReason, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomSeat, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, type Save, type SaveMeta, type SchemaOutput, type ServerEvents, type Snapshot, type SnapshotResponse, type SocialConfig, type SocialCounts, type SocialEvents, type SocialMe, type SortDir, type StatResult, type Stats, type SubmitScoreOptions, type SubmitScoreResult, type Suggestion, type SuggestionStatus, type SyncConflict, type SyncResult, type TouchMapping, type TradeBundle, type TradeId, type TradeListOptions, type TradeNoteOptions, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, type UiStack, type UiStackHandoff, type User, type Vector, type VirtualControlType, type VirtualDef, type VirtualInputs, type VirtualOverride, boxesTouch, controlSize, createHub, type findRealtimeApi, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, type isRealtimeApi, isUiStack, layoutControls, type linkRealtimeToHub, type multiplayerForwarder as mp, type notifyForwarder as notify, parseInputOverrides, type presenceForwarder as presence, type raceForwarder as race, type roomsForwarder as rooms, type socialForwarder as social };
|
|
10
|
+
import { $ as HubNotifyApi, A as RacerState, B as SuggestionStatus, C as RaceRecord, D as RaceStats, E as RaceState, F as ReportReason, G as REALTIME_READY_EVENT, H as isRealtimeApi, I as RoomInfo, J as RealtimeHubLink, K as REALTIME_SINGLETON_API, L as SocialConfig, M as Relation, N as ReportInput, O as Racer, P as ReportKind, Q as socialForwarder, R as SocialMe, S as RaceParams, T as RaceStatValue, U as REALTIME_FAILED_EVENT, V as findRealtimeApi, W as REALTIME_FEATURE_VERSION, X as notifyForwarder, Y as linkRealtimeToHub, Z as presenceForwarder, _ as PlayerLite, a as ErrorBody, at as SocialCounts, b as PresenceKind, c as JoinInfo, d as Message, et as HubPresenceApi, f as MessagesPage, g as PlayerCard, h as Party, i as Counts, it as PlayerRef, j as RecentPlayer, k as RacerResult, l as Launch, m as NotifyPrefs, n as ChatMode, nt as OpenInviteOptions, o as FriendEntry, ot as SocialEvents, p as NotifyChange, q as RealtimeApi, r as Conversation, rt as PlayOnlineMethods, s as Invite, t as Audience, tt as HubSocialApi, u as LaunchTicket, v as Presence, w as RaceResult, x as RaceOutcome, y as PresenceInput, z as Suggestion } from "./shared/social.js";
|
|
11
|
+
import { $ as LeaderboardResult, A as OUTBOX_MAX_ENTRIES, B as Board, C as OfflineApi, D as OfflineListener, E as OfflineEventName, F as ProfilePatch, G as GameRecords, H as GameAnalytics, I as QueueOp, J as HubStatus, K as GlobalAnalytics, L as QueueOpInput, M as OfflineKindDefinition, N as ReplayContext, O as OfflineOp, P as CLIENT_VERSION_HEADER, Q as LeaderboardEntry, R as QueuedScoreOptions, S as SyncResult, T as OfflineEventDetails, U as GameInfo, V as BoardWithTop, W as GameLeaderboards, X as InventorySnapshot, Y as Inventory, Z as Json, _ as TradeNoteOptions, a as HubErrorDetails, at as SaveMeta, b as StatResult, c as Hub, ct as Stats, d as ClientSupport, dt as User, et as MeResponse, f as HubMenuControl, ft as EndpointFields, g as TradeListOptions, h as TradeId, ht as GamePayload, i as HubErrorCode, it as Save, j as OfflineHandler, k as OUTBOX_MAX_CHARS, l as createHub, lt as SubmitScoreOptions, m as TradeBundle, mt as EndpointReply, n as ContentRejectedError, nt as Profile, o as OfflineError, ot as SnapshotResponse, p as GrantBundle, pt as EndpointName, q as HubOptions, r as HubError, rt as ProfileSummary, s as UNSUPPORTED_BY_HUB, st as SortDir, t as HUB_CLIENT_VERSION, tt as Metrics, u as hub, ut as SubmitScoreResult, v as AuthResponse, w as OUTBOX_FULL_CODE, x as SyncConflict, y as ProfileUpdate, z as BufferedEvent } from "./shared/index.js";
|
|
12
|
+
export { type Anchor, type Audience, type AuthResponse, type AutoPauseOptions, type AxisDef, type AxisSide, type Board, type BoardWithTop, type BufferedEvent, type BusyOptions, CLIENT_VERSION_HEADER, type ChatMode, type ClientSupport, ContentRejectedError, type Conversation, type Counts, DAILY_SINGLETON_API, DAILY_START_EVENT, type DailyAll, type DailyChallenge, type DailyCompleteResponse, type DailyCompletion, type DailyCompletionMeta, type DailyCompletions, type DailyDefinition, type DailyEventDetail, type DailyGameStatus, type DailyHost, type DailyStartResponse, type DailyStatus, DailySystem, type DraggedSpot, type EdgeOffsets, type EndpointFields, type EndpointName, type EndpointReply, type ErrorBody, type FriendEntry, type GameAnalytics, type GameInfo, type GameLeaderboards, type GamePayload, type GameRecords, type GamepadMapping, type GlobalAnalytics, type GrantBundle, type GroupDef, HUB_CLIENT_VERSION, Hub, HubError, type HubErrorCode, type HubErrorDetails, type HubMenuControl, type HubMpApi, type HubNotifyApi, type HubOptions, type HubPresenceApi, type HubRaceApi, type HubRoom, type HubRoomsApi, type HubSocialApi, type HubStatus, INPUT_SINGLETON_API, type InputConfig, type InputDef, type InputEvents, type InputHost, type InputOptions, type InputOverrides, type InputReading, type InputSource, InputSystem, type InputSystemOptions, type Insets, type Inventory, type InventorySnapshot, type Invite, type InviteCreated, type InviteLink, type InviteLinkMethods, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type JoinOptions, type Json, type Launch, type LaunchTicket, type LayoutBox, type LayoutItem, type LayoutOptions, type LeaderboardEntry, type LeaderboardResult, type MeResponse, type MenuBridge, type Message, type MessagesPage, type Metrics, type MouseMapping, type NavBlurEvent, type NavElement, type NavElementKind, type NavFocusEvent, type NavTarget, type NavigableDef, type Notice, type NotifyChange, type NotifyPrefs, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, type OfflineEventDetails, type OfflineEventName, type OfflineHandler, type OfflineKindDefinition, type OfflineListener, type OfflineOp, type OpenInviteOptions, Overlay, type OverlayEdge, type OverlayEvent, type OverlayListener, type OverlayReason, type PageInputControl, type Party, type PlayOnlineMethods, type PlayerCard, type PlayerLite, type PlayerRef, type Presence, type PresenceInput, type PresenceKind, type Profile, type ProfilePatch, type ProfileSummary, type ProfileUpdate, type QueueOp, type QueueOpInput, type QueuedScoreOptions, type REALTIME_FAILED_EVENT, type REALTIME_FEATURE_VERSION, type REALTIME_READY_EVENT, type REALTIME_SINGLETON_API, type RaceCreateOptions, type RaceDefinition, type RaceEvents, type RaceHistory, type RaceHistoryQuery, type RaceHistoryViewOptions, type RaceHudPlace, type RaceOutcome, type RaceParams, type RaceRecord, type RaceRecordPlayer, type RaceResult, type RaceResultPlayer, type RaceRuntimeApi, type RaceStart, type RaceStatValue, type RaceState, type RaceStats, type RaceStatusEvent, type Racer, type RacerResult, type RacerState, type RealtimeApi, type RealtimeErrorShape, type RealtimeHubLink, type RecentPlayer, type Rect, type Relation, type ReplayContext, type ReportInput, type ReportKind, type ReportReason, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomReclaimMethods, type RoomSeat, type RoomSeatChange, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, type Save, type SaveMeta, type SchemaOutput, type ServerEvents, type Snapshot, type SnapshotResponse, type SocialConfig, type SocialCounts, type SocialEvents, type SocialMe, type SortDir, type StatResult, type Stats, type SubmitScoreOptions, type SubmitScoreResult, type Suggestion, type SuggestionStatus, type SyncConflict, type SyncResult, type TouchMapping, type TradeBundle, type TradeId, type TradeListOptions, type TradeNoteOptions, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, type UiStack, type UiStackHandoff, type User, type Vector, type VirtualControlType, type VirtualDef, type VirtualInputs, type VirtualOverride, boxesTouch, controlSize, createHub, type findRealtimeApi, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, type isRealtimeApi, isUiStack, layoutControls, type linkRealtimeToHub, type multiplayerForwarder as mp, type notifyForwarder as notify, parseInputOverrides, type presenceForwarder as presence, type raceForwarder as race, type roomsForwarder as rooms, type socialForwarder as social };
|
package/dist/index.js
CHANGED
|
@@ -2,5 +2,5 @@ import { a as DailySystem, i as DAILY_START_EVENT, n as getDaily, r as isDailySy
|
|
|
2
2
|
import { t as HUB_CLIENT_VERSION } from "./shared/client-version.gen.js";
|
|
3
3
|
import { a as isPageInputControl, c as layoutControls, i as parseInputOverrides, l as boxesTouch, n as getInput, o as InputSystem, r as isInputSystem, s as Overlay, t as INPUT_SINGLETON_API, u as controlSize } from "./shared/input.js";
|
|
4
4
|
import { n as isUiStack, r as UI_STACK_VERSION, t as getUiStack } from "./shared/page-stack.js";
|
|
5
|
-
import { a as
|
|
6
|
-
export { CLIENT_VERSION_HEADER, ContentRejectedError, DAILY_SINGLETON_API, DAILY_START_EVENT, DailySystem, HUB_CLIENT_VERSION, Hub, HubError, INPUT_SINGLETON_API, InputSystem, OfflineError, Overlay, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, boxesTouch, controlSize, createHub, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, isUiStack, layoutControls, parseInputOverrides };
|
|
5
|
+
import { a as OUTBOX_FULL_CODE, c as OfflineApi, d as OfflineError, f as UNSUPPORTED_BY_HUB, i as CLIENT_VERSION_HEADER, l as ContentRejectedError, n as createHub, o as OUTBOX_MAX_CHARS, r as hub, s as OUTBOX_MAX_ENTRIES, t as Hub, u as HubError } from "./shared/src.js";
|
|
6
|
+
export { CLIENT_VERSION_HEADER, ContentRejectedError, DAILY_SINGLETON_API, DAILY_START_EVENT, DailySystem, HUB_CLIENT_VERSION, Hub, HubError, INPUT_SINGLETON_API, InputSystem, OUTBOX_FULL_CODE, OUTBOX_MAX_CHARS, OUTBOX_MAX_ENTRIES, OfflineApi, OfflineError, Overlay, UI_STACK_VERSION, UNSUPPORTED_BY_HUB, boxesTouch, controlSize, createHub, getDaily, getInput, getUiStack, hub, isDailySystem, isInputSystem, isPageInputControl, isUiStack, layoutControls, parseInputOverrides };
|
package/dist/mp.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as InviteCreated } from "./shared/wire-types.js";
|
|
2
|
-
import { a as
|
|
1
|
+
import { n as InviteLink, t as InviteCreated } from "./shared/wire-types.js";
|
|
2
|
+
import { a as InviteResult, i as InviteOptions, n as HubMpApi, o as JoinInfoEvent, r as InviteLinkMethods, t as BusyOptions } from "./shared/multiplayer-types.js";
|
|
3
3
|
import { a as Party, i as LaunchTicket, n as JoinInfo, o as multiplayerForwarder, r as Launch, t as Invite } from "./shared/mp.js";
|
|
4
|
-
export { type BusyOptions, type HubMpApi, type Invite, type InviteCreated, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type Launch, type LaunchTicket, type Party, multiplayerForwarder as mp };
|
|
4
|
+
export { type BusyOptions, type HubMpApi, type Invite, type InviteCreated, type InviteLink, type InviteLinkMethods, type InviteOptions, type InviteResult, type JoinInfo, type JoinInfoEvent, type Launch, type LaunchTicket, type Party, multiplayerForwarder as mp };
|
package/dist/race.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as RaceRecordPlayer, i as RaceHistory, o as RaceResultPlayer, s as RaceStatusEvent } from "./shared/wire-types.js";
|
|
2
2
|
import { a as RaceHistoryQuery, c as RaceRuntimeApi, i as RaceEvents, l as RaceStart, n as RaceCreateOptions, o as RaceHistoryViewOptions, r as RaceDefinition, s as RaceHudPlace, t as HubRaceApi } from "./shared/race-types.js";
|
|
3
3
|
import { a as RaceStatValue, c as Racer, d as RoomInfo, f as raceForwarder, i as RaceResult, l as RacerResult, n as RaceParams, o as RaceState, r as RaceRecord, s as RaceStats, t as RaceOutcome, u as RacerState } from "./shared/race.js";
|
|
4
4
|
export { type HubRaceApi, type RaceCreateOptions, type RaceDefinition, type RaceEvents, type RaceHistory, type RaceHistoryQuery, type RaceHistoryViewOptions, type RaceHudPlace, type RaceOutcome, type RaceParams, type RaceRecord, type RaceRecordPlayer, type RaceResult, type RaceResultPlayer, type RaceRuntimeApi, type RaceStart, type RaceStatValue, type RaceState, type RaceStats, type RaceStatusEvent, type Racer, type RacerResult, type RacerState, type RoomInfo, raceForwarder as race };
|
package/dist/rooms.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as RoomEvents, c as
|
|
1
|
+
import { d as RoomSeat, f as RoomSeatChange, l as RoomChatLine, p as RoomStateChange, u as RoomMessage } from "./shared/wire-types.js";
|
|
2
|
+
import { a as RoomEvents, c as RoomSelf, d as RoomStateOptions, i as RoomCreateOptions, l as RoomSendOptions, n as HubRoomsApi, o as RoomListOptions, r as JoinOptions, s as RoomReclaimMethods, t as HubRoom, u as RoomState } from "./shared/room-types.js";
|
|
3
3
|
import { n as roomsForwarder, t as RoomInfo } from "./shared/rooms.js";
|
|
4
|
-
export { type HubRoom, type HubRoomsApi, type JoinOptions, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomSeat, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, roomsForwarder as rooms };
|
|
4
|
+
export { type HubRoom, type HubRoomsApi, type JoinOptions, type RoomChatLine, type RoomCreateOptions, type RoomEvents, type RoomInfo, type RoomListOptions, type RoomMessage, type RoomReclaimMethods, type RoomSeat, type RoomSeatChange, type RoomSelf, type RoomSendOptions, type RoomState, type RoomStateChange, type RoomStateOptions, roomsForwarder as rooms };
|
package/dist/shared/bridge.js
CHANGED
|
@@ -47,9 +47,11 @@ function hubLink() {
|
|
|
47
47
|
//#region src/realtime/runtime-api.ts
|
|
48
48
|
/**
|
|
49
49
|
* The realtime feature version the runtime reports in {@link RealtimeApi.version}.
|
|
50
|
-
* 2 added races;
|
|
50
|
+
* 2 added races; 3 added invite links and taking back a held seat; 4 added
|
|
51
|
+
* "Play online" (tournaments). A client feature-detects newer additions with
|
|
52
|
+
* it (or by the optional method).
|
|
51
53
|
*/
|
|
52
|
-
const REALTIME_FEATURE_VERSION =
|
|
54
|
+
const REALTIME_FEATURE_VERSION = 4;
|
|
53
55
|
/**
|
|
54
56
|
* The cross-bundle shape number of the `rt` page singleton (plan §4.4). The
|
|
55
57
|
* runtime registers with it through `claimSingleton`; bump it only when the
|
|
@@ -201,9 +203,13 @@ async function rethrowAsHubError(pending) {
|
|
|
201
203
|
throw hubLink().toHubError(error);
|
|
202
204
|
}
|
|
203
205
|
}
|
|
206
|
+
/** The rejection for a feature the page's social runtime is too old to have (version 3 additions). */
|
|
207
|
+
function outdatedRuntime(feature) {
|
|
208
|
+
return hubLink().createOfflineError(`${feature} needs the newest hub. Reload the page to update.`);
|
|
209
|
+
}
|
|
204
210
|
/** The page's one bridge (per client bundle). */
|
|
205
211
|
const pageBridge = new RealtimeBridge();
|
|
206
212
|
//#endregion
|
|
207
|
-
export {
|
|
213
|
+
export { isRealtimeApi as a, REALTIME_FEATURE_VERSION as c, hubLink as d, linkRealtimeToHub as f, findRealtimeApi as i, REALTIME_READY_EVENT as l, pageBridge as n, readRuntimeFailure as o, rethrowAsHubError as r, REALTIME_FAILED_EVENT as s, outdatedRuntime as t, REALTIME_SINGLETON_API as u };
|
|
208
214
|
|
|
209
215
|
//# sourceMappingURL=bridge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","names":[],"sources":["../../src/realtime/hub-link.ts","../../src/realtime/runtime-api.ts","../../src/realtime/page-runtime.ts","../../src/realtime/bridge.ts"],"mappings":";;;;;;;;;;AAuBA,SAAS,iBAAiB,OAAoC;CAC5D,IAAI,iBAAiB,OACnB,OAAO;CAET,MAAM,UAAU,UAAU,OAAO,SAAS;CAC1C,MAAM,OAA2B,IAAI,MAAM,OAAO,YAAY,WAAW,UAAU,OAAO,KAAK,CAAC;CAChG,KAAK,MAAM,OAAO,CAAC,UAAU,cAAc,GAAY;EACrD,MAAM,QAAQ,UAAU,OAAO,GAAG;EAClC,IAAI,OAAO,UAAU,UACnB,KAAK,OAAO;CAEhB;CACA,KAAK,MAAM,OAAO;EAAC;EAAQ;EAAU;CAAM,GAAY;EACrD,MAAM,QAAQ,UAAU,OAAO,GAAG;EAClC,IAAI,OAAO,UAAU,UACnB,KAAK,OAAO;CAEhB;CACA,OAAO;AACT;AAYA,IAAI,cAA+B;CATjC,YAAY;CACZ,mBAAmB,SAAS;EAC1B,MAAM,UAA8B,IAAI,MAAM,OAAO;EACrD,QAAQ,OAAO;EACf,OAAO;CACT;CACA,2BAA2B,QAAQ,uBAAO,IAAI,MAAM,qEAAqE,CAAC;AAG5E;;AAGhD,SAAgB,kBAAkB,MAA6B;CAC7D,cAAc;AAChB;;AAGA,SAAgB,UAA2B;CACzC,OAAO;AACT
|
|
1
|
+
{"version":3,"file":"bridge.js","names":[],"sources":["../../src/realtime/hub-link.ts","../../src/realtime/runtime-api.ts","../../src/realtime/page-runtime.ts","../../src/realtime/bridge.ts"],"mappings":";;;;;;;;;;AAuBA,SAAS,iBAAiB,OAAoC;CAC5D,IAAI,iBAAiB,OACnB,OAAO;CAET,MAAM,UAAU,UAAU,OAAO,SAAS;CAC1C,MAAM,OAA2B,IAAI,MAAM,OAAO,YAAY,WAAW,UAAU,OAAO,KAAK,CAAC;CAChG,KAAK,MAAM,OAAO,CAAC,UAAU,cAAc,GAAY;EACrD,MAAM,QAAQ,UAAU,OAAO,GAAG;EAClC,IAAI,OAAO,UAAU,UACnB,KAAK,OAAO;CAEhB;CACA,KAAK,MAAM,OAAO;EAAC;EAAQ;EAAU;CAAM,GAAY;EACrD,MAAM,QAAQ,UAAU,OAAO,GAAG;EAClC,IAAI,OAAO,UAAU,UACnB,KAAK,OAAO;CAEhB;CACA,OAAO;AACT;AAYA,IAAI,cAA+B;CATjC,YAAY;CACZ,mBAAmB,SAAS;EAC1B,MAAM,UAA8B,IAAI,MAAM,OAAO;EACrD,QAAQ,OAAO;EACf,OAAO;CACT;CACA,2BAA2B,QAAQ,uBAAO,IAAI,MAAM,qEAAqE,CAAC;AAG5E;;AAGhD,SAAgB,kBAAkB,MAA6B;CAC7D,cAAc;AAChB;;AAGA,SAAgB,UAA2B;CACzC,OAAO;AACT;;;;;;;;;AChDA,MAAa,2BAA2B;;;;;;AAgBxC,MAAa,yBAAyB;;AAGtC,MAAa,uBAAuB;;AAGpC,MAAa,wBAAwB;;;;;;;;;AC1BrC,SAAgB,cAAc,WAA8C;CAC1E,OAAO,OAAO,UAAU,WAAW,SAAS,MAAM,YAC7C,WAAW,UAAU,WAAW,UAAU,GAAG,CAAC,OAAO,OAAO,CAAC,KAC7D,WAAW,UAAU,WAA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CACf,SAAS,OAAO;EACd,MAAM,QAAQ,CAAC,CAAC,WAAW,KAAK;CAClC;AACF;;AAGA,SAAgB,gBAAgB,SAAwB;CACtD,OAAO,QAAQ,CAAC,CAAC,mBAAmB,GAAG,QAAQ,kDAAkD;AACnG;;AAGA,MAAa,aAAa,IAAI,eAAe"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/core/version/client-version.gen.ts
|
|
2
2
|
/** This client's package version, sent as `x-hub-client` on REST calls and `client` in `hello`. */
|
|
3
|
-
const HUB_CLIENT_VERSION = "2.0.0-next.
|
|
3
|
+
const HUB_CLIENT_VERSION = "2.0.0-next.2";
|
|
4
4
|
//#endregion
|
|
5
5
|
export { HUB_CLIENT_VERSION as t };
|
|
6
6
|
|
package/dist/shared/daily.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as SchemaOutput } from "./wire-types.js";
|
|
2
2
|
import { DailyCompletion, DailyCompletions, Json, dailyEndpoints } from "@diffenderfer-games/hub-contract";
|
|
3
3
|
//#region src/daily/types.d.ts
|
|
4
4
|
/** The response type of a daily endpoint. */
|
|
@@ -41,8 +41,8 @@ interface DailyHost {
|
|
|
41
41
|
all(): Promise<DailyAll>;
|
|
42
42
|
/** `POST /games/:slug/daily/:day/start`. */
|
|
43
43
|
start(day: string): Promise<DailyStartResponse>;
|
|
44
|
-
/** `POST /games/:slug/daily/:day/complete
|
|
45
|
-
complete(day: string, token: string, meta: DailyCompletionMeta): Promise<DailyCompleteResponse>;
|
|
44
|
+
/** `POST /games/:slug/daily/:day/complete`; `null` when it was queued offline, to replay when the hub is back. */
|
|
45
|
+
complete(day: string, token: string, meta: DailyCompletionMeta): Promise<DailyCompleteResponse | null>;
|
|
46
46
|
/** Fire a `hub:*` window event (the menu listens). */
|
|
47
47
|
emit(name: string, detail: DailyEventDetail): void;
|
|
48
48
|
}
|
|
@@ -56,6 +56,10 @@ type DailyEventDetail = {
|
|
|
56
56
|
count: number;
|
|
57
57
|
rank: number | null;
|
|
58
58
|
meta: DailyCompletionMeta;
|
|
59
|
+
} | {
|
|
60
|
+
day: string;
|
|
61
|
+
queued: true;
|
|
62
|
+
meta: DailyCompletionMeta;
|
|
59
63
|
} | {
|
|
60
64
|
day: string;
|
|
61
65
|
error: string;
|
|
@@ -94,7 +98,9 @@ declare class DailySystem {
|
|
|
94
98
|
/**
|
|
95
99
|
* Record completion of the active challenge with optional metadata.
|
|
96
100
|
* Resolves with the new completion count and rank, or `null` when no
|
|
97
|
-
* challenge is active or the hub
|
|
101
|
+
* challenge is active, the hub refused, or the hub can't be reached: then
|
|
102
|
+
* the completion is queued (`hub:daily-queued`) and replays when it is
|
|
103
|
+
* back (`hub:daily-complete` follows).
|
|
98
104
|
*/
|
|
99
105
|
complete(meta?: DailyCompletionMeta): Promise<DailyCompleteResponse | null>;
|
|
100
106
|
/** Ask the page's other daily systems to start `day` (this one ignores its own event). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily.d.ts","names":[],"sources":["../../src/daily/types.ts","../../src/daily/daily-system.ts","../../src/daily/page-daily.ts"],"mappings":";;;;KAQK,cAAc,0BAA0B,kBAAkB,qBAAqB,gBAAgB;;KAGxF,cAAc;;KAGd,WAAW;;KAGX,kBAAkB;;KAGlB,qBAAqB;;KAGrB,wBAAwB;;UAGnB;;EAEf;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf,OAAO,WAAW;;;KAIR,sBAAsB,eAAe;;UAGhC;;WAEN;;EAET,UAAU,QAAQ;;EAElB,OAAO,QAAQ;;EAEf,MAAM,cAAc,QAAQ;;EAE5B,SAAS,aAAa,eAAe,MAAM,sBAAsB,QAAQ;;EAEzE,KAAK,cAAc,QAAQ;;;KAIjB;EACN;EAAa;EAAc;;EAC3B;EAAa;EAAe;EAAqB,MAAM;;EACvD;EAAa;;;;;
|
|
1
|
+
{"version":3,"file":"daily.d.ts","names":[],"sources":["../../src/daily/types.ts","../../src/daily/daily-system.ts","../../src/daily/page-daily.ts"],"mappings":";;;;KAQK,cAAc,0BAA0B,kBAAkB,qBAAqB,gBAAgB;;KAGxF,cAAc;;KAGd,WAAW;;KAGX,kBAAkB;;KAGlB,qBAAqB;;KAGrB,wBAAwB;;UAGnB;;EAEf;;EAEA;;EAEA;;EAEA;;;UAIe;;EAEf,OAAO,WAAW;;;KAIR,sBAAsB,eAAe;;UAGhC;;WAEN;;EAET,UAAU,QAAQ;;EAElB,OAAO,QAAQ;;EAEf,MAAM,cAAc,QAAQ;;EAE5B,SAAS,aAAa,eAAe,MAAM,sBAAsB,QAAQ;;EAEzE,KAAK,cAAc,QAAQ;;;KAIjB;EACN;EAAa;EAAc;;EAC3B;EAAa;EAAe;EAAqB,MAAM;;EACvD;EAAa;EAAc,MAAM;;EACjC;EAAa;;;;;cCnDN;;cA0BA;;;;;EAKX,QAAQ;mBACS;UACT;UACA;UACA;EAEI,YAAA,MAAM;;MAiBd;;;;;;EASJ,OAAO,YAAY;;;;;;;EAeb,aAAa,cAAc;;;;;;;;EAyB3B,SAAS,OAAM,sBAA2B,QAAQ;;UAsBhD;;EAaR;;EAKA,UAAU,QAAQ;;EAKlB,OAAO,QAAQ;;;;;cCzJJ;;iBAIG,cAAc,qBAAqB,aAAa;;;;;;iBAWhD,SAAS,MAAM,YAAY"}
|
package/dist/shared/daily.js
CHANGED
|
@@ -104,7 +104,9 @@ var DailySystem = class {
|
|
|
104
104
|
/**
|
|
105
105
|
* Record completion of the active challenge with optional metadata.
|
|
106
106
|
* Resolves with the new completion count and rank, or `null` when no
|
|
107
|
-
* challenge is active or the hub
|
|
107
|
+
* challenge is active, the hub refused, or the hub can't be reached: then
|
|
108
|
+
* the completion is queued (`hub:daily-queued`) and replays when it is
|
|
109
|
+
* back (`hub:daily-complete` follows).
|
|
108
110
|
*/
|
|
109
111
|
async complete(meta = {}) {
|
|
110
112
|
const challenge = this.active;
|
|
@@ -112,6 +114,14 @@ var DailySystem = class {
|
|
|
112
114
|
try {
|
|
113
115
|
const completed = await this.host.complete(challenge.day, challenge.token, meta);
|
|
114
116
|
this.active = null;
|
|
117
|
+
if (completed === null) {
|
|
118
|
+
this.host.emit("hub:daily-queued", {
|
|
119
|
+
day: challenge.day,
|
|
120
|
+
queued: true,
|
|
121
|
+
meta
|
|
122
|
+
});
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
115
125
|
this.host.emit("hub:daily-complete", {
|
|
116
126
|
day: challenge.day,
|
|
117
127
|
count: completed.count,
|
|
@@ -178,7 +188,7 @@ let claimedDaily = null;
|
|
|
178
188
|
function getDaily(host) {
|
|
179
189
|
claimedDaily ?? (claimedDaily = claimSingleton({
|
|
180
190
|
name: "daily",
|
|
181
|
-
version: "2.0.0-next.
|
|
191
|
+
version: "2.0.0-next.2",
|
|
182
192
|
api: 1,
|
|
183
193
|
create: () => new DailySystem(host),
|
|
184
194
|
isInstance: isDailySystem
|
package/dist/shared/daily.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daily.js","names":[],"sources":["../../src/daily/daily-system.ts","../../src/daily/page-daily.ts"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,cAAc;;AAGpB,MAAa,oBAAoB;;AAIjC,SAAS,SAAS,WAAmC;CACnD,OAAO,OAAO,cAAc,YAAY,YAAY,KAAK,SAAS,IAAI,YAAY;AACpF;;AAGA,SAAS,kBAAiC;CAGxC,MAAM,WAAW,OAAO,WAAW,cAAc,OAAO,SAAS,UAAU,QAAQ,gBAAgB,CAAC;CACpG,IAAI,aAAa,QAAQ,OAAO,aAAa,aAC3C,OAAO;CAET,OAAO,SAAS,IAAI,IAAI,SAAS,IAAI,CAAC,CAAC,aAAa,IAAI,OAAO,CAAC;AAClE;;AAIA,SAAS,UAAU,OAAwB;CACzC,OAAO,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAC9D;;AAGA,IAAa,cAAb,MAAyB;CAWvB,YAAY,MAAiB;;;;;;;GAN7B;GAAgC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K,SAAS;CAChB;;CAGA,SAA+B;EAC7B,OAAO,KAAK,KAAK,OAAO;CAC1B;;CAGA,MAAyB;EACvB,OAAO,KAAK,KAAK,IAAI;CACvB;AACF;;;;;;;;AC5JA,MAAa,sBAAsB;;AAInC,SAAgB,cAAc,WAA8C;CAC1E,OAAO,WAAW,WAAW;EAAC;EAAU;EAAgB;EAAY;EAAU;EAAU;CAAK,CAAC;AAChG;AAEA,IAAI,eAAmC;;;;;;AAOvC,SAAgB,SAAS,MAA8B;CACrD,iBAAA,eAAiB,eAAe;EAC9B,MAAM;EACN,SAAA;EACA,KAAA;EACA,cAAc,IAAI,YAAY,IAAI;EAClC,YAAY;CACd,CAAC;CACD,OAAO;AACT"}
|
package/dist/shared/globals.js
CHANGED
|
@@ -50,8 +50,6 @@ function _defineProperty(e, r, t) {
|
|
|
50
50
|
writable: !0
|
|
51
51
|
}) : e[r] = t, e;
|
|
52
52
|
}
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region src/globals.ts
|
|
55
53
|
/** The v1 window names, kept as aliases. */
|
|
56
54
|
const LEGACY_GLOBAL_NAMES = {
|
|
57
55
|
input: "__HUB_INPUT__",
|
|
@@ -80,7 +78,14 @@ function claimSingleton(claim) {
|
|
|
80
78
|
if (claim.onMismatch?.(registered) !== true) return claim.create();
|
|
81
79
|
} else {
|
|
82
80
|
const legacy = page[LEGACY_GLOBAL_NAMES[claim.name]];
|
|
83
|
-
if (registered === void 0 && claim.isInstance(legacy))
|
|
81
|
+
if (registered === void 0 && claim.isInstance(legacy)) {
|
|
82
|
+
registry[claim.name] = {
|
|
83
|
+
version: "v1",
|
|
84
|
+
api: claim.api,
|
|
85
|
+
instance: legacy
|
|
86
|
+
};
|
|
87
|
+
return legacy;
|
|
88
|
+
}
|
|
84
89
|
}
|
|
85
90
|
const instance = claim.create();
|
|
86
91
|
registry[claim.name] = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globals.js","names":[],"sources":["../../src/realtime/cross-bundle.ts","../../src/globals.ts"],"mappings":";;AAWA,SAAgB,SAAS,WAAyC;CAChE,OAAO,OAAO,cAAc,YAAY,cAAc;AACxD;;AAIA,SAAgB,WAAgC,WAAoB,OAA8D;CAChI,IAAI,CAAC,SAAS,SAAS,GACrB,OAAO;CAET,OAAO,MAAM,OAAO,SAAS,QAAQ,aAAa,OAAO,QAAQ,IAAI,WAAW,IAAI,MAAM,UAAU;AACtG;;AAIA,SAAgB,UAAU,WAAoB,KAAsB;CAClE,OAAO,SAAS,SAAS,IAAI,QAAQ,IAAI,WAAW,GAAG,IAAI,KAAA;AAC7D
|
|
1
|
+
{"version":3,"file":"globals.js","names":[],"sources":["../../src/realtime/cross-bundle.ts","../../src/globals.ts"],"mappings":";;AAWA,SAAgB,SAAS,WAAyC;CAChE,OAAO,OAAO,cAAc,YAAY,cAAc;AACxD;;AAIA,SAAgB,WAAgC,WAAoB,OAA8D;CAChI,IAAI,CAAC,SAAS,SAAS,GACrB,OAAO;CAET,OAAO,MAAM,OAAO,SAAS,QAAQ,aAAa,OAAO,QAAQ,IAAI,WAAW,IAAI,MAAM,UAAU;AACtG;;AAIA,SAAgB,UAAU,WAAoB,KAAsB;CAClE,OAAO,SAAS,SAAS,IAAI,QAAQ,IAAI,WAAW,GAAG,IAAI,KAAA;AAC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACQA,MAAa,sBAAsB;CAAE,OAAO;CAAiB,OAAO;CAAiB,IAAI;AAAa;AAkCtG,MAAM,mCAAmB,IAAI,IAAmB;;AAGhD,SAAS,WAAW,MAAiD;CACnE,IAAI,SAAS,KAAA,GACX;CAEF,KAAK,WAAL,KAAK,SAAW,CAAC;CACjB,OAAO,KAAK;AACd;;AAGA,SAAgB,eAAkB,OAA6B;CAC7D,MAAM,OAAO,OAAO,WAAW,cAAc,KAAA,IAAY;CACzD,MAAM,WAAW,WAAW,IAAI;CAChC,IAAI,SAAS,KAAA,KAAa,aAAa,KAAA,GACrC,OA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