arky-sdk 0.9.13 → 0.9.16
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 +16 -12
- package/dist/admin-C-ZTxvz3.d.ts +1544 -0
- package/dist/admin-Dm2WRN6q.d.cts +1544 -0
- package/dist/admin.cjs +982 -425
- 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 +982 -425
- package/dist/admin.js.map +1 -1
- package/dist/{api-DvsFdOaF.d.cts → api-D37IpMSq.d.cts} +1417 -665
- package/dist/{api-DvsFdOaF.d.ts → api-D37IpMSq.d.ts} +1417 -665
- package/dist/index.cjs +1317 -539
- 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 +1317 -539
- package/dist/index.js.map +1 -1
- package/dist/{index-CQd9b_7n.d.ts → inventory-DdN96PX3.d.cts} +6 -4
- package/dist/{index-BC06yiuv.d.cts → inventory-Dh1RevEb.d.ts} +6 -4
- package/dist/storefront.cjs +1210 -658
- package/dist/storefront.cjs.map +1 -1
- package/dist/storefront.d.cts +88 -285
- package/dist/storefront.d.ts +88 -285
- package/dist/storefront.js +1207 -659
- 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.cjs +198 -16
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.cts +18 -2
- package/dist/utils.d.ts +18 -2
- package/dist/utils.js +191 -17
- package/dist/utils.js.map +1 -1
- package/package.json +4 -5
- package/dist/admin-Q9MBFwCb.d.cts +0 -1496
- package/dist/admin-ZLXD4_en.d.ts +0 -1496
- package/scripts/contract-admin.mjs +0 -120
- package/scripts/contract-storefront.mjs +0 -296
package/dist/storefront.d.cts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { C as CreateStorefrontConfig, a as ContactSession, b as
|
|
2
|
-
export {
|
|
1
|
+
import { C as CreateStorefrontConfig, S as StorefrontClient, a as ContactSession, b as StorefrontIdentifyResult, V as VerifyResponse, A as AuthStateListener, I as IdentifyResponse, T as TrackActionParams, c as StorefrontAction, U as UseExperimentParams, E as ExperimentUseResponse, d as StartSupportConversationParams, e as SupportConversationStartResponse, f as StorefrontSendSupportMessageParams, g as SupportConversationResponse, h as StorefrontGetSupportConversationParams, i as getBlockValue, j as getBlockTextValue, k as getBlockContentValue, l as getBlockValues, m as getBlockLabel, n as getBlockObjectValues, o as getBlockFromArray, p as formatBlockValue, q as prepareBlocksForSubmission, r as extractBlockValues, v as validatePhoneNumber, s as findTimeZone, t as slugify, u as humanize, w as categorify, x as formatDate, y as getSvgContentForAstro, z as fetchSvgContent, B as injectSvgIntoElement } from './admin-Dm2WRN6q.cjs';
|
|
2
|
+
export { D as COMMON_ACTION_KEYS, J as CartApi, K as CartController, L as CartControllerAddItemParams, M as CartControllerCheckoutParams, N as CartControllerClearParams, O as CartControllerInitParams, P as CartControllerListener, Q as CartControllerQuoteParams, R as CartControllerRefreshParams, W as CartControllerRemoveItemParams, X as CartControllerState, Y as CartControllerUpdateParams, H as CommonActionKey, Z as StorefrontSessionStorage, G as createCartController, F as createStorefront } from './admin-Dm2WRN6q.cjs';
|
|
3
|
+
import { m as formatPayment, f as formatMinor, g as getCurrencySymbol, a as getCurrencyName, i as isValidKey, v as validateKey, t as toKey, n as nameToKey, e as getAvailableStock, h as getReservedStock, j as hasStock, k as getInventoryAt, l as getFirstAvailableFCId } from './inventory-DdN96PX3.cjs';
|
|
4
|
+
import { C as CollectionEntry, F as Form, a as FormValues, P as Product, S as Service, b as Provider, A as AvailabilityResponse, c as ServiceProvider, B as Block, d as OrderQuote, e as Currency, f as PaymentMethod, g as SlotRange, h as FormEntry, i as Price, j as OrderCheckoutResult, E as EshopCartItem, k as Address, l as Cart, m as FormSchema, n as FormField, Z as ZoneLocation, o as ProductCheckoutItemInput, p as ServiceCheckoutItemInput, M as Market, q as PaymentStoreConfig, r as Contact, G as GetCollectionParams, R as RequestOptions, s as Collection, t as GetEntriesParams, u as PaginatedResponse, v as GetFormParams, w as SubmitFormParams, x as FormSubmission, y as GetTaxonomyParams, T as Taxonomy, z as GetTaxonomyChildrenParams, D as GetProductParams, H as GetProductsParams, J as GetServiceParams, K as GetServicesParams, L as FindServiceProvidersParams, N as GetAvailabilityParams, Q as GetProviderParams, U as GetProvidersParams, V as GetOrderParams, W as Order, X as GetOrdersParams, Y as DownloadDigitalAccessParams, _ as DigitalAccessDownloadResponse, $ as FindDigitalAccessGrantsParams, a0 as DigitalAccessGrant, a1 as GetDigitalAccessGrantParams, a2 as ProductVariant, a3 as OrderCheckoutItemInput, a4 as GetContactListParams, a5 as StorefrontContactList, a6 as FindStorefrontContactListsParams, a7 as FindStorefrontContactListPlansParams, a8 as StorefrontContactListPlan, a9 as FindStorefrontContactListMembershipsParams, aa as StorefrontContactListMembership, ab as SubscribeContactListParams, ac as ContactListSubscribeResponse, ad as ContactListAccessParams, ae as ContactListAccessResponse, af as ContactListContentAccessParams, ag as ContactListContentAccessResponse, ah as ContactListManagementResponse, ai as Store, aj as Location } from './api-D37IpMSq.cjs';
|
|
5
|
+
export { am as AuthStorage, ak as FormValue, al as HttpClientConfig } from './api-D37IpMSq.cjs';
|
|
3
6
|
import * as nanostores from 'nanostores';
|
|
4
|
-
import {
|
|
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-DvsFdOaF.cjs';
|
|
6
|
-
import { StripeElementsOptions } from '@stripe/stripe-js';
|
|
7
|
+
import { StripeElementsOptions, Stripe } from '@stripe/stripe-js';
|
|
7
8
|
|
|
8
9
|
interface StripeConfirmationTokenControllerConfig {
|
|
9
10
|
publishableKey: string;
|
|
11
|
+
connectedAccountId?: string;
|
|
10
12
|
amount: number;
|
|
11
13
|
currency: string;
|
|
12
14
|
appearance?: StripeElementsOptions["appearance"];
|
|
@@ -33,7 +35,10 @@ interface StripeConfirmationTokenController {
|
|
|
33
35
|
handleNextAction(clientSecret: string): Promise<void>;
|
|
34
36
|
destroy(): void;
|
|
35
37
|
}
|
|
36
|
-
|
|
38
|
+
type StripeLoader = (publishableKey: string, options?: {
|
|
39
|
+
stripeAccount: string;
|
|
40
|
+
}) => PromiseLike<Stripe | null>;
|
|
41
|
+
declare function createStripeConfirmationTokenController(config: StripeConfirmationTokenControllerConfig, stripeLoader?: StripeLoader): Promise<StripeConfirmationTokenController>;
|
|
37
42
|
|
|
38
43
|
type ArkyPaymentController = StripeConfirmationTokenController;
|
|
39
44
|
type ArkyStripePaymentMountOptions = Partial<StripeConfirmationTokenControllerConfig>;
|
|
@@ -50,13 +55,17 @@ type ArkyCmsEntryParams = ArkyStoreContext & {
|
|
|
50
55
|
key?: string;
|
|
51
56
|
store_id?: string;
|
|
52
57
|
};
|
|
58
|
+
interface ArkySubmitFormByKeyParams {
|
|
59
|
+
key: string;
|
|
60
|
+
store_id?: string;
|
|
61
|
+
values: FormValues;
|
|
62
|
+
}
|
|
53
63
|
interface ArkyServiceCartItem {
|
|
54
64
|
id: string;
|
|
55
65
|
service_id: string;
|
|
56
66
|
provider_id: string;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
forms?: FormEntry[];
|
|
67
|
+
slots: SlotRange[];
|
|
68
|
+
forms: FormEntry[];
|
|
60
69
|
price?: Price;
|
|
61
70
|
service_name?: string;
|
|
62
71
|
provider_name?: string;
|
|
@@ -99,7 +108,7 @@ interface ArkyCartInput {
|
|
|
99
108
|
service_items?: ArkyServiceCartItem[];
|
|
100
109
|
shipping_address?: Address | null;
|
|
101
110
|
billing_address?: Address | null;
|
|
102
|
-
forms?: FormEntry[]
|
|
111
|
+
forms?: FormEntry[];
|
|
103
112
|
promo_code?: string | null;
|
|
104
113
|
payment_method_key?: string | null;
|
|
105
114
|
shipping_method_id?: string | null;
|
|
@@ -154,19 +163,27 @@ interface ArkyServiceSlot {
|
|
|
154
163
|
date?: string;
|
|
155
164
|
serviceBlocks?: Block[];
|
|
156
165
|
}
|
|
166
|
+
interface ArkyServiceFormGroup {
|
|
167
|
+
form: Form;
|
|
168
|
+
blocks: Block[];
|
|
169
|
+
}
|
|
170
|
+
interface ArkyServiceFormState {
|
|
171
|
+
provider_id: string | null;
|
|
172
|
+
groups: ArkyServiceFormGroup[];
|
|
173
|
+
loading: boolean;
|
|
174
|
+
error: string | null;
|
|
175
|
+
}
|
|
157
176
|
interface ArkyServiceState {
|
|
158
177
|
service: Service | null;
|
|
159
178
|
availability: AvailabilityResponse | null;
|
|
160
179
|
providers: Provider[];
|
|
180
|
+
serviceProviders: ServiceProvider[];
|
|
161
181
|
selectedProviderId: string | null;
|
|
162
182
|
currentMonth: Date;
|
|
163
183
|
calendar: ArkyCalendarDay[];
|
|
164
184
|
selectedDate: string | null;
|
|
165
|
-
startDate: string | null;
|
|
166
|
-
endDate: string | null;
|
|
167
185
|
slots: ArkyServiceSlot[];
|
|
168
186
|
selectedSlot: ArkyServiceSlot | null;
|
|
169
|
-
cart: ArkyServiceSlot[];
|
|
170
187
|
timezone: string;
|
|
171
188
|
tzGroups: Record<string, {
|
|
172
189
|
zone: string;
|
|
@@ -177,268 +194,43 @@ interface ArkyServiceState {
|
|
|
177
194
|
quote: OrderQuote | null;
|
|
178
195
|
fetchingQuote: boolean;
|
|
179
196
|
quoteError: string | null;
|
|
180
|
-
currency:
|
|
197
|
+
currency: Currency | null;
|
|
181
198
|
dateTimeConfirmed: boolean;
|
|
182
|
-
isMultiDay: boolean;
|
|
183
199
|
availablePaymentMethods: PaymentMethod[];
|
|
184
200
|
cartId: string | null;
|
|
185
201
|
promoCode: string | null;
|
|
186
202
|
}
|
|
187
203
|
|
|
188
204
|
declare function locationToAddress(location: ZoneLocation): Address;
|
|
205
|
+
declare function createFormEntry(formId: string, fields: FormField[]): FormEntry;
|
|
189
206
|
declare function toProductCheckoutItems(items: EshopCartItem[]): ProductCheckoutItemInput[];
|
|
190
207
|
declare function toServiceCheckoutItems(items: ArkyServiceCartItem[]): ServiceCheckoutItemInput[];
|
|
208
|
+
declare function buildFormFields(schema: FormSchema[], values: FormValues): FormField[];
|
|
209
|
+
declare function createFormEntryFromValues(form: Pick<Form, "id" | "schema">, values: FormValues): FormEntry;
|
|
191
210
|
|
|
192
|
-
declare function
|
|
193
|
-
client:
|
|
194
|
-
identify: (params?: {
|
|
195
|
-
email?: string;
|
|
196
|
-
verify?: boolean;
|
|
197
|
-
market?: string;
|
|
198
|
-
}) => Promise<ContactSession>;
|
|
199
|
-
verify: (params: {
|
|
200
|
-
code: string;
|
|
201
|
-
}) => Promise<ContactToken>;
|
|
202
|
-
logout: () => Promise<void>;
|
|
203
|
-
me: () => Promise<ContactDetail>;
|
|
204
|
-
readonly session: ContactSession | null;
|
|
205
|
-
readonly isAuthenticated: boolean;
|
|
206
|
-
onAuthStateChanged(listener: AuthStateListener<ContactSession>): () => void;
|
|
207
|
-
store: {
|
|
208
|
-
getStore(options?: RequestOptions): Promise<Store>;
|
|
209
|
-
location: {
|
|
210
|
-
getCountries(options?: RequestOptions): Promise<{
|
|
211
|
-
items: {
|
|
212
|
-
code: string;
|
|
213
|
-
name: string;
|
|
214
|
-
states: {
|
|
215
|
-
code: string;
|
|
216
|
-
name: string;
|
|
217
|
-
}[];
|
|
218
|
-
}[];
|
|
219
|
-
cursor: string | null;
|
|
220
|
-
}>;
|
|
221
|
-
getCountry(countryCode: string, options?: RequestOptions): Promise<{
|
|
222
|
-
code: string;
|
|
223
|
-
name: string;
|
|
224
|
-
states: {
|
|
225
|
-
code: string;
|
|
226
|
-
name: string;
|
|
227
|
-
}[];
|
|
228
|
-
}>;
|
|
229
|
-
list(options?: RequestOptions): Promise<Location[]>;
|
|
230
|
-
get(id: string, options?: RequestOptions): Promise<Location>;
|
|
231
|
-
};
|
|
232
|
-
market: {
|
|
233
|
-
list(options?: RequestOptions): Promise<Market[]>;
|
|
234
|
-
get(id: string, options?: RequestOptions): Promise<Market>;
|
|
235
|
-
};
|
|
236
|
-
};
|
|
237
|
-
cart: CartController;
|
|
238
|
-
cms: {
|
|
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>>;
|
|
245
|
-
};
|
|
246
|
-
form: {
|
|
247
|
-
get(params: GetFormParams, options?: RequestOptions): Promise<Form>;
|
|
248
|
-
submit(params: SubmitFormParams, options?: RequestOptions): Promise<FormSubmission>;
|
|
249
|
-
};
|
|
250
|
-
taxonomy: {
|
|
251
|
-
get(params: GetTaxonomyParams, options?: RequestOptions): Promise<Taxonomy>;
|
|
252
|
-
getChildren(params: GetTaxonomyChildrenParams, options?: RequestOptions): Promise<PaginatedResponse<Taxonomy>>;
|
|
253
|
-
};
|
|
254
|
-
};
|
|
255
|
-
eshop: {
|
|
256
|
-
product: {
|
|
257
|
-
get(params: GetProductParams, options?: RequestOptions): Promise<Product>;
|
|
258
|
-
find(params: GetProductsParams, options?: RequestOptions): Promise<PaginatedResponse<Product>>;
|
|
259
|
-
};
|
|
260
|
-
cart: {
|
|
261
|
-
current(params?: GetCurrentCartParams, options?: RequestOptions): Promise<Cart>;
|
|
262
|
-
get(params: GetCartParams, options?: RequestOptions): Promise<Cart>;
|
|
263
|
-
update(params: UpdateCartParams, options?: RequestOptions): Promise<Cart>;
|
|
264
|
-
addItem(params: AddCartItemParams, options?: RequestOptions): Promise<Cart>;
|
|
265
|
-
removeItem(params: RemoveCartItemParams, options?: RequestOptions): Promise<Cart>;
|
|
266
|
-
clear(params: ClearCartParams, options?: RequestOptions): Promise<Cart>;
|
|
267
|
-
quote(params: QuoteCartParams, options?: RequestOptions): Promise<OrderQuote>;
|
|
268
|
-
checkout(params: CheckoutCartParams, options?: RequestOptions): Promise<OrderCheckoutResult>;
|
|
269
|
-
};
|
|
270
|
-
order: {
|
|
271
|
-
get(params: GetOrderParams, options?: RequestOptions): Promise<Order>;
|
|
272
|
-
find(params: GetOrdersParams, options?: RequestOptions): Promise<PaginatedResponse<Order>>;
|
|
273
|
-
downloadDigitalAccess(params: DownloadDigitalAccessParams, options?: RequestOptions): Promise<DigitalAccessDownloadResponse>;
|
|
274
|
-
};
|
|
275
|
-
service: {
|
|
276
|
-
get(params: GetServiceParams, options?: RequestOptions): Promise<Service>;
|
|
277
|
-
find(params: GetServicesParams, options?: RequestOptions): Promise<PaginatedResponse<Service>>;
|
|
278
|
-
findProviders(params: FindServiceProvidersParams, options?: RequestOptions): Promise<Provider[]>;
|
|
279
|
-
getAvailability(params: GetAvailabilityParams, options?: RequestOptions): Promise<AvailabilityResponse>;
|
|
280
|
-
};
|
|
281
|
-
provider: {
|
|
282
|
-
get(params: GetProviderParams, options?: RequestOptions): Promise<Provider>;
|
|
283
|
-
find(params: GetProvidersParams, options?: RequestOptions): Promise<PaginatedResponse<Provider>>;
|
|
284
|
-
};
|
|
285
|
-
};
|
|
286
|
-
crm: {
|
|
287
|
-
contact: {
|
|
288
|
-
identify(params?: {
|
|
289
|
-
email?: string;
|
|
290
|
-
verify?: boolean;
|
|
291
|
-
market?: string;
|
|
292
|
-
}, options?: RequestOptions): Promise<IdentifyResponse>;
|
|
293
|
-
verify(params: {
|
|
294
|
-
code: string;
|
|
295
|
-
}, options?: RequestOptions): Promise<VerifyResponse>;
|
|
296
|
-
logout(options?: RequestOptions): Promise<void>;
|
|
297
|
-
getMe(options?: RequestOptions): Promise<ContactDetail>;
|
|
298
|
-
};
|
|
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>;
|
|
305
|
-
unsubscribe(token: string, options?: RequestOptions): Promise<{
|
|
306
|
-
success: boolean;
|
|
307
|
-
}>;
|
|
308
|
-
confirm(token: string, options?: RequestOptions): Promise<{
|
|
309
|
-
success: boolean;
|
|
310
|
-
}>;
|
|
311
|
-
};
|
|
312
|
-
};
|
|
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>;
|
|
319
|
-
};
|
|
320
|
-
support: {
|
|
321
|
-
startConversation(params?: Omit<StartSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
322
|
-
sendMessage(params: Omit<SendSupportMessageParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
323
|
-
getConversation(params: Omit<GetSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
324
|
-
};
|
|
325
|
-
setStoreId: (storeId: string) => void;
|
|
326
|
-
getStoreId: () => string;
|
|
327
|
-
setMarket: (key: string) => void;
|
|
328
|
-
getMarket: () => string;
|
|
329
|
-
setLocale: (l: string) => void;
|
|
330
|
-
getLocale: () => string;
|
|
331
|
-
utils: {
|
|
332
|
-
getImageUrl: (imageBlock: any, isBlock?: boolean) => any;
|
|
333
|
-
getBlockValue: (entry: any, blockKey: string) => any;
|
|
334
|
-
getBlockTextValue: (block: any, locale?: string) => string;
|
|
335
|
-
getBlockValues: (entry: any, blockKey: string) => any;
|
|
336
|
-
getBlockLabel: typeof getBlockLabel;
|
|
337
|
-
getBlockObjectValues: (entry: any, blockKey: string, locale?: string) => any;
|
|
338
|
-
getBlockFromArray: (entry: any, blockKey: string, locale?: string) => any;
|
|
339
|
-
formatBlockValue: typeof formatBlockValue;
|
|
340
|
-
prepareBlocksForSubmission: typeof prepareBlocksForSubmission;
|
|
341
|
-
extractBlockValues: typeof extractBlockValues;
|
|
342
|
-
formatPrice: (prices: any[]) => string;
|
|
343
|
-
getPriceAmount: (prices: any[]) => number;
|
|
344
|
-
formatPayment: typeof formatPayment;
|
|
345
|
-
formatMinor: typeof formatMinor;
|
|
346
|
-
getCurrencySymbol: typeof getCurrencySymbol;
|
|
347
|
-
getCurrencyName: typeof getCurrencyName;
|
|
348
|
-
validatePhoneNumber: typeof validatePhoneNumber;
|
|
349
|
-
tzGroups: {
|
|
350
|
-
label: string;
|
|
351
|
-
zones: {
|
|
352
|
-
label: string;
|
|
353
|
-
value: string;
|
|
354
|
-
}[];
|
|
355
|
-
}[];
|
|
356
|
-
findTimeZone: typeof findTimeZone;
|
|
357
|
-
slugify: typeof slugify;
|
|
358
|
-
humanize: typeof humanize;
|
|
359
|
-
categorify: typeof categorify;
|
|
360
|
-
formatDate: typeof formatDate;
|
|
361
|
-
getSvgContentForAstro: typeof getSvgContentForAstro;
|
|
362
|
-
fetchSvgContent: typeof fetchSvgContent;
|
|
363
|
-
injectSvgIntoElement: typeof injectSvgIntoElement;
|
|
364
|
-
isValidKey: typeof isValidKey;
|
|
365
|
-
validateKey: typeof validateKey;
|
|
366
|
-
toKey: typeof toKey;
|
|
367
|
-
nameToKey: typeof nameToKey;
|
|
368
|
-
getAvailableStock: typeof getAvailableStock;
|
|
369
|
-
getReservedStock: typeof getReservedStock;
|
|
370
|
-
hasStock: typeof hasStock;
|
|
371
|
-
getInventoryAt: typeof getInventoryAt;
|
|
372
|
-
getFirstAvailableFCId: typeof getFirstAvailableFCId;
|
|
373
|
-
};
|
|
374
|
-
};
|
|
211
|
+
declare function initializeStore(config: ArkyStoreConfig): {
|
|
212
|
+
client: StorefrontClient;
|
|
375
213
|
session: nanostores.PreinitializedWritableAtom<ContactSession | null> & object;
|
|
376
214
|
market: nanostores.ReadableAtom<Market | null>;
|
|
377
215
|
market_key: nanostores.PreinitializedWritableAtom<string> & object;
|
|
378
216
|
locale: nanostores.PreinitializedWritableAtom<string> & object;
|
|
379
|
-
currency: nanostores.ReadableAtom<
|
|
217
|
+
currency: nanostores.ReadableAtom<Currency | null>;
|
|
380
218
|
allowed_payment_methods: nanostores.ReadableAtom<PaymentMethod[]>;
|
|
381
219
|
payment_config: nanostores.ReadableAtom<{
|
|
382
|
-
provider:
|
|
220
|
+
provider: PaymentStoreConfig | null;
|
|
383
221
|
enabled: boolean;
|
|
384
222
|
}>;
|
|
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
|
-
};
|
|
433
223
|
identify: (params?: {
|
|
434
224
|
email?: string;
|
|
435
225
|
verify?: boolean;
|
|
436
226
|
market?: string;
|
|
437
|
-
}) => Promise<
|
|
227
|
+
}) => Promise<StorefrontIdentifyResult>;
|
|
228
|
+
identifyContactEmailIfMissing: (email: string) => Promise<ContactSession>;
|
|
438
229
|
verify: (params: {
|
|
230
|
+
challenge_id: string;
|
|
439
231
|
code: string;
|
|
440
|
-
}) => Promise<
|
|
441
|
-
me: () => Promise<
|
|
232
|
+
}) => Promise<VerifyResponse>;
|
|
233
|
+
me: () => Promise<Contact>;
|
|
442
234
|
logout: () => Promise<void>;
|
|
443
235
|
onAuthStateChanged: (listener: AuthStateListener<ContactSession>) => () => void;
|
|
444
236
|
readonly isAuthenticated: boolean;
|
|
@@ -460,12 +252,9 @@ declare function initialize(config: ArkyStoreConfig): {
|
|
|
460
252
|
find: (params: GetEntriesParams, options?: RequestOptions) => Promise<PaginatedResponse<CollectionEntry>>;
|
|
461
253
|
};
|
|
462
254
|
form: {
|
|
463
|
-
get: (params:
|
|
464
|
-
id?: string;
|
|
465
|
-
key?: string;
|
|
466
|
-
}, options?: RequestOptions) => Promise<Form>;
|
|
255
|
+
get: (params: GetFormParams, options?: RequestOptions) => Promise<Form>;
|
|
467
256
|
submit: (params: SubmitFormParams, options?: RequestOptions) => Promise<FormSubmission>;
|
|
468
|
-
submitByKey: (
|
|
257
|
+
submitByKey: (params: ArkySubmitFormByKeyParams, options?: RequestOptions) => Promise<FormSubmission>;
|
|
469
258
|
};
|
|
470
259
|
taxonomy: {
|
|
471
260
|
get(params: GetTaxonomyParams, options?: RequestOptions): Promise<Taxonomy>;
|
|
@@ -476,21 +265,16 @@ declare function initialize(config: ArkyStoreConfig): {
|
|
|
476
265
|
state: nanostores.PreinitializedMapStore<ArkyEshopState> & object;
|
|
477
266
|
product: {
|
|
478
267
|
get: (params: GetProductParams, options?: RequestOptions) => Promise<Product>;
|
|
479
|
-
find: (params?: GetProductsParams, options?: RequestOptions) => Promise<PaginatedResponse<Product>>;
|
|
480
268
|
list: (params?: GetProductsParams, options?: RequestOptions) => Promise<PaginatedResponse<Product>>;
|
|
481
|
-
loadListing: (params?: GetProductsParams, options?: RequestOptions) => Promise<PaginatedResponse<Product>>;
|
|
482
|
-
loadDetail: (params: GetProductParams, options?: RequestOptions) => Promise<Product>;
|
|
483
269
|
};
|
|
484
270
|
service: {
|
|
485
271
|
get: (params: GetServiceParams, options?: RequestOptions) => Promise<Service>;
|
|
486
|
-
find: (params?: GetServicesParams, options?: RequestOptions) => Promise<PaginatedResponse<Service>>;
|
|
487
272
|
list: (params?: GetServicesParams, options?: RequestOptions) => Promise<PaginatedResponse<Service>>;
|
|
488
|
-
|
|
489
|
-
loadDetail: (params: GetServiceParams, options?: RequestOptions) => Promise<Service>;
|
|
490
|
-
listProviders: (params: FindServiceProvidersParams, options?: RequestOptions) => Promise<Provider[]>;
|
|
491
|
-
findProviders: (params: FindServiceProvidersParams, options?: RequestOptions) => Promise<Provider[]>;
|
|
273
|
+
listProviders: (params: FindServiceProvidersParams, options?: RequestOptions) => Promise<ServiceProvider[]>;
|
|
492
274
|
getAvailability: (params: GetAvailabilityParams, options?: RequestOptions) => Promise<AvailabilityResponse>;
|
|
493
275
|
state: nanostores.PreinitializedMapStore<ArkyServiceState> & object;
|
|
276
|
+
form_state: nanostores.PreinitializedMapStore<ArkyServiceFormState> & object;
|
|
277
|
+
form_groups: nanostores.ReadableAtom<ArkyServiceFormGroup[]>;
|
|
494
278
|
form_blocks: nanostores.ReadableAtom<Block[]>;
|
|
495
279
|
current_step_name: nanostores.ReadableAtom<string>;
|
|
496
280
|
can_proceed: nanostores.ReadableAtom<boolean>;
|
|
@@ -514,29 +298,30 @@ declare function initialize(config: ArkyStoreConfig): {
|
|
|
514
298
|
nextMonth: () => void;
|
|
515
299
|
selectProvider: (providerId: string | null) => void;
|
|
516
300
|
selectDate: (cell: ArkyCalendarDay) => void;
|
|
517
|
-
createMultiDaySlots: () => void;
|
|
518
301
|
selectTimeSlot: (slot: ArkyServiceSlot | null) => void;
|
|
519
302
|
resetDateSelection: () => void;
|
|
520
303
|
updateCalendar: () => void;
|
|
521
304
|
findFirstAvailable: () => void;
|
|
522
|
-
addToCart: () => Promise<void>;
|
|
523
|
-
removeFromCart: (
|
|
305
|
+
addToCart: (explicitSlots?: ArkyServiceSlot[]) => Promise<void>;
|
|
306
|
+
removeFromCart: (bookingId: string) => Promise<void>;
|
|
524
307
|
clearCart: () => Promise<void>;
|
|
525
308
|
getProvidersList: () => Provider[];
|
|
526
309
|
prevStep: () => void;
|
|
527
310
|
nextStep: () => void;
|
|
528
311
|
getServicePrice: () => string;
|
|
529
312
|
formatDateDisplay: (value: string | null) => string;
|
|
530
|
-
serviceItemsFromSlots: (slots: ArkyServiceSlot[]) => ArkyServiceCartItem[];
|
|
313
|
+
serviceItemsFromSlots: (slots: ArkyServiceSlot[], forms?: FormEntry[]) => ArkyServiceCartItem[];
|
|
531
314
|
};
|
|
532
315
|
provider: {
|
|
533
316
|
get: (params: GetProviderParams, options?: RequestOptions) => Promise<Provider>;
|
|
534
|
-
|
|
317
|
+
list: (params?: GetProvidersParams, options?: RequestOptions) => Promise<PaginatedResponse<Provider>>;
|
|
535
318
|
};
|
|
536
319
|
order: {
|
|
537
320
|
get(params: GetOrderParams, options?: RequestOptions): Promise<Order>;
|
|
538
321
|
find(params: GetOrdersParams, options?: RequestOptions): Promise<PaginatedResponse<Order>>;
|
|
539
322
|
downloadDigitalAccess(params: DownloadDigitalAccessParams, options?: RequestOptions): Promise<DigitalAccessDownloadResponse>;
|
|
323
|
+
findDigitalAccess(params: FindDigitalAccessGrantsParams, options?: RequestOptions): Promise<PaginatedResponse<DigitalAccessGrant>>;
|
|
324
|
+
getDigitalAccess(params: GetDigitalAccessGrantParams, options?: RequestOptions): Promise<DigitalAccessGrant>;
|
|
540
325
|
};
|
|
541
326
|
cart: {
|
|
542
327
|
cart: nanostores.PreinitializedWritableAtom<Cart | null> & object;
|
|
@@ -582,6 +367,7 @@ declare function initialize(config: ArkyStoreConfig): {
|
|
|
582
367
|
removePromoCode(input?: Omit<ArkyCartInput, "promo_code">): Promise<OrderQuote | null>;
|
|
583
368
|
selectShippingMethod(id: string | null): void;
|
|
584
369
|
locationToAddress: typeof locationToAddress;
|
|
370
|
+
createFormEntry: typeof createFormEntry;
|
|
585
371
|
buildItems: (input?: ArkyCartInput) => OrderCheckoutItemInput[];
|
|
586
372
|
buildProductItems: typeof toProductCheckoutItems;
|
|
587
373
|
buildServiceItems: typeof toServiceCheckoutItems;
|
|
@@ -591,21 +377,32 @@ declare function initialize(config: ArkyStoreConfig): {
|
|
|
591
377
|
contact: {
|
|
592
378
|
identify(params?: {
|
|
593
379
|
email?: string;
|
|
594
|
-
|
|
380
|
+
market?: string;
|
|
381
|
+
}, options?: RequestOptions): Promise<IdentifyResponse>;
|
|
382
|
+
requestCode(params?: {
|
|
383
|
+
email?: string;
|
|
595
384
|
market?: string;
|
|
596
385
|
}, options?: RequestOptions): Promise<IdentifyResponse>;
|
|
597
386
|
verify(params: {
|
|
387
|
+
challenge_id: string;
|
|
598
388
|
code: string;
|
|
599
389
|
}, options?: RequestOptions): Promise<VerifyResponse>;
|
|
600
390
|
logout(options?: RequestOptions): Promise<void>;
|
|
601
|
-
getMe(options?: RequestOptions): Promise<
|
|
391
|
+
getMe(options?: RequestOptions): Promise<Contact>;
|
|
602
392
|
};
|
|
603
393
|
contactList: {
|
|
604
|
-
get(params: GetContactListParams, options?: RequestOptions): Promise<
|
|
605
|
-
find(params?:
|
|
394
|
+
get(params: GetContactListParams, options?: RequestOptions): Promise<StorefrontContactList>;
|
|
395
|
+
find(params?: FindStorefrontContactListsParams, options?: RequestOptions): Promise<PaginatedResponse<StorefrontContactList>>;
|
|
396
|
+
plans: {
|
|
397
|
+
find(params: FindStorefrontContactListPlansParams, options?: RequestOptions): Promise<PaginatedResponse<StorefrontContactListPlan>>;
|
|
398
|
+
};
|
|
399
|
+
memberships: {
|
|
400
|
+
find(params?: FindStorefrontContactListMembershipsParams, options?: RequestOptions): Promise<PaginatedResponse<StorefrontContactListMembership>>;
|
|
401
|
+
};
|
|
606
402
|
subscribe(params: SubscribeContactListParams, options?: RequestOptions): Promise<ContactListSubscribeResponse>;
|
|
607
403
|
checkAccess(params: ContactListAccessParams, options?: RequestOptions): Promise<ContactListAccessResponse>;
|
|
608
404
|
checkContentAccess(params: ContactListContentAccessParams, options?: RequestOptions): Promise<ContactListContentAccessResponse>;
|
|
405
|
+
manage(token: string, options?: RequestOptions): Promise<ContactListManagementResponse>;
|
|
609
406
|
unsubscribe(token: string, options?: RequestOptions): Promise<{
|
|
610
407
|
success: boolean;
|
|
611
408
|
}>;
|
|
@@ -623,9 +420,9 @@ declare function initialize(config: ArkyStoreConfig): {
|
|
|
623
420
|
use: (params: string | UseExperimentParams) => Promise<ExperimentUseResponse>;
|
|
624
421
|
};
|
|
625
422
|
support: {
|
|
626
|
-
startConversation(params?: Omit<StartSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<
|
|
627
|
-
sendMessage(params:
|
|
628
|
-
getConversation(params:
|
|
423
|
+
startConversation(params?: Omit<StartSupportConversationParams, "store_id">, opts?: RequestOptions): Promise<SupportConversationStartResponse>;
|
|
424
|
+
sendMessage(params: StorefrontSendSupportMessageParams, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
425
|
+
getConversation(params: StorefrontGetSupportConversationParams, opts?: RequestOptions): Promise<SupportConversationResponse>;
|
|
629
426
|
};
|
|
630
427
|
store: {
|
|
631
428
|
getStore(options?: RequestOptions): Promise<Store>;
|
|
@@ -658,18 +455,19 @@ declare function initialize(config: ArkyStoreConfig): {
|
|
|
658
455
|
};
|
|
659
456
|
};
|
|
660
457
|
utils: {
|
|
661
|
-
getImageUrl: (imageBlock:
|
|
662
|
-
getBlockValue:
|
|
663
|
-
getBlockTextValue:
|
|
664
|
-
|
|
458
|
+
getImageUrl: (imageBlock: unknown, isBlock?: boolean) => string | null;
|
|
459
|
+
getBlockValue: typeof getBlockValue;
|
|
460
|
+
getBlockTextValue: typeof getBlockTextValue;
|
|
461
|
+
getBlockContentValue: typeof getBlockContentValue;
|
|
462
|
+
getBlockValues: typeof getBlockValues;
|
|
665
463
|
getBlockLabel: typeof getBlockLabel;
|
|
666
|
-
getBlockObjectValues:
|
|
667
|
-
getBlockFromArray:
|
|
464
|
+
getBlockObjectValues: typeof getBlockObjectValues;
|
|
465
|
+
getBlockFromArray: typeof getBlockFromArray;
|
|
668
466
|
formatBlockValue: typeof formatBlockValue;
|
|
669
467
|
prepareBlocksForSubmission: typeof prepareBlocksForSubmission;
|
|
670
468
|
extractBlockValues: typeof extractBlockValues;
|
|
671
|
-
formatPrice: (prices:
|
|
672
|
-
getPriceAmount: (prices:
|
|
469
|
+
formatPrice: (prices: Price[]) => string;
|
|
470
|
+
getPriceAmount: (prices: Price[]) => number | null;
|
|
673
471
|
formatPayment: typeof formatPayment;
|
|
674
472
|
formatMinor: typeof formatMinor;
|
|
675
473
|
getCurrencySymbol: typeof getCurrencySymbol;
|
|
@@ -701,9 +499,14 @@ declare function initialize(config: ArkyStoreConfig): {
|
|
|
701
499
|
getFirstAvailableFCId: typeof getFirstAvailableFCId;
|
|
702
500
|
};
|
|
703
501
|
};
|
|
502
|
+
type InitializedStoreBase = ReturnType<typeof initializeStore>;
|
|
503
|
+
type InitializedStore = InitializedStoreBase & {
|
|
504
|
+
forStore(storeId: string): InitializedStore;
|
|
505
|
+
};
|
|
506
|
+
declare function initialize(config: ArkyStoreConfig): InitializedStore;
|
|
704
507
|
|
|
705
508
|
type ArkyStore = ReturnType<typeof initialize>;
|
|
706
509
|
type ArkyCartStore = ArkyStore["eshop"]["cart"];
|
|
707
510
|
type ArkyServiceStore = ArkyStore["eshop"]["service"];
|
|
708
511
|
|
|
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,
|
|
512
|
+
export { type ArkyCartInput, type ArkyCartSnapshot, type ArkyCartStatus, type ArkyCartStore, type ArkyCmsEntryParams, type ArkyCmsState, type ArkyEshopState, type ArkyLastOrder, type ArkyPaymentController, type ArkyServiceCartItem, type ArkyServiceFormGroup, type ArkyServiceFormState, type ArkyServiceSlot, type ArkyServiceState, type ArkyServiceStore, type ArkyStore, type ArkyStoreConfig, type ArkyStoreContext, type ArkyStripePaymentMountOptions, type ArkySubmitFormByKeyParams, AuthStateListener, ContactSession, CreateStorefrontConfig, ExperimentUseResponse, FormField, FormSchema, FormValues, StorefrontAction, StorefrontClient, StorefrontIdentifyResult, type StripeConfirmationTokenController, type StripeConfirmationTokenControllerConfig, type StripeConfirmationTokenOptions, type StripeConfirmationTokenResult, TrackActionParams, UseExperimentParams, buildFormFields, createFormEntry, createFormEntryFromValues, createStripeConfirmationTokenController, getBlockContentValue, initialize };
|