@indiegems/gem-web-sdk 9.1.3 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sdk.d.ts CHANGED
@@ -157,6 +157,11 @@ type AffixSelection = {
157
157
  "pool": AffixPoolRef;
158
158
  "respect_groups"?: boolean;
159
159
  };
160
+ type BackfillPolicy = "fill_existing_first" | "prefer_new_match";
161
+ type BackfillSettings = {
162
+ "enabled": boolean;
163
+ "policy"?: BackfillPolicy;
164
+ };
160
165
  type Boundary = {
161
166
  "boundary"?: string;
162
167
  "reset_time"?: string;
@@ -230,11 +235,20 @@ type LevelDefinition = {
230
235
  "rewards"?: RecipeOperation[];
231
236
  "threshold": number;
232
237
  };
238
+ type MatchmakingSettings = {
239
+ "backfill"?: null | BackfillSettings;
240
+ "cluster_stagger_seconds"?: number;
241
+ "enabled": boolean;
242
+ "fill_window_seconds"?: number;
243
+ "strategy"?: MatchmakingStrategy;
244
+ "ticket_expiry_seconds"?: number | null;
245
+ };
246
+ type MatchmakingStrategy = "fifo";
233
247
  type OrderBySpec = {
234
248
  "column": RunValueColumn;
235
249
  "direction": SortDirection;
236
250
  };
237
- type OrderSource$1 = "real_money_purchase" | "real_money_refund" | "full_game_purchase" | "full_game_refund" | "platform_purchase" | "reward" | "admin" | "system" | "promo" | "game_consume" | "play" | "recipe" | "transfer" | "platform_funded_game_inventory_purchase" | "earning_reset";
251
+ type OrderSource$1 = "real_money_purchase" | "real_money_refund" | "full_game_purchase" | "full_game_refund" | "platform_purchase" | "reward" | "admin" | "system" | "promo" | "game_consume" | "play" | "recipe" | "transfer" | "platform_funded_game_inventory_purchase" | "earning_reset" | "test_account_provision" | "developer_grant";
238
252
  type OverflowBehavior$1 = "fail" | "clamp" | "allow";
239
253
  type PityEffect = "guarantee_tier" | {
240
254
  "weight_boost": {
@@ -452,6 +466,7 @@ type SnapshotGameRoomTemplate = {
452
466
  "id": string;
453
467
  "idle_timeout_seconds"?: number | null;
454
468
  "match_type": string;
469
+ "matchmaking"?: null | MatchmakingSettings;
455
470
  "max_match_duration_seconds"?: number | null;
456
471
  "max_players": number;
457
472
  "min_players": number;
@@ -523,6 +538,7 @@ type SnapshotProgression = {
523
538
  "display_name"?: string | null;
524
539
  "icon_url"?: string | null;
525
540
  "id": string;
541
+ "localized"?: Record<string, unknown>;
526
542
  "progression_type": string;
527
543
  "slug"?: string | null;
528
544
  "sort_order": number;
@@ -560,6 +576,7 @@ type SnapshotRewardedPlacement = {
560
576
  "grants": SnapshotRewardGrant[];
561
577
  "max_held"?: number | null;
562
578
  "max_per_day"?: number | null;
579
+ "min_watch_secs"?: number | null;
563
580
  "placement": string;
564
581
  "reward_class": string;
565
582
  "without_ads": string;
@@ -1524,26 +1541,6 @@ interface ClusterTarget {
1524
1541
  readonly id: string;
1525
1542
  readonly pressure: string;
1526
1543
  }
1527
- type RoomArgScalar = string | number | boolean;
1528
- type RoomArgValue$1 = RoomArgScalar | readonly RoomArgScalar[];
1529
- type RoomArgs = Readonly<Record<string, RoomArgValue$1>>;
1530
- type RoomArgType$1 = "string" | "int" | "float" | "bool" | (string & {});
1531
- interface RoomArgEntry {
1532
- readonly name: string;
1533
- readonly type: RoomArgType$1;
1534
- readonly list: boolean;
1535
- readonly required: boolean;
1536
- readonly mutable: boolean;
1537
- readonly fixed?: RoomArgValue$1;
1538
- readonly default?: RoomArgValue$1;
1539
- readonly description?: string;
1540
- readonly allowed?: readonly RoomArgScalar[];
1541
- readonly min?: number;
1542
- readonly max?: number;
1543
- readonly minItems?: number;
1544
- readonly maxItems?: number;
1545
- readonly maxLength?: number;
1546
- }
1547
1544
  type DedicatedServerFailure = "timeout" | "aborted" | "allocation_failed" | "no_server_ready" | "start_rate_limited" | "p2p_unavailable" | "unsupported_protocol" | "credential_expired" | "credential_reused" | "join_rate_limited" | "signaling_unavailable" | "signaling_failed" | "offer_refused" | "invalid_sdp" | "media_refused" | "connection_failed" | "join_refused" | "match_ended" | "misconfigured";
1548
1545
  declare class DedicatedServerError extends Error {
1549
1546
  readonly reason: DedicatedServerFailure;
@@ -1652,6 +1649,26 @@ interface TransportAdvert {
1652
1649
  declare function readTemplateTransports(value: unknown): readonly TransportKind[] | null;
1653
1650
  declare function readTransportAdvert(settings: unknown, forMatch?: string): TransportAdvert | null;
1654
1651
  declare function webTransportAvailable(): boolean;
1652
+ type RoomArgScalar = string | number | boolean;
1653
+ type RoomArgValue$1 = RoomArgScalar | readonly RoomArgScalar[];
1654
+ type RoomArgs = Readonly<Record<string, RoomArgValue$1>>;
1655
+ type RoomArgType$1 = "string" | "int" | "float" | "bool" | (string & {});
1656
+ interface RoomArgEntry {
1657
+ readonly name: string;
1658
+ readonly type: RoomArgType$1;
1659
+ readonly list: boolean;
1660
+ readonly required: boolean;
1661
+ readonly mutable: boolean;
1662
+ readonly fixed?: RoomArgValue$1;
1663
+ readonly default?: RoomArgValue$1;
1664
+ readonly description?: string;
1665
+ readonly allowed?: readonly RoomArgScalar[];
1666
+ readonly min?: number;
1667
+ readonly max?: number;
1668
+ readonly minItems?: number;
1669
+ readonly maxItems?: number;
1670
+ readonly maxLength?: number;
1671
+ }
1655
1672
  type RoomStatus = "open" | "in_game" | "closed" | (string & {});
1656
1673
  type MatchConnectionState = "disconnected" | "connecting" | "connected" | "suspended";
1657
1674
  type MatchSessionPhase = "none" | "starting" | "ready" | "connected" | "suspended" | "ended" | (string & {});
@@ -1749,6 +1766,38 @@ interface RoomOperationError {
1749
1766
  readonly message: string;
1750
1767
  readonly retryable: boolean;
1751
1768
  }
1769
+ interface QueueForMatchOptions {
1770
+ readonly templateSlugs: readonly string[];
1771
+ readonly partyId?: string;
1772
+ readonly signal?: AbortSignal;
1773
+ }
1774
+ type MatchTicketStatus = "queued" | "matched" | "expired" | "cancelled" | "failed" | "lost" | "unavailable";
1775
+ type MatchTicketOutcome = {
1776
+ readonly status: "matched";
1777
+ readonly room: Room;
1778
+ } | {
1779
+ readonly status: "expired";
1780
+ readonly reason: string;
1781
+ } | {
1782
+ readonly status: "cancelled";
1783
+ readonly reason: string;
1784
+ } | {
1785
+ readonly status: "failed";
1786
+ readonly reason: string;
1787
+ } | {
1788
+ readonly status: "lost";
1789
+ } | {
1790
+ readonly status: "unavailable";
1791
+ };
1792
+ interface MatchTicket {
1793
+ readonly id: string;
1794
+ readonly status: MatchTicketStatus;
1795
+ readonly partySize: number;
1796
+ readonly queuedAt: number;
1797
+ readonly expiresAt: number;
1798
+ readonly outcome: Promise<MatchTicketOutcome>;
1799
+ cancel(): Promise<MatchTicketOutcome>;
1800
+ }
1752
1801
  interface CreateRoomOptions {
1753
1802
  readonly name: string;
1754
1803
  readonly maxPlayers?: number;
@@ -1891,6 +1940,7 @@ interface RoomManager {
1891
1940
  join(roomId: string, options?: JoinRoomOptions): Promise<Room>;
1892
1941
  joinByCode(code: string, options?: JoinRoomOptions): Promise<Room>;
1893
1942
  quickJoin(options: QuickJoinOptions): Promise<Room>;
1943
+ queueForMatch(options: QueueForMatchOptions): Promise<MatchTicket>;
1894
1944
  list(options?: ListRoomsOptions): Promise<RoomPage>;
1895
1945
  myRooms(signal?: AbortSignal): Promise<readonly RoomSummary[]>;
1896
1946
  leave(options?: {
@@ -1916,6 +1966,7 @@ interface RoomManager {
1916
1966
  }): Promise<void>;
1917
1967
  readonly gameId: string | null;
1918
1968
  readonly currentRoom: Room | null;
1969
+ readonly currentTicket: MatchTicket | null;
1919
1970
  readonly currentMatch: ReadyMatch | null;
1920
1971
  readonly matchConnectionState: MatchConnectionState;
1921
1972
  readonly matchSession: MatchSession;