@series-inc/venus-sdk 3.1.2-beta.2 → 3.2.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.
@@ -819,8 +819,7 @@ interface LoggingApi {
819
819
  }
820
820
 
821
821
  interface SharedAssetsApi {
822
- loadCharactersBundle(): Promise<ArrayBuffer>;
823
- loadBurgerTimeAssetsBundle(): Promise<ArrayBuffer>;
822
+ loadAssetsBundle(game: string, bundleKey: string): Promise<ArrayBuffer>;
824
823
  loadLibraryCode(libraryKey: string): Promise<string>;
825
824
  }
826
825
 
@@ -828,8 +827,7 @@ declare class RpcSharedAssetsApi implements SharedAssetsApi {
828
827
  private readonly venusApi;
829
828
  private readonly rpcClient;
830
829
  constructor(rpcClient: RpcClient, venusApi: VenusAPI);
831
- loadBurgerTimeAssetsBundle(): Promise<ArrayBuffer>;
832
- loadCharactersBundle(): Promise<ArrayBuffer>;
830
+ loadAssetsBundle(game: string, bundleKey: string, fileType?: string): Promise<ArrayBuffer>;
833
831
  loadLibraryCode(libraryKey: string): Promise<string>;
834
832
  }
835
833
  interface LoadEmbeddedAssetsRequest {
@@ -819,8 +819,7 @@ interface LoggingApi {
819
819
  }
820
820
 
821
821
  interface SharedAssetsApi {
822
- loadCharactersBundle(): Promise<ArrayBuffer>;
823
- loadBurgerTimeAssetsBundle(): Promise<ArrayBuffer>;
822
+ loadAssetsBundle(game: string, bundleKey: string): Promise<ArrayBuffer>;
824
823
  loadLibraryCode(libraryKey: string): Promise<string>;
825
824
  }
826
825
 
@@ -828,8 +827,7 @@ declare class RpcSharedAssetsApi implements SharedAssetsApi {
828
827
  private readonly venusApi;
829
828
  private readonly rpcClient;
830
829
  constructor(rpcClient: RpcClient, venusApi: VenusAPI);
831
- loadBurgerTimeAssetsBundle(): Promise<ArrayBuffer>;
832
- loadCharactersBundle(): Promise<ArrayBuffer>;
830
+ loadAssetsBundle(game: string, bundleKey: string, fileType?: string): Promise<ArrayBuffer>;
833
831
  loadLibraryCode(libraryKey: string): Promise<string>;
834
832
  }
835
833
  interface LoadEmbeddedAssetsRequest {
@@ -3423,7 +3423,7 @@ function initializeTime(venusApi, host) {
3423
3423
  }
3424
3424
 
3425
3425
  // src/version.ts
3426
- var SDK_VERSION = "3.1.2-beta.2";
3426
+ var SDK_VERSION = "3.2.0";
3427
3427
 
3428
3428
  // src/shared-assets/embeddedLibrariesManifest.ts
3429
3429
  var DEFAULT_SHARED_LIB_CDN_BASE = "https://venus-static-01293ak.web.app/libs";
@@ -3594,10 +3594,6 @@ function base64ToUtf8(base64) {
3594
3594
  return decodeURIComponent(escape(result));
3595
3595
  }
3596
3596
 
3597
- // src/shared-assets/consts.ts
3598
- var BurgerTimeAssetsCdnPath = "burger-time/Core.stow";
3599
- var CharacterAssetsCdnPath = "burger-time/Character.stow";
3600
-
3601
3597
  // src/shared-assets/RpcSharedAssetsApi.ts
3602
3598
  var RpcSharedAssetsApi = class {
3603
3599
  constructor(rpcClient, venusApi) {
@@ -3606,33 +3602,18 @@ var RpcSharedAssetsApi = class {
3606
3602
  this.rpcClient = rpcClient;
3607
3603
  this.venusApi = venusApi;
3608
3604
  }
3609
- async loadBurgerTimeAssetsBundle() {
3610
- try {
3611
- const response = await this.rpcClient.callT("H5_LOAD_EMBEDDED_ASSET" /* H5_LOAD_EMBEDDED_ASSET */, {
3612
- assetKey: "burgerTimeCoreBundle"
3613
- });
3614
- return base64ToArrayBuffer(response.base64Data);
3615
- } catch (err) {
3616
- try {
3617
- const blob = await this.venusApi.cdn.fetchBlob(BurgerTimeAssetsCdnPath);
3618
- return await blob.arrayBuffer();
3619
- } catch (e) {
3620
- throw new Error("Failed to load burgerTimeAssetsBundle");
3621
- }
3622
- }
3623
- }
3624
- async loadCharactersBundle() {
3605
+ async loadAssetsBundle(game, bundleKey, fileType = "stow") {
3625
3606
  try {
3626
3607
  const response = await this.rpcClient.callT("H5_LOAD_EMBEDDED_ASSET" /* H5_LOAD_EMBEDDED_ASSET */, {
3627
- assetKey: "characters"
3608
+ assetKey: bundleKey
3628
3609
  });
3629
3610
  return base64ToArrayBuffer(response.base64Data);
3630
3611
  } catch (err) {
3631
3612
  try {
3632
- const blob = await this.venusApi.cdn.fetchBlob(CharacterAssetsCdnPath);
3613
+ const blob = await this.venusApi.cdn.fetchBlob(`${game}/${bundleKey}.${fileType}`);
3633
3614
  return await blob.arrayBuffer();
3634
3615
  } catch (e) {
3635
- throw new Error("Failed to load charactersBundle");
3616
+ throw new Error(`Failed to load ${bundleKey}`);
3636
3617
  }
3637
3618
  }
3638
3619
  }
@@ -3670,12 +3651,8 @@ var MockSharedAssetsApi = class {
3670
3651
  __publicField(this, "venusApi");
3671
3652
  this.venusApi = venusApi;
3672
3653
  }
3673
- async loadBurgerTimeAssetsBundle() {
3674
- const blob = await this.venusApi.cdn.fetchBlob(BurgerTimeAssetsCdnPath);
3675
- return await blob.arrayBuffer();
3676
- }
3677
- async loadCharactersBundle() {
3678
- const blob = await this.venusApi.cdn.fetchBlob(CharacterAssetsCdnPath);
3654
+ async loadAssetsBundle(game, bundleKey, fileType = "stow") {
3655
+ const blob = await this.venusApi.cdn.fetchBlob(`${game}/${bundleKey}.${fileType}`);
3679
3656
  return await blob.arrayBuffer();
3680
3657
  }
3681
3658
  async loadLibraryCode(libraryKey) {
@@ -5169,5 +5146,5 @@ function initializeSocial(venusApi, host) {
5169
5146
  }
5170
5147
 
5171
5148
  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 };
5172
- //# sourceMappingURL=chunk-G5AFYBIK.mjs.map
5173
- //# sourceMappingURL=chunk-G5AFYBIK.mjs.map
5149
+ //# sourceMappingURL=chunk-AGXMORDL.mjs.map
5150
+ //# sourceMappingURL=chunk-AGXMORDL.mjs.map