arky-sdk 0.9.6 → 0.9.11

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.
Files changed (41) hide show
  1. package/README.md +113 -194
  2. package/dist/{admin-DjYydKeB.d.ts → admin-BKXmDIVk.d.ts} +412 -405
  3. package/dist/{admin-DlL8mCxL.d.cts → admin-CAwQrMOX.d.cts} +412 -405
  4. package/dist/admin.cjs +767 -373
  5. package/dist/admin.cjs.map +1 -1
  6. package/dist/admin.d.cts +3 -3
  7. package/dist/admin.d.ts +3 -3
  8. package/dist/admin.js +767 -373
  9. package/dist/admin.js.map +1 -1
  10. package/dist/{api-BbBHcd4p.d.cts → api-DJI3S6XA.d.cts} +1440 -525
  11. package/dist/{api-BbBHcd4p.d.ts → api-DJI3S6XA.d.ts} +1440 -525
  12. package/dist/{index-CZxubTDA.d.ts → index-BaSBPLdF.d.ts} +1 -1
  13. package/dist/{index-nCF3Z6Af.d.cts → index-u-gjHnKs.d.cts} +1 -1
  14. package/dist/index.cjs +874 -471
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +3 -3
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.js +874 -471
  19. package/dist/index.js.map +1 -1
  20. package/dist/storefront.cjs +493 -300
  21. package/dist/storefront.cjs.map +1 -1
  22. package/dist/storefront.d.cts +172 -89
  23. package/dist/storefront.d.ts +172 -89
  24. package/dist/storefront.js +491 -299
  25. package/dist/storefront.js.map +1 -1
  26. package/dist/types.cjs.map +1 -1
  27. package/dist/types.d.cts +1 -1
  28. package/dist/types.d.ts +1 -1
  29. package/dist/types.js.map +1 -1
  30. package/dist/utils.d.cts +2 -2
  31. package/dist/utils.d.ts +2 -2
  32. package/package.json +7 -10
  33. package/scripts/contract-admin.mjs +137 -0
  34. package/scripts/contract-storefront.mjs +296 -0
  35. package/dist/storefront-store.cjs +0 -2809
  36. package/dist/storefront-store.cjs.map +0 -1
  37. package/dist/storefront-store.d.cts +0 -5
  38. package/dist/storefront-store.d.ts +0 -5
  39. package/dist/storefront-store.js +0 -2807
  40. package/dist/storefront-store.js.map +0 -1
  41. package/scripts/smoke-store.mjs +0 -41
@@ -1,9 +1,42 @@
1
- import { C as CreateStorefrontConfig, T as TrackParams, P as ProfileSession, a as ProfileToken, A as AuthStateListener, b as CartController, I as IdentifyResponse, V as VerifyResponse, S as StartSupportConversationParams, c as SupportConversationResponse, d as SendSupportMessageParams, G as GetSupportConversationParams, e as extractBlockValues, g as getBlockLabel, f as formatBlockValue, p as prepareBlocksForSubmission, v as validatePhoneNumber, h as findTimeZone, s as slugify, i as humanize, j as categorify, k as formatDate, l as getSvgContentForAstro, m as fetchSvgContent, n as injectSvgIntoElement, o as Activity } from './admin-DlL8mCxL.cjs';
2
- export { M as AuthStorage, q as COMMON_ACTIVITY_TYPES, w as CartApi, x as CartControllerAddItemParams, y as CartControllerCheckoutParams, z as CartControllerClearParams, B as CartControllerInitParams, D as CartControllerListener, E as CartControllerQuoteParams, F as CartControllerRefreshParams, H as CartControllerRemoveItemParams, J as CartControllerState, K as CartControllerUpdateParams, u as CommonActivityType, L as HttpClientConfig, t as createCartController, r as createStorefront } from './admin-DlL8mCxL.cjs';
1
+ import { C as CreateStorefrontConfig, a as ContactSession, b as ContactToken, A as AuthStateListener, c as CartController, I as IdentifyResponse, V as VerifyResponse, T as TrackActionParams, U as UseExperimentParams, E as ExperimentUseResponse, S as StartSupportConversationParams, d as SupportConversationResponse, e as SendSupportMessageParams, G as GetSupportConversationParams, g as getBlockLabel, f as formatBlockValue, p as prepareBlocksForSubmission, h as extractBlockValues, v as validatePhoneNumber, i as findTimeZone, s as slugify, j as humanize, k as categorify, l as formatDate, m as getSvgContentForAstro, n as fetchSvgContent, o as injectSvgIntoElement, q as StorefrontAction } from './admin-CAwQrMOX.cjs';
2
+ export { r as AuthStorage, t as COMMON_ACTION_KEYS, u as CartApi, w as CartControllerAddItemParams, x as CartControllerCheckoutParams, y as CartControllerClearParams, z as CartControllerInitParams, B as CartControllerListener, D as CartControllerQuoteParams, F as CartControllerRefreshParams, H as CartControllerRemoveItemParams, J as CartControllerState, K as CartControllerUpdateParams, L as CommonActionKey, M as HttpClientConfig, N as createCartController, O as createStorefront } from './admin-CAwQrMOX.cjs';
3
3
  import * as nanostores from 'nanostores';
