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.d.cts CHANGED
@@ -173,7 +173,7 @@ declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
173
173
  declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
174
174
  declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
175
175
 
176
- declare const SDK_VERSION = "0.7.90";
176
+ declare const SDK_VERSION = "0.7.91";
177
177
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
178
178
  interface ApiConfig {
179
179
  httpClient: any;
@@ -619,9 +619,10 @@ declare function createStorefront(config: HttpClientConfig & {
619
619
  };
620
620
  };
621
621
  activity: {
622
+ track(params: Parameters<(params: TrackParams) => Promise<void>>[0]): Promise<void>;
622
623
  COMMON_ACTIVITY_TYPES: readonly ["page_view", "product_view", "service_view", "provider_view", "cart_added", "cart_removed", "checkout_started", "purchase", "booking_created", "signin", "signup", "verified_email", "search", "share", "wishlist_added"];
623
- track(params: TrackParams): Promise<void>;
624
624
  };
625
+ ready: Promise<void>;
625
626
  automation: {
626
627
  agent: {
627
628
  getAgents(params?: any, options?: RequestOptions): any;
package/dist/index.d.ts CHANGED
@@ -173,7 +173,7 @@ declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
173
173
  declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
174
174
  declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
175
175
 
176
- declare const SDK_VERSION = "0.7.90";
176
+ declare const SDK_VERSION = "0.7.91";
177
177
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
178
178
  interface ApiConfig {
179
179
  httpClient: any;
@@ -619,9 +619,10 @@ declare function createStorefront(config: HttpClientConfig & {
619
619
  };
620
620
  };
621
621
  activity: {
622
+ track(params: Parameters<(params: TrackParams) => Promise<void>>[0]): Promise<void>;
622
623
  COMMON_ACTIVITY_TYPES: readonly ["page_view", "product_view", "service_view", "provider_view", "cart_added", "cart_removed", "checkout_started", "purchase", "booking_created", "signin", "signup", "verified_email", "search", "share", "wishlist_added"];
623
- track(params: TrackParams): Promise<void>;
624
624
  };
625
+ ready: Promise<void>;
625
626
  automation: {
626
627
  agent: {
627
628
  getAgents(params?: any, options?: RequestOptions): any;
package/dist/index.js CHANGED
@@ -2686,7 +2686,7 @@ function getFirstAvailableFCId(variant, quantity = 1) {
2686
2686
  }
2687
2687
 
2688
2688
  // src/index.ts
2689
- var SDK_VERSION = "0.7.90";
2689
+ var SDK_VERSION = "0.7.91";
2690
2690
  var SUPPORTED_FRAMEWORKS = [
2691
2691
  "astro",
2692
2692
  "react",
@@ -2960,6 +2960,10 @@ function createStorefront(config) {
2960
2960
  const storefrontApi = createStorefrontApi(apiConfig);
2961
2961
  const stores = createStores();
2962
2962
  let sessionPromise = null;
2963
+ let resolveReady;
2964
+ const ready = new Promise((r) => {
2965
+ resolveReady = r;
2966
+ });
2963
2967
  function session(market2) {
2964
2968
  if (market2 !== void 0) apiConfig.market = market2;
2965
2969
  if (sessionPromise) return sessionPromise;
@@ -2976,6 +2980,7 @@ function createStorefront(config) {
2976
2980
  market: result.market || null
2977
2981
  };
2978
2982
  populateStores(stores, s);
2983
+ resolveReady();
2979
2984
  return s;
2980
2985
  } catch (err) {
2981
2986
  const status = err?.status || err?.response?.status;
@@ -2990,6 +2995,7 @@ function createStorefront(config) {
2990
2995
  market: result.market || null
2991
2996
  };
2992
2997
  populateStores(stores, s);
2998
+ resolveReady();
2993
2999
  return s;
2994
3000
  }
2995
3001
  throw err;
@@ -3003,6 +3009,13 @@ function createStorefront(config) {
3003
3009
  });
3004
3010
  return sessionPromise;
3005
3011
  }
3012
+ const activity = {
3013
+ ...storefrontApi.activity,
3014
+ async track(params) {
3015
+ await ready;
3016
+ return storefrontApi.activity.track(params);
3017
+ }
3018
+ };
3006
3019
  function setMarket(key) {
3007
3020
  sessionPromise = null;
3008
3021
  return session(key);
@@ -3015,7 +3028,8 @@ function createStorefront(config) {
3015
3028
  eshop: storefrontApi.eshop,
3016
3029
  booking: storefrontApi.booking,
3017
3030
  crm: storefrontApi.crm,
3018
- activity: storefrontApi.activity,
3031
+ activity,
3032
+ ready,
3019
3033
  automation: storefrontApi.automation,
3020
3034
  setBusinessId: (businessId) => {
3021
3035
  refresh_business_id = businessId;