@indiegems/gem-web-sdk 15.3.2 → 16.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
@@ -2336,6 +2336,120 @@ interface GemFriendChallengeResult {
2336
2336
  readonly retryAfterMs?: number;
2337
2337
  readonly detail?: string;
2338
2338
  }
2339
+ interface GemRequestAppLinks {
2340
+ readonly gem: typeof PROTOCOL;
2341
+ readonly type: "gem.requestAppLinks";
2342
+ readonly requestId: string;
2343
+ }
2344
+ interface GemAppLinksResult {
2345
+ readonly gem: typeof PROTOCOL;
2346
+ readonly type: "gem.appLinksResult";
2347
+ readonly requestId: string;
2348
+ readonly outcome: "ok" | "declined" | "unavailable";
2349
+ readonly reason?: string;
2350
+ readonly arcade?: {
2351
+ store: "app_store" | "google_play";
2352
+ };
2353
+ readonly game?: {
2354
+ store: "app_store" | "google_play";
2355
+ };
2356
+ }
2357
+ interface GemRequestOpenApp {
2358
+ readonly gem: typeof PROTOCOL;
2359
+ readonly type: "gem.requestOpenApp";
2360
+ readonly requestId: string;
2361
+ readonly target: "arcade" | "game";
2362
+ }
2363
+ interface GemOpenAppResult {
2364
+ readonly gem: typeof PROTOCOL;
2365
+ readonly type: "gem.openAppResult";
2366
+ readonly requestId: string;
2367
+ readonly outcome: "ok" | "declined" | "unavailable";
2368
+ readonly reason?: string;
2369
+ }
2370
+ interface GemRequestOpenGame {
2371
+ readonly gem: typeof PROTOCOL;
2372
+ readonly type: "gem.requestOpenGame";
2373
+ readonly requestId: string;
2374
+ readonly ref: string;
2375
+ }
2376
+ interface GemOpenGameResult {
2377
+ readonly gem: typeof PROTOCOL;
2378
+ readonly type: "gem.openGameResult";
2379
+ readonly requestId: string;
2380
+ readonly outcome: "ok" | "declined" | "unavailable";
2381
+ readonly reason?: string;
2382
+ }
2383
+ interface GemRequestSimilarGames {
2384
+ readonly gem: typeof PROTOCOL;
2385
+ readonly type: "gem.requestSimilarGames";
2386
+ readonly requestId: string;
2387
+ readonly limit?: number;
2388
+ }
2389
+ interface GemSimilarGamesResult {
2390
+ readonly gem: typeof PROTOCOL;
2391
+ readonly type: "gem.similarGamesResult";
2392
+ readonly requestId: string;
2393
+ readonly outcome: "ok" | "declined" | "unavailable";
2394
+ readonly reason?: string;
2395
+ readonly games: {
2396
+ gameId: string;
2397
+ slug?: string;
2398
+ iconUrl: string;
2399
+ capsuleLandscapeUrl: string;
2400
+ capsulePortraitUrl: string;
2401
+ previewVideoUrl?: string;
2402
+ previewPosterUrl?: string;
2403
+ untrusted: {
2404
+ name: string;
2405
+ tagline: string;
2406
+ shortDescription: string;
2407
+ tags: string[];
2408
+ };
2409
+ }[];
2410
+ }
2411
+ interface GemRequestStoreOffers {
2412
+ readonly gem: typeof PROTOCOL;
2413
+ readonly type: "gem.requestStoreOffers";
2414
+ readonly requestId: string;
2415
+ }
2416
+ interface GemStoreOffersResult {
2417
+ readonly gem: typeof PROTOCOL;
2418
+ readonly type: "gem.storeOffersResult";
2419
+ readonly requestId: string;
2420
+ readonly outcome: "ok" | "declined" | "unavailable";
2421
+ readonly reason?: string;
2422
+ readonly offers: {
2423
+ skuId: string;
2424
+ kind: "gem_pack" | "boost" | "pass" | "bundle";
2425
+ name: string;
2426
+ description: string;
2427
+ imageUrl?: string;
2428
+ priceDisplay: string;
2429
+ grant?: {
2430
+ currency: string;
2431
+ amount: number;
2432
+ };
2433
+ }[];
2434
+ }
2435
+ interface GemRequestStorePurchase {
2436
+ readonly gem: typeof PROTOCOL;
2437
+ readonly type: "gem.requestStorePurchase";
2438
+ readonly requestId: string;
2439
+ readonly skuId: string;
2440
+ }
2441
+ interface GemStorePurchaseResult {
2442
+ readonly gem: typeof PROTOCOL;
2443
+ readonly type: "gem.storePurchaseResult";
2444
+ readonly requestId: string;
2445
+ readonly outcome: "ok" | "declined" | "unavailable";
2446
+ readonly reason?: string;
2447
+ }
2448
+ interface GemStorePurchaseSettled {
2449
+ readonly gem: typeof PROTOCOL;
2450
+ readonly type: "gem.storePurchaseSettled";
2451
+ readonly skuId: string;
2452
+ }
2339
2453
  interface ConnectOptions {
2340
2454
  readonly clusterTargetId?: ClusterTargetLike;
2341
2455
  readonly retry?: StartMatchRetryOptions;
@@ -4523,6 +4637,8 @@ interface FramePlayer extends PlayerIdentity {
4523
4637
  readonly avatarUrl?: string;
4524
4638
  readonly boost: PlayerBoost;
4525
4639
  }
4640
+ type GemArcadeAsk = Omit<GemRequestAppLinks, "gem"> | Omit<GemRequestOpenApp, "gem"> | Omit<GemRequestOpenGame, "gem"> | Omit<GemRequestSimilarGames, "gem"> | Omit<GemRequestStoreOffers, "gem"> | Omit<GemRequestStorePurchase, "gem">;
4641
+ type GemArcadeAnswer = GemAppLinksResult | GemOpenAppResult | GemOpenGameResult | GemSimilarGamesResult | GemStoreOffersResult | GemStorePurchaseResult | GemStorePurchaseSettled;
4526
4642
  interface FrameCallbacks {
4527
4643
  onToken?(msg: GemToken): void;
4528
4644
  onPause?(msg: GemPause): void;
@@ -4559,6 +4675,7 @@ interface FrameCallbacks {
4559
4675
  onMomentResult?(msg: GemMomentResult): void;
4560
4676
  onSignInResult?(msg: GemSignInResult): void;
4561
4677
  onFriendChallengeResult?(msg: GemFriendChallengeResult): void;
4678
+ onArcadeAnswer?(msg: GemArcadeAnswer): void;
4562
4679
  onError?(code: GemErrorCode, message?: string): void;
4563
4680
  onDropped?(code: GemErrorCode, message?: string): void;
4564
4681
  onStateChange?(state: FrameState): void;
@@ -4637,6 +4754,7 @@ declare class GemFrame {
4637
4754
  readyCalled(): boolean;
4638
4755
  requestSignIn(requestId: string): boolean;
4639
4756
  requestFriendChallenge(requestId: string, playerId: string, template: string, params?: Readonly<Record<string, string | number>>): boolean;
4757
+ requestArcade(msg: GemArcadeAsk): boolean;
4640
4758
  close(): void;
4641
4759
  private transition;
4642
4760
  private refuseMalformed;
@@ -4656,6 +4774,72 @@ interface ShareApi {
4656
4774
  readonly available: boolean;
4657
4775
  request(request?: ShareRequest): void;
4658
4776
  }
4777
+ type ArcadeOutcomeKind = "ok" | "declined" | "unavailable";
4778
+ interface ArcadeOutcome {
4779
+ readonly outcome: ArcadeOutcomeKind;
4780
+ readonly reason?: string;
4781
+ }
4782
+ type AppStore = "app_store" | "google_play";
4783
+ interface AppListing {
4784
+ readonly store: AppStore;
4785
+ }
4786
+ interface AppLinksOutcome extends ArcadeOutcome {
4787
+ readonly arcade?: AppListing;
4788
+ readonly game?: AppListing;
4789
+ }
4790
+ interface GameCard {
4791
+ readonly gameId: string;
4792
+ readonly slug?: string;
4793
+ readonly name: PlayerText;
4794
+ readonly tagline: PlayerText;
4795
+ readonly shortDescription: PlayerText;
4796
+ readonly tags: readonly PlayerText[];
4797
+ readonly iconUrl: string;
4798
+ readonly capsuleLandscapeUrl: string;
4799
+ readonly capsulePortraitUrl: string;
4800
+ readonly previewVideoUrl?: string;
4801
+ readonly previewPosterUrl?: string;
4802
+ }
4803
+ interface SimilarGamesOutcome extends ArcadeOutcome {
4804
+ readonly games: readonly GameCard[];
4805
+ }
4806
+ interface ArcadeAvailability {
4807
+ readonly appLinks: boolean;
4808
+ readonly openGame: boolean;
4809
+ }
4810
+ interface ArcadeApi {
4811
+ readonly available: ArcadeAvailability;
4812
+ appLinks(): Promise<AppLinksOutcome>;
4813
+ openApp(target: "arcade" | "game"): Promise<ArcadeOutcome>;
4814
+ openGame(ref: string): Promise<ArcadeOutcome>;
4815
+ similarGames(options?: {
4816
+ readonly limit?: number;
4817
+ }): Promise<SimilarGamesOutcome>;
4818
+ }
4819
+ interface ArcadeOffer {
4820
+ readonly skuId: string;
4821
+ readonly kind: "gem_pack" | "boost" | "pass" | "bundle";
4822
+ readonly name: string;
4823
+ readonly description: string;
4824
+ readonly imageUrl?: string;
4825
+ readonly priceDisplay: string;
4826
+ readonly grant?: {
4827
+ readonly currency: string;
4828
+ readonly amount: number;
4829
+ };
4830
+ }
4831
+ interface StoreOffersOutcome extends ArcadeOutcome {
4832
+ readonly offers: readonly ArcadeOffer[];
4833
+ }
4834
+ interface StoreSettlement {
4835
+ readonly skuId: string;
4836
+ }
4837
+ interface StoreApi {
4838
+ readonly available: boolean;
4839
+ offers(): Promise<StoreOffersOutcome>;
4840
+ purchase(skuId: string): Promise<ArcadeOutcome>;
4841
+ onSettled(listener: (settlement: StoreSettlement) => void): () => void;
4842
+ }
4659
4843
  interface VibrationApi {
4660
4844
  readonly available: boolean;
4661
4845
  vibrate(pattern: number | readonly number[]): boolean;
@@ -4915,6 +5099,8 @@ interface Gem {
4915
5099
  readonly ads: AdsApi;
4916
5100
  readonly account: AccountApi;
4917
5101
  readonly share: ShareApi;
5102
+ readonly arcade: ArcadeApi;
5103
+ readonly store: StoreApi;
4918
5104
  readonly avatarPickerAvailable: boolean;
4919
5105
  openAvatarPicker(options?: {
4920
5106
  readonly tab?: "2d" | "3d";
@@ -4969,4 +5155,4 @@ interface ExitAnalytics {
4969
5155
  }
4970
5156
  declare function leaveAndExit(rooms: ExitRooms, bridge: ExitBridge | null, reason?: string, analytics?: ExitAnalytics): Promise<void>;
4971
5157
  declare function createGem(options?: GemOptions): Gem;
4972
- export { ARCADE_EMBEDDERS, AVATAR_RIGS, type AccountApi, type AdFormat, type AdOutcome, type AdOutcomeKind, type AdRequest, type AdsApi, AnalyticsApi, type AnalyticsFlushOptions, type AnalyticsFlushResult, type AnalyticsOptions, type AnalyticsRejection$1 as AnalyticsRejection, type AnalyticsValue, AuthError, type AuthFailure, type AuthState, type Avatar3dFamily, type Avatar3dOffer, type Avatar3dPrice, type Avatar3dPurchaseRequest, type AvatarRigNode, type AvatarRigs, type Avatars3dApi, type Base64String, type BootMark, type BootTimeline, type BroadcastOptions, type BytesResponse, CONDITIONAL_HEADERS, type Challenge, type ChallengeWindow, ChallengesApi, type ClientOptions, type Clock, type ConditionalRequestHeaders, type ConfiguredPurchasePayment, type ConfiguredPurchaseRequest, type ConfiguredPurchaseResult, type ControlsApi, DEVICE_SETTINGS_MAX_BYTES, DedicatedServerError, type DedicatedServerFailure, type DedicatedServerSession, type DevToolsOpener, type DeviceSettings, type DeviceSettingsApi, type DeviceSettingsPutOutcome, type DirectPurchaseRequest, type DirectPurchaseResult, type EarnAllowance, type EarnAllowanceEvent, type EarnAllowancePeriod, type EarnAllowanceReadOptions, type EntityLeaderboard, type EntityLeaderboardEntry, type EntityLeaderboardOptions, type EntityType$1 as EntityType, type ExitAnalytics, type ExitBridge, type ExitRooms, type FrameState, type Friend, type FriendChallenge, FriendChallengeError, type FriendChallengeErrorCode, type FriendChallengeOutcome, type FriendChallengeOutcomeKind, type FriendChallengeRequest, type FriendChallengesPage, FriendsApi, type FriendsPage, type FunctionFailure, type FunctionInvokeOptions, type FunctionResult, FunctionsApi, type GameApi, type GameConfig, type GameMenu, type GameMenuItem, type GameServerLink, type GameSettingsApi, type Gem, GemApiError, type GemAudioChannels, GemClient, type GemCohort, type GemCohorts, GemConfigError, type GemControlBox, type GemCorner, type GemDevTools, type GemErrorReason, GemFrame, GemFunctionError, type GemGameChoiceSetting, type GemGameSetting, type GemGameSettingBase, type GemGameSettingChange, type GemGameSettingIcon, type GemGameSettingOption, type GemGameSettingValue, type GemGameSliderSetting, type GemGameToggleSetting, type GemGraphicsQuality, type GemIdentity, type GemInsets, type GemLook, type GemLookBase, type GemLookDelta, type GemLookOptions, type GemLookSpeed, type GemMatchApi, type GemMatchServer, type GemMatchServerModule, type GemOptions, type GemPlayer, type GemPrefs, type GemRecommendedSettings, type GemReservedArea, GemSaveError, type GemServer, type GemServerBundle, type GemServerFactory, type GemServerHost, type GemServerHostProfile, type GemServerIdentity, type GemServerLifecycle, type GemServerOptions, type GemServerProfile, type GemTerminationNotice, GemUnframedError, type GemViewport, type GetLeaderboardOptions, type HostTokenSource, type HostTokenSourceOptions, type JoinWelcome, type Leaderboard, type LeaderboardEntry, type LeaderboardPeriod, LeaderboardsApi, type ListChallengesOptions, type ListFriendChallengesOptions, type ListFriendsOptions, MAX_PERIODS_BACK, type MatchBackfillState, type MatchConnectOptions, type MatchConnection, type MatchHosting, type MatchHostingMode, type MatchPlayerReport, type MatchPlayerReportResult, type MatchServeOptions, type MatchTransport, type MessageMeta, type MomentKind, type MomentResult, type MomentSignal, type MomentsApi, type MultiTransportSession, PLATFORM_EVENTS, type PeriodOptions, PlatformApi, PlatformCurrenciesApi, type PlatformCurrency, type PlatformCurrencyAccess, type PlatformCurrencyPurchasePayment, type PlatformCurrencyPurchaseRequest, type PlatformCurrencyPurchaseResult, type PlatformCurrencyReadOptions, PlatformEarnAllowanceApi, type PlatformEventName, type PlayerBadge$1 as PlayerBadge, type PlayerBoost, type PlayerBoostMultiplier, type PlayerIdentity, type PlayerProfile, PlayerText, type ProfileCallOptions, type ProfileShowcaseEntry$1 as ProfileShowcaseEntry, ProfilesApi, type PurchaseApi, type PurchaseOptions, type PurchaseOutcome, PurchaseRefusal, type PurchaseRefusalCode, type PurchaseRequest, type PutBytesOptions, type PutSaveOptions, type RankedRow, type RecipeAvailability, type RecipeLock, type RequestOptions, type RewardCue, type RewardedStatus, type RoomArgValue, type SavePage, type SaveRecord, type SendOptions$1 as SendOptions, type ServerApi, type ServerBundleHost, type ServerTokenGrant, type SessionEndReason, type ShareApi, type ShareRequest, ShowcaseApi, type ShowcaseCallOptions, type ShowcaseFriendEntry, type ShowcaseFriends, type ShowcaseValue, type SignInOutcome, type SignInOutcomeKind, type SnapshotCurrency, type SnapshotItem, type TokenGrant, type Transport, type TransportAdvert, type TransportKind, TransportRefusal, type TransportRequest, type TransportResponse, UNRELIABLE_CHANNEL_LABEL, type VersionedGetOptions, type VersionedResponse, type VibrationApi, type WalletVisibleOptions, type WornAvatar3d$1 as WornAvatar3d, asPlayerText, createBootTimeline, createGem, createGemServer, createHostTokenSource, createMatchServer, defineServer, experimentSelection, leaveAndExit, mapIdentity, markOnResolve, platformIconUrl, presentJoinCredential, readTemplateTransports, readTransportAdvert, reportOnResolve, systemClock, text, toBase64, webTransportAvailable };
5158
+ export { ARCADE_EMBEDDERS, AVATAR_RIGS, type AccountApi, type AdFormat, type AdOutcome, type AdOutcomeKind, type AdRequest, type AdsApi, AnalyticsApi, type AnalyticsFlushOptions, type AnalyticsFlushResult, type AnalyticsOptions, type AnalyticsRejection$1 as AnalyticsRejection, type AnalyticsValue, type AppLinksOutcome, type AppListing, type AppStore, type ArcadeApi, type ArcadeAvailability, type ArcadeOffer, type ArcadeOutcome, type ArcadeOutcomeKind, AuthError, type AuthFailure, type AuthState, type Avatar3dFamily, type Avatar3dOffer, type Avatar3dPrice, type Avatar3dPurchaseRequest, type AvatarRigNode, type AvatarRigs, type Avatars3dApi, type Base64String, type BootMark, type BootTimeline, type BroadcastOptions, type BytesResponse, CONDITIONAL_HEADERS, type Challenge, type ChallengeWindow, ChallengesApi, type ClientOptions, type Clock, type ConditionalRequestHeaders, type ConfiguredPurchasePayment, type ConfiguredPurchaseRequest, type ConfiguredPurchaseResult, type ControlsApi, DEVICE_SETTINGS_MAX_BYTES, DedicatedServerError, type DedicatedServerFailure, type DedicatedServerSession, type DevToolsOpener, type DeviceSettings, type DeviceSettingsApi, type DeviceSettingsPutOutcome, type DirectPurchaseRequest, type DirectPurchaseResult, type EarnAllowance, type EarnAllowanceEvent, type EarnAllowancePeriod, type EarnAllowanceReadOptions, type EntityLeaderboard, type EntityLeaderboardEntry, type EntityLeaderboardOptions, type EntityType$1 as EntityType, type ExitAnalytics, type ExitBridge, type ExitRooms, type FrameState, type Friend, type FriendChallenge, FriendChallengeError, type FriendChallengeErrorCode, type FriendChallengeOutcome, type FriendChallengeOutcomeKind, type FriendChallengeRequest, type FriendChallengesPage, FriendsApi, type FriendsPage, type FunctionFailure, type FunctionInvokeOptions, type FunctionResult, FunctionsApi, type GameApi, type GameCard, type GameConfig, type GameMenu, type GameMenuItem, type GameServerLink, type GameSettingsApi, type Gem, GemApiError, type GemAudioChannels, GemClient, type GemCohort, type GemCohorts, GemConfigError, type GemControlBox, type GemCorner, type GemDevTools, type GemErrorReason, GemFrame, GemFunctionError, type GemGameChoiceSetting, type GemGameSetting, type GemGameSettingBase, type GemGameSettingChange, type GemGameSettingIcon, type GemGameSettingOption, type GemGameSettingValue, type GemGameSliderSetting, type GemGameToggleSetting, type GemGraphicsQuality, type GemIdentity, type GemInsets, type GemLook, type GemLookBase, type GemLookDelta, type GemLookOptions, type GemLookSpeed, type GemMatchApi, type GemMatchServer, type GemMatchServerModule, type GemOptions, type GemPlayer, type GemPrefs, type GemRecommendedSettings, type GemReservedArea, GemSaveError, type GemServer, type GemServerBundle, type GemServerFactory, type GemServerHost, type GemServerHostProfile, type GemServerIdentity, type GemServerLifecycle, type GemServerOptions, type GemServerProfile, type GemTerminationNotice, GemUnframedError, type GemViewport, type GetLeaderboardOptions, type HostTokenSource, type HostTokenSourceOptions, type JoinWelcome, type Leaderboard, type LeaderboardEntry, type LeaderboardPeriod, LeaderboardsApi, type ListChallengesOptions, type ListFriendChallengesOptions, type ListFriendsOptions, MAX_PERIODS_BACK, type MatchBackfillState, type MatchConnectOptions, type MatchConnection, type MatchHosting, type MatchHostingMode, type MatchPlayerReport, type MatchPlayerReportResult, type MatchServeOptions, type MatchTransport, type MessageMeta, type MomentKind, type MomentResult, type MomentSignal, type MomentsApi, type MultiTransportSession, PLATFORM_EVENTS, type PeriodOptions, PlatformApi, PlatformCurrenciesApi, type PlatformCurrency, type PlatformCurrencyAccess, type PlatformCurrencyPurchasePayment, type PlatformCurrencyPurchaseRequest, type PlatformCurrencyPurchaseResult, type PlatformCurrencyReadOptions, PlatformEarnAllowanceApi, type PlatformEventName, type PlayerBadge$1 as PlayerBadge, type PlayerBoost, type PlayerBoostMultiplier, type PlayerIdentity, type PlayerProfile, PlayerText, type ProfileCallOptions, type ProfileShowcaseEntry$1 as ProfileShowcaseEntry, ProfilesApi, type PurchaseApi, type PurchaseOptions, type PurchaseOutcome, PurchaseRefusal, type PurchaseRefusalCode, type PurchaseRequest, type PutBytesOptions, type PutSaveOptions, type RankedRow, type RecipeAvailability, type RecipeLock, type RequestOptions, type RewardCue, type RewardedStatus, type RoomArgValue, type SavePage, type SaveRecord, type SendOptions$1 as SendOptions, type ServerApi, type ServerBundleHost, type ServerTokenGrant, type SessionEndReason, type ShareApi, type ShareRequest, ShowcaseApi, type ShowcaseCallOptions, type ShowcaseFriendEntry, type ShowcaseFriends, type ShowcaseValue, type SignInOutcome, type SignInOutcomeKind, type SimilarGamesOutcome, type SnapshotCurrency, type SnapshotItem, type StoreApi, type StoreOffersOutcome, type StoreSettlement, type TokenGrant, type Transport, type TransportAdvert, type TransportKind, TransportRefusal, type TransportRequest, type TransportResponse, UNRELIABLE_CHANNEL_LABEL, type VersionedGetOptions, type VersionedResponse, type VibrationApi, type WalletVisibleOptions, type WornAvatar3d$1 as WornAvatar3d, asPlayerText, createBootTimeline, createGem, createGemServer, createHostTokenSource, createMatchServer, defineServer, experimentSelection, leaveAndExit, mapIdentity, markOnResolve, platformIconUrl, presentJoinCredential, readTemplateTransports, readTransportAdvert, reportOnResolve, systemClock, text, toBase64, webTransportAvailable };
@@ -1,6 +1,6 @@
1
1
  # The function surface — API reference
2
2
 
3
- Generated from `@indiegems/gem-web-sdk/function` v15.3.2, the version of the package this file ships in. Every symbol below carries an explicit anchor, its `anchor` in `reference.json` beside this file.
3
+ Generated from `@indiegems/gem-web-sdk/function` v16.0.0, the version of the package this file ships in. Every symbol below carries an explicit anchor, its `anchor` in `reference.json` beside this file.
4
4
 
5
5
  `@indiegems/gem-web-sdk/function` exports exactly the symbols on this page and nothing else.
6
6