@series-inc/venus-sdk 3.1.1 → 3.1.2-beta.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.
package/dist/index.cjs CHANGED
@@ -3437,11 +3437,7 @@ function initializeTime(venusApi, host) {
3437
3437
  }
3438
3438
 
3439
3439
  // src/version.ts
3440
- var SDK_VERSION = "3.1.1";
3441
-
3442
- // src/shared-assets/consts.ts
3443
- var BurgerTimeAssetsCdnPath = "burger-time/Core.stow";
3444
- var CharacterAssetsCdnPath = "burger-time/Character.stow";
3440
+ var SDK_VERSION = "3.1.2-beta.1";
3445
3441
 
3446
3442
  // src/shared-assets/embeddedLibrariesManifest.ts
3447
3443
  var DEFAULT_SHARED_LIB_CDN_BASE = "https://venus-static-01293ak.web.app/libs";
@@ -3620,33 +3616,18 @@ var RpcSharedAssetsApi = class {
3620
3616
  this.rpcClient = rpcClient;
3621
3617
  this.venusApi = venusApi;
3622
3618
  }
3623
- async loadBurgerTimeAssetsBundle() {
3624
- try {
3625
- const response = await this.rpcClient.callT("H5_LOAD_EMBEDDED_ASSET" /* H5_LOAD_EMBEDDED_ASSET */, {
3626
- assetKey: "burgerTimeCoreBundle"
3627
- });
3628
- return base64ToArrayBuffer(response.base64Data);
3629
- } catch (err) {
3630
- try {
3631
- const blob = await this.venusApi.cdn.fetchBlob(BurgerTimeAssetsCdnPath);
3632
- return await blob.arrayBuffer();
3633
- } catch (e) {
3634
- throw new Error("Failed to load burgerTimeAssetsBundle");
3635
- }
3636
- }
3637
- }
3638
- async loadCharactersBundle() {
3619
+ async loadAssetsBundle(game, bundleKey, fileType = "stow") {
3639
3620
  try {
3640
3621
  const response = await this.rpcClient.callT("H5_LOAD_EMBEDDED_ASSET" /* H5_LOAD_EMBEDDED_ASSET */, {
3641
- assetKey: "characters"
3622
+ assetKey: bundleKey
3642
3623
  });
3643
3624
  return base64ToArrayBuffer(response.base64Data);
3644
3625
  } catch (err) {
3645
3626
  try {
3646
- const blob = await this.venusApi.cdn.fetchBlob(CharacterAssetsCdnPath);
3627
+ const blob = await this.venusApi.cdn.fetchBlob(`${game}/${bundleKey}.${fileType}`);
3647
3628
  return await blob.arrayBuffer();
3648
3629
  } catch (e) {
3649
- throw new Error("Failed to load charactersBundle");
3630
+ throw new Error(`Failed to load ${bundleKey}`);
3650
3631
  }
3651
3632
  }
3652
3633
  }
@@ -3684,12 +3665,8 @@ var MockSharedAssetsApi = class {
3684
3665
  __publicField(this, "venusApi");
3685
3666
  this.venusApi = venusApi;
3686
3667
  }
3687
- async loadBurgerTimeAssetsBundle() {
3688
- const blob = await this.venusApi.cdn.fetchBlob(BurgerTimeAssetsCdnPath);
3689
- return await blob.arrayBuffer();
3690
- }
3691
- async loadCharactersBundle() {
3692
- const blob = await this.venusApi.cdn.fetchBlob(CharacterAssetsCdnPath);
3668
+ async loadAssetsBundle(game, bundleKey, fileType = "stow") {
3669
+ const blob = await this.venusApi.cdn.fetchBlob(`${game}/${bundleKey}.${fileType}`);
3693
3670
  return await blob.arrayBuffer();
3694
3671
  }
3695
3672
  async loadLibraryCode(libraryKey) {