arky-sdk 0.7.80 → 0.7.85

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
@@ -1,13 +1,15 @@
1
+ import * as nanostores from 'nanostores';
2
+ import { atom, computed } from 'nanostores';
1
3
  import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, GetMeParams, SearchAccountsParams, Location, CreateLocationParams, UpdateLocationParams, DeleteLocationParams, Market, CreateMarketParams, UpdateMarketParams, DeleteMarketParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetSubscriptionPlansParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, RemoveMemberParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, OAuthConnectParams, OAuthDisconnectParams, ListIntegrationsParams, CreateIntegrationParams, UpdateIntegrationParams, DeleteIntegrationParams, ListWebhooksParams, CreateWebhookParams, UpdateWebhookParams, DeleteWebhookParams, GetMediaParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, TriggerNotificationParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetShippingRatesParams, ShippingRate, ShipParams, ShipResult, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, CreateFormParams, UpdateFormParams, DeleteFormParams, GetFormParams, GetFormsParams, SubmitFormParams, GetFormSubmissionsParams, GetFormSubmissionParams, UpdateFormSubmissionParams, CreateTaxonomyParams, UpdateTaxonomyParams, DeleteTaxonomyParams, GetTaxonomyParams, GetTaxonomiesParams, GetTaxonomyChildrenParams, CreateEmailTemplateParams, UpdateEmailTemplateParams, DeleteEmailTemplateParams, GetEmailTemplateParams, GetEmailTemplatesParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, ProcessOrderRefundParams, Slot, CreateBookingParams, UpdateBookingParams, GetBookingParams, SearchBookingsParams, GetBookingQuoteParams, ProcessBookingRefundParams, GetAvailabilityParams, AvailabilityResponse, CancelBookingItemParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, FindServiceProvidersParams, CreateServiceProviderParams, UpdateServiceProviderParams, DeleteServiceProviderParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, CreateCustomerParams, Customer, GetCustomerParams, FindCustomersParams, UpdateCustomerParams, MergeCustomersParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, GetAudienceSubscribersParams, AddAudienceSubscriberParams, RemoveAudienceSubscriberParams, CreateAgentParams, UpdateAgentParams, DeleteAgentParams, GetAgentParams, GetAgentsParams, RunAgentParams, GetAgentChatsParams, GetAgentChatParams, UpdateAgentChatParams, RateAgentChatParams, GetBusinessChatsParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, GetWorkflowExecutionsParams, GetWorkflowExecutionParams } from './types.cjs';
2
4
  export { Access, Address, AgentChatStatus, AgentStatus, ApiResponse, Audience, AudienceAccessResponse, AudienceStatus, AudienceSubscribeResponse, AudienceSubscriber, AudienceSubscription, AudienceSubscriptionPayment, AudienceSubscriptionProvider, AudienceSubscriptionSource, AudienceSubscriptionStatus, AvailabilitySlot, Block, BookingCartItem, BookingPayment, BookingPaymentPromoCode, BookingPaymentProvider, BookingPaymentRefund, BookingPaymentTax, BookingPaymentTaxLine, BookingProviderStatus, BookingQuote, BookingServiceStatus, BookingStoreState, Business, BusinessSubscription, BusinessSubscriptionPayment, BusinessSubscriptionProvider, BusinessSubscriptionSource, BusinessSubscriptionStatus, CustomerStatus, CustomsDeclaration, CustomsItem, DaySlots, EmailTemplateStatus, EshopCartItem, EshopStoreState, Event, EventAction, ExecutionStatus, FormStatus, GeoLocation, GeoLocationBlock, Integration, IntegrationProvider, Language, Media, MediaResolution, Node, NodeResult, NodeStatus, OrderPayment, OrderPaymentPromoCode, OrderPaymentProvider, OrderPaymentRefund, OrderPaymentTax, OrderPaymentTaxLine, OrderQuote, OrderShipping, PaginatedResponse, Parcel, PaymentMethod, PaymentMethodType, Price, ProductStatus, PromoCodeStatus, PromoCodeValidation, ProviderAvailability, ProviderWithTimeline, PurchaseLabelResult, Shipment, ShipmentLine, ShippingAddress, ShippingMethod, ShippingStatus, ShippingWeightTier, SystemTemplateKey, TaxonomyStatus, Webhook, WebhookEventSubscription, Workflow, WorkflowEdge, WorkflowExecution, WorkflowHttpMethod, WorkflowHttpNode, WorkflowNode, WorkflowStatus, WorkflowSwitchNode, WorkflowTransformNode, WorkflowTriggerNode, Zone, ZoneLocation } from './types.cjs';
3
5
  import { f as formatPayment, a as formatMinor, g as getCurrencySymbol, b as getCurrencyName, i as isValidKey, v as validateKey, t as toKey, n as nameToKey, c as getAvailableStock, d as getReservedStock, h as hasStock, e as getInventoryAt, j as getFirstAvailableFCId } from './index-BCAQZOwm.cjs';
4
6
 
