@series-inc/venus-sdk 3.2.0 → 3.2.1-beta.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/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { r as AnalyticsApi, s as RpcRequest, t as RpcResponse, u as RpcNotification, v as RpcClient, V as VenusAPI, H as Host, w as StorageApi, N as NavigationApi, Q as QuitOptions, x as NavigationStackInfo, y as PushAppOptions, z as NotificationsApi, C as ScheduleLocalNotification, D as ScheduleNotificationOptions, E as PopupsApi, F as ActionSheetItem, G as ShowActionSheetOptions, I as ShowAlertOptions, J as ShowConfirmOptions, K as ShowToastOptions, L as ShowInterstitialAdOptions, M as ShowRewardedAdOptions, O as ProfileApi, P as Profile, T as DeviceApi, U as DeviceInfo, W as EnvironmentApi, X as EnvironmentInfo, Y as SystemApi, Z as SafeArea, _ as CdnApi, $ as SubPath, a0 as FetchBlobOptions, a1 as TimeApi, a2 as ServerTimeData, a3 as GetFutureTimeOptions, a4 as AiApi, a5 as AiChatCompletionRequest, a6 as AiChatCompletionData, a7 as HapticsApi, a8 as HapticFeedbackStyle, a9 as FeaturesApi, aa as Experiment, ab as LifecycleApi, ac as SleepCallback, ad as Subscription, ae as AwakeCallback, af as PauseCallback, ag as ResumeCallback, ah as QuitCallback, ai as SimulationApi, aj as SimulationSlotValidationResult, g as SimulationSubscribeOptions, ak as SimulationBatchOperation, al as SimulationBatchOperationsResult, am as SimulationAvailableItem, an as SimulationPowerPreview, ao as SimulationSlotMutationResult, ap as SimulationSlotContainer, aq as SimulationAssignment, ar as SimulationState, j as VenusSimulationConfig, as as ExecuteRecipeOptions, at as ExecuteRecipeResponse, au as CollectRecipeResult, av as GetActiveRunsOptions, S as SimulationRunSummary, aw as ExecuteScopedRecipeOptions, ax as ExecuteScopedRecipeResult, ay as GetAvailableRecipesOptions, az as GetAvailableRecipesResult, aA as Recipe, R as RecipeRequirementResult, aB as GetBatchRecipeRequirements, aC as TriggerRecipeChainOptions, aD as RoomDataUpdate, aE as RoomMessageEvent, aF as ProposedMoveEvent, aG as VenusTransport, aH as RoomsApi, aI as CreateRoomOptions, q as VenusRoom, aJ as JoinOrCreateRoomOptions, aK as JoinOrCreateResult, aL as ListRoomsOptions, aM as UpdateRoomDataOptions, aN as RoomMessageRequest, aO as StartRoomGameOptions, aP as ProposeMoveRequest, aQ as ProposeMoveResult, aR as ValidateMoveVerdict, aS as ValidateMoveResult, aT as RoomSubscriptionOptions, aU as LoggingApi, aV as IapApi, aW as SpendCurrencyOptions, aX as LoadEmbeddedAssetsResponse, aY as SharedAssetsApi, aZ as LeaderboardApi, a_ as ScoreToken, a$ as SubmitScoreParams, b0 as SubmitScoreResult, b1 as GetPagedScoresOptions, b2 as PagedScoresResponse, b3 as PlayerRankOptions, b4 as PlayerRankResult, b5 as GetPodiumScoresOptions, b6 as PodiumScoresResponse, b7 as PreloaderApi, b8 as SocialApi, b9 as ShareMetadata, ba as ShareLinkResult, bb as SocialQRCodeOptions, bc as QRCodeResult, bd as Avatar3dApi, be as AssetManifest, bf as Avatar3dConfig, bg as ShowEditorOptions, bh as Avatar3dEdits, bi as AdsApi, bj as InitializationOptions, bk as InitializationContext } from './AdsApi-DFutZ7_q.mjs';
2
- export { bl as AiMessage, bm as Asset, bn as Category, bP as HudInsets, bv as JoinRoomMatchCriteria, bK as LeaderboardAntiCheatConfig, bM as LeaderboardConfig, bL as LeaderboardDisplaySettings, bN as LeaderboardEntry, bH as LeaderboardModeConfig, bJ as LeaderboardPeriodConfig, bI as LeaderboardPeriodType, bG as LoadEmbeddedAssetsRequest, bo as MockAvatarApi, bq as NotificationTriggerInput, bt as OnNotificationCallback, br as OnRequestCallback, bs as OnResponseCallback, bO as PodiumScoresContext, by as RecipeInfo, bw as RoomMessageEventType, bF as RpcSharedAssetsApi, bu as RpcTransport, bC as SimulationBatchOperationAssign, bD as SimulationBatchOperationRemove, bE as SimulationBatchOperationResult, bz as SimulationPersonalState, bA as SimulationRoomActiveRecipe, bB as SimulationRoomState, bp as TimeIntervalTriggerInput, bx as VenusRoomPayload, bQ as createHost } from './AdsApi-DFutZ7_q.mjs';
1
+ import { r as AnalyticsApi, s as RpcRequest, t as RpcResponse, u as RpcNotification, v as RpcClient, V as VenusAPI, H as Host, w as StorageApi, N as NavigationApi, Q as QuitOptions, x as NavigationStackInfo, y as PushAppOptions, z as NotificationsApi, C as ScheduleLocalNotification, D as ScheduleNotificationOptions, E as PopupsApi, F as ActionSheetItem, G as ShowActionSheetOptions, I as ShowAlertOptions, J as ShowConfirmOptions, K as ShowToastOptions, L as ShowInterstitialAdOptions, M as ShowRewardedAdOptions, O as ProfileApi, P as Profile, T as DeviceApi, U as DeviceInfo, W as EnvironmentApi, X as EnvironmentInfo, Y as SystemApi, Z as SafeArea, _ as CdnApi, $ as SubPath, a0 as FetchBlobOptions, a1 as TimeApi, a2 as ServerTimeData, a3 as GetFutureTimeOptions, a4 as AiApi, a5 as AiChatCompletionRequest, a6 as AiChatCompletionData, a7 as HapticsApi, a8 as HapticFeedbackStyle, a9 as FeaturesApi, aa as Experiment, ab as LifecycleApi, ac as SleepCallback, ad as Subscription, ae as AwakeCallback, af as PauseCallback, ag as ResumeCallback, ah as QuitCallback, ai as SimulationApi, aj as SimulationSlotValidationResult, g as SimulationSubscribeOptions, ak as SimulationBatchOperation, al as SimulationBatchOperationsResult, am as SimulationAvailableItem, an as SimulationPowerPreview, ao as SimulationSlotMutationResult, ap as SimulationSlotContainer, aq as SimulationAssignment, ar as SimulationState, j as VenusSimulationConfig, as as ExecuteRecipeOptions, at as ExecuteRecipeResponse, au as CollectRecipeResult, av as GetActiveRunsOptions, S as SimulationRunSummary, aw as ExecuteScopedRecipeOptions, ax as ExecuteScopedRecipeResult, ay as GetAvailableRecipesOptions, az as GetAvailableRecipesResult, aA as Recipe, R as RecipeRequirementResult, aB as GetBatchRecipeRequirements, aC as TriggerRecipeChainOptions, aD as RoomDataUpdate, aE as RoomMessageEvent, aF as ProposedMoveEvent, aG as VenusTransport, aH as RoomsApi, aI as CreateRoomOptions, q as VenusRoom, aJ as JoinOrCreateRoomOptions, aK as JoinOrCreateResult, aL as ListRoomsOptions, aM as UpdateRoomDataOptions, aN as RoomMessageRequest, aO as StartRoomGameOptions, aP as ProposeMoveRequest, aQ as ProposeMoveResult, aR as ValidateMoveVerdict, aS as ValidateMoveResult, aT as RoomSubscriptionOptions, aU as LoggingApi, aV as IapApi, aW as SpendCurrencyOptions, aX as LoadEmbeddedAssetsResponse, aY as SharedAssetsApi, aZ as LeaderboardApi, a_ as ScoreToken, a$ as SubmitScoreParams, b0 as SubmitScoreResult, b1 as GetPagedScoresOptions, b2 as PagedScoresResponse, b3 as PlayerRankOptions, b4 as PlayerRankResult, b5 as GetPodiumScoresOptions, b6 as PodiumScoresResponse, b7 as PreloaderApi, b8 as SocialApi, b9 as ShareMetadata, ba as ShareLinkResult, bb as SocialQRCodeOptions, bc as QRCodeResult, bd as Avatar3dApi, be as AssetManifest, bf as Avatar3dConfig, bg as ShowEditorOptions, bh as Avatar3dEdits, bi as AdsApi, bj as InitializationOptions, bk as InitializationContext } from './AdsApi-or6zfdzM.mjs';
2
+ export { bl as AiMessage, bm as Asset, bn as Category, bP as HudInsets, bv as JoinRoomMatchCriteria, bK as LeaderboardAntiCheatConfig, bM as LeaderboardConfig, bL as LeaderboardDisplaySettings, bN as LeaderboardEntry, bH as LeaderboardModeConfig, bJ as LeaderboardPeriodConfig, bI as LeaderboardPeriodType, bG as LoadEmbeddedAssetsRequest, bo as MockAvatarApi, bq as NotificationTriggerInput, bt as OnNotificationCallback, br as OnRequestCallback, bs as OnResponseCallback, bO as PodiumScoresContext, by as RecipeInfo, bw as RoomMessageEventType, bF as RpcSharedAssetsApi, bu as RpcTransport, bC as SimulationBatchOperationAssign, bD as SimulationBatchOperationRemove, bE as SimulationBatchOperationResult, bz as SimulationPersonalState, bA as SimulationRoomActiveRecipe, bB as SimulationRoomState, bp as TimeIntervalTriggerInput, bx as VenusRoomPayload, bQ as createHost } from './AdsApi-or6zfdzM.mjs';
3
3
  export { WEBVIEW_LIBRARY_SHIM_SOURCE, getWebviewLibraryShimSource } from './webview/index.mjs';
