@indiegems/gem-web-sdk 7.0.0 → 7.1.1

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.
@@ -123,6 +123,7 @@ type AnalyticsRejection = {
123
123
  "code": string;
124
124
  "index": number;
125
125
  };
126
+ type BadgeKind = "platform" | "game";
126
127
  type BatchOrderItem = {
127
128
  "nonce"?: string | null;
128
129
  "operations": OperationRequest[];
@@ -153,6 +154,7 @@ type BucketBalanceResponse = {
153
154
  "next_reset_at"?: number | null;
154
155
  };
155
156
  type CatalogItem = {
157
+ "category"?: ItemCategory;
156
158
  "consumable": boolean;
157
159
  "display_name"?: string | null;
158
160
  "fungible": boolean;
@@ -172,11 +174,27 @@ type CatalogRecipe = {
172
174
  "catalog_id": string;
173
175
  "cooldown_seconds"?: number | null;
174
176
  "display_name"?: string | null;
177
+ "lock_reasons"?: RecipeLockReason[] | null;
178
+ "locked"?: boolean | null;
175
179
  "max_uses"?: number | null;
176
180
  "platform_prices": CatalogPrice[];
181
+ "prerequisites"?: RecipePrerequisite[];
177
182
  "recipe_id": string;
178
183
  "recipe_type": string;
179
184
  };
185
+ type ChallengeListResponse = {
186
+ "challenges": ChallengePeriodResponse[];
187
+ };
188
+ type ChallengePeriodResponse = {
189
+ "challenge_data"?: string | null;
190
+ "challenge_data_hash"?: string | null;
191
+ "period_ends_at": string;
192
+ "period_start_at": string;
193
+ "progression_definition_id": string;
194
+ "seed": string;
195
+ "slug"?: string | null;
196
+ "window": WindowKind;
197
+ };
180
198
  type ClientPlatform = "universal" | "mobile" | "web";
181
199
  type CreateOrderRequest = {
182
200
  "channel"?: null | GameChannel;
@@ -226,7 +244,7 @@ type EntityLeaderboardEntryResponse = {
226
244
  "rank": number;
227
245
  "stats"?: Record<string, unknown> | null;
228
246
  };
229
- type EntityLeaderboardResponse = {
247
+ type EntityLeaderboardResponse = PlayerIdentityFields & {
230
248
  "bucket_1"?: string | null;
231
249
  "bucket_2"?: string | null;
232
250
  "entity_id": string;
@@ -278,16 +296,11 @@ type FidelityReport = {
278
296
  "defaults_applied": string[];
279
297
  };
280
298
  type GameChannel = "dev" | "test" | "release";
281
- type GameRoomMemberResponseV2 = {
282
- "avatar_icon_id"?: string | null;
283
- "discriminator"?: string | null;
284
- "display_name"?: string | null;
285
- "display_tag"?: string | null;
299
+ type GameRoomMemberResponseV2 = PlayerIdentityFields & {
286
300
  "group_id"?: string | null;
287
301
  "is_ready": boolean;
288
302
  "joined_at": number;
289
303
  "platform"?: null | ClientPlatform;
290
- "player_id": string;
291
304
  "role": string;
292
305
  };
293
306
  type GameRoomResponseV2 = {
@@ -421,6 +434,7 @@ type InventoryChange = {
421
434
  "mapping_index": number;
422
435
  "outcome": PlatformGrantOutcome;
423
436
  "platform_order_id"?: string | null;
437
+ "principal"?: null | ReceiptPrincipal;
424
438
  "progression_definition_id": string;
425
439
  "reason"?: string | null;
426
440
  "requested": number;
@@ -430,6 +444,7 @@ type InventoryChange = {
430
444
  "achievement_id": string;
431
445
  "outcome": AchievementUnlockOutcome;
432
446
  "points": number;
447
+ "principal"?: null | ReceiptPrincipal;
433
448
  "progression_definition_id": string;
434
449
  "reason"?: string | null;
435
450
  "type": "achievement_unlocked";
@@ -465,6 +480,7 @@ type InventoryScopeResponse = {
465
480
  "game_id": string;
466
481
  "type": "game";
467
482
  };
483
+ type ItemCategory = "cosmetic" | "progression";
468
484
  type ItemInstanceResponse = {
469
485
  "acquired_at": number;
470
486
  "custom_data"?: unknown;
@@ -473,11 +489,7 @@ type ItemInstanceResponse = {
473
489
  "properties": unknown;
474
490
  "quantity": number;
475
491
  };
476
- type LeaderboardEntryResponse = {
477
- "avatar_icon_url"?: string | null;
478
- "discriminator"?: string | null;
479
- "display_name"?: string | null;
480
- "display_tag"?: string | null;
492
+ type LeaderboardEntryResponse = PlayerIdentityFields & {
481
493
  "entity_id"?: string | null;
482
494
  "entity_type"?: null | EntityType;
483
495
  "is_viewer"?: boolean;
@@ -507,6 +519,11 @@ type LootRollResultResponse = {
507
519
  "was_replacement": boolean;
508
520
  };
509
521
  type MatchType = "dedicated" | "p2p" | "none";
522
+ type NameStyle = {
523
+ "fallback"?: null | ThemedColors;
524
+ "item_id": string;
525
+ "preset": string;
526
+ };
510
527
  type OperationRequest = {
511
528
  "amount": number;
512
529
  "bucket"?: string | null;
@@ -656,8 +673,33 @@ type PeriodProgressResponse = {
656
673
  "target": number;
657
674
  "window": string;
658
675
  };
659
- type PlatformGrantClamp = "none" | "max_per_event" | "game_max_per_entity" | "platform_max_per_game_per_entity" | "game_max_per_window" | "platform_max_per_window" | "max_balance";
676
+ type PlatformGrantClamp = "none" | "max_per_event" | "game_max_per_entity" | "platform_max_per_game_per_entity" | "game_max_per_window" | "platform_max_per_window" | "max_balance" | "holdings_cap";
660
677
  type PlatformGrantOutcome = "fired" | "clamped" | "suppressed";
678
+ type PlayerBadge = {
679
+ "icon_url": string;
680
+ "item_id": string;
681
+ "kind": BadgeKind;
682
+ };
683
+ type PlayerIdentityFields = {
684
+ "avatar_icon_id"?: string | null;
685
+ "avatar_icon_url"?: string | null;
686
+ "badges"?: PlayerBadge[];
687
+ "discriminator"?: string | null;
688
+ "display_name"?: string | null;
689
+ "display_tag"?: string | null;
690
+ "name_animation"?: null | NameStyle;
691
+ "name_color"?: null | NameStyle;
692
+ "player_id"?: string;
693
+ "title"?: null | PlayerTitle;
694
+ "title_animation"?: null | NameStyle;
695
+ "title_color"?: null | NameStyle;
696
+ };
697
+ type PlayerTitle = {
698
+ "item_id": string;
699
+ "lang": string;
700
+ "text": string;
701
+ };
702
+ type PrerequisiteType = "owns_item" | "progression_complete" | "min_progression_value" | "progression_level";
661
703
  type ProgressionAchievementState = {
662
704
  "hidden": boolean;
663
705
  "id": string;
@@ -702,9 +744,12 @@ type PurchaseCatalogResponse = {
702
744
  type PutSettingRequest = {
703
745
  "value": Base64String;
704
746
  };
747
+ type ReceiptPrincipal = "function";
705
748
  type RecipeAvailabilityResponse = {
706
749
  "can_execute": boolean;
707
750
  "cooldown_expires_at"?: string | null;
751
+ "lock_reasons"?: RecipeLockReason[];
752
+ "locked"?: boolean;
708
753
  "reasons": UnavailabilityReason[];
709
754
  "recipe_id": string;
710
755
  "uses_remaining"?: number | null;
@@ -725,6 +770,17 @@ type RecipeExecuteResponse = {
725
770
  "order_id": string;
726
771
  "status": OrderStatus;
727
772
  };
773
+ type RecipeLockReason = {
774
+ "current": number;
775
+ "prerequisite_type": PrerequisiteType;
776
+ "reference_id": string;
777
+ "required": number;
778
+ };
779
+ type RecipePrerequisite = {
780
+ "prerequisite_type": PrerequisiteType;
781
+ "reference_id": string;
782
+ "reference_value": number;
783
+ };
728
784
  type RecipeUsageListResponse = {
729
785
  "usages": RecipeUsageResponse[];
730
786
  };
@@ -889,6 +945,10 @@ type SuppliedScope = {
889
945
  "game_id": string;
890
946
  "type": "game";
891
947
  };
948
+ type ThemedColors = {
949
+ "on_dark": string;
950
+ "on_light": string;
951
+ };
892
952
  type TransferCurrencyRequest = {
893
953
  "amount": number;
894
954
  "currency_id": string;
@@ -934,8 +994,10 @@ type UnavailabilityReason = {
934
994
  "max_uses": number;
935
995
  "type": "max_uses_reached";
936
996
  } | {
997
+ "current"?: number;
937
998
  "prerequisite_type": string;
938
999
  "reference_id": string;
1000
+ "required"?: number;
939
1001
  "type": "prerequisite_not_met";
940
1002
  } | {
941
1003
  "available": number;
@@ -958,6 +1020,7 @@ type UpdateGameRoomRequest = {
958
1020
  type UpdateRoomArgsRequest = {
959
1021
  "room_args": Record<string, unknown>;
960
1022
  };
1023
+ type WindowKind = "daily" | "weekly" | "monthly" | "cron";
961
1024
  type WindowPreviewResponse = {
962
1025
  "ends_at": string;
963
1026
  "starts_at": string;
@@ -1032,9 +1095,9 @@ declare function getEntityInventoryItem(api: GameApi, entity_type: string, entit
1032
1095
  signal?: AbortSignal;
1033
1096
  }): Promise<ItemInstanceResponse[]>;
1034
1097
  declare function getEntityLeaderboard(api: GameApi, leaderboard_type: string, entity_type: string, entity_id: string, options?: {
1035
- "bucket_1"?: string;
1036
- "bucket_2"?: string;
1037
- "limit"?: number;
1098
+ "bucket_1"?: string | null;
1099
+ "bucket_2"?: string | null;
1100
+ "limit"?: number | null;
1038
1101
  signal?: AbortSignal;
1039
1102
  }): Promise<EntityLeaderboardResponse>;
1040
1103
  declare function getEntityOrder(api: GameApi, entity_type: string, entity_id: string, order_id: string, options?: {
@@ -1062,12 +1125,12 @@ declare function getGameRoomV2(api: GameApi, game_room_id: string, options?: {
1062
1125
  signal?: AbortSignal;
1063
1126
  }): Promise<VersionedResponse<GameRoomResponseV2>>;
1064
1127
  declare function getLeaderboard(api: GameApi, leaderboard_type: string, options?: {
1065
- "bucket_1"?: string;
1066
- "bucket_2"?: string;
1128
+ "bucket_1"?: string | null;
1129
+ "bucket_2"?: string | null;
1067
1130
  signal?: AbortSignal;
1068
1131
  }): Promise<LeaderboardResponse>;
1069
1132
  declare function getPurchaseCatalog(api: GameApi, options?: {
1070
- "config_version"?: number;
1133
+ "config_version"?: number | null;
1071
1134
  signal?: AbortSignal;
1072
1135
  }): Promise<PurchaseCatalogResponse>;
1073
1136
  declare function getResolvedTemplate(api: GameApi, template_id: string, options?: {
@@ -1085,9 +1148,16 @@ declare function ingestAnalyticsEvents(api: GameApi, body: AnalyticsBatchRequest
1085
1148
  declare function initiateInventoryTransfer(api: GameApi, body: InitiateTransferRequest, options?: {
1086
1149
  signal?: AbortSignal;
1087
1150
  }): Promise<TransferResponse>;
1151
+ declare function invokeFunction(api: GameApi, body: Uint8Array, options?: {
1152
+ signal?: AbortSignal;
1153
+ }): Promise<BytesResponse>;
1088
1154
  declare function kickPlayer(api: GameApi, game_room_id: string, player_id: string, options?: {
1089
1155
  signal?: AbortSignal;
1090
1156
  }): Promise<void>;
1157
+ declare function listChallenges(api: GameApi, options?: {
1158
+ "periods_back"?: number;
1159
+ signal?: AbortSignal;
1160
+ }): Promise<ChallengeListResponse>;
1091
1161
  declare function listEntityGameSettings(api: GameApi, entity_type: string, entity_id: string, options?: {
1092
1162
  signal?: AbortSignal;
1093
1163
  }): Promise<SettingsListResponse>;
@@ -1126,9 +1196,9 @@ declare function listResolvedTemplates(api: GameApi, options?: {
1126
1196
  declare function listTransfers(api: GameApi, options: {
1127
1197
  "entity_type": string;
1128
1198
  "entity_id": string;
1129
- "direction"?: string;
1130
- "status"?: string;
1131
- "cursor"?: string;
1199
+ "direction"?: string | null;
1200
+ "status"?: string | null;
1201
+ "cursor"?: string | null;
1132
1202
  "limit"?: number;
1133
1203
  signal?: AbortSignal;
1134
1204
  }): Promise<ListTransfersResponse>;
@@ -1158,4 +1228,4 @@ declare function updateGameRoomV2(api: GameApi, game_room_id: string, body: Upda
1158
1228
  ifMatch?: string;
1159
1229
  signal?: AbortSignal;
1160
1230
  }): Promise<GameRoomResponseV2>;
1161
- export { type AchievementUnlockOutcome, type ActiveWindowResponse, type AdminActionRequest, type AnalyticsBatchRequest, type AnalyticsBatchResponse, type AnalyticsEventSubmission, type AnalyticsRejection, type BatchOrderItem, type BatchOrderItemResult, type BatchOrderRequest, type BatchOrderResponse, type BucketBalanceResponse, type CatalogItem, type CatalogPrice, 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 PeriodProgressResponse, type PlatformGrantClamp, type PlatformGrantOutcome, type ProgressionAchievementState, type ProgressionAddRequest, type ProgressionClaimRequest, type ProgressionResetRequest, type ProgressionStateOverride, type ProgressionStateResponse, type PurchaseCatalogResponse, 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 SuppliedPeriodProgressRow, 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, ingestAnalyticsEvents, initiateInventoryTransfer, kickPlayer, listEntityGameSettings, listEntityOrders, listEntityProgressions, listEntitySaves, listEvents, listGameRooms, listResolvedTemplates, listTransfers, putEntityGameSetting, putRoomArgs, rejectTransfer, requestSaveUploadUrl, resetEntityProgression, simulateEntityOrder, transferHostV2, updateGameRoomV2 };
1231
+ export { type AchievementUnlockOutcome, type ActiveWindowResponse, type AdminActionRequest, type AnalyticsBatchRequest, type AnalyticsBatchResponse, type AnalyticsEventSubmission, type AnalyticsRejection, type BadgeKind, type BatchOrderItem, type BatchOrderItemResult, type BatchOrderRequest, type BatchOrderResponse, type BucketBalanceResponse, type CatalogItem, type CatalogPrice, type CatalogRecipe, type ChallengeListResponse, type ChallengePeriodResponse, 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 ItemCategory, type ItemInstanceResponse, type LeaderboardEntryResponse, type LeaderboardResponse, type ListTransfersResponse, type LootRollResultResponse, type MatchType, type NameStyle, type OperationRequest, type OrderListResponse, type OrderRecordResponse, type OrderResponse, type OrderSource, type OrderStatus, type OverflowBehavior, type PaginatedCollectionCurrencyBalanceResponse, type PaginatedCollectionItemInstanceResponse, type PaginatedCollectionProgressionStateResponse, type PaginatedResponseSaveDataResponse, type PeriodProgressResponse, type PlatformGrantClamp, type PlatformGrantOutcome, type PlayerBadge, type PlayerIdentityFields, type PlayerTitle, type PrerequisiteType, type ProgressionAchievementState, type ProgressionAddRequest, type ProgressionClaimRequest, type ProgressionResetRequest, type ProgressionStateOverride, type ProgressionStateResponse, type PurchaseCatalogResponse, type PutSettingRequest, type ReceiptPrincipal, type RecipeAvailabilityResponse, type RecipeExecuteRequest, type RecipeExecuteResponse, type RecipeLockReason, type RecipePrerequisite, 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 SuppliedPeriodProgressRow, type SuppliedProgressionRow, type SuppliedProgressions, type SuppliedScope, type ThemedColors, type TransferCurrencyRequest, type TransferItemRequest, type TransferResponse, type UnavailabilityReason, type UpdateGameRoomRequest, type UpdateRoomArgsRequest, type WindowKind, 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, ingestAnalyticsEvents, initiateInventoryTransfer, invokeFunction, kickPlayer, listChallenges, listEntityGameSettings, listEntityOrders, listEntityProgressions, listEntitySaves, listEvents, listGameRooms, listResolvedTemplates, listTransfers, putEntityGameSetting, putRoomArgs, rejectTransfer, requestSaveUploadUrl, resetEntityProgression, simulateEntityOrder, transferHostV2, updateGameRoomV2 };