5
7
  interface Activity$1 {
6
- businessId: string;
7
- customerId: string;
8
+ business_id: string;
9
+ customer_id: string;
8
10
  type: string;
9
11
  payload: Record<string, any>;
10
- createdAt: number;
12
+ created_at: number;
11
13
  }
12
14
  interface TrackParams {
13
15
  type: string;
@@ -17,10 +19,10 @@ declare const COMMON_ACTIVITY_TYPES: readonly ["page_view", "product_view", "ser
17
19
  type CommonActivityType = (typeof COMMON_ACTIVITY_TYPES)[number];
18
20
 
19
21
  interface AuthTokens {
20
- accessToken: string;
21
- refreshToken?: string;
22
- accessExpiresAt?: number;
23
- accountId?: string;
22
+ access_token: string;
23
+ refresh_token?: string;
24
+ access_expires_at?: number;
25
+ account_id?: string;
24
26
  }
25
27
  interface HttpClientConfig {
26
28
  baseUrl: string;
@@ -34,23 +36,23 @@ interface HttpClientConfig {
34
36
  isAuthenticated?: () => boolean;
35
37
  }
36
38
 
37
- type EntityKind = "product" | "service" | "provider" | "node" | "customer" | "audience" | "agent" | "workflow" | "promoCode" | "emailTemplate" | "form" | "taxonomy" | "media" | "order" | "booking";
39
+ type EntityKind = "product" | "service" | "provider" | "node" | "customer" | "audience" | "agent" | "workflow" | "promo_code" | "email_template" | "form" | "taxonomy" | "media" | "order" | "booking";
38
40
  type Granularity = "hour" | "day" | "week" | "month" | {
39
41
  minutes: 5 | 10 | 15 | 30;
40
42
  };
41
- type Measure = "count" | "uniqCustomers" | "ordersCreated" | "bookingsCreated" | "newCustomers" | "formSubmissions" | {
42
- entityState: {
43
+ type Measure = "count" | "uniq_customers" | "orders_created" | "bookings_created" | "new_customers" | "form_submissions" | {
44
+ entity_state: {
43
45
  entity: EntityKind;
44
46
  status: string;
45
47
  };
46
48
  };
47
- type Dimension = "countryCode" | "city" | "deviceType" | "browser" | "os" | "language" | "activityType" | "entity" | "entityStatus" | {
48
- timeBucket: {
49
+ type Dimension = "country_code" | "city" | "device_type" | "browser" | "os" | "language" | "activity_type" | "entity" | "entity_status" | {
50
+ time_bucket: {
49
51
  granularity: Granularity;
50
52
  };
51
53
  };
52
- type FilterField = "type" | "countryCode" | "deviceType" | "browser" | "os" | "language" | "entity" | "action" | "customerId";
53
- type FilterOp = "eq" | "neq" | "in" | "notIn" | "contains";
54
+ type FilterField = "type" | "country_code" | "device_type" | "browser" | "os" | "language" | "entity" | "action" | "customer_id";
55
+ type FilterOp = "eq" | "neq" | "in" | "not_in" | "contains";
54
56
  interface Filter {
55
57
  field: FilterField;
56
58
  op: FilterOp;
@@ -73,9 +75,9 @@ interface AnalyticsQuery {
73
75
  measures: Measure[];
74
76
  dimensions?: Dimension[];
75
77
  filters?: Filter[];
76
- timeRange: TimeRange;
78
+ time_range: TimeRange;
77
79
  granularity?: Granularity;
78
- orderBy?: OrderBy[];
80
+ order_by?: OrderBy[];
79
81
  limit?: number;
80
82
  }
81
83
  interface AnalyticsRow {
@@ -84,29 +86,29 @@ interface AnalyticsRow {
84
86
  interface AnalyticsQueryResponse {
85
87
  rows: AnalyticsRow[];
86
88
  meta: {
87
- rowCount: number;
88
- executionMs: number;
89
+ row_count: number;
90
+ execution_ms: number;
89
91
  };
90
92
  }
91
93
 
92
94
  interface Activity {
93
- businessId: string;
94
- customerId: string;
95
+ business_id: string;
96
+ customer_id: string;
95
97
  type: string;
96
98
  payload: Record<string, any>;
97
- createdAt: number;
98
- countryCode?: string | null;
99
+ created_at: number;
100
+ country_code?: string | null;
99
101
  city?: string | null;
100
102
  region?: string | null;
101
103
  timezone?: string | null;
102
- deviceType?: string | null;
104
+ device_type?: string | null;
103
105
  browser?: string | null;
104
106
  os?: string | null;
105
107
  language?: string | null;
106
- sessionIdx?: number | null;
108
+ session_idx?: number | null;
107
109
  }
108
110
  interface TimelineParams {
109
- customerId: string;
111
+ customer_id: string;
110
112
  businessId?: string;
111
113
  limit?: number;
112
114
  cursor?: string;
@@ -126,6 +128,20 @@ interface GetCountriesResponse {
126
128
  cursor: string | null;
127
129
  }
128
130
 
131
+ interface StorefrontStores {
132
+ business: ReturnType<typeof atom<any>>;
133
+ market: ReturnType<typeof atom<any>>;
134
+ loading: ReturnType<typeof atom<boolean>>;
135
+ error: ReturnType<typeof atom<string | null>>;
136
+ initialized: ReturnType<typeof atom<boolean>>;
137
+ currency: ReturnType<typeof computed>;
138
+ currencySymbol: ReturnType<typeof computed>;
139
+ paymentMethods: ReturnType<typeof computed>;
140
+ paymentMethodObjects: ReturnType<typeof computed>;
141
+ paymentConfig: ReturnType<typeof computed>;
142
+ zones: ReturnType<typeof computed>;
143
+ }
144
+
129
145
  declare function getBlockLabel(block: any): string;
130
146
  declare function formatBlockValue(block: any): string;
131
147
  declare function prepareBlocksForSubmission(formData: any, blockTypes?: Record<string, string>): any[];
@@ -156,15 +172,7 @@ declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
156
172
  declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
157
173
  declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
158
174
 
159
- declare global {
160
- interface Window {
161
- dataLayer: any[];
162
- gtag: (...args: any[]) => void;
163
- }
164
- }
165
- declare function track(eventName: string, params?: Record<string, any>): void;
166
-
167
- declare const SDK_VERSION = "0.7.80";
175
+ declare const SDK_VERSION = "0.7.85";
168
176
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
169
177
  interface ApiConfig {
170
178
  httpClient: any;
@@ -186,7 +194,7 @@ declare function createAdmin(config: HttpClientConfig & {
186
194
  }, options?: RequestOptions): Promise<any>;
187
195
  verify(params: MagicLinkVerifyParams, options?: RequestOptions): Promise<any>;
188
196
  refresh(params: {
189
- refreshToken: string;
197
+ refresh_token: string;
190
198
  }, options?: RequestOptions): Promise<any>;
191
199
  businessCode(businessId: string, params: {
192
200
  email: string;
@@ -242,7 +250,7 @@ declare function createAdmin(config: HttpClientConfig & {
242
250
  deleteIntegration(params: DeleteIntegrationParams, options?: RequestOptions): Promise<any>;
243
251
  getIntegrationConfig(params: {
244
252
  businessId: string;
245
- type: "payment" | "shipping" | "analytics";
253
+ type: "payment" | "shipping";
246
254
  }, options?: RequestOptions): Promise<any>;
247
255
  listWebhooks(params: ListWebhooksParams, options?: RequestOptions): Promise<any>;
248
256
  createWebhook(params: CreateWebhookParams, options?: RequestOptions): Promise<any>;
@@ -430,7 +438,6 @@ declare function createAdmin(config: HttpClientConfig & {
430
438
  };
431
439
  };
432
440
  analytics: {
433
- track: typeof track;
434
441
  query: (spec: AnalyticsQuery, options?: RequestOptions & {
435
442
  businessId?: string;
436
443
  }) => Promise<AnalyticsQueryResponse>;
@@ -482,7 +489,6 @@ declare function createAdmin(config: HttpClientConfig & {
482
489
  validateKey: typeof validateKey;
483
490
  toKey: typeof toKey;
484
491
  nameToKey: typeof nameToKey;
485
- track: typeof track;
486
492
  getAvailableStock: typeof getAvailableStock;
487
493
  getReservedStock: typeof getReservedStock;
488
494
  hasStock: typeof hasStock;
@@ -490,16 +496,33 @@ declare function createAdmin(config: HttpClientConfig & {
490
496
  getFirstAvailableFCId: typeof getFirstAvailableFCId;
491
497
  };
492
498
  }>;
499
+ interface StorefrontSession {
500
+ business: any;
501
+ market: any;
502
+ }
493
503
  declare function createStorefront(config: HttpClientConfig & {
494
- market: string;
504
+ market?: string;
495
505
  locale?: string;
496
- }): Promise<{
506
+ }): {
507
+ init: () => Promise<StorefrontSession>;
508
+ stores: {
509
+ business: nanostores.PreinitializedWritableAtom<any> & object;
510
+ market: nanostores.PreinitializedWritableAtom<any> & object;
511
+ loading: nanostores.PreinitializedWritableAtom<boolean> & object;
512
+ error: nanostores.PreinitializedWritableAtom<string> & object;
513
+ initialized: nanostores.PreinitializedWritableAtom<boolean> & object;
514
+ currency: nanostores.ReadableAtom<any>;
515
+ currencySymbol: nanostores.ReadableAtom<any>;
516
+ paymentMethods: nanostores.ReadableAtom<any>;
517
+ paymentMethodObjects: nanostores.ReadableAtom<any>;
518
+ paymentConfig: nanostores.ReadableAtom<{
519
+ provider: any;
520
+ enabled: boolean;
521
+ }>;
522
+ zones: nanostores.ReadableAtom<any>;
523
+ };
497
524
  business: {
498
525
  getBusiness(options?: RequestOptions): any;
499
- getIntegrationConfig(params: {
500
- businessId?: string;
501
- type: "payment" | "shipping" | "analytics";
502
- }, options?: RequestOptions): any;
503
526
  location: {
504
527
  getCountries(options?: RequestOptions): any;
505
528
  getCountry(countryCode: string, options?: RequestOptions): any;
@@ -563,9 +586,7 @@ declare function createStorefront(config: HttpClientConfig & {
563
586
  customer: {
564
587
  initialize(params?: {
565
588
  businessId?: string;
566
- }, options?: RequestOptions): any;
567
- signInAnonymously(params?: {
568
- businessId?: string;
589
+ market?: string;
569
590
  }, options?: RequestOptions): any;
570
591
  connect(params: any, options?: RequestOptions): any;
571
592
  requestCode(params: {
@@ -578,7 +599,7 @@ declare function createStorefront(config: HttpClientConfig & {
578
599
  businessId?: string;
579
600
  }, options?: RequestOptions): any;
580
601
  refreshToken(params: {
581
- refreshToken: string;
602
+ refresh_token: string;
582
603
  businessId?: string;
583
604
  }, options?: RequestOptions): any;
584
605
  getMe(options?: RequestOptions): any;
@@ -608,35 +629,32 @@ declare function createStorefront(config: HttpClientConfig & {
608
629
  sendMessage(params: {
609
630
  id: string;
610
631
  message: string;
611
- chatId?: string;
632
+ chat_id?: string;
612
633
  businessId?: string;
613
634
  }, options?: RequestOptions): any;
614
635
  getChat(params: {
615
636
  id: string;
616
- chatId: string;
637
+ chat_id: string;
617
638
  businessId?: string;
618
639
  }, options?: RequestOptions): any;
619
640
  getChatMessages(params: {
620
641
  id: string;
621
- chatId: string;
642
+ chat_id: string;
622
643
  limit?: number;
623
644
  businessId?: string;
624
645
  }, options?: RequestOptions): any;
625
646
  rateChat(params: {
626
647
  id: string;
627
- chatId: string;
648
+ chat_id: string;
628
649
  rating: number;
629
650
  comment?: string;
630
651
  businessId?: string;
631
652
  }, options?: RequestOptions): any;
632
653
  };
633
654
  };
634
- analytics: {
635
- track: typeof track;
636
- };
637
655
  setBusinessId: (businessId: string) => void;
638
656
  getBusinessId: () => string;
639
- setMarket: (market: string) => void;
657
+ setMarket: (key: string) => void;
640
658
  getMarket: () => string;
641
659
  setLocale: (locale: string) => void;
642
660
  getLocale: () => string;
@@ -681,13 +699,12 @@ declare function createStorefront(config: HttpClientConfig & {
681
699
  validateKey: typeof validateKey;
682
700
  toKey: typeof toKey;
683
701
  nameToKey: typeof nameToKey;
684
- track: typeof track;
685
702
  getAvailableStock: typeof getAvailableStock;
686
703
  getReservedStock: typeof getReservedStock;
687
704
  hasStock: typeof hasStock;
688
705
  getInventoryAt: typeof getInventoryAt;
689
706
  getFirstAvailableFCId: typeof getFirstAvailableFCId;
690
707
  };
691
- }>;
708
+ };
692
709
 
693
- export { type Activity$1 as Activity, type AnalyticsQuery, type AnalyticsQueryResponse, type AnalyticsRow, type ApiConfig, AvailabilityResponse, COMMON_ACTIVITY_TYPES, type CommonActivityType, CreateAgentParams, CreateLocationParams, DeleteLocationParams, type Dimension, type EntityKind, type Filter, type FilterField, type FilterOp, GetAgentParams, GetAgentsParams, GetAvailabilityParams, type GetCountriesResponse, GetShippingRatesParams, type Granularity, type HttpClientConfig, Location, type LocationCountry, type LocationState, Market, type Measure, type OrderBy, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShipParams, ShipResult, ShippingRate, Slot, type TimeRange, type TimeUnit, type TimelineParams, type TrackParams, UpdateAgentParams, UpdateLocationParams, createAdmin, createStorefront };
710
+ export { type Activity$1 as Activity, type AnalyticsQuery, type AnalyticsQueryResponse, type AnalyticsRow, type ApiConfig, AvailabilityResponse, COMMON_ACTIVITY_TYPES, type CommonActivityType, CreateAgentParams, CreateLocationParams, DeleteLocationParams, type Dimension, type EntityKind, type Filter, type FilterField, type FilterOp, GetAgentParams, GetAgentsParams, GetAvailabilityParams, type GetCountriesResponse, GetShippingRatesParams, type Granularity, type HttpClientConfig, Location, type LocationCountry, type LocationState, Market, type Measure, type OrderBy, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShipParams, ShipResult, ShippingRate, Slot, type StorefrontSession, type StorefrontStores, type TimeRange, type TimeUnit, type TimelineParams, type TrackParams, UpdateAgentParams, UpdateLocationParams, createAdmin, createStorefront };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,15 @@
1
+ import * as nanostores from 'nanostores';
2
+ import { atom, computed } from 'nanostores';
1
3
  import { RequestOptions, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, DeleteAccountParams, GetMeParams, SearchAccountsParams, Location, CreateLocationParams, UpdateLocationParams, DeleteLocationParams, Market, CreateMarketParams, UpdateMarketParams, DeleteMarketParams, CreateBusinessParams, UpdateBusinessParams, DeleteBusinessParams, GetBusinessParams, GetBusinessesParams, GetSubscriptionPlansParams, SubscribeParams, CreatePortalSessionParams, InviteUserParams, RemoveMemberParams, HandleInvitationParams, TestWebhookParams, GetBusinessMediaParams2, OAuthConnectParams, OAuthDisconnectParams, ListIntegrationsParams, CreateIntegrationParams, UpdateIntegrationParams, DeleteIntegrationParams, ListWebhooksParams, CreateWebhookParams, UpdateWebhookParams, DeleteWebhookParams, GetMediaParams, UploadBusinessMediaParams, DeleteBusinessMediaParams, GetBusinessMediaParams, UpdateMediaParams, TrackEmailOpenParams, TriggerNotificationParams, CreatePromoCodeParams, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetShippingRatesParams, ShippingRate, ShipParams, ShipResult, CreateNodeParams, UpdateNodeParams, DeleteNodeParams, GetNodeParams, GetNodesParams, GetNodeChildrenParams, CreateFormParams, UpdateFormParams, DeleteFormParams, GetFormParams, GetFormsParams, SubmitFormParams, GetFormSubmissionsParams, GetFormSubmissionParams, UpdateFormSubmissionParams, CreateTaxonomyParams, UpdateTaxonomyParams, DeleteTaxonomyParams, GetTaxonomyParams, GetTaxonomiesParams, GetTaxonomyChildrenParams, CreateEmailTemplateParams, UpdateEmailTemplateParams, DeleteEmailTemplateParams, GetEmailTemplateParams, GetEmailTemplatesParams, CreateProductParams, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, CreateOrderParams, UpdateOrderParams, GetOrderParams, GetOrdersParams, GetQuoteParams, ProcessOrderRefundParams, Slot, CreateBookingParams, UpdateBookingParams, GetBookingParams, SearchBookingsParams, GetBookingQuoteParams, ProcessBookingRefundParams, GetAvailabilityParams, AvailabilityResponse, CancelBookingItemParams, CreateServiceParams, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, FindServiceProvidersParams, CreateServiceProviderParams, UpdateServiceProviderParams, DeleteServiceProviderParams, CreateProviderParams, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, CreateCustomerParams, Customer, GetCustomerParams, FindCustomersParams, UpdateCustomerParams, MergeCustomersParams, CreateAudienceParams, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, GetAudienceSubscribersParams, AddAudienceSubscriberParams, RemoveAudienceSubscriberParams, CreateAgentParams, UpdateAgentParams, DeleteAgentParams, GetAgentParams, GetAgentsParams, RunAgentParams, GetAgentChatsParams, GetAgentChatParams, UpdateAgentChatParams, RateAgentChatParams, GetBusinessChatsParams, CreateWorkflowParams, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, GetWorkflowExecutionsParams, GetWorkflowExecutionParams } from './types.js';
2
4
  export { Access, Address, AgentChatStatus, AgentStatus, ApiResponse, Audience, AudienceAccessResponse, AudienceStatus, AudienceSubscribeResponse, AudienceSubscriber, AudienceSubscription, AudienceSubscriptionPayment, AudienceSubscriptionProvider, AudienceSubscriptionSource, AudienceSubscriptionStatus, AvailabilitySlot, Block, BookingCartItem, BookingPayment, BookingPaymentPromoCode, BookingPaymentProvider, BookingPaymentRefund, BookingPaymentTax, BookingPaymentTaxLine, BookingProviderStatus, BookingQuote, BookingServiceStatus, BookingStoreState, Business, BusinessSubscription, BusinessSubscriptionPayment, BusinessSubscriptionProvider, BusinessSubscriptionSource, BusinessSubscriptionStatus, CustomerStatus, CustomsDeclaration, CustomsItem, DaySlots, EmailTemplateStatus, EshopCartItem, EshopStoreState, Event, EventAction, ExecutionStatus, FormStatus, GeoLocation, GeoLocationBlock, Integration, IntegrationProvider, Language, Media, MediaResolution, Node, NodeResult, NodeStatus, OrderPayment, OrderPaymentPromoCode, OrderPaymentProvider, OrderPaymentRefund, OrderPaymentTax, OrderPaymentTaxLine, OrderQuote, OrderShipping, PaginatedResponse, Parcel, PaymentMethod, PaymentMethodType, Price, ProductStatus, PromoCodeStatus, PromoCodeValidation, ProviderAvailability, ProviderWithTimeline, PurchaseLabelResult, Shipment, ShipmentLine, ShippingAddress, ShippingMethod, ShippingStatus, ShippingWeightTier, SystemTemplateKey, TaxonomyStatus, Webhook, WebhookEventSubscription, Workflow, WorkflowEdge, WorkflowExecution, WorkflowHttpMethod, WorkflowHttpNode, WorkflowNode, WorkflowStatus, WorkflowSwitchNode, WorkflowTransformNode, WorkflowTriggerNode, Zone, ZoneLocation } from './types.js';
3
5
  import { f as formatPayment, a as formatMinor, g as getCurrencySymbol, b as getCurrencyName, i as isValidKey, v as validateKey, t as toKey, n as nameToKey, c as getAvailableStock, d as getReservedStock, h as hasStock, e as getInventoryAt, j as getFirstAvailableFCId } from './index-DTg5d847.js';
4
6
 
5
7
  interface Activity$1 {
6
- businessId: string;
7
- customerId: string;
8
+ business_id: string;
9
+ customer_id: string;
8
10
  type: string;
9
11
  payload: Record<string, any>;
10
- createdAt: number;
12
+ created_at: number;
11
13
  }
12
14
  interface TrackParams {
13
15
  type: string;
@@ -17,10 +19,10 @@ declare const COMMON_ACTIVITY_TYPES: readonly ["page_view", "product_view", "ser
17
19
  type CommonActivityType = (typeof COMMON_ACTIVITY_TYPES)[number];
18
20
 
19
21
  interface AuthTokens {
20
- accessToken: string;
21
- refreshToken?: string;
22
- accessExpiresAt?: number;
23
- accountId?: string;
22
+ access_token: string;
23
+ refresh_token?: string;
24
+ access_expires_at?: number;
25
+ account_id?: string;
24
26
  }
25
27
  interface HttpClientConfig {
26
28
  baseUrl: string;
@@ -34,23 +36,23 @@ interface HttpClientConfig {
34
36
  isAuthenticated?: () => boolean;
35
37
  }
36
38
 
37
- type EntityKind = "product" | "service" | "provider" | "node" | "customer" | "audience" | "agent" | "workflow" | "promoCode" | "emailTemplate" | "form" | "taxonomy" | "media" | "order" | "booking";
39
+ type EntityKind = "product" | "service" | "provider" | "node" | "customer" | "audience" | "agent" | "workflow" | "promo_code" | "email_template" | "form" | "taxonomy" | "media" | "order" | "booking";
38
40
  type Granularity = "hour" | "day" | "week" | "month" | {
39
41
  minutes: 5 | 10 | 15 | 30;
40
42
  };
41
- type Measure = "count" | "uniqCustomers" | "ordersCreated" | "bookingsCreated" | "newCustomers" | "formSubmissions" | {
42
- entityState: {
43
+ type Measure = "count" | "uniq_customers" | "orders_created" | "bookings_created" | "new_customers" | "form_submissions" | {
44
+ entity_state: {
43
45
  entity: EntityKind;
44
46
  status: string;
45
47
  };
46
48
  };
47
- type Dimension = "countryCode" | "city" | "deviceType" | "browser" | "os" | "language" | "activityType" | "entity" | "entityStatus" | {
48
- timeBucket: {
49
+ type Dimension = "country_code" | "city" | "device_type" | "browser" | "os" | "language" | "activity_type" | "entity" | "entity_status" | {
50
+ time_bucket: {
49
51
  granularity: Granularity;
50
52
  };
51
53
  };
52
- type FilterField = "type" | "countryCode" | "deviceType" | "browser" | "os" | "language" | "entity" | "action" | "customerId";
53
- type FilterOp = "eq" | "neq" | "in" | "notIn" | "contains";
54
+ type FilterField = "type" | "country_code" | "device_type" | "browser" | "os" | "language" | "entity" | "action" | "customer_id";
55
+ type FilterOp = "eq" | "neq" | "in" | "not_in" | "contains";
54
56
  interface Filter {
55
57
  field: FilterField;
56
58
  op: FilterOp;
@@ -73,9 +75,9 @@ interface AnalyticsQuery {
73
75
  measures: Measure[];
74
76
  dimensions?: Dimension[];
75
77
  filters?: Filter[];
76
- timeRange: TimeRange;
78
+ time_range: TimeRange;
77
79
  granularity?: Granularity;
78
- orderBy?: OrderBy[];
80
+ order_by?: OrderBy[];
79
81
  limit?: number;
80
82
  }
81
83
  interface AnalyticsRow {
@@ -84,29 +86,29 @@ interface AnalyticsRow {
84
86
  interface AnalyticsQueryResponse {
85
87
  rows: AnalyticsRow[];
86
88
  meta: {
87
- rowCount: number;
88
- executionMs: number;
89
+ row_count: number;
90
+ execution_ms: number;
89
91
  };
90
92
  }
91
93
 
92
94
  interface Activity {
93
- businessId: string;
94
- customerId: string;
95
+ business_id: string;
96
+ customer_id: string;
95
97
  type: string;
96
98
  payload: Record<string, any>;
97
- createdAt: number;
98
- countryCode?: string | null;
99
+ created_at: number;
100
+ country_code?: string | null;
99
101
  city?: string | null;
100
102
  region?: string | null;
101
103
  timezone?: string | null;
102
- deviceType?: string | null;
104
+ device_type?: string | null;
103
105
  browser?: string | null;
104
106
  os?: string | null;
105
107
  language?: string | null;
106
- sessionIdx?: number | null;
108
+ session_idx?: number | null;
107
109
  }
108
110
  interface TimelineParams {
109
- customerId: string;
111
+ customer_id: string;
110
112
  businessId?: string;
111
113
  limit?: number;
112
114
  cursor?: string;
@@ -126,6 +128,20 @@ interface GetCountriesResponse {
126
128
  cursor: string | null;
127
129
  }
128
130
 
131
+ interface StorefrontStores {
132
+ business: ReturnType<typeof atom<any>>;
133
+ market: ReturnType<typeof atom<any>>;
134
+ loading: ReturnType<typeof atom<boolean>>;
135
+ error: ReturnType<typeof atom<string | null>>;
136
+ initialized: ReturnType<typeof atom<boolean>>;
137
+ currency: ReturnType<typeof computed>;
138
+ currencySymbol: ReturnType<typeof computed>;
139
+ paymentMethods: ReturnType<typeof computed>;
140
+ paymentMethodObjects: ReturnType<typeof computed>;
141
+ paymentConfig: ReturnType<typeof computed>;
142
+ zones: ReturnType<typeof computed>;
143
+ }
144
+
129
145
  declare function getBlockLabel(block: any): string;
130
146
  declare function formatBlockValue(block: any): string;
131
147
  declare function prepareBlocksForSubmission(formData: any, blockTypes?: Record<string, string>): any[];
@@ -156,15 +172,7 @@ declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
156
172
  declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
157
173
  declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
158
174
 
159
- declare global {
160
- interface Window {
161
- dataLayer: any[];
162
- gtag: (...args: any[]) => void;
163
- }
164
- }
165
- declare function track(eventName: string, params?: Record<string, any>): void;
166
-
167
- declare const SDK_VERSION = "0.7.80";
175
+ declare const SDK_VERSION = "0.7.85";
168
176
  declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
169
177
  interface ApiConfig {
170
178
  httpClient: any;
@@ -186,7 +194,7 @@ declare function createAdmin(config: HttpClientConfig & {
186
194
  }, options?: RequestOptions): Promise<any>;
187
195
  verify(params: MagicLinkVerifyParams, options?: RequestOptions): Promise<any>;
188
196
  refresh(params: {
189
- refreshToken: string;
197
+ refresh_token: string;
190
198
  }, options?: RequestOptions): Promise<any>;
191
199
  businessCode(businessId: string, params: {
192
200
  email: string;
@@ -242,7 +250,7 @@ declare function createAdmin(config: HttpClientConfig & {
242
250
  deleteIntegration(params: DeleteIntegrationParams, options?: RequestOptions): Promise<any>;
243
251
  getIntegrationConfig(params: {
244
252
  businessId: string;
245
- type: "payment" | "shipping" | "analytics";
253
+ type: "payment" | "shipping";
246
254
  }, options?: RequestOptions): Promise<any>;
247
255
  listWebhooks(params: ListWebhooksParams, options?: RequestOptions): Promise<any>;
248
256
  createWebhook(params: CreateWebhookParams, options?: RequestOptions): Promise<any>;
@@ -430,7 +438,6 @@ declare function createAdmin(config: HttpClientConfig & {
430
438
  };
431
439
  };
432
440
  analytics: {
433
- track: typeof track;
434
441
  query: (spec: AnalyticsQuery, options?: RequestOptions & {
435
442
  businessId?: string;
436
443
  }) => Promise<AnalyticsQueryResponse>;
@@ -482,7 +489,6 @@ declare function createAdmin(config: HttpClientConfig & {
482
489
  validateKey: typeof validateKey;
483
490
  toKey: typeof toKey;
484
491
  nameToKey: typeof nameToKey;
485
- track: typeof track;
486
492
  getAvailableStock: typeof getAvailableStock;
487
493
  getReservedStock: typeof getReservedStock;
488
494
  hasStock: typeof hasStock;
@@ -490,16 +496,33 @@ declare function createAdmin(config: HttpClientConfig & {
490
496
  getFirstAvailableFCId: typeof getFirstAvailableFCId;
491
497
  };
492
498
  }>;
499
+ interface StorefrontSession {
500
+ business: any;
501
+ market: any;
502
+ }
493
503
  declare function createStorefront(config: HttpClientConfig & {
494
- market: string;
504
+ market?: string;
495
505
  locale?: string;
496
- }): Promise<{
506
+ }): {
507
+ init: () => Promise<StorefrontSession>;
508
+ stores: {
509
+ business: nanostores.PreinitializedWritableAtom<any> & object;
510
+ market: nanostores.PreinitializedWritableAtom<any> & object;
511
+ loading: nanostores.PreinitializedWritableAtom<boolean> & object;
512
+ error: nanostores.PreinitializedWritableAtom<string> & object;
513
+ initialized: nanostores.PreinitializedWritableAtom<boolean> & object;
514
+ currency: nanostores.ReadableAtom<any>;
515
+ currencySymbol: nanostores.ReadableAtom<any>;
516
+ paymentMethods: nanostores.ReadableAtom<any>;
517
+ paymentMethodObjects: nanostores.ReadableAtom<any>;
518
+ paymentConfig: nanostores.ReadableAtom<{
519
+ provider: any;
520
+ enabled: boolean;
521
+ }>;
522
+ zones: nanostores.ReadableAtom<any>;
523
+ };
497
524
  business: {
498
525
  getBusiness(options?: RequestOptions): any;
499
- getIntegrationConfig(params: {
500
- businessId?: string;
501
- type: "payment" | "shipping" | "analytics";
502
- }, options?: RequestOptions): any;
503
526
  location: {
504
527
  getCountries(options?: RequestOptions): any;
505
528
  getCountry(countryCode: string, options?: RequestOptions): any;
@@ -563,9 +586,7 @@ declare function createStorefront(config: HttpClientConfig & {
563
586
  customer: {
564
587
  initialize(params?: {
565
588
  businessId?: string;
566
- }, options?: RequestOptions): any;
567
- signInAnonymously(params?: {
568
- businessId?: string;
589
+ market?: string;
569
590
  }, options?: RequestOptions): any;
570
591
  connect(params: any, options?: RequestOptions): any;
571
592
  requestCode(params: {
@@ -578,7 +599,7 @@ declare function createStorefront(config: HttpClientConfig & {
578
599
  businessId?: string;
579
600
  }, options?: RequestOptions): any;
580
601
  refreshToken(params: {
581
- refreshToken: string;
602
+ refresh_token: string;
582
603
  businessId?: string;
583
604
  }, options?: RequestOptions): any;
584
605
  getMe(options?: RequestOptions): any;
@@ -608,35 +629,32 @@ declare function createStorefront(config: HttpClientConfig & {
608
629
  sendMessage(params: {
609
630
  id: string;
610
631
  message: string;
611
- chatId?: string;
632
+ chat_id?: string;
612
633
  businessId?: string;
613
634
  }, options?: RequestOptions): any;
614
635
  getChat(params: {
615
636
  id: string;
616
- chatId: string;
637
+ chat_id: string;
617
638
  businessId?: string;
618
639
  }, options?: RequestOptions): any;
619
640
  getChatMessages(params: {
620
641
  id: string;
621
- chatId: string;
642
+ chat_id: string;
622
643
  limit?: number;
623
644
  businessId?: string;
624
645
  }, options?: RequestOptions): any;
625
646
  rateChat(params: {
626
647
  id: string;
627
- chatId: string;
648
+ chat_id: string;
628
649
  rating: number;
629
650
  comment?: string;
630
651
  businessId?: string;
631
652
  }, options?: RequestOptions): any;
632
653
  };
633
654
  };
634
- analytics: {
635
- track: typeof track;
636
- };
637
655
  setBusinessId: (businessId: string) => void;
638
656
  getBusinessId: () => string;
639
- setMarket: (market: string) => void;
657
+ setMarket: (key: string) => void;
640
658
  getMarket: () => string;
641
659
  setLocale: (locale: string) => void;
642
660
  getLocale: () => string;
@@ -681,13 +699,12 @@ declare function createStorefront(config: HttpClientConfig & {
681
699
  validateKey: typeof validateKey;
682
700
  toKey: typeof toKey;
683
701
  nameToKey: typeof nameToKey;
684
- track: typeof track;
685
702
  getAvailableStock: typeof getAvailableStock;
686
703
  getReservedStock: typeof getReservedStock;
687
704
  hasStock: typeof hasStock;
688
705
  getInventoryAt: typeof getInventoryAt;
689
706
  getFirstAvailableFCId: typeof getFirstAvailableFCId;
690
707
  };
691
- }>;
708
+ };
692
709
 
693
- export { type Activity$1 as Activity, type AnalyticsQuery, type AnalyticsQueryResponse, type AnalyticsRow, type ApiConfig, AvailabilityResponse, COMMON_ACTIVITY_TYPES, type CommonActivityType, CreateAgentParams, CreateLocationParams, DeleteLocationParams, type Dimension, type EntityKind, type Filter, type FilterField, type FilterOp, GetAgentParams, GetAgentsParams, GetAvailabilityParams, type GetCountriesResponse, GetShippingRatesParams, type Granularity, type HttpClientConfig, Location, type LocationCountry, type LocationState, Market, type Measure, type OrderBy, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShipParams, ShipResult, ShippingRate, Slot, type TimeRange, type TimeUnit, type TimelineParams, type TrackParams, UpdateAgentParams, UpdateLocationParams, createAdmin, createStorefront };
710
+ export { type Activity$1 as Activity, type AnalyticsQuery, type AnalyticsQueryResponse, type AnalyticsRow, type ApiConfig, AvailabilityResponse, COMMON_ACTIVITY_TYPES, type CommonActivityType, CreateAgentParams, CreateLocationParams, DeleteLocationParams, type Dimension, type EntityKind, type Filter, type FilterField, type FilterOp, GetAgentParams, GetAgentsParams, GetAvailabilityParams, type GetCountriesResponse, GetShippingRatesParams, type Granularity, type HttpClientConfig, Location, type LocationCountry, type LocationState, Market, type Measure, type OrderBy, SDK_VERSION, SUPPORTED_FRAMEWORKS, ShipParams, ShipResult, ShippingRate, Slot, type StorefrontSession, type StorefrontStores, type TimeRange, type TimeUnit, type TimelineParams, type TrackParams, UpdateAgentParams, UpdateLocationParams, createAdmin, createStorefront };