arky-sdk 0.9.6 → 0.9.12
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/README.md +113 -194
- package/dist/admin-D8HiRDCl.d.cts +1536 -0
- package/dist/admin-Dnnv18wN.d.ts +1536 -0
- package/dist/admin.cjs +832 -375
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.d.cts +3 -3
- package/dist/admin.d.ts +3 -3
- package/dist/admin.js +832 -375
- package/dist/admin.js.map +1 -1
- package/dist/api-D4lMmvF0.d.cts +4337 -0
- package/dist/api-D4lMmvF0.d.ts +4337 -0
- package/dist/{index-nCF3Z6Af.d.cts → index-BS2x278C.d.cts} +1 -1
- package/dist/{index-CZxubTDA.d.ts → index-Be8suRwP.d.ts} +1 -1
- package/dist/index.cjs +934 -460
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +934 -460
- package/dist/index.js.map +1 -1
- package/dist/storefront.cjs +501 -300
- package/dist/storefront.cjs.map +1 -1
- package/dist/storefront.d.cts +174 -89
- package/dist/storefront.d.ts +174 -89
- package/dist/storefront.js +499 -299
- package/dist/storefront.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/package.json +7 -10
- package/scripts/contract-admin.mjs +137 -0
- package/scripts/contract-storefront.mjs +296 -0
- package/dist/admin-DjYydKeB.d.ts +0 -1389
- package/dist/admin-DlL8mCxL.d.cts +0 -1389
- package/dist/api-BbBHcd4p.d.cts +0 -3289
- package/dist/api-BbBHcd4p.d.ts +0 -3289
- package/dist/storefront-store.cjs +0 -2809
- package/dist/storefront-store.cjs.map +0 -1
- package/dist/storefront-store.d.cts +0 -5
- package/dist/storefront-store.d.ts +0 -5
- package/dist/storefront-store.js +0 -2807
- package/dist/storefront-store.js.map +0 -1
- package/scripts/smoke-store.mjs +0 -41
package/dist/storefront.d.ts
CHANGED
|
@@ -1,9 +1,42 @@
|
|
|
1
|
-
import { C as CreateStorefrontConfig,
|
|
2
|
-
export {
|
|
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-Dnnv18wN.js';
|
|
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-Dnnv18wN.js';
|
|
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-
|
|
5
|
-
import {
|
|
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-Be8suRwP.js';
|
|
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 ContactListContentAccessParams, a9 as ContactListContentAccessResponse, aa as ProductVariant, ab as OrderCheckoutItemInput, ac as FormField } from './api-D4lMmvF0.js';
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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<
|
|
198
|
+
}) => Promise<ContactSession>;
|
|
167
199
|
verify: (params: {
|
|
168
200
|
code: string;
|
|
169
|
-
}) => Promise<
|
|
201
|
+
}) => Promise<ContactToken>;
|
|
170
202
|
logout: () => Promise<void>;
|
|
171
|
-
me: () => Promise<
|
|
172
|
-
readonly session:
|
|
203
|
+
me: () => Promise<ContactDetail>;
|
|
204
|
+
readonly session: ContactSession | null;
|
|
173
205
|
readonly isAuthenticated: boolean;
|
|
174
|
-
onAuthStateChanged(listener: AuthStateListener<
|
|
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
|
-
|
|
208
|
-
get(params:
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
-
|
|
287
|
+
contact: {
|
|
268
288
|
identify(params?: {
|
|
269
289
|
email?: string;
|
|
270
290
|
verify?: boolean;
|
|
@@ -274,24 +294,28 @@ 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<
|
|
297
|
+
getMe(options?: RequestOptions): Promise<ContactDetail>;
|
|
278
298
|
};
|
|
279
|
-
|
|
280
|
-
get(params:
|
|
281
|
-
find(params?:
|
|
282
|
-
subscribe(params:
|
|
283
|
-
checkAccess(params:
|
|
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>;
|
|
304
|
+
checkContentAccess(params: ContactListContentAccessParams, options?: RequestOptions): Promise<ContactListContentAccessResponse>;
|
|
284
305
|
unsubscribe(token: string, options?: RequestOptions): Promise<{
|
|
285
|
-
|
|
306
|
+
success: boolean;
|
|
286
307
|
}>;
|
|
287
308
|
confirm(token: string, options?: RequestOptions): Promise<{
|
|
288
|
-
|
|
309
|
+
success: boolean;
|
|
289
310
|
}>;
|
|
290
311
|
};
|
|
291
312
|
};
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
track(params:
|
|
313
|
+
action: {
|
|
314
|
+
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"];
|
|
315
|
+
track(params: TrackActionParams): Promise<void>;
|
|
316
|
+
};
|
|
317
|
+
experiments: {
|
|
318
|
+
use(params: UseExperimentParams, options?: RequestOptions): Promise<ExperimentUseResponse>;
|
|
295
319
|
};
|
|
296
320
|
support: {
|
|
297
321
|
startConversation(params?: Omit<StartSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
@@ -304,7 +328,6 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
304
328
|
getMarket: () => string;
|
|
305
329
|
setLocale: (l: string) => void;
|
|
306
330
|
getLocale: () => string;
|
|
307
|
-
extractBlockValues: typeof extractBlockValues;
|
|
308
331
|
utils: {
|
|
309
332
|
getImageUrl: (imageBlock: any, isBlock?: boolean) => any;
|
|
310
333
|
getBlockValue: (entry: any, blockKey: string) => any;
|
|
@@ -349,7 +372,7 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
349
372
|
getFirstAvailableFCId: typeof getFirstAvailableFCId;
|
|
350
373
|
};
|
|
351
374
|
};
|
|
352
|
-
session: nanostores.PreinitializedWritableAtom<
|
|
375
|
+
session: nanostores.PreinitializedWritableAtom<ContactSession | null> & object;
|
|
353
376
|
market: nanostores.ReadableAtom<Market | null>;
|
|
354
377
|
market_key: nanostores.PreinitializedWritableAtom<string> & object;
|
|
355
378
|
locale: nanostores.PreinitializedWritableAtom<string> & object;
|
|
@@ -359,20 +382,65 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
359
382
|
provider: {} | null;
|
|
360
383
|
enabled: boolean;
|
|
361
384
|
}>;
|
|
362
|
-
|
|
363
|
-
|
|
385
|
+
cart: {
|
|
386
|
+
cart: nanostores.PreinitializedWritableAtom<Cart | null> & object;
|
|
387
|
+
product_items: nanostores.PreinitializedWritableAtom<EshopCartItem[]> & object;
|
|
388
|
+
service_items: nanostores.PreinitializedWritableAtom<ArkyServiceCartItem[]> & object;
|
|
389
|
+
quote_result: nanostores.PreinitializedWritableAtom<OrderQuote | null> & object;
|
|
390
|
+
promo_code: nanostores.PreinitializedWritableAtom<string | null> & object;
|
|
391
|
+
last_order: nanostores.PreinitializedWritableAtom<ArkyLastOrder | null> & object;
|
|
392
|
+
status: nanostores.PreinitializedMapStore<ArkyCartStatus> & object;
|
|
393
|
+
product_item_count: nanostores.ReadableAtom<number>;
|
|
394
|
+
service_item_count: nanostores.ReadableAtom<number>;
|
|
395
|
+
item_count: nanostores.ReadableAtom<number>;
|
|
396
|
+
snapshot: nanostores.ReadableAtom<{
|
|
397
|
+
cart: Cart | null;
|
|
398
|
+
product_items: EshopCartItem[];
|
|
399
|
+
service_items: ArkyServiceCartItem[];
|
|
400
|
+
item_count: number;
|
|
401
|
+
}>;
|
|
402
|
+
load: () => Promise<Cart>;
|
|
403
|
+
refresh: (input?: ArkyCartInput, writeRevision?: number) => Promise<Cart>;
|
|
404
|
+
addProduct: (product: Product, variant: ProductVariant, quantity?: number) => Promise<Cart>;
|
|
405
|
+
setProductQuantity: (itemId: string, quantity: number) => Promise<Cart>;
|
|
406
|
+
removeProduct: (itemId: string) => Promise<Cart | null>;
|
|
407
|
+
addServiceItem: (item: ArkyServiceCartItem) => Promise<Cart>;
|
|
408
|
+
removeServiceItem: (itemId: string) => Promise<Cart>;
|
|
409
|
+
clear: () => Promise<Cart | null>;
|
|
410
|
+
clearLocal: () => void;
|
|
411
|
+
quote: (input?: ArkyCartInput) => Promise<OrderQuote | null>;
|
|
412
|
+
checkout: (input?: ArkyCartInput) => Promise<OrderCheckoutResult>;
|
|
413
|
+
payment: {
|
|
414
|
+
controller: nanostores.PreinitializedWritableAtom<StripeConfirmationTokenController | null> & object;
|
|
415
|
+
ready: nanostores.ReadableAtom<boolean>;
|
|
416
|
+
setController: (controller: StripeConfirmationTokenController | null) => StripeConfirmationTokenController | null;
|
|
417
|
+
getController: () => StripeConfirmationTokenController | null;
|
|
418
|
+
mountStripe: (target: string | HTMLElement, options?: ArkyStripePaymentMountOptions) => Promise<StripeConfirmationTokenController>;
|
|
419
|
+
update: (input: {
|
|
420
|
+
amount?: number;
|
|
421
|
+
currency?: string;
|
|
422
|
+
}) => void;
|
|
423
|
+
destroy: () => void;
|
|
424
|
+
};
|
|
425
|
+
applyPromoCode(code: string, input?: Omit<ArkyCartInput, "promo_code">): Promise<OrderQuote | null>;
|
|
426
|
+
removePromoCode(input?: Omit<ArkyCartInput, "promo_code">): Promise<OrderQuote | null>;
|
|
427
|
+
selectShippingMethod(id: string | null): void;
|
|
428
|
+
locationToAddress: typeof locationToAddress;
|
|
429
|
+
buildItems: (input?: ArkyCartInput) => OrderCheckoutItemInput[];
|
|
430
|
+
buildProductItems: typeof toProductCheckoutItems;
|
|
431
|
+
buildServiceItems: typeof toServiceCheckoutItems;
|
|
432
|
+
};
|
|
364
433
|
identify: (params?: {
|
|
365
434
|
email?: string;
|
|
366
435
|
verify?: boolean;
|
|
367
436
|
market?: string;
|
|
368
|
-
}) => Promise<
|
|
437
|
+
}) => Promise<ContactSession>;
|
|
369
438
|
verify: (params: {
|
|
370
439
|
code: string;
|
|
371
|
-
}) => Promise<
|
|
372
|
-
me: () => Promise<
|
|
440
|
+
}) => Promise<ContactToken>;
|
|
441
|
+
me: () => Promise<ContactDetail>;
|
|
373
442
|
logout: () => Promise<void>;
|
|
374
|
-
onAuthStateChanged: (listener: AuthStateListener<
|
|
375
|
-
readonly currentSession: ProfileSession | null;
|
|
443
|
+
onAuthStateChanged: (listener: AuthStateListener<ContactSession>) => () => void;
|
|
376
444
|
readonly isAuthenticated: boolean;
|
|
377
445
|
setMarket: (key: string) => void;
|
|
378
446
|
setLocale: (value: string, options?: {
|
|
@@ -384,10 +452,12 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
384
452
|
getLocale: () => string;
|
|
385
453
|
cms: {
|
|
386
454
|
state: nanostores.PreinitializedMapStore<ArkyCmsState> & object;
|
|
387
|
-
|
|
388
|
-
get: (params:
|
|
389
|
-
|
|
390
|
-
|
|
455
|
+
collection: {
|
|
456
|
+
get: (params: GetCollectionParams, options?: RequestOptions) => Promise<Collection>;
|
|
457
|
+
};
|
|
458
|
+
entry: {
|
|
459
|
+
get: (params: ArkyCmsEntryParams, options?: RequestOptions) => Promise<CollectionEntry>;
|
|
460
|
+
find: (params: GetEntriesParams, options?: RequestOptions) => Promise<PaginatedResponse<CollectionEntry>>;
|
|
391
461
|
};
|
|
392
462
|
form: {
|
|
393
463
|
get: (params: {
|
|
@@ -466,6 +536,7 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
466
536
|
order: {
|
|
467
537
|
get(params: GetOrderParams, options?: RequestOptions): Promise<Order>;
|
|
468
538
|
find(params: GetOrdersParams, options?: RequestOptions): Promise<PaginatedResponse<Order>>;
|
|
539
|
+
downloadDigitalAccess(params: DownloadDigitalAccessParams, options?: RequestOptions): Promise<DigitalAccessDownloadResponse>;
|
|
469
540
|
};
|
|
470
541
|
cart: {
|
|
471
542
|
cart: nanostores.PreinitializedWritableAtom<Cart | null> & object;
|
|
@@ -484,30 +555,40 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
484
555
|
service_items: ArkyServiceCartItem[];
|
|
485
556
|
item_count: number;
|
|
486
557
|
}>;
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
ifRevision?: number;
|
|
490
|
-
}) => Promise<Cart>;
|
|
491
|
-
sync: (input?: ArkyCartInput, writeRevision?: number) => Promise<Cart>;
|
|
558
|
+
load: () => Promise<Cart>;
|
|
559
|
+
refresh: (input?: ArkyCartInput, writeRevision?: number) => Promise<Cart>;
|
|
492
560
|
addProduct: (product: Product, variant: ProductVariant, quantity?: number) => Promise<Cart>;
|
|
493
561
|
setProductQuantity: (itemId: string, quantity: number) => Promise<Cart>;
|
|
494
562
|
removeProduct: (itemId: string) => Promise<Cart | null>;
|
|
495
563
|
addServiceItem: (item: ArkyServiceCartItem) => Promise<Cart>;
|
|
496
564
|
removeServiceItem: (itemId: string) => Promise<Cart>;
|
|
497
565
|
clear: () => Promise<Cart | null>;
|
|
566
|
+
clearLocal: () => void;
|
|
498
567
|
quote: (input?: ArkyCartInput) => Promise<OrderQuote | null>;
|
|
499
568
|
checkout: (input?: ArkyCartInput) => Promise<OrderCheckoutResult>;
|
|
569
|
+
payment: {
|
|
570
|
+
controller: nanostores.PreinitializedWritableAtom<StripeConfirmationTokenController | null> & object;
|
|
571
|
+
ready: nanostores.ReadableAtom<boolean>;
|
|
572
|
+
setController: (controller: StripeConfirmationTokenController | null) => StripeConfirmationTokenController | null;
|
|
573
|
+
getController: () => StripeConfirmationTokenController | null;
|
|
574
|
+
mountStripe: (target: string | HTMLElement, options?: ArkyStripePaymentMountOptions) => Promise<StripeConfirmationTokenController>;
|
|
575
|
+
update: (input: {
|
|
576
|
+
amount?: number;
|
|
577
|
+
currency?: string;
|
|
578
|
+
}) => void;
|
|
579
|
+
destroy: () => void;
|
|
580
|
+
};
|
|
500
581
|
applyPromoCode(code: string, input?: Omit<ArkyCartInput, "promo_code">): Promise<OrderQuote | null>;
|
|
501
582
|
removePromoCode(input?: Omit<ArkyCartInput, "promo_code">): Promise<OrderQuote | null>;
|
|
502
583
|
selectShippingMethod(id: string | null): void;
|
|
503
584
|
locationToAddress: typeof locationToAddress;
|
|
504
|
-
buildItems: (input?: ArkyCartInput) =>
|
|
585
|
+
buildItems: (input?: ArkyCartInput) => OrderCheckoutItemInput[];
|
|
505
586
|
buildProductItems: typeof toProductCheckoutItems;
|
|
506
587
|
buildServiceItems: typeof toServiceCheckoutItems;
|
|
507
588
|
};
|
|
508
589
|
};
|
|
509
590
|
crm: {
|
|
510
|
-
|
|
591
|
+
contact: {
|
|
511
592
|
identify(params?: {
|
|
512
593
|
email?: string;
|
|
513
594
|
verify?: boolean;
|
|
@@ -517,25 +598,29 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
517
598
|
code: string;
|
|
518
599
|
}, options?: RequestOptions): Promise<VerifyResponse>;
|
|
519
600
|
logout(options?: RequestOptions): Promise<void>;
|
|
520
|
-
getMe(options?: RequestOptions): Promise<
|
|
601
|
+
getMe(options?: RequestOptions): Promise<ContactDetail>;
|
|
521
602
|
};
|
|
522
|
-
|
|
523
|
-
get(params:
|
|
524
|
-
find(params?:
|
|
525
|
-
subscribe(params:
|
|
526
|
-
checkAccess(params:
|
|
603
|
+
contactList: {
|
|
604
|
+
get(params: GetContactListParams, options?: RequestOptions): Promise<ContactList>;
|
|
605
|
+
find(params?: FindContactListsParams, options?: RequestOptions): Promise<PaginatedResponse<ContactList>>;
|
|
606
|
+
subscribe(params: SubscribeContactListParams, options?: RequestOptions): Promise<ContactListSubscribeResponse>;
|
|
607
|
+
checkAccess(params: ContactListAccessParams, options?: RequestOptions): Promise<ContactListAccessResponse>;
|
|
608
|
+
checkContentAccess(params: ContactListContentAccessParams, options?: RequestOptions): Promise<ContactListContentAccessResponse>;
|
|
527
609
|
unsubscribe(token: string, options?: RequestOptions): Promise<{
|
|
528
|
-
|
|
610
|
+
success: boolean;
|
|
529
611
|
}>;
|
|
530
612
|
confirm(token: string, options?: RequestOptions): Promise<{
|
|
531
|
-
|
|
613
|
+
success: boolean;
|
|
532
614
|
}>;
|
|
533
615
|
};
|
|
534
616
|
};
|
|
535
|
-
|
|
536
|
-
track(params:
|
|
617
|
+
action: {
|
|
618
|
+
track(params: TrackActionParams): Promise<void>;
|
|
537
619
|
pageView(payload?: Record<string, unknown>): Promise<void>;
|
|
538
|
-
state: nanostores.PreinitializedWritableAtom<
|
|
620
|
+
state: nanostores.PreinitializedWritableAtom<StorefrontAction | null> & object;
|
|
621
|
+
};
|
|
622
|
+
experiments: {
|
|
623
|
+
use: (params: string | UseExperimentParams) => Promise<ExperimentUseResponse>;
|
|
539
624
|
};
|
|
540
625
|
support: {
|
|
541
626
|
startConversation(params?: Omit<StartSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
@@ -617,8 +702,8 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
617
702
|
};
|
|
618
703
|
};
|
|
619
704
|
|
|
620
|
-
type ArkyStore = ReturnType<typeof
|
|
705
|
+
type ArkyStore = ReturnType<typeof initialize>;
|
|
621
706
|
type ArkyCartStore = ArkyStore["eshop"]["cart"];
|
|
622
707
|
type ArkyServiceStore = ArkyStore["eshop"]["service"];
|
|
623
708
|
|
|
624
|
-
export { type
|
|
709
|
+
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 };
|