4
- 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-nCF3Z6Af.cjs';
5
- import { C as Cart, an as Node, ax as Form, aX as Product, b9 as Service, bm as Provider, bf as AvailabilityResponse, ar as Block, O as OrderQuote, d7 as PaymentMethod, ea as FormEntry, cU as Price, a as OrderCheckoutResult, cO as EshopCartItem, db as Address, dd as ZoneLocation, ff as ProductCheckoutItemInput, fg as ServiceCheckoutItemInput, bu as ProfileDetail, R as RequestOptions, S as Store, L as Location, M as Market, aq as GetNodeParams, as as TaxonomyEntry, at as NodeStatus, au as GetNodesParams, y as PaginatedResponse, av as GetNodeChildrenParams, aA as GetFormParams, aC as SubmitFormParams, aD as FormSubmission, aL as GetTaxonomyParams, aI as Taxonomy, aN as GetTaxonomyChildrenParams, a_ as GetProductParams, a$ as GetProductsParams, G as GetCurrentCartParams, b as GetCartParams, U as UpdateCartParams, A as AddCartItemParams, c as RemoveCartItemParams, d as ClearCartParams, Q as QuoteCartParams, e as CheckoutCartParams, b2 as GetOrderParams, b1 as Order, b3 as GetOrdersParams, bc as GetServiceParams, bd as GetServicesParams, bg as FindServiceProvidersParams, be as GetAvailabilityParams, bp as GetProviderParams, bq as GetProvidersParams, bD as GetProfileListParams, bB as ProfileList, bE as FindProfileListsParams, cJ as SubscribeProfileListParams, cK as ProfileListSubscribeResponse, cL as ProfileListAccessParams, cM as ProfileListAccessResponse, e8 as FormField, e2 as ProductVariant, fi as CheckoutItemInput } from './api-BbBHcd4p.cjs';
4
+ 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-u-gjHnKs.cjs';
5
+ import { E as EshopCartItem, F as FormEntry, P as Price, A as Address, B as Block, C as Cart, O as OrderCheckoutResult, a as CollectionEntry, b as Form, c as Product, S as Service, d as Provider, e as AvailabilityResponse, f as OrderQuote, g as PaymentMethod, Z as ZoneLocation, h as ProductCheckoutItemInput, i as ServiceCheckoutItemInput, j as ContactDetail, R as RequestOptions, k as Store, L as Location, M as Market, G as GetCollectionParams, l as Collection, m as GetEntryParams, n as GetEntriesParams, o as PaginatedResponse, p as GetFormParams, q as SubmitFormParams, r as FormSubmission, s as GetTaxonomyParams, T as Taxonomy, t as GetTaxonomyChildrenParams, u as GetProductParams, v as GetProductsParams, w as GetCurrentCartParams, x as GetCartParams, U as UpdateCartParams, y as AddCartItemParams, z as RemoveCartItemParams, D as ClearCartParams, Q as QuoteCartParams, H as CheckoutCartParams, I as GetOrderParams, J as Order, K as GetOrdersParams, N as DownloadDigitalAccessParams, V as DigitalAccessDownloadResponse, W as GetServiceParams, X as GetServicesParams, Y as FindServiceProvidersParams, _ as GetAvailabilityParams, $ as GetProviderParams, a0 as GetProvidersParams, a1 as GetContactListParams, a2 as ContactList, a3 as FindContactListsParams, a4 as SubscribeContactListParams, a5 as ContactListSubscribeResponse, a6 as ContactListAccessParams, a7 as ContactListAccessResponse, a8 as ProductVariant, a9 as OrderCheckoutItemInput, aa as FormField } from './api-DJI3S6XA.cjs';
6
+ import { StripeElementsOptions } from '@stripe/stripe-js';
6
7
 
