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.
- package/README.md +113 -194
- package/dist/{admin-DjYydKeB.d.ts → admin-BKXmDIVk.d.ts} +412 -405
- package/dist/{admin-DlL8mCxL.d.cts → admin-CAwQrMOX.d.cts} +412 -405
- package/dist/admin.cjs +767 -373
- 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 +767 -373
- package/dist/admin.js.map +1 -1
- package/dist/{api-BbBHcd4p.d.cts → api-DJI3S6XA.d.cts} +1440 -525
- package/dist/{api-BbBHcd4p.d.ts → api-DJI3S6XA.d.ts} +1440 -525
- package/dist/{index-CZxubTDA.d.ts → index-BaSBPLdF.d.ts} +1 -1
- package/dist/{index-nCF3Z6Af.d.cts → index-u-gjHnKs.d.cts} +1 -1
- package/dist/index.cjs +874 -471
- 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 +874 -471
- package/dist/index.js.map +1 -1
- package/dist/storefront.cjs +493 -300
- package/dist/storefront.cjs.map +1 -1
- package/dist/storefront.d.cts +172 -89
- package/dist/storefront.d.ts +172 -89
- package/dist/storefront.js +491 -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/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.cts
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-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-
|
|
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-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
|
-
|
|
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,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<
|
|
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>;
|
|
284
304
|
unsubscribe(token: string, options?: RequestOptions): Promise<{
|
|
285
|
-
|
|
305
|
+
success: boolean;
|
|
286
306
|
}>;
|
|
287
307
|
confirm(token: string, options?: RequestOptions): Promise<{
|
|
288
|
-
|
|
308
|
+
success: boolean;
|
|
289
309
|
}>;
|
|
290
310
|
};
|
|
291
311
|
};
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
track(params:
|
|
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<
|
|
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
|
-
|
|
363
|
-
|
|
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<
|
|
436
|
+
}) => Promise<ContactSession>;
|
|
369
437
|
verify: (params: {
|
|
370
438
|
code: string;
|
|
371
|
-
}) => Promise<
|
|
372
|
-
me: () => Promise<
|
|
439
|
+
}) => Promise<ContactToken>;
|
|
440
|
+
me: () => Promise<ContactDetail>;
|
|
373
441
|
logout: () => Promise<void>;
|
|
374
|
-
onAuthStateChanged: (listener: AuthStateListener<
|
|
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
|
-
|
|
388
|
-
get: (params:
|
|
389
|
-
|
|
390
|
-
|
|
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
|
-
|
|
488
|
-
|
|
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) =>
|
|
584
|
+
buildItems: (input?: ArkyCartInput) => OrderCheckoutItemInput[];
|
|
505
585
|
buildProductItems: typeof toProductCheckoutItems;
|
|
506
586
|
buildServiceItems: typeof toServiceCheckoutItems;
|
|
507
587
|
};
|
|
508
588
|
};
|
|
509
589
|
crm: {
|
|
510
|
-
|
|
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<
|
|
600
|
+
getMe(options?: RequestOptions): Promise<ContactDetail>;
|
|
521
601
|
};
|
|
522
|
-
|
|
523
|
-
get(params:
|
|
524
|
-
find(params?:
|
|
525
|
-
subscribe(params:
|
|
526
|
-
checkAccess(params:
|
|
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
|
-
|
|
608
|
+
success: boolean;
|
|
529
609
|
}>;
|
|
530
610
|
confirm(token: string, options?: RequestOptions): Promise<{
|
|
531
|
-
|
|
611
|
+
success: boolean;
|
|
532
612
|
}>;
|
|
533
613
|
};
|
|
534
614
|
};
|
|
535
|
-
|
|
536
|
-
track(params:
|
|
615
|
+
action: {
|
|
616
|
+
track(params: TrackActionParams): Promise<void>;
|
|
537
617
|
pageView(payload?: Record<string, unknown>): Promise<void>;
|
|
538
|
-
state: nanostores.PreinitializedWritableAtom<
|
|
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
|
|
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
|
|
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 };
|