arky-sdk 0.7.87 → 0.7.90

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
@@ -27,7 +27,7 @@ interface AuthTokens {
27
27
  interface HttpClientConfig {
28
28
  baseUrl: string;
29
29
  businessId: string;
30
- refreshPath?: string;
30
+ refreshPath?: string | (() => string);
31
31
  getToken?: () => Promise<AuthTokens> | AuthTokens;
32
32
  setToken?: (tokens: AuthTokens) => void;
33
33
  logout?: () => void;
@@ -109,7 +109,7 @@ interface Activity {
109
109
  }
110
110
  interface TimelineParams {
111
111
  customer_id: string;
112
- businessId?: string;
112
+ business_id?: string;
113
113
  limit?: number;
114
114
  cursor?: string;
115
115
  }
@@ -129,11 +129,12 @@ interface GetCountriesResponse {
129
129
  }
130
130
 
131
131
  interface StorefrontStores {
132
+ customer: ReturnType<typeof atom<any>>;
132
133
  business: ReturnType<typeof atom<any>>;
133
134
  market: ReturnType<typeof atom<any>>;
134
135
  loading: ReturnType<typeof atom<boolean>>;
135
136
  error: ReturnType<typeof atom<string | null>>;
136
- initialized: ReturnType<typeof atom<boolean>>;
137
+ isLoggedIn: ReturnType<typeof computed>;
137
138
  currency: ReturnType<typeof computed>;
138
139
  currencySymbol: ReturnType<typeof computed>;
139
140
  paymentMethods: ReturnType<typeof computed>;
@@ -172,7 +173,7 @@ declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
172
173
  declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
173
174
  declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
174
175
 
175
- declare const SDK_VERSION = "0.7.85";
176
+ declare const SDK_VERSION = "0.7.90";
176
177
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
177
178
  interface ApiConfig {
178
179
  httpClient: any;
@@ -249,7 +250,7 @@ declare function createAdmin(config: HttpClientConfig & {
249
250
  updateIntegration(params: UpdateIntegrationParams, options?: RequestOptions): Promise<any>;
250
251
  deleteIntegration(params: DeleteIntegrationParams, options?: RequestOptions): Promise<any>;
251
252
  getIntegrationConfig(params: {
252
- businessId: string;
253
+ business_id: string;
253
254
  type: "payment" | "shipping";
254
255
  }, options?: RequestOptions): Promise<any>;
255
256
  listWebhooks(params: ListWebhooksParams, options?: RequestOptions): Promise<any>;
@@ -385,12 +386,12 @@ declare function createAdmin(config: HttpClientConfig & {
385
386
  merge: (params: MergeCustomersParams, options?: RequestOptions) => Promise<Customer>;
386
387
  revokeToken: (params: {
387
388
  id: string;
388
- tokenId: string;
389
- businessId?: string;
389
+ token_id: string;
390
+ business_id?: string;
390
391
  }, options?: RequestOptions) => Promise<any>;
391
392
  revokeAllTokens: (params: {
392
393
  id: string;
393
- businessId?: string;
394
+ business_id?: string;
394
395
  }, options?: RequestOptions) => Promise<any>;
395
396
  };
396
397
  audience: {
@@ -439,7 +440,7 @@ declare function createAdmin(config: HttpClientConfig & {
439
440
  };
440
441
  analytics: {
441
442
  query: (spec: AnalyticsQuery, options?: RequestOptions & {
442
- businessId?: string;
443
+ business_id?: string;
443
444
  }) => Promise<AnalyticsQueryResponse>;
444
445
  };
445
446
  setBusinessId: (businessId: string) => void;
@@ -497,6 +498,7 @@ declare function createAdmin(config: HttpClientConfig & {
497
498
  };
498
499
  }>;
499
500
  interface StorefrontSession {
501
+ customer: any;
500
502
  business: any;
501
503
  market: any;
502
504
  }
@@ -504,13 +506,14 @@ declare function createStorefront(config: HttpClientConfig & {
504
506
  market?: string;
505
507
  locale?: string;
506
508
  }): {
507
- init: () => Promise<StorefrontSession>;
509
+ session: (market?: string) => Promise<StorefrontSession>;
508
510
  stores: {
511
+ customer: nanostores.PreinitializedWritableAtom<any> & object;
509
512
  business: nanostores.PreinitializedWritableAtom<any> & object;
510
513
  market: nanostores.PreinitializedWritableAtom<any> & object;
511
514
  loading: nanostores.PreinitializedWritableAtom<boolean> & object;
512
515
  error: nanostores.PreinitializedWritableAtom<string> & object;
513
- initialized: nanostores.PreinitializedWritableAtom<boolean> & object;
516
+ isLoggedIn: nanostores.ReadableAtom<boolean>;
514
517
  currency: nanostores.ReadableAtom<any>;
515
518
  currencySymbol: nanostores.ReadableAtom<any>;
516
519
  paymentMethods: nanostores.ReadableAtom<any>;
@@ -584,24 +587,24 @@ declare function createStorefront(config: HttpClientConfig & {
584
587
  };
585
588
  crm: {
586
589
  customer: {
587
- initialize(params?: {
588
- businessId?: string;
590
+ session(params?: {
591
+ business_id?: string;
589
592
  market?: string;
590
- }, options?: RequestOptions): any;
591
- connect(params: any, options?: RequestOptions): any;
593
+ }, options?: RequestOptions): Promise<any>;
594
+ connect(params: any, options?: RequestOptions): Promise<any>;
592
595
  requestCode(params: {
593
596
  email: string;
594
- businessId?: string;
597
+ business_id?: string;
595
598
  }, options?: RequestOptions): any;
596
599
  verify(params: {
597
600
  email: string;
598
601
  code: string;
599
- businessId?: string;
600
- }, options?: RequestOptions): any;
602
+ business_id?: string;
603
+ }, options?: RequestOptions): Promise<any>;
601
604
  refreshToken(params: {
602
605
  refresh_token: string;
603
- businessId?: string;
604
- }, options?: RequestOptions): any;
606
+ business_id?: string;
607
+ }, options?: RequestOptions): Promise<any>;
605
608
  getMe(options?: RequestOptions): any;
606
609
  };
607
610
  audience: {
@@ -624,37 +627,37 @@ declare function createStorefront(config: HttpClientConfig & {
624
627
  getAgents(params?: any, options?: RequestOptions): any;
625
628
  getAgent(params: {
626
629
  id: string;
627
- businessId?: string;
630
+ business_id?: string;
628
631
  }, options?: RequestOptions): any;
629
632
  sendMessage(params: {
630
633
  id: string;
631
634
  message: string;
632
635
  chat_id?: string;
633
- businessId?: string;
636
+ business_id?: string;
634
637
  }, options?: RequestOptions): any;
635
638
  getChat(params: {
636
639
  id: string;
637
640
  chat_id: string;
638
- businessId?: string;
641
+ business_id?: string;
639
642
  }, options?: RequestOptions): any;
640
643
  getChatMessages(params: {
641
644
  id: string;
642
645
  chat_id: string;
643
646
  limit?: number;
644
- businessId?: string;
647
+ business_id?: string;
645
648
  }, options?: RequestOptions): any;
646
649
  rateChat(params: {
647
650
  id: string;
648
651
  chat_id: string;
649
652
  rating: number;
650
653
  comment?: string;
651
- businessId?: string;
654
+ business_id?: string;
652
655
  }, options?: RequestOptions): any;
653
656
  };
654
657
  };
655
658
  setBusinessId: (businessId: string) => void;
656
659
  getBusinessId: () => string;
657
- setMarket: (key: string) => void;
660
+ setMarket: (key: string) => Promise<StorefrontSession>;
658
661
  getMarket: () => string;
659
662
  setLocale: (locale: string) => void;
660
663
  getLocale: () => string;
package/dist/index.d.ts CHANGED
@@ -27,7 +27,7 @@ interface AuthTokens {
27
27
  interface HttpClientConfig {
28
28
  baseUrl: string;
29
29
  businessId: string;
30
- refreshPath?: string;
30
+ refreshPath?: string | (() => string);
31
31
  getToken?: () => Promise<AuthTokens> | AuthTokens;
32
32
  setToken?: (tokens: AuthTokens) => void;
33
33
  logout?: () => void;
@@ -109,7 +109,7 @@ interface Activity {
109
109
  }
110
110
  interface TimelineParams {
111
111
  customer_id: string;
112
- businessId?: string;
112
+ business_id?: string;
113
113
  limit?: number;
114
114
  cursor?: string;
115
115
  }
@@ -129,11 +129,12 @@ interface GetCountriesResponse {
129
129
  }
130
130
 
131
131
  interface StorefrontStores {
132
+ customer: ReturnType<typeof atom<any>>;
132
133
  business: ReturnType<typeof atom<any>>;
133
134
  market: ReturnType<typeof atom<any>>;
134
135
  loading: ReturnType<typeof atom<boolean>>;
135
136
  error: ReturnType<typeof atom<string | null>>;
136
- initialized: ReturnType<typeof atom<boolean>>;
137
+ isLoggedIn: ReturnType<typeof computed>;
137
138
  currency: ReturnType<typeof computed>;
138
139
  currencySymbol: ReturnType<typeof computed>;
139
140
  paymentMethods: ReturnType<typeof computed>;
@@ -172,7 +173,7 @@ declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
172
173
  declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
173
174
  declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
174
175
 
175
- declare const SDK_VERSION = "0.7.85";
176
+ declare const SDK_VERSION = "0.7.90";
176
177
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
177
178
  interface ApiConfig {
178
179
  httpClient: any;
@@ -249,7 +250,7 @@ declare function createAdmin(config: HttpClientConfig & {
249
250
  updateIntegration(params: UpdateIntegrationParams, options?: RequestOptions): Promise<any>;
250
251
  deleteIntegration(params: DeleteIntegrationParams, options?: RequestOptions): Promise<any>;
251
252
  getIntegrationConfig(params: {
252
- businessId: string;
253
+ business_id: string;
253
254
  type: "payment" | "shipping";
254
255
  }, options?: RequestOptions): Promise<any>;
255
256
  listWebhooks(params: ListWebhooksParams, options?: RequestOptions): Promise<any>;
@@ -385,12 +386,12 @@ declare function createAdmin(config: HttpClientConfig & {
385
386
  merge: (params: MergeCustomersParams, options?: RequestOptions) => Promise<Customer>;
386
387
  revokeToken: (params: {
387
388
  id: string;
388
- tokenId: string;
389
- businessId?: string;
389
+ token_id: string;
390
+ business_id?: string;
390
391
  }, options?: RequestOptions) => Promise<any>;
391
392
  revokeAllTokens: (params: {
392
393
  id: string;
393
- businessId?: string;
394
+ business_id?: string;
394
395
  }, options?: RequestOptions) => Promise<any>;
395
396
  };
396
397
  audience: {
@@ -439,7 +440,7 @@ declare function createAdmin(config: HttpClientConfig & {
439
440
  };
440
441
  analytics: {
441
442
  query: (spec: AnalyticsQuery, options?: RequestOptions & {
442
- businessId?: string;
443
+ business_id?: string;
443
444
  }) => Promise<AnalyticsQueryResponse>;
444
445
  };
445
446
  setBusinessId: (businessId: string) => void;
@@ -497,6 +498,7 @@ declare function createAdmin(config: HttpClientConfig & {
497
498
  };
498
499
  }>;
499
500
  interface StorefrontSession {
501
+ customer: any;
500
502
  business: any;
501
503
  market: any;
502
504
  }
@@ -504,13 +506,14 @@ declare function createStorefront(config: HttpClientConfig & {
504
506
  market?: string;
505
507
  locale?: string;
506
508
  }): {
507
- init: () => Promise<StorefrontSession>;
509
+ session: (market?: string) => Promise<StorefrontSession>;
508
510
  stores: {
511
+ customer: nanostores.PreinitializedWritableAtom<any> & object;
509
512
  business: nanostores.PreinitializedWritableAtom<any> & object;
510
513
  market: nanostores.PreinitializedWritableAtom<any> & object;
511
514
  loading: nanostores.PreinitializedWritableAtom<boolean> & object;
512
515
  error: nanostores.PreinitializedWritableAtom<string> & object;
513
- initialized: nanostores.PreinitializedWritableAtom<boolean> & object;
516
+ isLoggedIn: nanostores.ReadableAtom<boolean>;
514
517
  currency: nanostores.ReadableAtom<any>;
515
518
  currencySymbol: nanostores.ReadableAtom<any>;
516
519
  paymentMethods: nanostores.ReadableAtom<any>;
@@ -584,24 +587,24 @@ declare function createStorefront(config: HttpClientConfig & {
584
587
  };
585
588
  crm: {
586
589
  customer: {
587
- initialize(params?: {
588
- businessId?: string;
590
+ session(params?: {
591
+ business_id?: string;
589
592
  market?: string;
590
- }, options?: RequestOptions): any;
591
- connect(params: any, options?: RequestOptions): any;
593
+ }, options?: RequestOptions): Promise<any>;
594
+ connect(params: any, options?: RequestOptions): Promise<any>;
592
595
  requestCode(params: {
593
596
  email: string;
594
- businessId?: string;
597
+ business_id?: string;
595
598
  }, options?: RequestOptions): any;
596
599
  verify(params: {
597
600
  email: string;
598
601
  code: string;
599
- businessId?: string;
600
- }, options?: RequestOptions): any;
602
+ business_id?: string;
603
+ }, options?: RequestOptions): Promise<any>;
601
604
  refreshToken(params: {
602
605
  refresh_token: string;
603
- businessId?: string;
604
- }, options?: RequestOptions): any;
606
+ business_id?: string;
607
+ }, options?: RequestOptions): Promise<any>;
605
608
  getMe(options?: RequestOptions): any;
606
609
  };
607
610
  audience: {
@@ -624,37 +627,37 @@ declare function createStorefront(config: HttpClientConfig & {
624
627
  getAgents(params?: any, options?: RequestOptions): any;
625
628
  getAgent(params: {
626
629
  id: string;
627
- businessId?: string;
630
+ business_id?: string;
628
631
  }, options?: RequestOptions): any;
629
632
  sendMessage(params: {
630
633
  id: string;
631
634
  message: string;
632
635
  chat_id?: string;
633
- businessId?: string;
636
+ business_id?: string;
634
637
  }, options?: RequestOptions): any;
635
638
  getChat(params: {
636
639
  id: string;
637
640
  chat_id: string;
638
- businessId?: string;
641
+ business_id?: string;
639
642
  }, options?: RequestOptions): any;
640
643
  getChatMessages(params: {
641
644
  id: string;
642
645
  chat_id: string;
643
646
  limit?: number;
644
- businessId?: string;
647
+ business_id?: string;
645
648
  }, options?: RequestOptions): any;
646
649
  rateChat(params: {
647
650
  id: string;
648
651
  chat_id: string;
649
652
  rating: number;
650
653
  comment?: string;
651
- businessId?: string;
654
+ business_id?: string;
652
655
  }, options?: RequestOptions): any;
653
656
  };
654
657
  };
655
658
  setBusinessId: (businessId: string) => void;
656
659
  getBusinessId: () => string;
657
- setMarket: (key: string) => void;
660
+ setMarket: (key: string) => Promise<StorefrontSession>;
658
661
  getMarket: () => string;
659
662
  setLocale: (locale: string) => void;
660
663
  getLocale: () => string;