8
+ interface StripeConfirmationTokenControllerConfig {
9
+ publishableKey: string;
10
+ amount: number;
11
+ currency: string;
12
+ appearance?: StripeElementsOptions["appearance"];
13
+ }
14
+ interface StripeConfirmationTokenOptions {
15
+ return_url?: string;
16
+ billing_details?: {
17
+ name?: string | null;
18
+ email?: string | null;
19
+ phone?: string | null;
20
+ };
21
+ }
22
+ interface StripeConfirmationTokenResult {
23
+ confirmation_token_id: string;
24
+ return_url?: string;
25
+ }
26
+ interface StripeConfirmationTokenController {
27
+ mount(target: string | HTMLElement): void;
28
+ update(input: {
29
+ amount?: number;
30
+ currency?: string;
31
+ }): void;
32
+ createConfirmationToken(options?: StripeConfirmationTokenOptions): Promise<StripeConfirmationTokenResult>;
33
+ handleNextAction(clientSecret: string): Promise<void>;
34
+ destroy(): void;
35
+ }
36
+ declare function createStripeConfirmationTokenController(config: StripeConfirmationTokenControllerConfig): Promise<StripeConfirmationTokenController>;
37
+
38
+ type ArkyPaymentController = StripeConfirmationTokenController;
39
+ type ArkyStripePaymentMountOptions = Partial<StripeConfirmationTokenControllerConfig>;
7
40
  interface ArkyStoreConfig extends CreateStorefrontConfig {
8
41
  marketForLocale?: (locale: string) => string | null | undefined;
9
42
  }
@@ -11,18 +44,9 @@ interface ArkyStoreContext {
11
44
  locale?: string;
12
45
  market?: string;
13
46
  }
