@indiegems/gem-web-sdk 5.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.
@@ -0,0 +1,1078 @@
1
+ interface Clock {
2
+ now(): number;
3
+ setTimeout(fn: () => void, ms: number): unknown;
4
+ clearTimeout(handle: unknown): void;
5
+ }
6
+ declare const CONDITIONAL_HEADERS: readonly [
7
+ "if-match",
8
+ "if-none-match"
9
+ ];
10
+ type ConditionalRequestHeaders = Partial<Record<(typeof CONDITIONAL_HEADERS)[number], string>>;
11
+ interface TransportRequest {
12
+ readonly method: "GET" | "PUT" | "POST" | "PATCH" | "DELETE";
13
+ readonly path: string;
14
+ readonly body?: unknown;
15
+ readonly headers?: ConditionalRequestHeaders;
16
+ readonly signal?: AbortSignal;
17
+ readonly keepalive?: boolean;
18
+ }
19
+ interface TransportResponse {
20
+ readonly status: number;
21
+ readonly body: unknown;
22
+ readonly etag?: string;
23
+ readonly retryAfterSeconds?: number;
24
+ }
25
+ interface Transport {
26
+ request(request: TransportRequest): Promise<TransportResponse>;
27
+ }
28
+ type Base64String = string & {
29
+ readonly __contentEncoding: "base64";
30
+ };
31
+ interface ClientOptions {
32
+ readonly transport: Transport;
33
+ readonly clock: Clock;
34
+ readonly maxRetries?: number;
35
+ }
36
+ interface RequestOptions {
37
+ readonly keepalive?: boolean;
38
+ readonly ifMatch?: string;
39
+ readonly replaySafe?: boolean;
40
+ }
41
+ interface VersionedGetOptions {
42
+ readonly signal?: AbortSignal;
43
+ readonly ifNoneMatch?: string;
44
+ }
45
+ type VersionedResponse<T> = {
46
+ readonly modified: true;
47
+ readonly body: T;
48
+ readonly etag?: string;
49
+ } | {
50
+ readonly modified: false;
51
+ readonly etag?: string;
52
+ };
53
+ declare class GemClient {
54
+ private readonly options;
55
+ constructor(options: ClientOptions);
56
+ get<T>(path: string, signal?: AbortSignal): Promise<T>;
57
+ getWithEtag<T>(path: string, options?: VersionedGetOptions): Promise<VersionedResponse<T>>;
58
+ put<T>(path: string, body: unknown, signal?: AbortSignal, options?: RequestOptions): Promise<T>;
59
+ post<T>(path: string, body: unknown, signal?: AbortSignal, options?: RequestOptions): Promise<T>;
60
+ patch<T>(path: string, body: unknown, signal?: AbortSignal, options?: RequestOptions): Promise<T>;
61
+ delete<T>(path: string, signal?: AbortSignal, options?: RequestOptions): Promise<T>;
62
+ private send;
63
+ private sendRaw;
64
+ private backoff;
65
+ }
66
+ interface GameApi {
67
+ readonly client: GemClient;
68
+ gameId(): string;
69
+ }
70
+ type ActiveWindowResponse = {
71
+ "ends_at": string;
72
+ "window_id": string;
73
+ };
74
+ type AdminActionRequest = {
75
+ "action": "mute";
76
+ "player_id": string;
77
+ } | {
78
+ "action": "unmute";
79
+ "player_id": string;
80
+ } | {
81
+ "action": "remove";
82
+ "player_id": string;
83
+ } | {
84
+ "action": "ban";
85
+ "player_id": string;
86
+ } | {
87
+ "action": "move_channel";
88
+ "channel": string;
89
+ "player_id": string;
90
+ } | {
91
+ "action": "proximity_params";
92
+ "hearing_radius"?: number | null;
93
+ "max_voices"?: number | null;
94
+ };
95
+ type BatchOrderItem = {
96
+ "nonce"?: string | null;
97
+ "operations": OperationRequest[];
98
+ "source_reference"?: string | null;
99
+ };
100
+ type BatchOrderItemResult = {
101
+ "auto_claimed_rewards"?: InventoryChange[];
102
+ "changes": InventoryChange[];
103
+ "nonce"?: string | null;
104
+ "order_id": string;
105
+ "status": OrderStatus;
106
+ };
107
+ type BatchOrderRequest = {
108
+ "channel"?: null | GameChannel;
109
+ "game_id"?: string | null;
110
+ "orders": BatchOrderItem[];
111
+ "source": OrderSource;
112
+ };
113
+ type BatchOrderResponse = {
114
+ "etag"?: string | null;
115
+ "orders": BatchOrderItemResult[];
116
+ "status": OrderStatus;
117
+ };
118
+ type BucketBalanceResponse = {
119
+ "balance": number;
120
+ "bucket": string;
121
+ };
122
+ type CatalogItem = {
123
+ "consumable": boolean;
124
+ "display_name"?: string | null;
125
+ "fungible": boolean;
126
+ "icon_url"?: string | null;
127
+ "item_id": string;
128
+ "platform_prices": PurchasePrice[];
129
+ "stack_size"?: number | null;
130
+ };
131
+ type CatalogRecipe = {
132
+ "availability_end"?: string | null;
133
+ "availability_start"?: string | null;
134
+ "catalog_id": string;
135
+ "cooldown_seconds"?: number | null;
136
+ "display_name"?: string | null;
137
+ "max_uses"?: number | null;
138
+ "platform_prices": PurchasePrice[];
139
+ "recipe_id": string;
140
+ "recipe_type": string;
141
+ };
142
+ type ClientPlatform = "universal" | "mobile" | "web";
143
+ type CreateOrderRequest = {
144
+ "channel"?: null | GameChannel;
145
+ "game_id"?: string | null;
146
+ "nonce"?: string | null;
147
+ "operations": OperationRequest[];
148
+ "source": OrderSource;
149
+ "source_reference"?: string | null;
150
+ };
151
+ type CreateSessionRequest = {
152
+ "channel_assignments": Record<string, unknown>;
153
+ "game_id": string;
154
+ "members": string[];
155
+ "mode_override"?: string | null;
156
+ "region": string;
157
+ "session_id": string;
158
+ "text_chat_enabled_override"?: boolean | null;
159
+ };
160
+ type CurrencyBalanceResponse = {
161
+ "buckets"?: BucketBalanceResponse[] | null;
162
+ "currency_id": string;
163
+ "total": number;
164
+ };
165
+ type CurrencyResetOverride = {
166
+ "bucket": string;
167
+ "currency_id": string;
168
+ "last_reset_at"?: string | null;
169
+ "next_reset_at"?: string | null;
170
+ };
171
+ type DropRateEntry = {
172
+ "drop_rate": number;
173
+ "entry_id": string;
174
+ "rarity_tier"?: string | null;
175
+ "weight": number;
176
+ };
177
+ type DropRatesResponse = {
178
+ "allow_duplicate_rolls": boolean;
179
+ "entries": DropRateEntry[];
180
+ "loot_table_id": string;
181
+ "name": string;
182
+ "roll_count": number;
183
+ "total_weight": number;
184
+ };
185
+ type EntityLeaderboardEntryResponse = {
186
+ "occurred_at": number;
187
+ "properties"?: Record<string, unknown> | null;
188
+ "rank": number;
189
+ "stats"?: Record<string, unknown> | null;
190
+ };
191
+ type EntityLeaderboardResponse = {
192
+ "bucket_1"?: string | null;
193
+ "bucket_2"?: string | null;
194
+ "entity_id": string;
195
+ "entity_type": EntityType;
196
+ "entries": EntityLeaderboardEntryResponse[];
197
+ "generated_at": number;
198
+ "leaderboard_type": string;
199
+ "personal_best"?: null | EntityLeaderboardEntryResponse;
200
+ "run_type": string;
201
+ "total_runs": number;
202
+ "total_runs_exact": boolean;
203
+ };
204
+ type EntityType = "player" | "character";
205
+ type ErrorDetail = {
206
+ "code": string;
207
+ "details"?: unknown;
208
+ "message": string;
209
+ };
210
+ type ErrorResponse = {
211
+ "error": ErrorDetail;
212
+ };
213
+ type EventDefinitionResponse = {
214
+ "created_at": string;
215
+ "description": string;
216
+ "display_name": string;
217
+ "event_id": string;
218
+ "icon_url": string;
219
+ "is_enabled": boolean;
220
+ "metadata": unknown;
221
+ "schedule": unknown;
222
+ "schedule_type": string;
223
+ "slug"?: string | null;
224
+ "status"?: null | EventStatusInfo;
225
+ "updated_at": string;
226
+ };
227
+ type EventListResponse = {
228
+ "events": EventDefinitionResponse[];
229
+ "limit": number;
230
+ "offset": number;
231
+ "total": number;
232
+ };
233
+ type EventStatusInfo = {
234
+ "current_window"?: null | ActiveWindowResponse;
235
+ "is_active": boolean;
236
+ "next_window"?: null | WindowPreviewResponse;
237
+ };
238
+ type FidelityReport = {
239
+ "caveats": string[];
240
+ "defaults_applied": string[];
241
+ };
242
+ type GameChannel = "dev" | "test" | "release";
243
+ type GameRoomMemberResponseV2 = {
244
+ "avatar_icon_id"?: string | null;
245
+ "discriminator"?: string | null;
246
+ "display_name"?: string | null;
247
+ "display_tag"?: string | null;
248
+ "group_id"?: string | null;
249
+ "is_ready": boolean;
250
+ "joined_at": number;
251
+ "platform"?: null | ClientPlatform;
252
+ "player_id": string;
253
+ "role": string;
254
+ };
255
+ type GameRoomResponseV2 = {
256
+ "created_at": number;
257
+ "game_channel": string;
258
+ "game_id": string;
259
+ "game_room_type": string;
260
+ "host_player_id": string;
261
+ "id": string;
262
+ "is_public": boolean;
263
+ "join_code"?: string | null;
264
+ "match_id"?: string | null;
265
+ "max_players": number;
266
+ "member_count": number;
267
+ "members": GameRoomMemberResponseV2[];
268
+ "name": string;
269
+ "region"?: string | null;
270
+ "room_args"?: Record<string, unknown> | null;
271
+ "room_args_template"?: null | RoomArgsTemplate;
272
+ "settings"?: unknown;
273
+ "started_at"?: number | null;
274
+ "status": string;
275
+ "template_id"?: string | null;
276
+ "template_slug"?: string | null;
277
+ "transports": string[];
278
+ "updated_at": number;
279
+ "version": number;
280
+ };
281
+ type GameRoomSummaryResponse = {
282
+ "created_at": number;
283
+ "game_channel": string;
284
+ "game_id": string;
285
+ "game_room_type": string;
286
+ "host_player_id": string;
287
+ "id": string;
288
+ "is_public": boolean;
289
+ "max_players": number;
290
+ "member_count": number;
291
+ "name": string;
292
+ "status": string;
293
+ "template_slug"?: string | null;
294
+ };
295
+ type GameRoomTemplateListResponse = {
296
+ "templates": GameRoomTemplateResponse[];
297
+ };
298
+ type GameRoomTemplateResponse = {
299
+ "allow_host_transfer": boolean;
300
+ "allow_join_in_progress": boolean;
301
+ "allow_kick": boolean;
302
+ "allow_party_join": boolean;
303
+ "allow_ready_check": boolean;
304
+ "auto_close_when_empty": boolean;
305
+ "auto_leave_on_client_shutdown": boolean;
306
+ "auto_start_host": boolean;
307
+ "default_visibility": string;
308
+ "game_id"?: string | null;
309
+ "game_room_ttl_seconds": number;
310
+ "game_room_type": string;
311
+ "id": string;
312
+ "idle_timeout_seconds"?: number | null;
313
+ "is_active": boolean;
314
+ "match_type": MatchType;
315
+ "max_match_duration_seconds": number;
316
+ "max_players": number;
317
+ "min_players": number;
318
+ "name": string;
319
+ "notify_on_host_transfer": string;
320
+ "notify_on_join": string;
321
+ "notify_on_kick": string;
322
+ "notify_on_leave": string;
323
+ "notify_on_ready": string;
324
+ "offline_member_timeout_seconds"?: number | null;
325
+ "room_args_template"?: null | RoomArgsTemplate;
326
+ "show_in_browser": boolean;
327
+ "slug"?: string | null;
328
+ "transports": string[];
329
+ };
330
+ type GameRoomsListResponse = {
331
+ "game_rooms": GameRoomSummaryResponse[];
332
+ "next_cursor"?: string | null;
333
+ };
334
+ type InitiateTransferRequest = {
335
+ "currencies"?: TransferCurrencyRequest[];
336
+ "items"?: TransferItemRequest[];
337
+ "message"?: string | null;
338
+ "nonce": string;
339
+ "source_entity_id": string;
340
+ "source_entity_type": string;
341
+ "target_entity_id": string;
342
+ "target_entity_type": string;
343
+ };
344
+ type InventoryChange = {
345
+ "balance_after": number;
346
+ "balance_before": number;
347
+ "bucket": string;
348
+ "currency_id": string;
349
+ "delta": number;
350
+ "type": "currency";
351
+ } | {
352
+ "delta": number;
353
+ "instance_id": string;
354
+ "item_definition_id": string;
355
+ "quantity_after": number;
356
+ "quantity_before": number;
357
+ "type": "item";
358
+ } | {
359
+ "instance_id": string;
360
+ "item_definition_id": string;
361
+ "properties_after": unknown;
362
+ "properties_before": unknown;
363
+ "type": "item_properties_changed";
364
+ } | {
365
+ "custom_data_after": unknown;
366
+ "custom_data_before": unknown;
367
+ "instance_id": string;
368
+ "item_definition_id": string;
369
+ "type": "item_custom_data_changed";
370
+ } | {
371
+ "completed": boolean;
372
+ "delta": number;
373
+ "depth"?: number;
374
+ "op_index"?: number | null;
375
+ "progression_definition_id": string;
376
+ "type": "progression";
377
+ "value_after": number;
378
+ "value_before": number;
379
+ } | {
380
+ "clamped_by": PlatformGrantClamp;
381
+ "granted": number;
382
+ "mapping_index": number;
383
+ "outcome": PlatformGrantOutcome;
384
+ "progression_definition_id": string;
385
+ "reason"?: string | null;
386
+ "requested": number;
387
+ "target_currency_id": string;
388
+ "type": "platform_grant";
389
+ } | {
390
+ "balance_after": number;
391
+ "balance_before": number;
392
+ "bucket": string;
393
+ "currency_id": string;
394
+ "type": "currency_bucket_reset";
395
+ } | {
396
+ "progression_definition_id": string;
397
+ "reset_reason": string;
398
+ "type": "progression_reset";
399
+ "value_before": number;
400
+ "was_completed": boolean;
401
+ } | {
402
+ "type": "unknown";
403
+ };
404
+ type InventoryResponse = {
405
+ "currencies": PaginatedCollectionCurrencyBalanceResponse;
406
+ "entity_id": string;
407
+ "etag": string;
408
+ "items": PaginatedCollectionItemInstanceResponse;
409
+ "progressions": PaginatedCollectionProgressionStateResponse;
410
+ "scope": InventoryScopeResponse;
411
+ };
412
+ type InventoryScopeResponse = {
413
+ "type": "platform";
414
+ } | {
415
+ "channel": GameChannel;
416
+ "game_id": string;
417
+ "type": "game";
418
+ };
419
+ type ItemInstanceResponse = {
420
+ "acquired_at": number;
421
+ "custom_data"?: unknown;
422
+ "instance_id": string;
423
+ "item_definition_id": string;
424
+ "properties": unknown;
425
+ "quantity": number;
426
+ };
427
+ type LeaderboardEntryResponse = {
428
+ "discriminator"?: string | null;
429
+ "display_name"?: string | null;
430
+ "display_tag"?: string | null;
431
+ "entity_id"?: string | null;
432
+ "entity_type"?: null | EntityType;
433
+ "is_viewer"?: boolean;
434
+ "occurred_at": number;
435
+ "properties"?: Record<string, unknown> | null;
436
+ "rank": number;
437
+ "stats"?: Record<string, unknown> | null;
438
+ };
439
+ type LeaderboardResponse = {
440
+ "bucket_1"?: string | null;
441
+ "bucket_2"?: string | null;
442
+ "entries": LeaderboardEntryResponse[];
443
+ "generated_at": number;
444
+ "leaderboard_type": string;
445
+ "run_type": string;
446
+ "update_frequency_seconds": number;
447
+ };
448
+ type ListTransfersResponse = {
449
+ "next_cursor"?: string | null;
450
+ "transfers": TransferResponse[];
451
+ };
452
+ type LootRollResultResponse = {
453
+ "entry_id": string;
454
+ "grants": InventoryChange[];
455
+ "rarity_tier"?: string | null;
456
+ "roll_number": number;
457
+ "was_replacement": boolean;
458
+ };
459
+ type MatchType = "dedicated" | "p2p" | "none";
460
+ type OperationRequest = {
461
+ "amount": number;
462
+ "bucket"?: string | null;
463
+ "currency_id": SlugOrId;
464
+ "overflow"?: OverflowBehavior;
465
+ "reason"?: string | null;
466
+ "type": "currency_grant";
467
+ } | {
468
+ "amount": number;
469
+ "bucket"?: string | null;
470
+ "currency_id": SlugOrId;
471
+ "overflow"?: OverflowBehavior;
472
+ "reason"?: string | null;
473
+ "type": "currency_consume";
474
+ } | {
475
+ "amount": number;
476
+ "bucket"?: string | null;
477
+ "currency_id": SlugOrId;
478
+ "reason"?: string | null;
479
+ "type": "currency_set";
480
+ } | {
481
+ "custom_data"?: Record<string, unknown> | null;
482
+ "instance_id"?: string | null;
483
+ "item_definition_id": SlugOrId;
484
+ "overflow"?: OverflowBehavior;
485
+ "properties"?: Record<string, unknown> | null;
486
+ "quantity"?: number;
487
+ "reason"?: string | null;
488
+ "type": "item_grant";
489
+ } | {
490
+ "instance_id"?: string | null;
491
+ "item_definition_id": SlugOrId;
492
+ "overflow"?: OverflowBehavior;
493
+ "quantity"?: number;
494
+ "reason"?: string | null;
495
+ "type": "item_remove";
496
+ } | {
497
+ "instance_id": string;
498
+ "item_definition_id": SlugOrId;
499
+ "properties": Record<string, unknown>;
500
+ "reason"?: string | null;
501
+ "type": "item_set_properties";
502
+ } | {
503
+ "instance_id": string;
504
+ "item_definition_id": SlugOrId;
505
+ "reason"?: string | null;
506
+ "type": "item_set_custom_data";
507
+ "updates": Record<string, unknown>;
508
+ } | {
509
+ "amount": number;
510
+ "progression_definition_id": SlugOrId;
511
+ "reason"?: string | null;
512
+ "type": "progression_add";
513
+ } | {
514
+ "progression_definition_id": SlugOrId;
515
+ "reason"?: string | null;
516
+ "type": "progression_set";
517
+ "value": number;
518
+ } | {
519
+ "progression_definition_id": SlugOrId;
520
+ "reason"?: string | null;
521
+ "type": "progression_max";
522
+ "value": number;
523
+ } | {
524
+ "progression_definition_id": SlugOrId;
525
+ "reason"?: string | null;
526
+ "type": "progression_reset";
527
+ };
528
+ type OrderListResponse = {
529
+ "has_more": boolean;
530
+ "next_cursor"?: string | null;
531
+ "orders": OrderRecordResponse[];
532
+ };
533
+ type OrderRecordResponse = {
534
+ "created_at": number;
535
+ "nonce"?: string | null;
536
+ "order_id": string;
537
+ "source": OrderSource;
538
+ "source_reference"?: string | null;
539
+ "status": string;
540
+ };
541
+ type OrderResponse = {
542
+ "changes"?: InventoryChange[];
543
+ "error"?: string | null;
544
+ "etag"?: string | null;
545
+ "order_id": string;
546
+ "status": OrderStatus;
547
+ };
548
+ type OrderSource = "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";
549
+ type OrderStatus = "completed" | "failed";
550
+ type OverflowBehavior = "fail" | "clamp" | "allow";
551
+ type PaginatedCollectionCurrencyBalanceResponse = {
552
+ "data": {
553
+ "buckets"?: BucketBalanceResponse[] | null;
554
+ "currency_id": string;
555
+ "total": number;
556
+ }[];
557
+ "has_more": boolean;
558
+ "next_cursor"?: string | null;
559
+ };
560
+ type PaginatedCollectionItemInstanceResponse = {
561
+ "data": {
562
+ "acquired_at": number;
563
+ "custom_data"?: unknown;
564
+ "instance_id": string;
565
+ "item_definition_id": string;
566
+ "properties": unknown;
567
+ "quantity": number;
568
+ }[];
569
+ "has_more": boolean;
570
+ "next_cursor"?: string | null;
571
+ };
572
+ type PaginatedCollectionProgressionStateResponse = {
573
+ "data": {
574
+ "completion_count": number;
575
+ "current_value": number;
576
+ "is_completed": boolean;
577
+ "progression_definition_id": string;
578
+ }[];
579
+ "has_more": boolean;
580
+ "next_cursor"?: string | null;
581
+ };
582
+ type PaginatedResponseSaveDataResponse = {
583
+ "data": {
584
+ "created_at": number;
585
+ "download_url"?: string | null;
586
+ "entity_id": string;
587
+ "entity_type": string;
588
+ "etag": string;
589
+ "key": string;
590
+ "metadata"?: unknown;
591
+ "size_bytes": number;
592
+ "updated_at": number;
593
+ }[];
594
+ "has_more": boolean;
595
+ "next_cursor"?: string | null;
596
+ };
597
+ type PlatformGrantClamp = "none" | "max_per_event" | "game_max_per_entity" | "platform_max_per_game_per_entity" | "max_balance";
598
+ type PlatformGrantOutcome = "fired" | "clamped" | "suppressed";
599
+ type ProgressionAddRequest = {
600
+ "amount": number;
601
+ "reason"?: string | null;
602
+ };
603
+ type ProgressionClaimRequest = {
604
+ "channel"?: null | GameChannel;
605
+ "game_id": string;
606
+ "reason"?: string | null;
607
+ "track_id"?: string | null;
608
+ };
609
+ type ProgressionResetRequest = {
610
+ "reason"?: string | null;
611
+ };
612
+ type ProgressionStateOverride = {
613
+ "last_reset_at"?: string | null;
614
+ "last_window_id"?: string | null;
615
+ "progression_definition_id": string;
616
+ "rewards_claimed_through"?: Record<string, unknown> | null;
617
+ };
618
+ type ProgressionStateResponse = {
619
+ "completion_count": number;
620
+ "current_value": number;
621
+ "is_completed": boolean;
622
+ "progression_definition_id": string;
623
+ };
624
+ type PurchaseCatalogResponse = {
625
+ "config_version": number;
626
+ "items": CatalogItem[];
627
+ "recipes": CatalogRecipe[];
628
+ };
629
+ type PurchasePrice = {
630
+ "platform_currency_id": string;
631
+ "price": number;
632
+ };
633
+ type PutSettingRequest = {
634
+ "value": Base64String;
635
+ };
636
+ type RecipeAvailabilityResponse = {
637
+ "can_execute": boolean;
638
+ "cooldown_expires_at"?: string | null;
639
+ "reasons": UnavailabilityReason[];
640
+ "recipe_id": string;
641
+ "uses_remaining"?: number | null;
642
+ };
643
+ type RecipeExecuteRequest = {
644
+ "catalog_id": SlugOrId;
645
+ "channel"?: null | GameChannel;
646
+ "game_id": string;
647
+ "nonce"?: string | null;
648
+ "recipe_id": SlugOrId;
649
+ };
650
+ type RecipeExecuteResponse = {
651
+ "auto_claimed_rewards": InventoryChange[];
652
+ "consumed": InventoryChange[];
653
+ "etag"?: string | null;
654
+ "granted": InventoryChange[];
655
+ "loot_results"?: LootRollResultResponse[] | null;
656
+ "order_id": string;
657
+ "status": OrderStatus;
658
+ };
659
+ type RecipeUsageListResponse = {
660
+ "usages": RecipeUsageResponse[];
661
+ };
662
+ type RecipeUsageResponse = {
663
+ "cooldown_expires_at"?: string | null;
664
+ "is_on_cooldown": boolean;
665
+ "last_used_at"?: string | null;
666
+ "recipe_id": string;
667
+ "use_count": number;
668
+ };
669
+ type RoomArgType = "string" | "int" | "float" | "bool";
670
+ type RoomArgsResponse = {
671
+ "room_args": Record<string, unknown>;
672
+ "room_args_template": RoomArgsTemplate;
673
+ };
674
+ type RoomArgsTemplate = {
675
+ "name": string;
676
+ } & {
677
+ "allowed"?: Record<string, unknown>[] | null;
678
+ "default"?: Record<string, unknown> | null;
679
+ "description"?: string | null;
680
+ "fixed"?: Record<string, unknown> | null;
681
+ "list"?: boolean;
682
+ "max"?: number | null;
683
+ "max_items"?: number | null;
684
+ "max_length"?: number | null;
685
+ "min"?: number | null;
686
+ "min_items"?: number | null;
687
+ "mutable"?: boolean | null;
688
+ "required"?: boolean;
689
+ "type": RoomArgType;
690
+ }[];
691
+ type SaveDataResponse = {
692
+ "created_at": number;
693
+ "download_url"?: string | null;
694
+ "entity_id": string;
695
+ "entity_type": string;
696
+ "etag": string;
697
+ "key": string;
698
+ "metadata"?: unknown;
699
+ "size_bytes": number;
700
+ "updated_at": number;
701
+ };
702
+ type SaveFinalizeRequest = {
703
+ "session_id": string;
704
+ };
705
+ type SaveUploadUrlRequest = {
706
+ "content_type"?: string;
707
+ "metadata"?: unknown;
708
+ "size_bytes": number;
709
+ };
710
+ type SaveUploadUrlResponse = {
711
+ "expires_at": number;
712
+ "session_id": string;
713
+ "upload_headers": Record<string, unknown>;
714
+ "upload_url": string;
715
+ };
716
+ type SettingResponse = {
717
+ "etag": string;
718
+ "key": string;
719
+ "updated_at": number;
720
+ "value": Base64String;
721
+ };
722
+ type SettingsListResponse = {
723
+ "settings": SettingResponse[];
724
+ };
725
+ type SimulateOrderRequest = {
726
+ "inventory": SuppliedInventory;
727
+ "order": CreateOrderRequest;
728
+ "overrides"?: SimulationOverrides;
729
+ "seed"?: string | null;
730
+ "simulated_at"?: string | null;
731
+ };
732
+ type SimulateOrderResponse = {
733
+ "auto_claimed_rewards": InventoryChange[];
734
+ "changes": InventoryChange[];
735
+ "fidelity": FidelityReport;
736
+ "generation_details"?: unknown;
737
+ "outcome": SimulationOutcome;
738
+ "resulting_etag": string;
739
+ "resulting_inventory": InventoryResponse;
740
+ "seed": string;
741
+ "simulation_id": string;
742
+ };
743
+ type SimulationFailure = {
744
+ "code": string;
745
+ "message": string;
746
+ "operation_index"?: number | null;
747
+ };
748
+ type SimulationOutcome = {
749
+ "failure"?: null | SimulationFailure;
750
+ "status": OrderStatus;
751
+ };
752
+ type SimulationOverrides = {
753
+ "currencies"?: CurrencyResetOverride[];
754
+ "progressions"?: ProgressionStateOverride[];
755
+ };
756
+ type SlugOrId = string;
757
+ type SuppliedBucketRow = {
758
+ "balance": number;
759
+ "bucket": string;
760
+ };
761
+ type SuppliedCurrencies = {
762
+ "data"?: SuppliedCurrencyRow[];
763
+ "has_more"?: boolean;
764
+ "next_cursor"?: string | null;
765
+ };
766
+ type SuppliedCurrencyRow = {
767
+ "buckets"?: SuppliedBucketRow[] | null;
768
+ "currency_id": string;
769
+ "total": number;
770
+ };
771
+ type SuppliedInventory = {
772
+ "currencies"?: SuppliedCurrencies;
773
+ "entity_id"?: string | null;
774
+ "etag"?: string;
775
+ "items"?: SuppliedItems;
776
+ "progressions"?: SuppliedProgressions;
777
+ "scope"?: null | SuppliedScope;
778
+ };
779
+ type SuppliedItemRow = {
780
+ "acquired_at"?: number | null;
781
+ "custom_data"?: unknown;
782
+ "instance_id": string;
783
+ "item_definition_id": string;
784
+ "properties"?: unknown;
785
+ "quantity": number;
786
+ };
787
+ type SuppliedItems = {
788
+ "data"?: SuppliedItemRow[];
789
+ "has_more"?: boolean;
790
+ "next_cursor"?: string | null;
791
+ };
792
+ type SuppliedProgressionRow = {
793
+ "completion_count": number;
794
+ "current_value": number;
795
+ "is_completed": boolean;
796
+ "progression_definition_id": string;
797
+ };
798
+ type SuppliedProgressions = {
799
+ "data"?: SuppliedProgressionRow[];
800
+ "has_more"?: boolean;
801
+ "next_cursor"?: string | null;
802
+ };
803
+ type SuppliedScope = {
804
+ "type": "platform";
805
+ } | {
806
+ "channel"?: null | GameChannel;
807
+ "game_id": string;
808
+ "type": "game";
809
+ };
810
+ type TransferCurrencyRequest = {
811
+ "amount": number;
812
+ "currency_id": string;
813
+ };
814
+ type TransferItemRequest = {
815
+ "instance_id"?: string | null;
816
+ "item_definition_id": string;
817
+ "quantity": number;
818
+ };
819
+ type TransferResponse = {
820
+ "created_at": string;
821
+ "currencies": unknown;
822
+ "expires_at": string;
823
+ "items": unknown;
824
+ "message"?: string | null;
825
+ "resolved_at"?: string | null;
826
+ "source_entity_id": string;
827
+ "source_entity_type": string;
828
+ "status": string;
829
+ "target_entity_id": string;
830
+ "target_entity_type": string;
831
+ "transfer_id": string;
832
+ };
833
+ type UnavailabilityReason = {
834
+ "type": "not_found";
835
+ } | {
836
+ "type": "inactive";
837
+ } | {
838
+ "type": "not_client_executable";
839
+ } | {
840
+ "available_from": string;
841
+ "type": "not_yet_available";
842
+ } | {
843
+ "expired_at": string;
844
+ "type": "expired";
845
+ } | {
846
+ "event_id": string;
847
+ "type": "event_not_active";
848
+ } | {
849
+ "expires_at": string;
850
+ "type": "on_cooldown";
851
+ } | {
852
+ "max_uses": number;
853
+ "type": "max_uses_reached";
854
+ } | {
855
+ "prerequisite_type": string;
856
+ "reference_id": string;
857
+ "type": "prerequisite_not_met";
858
+ } | {
859
+ "available": number;
860
+ "currency_id": string;
861
+ "required": number;
862
+ "type": "insufficient_currency";
863
+ } | {
864
+ "available": number;
865
+ "item_definition_id": string;
866
+ "required": number;
867
+ "type": "insufficient_items";
868
+ };
869
+ type UpdateGameRoomRequest = {
870
+ "is_public"?: boolean | null;
871
+ "max_players"?: number | null;
872
+ "name"?: string | null;
873
+ "room_args"?: Record<string, unknown> | null;
874
+ "settings"?: unknown;
875
+ };
876
+ type UpdateRoomArgsRequest = {
877
+ "room_args": Record<string, unknown>;
878
+ };
879
+ type WindowPreviewResponse = {
880
+ "ends_at": string;
881
+ "starts_at": string;
882
+ };
883
+ declare function acceptTransfer(api: GameApi, transfer_id: string, options?: {
884
+ signal?: AbortSignal;
885
+ }): Promise<TransferResponse>;
886
+ declare function addEntityProgression(api: GameApi, entity_type: string, entity_id: string, progression_definition_id: SlugOrId, body: ProgressionAddRequest, options?: {
887
+ signal?: AbortSignal;
888
+ }): Promise<OrderResponse>;
889
+ declare function adminAction(api: GameApi, session_id: string, body: AdminActionRequest, options?: {
890
+ signal?: AbortSignal;
891
+ }): Promise<void>;
892
+ declare function cancelInventoryTransfer(api: GameApi, transfer_id: string, options?: {
893
+ signal?: AbortSignal;
894
+ }): Promise<TransferResponse>;
895
+ declare function claimEntityProgressionRewards(api: GameApi, entity_type: string, entity_id: string, progression_definition_id: SlugOrId, body: ProgressionClaimRequest, options?: {
896
+ signal?: AbortSignal;
897
+ }): Promise<OrderResponse>;
898
+ declare function closeGameRoom(api: GameApi, game_room_id: string, options?: {
899
+ signal?: AbortSignal;
900
+ }): Promise<void>;
901
+ declare function createEntityBatchOrder(api: GameApi, entity_type: string, entity_id: string, body: BatchOrderRequest, options?: {
902
+ ifMatch?: string;
903
+ signal?: AbortSignal;
904
+ }): Promise<BatchOrderResponse>;
905
+ declare function createEntityOrder(api: GameApi, entity_type: string, entity_id: string, body: CreateOrderRequest, options?: {
906
+ ifMatch?: string;
907
+ signal?: AbortSignal;
908
+ }): Promise<OrderResponse>;
909
+ declare function createSession(api: GameApi, body: CreateSessionRequest, options?: {
910
+ signal?: AbortSignal;
911
+ }): Promise<void>;
912
+ declare function deleteEntityGameSetting(api: GameApi, entity_type: string, entity_id: string, key: string, options?: {
913
+ signal?: AbortSignal;
914
+ }): Promise<void>;
915
+ declare function deleteEntitySave(api: GameApi, entity_type: string, entity_id: string, key: string, options?: {
916
+ signal?: AbortSignal;
917
+ }): Promise<void>;
918
+ declare function deleteSession(api: GameApi, session_id: string, options?: {
919
+ signal?: AbortSignal;
920
+ }): Promise<void>;
921
+ declare function executeEntityRecipe(api: GameApi, entity_type: string, entity_id: string, body: RecipeExecuteRequest, options?: {
922
+ ifMatch?: string;
923
+ signal?: AbortSignal;
924
+ }): Promise<RecipeExecuteResponse>;
925
+ declare function finalizeSaveUpload(api: GameApi, entity_type: string, entity_id: string, key: string, body: SaveFinalizeRequest, options?: {
926
+ signal?: AbortSignal;
927
+ }): Promise<SaveDataResponse>;
928
+ declare function getDropRates(api: GameApi, loot_table_id: SlugOrId, options?: {
929
+ signal?: AbortSignal;
930
+ }): Promise<DropRatesResponse>;
931
+ declare function getEntityCurrency(api: GameApi, entity_type: string, entity_id: string, currency_id: SlugOrId, options?: {
932
+ signal?: AbortSignal;
933
+ }): Promise<CurrencyBalanceResponse>;
934
+ declare function getEntityGameSetting(api: GameApi, entity_type: string, entity_id: string, key: string, options?: {
935
+ ifNoneMatch?: string;
936
+ signal?: AbortSignal;
937
+ }): Promise<VersionedResponse<SettingResponse>>;
938
+ declare function getEntityInventory(api: GameApi, entity_type: string, entity_id: string, options?: {
939
+ "include_buckets"?: boolean;
940
+ "currency_limit"?: number;
941
+ "currency_cursor"?: string;
942
+ "item_limit"?: number;
943
+ "item_cursor"?: string;
944
+ "progression_limit"?: number;
945
+ "progression_cursor"?: string;
946
+ signal?: AbortSignal;
947
+ }): Promise<InventoryResponse>;
948
+ declare function getEntityInventoryItem(api: GameApi, entity_type: string, entity_id: string, item_definition_id: SlugOrId, options?: {
949
+ signal?: AbortSignal;
950
+ }): Promise<ItemInstanceResponse[]>;
951
+ declare function getEntityLeaderboard(api: GameApi, leaderboard_type: string, entity_type: string, entity_id: string, options?: {
952
+ "bucket_1"?: string;
953
+ "bucket_2"?: string;
954
+ "limit"?: number;
955
+ signal?: AbortSignal;
956
+ }): Promise<EntityLeaderboardResponse>;
957
+ declare function getEntityOrder(api: GameApi, entity_type: string, entity_id: string, order_id: string, options?: {
958
+ signal?: AbortSignal;
959
+ }): Promise<OrderRecordResponse>;
960
+ declare function getEntityProgression(api: GameApi, entity_type: string, entity_id: string, progression_definition_id: SlugOrId, options?: {
961
+ signal?: AbortSignal;
962
+ }): Promise<ProgressionStateResponse>;
963
+ declare function getEntityRecipeAvailability(api: GameApi, entity_type: string, entity_id: string, catalog_id: SlugOrId, recipe_id: SlugOrId, options?: {
964
+ signal?: AbortSignal;
965
+ }): Promise<RecipeAvailabilityResponse>;
966
+ declare function getEntityRecipeUsage(api: GameApi, entity_type: string, entity_id: string, options?: {
967
+ "limit"?: number;
968
+ signal?: AbortSignal;
969
+ }): Promise<RecipeUsageListResponse>;
970
+ declare function getEntitySave(api: GameApi, entity_type: string, entity_id: string, key: string, options?: {
971
+ ifNoneMatch?: string;
972
+ signal?: AbortSignal;
973
+ }): Promise<VersionedResponse<SaveDataResponse>>;
974
+ declare function getEvent(api: GameApi, event_id: string, options?: {
975
+ signal?: AbortSignal;
976
+ }): Promise<EventDefinitionResponse>;
977
+ declare function getGameRoomV2(api: GameApi, game_room_id: string, options?: {
978
+ ifNoneMatch?: string;
979
+ signal?: AbortSignal;
980
+ }): Promise<VersionedResponse<GameRoomResponseV2>>;
981
+ declare function getLeaderboard(api: GameApi, leaderboard_type: string, options?: {
982
+ "bucket_1"?: string;
983
+ "bucket_2"?: string;
984
+ signal?: AbortSignal;
985
+ }): Promise<LeaderboardResponse>;
986
+ declare function getPurchaseCatalog(api: GameApi, options?: {
987
+ "config_version"?: number;
988
+ signal?: AbortSignal;
989
+ }): Promise<PurchaseCatalogResponse>;
990
+ declare function getResolvedTemplate(api: GameApi, template_id: string, options?: {
991
+ signal?: AbortSignal;
992
+ }): Promise<GameRoomTemplateResponse>;
993
+ declare function getRoomArgs(api: GameApi, game_room_id: string, options?: {
994
+ signal?: AbortSignal;
995
+ }): Promise<RoomArgsResponse>;
996
+ declare function getTransferDetails(api: GameApi, transfer_id: string, options?: {
997
+ signal?: AbortSignal;
998
+ }): Promise<TransferResponse>;
999
+ declare function initiateInventoryTransfer(api: GameApi, body: InitiateTransferRequest, options?: {
1000
+ signal?: AbortSignal;
1001
+ }): Promise<TransferResponse>;
1002
+ declare function kickPlayer(api: GameApi, game_room_id: string, player_id: string, options?: {
1003
+ signal?: AbortSignal;
1004
+ }): Promise<void>;
1005
+ declare function listEntityGameSettings(api: GameApi, entity_type: string, entity_id: string, options?: {
1006
+ signal?: AbortSignal;
1007
+ }): Promise<SettingsListResponse>;
1008
+ declare function listEntityOrders(api: GameApi, entity_type: string, entity_id: string, options?: {
1009
+ "limit"?: number;
1010
+ "cursor"?: string;
1011
+ signal?: AbortSignal;
1012
+ }): Promise<OrderListResponse>;
1013
+ declare function listEntityProgressions(api: GameApi, entity_type: string, entity_id: string, options?: {
1014
+ signal?: AbortSignal;
1015
+ }): Promise<ProgressionStateResponse[]>;
1016
+ declare function listEntitySaves(api: GameApi, entity_type: string, entity_id: string, options?: {
1017
+ "limit"?: number;
1018
+ "cursor"?: string;
1019
+ signal?: AbortSignal;
1020
+ }): Promise<PaginatedResponseSaveDataResponse>;
1021
+ declare function listEvents(api: GameApi, options?: {
1022
+ "include_inactive"?: boolean;
1023
+ "limit"?: number;
1024
+ "offset"?: number;
1025
+ signal?: AbortSignal;
1026
+ }): Promise<EventListResponse>;
1027
+ declare function listGameRooms(api: GameApi, options?: {
1028
+ "status"?: string | null;
1029
+ "game_channel"?: string | null;
1030
+ "game_room_type"?: string | null;
1031
+ "template_id"?: string | null;
1032
+ "template_slug"?: string | null;
1033
+ "limit"?: number | null;
1034
+ "cursor"?: string | null;
1035
+ signal?: AbortSignal;
1036
+ }): Promise<GameRoomsListResponse>;
1037
+ declare function listResolvedTemplates(api: GameApi, options?: {
1038
+ signal?: AbortSignal;
1039
+ }): Promise<GameRoomTemplateListResponse>;
1040
+ declare function listTransfers(api: GameApi, options: {
1041
+ "entity_type": string;
1042
+ "entity_id": string;
1043
+ "direction"?: string;
1044
+ "status"?: string;
1045
+ "cursor"?: string;
1046
+ "limit"?: number;
1047
+ signal?: AbortSignal;
1048
+ }): Promise<ListTransfersResponse>;
1049
+ declare function matchEnd(api: GameApi, match_id: string, options?: {
1050
+ signal?: AbortSignal;
1051
+ }): Promise<void>;
1052
+ declare function putEntityGameSetting(api: GameApi, entity_type: string, entity_id: string, key: string, body: PutSettingRequest, options?: {
1053
+ ifMatch?: string;
1054
+ signal?: AbortSignal;
1055
+ }): Promise<SettingResponse>;
1056
+ declare function putRoomArgs(api: GameApi, game_room_id: string, body: UpdateRoomArgsRequest, options?: {
1057
+ signal?: AbortSignal;
1058
+ }): Promise<RoomArgsResponse>;
1059
+ declare function rejectTransfer(api: GameApi, transfer_id: string, options?: {
1060
+ signal?: AbortSignal;
1061
+ }): Promise<TransferResponse>;
1062
+ declare function requestSaveUploadUrl(api: GameApi, entity_type: string, entity_id: string, key: string, body: SaveUploadUrlRequest, options?: {
1063
+ signal?: AbortSignal;
1064
+ }): Promise<SaveUploadUrlResponse>;
1065
+ declare function resetEntityProgression(api: GameApi, entity_type: string, entity_id: string, progression_definition_id: SlugOrId, body: ProgressionResetRequest, options?: {
1066
+ signal?: AbortSignal;
1067
+ }): Promise<OrderResponse>;
1068
+ declare function simulateEntityOrder(api: GameApi, entity_type: string, entity_id: string, body: SimulateOrderRequest, options?: {
1069
+ signal?: AbortSignal;
1070
+ }): Promise<SimulateOrderResponse>;
1071
+ declare function transferHostV2(api: GameApi, game_room_id: string, player_id: string, options?: {
1072
+ signal?: AbortSignal;
1073
+ }): Promise<GameRoomResponseV2>;
1074
+ declare function updateGameRoomV2(api: GameApi, game_room_id: string, body: UpdateGameRoomRequest, options?: {
1075
+ ifMatch?: string;
1076
+ signal?: AbortSignal;
1077
+ }): Promise<GameRoomResponseV2>;
1078
+ export { type ActiveWindowResponse, type AdminActionRequest, type BatchOrderItem, type BatchOrderItemResult, type BatchOrderRequest, type BatchOrderResponse, type BucketBalanceResponse, type CatalogItem, type CatalogRecipe, type ClientPlatform, type CreateOrderRequest, type CreateSessionRequest, type CurrencyBalanceResponse, type CurrencyResetOverride, type DropRateEntry, type DropRatesResponse, type EntityLeaderboardEntryResponse, type EntityLeaderboardResponse, type EntityType, type ErrorDetail, type ErrorResponse, type EventDefinitionResponse, type EventListResponse, type EventStatusInfo, type FidelityReport, type GameApi, type GameChannel, type GameRoomMemberResponseV2, type GameRoomResponseV2, type GameRoomSummaryResponse, type GameRoomTemplateListResponse, type GameRoomTemplateResponse, type GameRoomsListResponse, type InitiateTransferRequest, type InventoryChange, type InventoryResponse, type InventoryScopeResponse, type ItemInstanceResponse, type LeaderboardEntryResponse, type LeaderboardResponse, type ListTransfersResponse, type LootRollResultResponse, type MatchType, type OperationRequest, type OrderListResponse, type OrderRecordResponse, type OrderResponse, type OrderSource, type OrderStatus, type OverflowBehavior, type PaginatedCollectionCurrencyBalanceResponse, type PaginatedCollectionItemInstanceResponse, type PaginatedCollectionProgressionStateResponse, type PaginatedResponseSaveDataResponse, type PlatformGrantClamp, type PlatformGrantOutcome, type ProgressionAddRequest, type ProgressionClaimRequest, type ProgressionResetRequest, type ProgressionStateOverride, type ProgressionStateResponse, type PurchaseCatalogResponse, type PurchasePrice, type PutSettingRequest, type RecipeAvailabilityResponse, type RecipeExecuteRequest, type RecipeExecuteResponse, type RecipeUsageListResponse, type RecipeUsageResponse, type RoomArgType, type RoomArgsResponse, type RoomArgsTemplate, type SaveDataResponse, type SaveFinalizeRequest, type SaveUploadUrlRequest, type SaveUploadUrlResponse, type SettingResponse, type SettingsListResponse, type SimulateOrderRequest, type SimulateOrderResponse, type SimulationFailure, type SimulationOutcome, type SimulationOverrides, type SlugOrId, type SuppliedBucketRow, type SuppliedCurrencies, type SuppliedCurrencyRow, type SuppliedInventory, type SuppliedItemRow, type SuppliedItems, type SuppliedProgressionRow, type SuppliedProgressions, type SuppliedScope, type TransferCurrencyRequest, type TransferItemRequest, type TransferResponse, type UnavailabilityReason, type UpdateGameRoomRequest, type UpdateRoomArgsRequest, type WindowPreviewResponse, acceptTransfer, addEntityProgression, adminAction, cancelInventoryTransfer, claimEntityProgressionRewards, closeGameRoom, createEntityBatchOrder, createEntityOrder, createSession, deleteEntityGameSetting, deleteEntitySave, deleteSession, executeEntityRecipe, finalizeSaveUpload, getDropRates, getEntityCurrency, getEntityGameSetting, getEntityInventory, getEntityInventoryItem, getEntityLeaderboard, getEntityOrder, getEntityProgression, getEntityRecipeAvailability, getEntityRecipeUsage, getEntitySave, getEvent, getGameRoomV2, getLeaderboard, getPurchaseCatalog, getResolvedTemplate, getRoomArgs, getTransferDetails, initiateInventoryTransfer, kickPlayer, listEntityGameSettings, listEntityOrders, listEntityProgressions, listEntitySaves, listEvents, listGameRooms, listResolvedTemplates, listTransfers, matchEnd, putEntityGameSetting, putRoomArgs, rejectTransfer, requestSaveUploadUrl, resetEntityProgression, simulateEntityOrder, transferHostV2, updateGameRoomV2 };