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.
Files changed (43) hide show
  1. package/README.md +113 -194
  2. package/dist/admin-BKXmDIVk.d.ts +1396 -0
  3. package/dist/admin-CAwQrMOX.d.cts +1396 -0
  4. package/dist/admin.cjs +1239 -455
  5. package/dist/admin.cjs.map +1 -1
  6. package/dist/admin.d.cts +3 -3
  7. package/dist/admin.d.ts +3 -3
  8. package/dist/admin.js +1239 -455
  9. package/dist/admin.js.map +1 -1
  10. package/dist/api-DJI3S6XA.d.cts +4204 -0
  11. package/dist/api-DJI3S6XA.d.ts +4204 -0
  12. package/dist/{index-C5gikdBg.d.cts → index-BaSBPLdF.d.ts} +1 -1
  13. package/dist/{index-MFMjlIfS.d.ts → index-u-gjHnKs.d.cts} +1 -1
  14. package/dist/index.cjs +1360 -610
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +3 -3
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.js +1360 -610
  19. package/dist/index.js.map +1 -1
  20. package/dist/storefront.cjs +590 -382
  21. package/dist/storefront.cjs.map +1 -1
  22. package/dist/storefront.d.cts +182 -156
  23. package/dist/storefront.d.ts +182 -156
  24. package/dist/storefront.js +588 -381
  25. package/dist/storefront.js.map +1 -1
  26. package/dist/types.cjs.map +1 -1
  27. package/dist/types.d.cts +1 -2666
  28. package/dist/types.d.ts +1 -2666
  29. package/dist/types.js.map +1 -1
  30. package/dist/utils.d.cts +2 -2
  31. package/dist/utils.d.ts +2 -2
  32. package/package.json +9 -11
  33. package/scripts/contract-admin.mjs +137 -0
  34. package/scripts/contract-storefront.mjs +296 -0
  35. package/dist/admin-CfHen7c5.d.cts +0 -1036
  36. package/dist/admin-ru7pX5bd.d.ts +0 -1036
  37. package/dist/storefront-store.cjs +0 -2794
  38. package/dist/storefront-store.cjs.map +0 -1
  39. package/dist/storefront-store.d.cts +0 -5
  40. package/dist/storefront-store.d.ts +0 -5
  41. package/dist/storefront-store.js +0 -2792
  42. package/dist/storefront-store.js.map +0 -1
  43. package/scripts/smoke-store.mjs +0 -41