14
- interface ArkyStoreSetupOptions extends ArkyStoreContext {
15
- hydrateCart?: boolean;
16
- identify?: boolean;
17
- track?: TrackParams | false | null;
18
- }
19
- interface ArkyStoreSetupResult {
20
- session: ProfileSession | null;
21
- cart?: Cart;
22
- }
23
- type ArkyCmsNodeParams = ArkyStoreContext & {
47
+ type ArkyCmsEntryParams = ArkyStoreContext & {
24
48
  id?: string;
25
- slug?: string;
49
+ collection_id?: string;
26
50
  key?: string;
27
51
  store_id?: string;
28
52
  };
@@ -59,7 +83,7 @@ interface ArkyCartStatus {
59
83
  interface ArkyLastOrder {
60
84
  order_id: string;
61
85
  number: string;
62
- client_secret: string | null;
86
+ payment_action: OrderCheckoutResult["payment_action"];
63
87
  payment: OrderCheckoutResult["payment"];
64
88
  product_items?: EshopCartItem[];
65
89
  service_items?: ArkyServiceCartItem[];
@@ -67,7 +91,7 @@ interface ArkyLastOrder {
67
91
  billing_address?: Address | null;
68
92
  total?: number;
69
93
  currency?: string | null;
70
- payment_method_id?: string | null;
94
+ payment_method_key?: string | null;
71
95
  created_at: number;
72
96
  }
73
97
  interface ArkyCartInput {
@@ -77,11 +101,19 @@ interface ArkyCartInput {
77
101
  billing_address?: Address | null;
78
102
  forms?: FormEntry[] | Block[];
79
103
  promo_code?: string | null;
80
- payment_method_id?: string | null;
104
+ payment_method_key?: string | null;
81
105
  shipping_method_id?: string | null;
106
+ payment?: ArkyPaymentController | null;
107
+ return_url?: string;
108
+ billing_details?: {
109
+ name?: string | null;
110
+ email?: string | null;
111
+ phone?: string | null;
112
+ };
113
+ clear_after_checkout?: boolean;
82
114
  }
83
115
  interface ArkyCmsState {
84
- nodes: Record<string, Node>;
116
+ entries: Record<string, CollectionEntry>;
85
117
  forms: Record<string, Form>;
86
118
  loading: boolean;
87
119
  error: string | null;
@@ -157,21 +189,21 @@ declare function locationToAddress(location: ZoneLocation): Address;
157
189
  declare function toProductCheckoutItems(items: EshopCartItem[]): ProductCheckoutItemInput[];
158
190
  declare function toServiceCheckoutItems(items: ArkyServiceCartItem[]): ServiceCheckoutItemInput[];
159
191
 
160
- declare function createArkyStore(config: ArkyStoreConfig): {
192
+ declare function initialize(config: ArkyStoreConfig): {
161
193
  client: {
162
194
  identify: (params?: {
163
195
  email?: string;
164
196
  verify?: boolean;
165
197
  market?: string;
166
- }) => Promise<ProfileSession>;
198
+ }) => Promise<ContactSession>;
167
199
  verify: (params: {
168
200
  code: string;
169
- }) => Promise<ProfileToken>;
201
+ }) => Promise<ContactToken>;
170
202
  logout: () => Promise<void>;
171
- me: () => Promise<ProfileDetail>;
172
- readonly session: ProfileSession | null;
203
+ me: () => Promise<ContactDetail>;
204
+ readonly session: ContactSession | null;
173
205
  readonly isAuthenticated: boolean;
174
- onAuthStateChanged(listener: AuthStateListener<ProfileSession>): () => void;
206
+ onAuthStateChanged(listener: AuthStateListener<ContactSession>): () => void;
175
207
  store: {
176
208
  getStore(options?: RequestOptions): Promise<Store>;
177
209
  location: {
@@ -204,25 +236,12 @@ declare function createArkyStore(config: ArkyStoreConfig): {
204
236
  };
205
237
  cart: CartController;
206
238
  cms: {
207
- node: {
208
- get(params: GetNodeParams, options?: RequestOptions): Promise<{
209
- getBlock(key: string): any;
210
- getBlockValues(key: string): any;
211
- getImage(key: string): any;
212
- id: string;
213
- key: string;
214
- store_id: string;
215
- parent_id?: string | null;
216
- blocks: Block[];
217
- taxonomies: TaxonomyEntry[];
218
- status: NodeStatus;
219
- slug: Record<string, string>;
220
- children: Node[];
221
- created_at: number;
222
- updated_at: number;
223
- }>;
224
- find(params: GetNodesParams, options?: RequestOptions): Promise<PaginatedResponse<Node>>;
225
- getChildren(params: GetNodeChildrenParams, options?: RequestOptions): Promise<PaginatedResponse<Node>>;
239
+ collection: {
240
+ get(params: GetCollectionParams, options?: RequestOptions): Promise<Collection>;
241
+ };
242
+ entry: {
243
+ get(params: GetEntryParams, options?: RequestOptions): Promise<CollectionEntry>;
244
+ find(params: GetEntriesParams, options?: RequestOptions): Promise<PaginatedResponse<CollectionEntry>>;
226
245
  };
227
246
  form: {
228
247
  get(params: GetFormParams, options?: RequestOptions): Promise<Form>;
@@ -251,6 +270,7 @@ declare function createArkyStore(config: ArkyStoreConfig): {
251
270
  order: {
252
271
  get(params: GetOrderParams, options?: RequestOptions): Promise<Order>;
253
272
  find(params: GetOrdersParams, options?: RequestOptions): Promise<PaginatedResponse<Order>>;
273
+ downloadDigitalAccess(params: DownloadDigitalAccessParams, options?: RequestOptions): Promise<DigitalAccessDownloadResponse>;
254
274
  };
255
275
  service: {
256
276
  get(params: GetServiceParams, options?: RequestOptions): Promise<Service>;
@@ -264,7 +284,7 @@ declare function createArkyStore(config: ArkyStoreConfig): {
264
284
  };
265
285
  };
266
286
  crm: {
267
- profile: {
287
+ contact: {
268
288
  identify(params?: {
269
289
  email?: string;
270
290
  verify?: boolean;
@@ -274,24 +294,27 @@ declare function createArkyStore(config: ArkyStoreConfig): {
274
294
  code: string;
275
295
  }, options?: RequestOptions): Promise<VerifyResponse>;
276
296
  logout(options?: RequestOptions): Promise<void>;
277
- getMe(options?: RequestOptions): Promise<ProfileDetail>;
297
+ getMe(options?: RequestOptions): Promise<ContactDetail>;
278
298
  };
279
- profileList: {
280
- get(params: GetProfileListParams, options?: RequestOptions): Promise<ProfileList>;
281
- find(params?: FindProfileListsParams, options?: RequestOptions): Promise<PaginatedResponse<ProfileList>>;
282
- subscribe(params: SubscribeProfileListParams, options?: RequestOptions): Promise<ProfileListSubscribeResponse>;
283
- checkAccess(params: ProfileListAccessParams, options?: RequestOptions): Promise<ProfileListAccessResponse>;
299
+ contactList: {
300
+ get(params: GetContactListParams, options?: RequestOptions): Promise<ContactList>;
301
+ find(params?: FindContactListsParams, options?: RequestOptions): Promise<PaginatedResponse<ContactList>>;
302
+ subscribe(params: SubscribeContactListParams, options?: RequestOptions): Promise<ContactListSubscribeResponse>;
303
+ checkAccess(params: ContactListAccessParams, options?: RequestOptions): Promise<ContactListAccessResponse>;
284
304
  unsubscribe(token: string, options?: RequestOptions): Promise<{
285
- unsubscribed: boolean;
305
+ success: boolean;
286
306
  }>;
287
307
  confirm(token: string, options?: RequestOptions): Promise<{
288
- confirmed: boolean;
308
+ success: boolean;
289
309
  }>;
290
310
  };
291
311
  };
292
- activity: {
293
- COMMON_ACTIVITY_TYPES: readonly ["page_view", "product_view", "service_view", "provider_view", "cart_added", "cart_removed", "checkout_started", "purchase", "order_created", "signin", "signup", "verified_email", "search", "share", "wishlist_added"];
294
- track(params: TrackParams): Promise<void>;
312
+ action: {
313
+ COMMON_ACTION_KEYS: readonly ["page.view", "product.view", "service.view", "provider.view", "cart.added", "cart.removed", "checkout.started", "order.created", "signin", "signup", "verified.email", "search", "share", "wishlist.added"];
314
+ track(params: TrackActionParams): Promise<void>;
315
+ };
316
+ experiments: {
317
+ use(params: UseExperimentParams, options?: RequestOptions): Promise<ExperimentUseResponse>;
295
318
  };
296
319
  support: {
297
320
  startConversation(params?: Omit<StartSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
@@ -304,7 +327,6 @@ declare function createArkyStore(config: ArkyStoreConfig): {
304
327
  getMarket: () => string;
305
328
  setLocale: (l: string) => void;
306
329
  getLocale: () => string;
307
- extractBlockValues: typeof extractBlockValues;
308
330
  utils: {
309
331
  getImageUrl: (imageBlock: any, isBlock?: boolean) => any;
310
332
  getBlockValue: (entry: any, blockKey: string) => any;
@@ -349,7 +371,7 @@ declare function createArkyStore(config: ArkyStoreConfig): {
349
371
  getFirstAvailableFCId: typeof getFirstAvailableFCId;
350
372
  };
351
373
  };
352
- session: nanostores.PreinitializedWritableAtom<ProfileSession | null> & object;
374
+ session: nanostores.PreinitializedWritableAtom<ContactSession | null> & object;
353
375
  market: nanostores.ReadableAtom<Market | null>;
354
376
  market_key: nanostores.PreinitializedWritableAtom<string> & object;
355
377
  locale: nanostores.PreinitializedWritableAtom<string> & object;
@@ -359,20 +381,65 @@ declare function createArkyStore(config: ArkyStoreConfig): {
359
381
  provider: {} | null;
360
382
  enabled: boolean;
361
383
  }>;
362
- setup: (options?: ArkyStoreSetupOptions) => Promise<ArkyStoreSetupResult>;
363
- initialize: (options?: ArkyStoreSetupOptions) => Promise<ArkyStoreSetupResult>;
384
+ cart: {
385
+ cart: nanostores.PreinitializedWritableAtom<Cart | null> & object;
386
+ product_items: nanostores.PreinitializedWritableAtom<EshopCartItem[]> & object;
387
+ service_items: nanostores.PreinitializedWritableAtom<ArkyServiceCartItem[]> & object;
388
+ quote_result: nanostores.PreinitializedWritableAtom<OrderQuote | null> & object;
389
+ promo_code: nanostores.PreinitializedWritableAtom<string | null> & object;
390
+ last_order: nanostores.PreinitializedWritableAtom<ArkyLastOrder | null> & object;
391
+ status: nanostores.PreinitializedMapStore<ArkyCartStatus> & object;
392
+ product_item_count: nanostores.ReadableAtom<number>;
393
+ service_item_count: nanostores.ReadableAtom<number>;
394
+ item_count: nanostores.ReadableAtom<number>;
395
+ snapshot: nanostores.ReadableAtom<{
396
+ cart: Cart | null;
397
+ product_items: EshopCartItem[];
398
+ service_items: ArkyServiceCartItem[];
399
+ item_count: number;
400
+ }>;
401
+ load: () => Promise<Cart>;
402
+ refresh: (input?: ArkyCartInput, writeRevision?: number) => Promise<Cart>;
403
+ addProduct: (product: Product, variant: ProductVariant, quantity?: number) => Promise<Cart>;
404
+ setProductQuantity: (itemId: string, quantity: number) => Promise<Cart>;
405
+ removeProduct: (itemId: string) => Promise<Cart | null>;
406
+ addServiceItem: (item: ArkyServiceCartItem) => Promise<Cart>;
407
+ removeServiceItem: (itemId: string) => Promise<Cart>;
408
+ clear: () => Promise<Cart | null>;
409
+ clearLocal: () => void;
410
+ quote: (input?: ArkyCartInput) => Promise<OrderQuote | null>;
411
+ checkout: (input?: ArkyCartInput) => Promise<OrderCheckoutResult>;
412
+ payment: {
413
+ controller: nanostores.PreinitializedWritableAtom<StripeConfirmationTokenController | null> & object;
414
+ ready: nanostores.ReadableAtom<boolean>;
415
+ setController: (controller: StripeConfirmationTokenController | null) => StripeConfirmationTokenController | null;
416
+ getController: () => StripeConfirmationTokenController | null;
417
+ mountStripe: (target: string | HTMLElement, options?: ArkyStripePaymentMountOptions) => Promise<StripeConfirmationTokenController>;
418
+ update: (input: {
419
+ amount?: number;
420
+ currency?: string;
421
+ }) => void;
422
+ destroy: () => void;
423
+ };
424
+ applyPromoCode(code: string, input?: Omit<ArkyCartInput, "promo_code">): Promise<OrderQuote | null>;
425
+ removePromoCode(input?: Omit<ArkyCartInput, "promo_code">): Promise<OrderQuote | null>;
426
+ selectShippingMethod(id: string | null): void;
427
+ locationToAddress: typeof locationToAddress;
428
+ buildItems: (input?: ArkyCartInput) => OrderCheckoutItemInput[];
429
+ buildProductItems: typeof toProductCheckoutItems;
430
+ buildServiceItems: typeof toServiceCheckoutItems;
431
+ };
364
432
  identify: (params?: {
365
433
  email?: string;
366
434
  verify?: boolean;
367
435
  market?: string;
368
- }) => Promise<ProfileSession>;
436
+ }) => Promise<ContactSession>;
369
437
  verify: (params: {
370
438
  code: string;
371
- }) => Promise<ProfileToken>;
372
- me: () => Promise<ProfileDetail>;
439
+ }) => Promise<ContactToken>;
440
+ me: () => Promise<ContactDetail>;
373
441
  logout: () => Promise<void>;
374
- onAuthStateChanged: (listener: AuthStateListener<ProfileSession>) => () => void;
375
- readonly currentSession: ProfileSession | null;
442
+ onAuthStateChanged: (listener: AuthStateListener<ContactSession>) => () => void;
376
443
  readonly isAuthenticated: boolean;
377
444
  setMarket: (key: string) => void;
378
445
  setLocale: (value: string, options?: {
@@ -384,10 +451,12 @@ declare function createArkyStore(config: ArkyStoreConfig): {
384
451
  getLocale: () => string;
385
452
  cms: {
386
453
  state: nanostores.PreinitializedMapStore<ArkyCmsState> & object;
387
- node: {
388
- get: (params: ArkyCmsNodeParams, options?: RequestOptions) => Promise<Node>;
389
- find: (params: GetNodesParams, options?: RequestOptions) => Promise<PaginatedResponse<Node>>;
390
- getChildren: (params: GetNodeChildrenParams, options?: RequestOptions) => Promise<PaginatedResponse<Node>>;
454
+ collection: {
455
+ get: (params: GetCollectionParams, options?: RequestOptions) => Promise<Collection>;
456
+ };
457
+ entry: {
458
+ get: (params: ArkyCmsEntryParams, options?: RequestOptions) => Promise<CollectionEntry>;
459
+ find: (params: GetEntriesParams, options?: RequestOptions) => Promise<PaginatedResponse<CollectionEntry>>;
391
460
  };
392
461
  form: {
393
462
  get: (params: {
@@ -466,6 +535,7 @@ declare function createArkyStore(config: ArkyStoreConfig): {
466
535
  order: {
467
536
  get(params: GetOrderParams, options?: RequestOptions): Promise<Order>;
468
537
  find(params: GetOrdersParams, options?: RequestOptions): Promise<PaginatedResponse<Order>>;
538
+ downloadDigitalAccess(params: DownloadDigitalAccessParams, options?: RequestOptions): Promise<DigitalAccessDownloadResponse>;
469
539
  };
470
540
  cart: {
471
541
  cart: nanostores.PreinitializedWritableAtom<Cart | null> & object;
@@ -484,30 +554,40 @@ declare function createArkyStore(config: ArkyStoreConfig): {
484
554
  service_items: ArkyServiceCartItem[];
485
555
  item_count: number;
486
556
  }>;
487
- ensure: () => Promise<Cart>;
488
- hydrate: (response: Cart, options?: {
489
- ifRevision?: number;
490
- }) => Promise<Cart>;
491
- sync: (input?: ArkyCartInput, writeRevision?: number) => Promise<Cart>;
557
+ load: () => Promise<Cart>;
558
+ refresh: (input?: ArkyCartInput, writeRevision?: number) => Promise<Cart>;
492
559
  addProduct: (product: Product, variant: ProductVariant, quantity?: number) => Promise<Cart>;
493
560
  setProductQuantity: (itemId: string, quantity: number) => Promise<Cart>;
494
561
  removeProduct: (itemId: string) => Promise<Cart | null>;
495
562
  addServiceItem: (item: ArkyServiceCartItem) => Promise<Cart>;
496
563
  removeServiceItem: (itemId: string) => Promise<Cart>;
497
564
  clear: () => Promise<Cart | null>;
565
+ clearLocal: () => void;
498
566
  quote: (input?: ArkyCartInput) => Promise<OrderQuote | null>;
499
567
  checkout: (input?: ArkyCartInput) => Promise<OrderCheckoutResult>;
568
+ payment: {
569
+ controller: nanostores.PreinitializedWritableAtom<StripeConfirmationTokenController | null> & object;
570
+ ready: nanostores.ReadableAtom<boolean>;
571
+ setController: (controller: StripeConfirmationTokenController | null) => StripeConfirmationTokenController | null;
572
+ getController: () => StripeConfirmationTokenController | null;
573
+ mountStripe: (target: string | HTMLElement, options?: ArkyStripePaymentMountOptions) => Promise<StripeConfirmationTokenController>;
574
+ update: (input: {
575
+ amount?: number;
576
+ currency?: string;
577
+ }) => void;
578
+ destroy: () => void;
579
+ };
500
580
  applyPromoCode(code: string, input?: Omit<ArkyCartInput, "promo_code">): Promise<OrderQuote | null>;
501
581
  removePromoCode(input?: Omit<ArkyCartInput, "promo_code">): Promise<OrderQuote | null>;
502
582
  selectShippingMethod(id: string | null): void;
503
583
  locationToAddress: typeof locationToAddress;
504
- buildItems: (input?: ArkyCartInput) => CheckoutItemInput[];
584
+ buildItems: (input?: ArkyCartInput) => OrderCheckoutItemInput[];
505
585
  buildProductItems: typeof toProductCheckoutItems;
506
586
  buildServiceItems: typeof toServiceCheckoutItems;
507
587
  };
508
588
  };
509
589
  crm: {
510
- profile: {
590
+ contact: {
511
591
  identify(params?: {
512
592
  email?: string;
513
593
  verify?: boolean;
@@ -517,25 +597,28 @@ declare function createArkyStore(config: ArkyStoreConfig): {
517
597
  code: string;
518
598
  }, options?: RequestOptions): Promise<VerifyResponse>;
519
599
  logout(options?: RequestOptions): Promise<void>;
520
- getMe(options?: RequestOptions): Promise<ProfileDetail>;
600
+ getMe(options?: RequestOptions): Promise<ContactDetail>;
521
601
  };
522
- profileList: {
523
- get(params: GetProfileListParams, options?: RequestOptions): Promise<ProfileList>;
524
- find(params?: FindProfileListsParams, options?: RequestOptions): Promise<PaginatedResponse<ProfileList>>;
525
- subscribe(params: SubscribeProfileListParams, options?: RequestOptions): Promise<ProfileListSubscribeResponse>;
526
- checkAccess(params: ProfileListAccessParams, options?: RequestOptions): Promise<ProfileListAccessResponse>;
602
+ contactList: {
603
+ get(params: GetContactListParams, options?: RequestOptions): Promise<ContactList>;
604
+ find(params?: FindContactListsParams, options?: RequestOptions): Promise<PaginatedResponse<ContactList>>;
605
+ subscribe(params: SubscribeContactListParams, options?: RequestOptions): Promise<ContactListSubscribeResponse>;
606
+ checkAccess(params: ContactListAccessParams, options?: RequestOptions): Promise<ContactListAccessResponse>;
527
607
  unsubscribe(token: string, options?: RequestOptions): Promise<{
528
- unsubscribed: boolean;
608
+ success: boolean;
529
609
  }>;
530
610
  confirm(token: string, options?: RequestOptions): Promise<{
531
- confirmed: boolean;
611
+ success: boolean;
532
612
  }>;
533
613
  };
534
614
  };
535
- activity: {
536
- track(params: TrackParams): Promise<void>;
615
+ action: {
616
+ track(params: TrackActionParams): Promise<void>;
537
617
  pageView(payload?: Record<string, unknown>): Promise<void>;
538
- state: nanostores.PreinitializedWritableAtom<Activity | null> & object;
618
+ state: nanostores.PreinitializedWritableAtom<StorefrontAction | null> & object;
619
+ };
620
+ experiments: {
621
+ use: (params: string | UseExperimentParams) => Promise<ExperimentUseResponse>;
539
622
  };
540
623
  support: {
541
624
  startConversation(params?: Omit<StartSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
@@ -617,8 +700,8 @@ declare function createArkyStore(config: ArkyStoreConfig): {
617
700
  };
618
701
  };
619
702
 
620
- type ArkyStore = ReturnType<typeof createArkyStore>;
703
+ type ArkyStore = ReturnType<typeof initialize>;
621
704
  type ArkyCartStore = ArkyStore["eshop"]["cart"];
622
705
  type ArkyServiceStore = ArkyStore["eshop"]["service"];
623
706
 
624
- export { type ArkyCalendarDay as A, Activity, type ArkyCartInput, type ArkyCartSnapshot, type ArkyCartStatus, type ArkyCartStore, type ArkyCmsNodeParams, type ArkyCmsState, type ArkyEshopState, type ArkyLastOrder, type ArkyServiceCartItem, type ArkyServiceStore, type ArkyStore, type ArkyStoreConfig, type ArkyStoreContext, type ArkyStoreSetupOptions, type ArkyStoreSetupResult, AuthStateListener, CartController, CreateStorefrontConfig, ProfileSession, TrackParams, type ArkyServiceSlot as a, type ArkyServiceState as b, createArkyStore };
707
+ export { type ArkyCartInput, type ArkyCartSnapshot, type ArkyCartStatus, type ArkyCartStore, type ArkyCmsEntryParams, type ArkyCmsState, type ArkyEshopState, type ArkyLastOrder, type ArkyPaymentController, type ArkyServiceCartItem, type ArkyServiceStore, type ArkyStore, type ArkyStoreConfig, type ArkyStoreContext, type ArkyStripePaymentMountOptions, AuthStateListener, CartController, ContactSession, CreateStorefrontConfig, ExperimentUseResponse, StorefrontAction, type StripeConfirmationTokenController, type StripeConfirmationTokenControllerConfig, type StripeConfirmationTokenOptions, type StripeConfirmationTokenResult, TrackActionParams, UseExperimentParams, createStripeConfirmationTokenController, initialize };