arky-sdk 0.7.90 → 0.7.91

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
@@ -2688,7 +2688,7 @@ function getFirstAvailableFCId(variant, quantity = 1) {
2688
2688
  }
2689
2689
 
2690
2690
  // src/index.ts
2691
- var SDK_VERSION = "0.7.90";
2691
+ var SDK_VERSION = "0.7.91";
2692
2692
  var SUPPORTED_FRAMEWORKS = [
2693
2693
  "astro",
2694
2694
  "react",
@@ -2962,6 +2962,10 @@ function createStorefront(config) {
2962
2962
  const storefrontApi = createStorefrontApi(apiConfig);
2963
2963
  const stores = createStores();
2964
2964
  let sessionPromise = null;
2965
+ let resolveReady;
2966
+ const ready = new Promise((r) => {
2967
+ resolveReady = r;
2968
+ });
2965
2969
  function session(market2) {
2966
2970
  if (market2 !== void 0) apiConfig.market = market2;
2967
2971
  if (sessionPromise) return sessionPromise;
@@ -2978,6 +2982,7 @@ function createStorefront(config) {
2978
2982
  market: result.market || null
2979
2983
  };
2980
2984
  populateStores(stores, s);
2985
+ resolveReady();
2981
2986
  return s;
2982
2987
  } catch (err) {
2983
2988
  const status = err?.status || err?.response?.status;
@@ -2992,6 +2997,7 @@ function createStorefront(config) {
2992
2997
  market: result.market || null
2993
2998
  };
2994
2999
  populateStores(stores, s);
3000
+ resolveReady();
2995
3001
  return s;
2996
3002
  }
2997
3003
  throw err;
@@ -3005,6 +3011,13 @@ function createStorefront(config) {
3005
3011
  });
3006
3012
  return sessionPromise;
3007
3013
  }
3014
+ const activity = {
3015
+ ...storefrontApi.activity,
3016
+ async track(params) {
3017
+ await ready;
3018
+ return storefrontApi.activity.track(params);
3019
+ }
3020
+ };
3008
3021
  function setMarket(key) {
3009
3022
  sessionPromise = null;
3010
3023
  return session(key);
@@ -3017,7 +3030,8 @@ function createStorefront(config) {
3017
3030
  eshop: storefrontApi.eshop,
3018
3031
  booking: storefrontApi.booking,
3019
3032
  crm: storefrontApi.crm,
3020
- activity: storefrontApi.activity,
3033
+ activity,
3034
+ ready,
3021
3035
  automation: storefrontApi.automation,
3022
3036
  setBusinessId: (businessId) => {
3023
3037
  refresh_business_id = businessId;