arky-sdk 0.9.0 → 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-BKXmDIVk.d.ts +1396 -0
- package/dist/admin-CAwQrMOX.d.cts +1396 -0
- package/dist/admin.cjs +1239 -455
- 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 +1239 -455
- package/dist/admin.js.map +1 -1
- package/dist/api-DJI3S6XA.d.cts +4204 -0
- package/dist/api-DJI3S6XA.d.ts +4204 -0
- package/dist/{index-C5gikdBg.d.cts → index-BaSBPLdF.d.ts} +1 -1
- package/dist/{index-MFMjlIfS.d.ts → index-u-gjHnKs.d.cts} +1 -1
- package/dist/index.cjs +1360 -610
- 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 +1360 -610
- package/dist/index.js.map +1 -1
- package/dist/storefront.cjs +590 -382
- package/dist/storefront.cjs.map +1 -1
- package/dist/storefront.d.cts +182 -156
- package/dist/storefront.d.ts +182 -156
- package/dist/storefront.js +588 -381
- package/dist/storefront.js.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -2666
- package/dist/types.d.ts +1 -2666
- package/dist/types.js.map +1 -1
- package/dist/utils.d.cts +2 -2
- package/dist/utils.d.ts +2 -2
- package/package.json +9 -11
- package/scripts/contract-admin.mjs +137 -0
- package/scripts/contract-storefront.mjs +296 -0
- package/dist/admin-CfHen7c5.d.cts +0 -1036
- package/dist/admin-ru7pX5bd.d.ts +0 -1036
- package/dist/storefront-store.cjs +0 -2794
- 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 -2792
- 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-BKXmDIVk.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-BKXmDIVk.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 { Cart,
|
|
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-BaSBPLdF.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 ProductVariant, a9 as OrderCheckoutItemInput, aa as FormField } from './api-DJI3S6XA.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: CustomerSession | 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,59 +294,32 @@ 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:
|
|
284
|
-
id: string;
|
|
285
|
-
}, options?: RequestOptions): Promise<AudienceAccessResponse>;
|
|
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>;
|
|
286
304
|
unsubscribe(token: string, options?: RequestOptions): Promise<{
|
|
287
|
-
|
|
305
|
+
success: boolean;
|
|
288
306
|
}>;
|
|
289
307
|
confirm(token: string, options?: RequestOptions): Promise<{
|
|
290
|
-
|
|
308
|
+
success: boolean;
|
|
291
309
|
}>;
|
|
292
310
|
};
|
|
293
311
|
};
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
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>;
|
|
297
315
|
};
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
sendMessage(params: {
|
|
306
|
-
id: string;
|
|
307
|
-
message: string;
|
|
308
|
-
chat_id?: string;
|
|
309
|
-
store_id?: string;
|
|
310
|
-
}, options?: RequestOptions): Promise<AgentChatMessage>;
|
|
311
|
-
getChat(params: {
|
|
312
|
-
id: string;
|
|
313
|
-
chat_id: string;
|
|
314
|
-
store_id?: string;
|
|
315
|
-
}, options?: RequestOptions): Promise<AgentChat>;
|
|
316
|
-
getChatMessages(params: {
|
|
317
|
-
id: string;
|
|
318
|
-
chat_id: string;
|
|
319
|
-
limit?: number;
|
|
320
|
-
store_id?: string;
|
|
321
|
-
}, options?: RequestOptions): Promise<PaginatedResponse<AgentChatMessage>>;
|
|
322
|
-
rateChat(params: {
|
|
323
|
-
id: string;
|
|
324
|
-
chat_id: string;
|
|
325
|
-
rating: number;
|
|
326
|
-
comment?: string;
|
|
327
|
-
store_id?: string;
|
|
328
|
-
}, options?: RequestOptions): Promise<AgentChat>;
|
|
329
|
-
};
|
|
316
|
+
experiments: {
|
|
317
|
+
use(params: UseExperimentParams, options?: RequestOptions): Promise<ExperimentUseResponse>;
|
|
318
|
+
};
|
|
319
|
+
support: {
|
|
320
|
+
startConversation(params?: Omit<StartSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
321
|
+
sendMessage(params: Omit<SendSupportMessageParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
322
|
+
getConversation(params: Omit<GetSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
330
323
|
};
|
|
331
324
|
setStoreId: (storeId: string) => void;
|
|
332
325
|
getStoreId: () => string;
|
|
@@ -334,7 +327,6 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
334
327
|
getMarket: () => string;
|
|
335
328
|
setLocale: (l: string) => void;
|
|
336
329
|
getLocale: () => string;
|
|
337
|
-
extractBlockValues: typeof extractBlockValues;
|
|
338
330
|
utils: {
|
|
339
331
|
getImageUrl: (imageBlock: any, isBlock?: boolean) => any;
|
|
340
332
|
getBlockValue: (entry: any, blockKey: string) => any;
|
|
@@ -379,7 +371,7 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
379
371
|
getFirstAvailableFCId: typeof getFirstAvailableFCId;
|
|
380
372
|
};
|
|
381
373
|
};
|
|
382
|
-
session: nanostores.PreinitializedWritableAtom<
|
|
374
|
+
session: nanostores.PreinitializedWritableAtom<ContactSession | null> & object;
|
|
383
375
|
market: nanostores.ReadableAtom<Market | null>;
|
|
384
376
|
market_key: nanostores.PreinitializedWritableAtom<string> & object;
|
|
385
377
|
locale: nanostores.PreinitializedWritableAtom<string> & object;
|
|
@@ -389,34 +381,82 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
389
381
|
provider: {} | null;
|
|
390
382
|
enabled: boolean;
|
|
391
383
|
}>;
|
|
392
|
-
|
|
393
|
-
|
|
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
|
+
};
|
|
394
432
|
identify: (params?: {
|
|
395
433
|
email?: string;
|
|
396
434
|
verify?: boolean;
|
|
397
435
|
market?: string;
|
|
398
|
-
}) => Promise<
|
|
436
|
+
}) => Promise<ContactSession>;
|
|
399
437
|
verify: (params: {
|
|
400
438
|
code: string;
|
|
401
|
-
}) => Promise<
|
|
402
|
-
me: () => Promise<
|
|
439
|
+
}) => Promise<ContactToken>;
|
|
440
|
+
me: () => Promise<ContactDetail>;
|
|
403
441
|
logout: () => Promise<void>;
|
|
404
|
-
onAuthStateChanged: (listener: AuthStateListener<
|
|
405
|
-
readonly currentSession: CustomerSession | null;
|
|
442
|
+
onAuthStateChanged: (listener: AuthStateListener<ContactSession>) => () => void;
|
|
406
443
|
readonly isAuthenticated: boolean;
|
|
407
444
|
setMarket: (key: string) => void;
|
|
408
445
|
setLocale: (value: string, options?: {
|
|
409
446
|
market?: string;
|
|
410
447
|
}) => void;
|
|
411
448
|
setContext: (context: ArkyStoreContext) => void;
|
|
449
|
+
getStoreId: () => string;
|
|
412
450
|
getMarket: () => string;
|
|
413
451
|
getLocale: () => string;
|
|
414
452
|
cms: {
|
|
415
453
|
state: nanostores.PreinitializedMapStore<ArkyCmsState> & object;
|
|
416
|
-
|
|
417
|
-
get: (params:
|
|
418
|
-
|
|
419
|
-
|
|
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>>;
|
|
420
460
|
};
|
|
421
461
|
form: {
|
|
422
462
|
get: (params: {
|
|
@@ -495,6 +535,7 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
495
535
|
order: {
|
|
496
536
|
get(params: GetOrderParams, options?: RequestOptions): Promise<Order>;
|
|
497
537
|
find(params: GetOrdersParams, options?: RequestOptions): Promise<PaginatedResponse<Order>>;
|
|
538
|
+
downloadDigitalAccess(params: DownloadDigitalAccessParams, options?: RequestOptions): Promise<DigitalAccessDownloadResponse>;
|
|
498
539
|
};
|
|
499
540
|
cart: {
|
|
500
541
|
cart: nanostores.PreinitializedWritableAtom<Cart | null> & object;
|
|
@@ -513,28 +554,40 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
513
554
|
service_items: ArkyServiceCartItem[];
|
|
514
555
|
item_count: number;
|
|
515
556
|
}>;
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
sync: (input?: ArkyCartInput) => Promise<Cart>;
|
|
557
|
+
load: () => Promise<Cart>;
|
|
558
|
+
refresh: (input?: ArkyCartInput, writeRevision?: number) => Promise<Cart>;
|
|
519
559
|
addProduct: (product: Product, variant: ProductVariant, quantity?: number) => Promise<Cart>;
|
|
520
560
|
setProductQuantity: (itemId: string, quantity: number) => Promise<Cart>;
|
|
521
561
|
removeProduct: (itemId: string) => Promise<Cart | null>;
|
|
522
562
|
addServiceItem: (item: ArkyServiceCartItem) => Promise<Cart>;
|
|
523
563
|
removeServiceItem: (itemId: string) => Promise<Cart>;
|
|
524
564
|
clear: () => Promise<Cart | null>;
|
|
565
|
+
clearLocal: () => void;
|
|
525
566
|
quote: (input?: ArkyCartInput) => Promise<OrderQuote | null>;
|
|
526
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
|
+
};
|
|
527
580
|
applyPromoCode(code: string, input?: Omit<ArkyCartInput, "promo_code">): Promise<OrderQuote | null>;
|
|
528
581
|
removePromoCode(input?: Omit<ArkyCartInput, "promo_code">): Promise<OrderQuote | null>;
|
|
529
582
|
selectShippingMethod(id: string | null): void;
|
|
530
583
|
locationToAddress: typeof locationToAddress;
|
|
531
|
-
buildItems: (input?: ArkyCartInput) =>
|
|
584
|
+
buildItems: (input?: ArkyCartInput) => OrderCheckoutItemInput[];
|
|
532
585
|
buildProductItems: typeof toProductCheckoutItems;
|
|
533
586
|
buildServiceItems: typeof toServiceCheckoutItems;
|
|
534
587
|
};
|
|
535
588
|
};
|
|
536
589
|
crm: {
|
|
537
|
-
|
|
590
|
+
contact: {
|
|
538
591
|
identify(params?: {
|
|
539
592
|
email?: string;
|
|
540
593
|
verify?: boolean;
|
|
@@ -544,27 +597,33 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
544
597
|
code: string;
|
|
545
598
|
}, options?: RequestOptions): Promise<VerifyResponse>;
|
|
546
599
|
logout(options?: RequestOptions): Promise<void>;
|
|
547
|
-
getMe(options?: RequestOptions): Promise<
|
|
600
|
+
getMe(options?: RequestOptions): Promise<ContactDetail>;
|
|
548
601
|
};
|
|
549
|
-
|
|
550
|
-
get(params:
|
|
551
|
-
find(params
|
|
552
|
-
subscribe(params:
|
|
553
|
-
checkAccess(params:
|
|
554
|
-
id: string;
|
|
555
|
-
}, options?: RequestOptions): Promise<AudienceAccessResponse>;
|
|
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>;
|
|
556
607
|
unsubscribe(token: string, options?: RequestOptions): Promise<{
|
|
557
|
-
|
|
608
|
+
success: boolean;
|
|
558
609
|
}>;
|
|
559
610
|
confirm(token: string, options?: RequestOptions): Promise<{
|
|
560
|
-
|
|
611
|
+
success: boolean;
|
|
561
612
|
}>;
|
|
562
613
|
};
|
|
563
614
|
};
|
|
564
|
-
|
|
565
|
-
track(params:
|
|
615
|
+
action: {
|
|
616
|
+
track(params: TrackActionParams): Promise<void>;
|
|
566
617
|
pageView(payload?: Record<string, unknown>): Promise<void>;
|
|
567
|
-
state: nanostores.PreinitializedWritableAtom<
|
|
618
|
+
state: nanostores.PreinitializedWritableAtom<StorefrontAction | null> & object;
|
|
619
|
+
};
|
|
620
|
+
experiments: {
|
|
621
|
+
use: (params: string | UseExperimentParams) => Promise<ExperimentUseResponse>;
|
|
622
|
+
};
|
|
623
|
+
support: {
|
|
624
|
+
startConversation(params?: Omit<StartSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
625
|
+
sendMessage(params: Omit<SendSupportMessageParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
626
|
+
getConversation(params: Omit<GetSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
568
627
|
};
|
|
569
628
|
store: {
|
|
570
629
|
getStore(options?: RequestOptions): Promise<Store>;
|
|
@@ -596,39 +655,6 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
596
655
|
get(id: string, options?: RequestOptions): Promise<Market>;
|
|
597
656
|
};
|
|
598
657
|
};
|
|
599
|
-
automation: {
|
|
600
|
-
agent: {
|
|
601
|
-
getAgents(params?: GetAgentsParams, options?: RequestOptions): Promise<PaginatedResponse<Agent>>;
|
|
602
|
-
getAgent(params: {
|
|
603
|
-
id: string;
|
|
604
|
-
store_id?: string;
|
|
605
|
-
}, options?: RequestOptions): Promise<Agent>;
|
|
606
|
-
sendMessage(params: {
|
|
607
|
-
id: string;
|
|
608
|
-
message: string;
|
|
609
|
-
chat_id?: string;
|
|
610
|
-
store_id?: string;
|
|
611
|
-
}, options?: RequestOptions): Promise<AgentChatMessage>;
|
|
612
|
-
getChat(params: {
|
|
613
|
-
id: string;
|
|
614
|
-
chat_id: string;
|
|
615
|
-
store_id?: string;
|
|
616
|
-
}, options?: RequestOptions): Promise<AgentChat>;
|
|
617
|
-
getChatMessages(params: {
|
|
618
|
-
id: string;
|
|
619
|
-
chat_id: string;
|
|
620
|
-
limit?: number;
|
|
621
|
-
store_id?: string;
|
|
622
|
-
}, options?: RequestOptions): Promise<PaginatedResponse<AgentChatMessage>>;
|
|
623
|
-
rateChat(params: {
|
|
624
|
-
id: string;
|
|
625
|
-
chat_id: string;
|
|
626
|
-
rating: number;
|
|
627
|
-
comment?: string;
|
|
628
|
-
store_id?: string;
|
|
629
|
-
}, options?: RequestOptions): Promise<AgentChat>;
|
|
630
|
-
};
|
|
631
|
-
};
|
|
632
658
|
utils: {
|
|
633
659
|
getImageUrl: (imageBlock: any, isBlock?: boolean) => any;
|
|
634
660
|
getBlockValue: (entry: any, blockKey: string) => any;
|
|
@@ -674,8 +700,8 @@ declare function createArkyStore(config: ArkyStoreConfig): {
|
|
|
674
700
|
};
|
|
675
701
|
};
|
|
676
702
|
|
|
677
|
-
type ArkyStore = ReturnType<typeof
|
|
703
|
+
type ArkyStore = ReturnType<typeof initialize>;
|
|
678
704
|
type ArkyCartStore = ArkyStore["eshop"]["cart"];
|
|
679
705
|
type ArkyServiceStore = ArkyStore["eshop"]["service"];
|
|
680
706
|
|
|
681
|
-
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 };
|