4
4
 
5
5
  declare class MockAnalyticsApi implements AnalyticsApi {
@@ -23,6 +23,7 @@ declare function createMockStorageApi(storageType: StorageType, appUrl?: string)
23
23
  declare class MockStorageApi implements StorageApi {
24
24
  private readonly prefix;
25
25
  private readonly syncDelay;
26
+ private readonly orderStorageKey;
26
27
  constructor(prefix: string, syncDelay: number);
27
28
  clear(): Promise<void>;
28
29
  getAllItems(): Promise<string[]>;
@@ -40,6 +41,16 @@ declare class MockStorageApi implements StorageApi {
40
41
  private extractKey;
41
42
  private keys;
42
43
  private simulateSyncDelay;
44
+ private readOrder;
45
+ private normalizeOrder;
46
+ private rebuildOrderFromStorage;
47
+ private upsertOrder;
48
+ private bulkUpsertOrder;
49
+ private removeFromOrder;
50
+ private bulkRemoveFromOrder;
51
+ private writeOrder;
52
+ private clearOrder;
53
+ private dedupeKeys;
43
54
  }
44
55
 
45
56
  interface MethodIds {
@@ -460,7 +471,6 @@ declare class MockSharedAssetsApi implements SharedAssetsApi {
460
471
  private readonly venusApi;
461
472
  constructor(venusApi: VenusAPI);
462
473
  loadAssetsBundle(game: string, bundleKey: string, fileType?: string): Promise<ArrayBuffer>;
463
- loadLibraryCode(libraryKey: string): Promise<string>;
464
474
  }
465
475
 
466
476
  type ModuleSpecifierMatch = 'exact' | 'prefix';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { r as AnalyticsApi, s as RpcRequest, t as RpcResponse, u as RpcNotification, v as RpcClient, V as VenusAPI, H as Host, w as StorageApi, N as NavigationApi, Q as QuitOptions, x as NavigationStackInfo, y as PushAppOptions, z as NotificationsApi, C as ScheduleLocalNotification, D as ScheduleNotificationOptions, E as PopupsApi, F as ActionSheetItem, G as ShowActionSheetOptions, I as ShowAlertOptions, J as ShowConfirmOptions, K as ShowToastOptions, L as ShowInterstitialAdOptions, M as ShowRewardedAdOptions, O as ProfileApi, P as Profile, T as DeviceApi, U as DeviceInfo, W as EnvironmentApi, X as EnvironmentInfo, Y as SystemApi, Z as SafeArea, _ as CdnApi, $ as SubPath, a0 as FetchBlobOptions, a1 as TimeApi, a2 as ServerTimeData, a3 as GetFutureTimeOptions, a4 as AiApi, a5 as AiChatCompletionRequest, a6 as AiChatCompletionData, a7 as HapticsApi, a8 as HapticFeedbackStyle, a9 as FeaturesApi, aa as Experiment, ab as LifecycleApi, ac as SleepCallback, ad as Subscription, ae as AwakeCallback, af as PauseCallback, ag as ResumeCallback, ah as QuitCallback, ai as SimulationApi, aj as SimulationSlotValidationResult, g as SimulationSubscribeOptions, ak as SimulationBatchOperation, al as SimulationBatchOperationsResult, am as SimulationAvailableItem, an as SimulationPowerPreview, ao as SimulationSlotMutationResult, ap as SimulationSlotContainer, aq as SimulationAssignment, ar as SimulationState, j as VenusSimulationConfig, as as ExecuteRecipeOptions, at as ExecuteRecipeResponse, au as CollectRecipeResult, av as GetActiveRunsOptions, S as SimulationRunSummary, aw as ExecuteScopedRecipeOptions, ax as ExecuteScopedRecipeResult, ay as GetAvailableRecipesOptions, az as GetAvailableRecipesResult, aA as Recipe, R as RecipeRequirementResult, aB as GetBatchRecipeRequirements, aC as TriggerRecipeChainOptions, aD as RoomDataUpdate, aE as RoomMessageEvent, aF as ProposedMoveEvent, aG as VenusTransport, aH as RoomsApi, aI as CreateRoomOptions, q as VenusRoom, aJ as JoinOrCreateRoomOptions, aK as JoinOrCreateResult, aL as ListRoomsOptions, aM as UpdateRoomDataOptions, aN as RoomMessageRequest, aO as StartRoomGameOptions, aP as ProposeMoveRequest, aQ as ProposeMoveResult, aR as ValidateMoveVerdict, aS as ValidateMoveResult, aT as RoomSubscriptionOptions, aU as LoggingApi, aV as IapApi, aW as SpendCurrencyOptions, aX as LoadEmbeddedAssetsResponse, aY as SharedAssetsApi, aZ as LeaderboardApi, a_ as ScoreToken, a$ as SubmitScoreParams, b0 as SubmitScoreResult, b1 as GetPagedScoresOptions, b2 as PagedScoresResponse, b3 as PlayerRankOptions, b4 as PlayerRankResult, b5 as GetPodiumScoresOptions, b6 as PodiumScoresResponse, b7 as PreloaderApi, b8 as SocialApi, b9 as ShareMetadata, ba as ShareLinkResult, bb as SocialQRCodeOptions, bc as QRCodeResult, bd as Avatar3dApi, be as AssetManifest, bf as Avatar3dConfig, bg as ShowEditorOptions, bh as Avatar3dEdits, bi as AdsApi, bj as InitializationOptions, bk as InitializationContext } from './AdsApi-DFutZ7_q.js';
2
- export { bl as AiMessage, bm as Asset, bn as Category, bP as HudInsets, bv as JoinRoomMatchCriteria, bK as LeaderboardAntiCheatConfig, bM as LeaderboardConfig, bL as LeaderboardDisplaySettings, bN as LeaderboardEntry, bH as LeaderboardModeConfig, bJ as LeaderboardPeriodConfig, bI as LeaderboardPeriodType, bG as LoadEmbeddedAssetsRequest, bo as MockAvatarApi, bq as NotificationTriggerInput, bt as OnNotificationCallback, br as OnRequestCallback, bs as OnResponseCallback, bO as PodiumScoresContext, by as RecipeInfo, bw as RoomMessageEventType, bF as RpcSharedAssetsApi, bu as RpcTransport, bC as SimulationBatchOperationAssign, bD as SimulationBatchOperationRemove, bE as SimulationBatchOperationResult, bz as SimulationPersonalState, bA as SimulationRoomActiveRecipe, bB as SimulationRoomState, bp as TimeIntervalTriggerInput, bx as VenusRoomPayload, bQ as createHost } from './AdsApi-DFutZ7_q.js';
1
+ import { r as AnalyticsApi, s as RpcRequest, t as RpcResponse, u as RpcNotification, v as RpcClient, V as VenusAPI, H as Host, w as StorageApi, N as NavigationApi, Q as QuitOptions, x as NavigationStackInfo, y as PushAppOptions, z as NotificationsApi, C as ScheduleLocalNotification, D as ScheduleNotificationOptions, E as PopupsApi, F as ActionSheetItem, G as ShowActionSheetOptions, I as ShowAlertOptions, J as ShowConfirmOptions, K as ShowToastOptions, L as ShowInterstitialAdOptions, M as ShowRewardedAdOptions, O as ProfileApi, P as Profile, T as DeviceApi, U as DeviceInfo, W as EnvironmentApi, X as EnvironmentInfo, Y as SystemApi, Z as SafeArea, _ as CdnApi, $ as SubPath, a0 as FetchBlobOptions, a1 as TimeApi, a2 as ServerTimeData, a3 as GetFutureTimeOptions, a4 as AiApi, a5 as AiChatCompletionRequest, a6 as AiChatCompletionData, a7 as HapticsApi, a8 as HapticFeedbackStyle, a9 as FeaturesApi, aa as Experiment, ab as LifecycleApi, ac as SleepCallback, ad as Subscription, ae as AwakeCallback, af as PauseCallback, ag as ResumeCallback, ah as QuitCallback, ai as SimulationApi, aj as SimulationSlotValidationResult, g as SimulationSubscribeOptions, ak as SimulationBatchOperation, al as SimulationBatchOperationsResult, am as SimulationAvailableItem, an as SimulationPowerPreview, ao as SimulationSlotMutationResult, ap as SimulationSlotContainer, aq as SimulationAssignment, ar as SimulationState, j as VenusSimulationConfig, as as ExecuteRecipeOptions, at as ExecuteRecipeResponse, au as CollectRecipeResult, av as GetActiveRunsOptions, S as SimulationRunSummary, aw as ExecuteScopedRecipeOptions, ax as ExecuteScopedRecipeResult, ay as GetAvailableRecipesOptions, az as GetAvailableRecipesResult, aA as Recipe, R as RecipeRequirementResult, aB as GetBatchRecipeRequirements, aC as TriggerRecipeChainOptions, aD as RoomDataUpdate, aE as RoomMessageEvent, aF as ProposedMoveEvent, aG as VenusTransport, aH as RoomsApi, aI as CreateRoomOptions, q as VenusRoom, aJ as JoinOrCreateRoomOptions, aK as JoinOrCreateResult, aL as ListRoomsOptions, aM as UpdateRoomDataOptions, aN as RoomMessageRequest, aO as StartRoomGameOptions, aP as ProposeMoveRequest, aQ as ProposeMoveResult, aR as ValidateMoveVerdict, aS as ValidateMoveResult, aT as RoomSubscriptionOptions, aU as LoggingApi, aV as IapApi, aW as SpendCurrencyOptions, aX as LoadEmbeddedAssetsResponse, aY as SharedAssetsApi, aZ as LeaderboardApi, a_ as ScoreToken, a$ as SubmitScoreParams, b0 as SubmitScoreResult, b1 as GetPagedScoresOptions, b2 as PagedScoresResponse, b3 as PlayerRankOptions, b4 as PlayerRankResult, b5 as GetPodiumScoresOptions, b6 as PodiumScoresResponse, b7 as PreloaderApi, b8 as SocialApi, b9 as ShareMetadata, ba as ShareLinkResult, bb as SocialQRCodeOptions, bc as QRCodeResult, bd as Avatar3dApi, be as AssetManifest, bf as Avatar3dConfig, bg as ShowEditorOptions, bh as Avatar3dEdits, bi as AdsApi, bj as InitializationOptions, bk as InitializationContext } from './AdsApi-or6zfdzM.js';
2
+ export { bl as AiMessage, bm as Asset, bn as Category, bP as HudInsets, bv as JoinRoomMatchCriteria, bK as LeaderboardAntiCheatConfig, bM as LeaderboardConfig, bL as LeaderboardDisplaySettings, bN as LeaderboardEntry, bH as LeaderboardModeConfig, bJ as LeaderboardPeriodConfig, bI as LeaderboardPeriodType, bG as LoadEmbeddedAssetsRequest, bo as MockAvatarApi, bq as NotificationTriggerInput, bt as OnNotificationCallback, br as OnRequestCallback, bs as OnResponseCallback, bO as PodiumScoresContext, by as RecipeInfo, bw as RoomMessageEventType, bF as RpcSharedAssetsApi, bu as RpcTransport, bC as SimulationBatchOperationAssign, bD as SimulationBatchOperationRemove, bE as SimulationBatchOperationResult, bz as SimulationPersonalState, bA as SimulationRoomActiveRecipe, bB as SimulationRoomState, bp as TimeIntervalTriggerInput, bx as VenusRoomPayload, bQ as createHost } from './AdsApi-or6zfdzM.js';
3
3
  export { WEBVIEW_LIBRARY_SHIM_SOURCE, getWebviewLibraryShimSource } from './webview/index.js';
4
4
 
5
5
  declare class MockAnalyticsApi implements AnalyticsApi {
@@ -23,6 +23,7 @@ declare function createMockStorageApi(storageType: StorageType, appUrl?: string)
23
23
  declare class MockStorageApi implements StorageApi {
24
24
  private readonly prefix;
25
25
  private readonly syncDelay;
26
+ private readonly orderStorageKey;
26
27
  constructor(prefix: string, syncDelay: number);
27
28
  clear(): Promise<void>;
28
29
  getAllItems(): Promise<string[]>;
@@ -40,6 +41,16 @@ declare class MockStorageApi implements StorageApi {
40
41
  private extractKey;
41
42
  private keys;
42
43
  private simulateSyncDelay;
44
+ private readOrder;
45
+ private normalizeOrder;
46
+ private rebuildOrderFromStorage;
47
+ private upsertOrder;
48
+ private bulkUpsertOrder;
49
+ private removeFromOrder;
50
+ private bulkRemoveFromOrder;
51
+ private writeOrder;
52
+ private clearOrder;
53
+ private dedupeKeys;
43
54
  }
44
55
 
45
56
  interface MethodIds {
@@ -460,7 +471,6 @@ declare class MockSharedAssetsApi implements SharedAssetsApi {
460
471
  private readonly venusApi;
461
472
  constructor(venusApi: VenusAPI);
462
473
  loadAssetsBundle(game: string, bundleKey: string, fileType?: string): Promise<ArrayBuffer>;
463
- loadLibraryCode(libraryKey: string): Promise<string>;
464
474
  }
465
475
 
466
476
  type ModuleSpecifierMatch = 'exact' | 'prefix';
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { DEFAULT_SHARED_LIB_CDN_BASE, EMBEDDED_LIBRARIES, EMBEDDED_LIBRARY_BY_KEY, HASH_ALGORITHM_NODE, HASH_ALGORITHM_WEB_CRYPTO, HapticFeedbackStyle, HostCdnApi, HostDeviceApi, HostEnvironmentApi, HostProfileApi, HostSystemApi, HostTimeApi, MODULE_TO_LIBRARY_SPECIFIERS, MockAdsApi, MockAiApi, MockAnalyticsApi, MockAvatarApi, MockCdnApi, MockDeviceApi, MockEnvironmentApi, MockFeaturesApi, MockHapticsApi, MockIapApi, MockLeaderboardApi, MockLifecycleApi, MockLoggingApi, MockNavigationApi, MockNotificationsApi, MockPopupsApi, MockPreloaderApi, MockProfileApi, MockSharedAssetsApi, MockSocialApi, MockStorageApi, MockSystemApi, MockTimeApi, RemoteHost, RpcAdsApi, RpcAiApi, RpcAnalyticsApi, RpcAvatarApi, RpcClient, RpcFeaturesApi, RpcHapticsApi, RpcIapApi, RpcLeaderboardApi, RpcLifecycleApi, RpcLoggingApi, RpcNavigationApi, RpcNotificationsApi, RpcPopupsApi, RpcPreloaderApi, RpcRoomsApi, RpcSharedAssetsApi, RpcSimulationApi, RpcSocialApi, RpcStorageApi, SDK_VERSION, VenusMessageId, VenusRoom, base64ToArrayBuffer, base64ToUtf8, computeScoreHash, createHost, createMockStorageApi, getLibraryDefinition, initializeAds, initializeAi, initializeAnalytics, initializeAvatar3d, initializeCdn, initializeFeaturesApi, initializeHaptics, initializeIap, initializeLeaderboard, initializeLifecycleApi, initializeLocalNotifications, initializeLoggingApi, initializePopups, initializePreloader, initializeProfile, initializeRoomsApi, initializeSimulation, initializeSocial, initializeStackNavigation, initializeStorage, initializeSystem, initializeTime, isPacificDaylightTime, setupRoomNotifications } from './chunk-AGXMORDL.mjs';
1
+ export { DEFAULT_SHARED_LIB_CDN_BASE, EMBEDDED_LIBRARIES, EMBEDDED_LIBRARY_BY_KEY, HASH_ALGORITHM_NODE, HASH_ALGORITHM_WEB_CRYPTO, HapticFeedbackStyle, HostCdnApi, HostDeviceApi, HostEnvironmentApi, HostProfileApi, HostSystemApi, HostTimeApi, MODULE_TO_LIBRARY_SPECIFIERS, MockAdsApi, MockAiApi, MockAnalyticsApi, MockAvatarApi, MockCdnApi, MockDeviceApi, MockEnvironmentApi, MockFeaturesApi, MockHapticsApi, MockIapApi, MockLeaderboardApi, MockLifecycleApi, MockLoggingApi, MockNavigationApi, MockNotificationsApi, MockPopupsApi, MockPreloaderApi, MockProfileApi, MockSharedAssetsApi, MockSocialApi, MockStorageApi, MockSystemApi, MockTimeApi, RemoteHost, RpcAdsApi, RpcAiApi, RpcAnalyticsApi, RpcAvatarApi, RpcClient, RpcFeaturesApi, RpcHapticsApi, RpcIapApi, RpcLeaderboardApi, RpcLifecycleApi, RpcLoggingApi, RpcNavigationApi, RpcNotificationsApi, RpcPopupsApi, RpcPreloaderApi, RpcRoomsApi, RpcSharedAssetsApi, RpcSimulationApi, RpcSocialApi, RpcStorageApi, SDK_VERSION, VenusMessageId, VenusRoom, base64ToArrayBuffer, base64ToUtf8, computeScoreHash, createHost, createMockStorageApi, getLibraryDefinition, initializeAds, initializeAi, initializeAnalytics, initializeAvatar3d, initializeCdn, initializeFeaturesApi, initializeHaptics, initializeIap, initializeLeaderboard, initializeLifecycleApi, initializeLocalNotifications, initializeLoggingApi, initializePopups, initializePreloader, initializeProfile, initializeRoomsApi, initializeSimulation, initializeSocial, initializeStackNavigation, initializeStorage, initializeSystem, initializeTime, isPacificDaylightTime, setupRoomNotifications } from './chunk-YOBDYPKZ.mjs';
2
2
  export { WEBVIEW_LIBRARY_SHIM_SOURCE, getWebviewLibraryShimSource } from './chunk-UXY5CKKG.mjs';
3
3
  import './chunk-QABXMFND.mjs';
4
4
  import './chunk-NSSMTXJJ.mjs';
@@ -101,21 +101,23 @@ var init_core = __esm({
101
101
  });
102
102
 
103
103
  // src/storage/MockStorageApi.ts
104
+ var STORAGE_PREFIXES = {
105
+ globalStorage: "venus:global",
106
+ deviceCache: "venus:deviceCache",
107
+ appStorage: "venus:appStorage"
108
+ };
104
109
  function createMockStorageApi(storageType, appUrl) {
105
110
  const appIdentifier = appUrl ? generateAppIdentifier(appUrl) : null;
106
- let prefix;
111
+ let prefix = STORAGE_PREFIXES[storageType];
107
112
  let syncDelay = 0;
108
113
  switch (storageType) {
109
114
  case "deviceCache":
110
- prefix = "venus:app";
111
115
  syncDelay = 0;
112
116
  break;
113
117
  case "appStorage":
114
- prefix = "venus:app";
115
118
  syncDelay = 100;
116
119
  break;
117
120
  case "globalStorage":
118
- prefix = "venus:global";
119
121
  syncDelay = 100;
120
122
  break;
121
123
  default:
@@ -128,29 +130,38 @@ var MockStorageApi = class {
128
130
  constructor(prefix, syncDelay) {
129
131
  __publicField(this, "prefix");
130
132
  __publicField(this, "syncDelay");
133
+ __publicField(this, "orderStorageKey");
131
134
  this.prefix = prefix;
132
135
  this.syncDelay = syncDelay;
136
+ this.orderStorageKey = `${prefix}__order__`;
133
137
  }
134
138
  async clear() {
139
+ const keysToRemove = [];
135
140
  const fullLength = localStorage.length;
136
141
  for (let i = 0; i < fullLength; i++) {
137
142
  const fullKey = localStorage.key(i);
138
- if (fullKey && fullKey.startsWith(this.prefix)) {
139
- localStorage.removeItem(fullKey);
143
+ if (!fullKey || fullKey === this.orderStorageKey) {
144
+ continue;
145
+ }
146
+ if (fullKey.startsWith(this.prefix)) {
147
+ keysToRemove.push(fullKey);
140
148
  }
141
149
  }
150
+ for (const key of keysToRemove) {
151
+ localStorage.removeItem(key);
152
+ }
153
+ this.clearOrder();
142
154
  await this.simulateSyncDelay();
143
155
  }
144
156
  async getAllItems() {
145
157
  const items = new Array();
146
- const fullLength = localStorage.length;
147
- for (let i = 0; i < fullLength; i++) {
148
- const fullKey = localStorage.key(i);
149
- if (fullKey && fullKey.startsWith(this.prefix)) {
150
- const item = localStorage.getItem(fullKey);
151
- if (item) {
152
- items.push(item);
153
- }
158
+ const orderedKeys = this.keys();
159
+ for (const key of orderedKeys) {
160
+ const value = localStorage.getItem(this.buildKey(key));
161
+ if (value !== null) {
162
+ items.push(value);
163
+ } else {
164
+ this.removeFromOrder(key);
154
165
  }
155
166
  }
156
167
  return items;
@@ -175,11 +186,13 @@ var MockStorageApi = class {
175
186
  const fullKey = this.buildKey(key);
176
187
  await this.simulateSyncDelay();
177
188
  localStorage.removeItem(fullKey);
189
+ this.removeFromOrder(key);
178
190
  }
179
191
  async setItem(key, item) {
180
192
  const fullKey = this.buildKey(key);
181
193
  await this.simulateSyncDelay();
182
194
  localStorage.setItem(fullKey, item);
195
+ this.upsertOrder(key);
183
196
  }
184
197
  async setMultipleItems(entries) {
185
198
  for (const entry of entries) {
@@ -187,6 +200,7 @@ var MockStorageApi = class {
187
200
  localStorage.setItem(fullKey, entry.value);
188
201
  }
189
202
  await this.simulateSyncDelay();
203
+ this.bulkUpsertOrder(entries.map((entry) => entry.key));
190
204
  }
191
205
  async removeMultipleItems(keys) {
192
206
  for (const key of keys) {
@@ -194,6 +208,7 @@ var MockStorageApi = class {
194
208
  localStorage.removeItem(fullKey);
195
209
  }
196
210
  await this.simulateSyncDelay();
211
+ this.bulkRemoveFromOrder(keys);
197
212
  }
198
213
  buildKey(key) {
199
214
  const prefix = this.prefix;
@@ -204,17 +219,8 @@ var MockStorageApi = class {
204
219
  return fullKey.substring(prefix.length);
205
220
  }
206
221
  keys() {
207
- const keys = new Array();
208
- let length = localStorage.length;
209
- for (let i = 0; i < length; i++) {
210
- const fullKey = localStorage.key(i);
211
- if (fullKey && fullKey.startsWith(this.prefix)) {
212
- length++;
213
- const key = this.extractKey(fullKey);
214
- keys.push(key);
215
- }
216
- }
217
- return keys;
222
+ const order = this.readOrder();
223
+ return [...order];
218
224
  }
219
225
  async simulateSyncDelay() {
220
226
  const syncDelay = this.syncDelay;
@@ -222,6 +228,127 @@ var MockStorageApi = class {
222
228
  await new Promise((resolve) => setTimeout(resolve, syncDelay));
223
229
  }
224
230
  }
231
+ readOrder() {
232
+ const raw = localStorage.getItem(this.orderStorageKey);
233
+ if (!raw) {
234
+ return this.rebuildOrderFromStorage();
235
+ }
236
+ try {
237
+ const parsed = JSON.parse(raw);
238
+ if (Array.isArray(parsed)) {
239
+ return this.normalizeOrder(parsed);
240
+ }
241
+ } catch {
242
+ }
243
+ return this.rebuildOrderFromStorage();
244
+ }
245
+ normalizeOrder(order) {
246
+ const seen = /* @__PURE__ */ new Set();
247
+ const normalized = [];
248
+ let changed = false;
249
+ for (const entry of order) {
250
+ if (typeof entry !== "string") {
251
+ changed = true;
252
+ continue;
253
+ }
254
+ if (seen.has(entry)) {
255
+ changed = true;
256
+ continue;
257
+ }
258
+ const fullKey = this.buildKey(entry);
259
+ if (localStorage.getItem(fullKey) === null) {
260
+ changed = true;
261
+ continue;
262
+ }
263
+ seen.add(entry);
264
+ normalized.push(entry);
265
+ }
266
+ if (changed) {
267
+ this.writeOrder(normalized);
268
+ }
269
+ return normalized;
270
+ }
271
+ rebuildOrderFromStorage() {
272
+ const keys = [];
273
+ const total = localStorage.length;
274
+ for (let i = 0; i < total; i++) {
275
+ const fullKey = localStorage.key(i);
276
+ if (!fullKey) continue;
277
+ if (fullKey === this.orderStorageKey) continue;
278
+ if (fullKey.startsWith(this.prefix)) {
279
+ keys.push(this.extractKey(fullKey));
280
+ }
281
+ }
282
+ this.writeOrder(keys);
283
+ return keys;
284
+ }
285
+ upsertOrder(key) {
286
+ const order = this.readOrder();
287
+ const index = order.indexOf(key);
288
+ if (index !== -1) {
289
+ order.splice(index, 1);
290
+ }
291
+ order.push(key);
292
+ this.writeOrder(order);
293
+ }
294
+ bulkUpsertOrder(keys) {
295
+ const dedupedKeys = this.dedupeKeys(keys);
296
+ if (dedupedKeys.length === 0) {
297
+ return;
298
+ }
299
+ const order = this.readOrder();
300
+ const keysSet = new Set(dedupedKeys);
301
+ const filtered = order.filter((entry) => !keysSet.has(entry));
302
+ for (const key of dedupedKeys) {
303
+ filtered.push(key);
304
+ }
305
+ this.writeOrder(filtered);
306
+ }
307
+ removeFromOrder(key) {
308
+ const order = this.readOrder();
309
+ const index = order.indexOf(key);
310
+ if (index !== -1) {
311
+ order.splice(index, 1);
312
+ this.writeOrder(order);
313
+ }
314
+ }
315
+ bulkRemoveFromOrder(keys) {
316
+ const dedupedKeys = this.dedupeKeys(keys);
317
+ if (dedupedKeys.length === 0) {
318
+ return;
319
+ }
320
+ const order = this.readOrder();
321
+ const keysSet = new Set(dedupedKeys);
322
+ const filtered = order.filter((entry) => !keysSet.has(entry));
323
+ if (filtered.length !== order.length) {
324
+ this.writeOrder(filtered);
325
+ }
326
+ }
327
+ writeOrder(order) {
328
+ if (order.length === 0) {
329
+ localStorage.removeItem(this.orderStorageKey);
330
+ return;
331
+ }
332
+ localStorage.setItem(this.orderStorageKey, JSON.stringify(order));
333
+ }
334
+ clearOrder() {
335
+ localStorage.removeItem(this.orderStorageKey);
336
+ }
337
+ dedupeKeys(keys) {
338
+ const result = [];
339
+ const seen = /* @__PURE__ */ new Set();
340
+ for (const key of keys) {
341
+ if (typeof key !== "string") {
342
+ continue;
343
+ }
344
+ if (seen.has(key)) {
345
+ continue;
346
+ }
347
+ seen.add(key);
348
+ result.push(key);
349
+ }
350
+ return result;
351
+ }
225
352
  };
226
353
  function generateAppIdentifier(appUrl) {
227
354
  if (!appUrl) appUrl = "";
@@ -5069,6 +5196,54 @@ function initializeLoggingApi(venusApi, host) {
5069
5196
  };
5070
5197
  }
5071
5198
 
5199
+ // src/shared-assets/base64Utils.ts
5200
+ function base64ToArrayBuffer(base64) {
5201
+ const binaryString = atob(base64);
5202
+ const len = binaryString.length;
5203
+ const bytes = new Uint8Array(len);
5204
+ for (let i = 0; i < len; i++) {
5205
+ bytes[i] = binaryString.charCodeAt(i);
5206
+ }
5207
+ return bytes.buffer;
5208
+ }
5209
+
5210
+ // src/shared-assets/RpcSharedAssetsApi.ts
5211
+ var RpcSharedAssetsApi = class {
5212
+ constructor(rpcClient, venusApi) {
5213
+ __publicField(this, "venusApi");
5214
+ __publicField(this, "rpcClient");
5215
+ this.rpcClient = rpcClient;
5216
+ this.venusApi = venusApi;
5217
+ }
5218
+ async loadAssetsBundle(game, bundleKey, fileType = "stow") {
5219
+ try {
5220
+ const response = await this.rpcClient.callT("H5_LOAD_EMBEDDED_ASSET" /* H5_LOAD_EMBEDDED_ASSET */, {
5221
+ assetKey: bundleKey
5222
+ });
5223
+ return base64ToArrayBuffer(response.base64Data);
5224
+ } catch (err) {
5225
+ try {
5226
+ const blob = await this.venusApi.cdn.fetchBlob(`${game}/${bundleKey}.${fileType}`);
5227
+ return await blob.arrayBuffer();
5228
+ } catch (e) {
5229
+ throw new Error(`Failed to load ${bundleKey}`);
5230
+ }
5231
+ }
5232
+ }
5233
+ };
5234
+
5235
+ // src/shared-assets/MockSharedAssetsApi.ts
5236
+ var MockSharedAssetsApi = class {
5237
+ constructor(venusApi) {
5238
+ __publicField(this, "venusApi");
5239
+ this.venusApi = venusApi;
5240
+ }
5241
+ async loadAssetsBundle(game, bundleKey, fileType = "stow") {
5242
+ const blob = await this.venusApi.cdn.fetchBlob(`${game}/${bundleKey}.${fileType}`);
5243
+ return await blob.arrayBuffer();
5244
+ }
5245
+ };
5246
+
5072
5247
  // src/shared-assets/embeddedLibrariesManifest.ts
5073
5248
  var EMBEDDED_LIBRARIES = [
5074
5249
  {
@@ -5183,7 +5358,7 @@ var EMBEDDED_LIBRARIES = [
5183
5358
  // Not ready yet - WASM loading needs additional work
5184
5359
  }
5185
5360
  ];
5186
- var EMBEDDED_LIBRARY_BY_KEY = EMBEDDED_LIBRARIES.reduce(
5361
+ EMBEDDED_LIBRARIES.reduce(
5187
5362
  (acc, lib) => {
5188
5363
  acc[lib.libraryKey] = lib;
5189
5364
  return acc;
@@ -5198,113 +5373,6 @@ EMBEDDED_LIBRARIES.filter(
5198
5373
  libraryKey: lib.libraryKey
5199
5374
  }))
5200
5375
  );
5201
- function getLibraryDefinition(libraryKey) {
5202
- const definition = EMBEDDED_LIBRARY_BY_KEY[libraryKey];
5203
- if (!definition) {
5204
- const availableKeys = Object.keys(EMBEDDED_LIBRARY_BY_KEY).join(", ");
5205
- throw new Error(
5206
- `Unsupported embedded library: ${libraryKey}. Available libraries: ${availableKeys}`
5207
- );
5208
- }
5209
- return definition;
5210
- }
5211
-
5212
- // src/shared-assets/base64Utils.ts
5213
- function base64ToArrayBuffer(base64) {
5214
- const binaryString = atob(base64);
5215
- const len = binaryString.length;
5216
- const bytes = new Uint8Array(len);
5217
- for (let i = 0; i < len; i++) {
5218
- bytes[i] = binaryString.charCodeAt(i);
5219
- }
5220
- return bytes.buffer;
5221
- }
5222
- function base64ToUtf8(base64) {
5223
- if (typeof TextDecoder !== "undefined") {
5224
- const decoder = new TextDecoder("utf-8");
5225
- const buffer = base64ToArrayBuffer(base64);
5226
- return decoder.decode(new Uint8Array(buffer));
5227
- }
5228
- if (typeof globalThis !== "undefined" && typeof globalThis.Buffer !== "undefined") {
5229
- const BufferCtor = globalThis.Buffer;
5230
- return BufferCtor.from(base64, "base64").toString("utf-8");
5231
- }
5232
- const binaryString = atob(base64);
5233
- let result = "";
5234
- for (let i = 0; i < binaryString.length; i++) {
5235
- result += String.fromCharCode(binaryString.charCodeAt(i));
5236
- }
5237
- return decodeURIComponent(escape(result));
5238
- }
5239
-
5240
- // src/shared-assets/RpcSharedAssetsApi.ts
5241
- var RpcSharedAssetsApi = class {
5242
- constructor(rpcClient, venusApi) {
5243
- __publicField(this, "venusApi");
5244
- __publicField(this, "rpcClient");
5245
- this.rpcClient = rpcClient;
5246
- this.venusApi = venusApi;
5247
- }
5248
- async loadAssetsBundle(game, bundleKey, fileType = "stow") {
5249
- try {
5250
- const response = await this.rpcClient.callT("H5_LOAD_EMBEDDED_ASSET" /* H5_LOAD_EMBEDDED_ASSET */, {
5251
- assetKey: bundleKey
5252
- });
5253
- return base64ToArrayBuffer(response.base64Data);
5254
- } catch (err) {
5255
- try {
5256
- const blob = await this.venusApi.cdn.fetchBlob(`${game}/${bundleKey}.${fileType}`);
5257
- return await blob.arrayBuffer();
5258
- } catch (e) {
5259
- throw new Error(`Failed to load ${bundleKey}`);
5260
- }
5261
- }
5262
- }
5263
- async loadLibraryCode(libraryKey) {
5264
- const definition = getLibraryDefinition(libraryKey);
5265
- try {
5266
- const response = await this.rpcClient.callT("H5_LOAD_EMBEDDED_ASSET" /* H5_LOAD_EMBEDDED_ASSET */, {
5267
- assetKey: definition.assetKey
5268
- });
5269
- return base64ToUtf8(response.base64Data);
5270
- } catch (err) {
5271
- console.error(
5272
- `[Venus Libraries] Failed to load ${libraryKey} from host via RPC:`,
5273
- err
5274
- );
5275
- console.warn(
5276
- `[Venus Libraries] Falling back to CDN for ${libraryKey}. This may indicate an asset packaging issue.`
5277
- );
5278
- try {
5279
- const cdnUrl = this.venusApi.cdn.resolveSharedLibUrl(definition.cdnPath);
5280
- const response = await this.venusApi.cdn.fetchFromCdn(cdnUrl);
5281
- return await response.text();
5282
- } catch (cdnError) {
5283
- throw new Error(
5284
- `Failed to load embedded library ${libraryKey}: RPC failed, CDN fallback failed: ${cdnError.message}`
5285
- );
5286
- }
5287
- }
5288
- }
5289
- };
5290
-
5291
- // src/shared-assets/MockSharedAssetsApi.ts
5292
- var MockSharedAssetsApi = class {
5293
- constructor(venusApi) {
5294
- __publicField(this, "venusApi");
5295
- this.venusApi = venusApi;
5296
- }
5297
- async loadAssetsBundle(game, bundleKey, fileType = "stow") {
5298
- const blob = await this.venusApi.cdn.fetchBlob(`${game}/${bundleKey}.${fileType}`);
5299
- return await blob.arrayBuffer();
5300
- }
5301
- async loadLibraryCode(libraryKey) {
5302
- const definition = getLibraryDefinition(libraryKey);
5303
- const url = this.venusApi.cdn.resolveSharedLibUrl(definition.cdnPath);
5304
- const response = await this.venusApi.cdn.fetchFromCdn(url);
5305
- return await response.text();
5306
- }
5307
- };
5308
5376
 
5309
5377
  // src/game-preloader/MockPreloaderApi.ts
5310
5378
  var MockPreloaderApi = class {
@@ -6830,7 +6898,7 @@ var RemoteHost = class {
6830
6898
  5e3
6831
6899
  );
6832
6900
  transport.instanceId = response.instanceId;
6833
- this.log(`Remote Host Initialized with id: ${transport.instanceId}`);
6901
+ this.log(`Remote Host Initialized with id: ${transport.instanceId}, response: ${JSON.stringify(response)}`);
6834
6902
  const profile = response.profile;
6835
6903
  const sanitizedProfile = {
6836
6904
  id: profile.id,
@@ -6870,7 +6938,7 @@ function createHost(venusApi, isMock) {
6870
6938
  }
6871
6939
 
6872
6940
  // src/version.ts
6873
- var SDK_VERSION = "3.2.0";
6941
+ var SDK_VERSION = "3.2.1-beta.0";
6874
6942
 
6875
6943
  // src/social/index.ts
6876
6944
  function initializeSocial(venusApi, host) {