@@ -1,1036 +0,0 @@
1
- import { Cart, OrderQuote, OrderCheckoutResult, GetCurrentCartParams, GetCartParams, RequestOptions as RequestOptions$1, AddCartItemParams, UpdateCartParams, RemoveCartItemParams, ClearCartParams, QuoteCartParams, CheckoutCartParams, Customer, Store, Market, AuthToken, MagicLinkVerifyParams, MagicLinkRequestParams, UpdateAccountProfileParams, AccountUpdateResponse, DeleteAccountParams, GetMeParams, Account, SearchAccountsParams, Location, CreateLocationParams, UpdateLocationParams, DeleteLocationParams, CreateMarketParams, UpdateMarketParams, DeleteMarketParams, CreateStoreParams, UpdateStoreParams, DeleteStoreParams, GetStoreParams, GetStoresParams, PaginatedResponse, GetSubscriptionPlansParams, SubscriptionPlan, SubscribeParams, CreatePortalSessionParams, InviteUserParams, RemoveMemberParams, HandleInvitationParams, TestWebhookParams, GetStoreMediaParams2, Media, OAuthConnectParams, Integration, OAuthDisconnectParams, ListIntegrationsParams, CreateIntegrationParams, UpdateIntegrationParams, DeleteIntegrationParams, ListWebhooksParams, Webhook, CreateWebhookParams, UpdateWebhookParams, DeleteWebhookParams, GetMediaParams, UploadStoreMediaParams, DeleteStoreMediaParams, GetStoreMediaParams, UpdateMediaParams, TrackEmailOpenParams, TriggerNotificationParams, CreatePromoCodeParams, PromoCode, UpdatePromoCodeParams, DeletePromoCodeParams, GetPromoCodeParams, GetPromoCodesParams, GetShippingRatesParams, ShippingRate, ShipParams, ShipResult, CreateNodeParams, Node, UpdateNodeParams, DeleteNodeParams, GetNodeParams, Block, TaxonomyEntry, NodeStatus, GetNodesParams, GetNodeChildrenParams, CreateFormParams, Form, UpdateFormParams, DeleteFormParams, GetFormParams, GetFormsParams, SubmitFormParams, FormSubmission, GetFormSubmissionsParams, GetFormSubmissionParams, UpdateFormSubmissionParams, CreateTaxonomyParams, Taxonomy, UpdateTaxonomyParams, DeleteTaxonomyParams, GetTaxonomyParams, GetTaxonomiesParams, GetTaxonomyChildrenParams, CreateEmailTemplateParams, EmailTemplate, UpdateEmailTemplateParams, DeleteEmailTemplateParams, GetEmailTemplateParams, GetEmailTemplatesParams, CreateProductParams, Product, UpdateProductParams, DeleteProductParams, GetProductParams, GetProductsParams, UpdateOrderParams, Order, GetOrderParams, GetOrdersParams, GetQuoteParams, ProcessOrderRefundParams, CreateCartParams, FindCartsParams, CreateServiceParams, Service, UpdateServiceParams, DeleteServiceParams, GetServiceParams, GetServicesParams, GetAvailabilityParams, AvailabilityResponse, FindServiceProvidersParams, ServiceProvider, CreateServiceProviderParams, UpdateServiceProviderParams, DeleteServiceProviderParams, CreateProviderParams, Provider, UpdateProviderParams, DeleteProviderParams, GetProviderParams, GetProvidersParams, CreateCustomerParams, GetCustomerParams, CustomerDetail, FindCustomersParams, UpdateCustomerParams, MergeCustomersParams, CreateAudienceParams, Audience, UpdateAudienceParams, GetAudienceParams, GetAudiencesParams, GetAudienceSubscribersParams, AudienceSubscriber, AddAudienceSubscriberParams, AddAudienceSubscriberResponse, RemoveAudienceSubscriberParams, FindActivitiesParams, CreateAgentParams, Agent, UpdateAgentParams, DeleteAgentParams, GetAgentParams, GetAgentsParams, RunAgentParams, AgentChatMessage, GetAgentChatsParams, AgentChat, GetAgentChatParams, UpdateAgentChatParams, RateAgentChatParams, GetStoreChatsParams, CreateWorkflowParams, Workflow, UpdateWorkflowParams, DeleteWorkflowParams, GetWorkflowParams, GetWorkflowsParams, TriggerWorkflowParams, WorkflowExecution, GetWorkflowExecutionsParams, GetWorkflowExecutionParams, SubscribeAudienceParams, AudienceSubscribeResponse, AudienceAccessResponse } from './types.cjs';
2
- 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-C5gikdBg.cjs';
3
-
4
- interface CartApi {
5
- current(params?: GetCurrentCartParams, options?: RequestOptions$1): Promise<Cart>;
6
- get(params: GetCartParams, options?: RequestOptions$1): Promise<Cart>;
7
- update(params: UpdateCartParams, options?: RequestOptions$1): Promise<Cart>;
8
- addItem(params: AddCartItemParams, options?: RequestOptions$1): Promise<Cart>;
9
- removeItem(params: RemoveCartItemParams, options?: RequestOptions$1): Promise<Cart>;
10
- clear(params: ClearCartParams, options?: RequestOptions$1): Promise<Cart>;
11
- quote(params: QuoteCartParams, options?: RequestOptions$1): Promise<OrderQuote>;
12
- checkout(params: CheckoutCartParams, options?: RequestOptions$1): Promise<OrderCheckoutResult>;
13
- }
14
- interface CartControllerState {
15
- cart: Cart | null;
16
- quote: OrderQuote | null;
17
- checkoutResult: OrderCheckoutResult | null;
18
- loading: boolean;
19
- initialized: boolean;
20
- error: unknown;
21
- }
22
- type CartControllerListener = (state: CartControllerState) => void;
23
- type CartControllerInitParams = GetCurrentCartParams | GetCartParams;
24
- type CartControllerRefreshParams = GetCurrentCartParams | GetCartParams;
25
- type CartControllerUpdateParams = Omit<UpdateCartParams, "id"> & {
26
- id?: string;
27
- };
28
- type CartControllerAddItemParams = Omit<AddCartItemParams, "id"> & {
29
- id?: string;
30
- };
31
- type CartControllerRemoveItemParams = Omit<RemoveCartItemParams, "id"> & {
32
- id?: string;
33
- };
34
- type CartControllerClearParams = Omit<ClearCartParams, "id"> & {
35
- id?: string;
36
- };
37
- type CartControllerQuoteParams = Omit<QuoteCartParams, "id"> & {
38
- id?: string;
39
- };
40
- type CartControllerCheckoutParams = Omit<CheckoutCartParams, "id"> & {
41
- id?: string;
42
- };
43
- interface CartController {
44
- subscribe(listener: CartControllerListener): () => void;
45
- getState(): CartControllerState;
46
- init(params?: CartControllerInitParams, options?: RequestOptions$1): Promise<Cart>;
47
- refresh(params?: CartControllerRefreshParams, options?: RequestOptions$1): Promise<Cart>;
48
- addItem(params: CartControllerAddItemParams, options?: RequestOptions$1): Promise<Cart>;
49
- update(params: CartControllerUpdateParams, options?: RequestOptions$1): Promise<Cart>;
50
- removeItem(params: CartControllerRemoveItemParams, options?: RequestOptions$1): Promise<Cart>;
51
- clear(params?: CartControllerClearParams, options?: RequestOptions$1): Promise<Cart>;
52
- quote(params?: CartControllerQuoteParams, options?: RequestOptions$1): Promise<OrderQuote>;
53
- checkout(params?: CartControllerCheckoutParams, options?: RequestOptions$1): Promise<OrderCheckoutResult>;
54
- }
55
- declare function createCartController(cartApi: CartApi): CartController;
56
-
57
- type CustomerToken = {
58
- id: string;
59
- token: string;
60
- created_at: number;
61
- };
62
- type IdentifyResponse = {
63
- customer: Customer;
64
- token: CustomerToken;
65
- store: Store;
66
- market: Market | null;
67
- code_sent: boolean;
68
- };
69
- type VerifyResponse = CustomerToken;
70
- interface Activity$1 {
71
- store_id: string;
72
- customer_id: string;
73
- type: string;
74
- payload: Record<string, unknown>;
75
- created_at: number;
76
- }
77
- interface TrackParams {
78
- type: string;
79
- payload?: Record<string, unknown>;
80
- }
81
- declare const COMMON_ACTIVITY_TYPES: readonly ["page_view", "product_view", "service_view", "provider_view", "cart_added", "cart_removed", "checkout_started", "purchase", "order_created", "signin", "signup", "verified_email", "search", "share", "wishlist_added"];
82
- type CommonActivityType = (typeof COMMON_ACTIVITY_TYPES)[number];
83
-
84
- interface AnalyticsTimeRange {
85
- from: number;
86
- to: number;
87
- }
88
- type AnalyticsReportKey = "orders_created" | "customers_created" | "form_submissions_created" | "carts_abandoned" | "media_count" | "products_by_status" | "services_by_status" | "providers_by_status" | "nodes_by_status" | "customers_by_status" | "audiences_by_status" | "agents_by_status" | "workflows_by_status" | "promo_codes_by_status" | "email_templates_by_status" | "forms_by_status" | "taxonomies_by_status" | "carts_by_status" | "orders_by_status" | "order_items_by_status" | "activity_by_country" | "recent_activity";
89
- type ActivityFeedCategory = "orders" | "carts" | "promo_codes" | "submissions" | "customers" | "audiences" | "products" | "services" | "providers" | "cms" | "workflows" | "agents" | "activities";
90
- interface AnalyticsReportRequest {
91
- key: AnalyticsReportKey;
92
- limit?: number;
93
- category?: ActivityFeedCategory;
94
- cursor_created_at?: number;
95
- cursor_id?: string;
96
- }
97
- interface AnalyticsRequest {
98
- time: AnalyticsTimeRange;
99
- reports: AnalyticsReportRequest[];
100
- }
101
- interface AnalyticsMetricData {
102
- value: number;
103
- execution_ms?: number;
104
- }
105
- interface AnalyticsBreakdownItem {
106
- key: string;
107
- label: string;
108
- value: number;
109
- unique_customers?: number;
110
- }
111
- interface AnalyticsBreakdownData {
112
- items: AnalyticsBreakdownItem[];
113
- }
114
- interface ActivityFeedItem {
115
- id: string;
116
- entity: string;
117
- entity_id: string;
118
- action: string;
119
- event_type: string;
120
- status: string;
121
- customer_id: string;
122
- category: string;
123
- title: string;
124
- description: string;
125
- href?: string | null;
126
- data: unknown;
127
- payload: unknown;
128
- created_at: number;
129
- }
130
- interface ActivityFeedSummary {
131
- total: number;
132
- orders: number;
133
- submissions: number;
134
- customers: number;
135
- audiences: number;
136
- abandoned_carts: number;
137
- carts: number;
138
- promo_codes: number;
139
- products: number;
140
- services: number;
141
- providers: number;
142
- cms: number;
143
- workflows: number;
144
- agents: number;
145
- activities: number;
146
- window_start: number;
147
- }
148
- interface ActivityFeedCursor {
149
- created_at: number;
150
- id: string;
151
- }
152
- interface ActivityFeedData {
153
- items: ActivityFeedItem[];
154
- summary: ActivityFeedSummary;
155
- next_cursor?: ActivityFeedCursor | null;
156
- meta: {
157
- row_count: number;
158
- execution_ms: number;
159
- };
160
- }
161
- type AnalyticsReport = {
162
- key: AnalyticsReportKey;
163
- type: "metric";
164
- data: AnalyticsMetricData;
165
- } | {
166
- key: AnalyticsReportKey;
167
- type: "breakdown";
168
- data: AnalyticsBreakdownData;
169
- } | {
170
- key: AnalyticsReportKey;
171
- type: "activity";
172
- data: ActivityFeedData;
173
- };
174
- interface AnalyticsResponse {
175
- time: AnalyticsTimeRange;
176
- reports: AnalyticsReport[];
177
- }
178
-
179
- interface Activity {
180
- id: string;
181
- store_id: string;
182
- customer_id: string;
183
- type: string;
184
- payload: Record<string, unknown>;
185
- created_at: number;
186
- country_code?: string | null;
187
- city?: string | null;
188
- region?: string | null;
189
- timezone?: string | null;
190
- device_type?: string | null;
191
- browser?: string | null;
192
- os?: string | null;
193
- language?: string | null;
194
- session_idx?: number | null;
195
- }
196
- interface TimelineParams {
197
- customer_id: string;
198
- store_id?: string;
199
- limit?: number;
200
- cursor?: string;
201
- }
202
-
203
- interface IntegrationOperation {
204
- name: string;
205
- value: string;
206
- description?: string;
207
- method: 'get' | 'post' | 'put' | 'patch' | 'delete';
208
- url: string;
209
- body?: Record<string, unknown> | string;
210
- headers?: Record<string, string>;
211
- }
212
- interface IntegrationResource {
213
- name: string;
214
- value: string;
215
- operations: IntegrationOperation[];
216
- }
217
- interface IntegrationService {
218
- id: string;
219
- name: string;
220
- description: string;
221
- icon: string;
222
- color: string;
223
- category: 'ai' | 'communication' | 'email' | 'productivity' | 'payments' | 'crm' | 'ecommerce' | 'developer' | 'storage' | 'analytics' | 'deploy' | 'core';
224
- configurationRequired: boolean;
225
- website?: string;
226
- docsUrl?: string;
227
- urlPatterns: string[];
228
- resources: IntegrationResource[];
229
- triggers?: Array<{
230
- name: string;
231
- value: string;
232
- description: string;
233
- webhookType: 'incoming' | 'polling';
234
- }>;
235
- }
236
-
237
- interface InvitationTokenData {
238
- auth: AuthToken;
239
- store_id?: string | null;
240
- }
241
-
242
- interface LocationState {
243
- code: string;
244
- name: string;
245
- }
246
- interface LocationCountry {
247
- code: string;
248
- name: string;
249
- states: LocationState[];
250
- }
251
- interface GetCountriesResponse {
252
- items: LocationCountry[];
253
- cursor: string | null;
254
- }
255
-
256
- interface QueryParams {
257
- [key: string]: string | number | boolean | string[] | number[] | null | undefined;
258
- }
259
-
260
- interface TokenSet {
261
- access_token: string;
262
- refresh_token?: string;
263
- access_expires_at?: number;
264
- }
265
- interface AuthStorage {
266
- getTokens(): TokenSet | null;
267
- onTokensRefreshed(tokens: TokenSet): void;
268
- onForcedLogout(): void;
269
- }
270
- interface RequestSuccessContext<T = unknown> {
271
- data: T;
272
- method: string;
273
- url: string;
274
- status: number;
275
- request?: unknown;
276
- duration_ms?: number;
277
- request_id?: string | null;
278
- }
279
- interface RequestErrorContext {
280
- error: unknown;
281
- method: string;
282
- url: string;
283
- status?: number;
284
- request?: unknown;
285
- response?: unknown;
286
- duration_ms?: number;
287
- request_id?: string | null;
288
- aborted?: boolean;
289
- }
290
- interface RequestOptions<T = unknown> {
291
- headers?: Record<string, string>;
292
- params?: QueryParams | Record<string, any>;
293
- transformRequest?: (data: unknown) => unknown;
294
- onSuccess?: (ctx: RequestSuccessContext<T>) => void | Promise<void>;
295
- onError?: (ctx: RequestErrorContext) => void | Promise<void>;
296
- }
297
- interface HttpClient {
298
- get<T>(path: string, opts?: RequestOptions<T>): Promise<T>;
299
- post<T>(path: string, body: unknown, opts?: RequestOptions<T>): Promise<T>;
300
- put<T>(path: string, body: unknown, opts?: RequestOptions<T>): Promise<T>;
301
- patch<T>(path: string, body: unknown, opts?: RequestOptions<T>): Promise<T>;
302
- delete<T>(path: string, opts?: RequestOptions<T>): Promise<T>;
303
- }
304
- interface HttpClientConfig {
305
- baseUrl: string;
306
- storeId: string;
307
- authStorage: AuthStorage;
308
- refreshPath?: string | (() => string);
309
- navigate?: (path: string) => void;
310
- loginFallbackPath?: string;
311
- }
312
-
313
- declare function getBlockLabel(block: any): string;
314
- declare function formatBlockValue(block: any): string;
315
- declare function prepareBlocksForSubmission(formData: any, blockTypes?: Record<string, string>): any[];
316
- declare function extractBlockValues(blocks: any[]): Record<string, any>;
317
-
318
- interface ValidationResult {
319
- isValid: boolean;
320
- error?: string;
321
- }
322
- declare function validatePhoneNumber(phone: string): ValidationResult;
323
-
324
- declare const tzGroups: {
325
- label: string;
326
- zones: {
327
- label: string;
328
- value: string;
329
- }[];
330
- }[];
331
- declare function findTimeZone(groups: typeof tzGroups): string;
332
-
333
- declare const locales: readonly ["en", "sr-latn"];
334
- declare function slugify(text: string): string;
335
- declare function humanize(text: string): string;
336
- declare function categorify(text: string): string;
337
- declare function formatDate(date: string | number | Date, locale: (typeof locales)[number]): string;
338
-
339
- declare function fetchSvgContent(mediaObject: any): Promise<string | null>;
340
- declare function getSvgContentForAstro(mediaObject: any): Promise<string>;
341
- declare function injectSvgIntoElement(mediaObject: any, targetElement: HTMLElement, className?: string): Promise<void>;
342
-
343
- declare const SDK_VERSION = "0.7.133";
344
- declare const SUPPORTED_FRAMEWORKS: readonly ["astro", "react", "vue", "svelte", "vanilla"];
345
-
346
- interface ApiConfig {
347
- httpClient: HttpClient;
348
- storeId: string;
349
- baseUrl: string;
350
- market: string;
351
- locale: string;
352
- authStorage: AuthStorage;
353
- }
354
- interface AdminSessionInternal {
355
- access_token: string;
356
- refresh_token: string;
357
- access_expires_at?: number;
358
- email?: string;
359
- }
360
- interface CustomerSessionInternal {
361
- access_token: string;
362
- customer: Customer;
363
- store: Store;
364
- market: Market | null;
365
- }
366
- interface AdminSession {
367
- email?: string;
368
- }
369
- interface CustomerSession {
370
- customer: Customer;
371
- store: Store;
372
- market: Market | null;
373
- }
374
- type AdminSessionUpdater = (updater: (prev: AdminSessionInternal | null) => AdminSessionInternal | null) => void;
375
- type CustomerSessionUpdater = (updater: (prev: CustomerSessionInternal | null) => CustomerSessionInternal | null) => void;
376
- type AuthStateListener<T> = (session: T | null) => void;
377
-
378
- type CreateAdminConfig = Omit<HttpClientConfig, "authStorage" | "storeId"> & {
379
- storeId: string;
380
- market: string;
381
- locale?: string;
382
- apiToken?: string;
383
- };
384
- declare function createAdmin(config: CreateAdminConfig): {
385
- auth: {
386
- code(params: {
387
- email: string;
388
- }, options?: RequestOptions$1): Promise<{
389
- sent: boolean;
390
- }>;
391
- verify(params: MagicLinkVerifyParams, options?: RequestOptions$1): Promise<AuthToken>;
392
- refresh(params: {
393
- refresh_token: string;
394
- }, options?: RequestOptions$1): Promise<AuthToken>;
395
- storeCode(storeId: string, params: {
396
- email: string;
397
- }, options?: RequestOptions$1): Promise<{
398
- sent: boolean;
399
- }>;
400
- storeVerify(storeId: string, params: MagicLinkVerifyParams, options?: RequestOptions$1): Promise<AuthToken>;
401
- magicLink(params: MagicLinkRequestParams, options?: RequestOptions$1): Promise<{
402
- sent: boolean;
403
- }>;
404
- };
405
- account: {
406
- updateAccount(params: UpdateAccountProfileParams, options?: RequestOptions$1): Promise<AccountUpdateResponse>;
407
- deleteAccount(_params: DeleteAccountParams, options?: RequestOptions$1): Promise<{
408
- deleted: boolean;
409
- }>;
410
- getMe(_params: GetMeParams, options?: RequestOptions$1): Promise<Account>;
411
- searchAccounts(params: SearchAccountsParams, options?: RequestOptions$1): Promise<{
412
- items: Account[];
413
- cursor?: string | null;
414
- }>;
415
- };
416
- store: {
417
- location: {
418
- getCountries(options?: RequestOptions$1): Promise<GetCountriesResponse>;
419
- getCountry(countryCode: string, options?: RequestOptions$1): Promise<LocationCountry>;
420
- list(options?: RequestOptions$1): Promise<Location[]>;
421
- get(id: string, options?: RequestOptions$1): Promise<Location>;
422
- create(params: CreateLocationParams, options?: RequestOptions$1): Promise<Location>;
423
- update(params: UpdateLocationParams, options?: RequestOptions$1): Promise<Location>;
424
- delete(params: DeleteLocationParams, options?: RequestOptions$1): Promise<{
425
- deleted: boolean;
426
- }>;
427
- };
428
- market: {
429
- list(options?: RequestOptions$1): Promise<Market[]>;
430
- get(id: string, options?: RequestOptions$1): Promise<Market>;
431
- create(params: CreateMarketParams, options?: RequestOptions$1): Promise<Market>;
432
- update(params: UpdateMarketParams, options?: RequestOptions$1): Promise<Market>;
433
- delete(params: DeleteMarketParams, options?: RequestOptions$1): Promise<{
434
- deleted: boolean;
435
- }>;
436
- };
437
- createStore(params: CreateStoreParams, options?: RequestOptions$1): Promise<Store>;
438
- updateStore(params: UpdateStoreParams, options?: RequestOptions$1): Promise<Store>;
439
- deleteStore(params: DeleteStoreParams, options?: RequestOptions$1): Promise<{
440
- deleted: boolean;
441
- }>;
442
- getStore(_params: GetStoreParams, options?: RequestOptions$1): Promise<Store>;
443
- getStores(params?: GetStoresParams, options?: RequestOptions$1): Promise<PaginatedResponse<Store>>;
444
- getSubscriptionPlans(_params: GetSubscriptionPlansParams, options?: RequestOptions$1): Promise<PaginatedResponse<SubscriptionPlan>>;
445
- subscribe(params: SubscribeParams, options?: RequestOptions$1): Promise<{
446
- checkout_url?: string;
447
- }>;
448
- createPortalSession(params: CreatePortalSessionParams, options?: RequestOptions$1): Promise<{
449
- portal_url: string;
450
- }>;
451
- inviteUser(params: InviteUserParams, options?: RequestOptions$1): Promise<{
452
- invited: boolean;
453
- }>;
454
- removeMember(params: RemoveMemberParams, options?: RequestOptions$1): Promise<{
455
- removed: boolean;
456
- }>;
457
- handleInvitation(params: HandleInvitationParams, options?: RequestOptions$1): Promise<InvitationTokenData>;
458
- testWebhook(params: TestWebhookParams, options?: RequestOptions$1): Promise<{
459
- tested: boolean;
460
- }>;
461
- getStoreMedia(params: GetStoreMediaParams2, options?: RequestOptions$1): Promise<PaginatedResponse<Media>>;
462
- oauthConnect(params: OAuthConnectParams, options?: RequestOptions$1): Promise<Integration>;
463
- oauthDisconnect(params: OAuthDisconnectParams, options?: RequestOptions$1): Promise<{
464
- disconnected: boolean;
465
- }>;
466
- listIntegrations(params: ListIntegrationsParams, options?: RequestOptions$1): Promise<Integration[]>;
467
- createIntegration(params: CreateIntegrationParams, options?: RequestOptions$1): Promise<Integration>;
468
- updateIntegration(params: UpdateIntegrationParams, options?: RequestOptions$1): Promise<Integration>;
469
- deleteIntegration(params: DeleteIntegrationParams, options?: RequestOptions$1): Promise<{
470
- deleted: boolean;
471
- }>;
472
- getIntegrationConfig(params: {
473
- store_id: string;
474
- type: "payment" | "shipping";
475
- }, options?: RequestOptions$1): Promise<unknown>;
476
- listWebhooks(params: ListWebhooksParams, options?: RequestOptions$1): Promise<Webhook[]>;
477
- createWebhook(params: CreateWebhookParams, options?: RequestOptions$1): Promise<Webhook>;
478
- updateWebhook(params: UpdateWebhookParams, options?: RequestOptions$1): Promise<Webhook>;
479
- deleteWebhook(params: DeleteWebhookParams, options?: RequestOptions$1): Promise<{
480
- deleted: boolean;
481
- }>;
482
- };
483
- media: {
484
- getMedia(params: GetMediaParams, options?: RequestOptions$1): Promise<Media>;
485
- uploadStoreMedia(params: UploadStoreMediaParams, _options?: RequestOptions$1): Promise<Media[]>;
486
- deleteStoreMedia(params: DeleteStoreMediaParams, options?: RequestOptions$1): Promise<{
487
- deleted: boolean;
488
- }>;
489
- getStoreMedia(params: GetStoreMediaParams, _options?: RequestOptions$1): Promise<PaginatedResponse<Media>>;
490
- updateMedia(params: UpdateMediaParams, options?: RequestOptions$1): Promise<Media>;
491
- };
492
- notification: {
493
- trackEmailOpen(params: TrackEmailOpenParams, options?: RequestOptions$1): Promise<void>;
494
- trigger(params: TriggerNotificationParams, options?: RequestOptions$1): Promise<{
495
- triggered: boolean;
496
- }>;
497
- };
498
- promoCode: {
499
- createPromoCode(params: CreatePromoCodeParams, options?: RequestOptions$1): Promise<PromoCode>;
500
- updatePromoCode(params: UpdatePromoCodeParams, options?: RequestOptions$1): Promise<PromoCode>;
501
- deletePromoCode(params: DeletePromoCodeParams, options?: RequestOptions$1): Promise<{
502
- deleted: boolean;
503
- }>;
504
- getPromoCode(params: GetPromoCodeParams, options?: RequestOptions$1): Promise<PromoCode>;
505
- getPromoCodes(params: GetPromoCodesParams, options?: RequestOptions$1): Promise<PaginatedResponse<PromoCode>>;
506
- };
507
- platform: {
508
- getCurrencies(options?: RequestOptions$1): Promise<string[]>;
509
- getIntegrationServices(options?: RequestOptions$1): Promise<IntegrationService[]>;
510
- getWebhookEvents(options?: RequestOptions$1): Promise<{
511
- data: string[];
512
- }>;
513
- data: {
514
- scan(params: {
515
- key: string;
516
- limit?: number;
517
- }, options?: RequestOptions$1): Promise<{
518
- value: Array<{
519
- key: string;
520
- value: unknown;
521
- }>;
522
- }>;
523
- put(params: {
524
- key: string;
525
- value: unknown;
526
- oldKey?: string;
527
- }, options?: RequestOptions$1): Promise<{
528
- ok: boolean;
529
- }>;
530
- delete(params: {
531
- key: string;
532
- }, options?: RequestOptions$1): Promise<{
533
- ok: boolean;
534
- }>;
535
- };
536
- runScript(params: {
537
- name: string;
538
- value?: string;
539
- username?: string;
540
- password?: string;
541
- }, options?: RequestOptions$1): Promise<{
542
- message: string;
543
- }>;
544
- };
545
- shipping: {
546
- getRates(params: GetShippingRatesParams, options?: RequestOptions$1): Promise<{
547
- rates: ShippingRate[];
548
- }>;
549
- ship(params: ShipParams, options?: RequestOptions$1): Promise<ShipResult>;
550
- };
551
- cms: {
552
- node: {
553
- create: (params: CreateNodeParams, options?: RequestOptions$1) => Promise<Node>;
554
- update: (params: UpdateNodeParams, options?: RequestOptions$1) => Promise<Node>;
555
- delete: (params: DeleteNodeParams, options?: RequestOptions$1) => Promise<{
556
- deleted: boolean;
557
- }>;
558
- get: (params: GetNodeParams, options?: RequestOptions$1) => Promise<{
559
- getBlock(key: string): any;
560
- getBlockValues(key: string): any;
561
- getImage(key: string): any;
562
- id: string;
563
- key: string;
564
- store_id: string;
565
- parent_id?: string | null;
566
- blocks: Block[];
567
- taxonomies: TaxonomyEntry[];
568
- status: NodeStatus;
569
- slug: Record<string, string>;
570
- children: Node[];
571
- created_at: number;
572
- updated_at: number;
573
- }>;
574
- find: (params: GetNodesParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Node>>;
575
- getChildren: (params: GetNodeChildrenParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Node>>;
576
- };
577
- form: {
578
- create: (params: CreateFormParams, options?: RequestOptions$1) => Promise<Form>;
579
- update: (params: UpdateFormParams, options?: RequestOptions$1) => Promise<Form>;
580
- delete: (params: DeleteFormParams, options?: RequestOptions$1) => Promise<{
581
- deleted: boolean;
582
- }>;
583
- get: (params: GetFormParams, options?: RequestOptions$1) => Promise<Form>;
584
- find: (params: GetFormsParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Form>>;
585
- submit: (params: SubmitFormParams, options?: RequestOptions$1) => Promise<FormSubmission>;
586
- getSubmissions: (params: GetFormSubmissionsParams, options?: RequestOptions$1) => Promise<PaginatedResponse<FormSubmission>>;
587
- getSubmission: (params: GetFormSubmissionParams, options?: RequestOptions$1) => Promise<FormSubmission>;
588
- updateSubmission: (params: UpdateFormSubmissionParams, options?: RequestOptions$1) => Promise<FormSubmission>;
589
- };
590
- taxonomy: {
591
- create: (params: CreateTaxonomyParams, options?: RequestOptions$1) => Promise<Taxonomy>;
592
- update: (params: UpdateTaxonomyParams, options?: RequestOptions$1) => Promise<Taxonomy>;
593
- delete: (params: DeleteTaxonomyParams, options?: RequestOptions$1) => Promise<{
594
- deleted: boolean;
595
- }>;
596
- get: (params: GetTaxonomyParams, options?: RequestOptions$1) => Promise<Taxonomy>;
597
- find: (params: GetTaxonomiesParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Taxonomy>>;
598
- getChildren: (params: GetTaxonomyChildrenParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Taxonomy>>;
599
- };
600
- emailTemplate: {
601
- create: (params: CreateEmailTemplateParams, options?: RequestOptions$1) => Promise<EmailTemplate>;
602
- update: (params: UpdateEmailTemplateParams, options?: RequestOptions$1) => Promise<EmailTemplate>;
603
- delete: (params: DeleteEmailTemplateParams, options?: RequestOptions$1) => Promise<{
604
- deleted: boolean;
605
- }>;
606
- get: (params: GetEmailTemplateParams, options?: RequestOptions$1) => Promise<EmailTemplate>;
607
- find: (params: GetEmailTemplatesParams, options?: RequestOptions$1) => Promise<PaginatedResponse<EmailTemplate>>;
608
- };
609
- };
610
- eshop: {
611
- product: {
612
- create: (params: CreateProductParams, options?: RequestOptions$1) => Promise<Product>;
613
- update: (params: UpdateProductParams, options?: RequestOptions$1) => Promise<Product>;
614
- delete: (params: DeleteProductParams, options?: RequestOptions$1) => Promise<{
615
- deleted: boolean;
616
- }>;
617
- get: (params: GetProductParams, options?: RequestOptions$1) => Promise<Product>;
618
- find: (params: GetProductsParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Product>>;
619
- };
620
- order: {
621
- update: (params: UpdateOrderParams, options?: RequestOptions$1) => Promise<Order>;
622
- get: (params: GetOrderParams, options?: RequestOptions$1) => Promise<Order>;
623
- find: (params: GetOrdersParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Order>>;
624
- getQuote: (params: GetQuoteParams, options?: RequestOptions$1) => Promise<OrderQuote>;
625
- processRefund: (params: ProcessOrderRefundParams, options?: RequestOptions$1) => Promise<Order>;
626
- };
627
- cart: {
628
- create: (params: CreateCartParams, options?: RequestOptions$1) => Promise<Cart>;
629
- update: (params: UpdateCartParams, options?: RequestOptions$1) => Promise<Cart>;
630
- get: (params: GetCartParams, options?: RequestOptions$1) => Promise<Cart>;
631
- find: (params?: FindCartsParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Cart>>;
632
- addItem: (params: AddCartItemParams, options?: RequestOptions$1) => Promise<Cart>;
633
- removeItem: (params: RemoveCartItemParams, options?: RequestOptions$1) => Promise<Cart>;
634
- clear: (params: ClearCartParams, options?: RequestOptions$1) => Promise<Cart>;
635
- quote: (params: QuoteCartParams, options?: RequestOptions$1) => Promise<OrderQuote>;
636
- checkout: (params: CheckoutCartParams, options?: RequestOptions$1) => Promise<OrderCheckoutResult>;
637
- };
638
- service: {
639
- create: (params: CreateServiceParams, options?: RequestOptions$1) => Promise<Service>;
640
- update: (params: UpdateServiceParams, options?: RequestOptions$1) => Promise<Service>;
641
- delete: (params: DeleteServiceParams, options?: RequestOptions$1) => Promise<void>;
642
- get: (params: GetServiceParams, options?: RequestOptions$1) => Promise<Service>;
643
- find: (params: GetServicesParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Service>>;
644
- getAvailability: (params: GetAvailabilityParams, options?: RequestOptions$1) => Promise<AvailabilityResponse>;
645
- findProviders: (params: FindServiceProvidersParams, options?: RequestOptions$1) => Promise<ServiceProvider[]>;
646
- createProvider: (params: CreateServiceProviderParams, options?: RequestOptions$1) => Promise<ServiceProvider>;
647
- updateProvider: (params: UpdateServiceProviderParams, options?: RequestOptions$1) => Promise<ServiceProvider>;
648
- deleteProvider: (params: DeleteServiceProviderParams, options?: RequestOptions$1) => Promise<void>;
649
- };
650
- provider: {
651
- create: (params: CreateProviderParams, options?: RequestOptions$1) => Promise<Provider>;
652
- update: (params: UpdateProviderParams, options?: RequestOptions$1) => Promise<Provider>;
653
- delete: (params: DeleteProviderParams, options?: RequestOptions$1) => Promise<void>;
654
- get: (params: GetProviderParams, options?: RequestOptions$1) => Promise<Provider>;
655
- find: (params: GetProvidersParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Provider>>;
656
- };
657
- promoCode: {
658
- createPromoCode(params: CreatePromoCodeParams, options?: RequestOptions$1): Promise<PromoCode>;
659
- updatePromoCode(params: UpdatePromoCodeParams, options?: RequestOptions$1): Promise<PromoCode>;
660
- deletePromoCode(params: DeletePromoCodeParams, options?: RequestOptions$1): Promise<{
661
- deleted: boolean;
662
- }>;
663
- getPromoCode(params: GetPromoCodeParams, options?: RequestOptions$1): Promise<PromoCode>;
664
- getPromoCodes(params: GetPromoCodesParams, options?: RequestOptions$1): Promise<PaginatedResponse<PromoCode>>;
665
- };
666
- };
667
- crm: {
668
- customer: {
669
- create: (params: CreateCustomerParams, options?: RequestOptions$1) => Promise<Customer>;
670
- get: (params: GetCustomerParams, options?: RequestOptions$1) => Promise<CustomerDetail>;
671
- find: (params?: FindCustomersParams, options?: RequestOptions$1) => Promise<{
672
- items: Customer[];
673
- cursor?: string;
674
- }>;
675
- update: (params: UpdateCustomerParams, options?: RequestOptions$1) => Promise<Customer>;
676
- merge: (params: MergeCustomersParams, options?: RequestOptions$1) => Promise<Customer>;
677
- revokeToken: (params: {
678
- id: string;
679
- token_id: string;
680
- store_id?: string;
681
- }, options?: RequestOptions$1) => Promise<{
682
- deleted: boolean;
683
- }>;
684
- revokeAllTokens: (params: {
685
- id: string;
686
- store_id?: string;
687
- }, options?: RequestOptions$1) => Promise<{
688
- deleted: boolean;
689
- }>;
690
- };
691
- audience: {
692
- create: (params: CreateAudienceParams, options?: RequestOptions$1) => Promise<Audience>;
693
- update: (params: UpdateAudienceParams, options?: RequestOptions$1) => Promise<Audience>;
694
- get: (params: GetAudienceParams, options?: RequestOptions$1) => Promise<Audience>;
695
- find: (params: GetAudiencesParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Audience>>;
696
- getSubscribers: (params: GetAudienceSubscribersParams, options?: RequestOptions$1) => Promise<{
697
- items: AudienceSubscriber[];
698
- cursor?: string | null;
699
- }>;
700
- addSubscriber: (params: AddAudienceSubscriberParams, options?: RequestOptions$1) => Promise<AddAudienceSubscriberResponse>;
701
- removeSubscriber: (params: RemoveAudienceSubscriberParams, options?: RequestOptions$1) => Promise<{
702
- deleted: boolean;
703
- }>;
704
- };
705
- activity: {
706
- timeline(params: TimelineParams, options?: RequestOptions$1): Promise<{
707
- items: Activity[];
708
- cursor: string | null;
709
- }>;
710
- find(params: FindActivitiesParams, options?: RequestOptions$1): Promise<{
711
- items: Activity[];
712
- cursor: string | null;
713
- }>;
714
- };
715
- };
716
- automation: {
717
- agent: {
718
- create: (params: CreateAgentParams, options?: RequestOptions$1) => Promise<Agent>;
719
- update: (params: UpdateAgentParams, options?: RequestOptions$1) => Promise<Agent>;
720
- delete: (params: DeleteAgentParams, options?: RequestOptions$1) => Promise<{
721
- deleted: boolean;
722
- }>;
723
- get: (params: GetAgentParams, options?: RequestOptions$1) => Promise<Agent>;
724
- find: (params?: GetAgentsParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Agent>>;
725
- sendMessage: (params: RunAgentParams, options?: RequestOptions$1) => Promise<AgentChatMessage>;
726
- getChats: (params: GetAgentChatsParams, options?: RequestOptions$1) => Promise<PaginatedResponse<AgentChat>>;
727
- getChat: (params: GetAgentChatParams, options?: RequestOptions$1) => Promise<AgentChat>;
728
- updateChat: (params: UpdateAgentChatParams, options?: RequestOptions$1) => Promise<AgentChat>;
729
- rateChat: (params: RateAgentChatParams, options?: RequestOptions$1) => Promise<AgentChat>;
730
- getStoreChats: (params: GetStoreChatsParams, options?: RequestOptions$1) => Promise<PaginatedResponse<AgentChat>>;
731
- getChatMessages: (params: GetAgentChatParams & {
732
- limit?: number;
733
- }, options?: RequestOptions$1) => Promise<PaginatedResponse<AgentChatMessage>>;
734
- };
735
- workflow: {
736
- create: (params: CreateWorkflowParams, options?: RequestOptions$1) => Promise<Workflow>;
737
- update: (params: UpdateWorkflowParams, options?: RequestOptions$1) => Promise<Workflow>;
738
- delete: (params: DeleteWorkflowParams, options?: RequestOptions$1) => Promise<{
739
- deleted: boolean;
740
- }>;
741
- get: (params: GetWorkflowParams, options?: RequestOptions$1) => Promise<Workflow>;
742
- find: (params?: GetWorkflowsParams, options?: RequestOptions$1) => Promise<PaginatedResponse<Workflow>>;
743
- trigger: (params: TriggerWorkflowParams, options?: RequestOptions$1) => Promise<WorkflowExecution>;
744
- getExecutions: (params: GetWorkflowExecutionsParams, options?: RequestOptions$1) => Promise<PaginatedResponse<WorkflowExecution>>;
745
- getExecution: (params: GetWorkflowExecutionParams, options?: RequestOptions$1) => Promise<WorkflowExecution>;
746
- };
747
- };
748
- analytics: {
749
- get(request: AnalyticsRequest, options?: RequestOptions$1 & {
750
- store_id?: string;
751
- }): Promise<AnalyticsResponse>;
752
- };
753
- setStoreId: (storeId: string) => void;
754
- getStoreId: () => string;
755
- setMarket: (market: string) => void;
756
- getMarket: () => string;
757
- setLocale: (locale: string) => void;
758
- getLocale: () => string;
759
- readonly session: AdminSession | null;
760
- readonly isAuthenticated: boolean;
761
- onAuthStateChanged(listener: AuthStateListener<AdminSession>): () => void;
762
- logout(): Promise<void>;
763
- extractBlockValues: typeof extractBlockValues;
764
- utils: {
765
- getImageUrl: (imageBlock: any, isBlock?: boolean) => any;
766
- getBlockValue: (entry: any, blockKey: string) => any;
767
- getBlockTextValue: (block: any, locale?: string) => string;
768
- getBlockValues: (entry: any, blockKey: string) => any;
769
- getBlockLabel: typeof getBlockLabel;
770
- getBlockObjectValues: (entry: any, blockKey: string, locale?: string) => any;
771
- getBlockFromArray: (entry: any, blockKey: string, locale?: string) => any;
772
- formatBlockValue: typeof formatBlockValue;
773
- prepareBlocksForSubmission: typeof prepareBlocksForSubmission;
774
- extractBlockValues: typeof extractBlockValues;
775
- formatPrice: (prices: any[]) => string;
776
- getPriceAmount: (prices: any[]) => number;
777
- formatPayment: typeof formatPayment;
778
- formatMinor: typeof formatMinor;
779
- getCurrencySymbol: typeof getCurrencySymbol;
780
- getCurrencyName: typeof getCurrencyName;
781
- validatePhoneNumber: typeof validatePhoneNumber;
782
- tzGroups: {
783
- label: string;
784
- zones: {
785
- label: string;
786
- value: string;
787
- }[];
788
- }[];
789
- findTimeZone: typeof findTimeZone;
790
- slugify: typeof slugify;
791
- humanize: typeof humanize;
792
- categorify: typeof categorify;
793
- formatDate: typeof formatDate;
794
- getSvgContentForAstro: typeof getSvgContentForAstro;
795
- fetchSvgContent: typeof fetchSvgContent;
796
- injectSvgIntoElement: typeof injectSvgIntoElement;
797
- isValidKey: typeof isValidKey;
798
- validateKey: typeof validateKey;
799
- toKey: typeof toKey;
800
- nameToKey: typeof nameToKey;
801
- getAvailableStock: typeof getAvailableStock;
802
- getReservedStock: typeof getReservedStock;
803
- hasStock: typeof hasStock;
804
- getInventoryAt: typeof getInventoryAt;
805
- getFirstAvailableFCId: typeof getFirstAvailableFCId;
806
- };
807
- };
808
- type CreateStorefrontConfig = Omit<HttpClientConfig, "authStorage" | "storeId"> & {
809
- storeId: string;
810
- market?: string;
811
- locale?: string;
812
- apiToken?: string;
813
- };
814
- declare function createStorefront(config: CreateStorefrontConfig): {
815
- identify: (params?: {
816
- email?: string;
817
- verify?: boolean;
818
- market?: string;
819
- }) => Promise<CustomerSession>;
820
- verify: (params: {
821
- code: string;
822
- }) => Promise<CustomerToken>;
823
- logout: () => Promise<void>;
824
- me: () => Promise<CustomerDetail>;
825
- readonly session: CustomerSession | null;
826
- readonly isAuthenticated: boolean;
827
- onAuthStateChanged(listener: AuthStateListener<CustomerSession>): () => void;
828
- store: {
829
- getStore(options?: RequestOptions$1): Promise<Store>;
830
- location: {
831
- getCountries(options?: RequestOptions$1): Promise<{
832
- items: {
833
- code: string;
834
- name: string;
835
- states: {
836
- code: string;
837
- name: string;
838
- }[];
839
- }[];
840
- cursor: string | null;
841
- }>;
842
- getCountry(countryCode: string, options?: RequestOptions$1): Promise<{
843
- code: string;
844
- name: string;
845
- states: {
846
- code: string;
847
- name: string;
848
- }[];
849
- }>;
850
- list(options?: RequestOptions$1): Promise<Location[]>;
851
- get(id: string, options?: RequestOptions$1): Promise<Location>;
852
- };
853
- market: {
854
- list(options?: RequestOptions$1): Promise<Market[]>;
855
- get(id: string, options?: RequestOptions$1): Promise<Market>;
856
- };
857
- };
858
- cart: CartController;
859
- cms: {
860
- node: {
861
- get(params: GetNodeParams, options?: RequestOptions$1): Promise<{
862
- getBlock(key: string): any;
863
- getBlockValues(key: string): any;
864
- getImage(key: string): any;
865
- id: string;
866
- key: string;
867
- store_id: string;
868
- parent_id?: string | null;
869
- blocks: Block[];
870
- taxonomies: TaxonomyEntry[];
871
- status: NodeStatus;
872
- slug: Record<string, string>;
873
- children: Node[];
874
- created_at: number;
875
- updated_at: number;
876
- }>;
877
- find(params: GetNodesParams, options?: RequestOptions$1): Promise<PaginatedResponse<Node>>;
878
- getChildren(params: GetNodeChildrenParams, options?: RequestOptions$1): Promise<PaginatedResponse<Node>>;
879
- };
880
- form: {
881
- get(params: GetFormParams, options?: RequestOptions$1): Promise<Form>;
882
- submit(params: SubmitFormParams, options?: RequestOptions$1): Promise<FormSubmission>;
883
- };
884
- taxonomy: {
885
- get(params: GetTaxonomyParams, options?: RequestOptions$1): Promise<Taxonomy>;
886
- getChildren(params: GetTaxonomyChildrenParams, options?: RequestOptions$1): Promise<PaginatedResponse<Taxonomy>>;
887
- };
888
- };
889
- eshop: {
890
- product: {
891
- get(params: GetProductParams, options?: RequestOptions$1): Promise<Product>;
892
- find(params: GetProductsParams, options?: RequestOptions$1): Promise<PaginatedResponse<Product>>;
893
- };
894
- cart: {
895
- current(params?: GetCurrentCartParams, options?: RequestOptions$1): Promise<Cart>;
896
- get(params: GetCartParams, options?: RequestOptions$1): Promise<Cart>;
897
- update(params: UpdateCartParams, options?: RequestOptions$1): Promise<Cart>;
898
- addItem(params: AddCartItemParams, options?: RequestOptions$1): Promise<Cart>;
899
- removeItem(params: RemoveCartItemParams, options?: RequestOptions$1): Promise<Cart>;
900
- clear(params: ClearCartParams, options?: RequestOptions$1): Promise<Cart>;
901
- quote(params: QuoteCartParams, options?: RequestOptions$1): Promise<OrderQuote>;
902
- checkout(params: CheckoutCartParams, options?: RequestOptions$1): Promise<OrderCheckoutResult>;
903
- };
904
- order: {
905
- get(params: GetOrderParams, options?: RequestOptions$1): Promise<Order>;
906
- find(params: GetOrdersParams, options?: RequestOptions$1): Promise<PaginatedResponse<Order>>;
907
- };
908
- service: {
909
- get(params: GetServiceParams, options?: RequestOptions$1): Promise<Service>;
910
- find(params: GetServicesParams, options?: RequestOptions$1): Promise<PaginatedResponse<Service>>;
911
- findProviders(params: FindServiceProvidersParams, options?: RequestOptions$1): Promise<Provider[]>;
912
- getAvailability(params: GetAvailabilityParams, options?: RequestOptions$1): Promise<AvailabilityResponse>;
913
- };
914
- provider: {
915
- get(params: GetProviderParams, options?: RequestOptions$1): Promise<Provider>;
916
- find(params: GetProvidersParams, options?: RequestOptions$1): Promise<PaginatedResponse<Provider>>;
917
- };
918
- };
919
- crm: {
920
- customer: {
921
- identify(params?: {
922
- email?: string;
923
- verify?: boolean;
924
- market?: string;
925
- }, options?: RequestOptions$1): Promise<IdentifyResponse>;
926
- verify(params: {
927
- code: string;
928
- }, options?: RequestOptions$1): Promise<VerifyResponse>;
929
- logout(options?: RequestOptions$1): Promise<void>;
930
- getMe(options?: RequestOptions$1): Promise<CustomerDetail>;
931
- };
932
- audience: {
933
- get(params: GetAudienceParams, options?: RequestOptions$1): Promise<Audience>;
934
- find(params: GetAudiencesParams, options?: RequestOptions$1): Promise<PaginatedResponse<Audience>>;
935
- subscribe(params: SubscribeAudienceParams, options?: RequestOptions$1): Promise<AudienceSubscribeResponse>;
936
- checkAccess(params: {
937
- id: string;
938
- }, options?: RequestOptions$1): Promise<AudienceAccessResponse>;
939
- unsubscribe(token: string, options?: RequestOptions$1): Promise<{
940
- unsubscribed: boolean;
941
- }>;
942
- confirm(token: string, options?: RequestOptions$1): Promise<{
943
- confirmed: boolean;
944
- }>;
945
- };
946
- };
947
- activity: {
948
- COMMON_ACTIVITY_TYPES: readonly ["page_view", "product_view", "service_view", "provider_view", "cart_added", "cart_removed", "checkout_started", "purchase", "order_created", "signin", "signup", "verified_email", "search", "share", "wishlist_added"];
949
- track(params: TrackParams): Promise<void>;
950
- };
951
- automation: {
952
- agent: {
953
- getAgents(params?: GetAgentsParams, options?: RequestOptions$1): Promise<PaginatedResponse<Agent>>;
954
- getAgent(params: {
955
- id: string;
956
- store_id?: string;
957
- }, options?: RequestOptions$1): Promise<Agent>;
958
- sendMessage(params: {
959
- id: string;
960
- message: string;
961
- chat_id?: string;
962
- store_id?: string;
963
- }, options?: RequestOptions$1): Promise<AgentChatMessage>;
964
- getChat(params: {
965
- id: string;
966
- chat_id: string;
967
- store_id?: string;
968
- }, options?: RequestOptions$1): Promise<AgentChat>;
969
- getChatMessages(params: {
970
- id: string;
971
- chat_id: string;
972
- limit?: number;
973
- store_id?: string;
974
- }, options?: RequestOptions$1): Promise<PaginatedResponse<AgentChatMessage>>;
975
- rateChat(params: {
976
- id: string;
977
- chat_id: string;
978
- rating: number;
979
- comment?: string;
980
- store_id?: string;
981
- }, options?: RequestOptions$1): Promise<AgentChat>;
982
- };
983
- };
984
- setStoreId: (storeId: string) => void;
985
- getStoreId: () => string;
986
- setMarket: (key: string) => void;
987
- getMarket: () => string;
988
- setLocale: (l: string) => void;
989
- getLocale: () => string;
990
- extractBlockValues: typeof extractBlockValues;
991
- utils: {
992
- getImageUrl: (imageBlock: any, isBlock?: boolean) => any;
993
- getBlockValue: (entry: any, blockKey: string) => any;
994
- getBlockTextValue: (block: any, locale?: string) => string;
995
- getBlockValues: (entry: any, blockKey: string) => any;
996
- getBlockLabel: typeof getBlockLabel;
997
- getBlockObjectValues: (entry: any, blockKey: string, locale?: string) => any;
998
- getBlockFromArray: (entry: any, blockKey: string, locale?: string) => any;
999
- formatBlockValue: typeof formatBlockValue;
1000
- prepareBlocksForSubmission: typeof prepareBlocksForSubmission;
1001
- extractBlockValues: typeof extractBlockValues;
1002
- formatPrice: (prices: any[]) => string;
1003
- getPriceAmount: (prices: any[]) => number;
1004
- formatPayment: typeof formatPayment;
1005
- formatMinor: typeof formatMinor;
1006
- getCurrencySymbol: typeof getCurrencySymbol;
1007
- getCurrencyName: typeof getCurrencyName;
1008
- validatePhoneNumber: typeof validatePhoneNumber;
1009
- tzGroups: {
1010
- label: string;
1011
- zones: {
1012
- label: string;
1013
- value: string;
1014
- }[];
1015
- }[];
1016
- findTimeZone: typeof findTimeZone;
1017
- slugify: typeof slugify;
1018
- humanize: typeof humanize;
1019
- categorify: typeof categorify;
1020
- formatDate: typeof formatDate;
1021
- getSvgContentForAstro: typeof getSvgContentForAstro;
1022
- fetchSvgContent: typeof fetchSvgContent;
1023
- injectSvgIntoElement: typeof injectSvgIntoElement;
1024
- isValidKey: typeof isValidKey;
1025
- validateKey: typeof validateKey;
1026
- toKey: typeof toKey;
1027
- nameToKey: typeof nameToKey;
1028
- getAvailableStock: typeof getAvailableStock;
1029
- getReservedStock: typeof getReservedStock;
1030
- hasStock: typeof hasStock;
1031
- getInventoryAt: typeof getInventoryAt;
1032
- getFirstAvailableFCId: typeof getFirstAvailableFCId;
1033
- };
1034
- };
1035
-
1036
- export { type AnalyticsReportKey as $, type AuthStateListener as A, type CartControllerListener as B, type CreateStorefrontConfig as C, type CartControllerQuoteParams as D, type CartControllerRefreshParams as E, type CartControllerRemoveItemParams as F, type CartControllerState as G, type CartControllerUpdateParams as H, type IdentifyResponse as I, type HttpClientConfig as J, type AuthStorage as K, SUPPORTED_FRAMEWORKS as L, type ApiConfig as M, type AdminSessionInternal as N, type CustomerSessionInternal as O, type AdminSession as P, type AdminSessionUpdater as Q, type CustomerSessionUpdater as R, SDK_VERSION as S, type TrackParams as T, type CreateAdminConfig as U, type VerifyResponse as V, createAdmin as W, type LocationState as X, type LocationCountry as Y, type GetCountriesResponse as Z, type AnalyticsTimeRange as _, type CustomerSession as a, type AnalyticsReportRequest as a0, type AnalyticsRequest as a1, type AnalyticsMetricData as a2, type AnalyticsBreakdownItem as a3, type AnalyticsBreakdownData as a4, type AnalyticsReport as a5, type AnalyticsResponse as a6, type ActivityFeedCategory as a7, type ActivityFeedItem as a8, type ActivityFeedSummary as a9, type ActivityFeedCursor as aa, type ActivityFeedData as ab, type TimelineParams as ac, type IntegrationOperation as ad, type IntegrationResource as ae, type IntegrationService as af, type CustomerToken as b, type CartController as c, findTimeZone as d, extractBlockValues as e, formatBlockValue as f, getBlockLabel as g, humanize as h, categorify as i, formatDate as j, getSvgContentForAstro as k, fetchSvgContent as l, injectSvgIntoElement as m, type Activity$1 as n, COMMON_ACTIVITY_TYPES as o, prepareBlocksForSubmission as p, createStorefront as q, createCartController as r, slugify as s, type CommonActivityType as t, type CartApi as u, validatePhoneNumber as v, type CartControllerAddItemParams as w, type CartControllerCheckoutParams as x, type CartControllerClearParams as y, type CartControllerInitParams as z };