@my-swu/simulator-client 0.1.0 → 0.1.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/dist/generated/schemas.js +563 -3
- package/dist/generated/types/common.d.ts +133 -0
- package/dist/generated/types/format-event-response.d.ts +1 -1
- package/dist/generated/types/game-state.d.ts +1 -1
- package/dist/generated/types/get-match-response.d.ts +1 -1
- package/dist/generated/types/list-active-ai-matches-response.d.ts +1 -1
- package/dist/generated/types/lobby-access-response.d.ts +1 -1
- package/dist/generated/types/lobby-server-message.d.ts +1 -1
- package/dist/generated/types/match-access-response.d.ts +1 -1
- package/dist/generated/types/match-history-replay-response.d.ts +1 -1
- package/dist/generated/types/match-spectator-access-response.d.ts +1 -1
- package/dist/generated/types/rematch-match-response.d.ts +1 -1
- package/dist/generated/types/restore-history-response.d.ts +1 -1
- package/dist/generated/types/restore-match-save-response.d.ts +1 -1
- package/dist/generated/types/server-message.d.ts +1 -1
- package/dist/generated/types/submit-match-deck-response.d.ts +1 -1
- package/dist/generated/types/tournament-room-access-response.d.ts +1 -1
- package/dist/generated/types/tournament-room-server-message.d.ts +1 -1
- package/dist/generated/types/undo-match-response.d.ts +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/internal/authenticated-socket-session.js +2 -2
- package/dist/internal/errors.d.ts +5 -0
- package/dist/internal/errors.js +4 -0
- package/dist/local/wasm-engine.d.ts +1 -0
- package/dist/local/worker-boot.d.ts +2 -0
- package/dist/local/worker-boot.js +1 -0
- package/dist/match-session/controller.js +53 -2
- package/dist/match-session/heartbeat.d.ts +33 -0
- package/dist/match-session/heartbeat.js +70 -0
- package/dist/match-session/session-state.d.ts +14 -0
- package/dist/match-session/types.d.ts +1 -1
- package/dist/match-session.d.ts +1 -1
- package/dist/resources/lobby-list-session.js +2 -2
- package/dist/resources/tournament-room-types.d.ts +2 -2
- package/dist/types.d.ts +1 -1
- package/dist/validators.d.ts +1 -1
- package/dist/validators.js +1 -1
- package/package.json +1 -1
- package/schema/common.schema.json +490 -2
- package/schema/game-command.schema.json +48 -0
- package/schema/game-event.schema.json +8 -0
- package/schema/game-state.schema.json +11 -0
- package/schema/health-response.schema.json +6 -1
- package/schema/manifest.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { MatchConnection } from '../connection.js';
|
|
2
2
|
import { TypedEmitter } from '../internal/emitter.js';
|
|
3
|
+
import { formatErrorMessages } from '../internal/errors.js';
|
|
3
4
|
import { DEFAULT_ERROR_HISTORY_LIMIT, DEFAULT_MATCH_HISTORY_LIMIT } from '../internal/limits.js';
|
|
4
5
|
import { nonNegativeNumber, normalizeReconnectBackoff, reconnectDelayMs, } from '../internal/reconnect-backoff.js';
|
|
6
|
+
import { createMatchSessionHeartbeat } from './heartbeat.js';
|
|
5
7
|
import { hasAccessSnapshot, matchReferenceFrom } from './access.js';
|
|
6
8
|
import { errorPayloadFromUnknown } from './errors.js';
|
|
7
9
|
const DEFAULT_EVENT_HISTORY_LIMIT = 50;
|
|
@@ -9,6 +11,8 @@ const DEFAULT_RECONNECT_INITIAL_DELAY_MS = 250;
|
|
|
9
11
|
const DEFAULT_RECONNECT_MAX_DELAY_MS = 5_000;
|
|
10
12
|
const DEFAULT_RECONNECT_MAX_RETRIES = 5;
|
|
11
13
|
const DEFAULT_RECONNECT_BACKOFF_FACTOR = 2;
|
|
14
|
+
const DEFAULT_HEARTBEAT_INTERVAL_MS = 10_000;
|
|
15
|
+
const DEFAULT_HEARTBEAT_TIMEOUT_MS = 10_000;
|
|
12
16
|
/** SDK-owned live match session implementation. */
|
|
13
17
|
export class MatchSessionController {
|
|
14
18
|
/**
|
|
@@ -25,6 +29,7 @@ export class MatchSessionController {
|
|
|
25
29
|
#matches;
|
|
26
30
|
#openConnection;
|
|
27
31
|
#autoReconnect;
|
|
32
|
+
#heartbeat;
|
|
28
33
|
#access;
|
|
29
34
|
#connection;
|
|
30
35
|
#connectionState = 'idle';
|
|
@@ -49,6 +54,13 @@ export class MatchSessionController {
|
|
|
49
54
|
...(options.options?.handshakeTimeoutMs == null ? {} : { handshakeTimeoutMs: options.options.handshakeTimeoutMs }),
|
|
50
55
|
};
|
|
51
56
|
this.#autoReconnect = normalizeAutoReconnect(options.options?.autoReconnect);
|
|
57
|
+
if (this.#autoReconnect.heartbeat != null) {
|
|
58
|
+
this.#heartbeat = createMatchSessionHeartbeat({
|
|
59
|
+
config: this.#autoReconnect.heartbeat,
|
|
60
|
+
sendPing: nonce => this.#heartbeatPing(nonce),
|
|
61
|
+
onTimeout: () => this.#heartbeatTimedOut(),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
52
64
|
this.#maxEventHistory = options.options?.maxEventHistory ?? DEFAULT_EVENT_HISTORY_LIMIT;
|
|
53
65
|
this.#maxErrorHistory = options.options?.maxErrorHistory ?? DEFAULT_ERROR_HISTORY_LIMIT;
|
|
54
66
|
if (options.access != null) {
|
|
@@ -71,7 +83,7 @@ export class MatchSessionController {
|
|
|
71
83
|
return [...this.#history];
|
|
72
84
|
}
|
|
73
85
|
get errorMessages() {
|
|
74
|
-
return this.#errors
|
|
86
|
+
return formatErrorMessages(this.#errors);
|
|
75
87
|
}
|
|
76
88
|
get matchId() {
|
|
77
89
|
return this.#matchId;
|
|
@@ -257,7 +269,10 @@ export class MatchSessionController {
|
|
|
257
269
|
connection.on('aiStatus', status => this.#setAiStatus(status)),
|
|
258
270
|
connection.on('error', error => this.#recordError(error)),
|
|
259
271
|
connection.on('message', message => this.#emitter.emit('message', message)),
|
|
260
|
-
connection.on('pong', pong =>
|
|
272
|
+
connection.on('pong', pong => {
|
|
273
|
+
this.#heartbeat?.acknowledge(pong.nonce);
|
|
274
|
+
this.#emitter.emit('pong', pong);
|
|
275
|
+
}),
|
|
261
276
|
];
|
|
262
277
|
}
|
|
263
278
|
#detachActiveConnection() {
|
|
@@ -272,6 +287,21 @@ export class MatchSessionController {
|
|
|
272
287
|
this.#connection = undefined;
|
|
273
288
|
activeConnection?.close();
|
|
274
289
|
}
|
|
290
|
+
/** Send one watchdog ping through the current live raw connection. */
|
|
291
|
+
#heartbeatPing(nonce) {
|
|
292
|
+
const connection = this.#connection;
|
|
293
|
+
if (connection == null || connection.connectionState !== 'open') {
|
|
294
|
+
throw new Error('match connection is not open');
|
|
295
|
+
}
|
|
296
|
+
connection.ping(nonce);
|
|
297
|
+
}
|
|
298
|
+
/** Close a silent socket so its existing abnormal-close recovery takes over. */
|
|
299
|
+
#heartbeatTimedOut() {
|
|
300
|
+
if (this.#connectionState !== 'open') {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
this.#connection?.close();
|
|
304
|
+
}
|
|
275
305
|
#cancelAutoReconnect() {
|
|
276
306
|
this.#reconnectGeneration += 1;
|
|
277
307
|
if (this.#reconnectTimer != null) {
|
|
@@ -430,6 +460,12 @@ export class MatchSessionController {
|
|
|
430
460
|
return;
|
|
431
461
|
}
|
|
432
462
|
this.#connectionState = state;
|
|
463
|
+
if (state === 'open') {
|
|
464
|
+
this.#heartbeat?.start();
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
this.#heartbeat?.stop();
|
|
468
|
+
}
|
|
433
469
|
this.#emitter.emit('connectionState', state);
|
|
434
470
|
this.#emitChange();
|
|
435
471
|
}
|
|
@@ -486,9 +522,24 @@ function normalizeAutoReconnect(options) {
|
|
|
486
522
|
const optionPolicy = options === true || options === false || options == null ? {} : options;
|
|
487
523
|
return {
|
|
488
524
|
...policy,
|
|
525
|
+
heartbeat: policy.enabled ? normalizeHeartbeat(optionPolicy.heartbeat) : undefined,
|
|
489
526
|
maxRetries: Math.max(0, Math.floor(nonNegativeNumber(optionPolicy.maxRetries, DEFAULT_RECONNECT_MAX_RETRIES))),
|
|
490
527
|
};
|
|
491
528
|
}
|
|
529
|
+
/** Normalize an enabled heartbeat without allowing zero-delay timer loops. */
|
|
530
|
+
function normalizeHeartbeat(options) {
|
|
531
|
+
if (options === false)
|
|
532
|
+
return undefined;
|
|
533
|
+
const policy = options === true || options == null ? {} : options;
|
|
534
|
+
return {
|
|
535
|
+
intervalMs: positiveInteger(policy.intervalMs, DEFAULT_HEARTBEAT_INTERVAL_MS),
|
|
536
|
+
timeoutMs: positiveInteger(policy.timeoutMs, DEFAULT_HEARTBEAT_TIMEOUT_MS),
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
/** Keep timer settings finite and strictly positive after user configuration. */
|
|
540
|
+
function positiveInteger(value, fallback) {
|
|
541
|
+
return Math.max(1, Math.floor(nonNegativeNumber(value, fallback)));
|
|
542
|
+
}
|
|
492
543
|
function sameReconnectState(left, right) {
|
|
493
544
|
if (left.phase !== right.phase) {
|
|
494
545
|
return false;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** Normalized timing configuration for one session heartbeat. */
|
|
2
|
+
export interface MatchSessionHeartbeatConfig {
|
|
3
|
+
/** Delay between a valid pong and the next ping. */
|
|
4
|
+
intervalMs: number;
|
|
5
|
+
/** Maximum wait for a pong matching the outstanding ping. */
|
|
6
|
+
timeoutMs: number;
|
|
7
|
+
}
|
|
8
|
+
/** Dependencies owned by the match-session controller. */
|
|
9
|
+
export interface MatchSessionHeartbeatOptions {
|
|
10
|
+
/** Normalized timing configuration. */
|
|
11
|
+
config: MatchSessionHeartbeatConfig;
|
|
12
|
+
/** Sends a transport ping carrying the supplied nonce. */
|
|
13
|
+
sendPing: (nonce: string) => void;
|
|
14
|
+
/** Replaces the active connection after a matching pong never arrives. */
|
|
15
|
+
onTimeout: () => void;
|
|
16
|
+
}
|
|
17
|
+
/** Small liveness timer for one already-open match socket. */
|
|
18
|
+
export interface MatchSessionHeartbeat {
|
|
19
|
+
/** Starts a new heartbeat generation. */
|
|
20
|
+
start: () => void;
|
|
21
|
+
/** Cancels all timers and ignores late callbacks from this generation. */
|
|
22
|
+
stop: () => void;
|
|
23
|
+
/** Accepts the pong only when it acknowledges the active ping. */
|
|
24
|
+
acknowledge: (nonce: string | null | undefined) => void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Create a ping/pong watchdog for a match session.
|
|
28
|
+
*
|
|
29
|
+
* One nonce is outstanding at most once. Every start and stop increments a
|
|
30
|
+
* generation, preventing a timer from a replaced socket from closing its
|
|
31
|
+
* successor.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createMatchSessionHeartbeat(options: MatchSessionHeartbeatOptions): MatchSessionHeartbeat;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a ping/pong watchdog for a match session.
|
|
3
|
+
*
|
|
4
|
+
* One nonce is outstanding at most once. Every start and stop increments a
|
|
5
|
+
* generation, preventing a timer from a replaced socket from closing its
|
|
6
|
+
* successor.
|
|
7
|
+
*/
|
|
8
|
+
export function createMatchSessionHeartbeat(options) {
|
|
9
|
+
let generation = 0;
|
|
10
|
+
let nonceIndex = 0;
|
|
11
|
+
let pendingNonce;
|
|
12
|
+
let pingTimer;
|
|
13
|
+
let timeoutTimer;
|
|
14
|
+
function clearTimers() {
|
|
15
|
+
if (pingTimer !== undefined)
|
|
16
|
+
clearTimeout(pingTimer);
|
|
17
|
+
if (timeoutTimer !== undefined)
|
|
18
|
+
clearTimeout(timeoutTimer);
|
|
19
|
+
pingTimer = undefined;
|
|
20
|
+
timeoutTimer = undefined;
|
|
21
|
+
}
|
|
22
|
+
function schedulePing(expectedGeneration) {
|
|
23
|
+
pingTimer = setTimeout(() => {
|
|
24
|
+
pingTimer = undefined;
|
|
25
|
+
if (expectedGeneration !== generation)
|
|
26
|
+
return;
|
|
27
|
+
const nonce = `match-session-heartbeat:${++nonceIndex}`;
|
|
28
|
+
pendingNonce = nonce;
|
|
29
|
+
timeoutTimer = setTimeout(() => {
|
|
30
|
+
timeoutTimer = undefined;
|
|
31
|
+
if (expectedGeneration !== generation || pendingNonce !== nonce)
|
|
32
|
+
return;
|
|
33
|
+
pendingNonce = undefined;
|
|
34
|
+
options.onTimeout();
|
|
35
|
+
}, options.config.timeoutMs);
|
|
36
|
+
try {
|
|
37
|
+
options.sendPing(nonce);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
if (expectedGeneration !== generation || pendingNonce !== nonce)
|
|
41
|
+
return;
|
|
42
|
+
clearTimeout(timeoutTimer);
|
|
43
|
+
timeoutTimer = undefined;
|
|
44
|
+
pendingNonce = undefined;
|
|
45
|
+
options.onTimeout();
|
|
46
|
+
}
|
|
47
|
+
}, options.config.intervalMs);
|
|
48
|
+
}
|
|
49
|
+
function stop() {
|
|
50
|
+
generation += 1;
|
|
51
|
+
pendingNonce = undefined;
|
|
52
|
+
clearTimers();
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
start: () => {
|
|
56
|
+
stop();
|
|
57
|
+
schedulePing(generation);
|
|
58
|
+
},
|
|
59
|
+
stop,
|
|
60
|
+
acknowledge: (nonce) => {
|
|
61
|
+
if (nonce == null || nonce !== pendingNonce)
|
|
62
|
+
return;
|
|
63
|
+
pendingNonce = undefined;
|
|
64
|
+
if (timeoutTimer !== undefined)
|
|
65
|
+
clearTimeout(timeoutTimer);
|
|
66
|
+
timeoutTimer = undefined;
|
|
67
|
+
schedulePing(generation);
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -100,11 +100,25 @@ export interface MatchSessionAutoReconnectPolicy {
|
|
|
100
100
|
maxDelayMs?: number | undefined;
|
|
101
101
|
/** Multiplier applied to each subsequent delay. */
|
|
102
102
|
backoffFactor?: number | undefined;
|
|
103
|
+
/**
|
|
104
|
+
* Detect sockets that remain reported as open after their transport path
|
|
105
|
+
* stops delivering server messages. Enabled by default with auto-reconnect.
|
|
106
|
+
*/
|
|
107
|
+
heartbeat?: MatchSessionHeartbeatOptions | undefined;
|
|
103
108
|
}
|
|
104
109
|
/**
|
|
105
110
|
* Automatic reconnect setting for one match session.
|
|
106
111
|
*/
|
|
107
112
|
export type MatchSessionAutoReconnectOptions = boolean | MatchSessionAutoReconnectPolicy;
|
|
113
|
+
/** Settings for the ping/pong liveness check owned by an auto-reconnecting session. */
|
|
114
|
+
export interface MatchSessionHeartbeatPolicy {
|
|
115
|
+
/** Delay between a successful pong and the next liveness ping. */
|
|
116
|
+
intervalMs?: number | undefined;
|
|
117
|
+
/** Maximum time to wait for the matching pong before reconnecting. */
|
|
118
|
+
timeoutMs?: number | undefined;
|
|
119
|
+
}
|
|
120
|
+
/** Enable, disable, or configure session heartbeat detection. */
|
|
121
|
+
export type MatchSessionHeartbeatOptions = boolean | MatchSessionHeartbeatPolicy;
|
|
108
122
|
/** Progress of automatic recovery after an abnormal match socket close. */
|
|
109
123
|
export type MatchSessionReconnectState = {
|
|
110
124
|
phase: 'idle';
|
|
@@ -3,7 +3,7 @@ import type { MatchHistoryFeedEntry } from '../generated/types/server-message.js
|
|
|
3
3
|
import type { ConnectionState } from '../session.js';
|
|
4
4
|
import type { MatchSessionMethods } from './methods.js';
|
|
5
5
|
import type { MatchSeat, MatchSessionReconnectState, MatchSessionState } from './session-state.js';
|
|
6
|
-
export type { MatchSeat, MatchSessionAccess, MatchSessionAutoReconnectOptions, MatchSessionAutoReconnectPolicy, MatchSessionConnectOptions, MatchSessionEvents, MatchSessionOptions, MatchSessionReconnectState, MatchSessionSnapshotPredicate, MatchSessionState, MatchSessionWaitOptions, } from './session-state.js';
|
|
6
|
+
export type { MatchSeat, MatchSessionAccess, MatchSessionAutoReconnectOptions, MatchSessionAutoReconnectPolicy, MatchSessionConnectOptions, MatchSessionEvents, MatchSessionHeartbeatOptions, MatchSessionHeartbeatPolicy, MatchSessionOptions, MatchSessionReconnectState, MatchSessionSnapshotPredicate, MatchSessionState, MatchSessionWaitOptions, } from './session-state.js';
|
|
7
7
|
/**
|
|
8
8
|
* Main ergonomic SDK API for interacting with one live match.
|
|
9
9
|
*
|
package/dist/match-session.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { MatchSessionController } from './match-session/controller.js';
|
|
2
2
|
export type { MatchSessionControllerOptions } from './match-session/controller.js';
|
|
3
|
-
export type { MatchSeat, MatchSession, MatchSessionAccess, MatchSessionAutoReconnectOptions, MatchSessionAutoReconnectPolicy, MatchSessionConnectOptions, MatchSessionEvents, MatchSessionOptions, MatchSessionReconnectState, MatchSessionSnapshotPredicate, MatchSessionState, MatchSessionWaitOptions, } from './match-session/types.js';
|
|
3
|
+
export type { MatchSeat, MatchSession, MatchSessionAccess, MatchSessionAutoReconnectOptions, MatchSessionAutoReconnectPolicy, MatchSessionConnectOptions, MatchSessionEvents, MatchSessionHeartbeatOptions, MatchSessionHeartbeatPolicy, MatchSessionOptions, MatchSessionReconnectState, MatchSessionSnapshotPredicate, MatchSessionState, MatchSessionWaitOptions, } from './match-session/types.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TypedEmitter } from '../internal/emitter.js';
|
|
2
|
-
import { SIMULATOR_REJECTION_CLOSE_CODE, simulatorSocketErrorPayload } from '../internal/errors.js';
|
|
2
|
+
import { formatErrorMessages, SIMULATOR_REJECTION_CLOSE_CODE, simulatorSocketErrorPayload, } from '../internal/errors.js';
|
|
3
3
|
import { websocketCloseInfo } from '../internal/websocket-event.js';
|
|
4
4
|
import { decodeSocketFrame } from '../internal/socket-frame.js';
|
|
5
5
|
import { passthroughValidator } from '../validators/validator.js';
|
|
@@ -56,7 +56,7 @@ class LobbyListSessionController {
|
|
|
56
56
|
return this.#connectionState;
|
|
57
57
|
}
|
|
58
58
|
get errorMessages() {
|
|
59
|
-
return this.#errors
|
|
59
|
+
return formatErrorMessages(this.#errors);
|
|
60
60
|
}
|
|
61
61
|
get errors() {
|
|
62
62
|
return [...this.#errors];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TournamentRoomServerMessage } from '../generated/index.js';
|
|
2
2
|
import type { PublicTournamentRoomSummary } from '../generated/types/tournament-room-list-response.js';
|
|
3
3
|
import type { TournamentRoomSnapshot } from '../generated/types/tournament-room-response.js';
|
|
4
4
|
import type { ErrorPayload, LobbyChatMessage, TournamentRoomMatchReadyPayload, TournamentRoomWelcomePayload } from '../generated/types/tournament-room-server-message.js';
|
|
5
5
|
import type { ConnectionState } from '../session.js';
|
|
6
6
|
import type { RoomPlayerPresenceEvent } from './lobby-types.js';
|
|
7
|
-
export type { CloseTournamentRoomRequest, CreateTournamentRoomRequest, CreateTournamentTableRequest, JoinTournamentRoomRequest, JoinTournamentTableRequest, LeaveTournamentRoomRequest, ReturnTournamentMatchRequest, StartTournamentEventRequest, SubmitTournamentDeckRequest, TournamentEventCommandRequest, TournamentRoomAccessResponse, TournamentRoomChatRequest, TournamentRoomChatResponse, TournamentRoomListResponse, TournamentRoomResponse, TournamentRoomServerMessage, TournamentRoomSyncRequest, UpdateTournamentRoomPlayerRequest, UpdateTournamentRoomSettingsRequest, };
|
|
7
|
+
export type { CloseTournamentRoomRequest, CreateTournamentRoomRequest, CreateTournamentTableRequest, JoinTournamentRoomRequest, JoinTournamentTableRequest, LeaveTournamentRoomRequest, ReturnTournamentMatchRequest, StartTournamentEventRequest, SubmitTournamentDeckRequest, TournamentEventCommandRequest, TournamentRoomAccessResponse, TournamentRoomChatRequest, TournamentRoomChatResponse, TournamentRoomListResponse, TournamentRoomResponse, TournamentRoomServerMessage, TournamentRoomSyncRequest, UpdateTournamentRoomPlayerRequest, UpdateTournamentRoomSettingsRequest, } from '../generated/index.js';
|
|
8
8
|
export type { PublicTournamentRoomSummary, TournamentRoomSnapshot };
|
|
9
9
|
export type { RoomPlayerPresenceEvent } from './lobby-types.js';
|
|
10
10
|
/** Minimal private tournament room credentials. */
|
package/dist/types.d.ts
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* `test/type-smoke.test.ts` enforces.
|
|
26
26
|
*/
|
|
27
27
|
export type { AiDifficulty, AiOpponentConfig, AiTrilogyFormatMode, FormatSetupInput, MatchScenarioInput, MctsConfigOverride, } from "./generated/types/create-match-request.js";
|
|
28
|
-
export type { AbilityWindow, ActionAbilitySource, ActionAbilityView, ActiveEffectDescriptionView, ActiveEffectView, AbilityTarget, AttachmentMode, AttackChoiceView, AttackTarget, AvailableAttackView, CapturedUnitView, CaptureOptionsView, CaptureSelection, CardArena, CardChoiceResourcePaymentOptionView, CardInstanceView, ConstructedFormat, CurrentAttackStateView, CurrentAttackView, DeckRegistrationView, DelayedEffectDescriptionView, DelayedEffectTimingView, DelayedEffectView, DistributionAssignment, DistributionDamageKindView, DistributionItemView, DistributionTargetView, DistributionTokenKindView, DynamicPowerLimit, EffectCardScopeView, EffectDurationView, EffectRestrictionView, EffectSourceView, EffectTargetView, ExploitOptionsView, FormatSeatView, GameTimerActiveClockView, GameTimerReserveView, GameTimerStateView, HiddenCardChoiceMode, HiddenZoneKind, InitiativeChoiceReason, InitiativeState, InstructedAttackView, LeaderActionView, LeaderDeployActionView, LeaderDeployCostView, LeaderDeployMode, LeaderDeployThresholdBonus, LeaderStateView, LimitedEventView, MatchEndReason, MatchFormat, MatchPhase, MatchResult, MatchSeriesView, MatchStatus, ModeChoiceView, NamedCardEffectDescriptionView, PendingAbilityAspectChoiceView, PendingAbilityAttackChoiceView, PendingAbilityCardChoiceView, PendingAbilityFamily, PendingAbilityModeChoiceView, PendingAbilityNameChoiceView, PendingAbilityOrderAbilityView, PendingAbilityOrderChoiceView, PendingAbilityOrderGroupView, PendingAbilityView, PendingChoiceView, PendingDistributionView, PendingUndoRequest, PlayActionView, PlayCardSourceView, PlayCardZone, PlayerTargetPattern, PresenceFilter, PromptState, RejectedPlayView, RelationFilter, ResourceCardView, ResourcePaymentOptionView, Seat, SeatDirection, SeatOfferIntent, SeatState, SelectionScope, SeriesEndReason, SeriesGameRecord, SeriesResultView, SharedCounterState, SmuggleActionView, SmuggleKind, TargetGroupPurpose, TargetSelectionGroup, TargetSelectionPlanView, TriggerWindowView, TwinSunsCounter, TwinSunsCountersView, UndoRequestReason, UniquenessFilter, UnitAbilitySuppressionView, UnitExtremum, UnitFilter, UnitStateView, UpgradeStateView, } from "./generated/types/get-match-response.js";
|
|
28
|
+
export type { AbilityWindow, ActionAbilitySource, ActionAbilityView, ActiveEffectDescriptionView, ActiveEffectView, AbilityTarget, AttachmentMode, AttackChoiceView, AttackTarget, AvailableAttackView, CapturedUnitView, CaptureOptionsView, CaptureSelection, CardArena, CardChoiceResourcePaymentOptionView, CardInstanceView, ConstructedFormat, CurrentAttackStateView, CurrentAttackView, DeckRegistrationView, DelayedEffectDescriptionView, DelayedEffectTimingView, DelayedEffectView, DistributionAssignment, DistributionDamageKindView, DistributionItemView, DistributionTargetView, DistributionTokenKindView, DynamicPowerLimit, EffectCardScopeView, EffectDurationView, EffectResolutionDraftStepView, EffectResolutionDraftView, EffectRestrictionView, EffectSourceView, EffectTargetView, ExploitOptionsView, FormatSeatView, GameTimerActiveClockView, GameTimerReserveView, GameTimerStateView, HiddenCardChoiceMode, HiddenZoneKind, InitiativeChoiceReason, InitiativeState, InstructedAttackView, LeaderActionView, LeaderDeployActionView, LeaderDeployCostView, LeaderDeployMode, LeaderDeployThresholdBonus, LeaderStateView, LimitedEventView, MatchEndReason, MatchFormat, MatchPhase, MatchResult, MatchSeriesView, MatchStatus, ModeChoiceView, NamedCardEffectDescriptionView, PendingAbilityAspectChoiceView, PendingAbilityAttackChoiceView, PendingAbilityCardChoiceView, PendingAbilityFamily, PendingAbilityModeChoiceView, PendingAbilityNameChoiceView, PendingAbilityOrderAbilityView, PendingAbilityOrderChoiceView, PendingAbilityOrderGroupView, PendingAbilityView, PendingChoiceView, PendingDistributionView, PendingUndoRequest, PlayActionView, PlayCardSourceView, PlayCardZone, PlayerTargetPattern, PresenceFilter, PromptState, RejectedPlayView, RelationFilter, ResourceCardView, ResourcePaymentOptionView, Seat, SeatDirection, SeatOfferIntent, SeatState, SelectionScope, SeriesEndReason, SeriesGameRecord, SeriesResultView, SharedCounterState, SmuggleActionView, SmuggleKind, TargetGroupPurpose, TargetSelectionGroup, TargetSelectionPlanView, TriggerWindowView, TwinSunsCounter, TwinSunsCountersView, UndoRequestReason, UniquenessFilter, UnitAbilitySuppressionView, UnitExtremum, UnitFilter, UnitStateView, UpgradeStateView, } from "./generated/types/get-match-response.js";
|
|
29
29
|
export type { AspectCount } from "./generated/types/cards-response.js";
|
|
30
30
|
export type { CloseTournamentRoomActiveMatches } from "./generated/types/close-tournament-room-request.js";
|
|
31
31
|
export type { CardDrawSource, TurnPassSource, UnitDefeatCause, } from "./generated/types/game-event.js";
|
package/dist/validators.d.ts
CHANGED
|
@@ -138,7 +138,7 @@ export interface SchemaTypeMap {
|
|
|
138
138
|
* ```ts
|
|
139
139
|
* import { parseSchema } from '@my-swu/simulator-client'
|
|
140
140
|
*
|
|
141
|
-
* const health = parseSchema('health-response', { status: 'ok' })
|
|
141
|
+
* const health = parseSchema('health-response', { buildSha: 'development', status: 'ok' })
|
|
142
142
|
* console.log(health.status)
|
|
143
143
|
* ```
|
|
144
144
|
*
|
package/dist/validators.js
CHANGED
|
@@ -11,7 +11,7 @@ import { hasUnknownDiscriminant, warmDiscriminants } from './validators/discrimi
|
|
|
11
11
|
* ```ts
|
|
12
12
|
* import { parseSchema } from '@my-swu/simulator-client'
|
|
13
13
|
*
|
|
14
|
-
* const health = parseSchema('health-response', { status: 'ok' })
|
|
14
|
+
* const health = parseSchema('health-response', { buildSha: 'development', status: 'ok' })
|
|
15
15
|
* console.log(health.status)
|
|
16
16
|
* ```
|
|
17
17
|
*
|