@fire-spark/core 0.0.1

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 (3) hide show
  1. package/dist/index.d.ts +3399 -0
  2. package/dist/index.js +5021 -0
  3. package/package.json +71 -0
@@ -0,0 +1,3399 @@
1
+ import { AndConditions, CheckoutMode, CheckoutResolved, Condition, CustomerIdentifyInput, CustomerRegisterInput, CustomerUpdateInput, FulfillmentListInput, GroupDisplayType, KioskDeviceConfig, KioskDeviceOverrides, KioskHealthBatchInput, KioskHealthBatchResult, KioskHeartbeatInput, KioskHeartbeatResult, KioskRealtimeToken, MatchResult, MatchableRule, Menu, Menu as Menu$1, MenuLookup, MenuLookup as MenuLookup$1, ModifierControlType, ModifierGroup, OrConditions, Order as Order$1, Order as Order$2, OrderInsertInput, OrderLine, OrderListInput, OrderReorderInput, OrderTotals, OrderUpdateInput, OrderValidateInput, OrderValidateOutput, PaymentIntentInput, PaymentMethod, PaymentProvider, PricingModifier, Product, Product as Product$1, Recommendation, RecurringDateCronResult, RecurringDateCronValues, RulesEngineOrderLine, RulesEngineParams, RulesEngineRuntime, Schedule, StoreListInput, StoreNearbyInput, StorefrontAvailability, StorefrontMenuScope, StorefrontMenuStreamOptions, StorefrontPaymentsListInput } from "@fire-spark/types";
2
+ //#region src/productCustomization/types.d.ts
3
+ type SelectionStatus = "IDLE" | "INCOMPLETE" | "VALID" | "INVALID";
4
+ type CustomizationPath = string;
5
+ type QuantitiesByPath = Record<CustomizationPath, number>;
6
+ interface Snapshot {
7
+ productId: string;
8
+ quantities: QuantitiesByPath;
9
+ }
10
+ interface CreateSessionOptions {
11
+ initial?: QuantitiesByPath;
12
+ snapshot?: Snapshot;
13
+ }
14
+ interface ValidateOptions {
15
+ soft?: boolean;
16
+ }
17
+ interface ResetOptions {
18
+ force?: boolean;
19
+ }
20
+ interface ProductCtx {
21
+ path: CustomizationPath;
22
+ min: number;
23
+ max: number;
24
+ quantity: number;
25
+ required: boolean;
26
+ status: SelectionStatus;
27
+ data: Product;
28
+ groups: ModifierGroupCtx[];
29
+ onChange: (quantity: number) => void;
30
+ validate: (options?: ValidateOptions) => SelectionStatus;
31
+ reset: (options?: ResetOptions) => void;
32
+ }
33
+ interface ModifierGroupCtx {
34
+ path: CustomizationPath;
35
+ min: number;
36
+ max: number;
37
+ required: boolean;
38
+ status: SelectionStatus;
39
+ data: ModifierGroup;
40
+ display: GroupDisplayType;
41
+ selectedQuantity: number;
42
+ modifiers: ModifierCtx[];
43
+ }
44
+ interface ModifierCtx {
45
+ path: CustomizationPath;
46
+ min: number;
47
+ max: number;
48
+ quantity: number;
49
+ required: boolean;
50
+ status: SelectionStatus;
51
+ data: Product;
52
+ type: ModifierControlType;
53
+ product: ProductCtx | null;
54
+ onChange: (quantity: number) => void;
55
+ linePrice: number;
56
+ }
57
+ interface CustomizationSession {
58
+ root: ProductCtx;
59
+ subscribe: (listener: () => void) => () => void;
60
+ snapshot: () => Snapshot;
61
+ totalPrice: () => number;
62
+ validate: (options?: ValidateOptions) => SelectionStatus;
63
+ reset: (options?: ResetOptions) => void;
64
+ }
65
+ //#endregion
66
+ //#region src/productCustomization/createSession.d.ts
67
+ declare const createSession: (lookup: MenuLookup$1, productId: string, options?: CreateSessionOptions) => CustomizationSession;
68
+ //#endregion
69
+ //#region src/productCustomization/flattenCategories.d.ts
70
+ interface MenuCategoryNode {
71
+ id: string;
72
+ items: Array<{
73
+ type: "CATEGORY" | "PRODUCT";
74
+ id: string;
75
+ }>;
76
+ }
77
+ interface FlatMenuCategory<T extends MenuCategoryNode> {
78
+ category: T;
79
+ depth: number;
80
+ instanceId: string;
81
+ }
82
+ interface NestedMenuCategory<T extends MenuCategoryNode> {
83
+ category: T;
84
+ depth: number;
85
+ instanceId: string;
86
+ children: NestedMenuCategory<T>[];
87
+ }
88
+ declare const nestMenuCategories: <T extends MenuCategoryNode>(sections: FlatMenuCategory<T>[]) => NestedMenuCategory<T>[];
89
+ declare const flattenMenuCategories: <T extends MenuCategoryNode>(categories: T[], categoriesById: Map<string, T>, options?: {
90
+ include?: (category: T) => boolean;
91
+ }) => FlatMenuCategory<T>[];
92
+ //#endregion
93
+ //#region src/productCustomization/fromOrderLines.d.ts
94
+ /**
95
+ * Inverse of {@link toOrderLines}: rebuild a {@link Snapshot} from a root cart
96
+ * line so {@link createSession} can reopen it via `{ snapshot }`.
97
+ */
98
+ declare const fromOrderLines: (root: OrderLine, lines: OrderLine[], lookup: MenuLookup$1) => Snapshot;
99
+ //#endregion
100
+ //#region src/productCustomization/menu.d.ts
101
+ declare const indexMenu: (menu: Menu$1) => MenuLookup$1;
102
+ //#endregion
103
+ //#region src/productCustomization/toOrderLines.d.ts
104
+ /** Flatten a customized product tree into priced OrderLine rows. */
105
+ declare const toOrderLines: (root: ProductCtx, locale: string) => OrderLine[];
106
+ //#endregion
107
+ //#region src/shared/baseUrl.d.ts
108
+ declare const resolveBaseUrl: (baseUrl?: string) => string;
109
+ //#endregion
110
+ //#region src/auth/types.d.ts
111
+ type StorefrontAccessToken = {
112
+ access_token: string;
113
+ token_type: "Bearer";
114
+ expires_in: number;
115
+ };
116
+ type AuthConfigureBase = {
117
+ baseUrl?: string;
118
+ fetchImpl?: typeof fetch;
119
+ tokenSkewMs?: number;
120
+ };
121
+ /** Default: exchange an IdP id_token (Firebase, …) for a storefront token. */
122
+ type AuthConfigureSubjectOptions = AuthConfigureBase & {
123
+ getSubjectToken: () => Promise<string>;
124
+ getAccessToken?: never;
125
+ };
126
+ /**
127
+ * Pre-issued storefront token (call center agent, chat handoff, …).
128
+ * Called again when the cached token is about to expire.
129
+ */
130
+ type AuthConfigureAccessTokenOptions = AuthConfigureBase & {
131
+ getAccessToken: () => Promise<StorefrontAccessToken>;
132
+ getSubjectToken?: never;
133
+ };
134
+ type AuthConfigureOptions = AuthConfigureSubjectOptions | AuthConfigureAccessTokenOptions;
135
+ type ExchangeOptions = {
136
+ baseUrl?: string;
137
+ fetchImpl?: typeof fetch;
138
+ };
139
+ //#endregion
140
+ //#region src/auth/auth.d.ts
141
+ declare const configure: (options: AuthConfigureOptions) => void;
142
+ declare const getBaseUrl: () => string;
143
+ declare const clear: () => void;
144
+ declare const getAccessToken: () => Promise<string>;
145
+ //#endregion
146
+ //#region src/auth/exchange.d.ts
147
+ declare const exchangeSubjectToken: (subjectToken: string, options?: ExchangeOptions) => Promise<StorefrontAccessToken>;
148
+ //#endregion
149
+ //#region src/auth/index.d.ts
150
+ declare const auth: {
151
+ configure: typeof configure;
152
+ getAccessToken: typeof getAccessToken;
153
+ getBaseUrl: typeof getBaseUrl;
154
+ clear: typeof clear;
155
+ exchangeSubjectToken: typeof exchangeSubjectToken;
156
+ resolveBaseUrl: typeof resolveBaseUrl;
157
+ };
158
+ //#endregion
159
+ //#region src/order/customer.d.ts
160
+ type OrderCustomerSource = {
161
+ name: string;
162
+ email?: string | null;
163
+ phone?: string | null;
164
+ };
165
+ /** Builds the order `customer` snapshot sent on create/update. */
166
+ declare const buildCustomerSnapshot: (source: OrderCustomerSource) => Order$1["customer"];
167
+ //#endregion
168
+ //#region src/services/http.d.ts
169
+ type ServiceHttpOptions = {
170
+ baseUrl?: string;
171
+ accessToken?: string;
172
+ fetchImpl?: typeof fetch;
173
+ signal?: AbortSignal;
174
+ };
175
+ declare class StorefrontHttpError extends Error {
176
+ status: number;
177
+ code?: string;
178
+ constructor(message: string, status: number, code?: string);
179
+ }
180
+ declare const isStorefrontNotFound: (error: unknown) => boolean;
181
+ declare const storefrontJson: <T>(path: string, init?: RequestInit, options?: ServiceHttpOptions) => Promise<T>;
182
+ //#endregion
183
+ //#region src/services/orders.d.ts
184
+ declare const listOrders: (input?: OrderListInput, options?: ServiceHttpOptions) => Promise<{
185
+ uid: string;
186
+ id: string;
187
+ brand_id?: string | null | undefined;
188
+ store_id: string;
189
+ channel_id: string;
190
+ customer_id: string;
191
+ fulfillment_id: string;
192
+ is_anonymous: boolean;
193
+ lines: {
194
+ type: "FEE" | "PRODUCT";
195
+ uid: string;
196
+ id: string;
197
+ parent_uid: string | null;
198
+ parent_id: string | null;
199
+ name: string;
200
+ image_url?: string | undefined;
201
+ menu_id?: string | undefined;
202
+ internal_attribution_source?: string | undefined;
203
+ internal_attribution_id?: string | undefined;
204
+ metadata: Record<string, unknown>;
205
+ bundled_items: {
206
+ id: string;
207
+ refund_price: number;
208
+ included_quantity: number;
209
+ }[];
210
+ redeem: {
211
+ id: string;
212
+ amount: number;
213
+ value: number;
214
+ }[];
215
+ quantity: number;
216
+ tax_rate: number | null;
217
+ discount_rate: number;
218
+ unit_subtotal: number;
219
+ unit_discount: number;
220
+ unit_tax_total: number;
221
+ unit_total: number;
222
+ subtotal: number;
223
+ discount_total: number;
224
+ tax_total: number;
225
+ total: number;
226
+ unit_group_subtotal: number;
227
+ unit_group_discount: number;
228
+ unit_group_tax_total: number;
229
+ unit_group_total: number;
230
+ group_subtotal: number;
231
+ group_discount: number;
232
+ group_tax_total: number;
233
+ group_total: number;
234
+ }[];
235
+ redeem: {
236
+ id: string;
237
+ amount: number;
238
+ value: number;
239
+ }[];
240
+ customer: {
241
+ customer_info: {
242
+ display_name: string;
243
+ first_name: string;
244
+ middle_name?: string | undefined;
245
+ last_name: string;
246
+ second_last_name?: string | undefined;
247
+ email: string;
248
+ phone: string;
249
+ gender?: "FEMALE" | "MALE" | undefined;
250
+ dob?: string | undefined;
251
+ document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
252
+ document_number?: string | undefined;
253
+ city?: string | undefined;
254
+ country?: string | undefined;
255
+ };
256
+ address_info?: {
257
+ address_line1: string;
258
+ address_line2?: string | undefined;
259
+ city?: string | undefined;
260
+ state?: string | undefined;
261
+ zip?: string | undefined;
262
+ country?: string | undefined;
263
+ reference?: string | undefined;
264
+ latitude?: number | undefined;
265
+ longitude?: number | undefined;
266
+ instructions?: string | undefined;
267
+ metadata: Record<string, unknown> | null;
268
+ } | null | undefined;
269
+ billing_info?: {
270
+ type: "BUSINESS" | "INDIVIDUAL";
271
+ legal_name: string;
272
+ address_line1: string;
273
+ address_line2?: string | undefined;
274
+ city?: string | undefined;
275
+ state?: string | undefined;
276
+ zip?: string | undefined;
277
+ country?: string | undefined;
278
+ tax_id: string;
279
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
280
+ metadata: Record<string, unknown> | null;
281
+ } | null | undefined;
282
+ };
283
+ payment_intents: {
284
+ id?: string | undefined;
285
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
286
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
287
+ collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
288
+ status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
289
+ totals: {
290
+ currency: string;
291
+ subtotal: number;
292
+ discount_rate: number;
293
+ discount_total: number;
294
+ tax_rate: number;
295
+ tax_total: number;
296
+ total: number;
297
+ };
298
+ error_message?: string | undefined;
299
+ placed_at: string;
300
+ resolved_at?: string | undefined;
301
+ metadata: Record<string, unknown>;
302
+ }[];
303
+ totals: {
304
+ currency: string;
305
+ subtotal: number;
306
+ discount_rate: number;
307
+ discount_total: number;
308
+ tax_rate: number;
309
+ tax_total: number;
310
+ total: number;
311
+ };
312
+ metadata: Record<string, unknown>;
313
+ payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
314
+ fulfillment_status: string;
315
+ status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
316
+ issued_at?: string | null | undefined;
317
+ resolved_at?: string | null | undefined;
318
+ }[]>;
319
+ declare const createOrder: (body: OrderInsertInput, options?: ServiceHttpOptions) => Promise<{
320
+ uid: string;
321
+ id: string;
322
+ brand_id?: string | null | undefined;
323
+ store_id: string;
324
+ channel_id: string;
325
+ customer_id: string;
326
+ fulfillment_id: string;
327
+ is_anonymous: boolean;
328
+ lines: {
329
+ type: "FEE" | "PRODUCT";
330
+ uid: string;
331
+ id: string;
332
+ parent_uid: string | null;
333
+ parent_id: string | null;
334
+ name: string;
335
+ image_url?: string | undefined;
336
+ menu_id?: string | undefined;
337
+ internal_attribution_source?: string | undefined;
338
+ internal_attribution_id?: string | undefined;
339
+ metadata: Record<string, unknown>;
340
+ bundled_items: {
341
+ id: string;
342
+ refund_price: number;
343
+ included_quantity: number;
344
+ }[];
345
+ redeem: {
346
+ id: string;
347
+ amount: number;
348
+ value: number;
349
+ }[];
350
+ quantity: number;
351
+ tax_rate: number | null;
352
+ discount_rate: number;
353
+ unit_subtotal: number;
354
+ unit_discount: number;
355
+ unit_tax_total: number;
356
+ unit_total: number;
357
+ subtotal: number;
358
+ discount_total: number;
359
+ tax_total: number;
360
+ total: number;
361
+ unit_group_subtotal: number;
362
+ unit_group_discount: number;
363
+ unit_group_tax_total: number;
364
+ unit_group_total: number;
365
+ group_subtotal: number;
366
+ group_discount: number;
367
+ group_tax_total: number;
368
+ group_total: number;
369
+ }[];
370
+ redeem: {
371
+ id: string;
372
+ amount: number;
373
+ value: number;
374
+ }[];
375
+ customer: {
376
+ customer_info: {
377
+ display_name: string;
378
+ first_name: string;
379
+ middle_name?: string | undefined;
380
+ last_name: string;
381
+ second_last_name?: string | undefined;
382
+ email: string;
383
+ phone: string;
384
+ gender?: "FEMALE" | "MALE" | undefined;
385
+ dob?: string | undefined;
386
+ document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
387
+ document_number?: string | undefined;
388
+ city?: string | undefined;
389
+ country?: string | undefined;
390
+ };
391
+ address_info?: {
392
+ address_line1: string;
393
+ address_line2?: string | undefined;
394
+ city?: string | undefined;
395
+ state?: string | undefined;
396
+ zip?: string | undefined;
397
+ country?: string | undefined;
398
+ reference?: string | undefined;
399
+ latitude?: number | undefined;
400
+ longitude?: number | undefined;
401
+ instructions?: string | undefined;
402
+ metadata: Record<string, unknown> | null;
403
+ } | null | undefined;
404
+ billing_info?: {
405
+ type: "BUSINESS" | "INDIVIDUAL";
406
+ legal_name: string;
407
+ address_line1: string;
408
+ address_line2?: string | undefined;
409
+ city?: string | undefined;
410
+ state?: string | undefined;
411
+ zip?: string | undefined;
412
+ country?: string | undefined;
413
+ tax_id: string;
414
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
415
+ metadata: Record<string, unknown> | null;
416
+ } | null | undefined;
417
+ };
418
+ payment_intents: {
419
+ id?: string | undefined;
420
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
421
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
422
+ collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
423
+ status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
424
+ totals: {
425
+ currency: string;
426
+ subtotal: number;
427
+ discount_rate: number;
428
+ discount_total: number;
429
+ tax_rate: number;
430
+ tax_total: number;
431
+ total: number;
432
+ };
433
+ error_message?: string | undefined;
434
+ placed_at: string;
435
+ resolved_at?: string | undefined;
436
+ metadata: Record<string, unknown>;
437
+ }[];
438
+ totals: {
439
+ currency: string;
440
+ subtotal: number;
441
+ discount_rate: number;
442
+ discount_total: number;
443
+ tax_rate: number;
444
+ tax_total: number;
445
+ total: number;
446
+ };
447
+ metadata: Record<string, unknown>;
448
+ payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
449
+ fulfillment_status: string;
450
+ status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
451
+ issued_at?: string | null | undefined;
452
+ resolved_at?: string | null | undefined;
453
+ }>;
454
+ declare const getOrder: (id: string, options?: ServiceHttpOptions) => Promise<{
455
+ uid: string;
456
+ id: string;
457
+ brand_id?: string | null | undefined;
458
+ store_id: string;
459
+ channel_id: string;
460
+ customer_id: string;
461
+ fulfillment_id: string;
462
+ is_anonymous: boolean;
463
+ lines: {
464
+ type: "FEE" | "PRODUCT";
465
+ uid: string;
466
+ id: string;
467
+ parent_uid: string | null;
468
+ parent_id: string | null;
469
+ name: string;
470
+ image_url?: string | undefined;
471
+ menu_id?: string | undefined;
472
+ internal_attribution_source?: string | undefined;
473
+ internal_attribution_id?: string | undefined;
474
+ metadata: Record<string, unknown>;
475
+ bundled_items: {
476
+ id: string;
477
+ refund_price: number;
478
+ included_quantity: number;
479
+ }[];
480
+ redeem: {
481
+ id: string;
482
+ amount: number;
483
+ value: number;
484
+ }[];
485
+ quantity: number;
486
+ tax_rate: number | null;
487
+ discount_rate: number;
488
+ unit_subtotal: number;
489
+ unit_discount: number;
490
+ unit_tax_total: number;
491
+ unit_total: number;
492
+ subtotal: number;
493
+ discount_total: number;
494
+ tax_total: number;
495
+ total: number;
496
+ unit_group_subtotal: number;
497
+ unit_group_discount: number;
498
+ unit_group_tax_total: number;
499
+ unit_group_total: number;
500
+ group_subtotal: number;
501
+ group_discount: number;
502
+ group_tax_total: number;
503
+ group_total: number;
504
+ }[];
505
+ redeem: {
506
+ id: string;
507
+ amount: number;
508
+ value: number;
509
+ }[];
510
+ customer: {
511
+ customer_info: {
512
+ display_name: string;
513
+ first_name: string;
514
+ middle_name?: string | undefined;
515
+ last_name: string;
516
+ second_last_name?: string | undefined;
517
+ email: string;
518
+ phone: string;
519
+ gender?: "FEMALE" | "MALE" | undefined;
520
+ dob?: string | undefined;
521
+ document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
522
+ document_number?: string | undefined;
523
+ city?: string | undefined;
524
+ country?: string | undefined;
525
+ };
526
+ address_info?: {
527
+ address_line1: string;
528
+ address_line2?: string | undefined;
529
+ city?: string | undefined;
530
+ state?: string | undefined;
531
+ zip?: string | undefined;
532
+ country?: string | undefined;
533
+ reference?: string | undefined;
534
+ latitude?: number | undefined;
535
+ longitude?: number | undefined;
536
+ instructions?: string | undefined;
537
+ metadata: Record<string, unknown> | null;
538
+ } | null | undefined;
539
+ billing_info?: {
540
+ type: "BUSINESS" | "INDIVIDUAL";
541
+ legal_name: string;
542
+ address_line1: string;
543
+ address_line2?: string | undefined;
544
+ city?: string | undefined;
545
+ state?: string | undefined;
546
+ zip?: string | undefined;
547
+ country?: string | undefined;
548
+ tax_id: string;
549
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
550
+ metadata: Record<string, unknown> | null;
551
+ } | null | undefined;
552
+ };
553
+ payment_intents: {
554
+ id?: string | undefined;
555
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
556
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
557
+ collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
558
+ status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
559
+ totals: {
560
+ currency: string;
561
+ subtotal: number;
562
+ discount_rate: number;
563
+ discount_total: number;
564
+ tax_rate: number;
565
+ tax_total: number;
566
+ total: number;
567
+ };
568
+ error_message?: string | undefined;
569
+ placed_at: string;
570
+ resolved_at?: string | undefined;
571
+ metadata: Record<string, unknown>;
572
+ }[];
573
+ totals: {
574
+ currency: string;
575
+ subtotal: number;
576
+ discount_rate: number;
577
+ discount_total: number;
578
+ tax_rate: number;
579
+ tax_total: number;
580
+ total: number;
581
+ };
582
+ metadata: Record<string, unknown>;
583
+ payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
584
+ fulfillment_status: string;
585
+ status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
586
+ issued_at?: string | null | undefined;
587
+ resolved_at?: string | null | undefined;
588
+ }>;
589
+ type PlaceOrderInput = {
590
+ payment?: {
591
+ type?: PaymentMethod;
592
+ provider?: PaymentProvider;
593
+ intents?: PaymentIntentInput[];
594
+ };
595
+ };
596
+ declare const placeOrder: (id: string, body?: PlaceOrderInput, options?: ServiceHttpOptions) => Promise<{
597
+ order_id: string;
598
+ order_fulfillment_id: string;
599
+ status: "ACCEPTED" | "EXISTS" | "IN_PROGRESS";
600
+ }>;
601
+ declare const getOrderFulfillment: (id: string, options?: ServiceHttpOptions) => Promise<{
602
+ uid: string;
603
+ id: string;
604
+ order_id: string;
605
+ fulfillment_id: string;
606
+ workflow: {
607
+ nodes: {
608
+ id: string;
609
+ type: "fulfillmentStep";
610
+ position: {
611
+ x: number;
612
+ y: number;
613
+ };
614
+ data: {
615
+ kind: "join" | "start" | "state" | "terminal";
616
+ label: Record<string, string>;
617
+ description?: Record<string, string> | undefined;
618
+ mappedStatus: string;
619
+ milestone?: string | undefined;
620
+ checkout_release?: boolean | undefined;
621
+ joinPolicy?: "all" | "any" | undefined;
622
+ actions?: {
623
+ id: string;
624
+ type: "invoke_callback" | "notify_webhook";
625
+ webhook_ids?: string[] | undefined;
626
+ callback_ids?: string[] | undefined;
627
+ }[] | undefined;
628
+ entered_at?: string | undefined;
629
+ exited_at?: string | undefined;
630
+ logs?: {
631
+ type: "error" | "info" | "success" | "warning";
632
+ message: string;
633
+ at: string;
634
+ actor_name?: string | undefined;
635
+ actor_avatar_url?: string | undefined;
636
+ }[] | undefined;
637
+ callback_run?: {
638
+ attempt: number;
639
+ errors: {
640
+ attempt: number;
641
+ at: string;
642
+ message: string;
643
+ status?: number | undefined;
644
+ body?: unknown;
645
+ started_at?: string | undefined;
646
+ duration_ms?: number | undefined;
647
+ }[];
648
+ response?: unknown;
649
+ started_at?: string | undefined;
650
+ finished_at?: string | undefined;
651
+ duration_ms?: number | undefined;
652
+ } | undefined;
653
+ webhook_runs?: {
654
+ id: string;
655
+ webhook_id: string;
656
+ alias?: string | null | undefined;
657
+ url: string;
658
+ type: string;
659
+ status: string;
660
+ started_at: string;
661
+ finished_at: string;
662
+ duration_ms: number;
663
+ ok: boolean;
664
+ http_status?: number | undefined;
665
+ error?: string | undefined;
666
+ }[] | undefined;
667
+ manual_advance?: {
668
+ reason: string;
669
+ to_status: string;
670
+ at: string;
671
+ actor_name?: string | undefined;
672
+ actor_avatar_url?: string | undefined;
673
+ } | undefined;
674
+ };
675
+ }[];
676
+ edges: {
677
+ id: string;
678
+ source: string;
679
+ target: string;
680
+ type?: "fulfillmentEdge" | undefined;
681
+ sourceHandle?: string | null | undefined;
682
+ targetHandle?: string | null | undefined;
683
+ data?: {
684
+ label?: string | undefined;
685
+ pathKind?: "cancel" | "default" | "refund" | "success" | undefined;
686
+ conditions?: ({
687
+ interpretation?: "both" | "client" | "server" | undefined;
688
+ product_id?: string | undefined;
689
+ tag?: string | undefined;
690
+ fulfillment_id: string;
691
+ store_id: string;
692
+ channel_id: string;
693
+ brand_id: string;
694
+ primitive: "string";
695
+ type: "Failure message" | "Order includes product with tag" | "Request path";
696
+ operator: "contains" | "ends with" | "equal to" | "not equal to" | "starts with";
697
+ caseInsensitive?: boolean | undefined;
698
+ value: string;
699
+ invalidMessage?: string | undefined;
700
+ } | {
701
+ interpretation?: "both" | "client" | "server" | undefined;
702
+ product_id?: string | undefined;
703
+ tag?: string | undefined;
704
+ fulfillment_id: string;
705
+ store_id: string;
706
+ channel_id: string;
707
+ brand_id: string;
708
+ primitive: "number";
709
+ type: "API error rate" | "Accumulated events" | "Cart product count" | "Customer age" | "HTTP status" | "Order includes product" | "Order includes product with tag";
710
+ operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
711
+ value: number;
712
+ include_modifiers?: boolean | undefined;
713
+ window_minutes?: number | undefined;
714
+ invalidMessage?: string | undefined;
715
+ } | {
716
+ interpretation?: "both" | "client" | "server" | undefined;
717
+ product_id?: string | undefined;
718
+ tag?: string | undefined;
719
+ fulfillment_id: string;
720
+ store_id: string;
721
+ channel_id: string;
722
+ brand_id: string;
723
+ primitive: "currency";
724
+ type: "Order includes product with tag" | "Order total";
725
+ operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
726
+ value: number;
727
+ invalidMessage?: string | undefined;
728
+ } | {
729
+ interpretation?: "both" | "client" | "server" | undefined;
730
+ product_id?: string | undefined;
731
+ tag?: string | undefined;
732
+ fulfillment_id: string;
733
+ store_id: string;
734
+ channel_id: string;
735
+ brand_id: string;
736
+ primitive: "boolean";
737
+ type: "Customer is anonymous" | "Is anonymous order" | "Order includes product with tag";
738
+ operator: "is" | "is not";
739
+ value: boolean;
740
+ invalidMessage?: string | undefined;
741
+ } | {
742
+ interpretation?: "both" | "client" | "server" | undefined;
743
+ primitive: "enum";
744
+ type: "Payment collect at" | "Payment method" | "Payment status";
745
+ operator: "is" | "is any of" | "is none of" | "is not";
746
+ value: string | string[];
747
+ invalidMessage?: string | undefined;
748
+ } | {
749
+ interpretation?: "both" | "client" | "server" | undefined;
750
+ primitive: "absolute date";
751
+ type: "Today";
752
+ operator: "is" | "is after" | "is before" | "is not";
753
+ value: Date;
754
+ invalidMessage?: string | undefined;
755
+ } | {
756
+ interpretation?: "both" | "client" | "server" | undefined;
757
+ primitive: "relative date";
758
+ type: "Birthday" | "Customer last session" | "Customer last visit" | "Registration";
759
+ operator: "occurred" | "occurred in the last" | "occurred more than";
760
+ value: string;
761
+ invalidMessage?: string | undefined;
762
+ } | {
763
+ interpretation?: "both" | "client" | "server" | undefined;
764
+ primitive: "recurring date";
765
+ type: "Current date";
766
+ operator: "falls within period";
767
+ startDate: Date;
768
+ endDate: Date;
769
+ allDay: boolean;
770
+ repeat: "CUSTOM" | "DAILY" | "FORTNIGHTLY" | "LAST_DAY_OF_MONTH" | "MONTHLY" | "NONE" | "WEEKDAYS" | "WEEKENDS" | "WEEKLY" | "WEEK_OF_MONTH";
771
+ value: string;
772
+ invalidMessage?: string | undefined;
773
+ } | {
774
+ interpretation?: "both" | "client" | "server" | undefined;
775
+ primitive: "custom";
776
+ type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
777
+ operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
778
+ value: string;
779
+ label_ids?: string[] | undefined;
780
+ invalidMessage?: string | undefined;
781
+ })[][] | undefined;
782
+ taken_at?: string | undefined;
783
+ } | undefined;
784
+ }[];
785
+ viewport?: {
786
+ x: number;
787
+ y: number;
788
+ zoom: number;
789
+ } | undefined;
790
+ };
791
+ current_node_ids: string[];
792
+ step: "ACCEPTING" | "FINALIZE" | "PAUSE_FOR_ADVANCE" | "PROCESS_STATE_NODE" | "ROLLBACK_ACCEPT" | "ROLLBACK_PROCESS_STATE_NODE" | "WARN_NO_EDGE";
793
+ status: "FAILED" | "PROCESSING" | "SUCCESS" | "WAITING";
794
+ steps_logs: {
795
+ started_at: string;
796
+ ended_at: string | null;
797
+ step: "ACCEPTING" | "FINALIZE" | "PAUSE_FOR_ADVANCE" | "PROCESS_STATE_NODE" | "ROLLBACK_ACCEPT" | "ROLLBACK_PROCESS_STATE_NODE" | "WARN_NO_EDGE";
798
+ logs: {
799
+ type: "error" | "info" | "success" | "warning";
800
+ message: string;
801
+ }[];
802
+ }[];
803
+ warning_count: number;
804
+ checkout_state: "failed" | "pending" | "released";
805
+ error: {
806
+ node_id?: string | undefined;
807
+ status?: string | undefined;
808
+ message: string;
809
+ } | null;
810
+ customer_id: string;
811
+ payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
812
+ fulfillment_status: string;
813
+ }>;
814
+ declare const listOrderFulfillments: (ids: string[], options?: ServiceHttpOptions) => Promise<{
815
+ uid: string;
816
+ id: string;
817
+ order_id: string;
818
+ fulfillment_id: string;
819
+ workflow: {
820
+ nodes: {
821
+ id: string;
822
+ type: "fulfillmentStep";
823
+ position: {
824
+ x: number;
825
+ y: number;
826
+ };
827
+ data: {
828
+ kind: "join" | "start" | "state" | "terminal";
829
+ label: Record<string, string>;
830
+ description?: Record<string, string> | undefined;
831
+ mappedStatus: string;
832
+ milestone?: string | undefined;
833
+ checkout_release?: boolean | undefined;
834
+ joinPolicy?: "all" | "any" | undefined;
835
+ actions?: {
836
+ id: string;
837
+ type: "invoke_callback" | "notify_webhook";
838
+ webhook_ids?: string[] | undefined;
839
+ callback_ids?: string[] | undefined;
840
+ }[] | undefined;
841
+ entered_at?: string | undefined;
842
+ exited_at?: string | undefined;
843
+ logs?: {
844
+ type: "error" | "info" | "success" | "warning";
845
+ message: string;
846
+ at: string;
847
+ actor_name?: string | undefined;
848
+ actor_avatar_url?: string | undefined;
849
+ }[] | undefined;
850
+ callback_run?: {
851
+ attempt: number;
852
+ errors: {
853
+ attempt: number;
854
+ at: string;
855
+ message: string;
856
+ status?: number | undefined;
857
+ body?: unknown;
858
+ started_at?: string | undefined;
859
+ duration_ms?: number | undefined;
860
+ }[];
861
+ response?: unknown;
862
+ started_at?: string | undefined;
863
+ finished_at?: string | undefined;
864
+ duration_ms?: number | undefined;
865
+ } | undefined;
866
+ webhook_runs?: {
867
+ id: string;
868
+ webhook_id: string;
869
+ alias?: string | null | undefined;
870
+ url: string;
871
+ type: string;
872
+ status: string;
873
+ started_at: string;
874
+ finished_at: string;
875
+ duration_ms: number;
876
+ ok: boolean;
877
+ http_status?: number | undefined;
878
+ error?: string | undefined;
879
+ }[] | undefined;
880
+ manual_advance?: {
881
+ reason: string;
882
+ to_status: string;
883
+ at: string;
884
+ actor_name?: string | undefined;
885
+ actor_avatar_url?: string | undefined;
886
+ } | undefined;
887
+ };
888
+ }[];
889
+ edges: {
890
+ id: string;
891
+ source: string;
892
+ target: string;
893
+ type?: "fulfillmentEdge" | undefined;
894
+ sourceHandle?: string | null | undefined;
895
+ targetHandle?: string | null | undefined;
896
+ data?: {
897
+ label?: string | undefined;
898
+ pathKind?: "cancel" | "default" | "refund" | "success" | undefined;
899
+ conditions?: ({
900
+ interpretation?: "both" | "client" | "server" | undefined;
901
+ product_id?: string | undefined;
902
+ tag?: string | undefined;
903
+ fulfillment_id: string;
904
+ store_id: string;
905
+ channel_id: string;
906
+ brand_id: string;
907
+ primitive: "string";
908
+ type: "Failure message" | "Order includes product with tag" | "Request path";
909
+ operator: "contains" | "ends with" | "equal to" | "not equal to" | "starts with";
910
+ caseInsensitive?: boolean | undefined;
911
+ value: string;
912
+ invalidMessage?: string | undefined;
913
+ } | {
914
+ interpretation?: "both" | "client" | "server" | undefined;
915
+ product_id?: string | undefined;
916
+ tag?: string | undefined;
917
+ fulfillment_id: string;
918
+ store_id: string;
919
+ channel_id: string;
920
+ brand_id: string;
921
+ primitive: "number";
922
+ type: "API error rate" | "Accumulated events" | "Cart product count" | "Customer age" | "HTTP status" | "Order includes product" | "Order includes product with tag";
923
+ operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
924
+ value: number;
925
+ include_modifiers?: boolean | undefined;
926
+ window_minutes?: number | undefined;
927
+ invalidMessage?: string | undefined;
928
+ } | {
929
+ interpretation?: "both" | "client" | "server" | undefined;
930
+ product_id?: string | undefined;
931
+ tag?: string | undefined;
932
+ fulfillment_id: string;
933
+ store_id: string;
934
+ channel_id: string;
935
+ brand_id: string;
936
+ primitive: "currency";
937
+ type: "Order includes product with tag" | "Order total";
938
+ operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
939
+ value: number;
940
+ invalidMessage?: string | undefined;
941
+ } | {
942
+ interpretation?: "both" | "client" | "server" | undefined;
943
+ product_id?: string | undefined;
944
+ tag?: string | undefined;
945
+ fulfillment_id: string;
946
+ store_id: string;
947
+ channel_id: string;
948
+ brand_id: string;
949
+ primitive: "boolean";
950
+ type: "Customer is anonymous" | "Is anonymous order" | "Order includes product with tag";
951
+ operator: "is" | "is not";
952
+ value: boolean;
953
+ invalidMessage?: string | undefined;
954
+ } | {
955
+ interpretation?: "both" | "client" | "server" | undefined;
956
+ primitive: "enum";
957
+ type: "Payment collect at" | "Payment method" | "Payment status";
958
+ operator: "is" | "is any of" | "is none of" | "is not";
959
+ value: string | string[];
960
+ invalidMessage?: string | undefined;
961
+ } | {
962
+ interpretation?: "both" | "client" | "server" | undefined;
963
+ primitive: "absolute date";
964
+ type: "Today";
965
+ operator: "is" | "is after" | "is before" | "is not";
966
+ value: Date;
967
+ invalidMessage?: string | undefined;
968
+ } | {
969
+ interpretation?: "both" | "client" | "server" | undefined;
970
+ primitive: "relative date";
971
+ type: "Birthday" | "Customer last session" | "Customer last visit" | "Registration";
972
+ operator: "occurred" | "occurred in the last" | "occurred more than";
973
+ value: string;
974
+ invalidMessage?: string | undefined;
975
+ } | {
976
+ interpretation?: "both" | "client" | "server" | undefined;
977
+ primitive: "recurring date";
978
+ type: "Current date";
979
+ operator: "falls within period";
980
+ startDate: Date;
981
+ endDate: Date;
982
+ allDay: boolean;
983
+ repeat: "CUSTOM" | "DAILY" | "FORTNIGHTLY" | "LAST_DAY_OF_MONTH" | "MONTHLY" | "NONE" | "WEEKDAYS" | "WEEKENDS" | "WEEKLY" | "WEEK_OF_MONTH";
984
+ value: string;
985
+ invalidMessage?: string | undefined;
986
+ } | {
987
+ interpretation?: "both" | "client" | "server" | undefined;
988
+ primitive: "custom";
989
+ type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
990
+ operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
991
+ value: string;
992
+ label_ids?: string[] | undefined;
993
+ invalidMessage?: string | undefined;
994
+ })[][] | undefined;
995
+ taken_at?: string | undefined;
996
+ } | undefined;
997
+ }[];
998
+ viewport?: {
999
+ x: number;
1000
+ y: number;
1001
+ zoom: number;
1002
+ } | undefined;
1003
+ };
1004
+ current_node_ids: string[];
1005
+ step: "ACCEPTING" | "FINALIZE" | "PAUSE_FOR_ADVANCE" | "PROCESS_STATE_NODE" | "ROLLBACK_ACCEPT" | "ROLLBACK_PROCESS_STATE_NODE" | "WARN_NO_EDGE";
1006
+ status: "FAILED" | "PROCESSING" | "SUCCESS" | "WAITING";
1007
+ steps_logs: {
1008
+ started_at: string;
1009
+ ended_at: string | null;
1010
+ step: "ACCEPTING" | "FINALIZE" | "PAUSE_FOR_ADVANCE" | "PROCESS_STATE_NODE" | "ROLLBACK_ACCEPT" | "ROLLBACK_PROCESS_STATE_NODE" | "WARN_NO_EDGE";
1011
+ logs: {
1012
+ type: "error" | "info" | "success" | "warning";
1013
+ message: string;
1014
+ }[];
1015
+ }[];
1016
+ warning_count: number;
1017
+ checkout_state: "failed" | "pending" | "released";
1018
+ error: {
1019
+ node_id?: string | undefined;
1020
+ status?: string | undefined;
1021
+ message: string;
1022
+ } | null;
1023
+ customer_id: string;
1024
+ payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1025
+ fulfillment_status: string;
1026
+ }[]>;
1027
+ declare const updateOrder: (id: string, body: OrderUpdateInput, options?: ServiceHttpOptions) => Promise<{
1028
+ uid: string;
1029
+ id: string;
1030
+ brand_id?: string | null | undefined;
1031
+ store_id: string;
1032
+ channel_id: string;
1033
+ customer_id: string;
1034
+ fulfillment_id: string;
1035
+ is_anonymous: boolean;
1036
+ lines: {
1037
+ type: "FEE" | "PRODUCT";
1038
+ uid: string;
1039
+ id: string;
1040
+ parent_uid: string | null;
1041
+ parent_id: string | null;
1042
+ name: string;
1043
+ image_url?: string | undefined;
1044
+ menu_id?: string | undefined;
1045
+ internal_attribution_source?: string | undefined;
1046
+ internal_attribution_id?: string | undefined;
1047
+ metadata: Record<string, unknown>;
1048
+ bundled_items: {
1049
+ id: string;
1050
+ refund_price: number;
1051
+ included_quantity: number;
1052
+ }[];
1053
+ redeem: {
1054
+ id: string;
1055
+ amount: number;
1056
+ value: number;
1057
+ }[];
1058
+ quantity: number;
1059
+ tax_rate: number | null;
1060
+ discount_rate: number;
1061
+ unit_subtotal: number;
1062
+ unit_discount: number;
1063
+ unit_tax_total: number;
1064
+ unit_total: number;
1065
+ subtotal: number;
1066
+ discount_total: number;
1067
+ tax_total: number;
1068
+ total: number;
1069
+ unit_group_subtotal: number;
1070
+ unit_group_discount: number;
1071
+ unit_group_tax_total: number;
1072
+ unit_group_total: number;
1073
+ group_subtotal: number;
1074
+ group_discount: number;
1075
+ group_tax_total: number;
1076
+ group_total: number;
1077
+ }[];
1078
+ redeem: {
1079
+ id: string;
1080
+ amount: number;
1081
+ value: number;
1082
+ }[];
1083
+ customer: {
1084
+ customer_info: {
1085
+ display_name: string;
1086
+ first_name: string;
1087
+ middle_name?: string | undefined;
1088
+ last_name: string;
1089
+ second_last_name?: string | undefined;
1090
+ email: string;
1091
+ phone: string;
1092
+ gender?: "FEMALE" | "MALE" | undefined;
1093
+ dob?: string | undefined;
1094
+ document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
1095
+ document_number?: string | undefined;
1096
+ city?: string | undefined;
1097
+ country?: string | undefined;
1098
+ };
1099
+ address_info?: {
1100
+ address_line1: string;
1101
+ address_line2?: string | undefined;
1102
+ city?: string | undefined;
1103
+ state?: string | undefined;
1104
+ zip?: string | undefined;
1105
+ country?: string | undefined;
1106
+ reference?: string | undefined;
1107
+ latitude?: number | undefined;
1108
+ longitude?: number | undefined;
1109
+ instructions?: string | undefined;
1110
+ metadata: Record<string, unknown> | null;
1111
+ } | null | undefined;
1112
+ billing_info?: {
1113
+ type: "BUSINESS" | "INDIVIDUAL";
1114
+ legal_name: string;
1115
+ address_line1: string;
1116
+ address_line2?: string | undefined;
1117
+ city?: string | undefined;
1118
+ state?: string | undefined;
1119
+ zip?: string | undefined;
1120
+ country?: string | undefined;
1121
+ tax_id: string;
1122
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
1123
+ metadata: Record<string, unknown> | null;
1124
+ } | null | undefined;
1125
+ };
1126
+ payment_intents: {
1127
+ id?: string | undefined;
1128
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1129
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1130
+ collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1131
+ status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1132
+ totals: {
1133
+ currency: string;
1134
+ subtotal: number;
1135
+ discount_rate: number;
1136
+ discount_total: number;
1137
+ tax_rate: number;
1138
+ tax_total: number;
1139
+ total: number;
1140
+ };
1141
+ error_message?: string | undefined;
1142
+ placed_at: string;
1143
+ resolved_at?: string | undefined;
1144
+ metadata: Record<string, unknown>;
1145
+ }[];
1146
+ totals: {
1147
+ currency: string;
1148
+ subtotal: number;
1149
+ discount_rate: number;
1150
+ discount_total: number;
1151
+ tax_rate: number;
1152
+ tax_total: number;
1153
+ total: number;
1154
+ };
1155
+ metadata: Record<string, unknown>;
1156
+ payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1157
+ fulfillment_status: string;
1158
+ status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
1159
+ issued_at?: string | null | undefined;
1160
+ resolved_at?: string | null | undefined;
1161
+ }>;
1162
+ declare const cancelOrder: (id: string, options?: ServiceHttpOptions) => Promise<{
1163
+ uid: string;
1164
+ id: string;
1165
+ brand_id?: string | null | undefined;
1166
+ store_id: string;
1167
+ channel_id: string;
1168
+ customer_id: string;
1169
+ fulfillment_id: string;
1170
+ is_anonymous: boolean;
1171
+ lines: {
1172
+ type: "FEE" | "PRODUCT";
1173
+ uid: string;
1174
+ id: string;
1175
+ parent_uid: string | null;
1176
+ parent_id: string | null;
1177
+ name: string;
1178
+ image_url?: string | undefined;
1179
+ menu_id?: string | undefined;
1180
+ internal_attribution_source?: string | undefined;
1181
+ internal_attribution_id?: string | undefined;
1182
+ metadata: Record<string, unknown>;
1183
+ bundled_items: {
1184
+ id: string;
1185
+ refund_price: number;
1186
+ included_quantity: number;
1187
+ }[];
1188
+ redeem: {
1189
+ id: string;
1190
+ amount: number;
1191
+ value: number;
1192
+ }[];
1193
+ quantity: number;
1194
+ tax_rate: number | null;
1195
+ discount_rate: number;
1196
+ unit_subtotal: number;
1197
+ unit_discount: number;
1198
+ unit_tax_total: number;
1199
+ unit_total: number;
1200
+ subtotal: number;
1201
+ discount_total: number;
1202
+ tax_total: number;
1203
+ total: number;
1204
+ unit_group_subtotal: number;
1205
+ unit_group_discount: number;
1206
+ unit_group_tax_total: number;
1207
+ unit_group_total: number;
1208
+ group_subtotal: number;
1209
+ group_discount: number;
1210
+ group_tax_total: number;
1211
+ group_total: number;
1212
+ }[];
1213
+ redeem: {
1214
+ id: string;
1215
+ amount: number;
1216
+ value: number;
1217
+ }[];
1218
+ customer: {
1219
+ customer_info: {
1220
+ display_name: string;
1221
+ first_name: string;
1222
+ middle_name?: string | undefined;
1223
+ last_name: string;
1224
+ second_last_name?: string | undefined;
1225
+ email: string;
1226
+ phone: string;
1227
+ gender?: "FEMALE" | "MALE" | undefined;
1228
+ dob?: string | undefined;
1229
+ document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
1230
+ document_number?: string | undefined;
1231
+ city?: string | undefined;
1232
+ country?: string | undefined;
1233
+ };
1234
+ address_info?: {
1235
+ address_line1: string;
1236
+ address_line2?: string | undefined;
1237
+ city?: string | undefined;
1238
+ state?: string | undefined;
1239
+ zip?: string | undefined;
1240
+ country?: string | undefined;
1241
+ reference?: string | undefined;
1242
+ latitude?: number | undefined;
1243
+ longitude?: number | undefined;
1244
+ instructions?: string | undefined;
1245
+ metadata: Record<string, unknown> | null;
1246
+ } | null | undefined;
1247
+ billing_info?: {
1248
+ type: "BUSINESS" | "INDIVIDUAL";
1249
+ legal_name: string;
1250
+ address_line1: string;
1251
+ address_line2?: string | undefined;
1252
+ city?: string | undefined;
1253
+ state?: string | undefined;
1254
+ zip?: string | undefined;
1255
+ country?: string | undefined;
1256
+ tax_id: string;
1257
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
1258
+ metadata: Record<string, unknown> | null;
1259
+ } | null | undefined;
1260
+ };
1261
+ payment_intents: {
1262
+ id?: string | undefined;
1263
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1264
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1265
+ collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1266
+ status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1267
+ totals: {
1268
+ currency: string;
1269
+ subtotal: number;
1270
+ discount_rate: number;
1271
+ discount_total: number;
1272
+ tax_rate: number;
1273
+ tax_total: number;
1274
+ total: number;
1275
+ };
1276
+ error_message?: string | undefined;
1277
+ placed_at: string;
1278
+ resolved_at?: string | undefined;
1279
+ metadata: Record<string, unknown>;
1280
+ }[];
1281
+ totals: {
1282
+ currency: string;
1283
+ subtotal: number;
1284
+ discount_rate: number;
1285
+ discount_total: number;
1286
+ tax_rate: number;
1287
+ tax_total: number;
1288
+ total: number;
1289
+ };
1290
+ metadata: Record<string, unknown>;
1291
+ payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1292
+ fulfillment_status: string;
1293
+ status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
1294
+ issued_at?: string | null | undefined;
1295
+ resolved_at?: string | null | undefined;
1296
+ }>;
1297
+ declare const refundOrder: (id: string, options?: ServiceHttpOptions) => Promise<{
1298
+ uid: string;
1299
+ id: string;
1300
+ brand_id?: string | null | undefined;
1301
+ store_id: string;
1302
+ channel_id: string;
1303
+ customer_id: string;
1304
+ fulfillment_id: string;
1305
+ is_anonymous: boolean;
1306
+ lines: {
1307
+ type: "FEE" | "PRODUCT";
1308
+ uid: string;
1309
+ id: string;
1310
+ parent_uid: string | null;
1311
+ parent_id: string | null;
1312
+ name: string;
1313
+ image_url?: string | undefined;
1314
+ menu_id?: string | undefined;
1315
+ internal_attribution_source?: string | undefined;
1316
+ internal_attribution_id?: string | undefined;
1317
+ metadata: Record<string, unknown>;
1318
+ bundled_items: {
1319
+ id: string;
1320
+ refund_price: number;
1321
+ included_quantity: number;
1322
+ }[];
1323
+ redeem: {
1324
+ id: string;
1325
+ amount: number;
1326
+ value: number;
1327
+ }[];
1328
+ quantity: number;
1329
+ tax_rate: number | null;
1330
+ discount_rate: number;
1331
+ unit_subtotal: number;
1332
+ unit_discount: number;
1333
+ unit_tax_total: number;
1334
+ unit_total: number;
1335
+ subtotal: number;
1336
+ discount_total: number;
1337
+ tax_total: number;
1338
+ total: number;
1339
+ unit_group_subtotal: number;
1340
+ unit_group_discount: number;
1341
+ unit_group_tax_total: number;
1342
+ unit_group_total: number;
1343
+ group_subtotal: number;
1344
+ group_discount: number;
1345
+ group_tax_total: number;
1346
+ group_total: number;
1347
+ }[];
1348
+ redeem: {
1349
+ id: string;
1350
+ amount: number;
1351
+ value: number;
1352
+ }[];
1353
+ customer: {
1354
+ customer_info: {
1355
+ display_name: string;
1356
+ first_name: string;
1357
+ middle_name?: string | undefined;
1358
+ last_name: string;
1359
+ second_last_name?: string | undefined;
1360
+ email: string;
1361
+ phone: string;
1362
+ gender?: "FEMALE" | "MALE" | undefined;
1363
+ dob?: string | undefined;
1364
+ document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
1365
+ document_number?: string | undefined;
1366
+ city?: string | undefined;
1367
+ country?: string | undefined;
1368
+ };
1369
+ address_info?: {
1370
+ address_line1: string;
1371
+ address_line2?: string | undefined;
1372
+ city?: string | undefined;
1373
+ state?: string | undefined;
1374
+ zip?: string | undefined;
1375
+ country?: string | undefined;
1376
+ reference?: string | undefined;
1377
+ latitude?: number | undefined;
1378
+ longitude?: number | undefined;
1379
+ instructions?: string | undefined;
1380
+ metadata: Record<string, unknown> | null;
1381
+ } | null | undefined;
1382
+ billing_info?: {
1383
+ type: "BUSINESS" | "INDIVIDUAL";
1384
+ legal_name: string;
1385
+ address_line1: string;
1386
+ address_line2?: string | undefined;
1387
+ city?: string | undefined;
1388
+ state?: string | undefined;
1389
+ zip?: string | undefined;
1390
+ country?: string | undefined;
1391
+ tax_id: string;
1392
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
1393
+ metadata: Record<string, unknown> | null;
1394
+ } | null | undefined;
1395
+ };
1396
+ payment_intents: {
1397
+ id?: string | undefined;
1398
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1399
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1400
+ collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1401
+ status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1402
+ totals: {
1403
+ currency: string;
1404
+ subtotal: number;
1405
+ discount_rate: number;
1406
+ discount_total: number;
1407
+ tax_rate: number;
1408
+ tax_total: number;
1409
+ total: number;
1410
+ };
1411
+ error_message?: string | undefined;
1412
+ placed_at: string;
1413
+ resolved_at?: string | undefined;
1414
+ metadata: Record<string, unknown>;
1415
+ }[];
1416
+ totals: {
1417
+ currency: string;
1418
+ subtotal: number;
1419
+ discount_rate: number;
1420
+ discount_total: number;
1421
+ tax_rate: number;
1422
+ tax_total: number;
1423
+ total: number;
1424
+ };
1425
+ metadata: Record<string, unknown>;
1426
+ payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1427
+ fulfillment_status: string;
1428
+ status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
1429
+ issued_at?: string | null | undefined;
1430
+ resolved_at?: string | null | undefined;
1431
+ }>;
1432
+ declare const reorderOrder: (id: string, body?: OrderReorderInput, options?: ServiceHttpOptions) => Promise<{
1433
+ uid: string;
1434
+ id: string;
1435
+ brand_id?: string | null | undefined;
1436
+ store_id: string;
1437
+ channel_id: string;
1438
+ customer_id: string;
1439
+ fulfillment_id: string;
1440
+ is_anonymous: boolean;
1441
+ lines: {
1442
+ type: "FEE" | "PRODUCT";
1443
+ uid: string;
1444
+ id: string;
1445
+ parent_uid: string | null;
1446
+ parent_id: string | null;
1447
+ name: string;
1448
+ image_url?: string | undefined;
1449
+ menu_id?: string | undefined;
1450
+ internal_attribution_source?: string | undefined;
1451
+ internal_attribution_id?: string | undefined;
1452
+ metadata: Record<string, unknown>;
1453
+ bundled_items: {
1454
+ id: string;
1455
+ refund_price: number;
1456
+ included_quantity: number;
1457
+ }[];
1458
+ redeem: {
1459
+ id: string;
1460
+ amount: number;
1461
+ value: number;
1462
+ }[];
1463
+ quantity: number;
1464
+ tax_rate: number | null;
1465
+ discount_rate: number;
1466
+ unit_subtotal: number;
1467
+ unit_discount: number;
1468
+ unit_tax_total: number;
1469
+ unit_total: number;
1470
+ subtotal: number;
1471
+ discount_total: number;
1472
+ tax_total: number;
1473
+ total: number;
1474
+ unit_group_subtotal: number;
1475
+ unit_group_discount: number;
1476
+ unit_group_tax_total: number;
1477
+ unit_group_total: number;
1478
+ group_subtotal: number;
1479
+ group_discount: number;
1480
+ group_tax_total: number;
1481
+ group_total: number;
1482
+ }[];
1483
+ redeem: {
1484
+ id: string;
1485
+ amount: number;
1486
+ value: number;
1487
+ }[];
1488
+ customer: {
1489
+ customer_info: {
1490
+ display_name: string;
1491
+ first_name: string;
1492
+ middle_name?: string | undefined;
1493
+ last_name: string;
1494
+ second_last_name?: string | undefined;
1495
+ email: string;
1496
+ phone: string;
1497
+ gender?: "FEMALE" | "MALE" | undefined;
1498
+ dob?: string | undefined;
1499
+ document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
1500
+ document_number?: string | undefined;
1501
+ city?: string | undefined;
1502
+ country?: string | undefined;
1503
+ };
1504
+ address_info?: {
1505
+ address_line1: string;
1506
+ address_line2?: string | undefined;
1507
+ city?: string | undefined;
1508
+ state?: string | undefined;
1509
+ zip?: string | undefined;
1510
+ country?: string | undefined;
1511
+ reference?: string | undefined;
1512
+ latitude?: number | undefined;
1513
+ longitude?: number | undefined;
1514
+ instructions?: string | undefined;
1515
+ metadata: Record<string, unknown> | null;
1516
+ } | null | undefined;
1517
+ billing_info?: {
1518
+ type: "BUSINESS" | "INDIVIDUAL";
1519
+ legal_name: string;
1520
+ address_line1: string;
1521
+ address_line2?: string | undefined;
1522
+ city?: string | undefined;
1523
+ state?: string | undefined;
1524
+ zip?: string | undefined;
1525
+ country?: string | undefined;
1526
+ tax_id: string;
1527
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
1528
+ metadata: Record<string, unknown> | null;
1529
+ } | null | undefined;
1530
+ };
1531
+ payment_intents: {
1532
+ id?: string | undefined;
1533
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1534
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1535
+ collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1536
+ status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1537
+ totals: {
1538
+ currency: string;
1539
+ subtotal: number;
1540
+ discount_rate: number;
1541
+ discount_total: number;
1542
+ tax_rate: number;
1543
+ tax_total: number;
1544
+ total: number;
1545
+ };
1546
+ error_message?: string | undefined;
1547
+ placed_at: string;
1548
+ resolved_at?: string | undefined;
1549
+ metadata: Record<string, unknown>;
1550
+ }[];
1551
+ totals: {
1552
+ currency: string;
1553
+ subtotal: number;
1554
+ discount_rate: number;
1555
+ discount_total: number;
1556
+ tax_rate: number;
1557
+ tax_total: number;
1558
+ total: number;
1559
+ };
1560
+ metadata: Record<string, unknown>;
1561
+ payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1562
+ fulfillment_status: string;
1563
+ status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
1564
+ issued_at?: string | null | undefined;
1565
+ resolved_at?: string | null | undefined;
1566
+ }>;
1567
+ declare const validateOrder: (body: OrderValidateInput, options?: ServiceHttpOptions) => Promise<OrderValidateOutput>;
1568
+ //#endregion
1569
+ //#region src/order/recommendations.d.ts
1570
+ type RecommendationType = Recommendation["type"];
1571
+ declare const DEFAULT_RECOMMENDATION_TYPES: RecommendationType[];
1572
+ //#endregion
1573
+ //#region src/order/types.d.ts
1574
+ type OrderScope = {
1575
+ store_id: string;
1576
+ channel_id: string;
1577
+ fulfillment_id: string;
1578
+ brand_id?: string | null;
1579
+ };
1580
+ type CreateOrderOptions = {
1581
+ scope?: OrderScope;
1582
+ customer?: OrderCustomerSource;
1583
+ fromOrderId?: string;
1584
+ isAnonymous?: boolean;
1585
+ /** When false, skips the OPEN-order lookup and starts a local draft. */
1586
+ reuseOpen?: boolean;
1587
+ orderId?: string;
1588
+ debounceMs?: number;
1589
+ baseUrl?: string;
1590
+ accessToken?: string;
1591
+ fetchImpl?: typeof fetch;
1592
+ };
1593
+ type ReorderOrderOptions = CreateOrderOptions & {
1594
+ strategy?: "replace" | "merge";
1595
+ };
1596
+ type OrderDraft = Order$2;
1597
+ //#endregion
1598
+ //#region src/order/Order.d.ts
1599
+ declare class Order {
1600
+ private draft;
1601
+ private synced;
1602
+ private deleted;
1603
+ private persisted;
1604
+ private readonly listeners;
1605
+ private readonly externalNotify?;
1606
+ private readonly http;
1607
+ private readonly flush;
1608
+ private constructor();
1609
+ /**
1610
+ * Opens a cart session: reuses an existing OPEN order for the scope, or a
1611
+ * local draft. Does not POST until `persist()` or the first mutating flush.
1612
+ */
1613
+ static open(options: CreateOrderOptions, notify?: () => void): Promise<Order>;
1614
+ static reorder(orderId: string, options?: ReorderOrderOptions, notify?: () => void): Promise<Order>;
1615
+ /** Opens a session and POSTs immediately if no OPEN order exists yet. */
1616
+ static create(options: CreateOrderOptions, notify?: () => void): Promise<Order>;
1617
+ /** @internal test hook — create without POST */
1618
+ static fromExisting(config: {
1619
+ order: Order$1;
1620
+ http: ServiceHttpOptions;
1621
+ debounceMs?: number;
1622
+ persisted?: boolean;
1623
+ sleep?: (ms: number) => Promise<void>;
1624
+ }, notify?: () => void): Order;
1625
+ /** Whether this session has a server row yet. */
1626
+ isPersisted(): boolean;
1627
+ /** Persist a local draft via POST (no-op if already on the server). */
1628
+ persist(): Promise<void>;
1629
+ /** Whether local edits failed to reach the server (e.g. offline). */
1630
+ hasPendingSync(): boolean;
1631
+ /** Retries pending edits; call when connectivity returns. */
1632
+ resume(): Promise<void>;
1633
+ /** Abandons the session locally: pending edits are dropped, no request. */
1634
+ dispose(): void;
1635
+ subscribe(listener: () => void): () => void;
1636
+ getOrder(): Order$1;
1637
+ /**
1638
+ * Upsell / cross-sell / down-sell products for items currently in the cart.
1639
+ * Skips targets whose base (unconfigured) customization is already in the cart —
1640
+ * same product id with a different modifier tree is still allowed.
1641
+ */
1642
+ getRecommendations(lookup: MenuLookup$1, quantity: number, types?: RecommendationType[]): Product$1[];
1643
+ /**
1644
+ * Rebuild a customization {@link Snapshot} for a root cart line so callers
1645
+ * can reopen it with `createSession(lookup, snapshot.productId, { snapshot })`.
1646
+ */
1647
+ getCustomizationSnapshot(rootLineUid: string, lookup: MenuLookup$1): Snapshot | null;
1648
+ addLine(lines: OrderLine | OrderLine[]): void;
1649
+ subtractLine(lineUid: string, quantity?: number): void;
1650
+ removeLine(lineUid: string): void;
1651
+ replaceLine(lineUid: string, lines: OrderLine | OrderLine[]): void;
1652
+ emptyOrder(): void;
1653
+ setScope(scope: Partial<OrderScope>): void;
1654
+ /** Shallow-merges into order metadata; `null` values are kept as-is. */
1655
+ setMetadata(patch: Record<string, unknown>): void;
1656
+ setCustomerDetails(details: {
1657
+ address_info?: Order$1["customer"]["address_info"];
1658
+ billing_info?: Order$1["customer"]["billing_info"];
1659
+ }): void;
1660
+ cancelOrder(): Promise<void>;
1661
+ refundOrder(): Promise<void>;
1662
+ validateOrder(): Promise<void>;
1663
+ placeOrder(input?: PlaceOrderInput): Promise<void>;
1664
+ private scheduleAfterMutate;
1665
+ private notify;
1666
+ }
1667
+ //#endregion
1668
+ //#region src/order/flush.d.ts
1669
+ declare class OrderSyncPendingError extends Error {
1670
+ constructor();
1671
+ }
1672
+ //#endregion
1673
+ //#region src/order/fulfillmentTrack.d.ts
1674
+ type TrackWorkflowNode = {
1675
+ id: string;
1676
+ data: {
1677
+ label: Record<string, string> | string;
1678
+ mappedStatus: string;
1679
+ kind?: string;
1680
+ milestone?: string;
1681
+ entered_at?: string;
1682
+ exited_at?: string;
1683
+ };
1684
+ };
1685
+ type TrackWorkflowEdge = {
1686
+ id: string;
1687
+ source: string;
1688
+ target: string;
1689
+ data?: {
1690
+ pathKind?: string | null;
1691
+ taken_at?: string;
1692
+ };
1693
+ };
1694
+ type TrackWorkflow = {
1695
+ nodes: TrackWorkflowNode[];
1696
+ edges: TrackWorkflowEdge[];
1697
+ };
1698
+ type VisitedState = {
1699
+ id: string;
1700
+ label: TrackWorkflowNode["data"]["label"];
1701
+ mappedStatus: string;
1702
+ entered_at: string;
1703
+ exited_at?: string;
1704
+ durationMs: number | null;
1705
+ };
1706
+ type MilestoneTrackItem = {
1707
+ id: string;
1708
+ milestone: string;
1709
+ order: number;
1710
+ completed: boolean;
1711
+ label: string;
1712
+ };
1713
+ type MilestoneSteps = {
1714
+ steps: MilestoneTrackItem[];
1715
+ current: number;
1716
+ total: number;
1717
+ };
1718
+ declare const currentNodes: (workflow: TrackWorkflow, currentNodeIds: string[]) => TrackWorkflowNode[];
1719
+ declare const visitedStates: (workflow: TrackWorkflow) => VisitedState[];
1720
+ /** Last milestone is done once current has reached the end (e.g. Fulfilled). */
1721
+ declare const isMilestoneStepDone: (order: number, current: number, total: number) => boolean;
1722
+ /** Deduped primary-path milestones (one per order index). */
1723
+ declare const milestoneTrack: (workflow: TrackWorkflow) => MilestoneTrackItem[];
1724
+ /** Ordered milestones + current index from `current_node_ids` (dashboard algo). */
1725
+ declare const milestoneSteps: (workflow: TrackWorkflow, currentNodeIds: string[]) => MilestoneSteps | null;
1726
+ //#endregion
1727
+ //#region src/order/validate.d.ts
1728
+ type OrderLineIssueCode = "PRODUCT_NOT_FOUND" | "HIDDEN" | "OUT_OF_STOCK" | "OUTSIDE_HOURS" | "MODIFIER_NOT_FOUND" | "MODIFIER_RULES_INVALID" | "PRICE_MISMATCH" | "TAX_MISMATCH" | "DISCOUNT_MISMATCH" | "QUANTITY_MISMATCH" | "QUANTITY_BELOW_MINIMUM" | "QUANTITY_ABOVE_MAXIMUM" | "STRUCTURE_MISMATCH" | "FEE_MISMATCH";
1729
+ type OrderIssueCode = "NO_MENU" | "MENU_CLOSED" | "SCOPE_INACTIVE" | "TOTALS_MISMATCH" | "EMPTY_ORDER" | "ITEMS_BELOW_MINIMUM" | "ITEMS_ABOVE_MAXIMUM" | "TOTAL_BELOW_MINIMUM" | "TOTAL_ABOVE_MAXIMUM" | "REDEEMS_ABOVE_MAXIMUM" | "REDEEMS_TOTAL_ABOVE_MAXIMUM" | "SHIPPING_REQUIRED" | "BILLING_REQUIRED" | "SHIPPING_FIELD_REQUIRED" | "BILLING_FIELD_REQUIRED";
1730
+ type OrderLineIssue = {
1731
+ code: OrderLineIssueCode;
1732
+ field?: string;
1733
+ expected?: string;
1734
+ actual?: string;
1735
+ };
1736
+ type OrderIssue = {
1737
+ code: OrderIssueCode;
1738
+ field?: string;
1739
+ expected?: string;
1740
+ actual?: string;
1741
+ };
1742
+ type OrderValidationResult = {
1743
+ ok: true;
1744
+ } | {
1745
+ ok: false;
1746
+ issues: OrderIssue[];
1747
+ lines: Record<string, OrderLineIssue[]>;
1748
+ };
1749
+ type ValidateOrderAgainstMenuInput = {
1750
+ lines: OrderLine[];
1751
+ totals: OrderTotals;
1752
+ menu: Menu$1 | null;
1753
+ menuActive: boolean;
1754
+ locale?: string;
1755
+ expectedFeeLines?: OrderLine[];
1756
+ };
1757
+ /** Compare cart lines/totals against a fresh menu (exact Big.js equality). */
1758
+ declare const validateOrderAgainstMenu: (input: ValidateOrderAgainstMenuInput) => OrderValidationResult;
1759
+ type OrderLineDiff = {
1760
+ uid: string;
1761
+ previous: OrderLine[];
1762
+ next: OrderLine[] | null;
1763
+ issues: OrderLineIssue[];
1764
+ };
1765
+ type CollectOrderLineDiffsInput = {
1766
+ lines: OrderLine[];
1767
+ menu: Menu$1 | null;
1768
+ locale?: string;
1769
+ lineIssues: Record<string, OrderLineIssue[]>;
1770
+ };
1771
+ declare const collectOrderLineDiffs: (input: CollectOrderLineDiffsInput) => OrderLineDiff[];
1772
+ //#endregion
1773
+ //#region src/order/OrderValidationError.d.ts
1774
+ declare class OrderValidationError extends Error {
1775
+ issues: OrderIssue[];
1776
+ lines: Record<string, OrderLineIssue[]>;
1777
+ constructor(issues: OrderIssue[], lines: Record<string, OrderLineIssue[]>);
1778
+ }
1779
+ declare const isOrderValidationError: (error: unknown) => error is OrderValidationError;
1780
+ //#endregion
1781
+ //#region src/order/totals.d.ts
1782
+ /** Sum root line group totals into order totals (Big.js). */
1783
+ declare const recomputeTotals: (lines: OrderLine[], currency?: string) => OrderTotals;
1784
+ //#endregion
1785
+ //#region src/order/lines.d.ts
1786
+ declare const addLines: (lines: OrderLine[], incoming: OrderLine | OrderLine[]) => OrderLine[];
1787
+ //#endregion
1788
+ //#region src/services/availability.d.ts
1789
+ declare const getAvailability: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<StorefrontAvailability>;
1790
+ //#endregion
1791
+ //#region src/services/cms.d.ts
1792
+ declare const getCmsBlock: (name: string, options?: ServiceHttpOptions) => Promise<{
1793
+ id: string;
1794
+ name: string;
1795
+ items: ({
1796
+ id: string;
1797
+ key: string;
1798
+ label?: string | null | undefined;
1799
+ type: "TEXT";
1800
+ text: string;
1801
+ } | {
1802
+ id: string;
1803
+ key: string;
1804
+ label?: string | null | undefined;
1805
+ type: "IMAGE";
1806
+ url: string;
1807
+ alt?: string | null | undefined;
1808
+ mime_type?: string | null | undefined;
1809
+ size_bytes?: number | null | undefined;
1810
+ } | {
1811
+ id: string;
1812
+ key: string;
1813
+ label?: string | null | undefined;
1814
+ type: "VIDEO";
1815
+ url: string;
1816
+ title?: string | null | undefined;
1817
+ mime_type?: string | null | undefined;
1818
+ size_bytes?: number | null | undefined;
1819
+ } | {
1820
+ id: string;
1821
+ key: string;
1822
+ label?: string | null | undefined;
1823
+ type: "DOCUMENT";
1824
+ url: string;
1825
+ title?: string | null | undefined;
1826
+ mime_type?: string | null | undefined;
1827
+ size_bytes?: number | null | undefined;
1828
+ } | {
1829
+ id: string;
1830
+ key: string;
1831
+ label?: string | null | undefined;
1832
+ type: "LIST";
1833
+ item_type: "DOCUMENT" | "IMAGE" | "TEXT" | "VIDEO";
1834
+ items: ({
1835
+ id: string;
1836
+ type: "TEXT";
1837
+ text: string;
1838
+ } | {
1839
+ id: string;
1840
+ type: "IMAGE";
1841
+ url: string;
1842
+ alt?: string | null | undefined;
1843
+ mime_type?: string | null | undefined;
1844
+ size_bytes?: number | null | undefined;
1845
+ } | {
1846
+ id: string;
1847
+ type: "VIDEO";
1848
+ url: string;
1849
+ title?: string | null | undefined;
1850
+ mime_type?: string | null | undefined;
1851
+ size_bytes?: number | null | undefined;
1852
+ } | {
1853
+ id: string;
1854
+ type: "DOCUMENT";
1855
+ url: string;
1856
+ title?: string | null | undefined;
1857
+ mime_type?: string | null | undefined;
1858
+ size_bytes?: number | null | undefined;
1859
+ })[];
1860
+ })[];
1861
+ status: string;
1862
+ }>;
1863
+ //#endregion
1864
+ //#region src/services/customers.d.ts
1865
+ declare const getCustomer: (id: string, options?: ServiceHttpOptions) => Promise<{
1866
+ id: string;
1867
+ uid: string;
1868
+ merchant_id: string;
1869
+ name: string;
1870
+ email: string | null;
1871
+ status: string;
1872
+ metadata: Record<string, unknown> | null;
1873
+ dob: string | null;
1874
+ gender: "FEMALE" | "MALE" | "OTHER" | null;
1875
+ registration_date: string;
1876
+ devices: {
1877
+ id: string;
1878
+ os: "ANDROID" | "IOS" | "WEB";
1879
+ fcm_token: string;
1880
+ created_at: string;
1881
+ updated_at: string;
1882
+ }[];
1883
+ delivery_addresses: {
1884
+ alias: string;
1885
+ address_line1: string;
1886
+ address_line2?: string | undefined;
1887
+ city?: string | undefined;
1888
+ state?: string | undefined;
1889
+ zip?: string | undefined;
1890
+ country?: string | undefined;
1891
+ reference?: string | undefined;
1892
+ latitude?: number | undefined;
1893
+ longitude?: number | undefined;
1894
+ instructions?: string | undefined;
1895
+ preferred: boolean;
1896
+ metadata: Record<string, unknown> | null;
1897
+ }[];
1898
+ billing_profiles: {
1899
+ alias: string;
1900
+ type: "BUSINESS" | "INDIVIDUAL";
1901
+ legal_name: string;
1902
+ address_line1: string;
1903
+ address_line2?: string | undefined;
1904
+ city?: string | undefined;
1905
+ state?: string | undefined;
1906
+ zip?: string | undefined;
1907
+ country?: string | undefined;
1908
+ tax_id: string;
1909
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
1910
+ preferred: boolean;
1911
+ metadata: Record<string, unknown> | null;
1912
+ }[];
1913
+ payments: ({
1914
+ id: string;
1915
+ type: "CASH";
1916
+ alias?: string | undefined;
1917
+ preferred: boolean;
1918
+ metadata: Record<string, unknown> | null;
1919
+ } | {
1920
+ id: string;
1921
+ type: "CARD";
1922
+ alias: string;
1923
+ brand: "amex" | "diners" | "discover" | "mastercard" | "other" | "visa";
1924
+ first4: string;
1925
+ last4: string;
1926
+ exp_month: number;
1927
+ exp_year: number;
1928
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1929
+ provider_payment_method_id: string;
1930
+ preferred: boolean;
1931
+ metadata: Record<string, unknown> | null;
1932
+ } | {
1933
+ id: string;
1934
+ type: "WALLET";
1935
+ alias: string;
1936
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1937
+ provider_payment_method_id: string;
1938
+ account_hint?: string | undefined;
1939
+ preferred: boolean;
1940
+ metadata: Record<string, unknown> | null;
1941
+ } | {
1942
+ id: string;
1943
+ type: "BANK_ACCOUNT";
1944
+ alias: string;
1945
+ bank_name?: string | undefined;
1946
+ last4: string;
1947
+ provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
1948
+ provider_payment_method_id?: string | undefined;
1949
+ preferred: boolean;
1950
+ metadata: Record<string, unknown> | null;
1951
+ })[];
1952
+ email_verified: boolean;
1953
+ consent: {
1954
+ marketing: boolean;
1955
+ } | null;
1956
+ notification_preferences: {
1957
+ email: boolean;
1958
+ push: boolean;
1959
+ push_token?: string | undefined;
1960
+ push_token_expires_at?: string | undefined;
1961
+ };
1962
+ is_anonymous: boolean;
1963
+ document_type?: string | null | undefined;
1964
+ document_number?: string | null | undefined;
1965
+ country?: string | null | undefined;
1966
+ phone?: string | null | undefined;
1967
+ phone_verified: boolean;
1968
+ }>;
1969
+ declare const createCustomer: (body: CustomerRegisterInput, options?: ServiceHttpOptions) => Promise<{
1970
+ id: string;
1971
+ uid: string;
1972
+ merchant_id: string;
1973
+ name: string;
1974
+ email: string | null;
1975
+ status: string;
1976
+ metadata: Record<string, unknown> | null;
1977
+ dob: string | null;
1978
+ gender: "FEMALE" | "MALE" | "OTHER" | null;
1979
+ registration_date: string;
1980
+ devices: {
1981
+ id: string;
1982
+ os: "ANDROID" | "IOS" | "WEB";
1983
+ fcm_token: string;
1984
+ created_at: string;
1985
+ updated_at: string;
1986
+ }[];
1987
+ delivery_addresses: {
1988
+ alias: string;
1989
+ address_line1: string;
1990
+ address_line2?: string | undefined;
1991
+ city?: string | undefined;
1992
+ state?: string | undefined;
1993
+ zip?: string | undefined;
1994
+ country?: string | undefined;
1995
+ reference?: string | undefined;
1996
+ latitude?: number | undefined;
1997
+ longitude?: number | undefined;
1998
+ instructions?: string | undefined;
1999
+ preferred: boolean;
2000
+ metadata: Record<string, unknown> | null;
2001
+ }[];
2002
+ billing_profiles: {
2003
+ alias: string;
2004
+ type: "BUSINESS" | "INDIVIDUAL";
2005
+ legal_name: string;
2006
+ address_line1: string;
2007
+ address_line2?: string | undefined;
2008
+ city?: string | undefined;
2009
+ state?: string | undefined;
2010
+ zip?: string | undefined;
2011
+ country?: string | undefined;
2012
+ tax_id: string;
2013
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
2014
+ preferred: boolean;
2015
+ metadata: Record<string, unknown> | null;
2016
+ }[];
2017
+ payments: ({
2018
+ id: string;
2019
+ type: "CASH";
2020
+ alias?: string | undefined;
2021
+ preferred: boolean;
2022
+ metadata: Record<string, unknown> | null;
2023
+ } | {
2024
+ id: string;
2025
+ type: "CARD";
2026
+ alias: string;
2027
+ brand: "amex" | "diners" | "discover" | "mastercard" | "other" | "visa";
2028
+ first4: string;
2029
+ last4: string;
2030
+ exp_month: number;
2031
+ exp_year: number;
2032
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2033
+ provider_payment_method_id: string;
2034
+ preferred: boolean;
2035
+ metadata: Record<string, unknown> | null;
2036
+ } | {
2037
+ id: string;
2038
+ type: "WALLET";
2039
+ alias: string;
2040
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2041
+ provider_payment_method_id: string;
2042
+ account_hint?: string | undefined;
2043
+ preferred: boolean;
2044
+ metadata: Record<string, unknown> | null;
2045
+ } | {
2046
+ id: string;
2047
+ type: "BANK_ACCOUNT";
2048
+ alias: string;
2049
+ bank_name?: string | undefined;
2050
+ last4: string;
2051
+ provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
2052
+ provider_payment_method_id?: string | undefined;
2053
+ preferred: boolean;
2054
+ metadata: Record<string, unknown> | null;
2055
+ })[];
2056
+ email_verified: boolean;
2057
+ consent: {
2058
+ marketing: boolean;
2059
+ } | null;
2060
+ notification_preferences: {
2061
+ email: boolean;
2062
+ push: boolean;
2063
+ push_token?: string | undefined;
2064
+ push_token_expires_at?: string | undefined;
2065
+ };
2066
+ is_anonymous: boolean;
2067
+ document_type?: string | null | undefined;
2068
+ document_number?: string | null | undefined;
2069
+ country?: string | null | undefined;
2070
+ phone?: string | null | undefined;
2071
+ phone_verified: boolean;
2072
+ }>;
2073
+ declare const identifyAnonymousCustomer: (id: string, body: CustomerIdentifyInput, options?: ServiceHttpOptions) => Promise<{
2074
+ id: string;
2075
+ uid: string;
2076
+ merchant_id: string;
2077
+ name: string;
2078
+ email: string | null;
2079
+ status: string;
2080
+ metadata: Record<string, unknown> | null;
2081
+ dob: string | null;
2082
+ gender: "FEMALE" | "MALE" | "OTHER" | null;
2083
+ registration_date: string;
2084
+ devices: {
2085
+ id: string;
2086
+ os: "ANDROID" | "IOS" | "WEB";
2087
+ fcm_token: string;
2088
+ created_at: string;
2089
+ updated_at: string;
2090
+ }[];
2091
+ delivery_addresses: {
2092
+ alias: string;
2093
+ address_line1: string;
2094
+ address_line2?: string | undefined;
2095
+ city?: string | undefined;
2096
+ state?: string | undefined;
2097
+ zip?: string | undefined;
2098
+ country?: string | undefined;
2099
+ reference?: string | undefined;
2100
+ latitude?: number | undefined;
2101
+ longitude?: number | undefined;
2102
+ instructions?: string | undefined;
2103
+ preferred: boolean;
2104
+ metadata: Record<string, unknown> | null;
2105
+ }[];
2106
+ billing_profiles: {
2107
+ alias: string;
2108
+ type: "BUSINESS" | "INDIVIDUAL";
2109
+ legal_name: string;
2110
+ address_line1: string;
2111
+ address_line2?: string | undefined;
2112
+ city?: string | undefined;
2113
+ state?: string | undefined;
2114
+ zip?: string | undefined;
2115
+ country?: string | undefined;
2116
+ tax_id: string;
2117
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
2118
+ preferred: boolean;
2119
+ metadata: Record<string, unknown> | null;
2120
+ }[];
2121
+ payments: ({
2122
+ id: string;
2123
+ type: "CASH";
2124
+ alias?: string | undefined;
2125
+ preferred: boolean;
2126
+ metadata: Record<string, unknown> | null;
2127
+ } | {
2128
+ id: string;
2129
+ type: "CARD";
2130
+ alias: string;
2131
+ brand: "amex" | "diners" | "discover" | "mastercard" | "other" | "visa";
2132
+ first4: string;
2133
+ last4: string;
2134
+ exp_month: number;
2135
+ exp_year: number;
2136
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2137
+ provider_payment_method_id: string;
2138
+ preferred: boolean;
2139
+ metadata: Record<string, unknown> | null;
2140
+ } | {
2141
+ id: string;
2142
+ type: "WALLET";
2143
+ alias: string;
2144
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2145
+ provider_payment_method_id: string;
2146
+ account_hint?: string | undefined;
2147
+ preferred: boolean;
2148
+ metadata: Record<string, unknown> | null;
2149
+ } | {
2150
+ id: string;
2151
+ type: "BANK_ACCOUNT";
2152
+ alias: string;
2153
+ bank_name?: string | undefined;
2154
+ last4: string;
2155
+ provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
2156
+ provider_payment_method_id?: string | undefined;
2157
+ preferred: boolean;
2158
+ metadata: Record<string, unknown> | null;
2159
+ })[];
2160
+ email_verified: boolean;
2161
+ consent: {
2162
+ marketing: boolean;
2163
+ } | null;
2164
+ notification_preferences: {
2165
+ email: boolean;
2166
+ push: boolean;
2167
+ push_token?: string | undefined;
2168
+ push_token_expires_at?: string | undefined;
2169
+ };
2170
+ is_anonymous: boolean;
2171
+ document_type?: string | null | undefined;
2172
+ document_number?: string | null | undefined;
2173
+ country?: string | null | undefined;
2174
+ phone?: string | null | undefined;
2175
+ phone_verified: boolean;
2176
+ }>;
2177
+ declare const updateCustomer: (id: string, body: CustomerUpdateInput, options?: ServiceHttpOptions) => Promise<{
2178
+ id: string;
2179
+ uid: string;
2180
+ merchant_id: string;
2181
+ name: string;
2182
+ email: string | null;
2183
+ status: string;
2184
+ metadata: Record<string, unknown> | null;
2185
+ dob: string | null;
2186
+ gender: "FEMALE" | "MALE" | "OTHER" | null;
2187
+ registration_date: string;
2188
+ devices: {
2189
+ id: string;
2190
+ os: "ANDROID" | "IOS" | "WEB";
2191
+ fcm_token: string;
2192
+ created_at: string;
2193
+ updated_at: string;
2194
+ }[];
2195
+ delivery_addresses: {
2196
+ alias: string;
2197
+ address_line1: string;
2198
+ address_line2?: string | undefined;
2199
+ city?: string | undefined;
2200
+ state?: string | undefined;
2201
+ zip?: string | undefined;
2202
+ country?: string | undefined;
2203
+ reference?: string | undefined;
2204
+ latitude?: number | undefined;
2205
+ longitude?: number | undefined;
2206
+ instructions?: string | undefined;
2207
+ preferred: boolean;
2208
+ metadata: Record<string, unknown> | null;
2209
+ }[];
2210
+ billing_profiles: {
2211
+ alias: string;
2212
+ type: "BUSINESS" | "INDIVIDUAL";
2213
+ legal_name: string;
2214
+ address_line1: string;
2215
+ address_line2?: string | undefined;
2216
+ city?: string | undefined;
2217
+ state?: string | undefined;
2218
+ zip?: string | undefined;
2219
+ country?: string | undefined;
2220
+ tax_id: string;
2221
+ tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
2222
+ preferred: boolean;
2223
+ metadata: Record<string, unknown> | null;
2224
+ }[];
2225
+ payments: ({
2226
+ id: string;
2227
+ type: "CASH";
2228
+ alias?: string | undefined;
2229
+ preferred: boolean;
2230
+ metadata: Record<string, unknown> | null;
2231
+ } | {
2232
+ id: string;
2233
+ type: "CARD";
2234
+ alias: string;
2235
+ brand: "amex" | "diners" | "discover" | "mastercard" | "other" | "visa";
2236
+ first4: string;
2237
+ last4: string;
2238
+ exp_month: number;
2239
+ exp_year: number;
2240
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2241
+ provider_payment_method_id: string;
2242
+ preferred: boolean;
2243
+ metadata: Record<string, unknown> | null;
2244
+ } | {
2245
+ id: string;
2246
+ type: "WALLET";
2247
+ alias: string;
2248
+ provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2249
+ provider_payment_method_id: string;
2250
+ account_hint?: string | undefined;
2251
+ preferred: boolean;
2252
+ metadata: Record<string, unknown> | null;
2253
+ } | {
2254
+ id: string;
2255
+ type: "BANK_ACCOUNT";
2256
+ alias: string;
2257
+ bank_name?: string | undefined;
2258
+ last4: string;
2259
+ provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
2260
+ provider_payment_method_id?: string | undefined;
2261
+ preferred: boolean;
2262
+ metadata: Record<string, unknown> | null;
2263
+ })[];
2264
+ email_verified: boolean;
2265
+ consent: {
2266
+ marketing: boolean;
2267
+ } | null;
2268
+ notification_preferences: {
2269
+ email: boolean;
2270
+ push: boolean;
2271
+ push_token?: string | undefined;
2272
+ push_token_expires_at?: string | undefined;
2273
+ };
2274
+ is_anonymous: boolean;
2275
+ document_type?: string | null | undefined;
2276
+ document_number?: string | null | undefined;
2277
+ country?: string | null | undefined;
2278
+ phone?: string | null | undefined;
2279
+ phone_verified: boolean;
2280
+ }>;
2281
+ declare const deleteCustomer: (id: string, options?: ServiceHttpOptions) => Promise<void>;
2282
+ //#endregion
2283
+ //#region src/services/fulfillment.d.ts
2284
+ declare const listFulfillment: (input?: FulfillmentListInput, options?: ServiceHttpOptions) => Promise<{
2285
+ id: string;
2286
+ uid: string;
2287
+ brand_id?: string | null | undefined;
2288
+ merchant_id: string;
2289
+ name: string;
2290
+ type: string;
2291
+ status: string;
2292
+ checkout_release: boolean;
2293
+ labels: string[];
2294
+ }[]>;
2295
+ declare const getFulfillment: (id: string, input?: FulfillmentListInput, options?: ServiceHttpOptions) => Promise<{
2296
+ id: string;
2297
+ uid: string;
2298
+ brand_id?: string | null | undefined;
2299
+ merchant_id: string;
2300
+ name: string;
2301
+ type: string;
2302
+ status: string;
2303
+ checkout_release: boolean;
2304
+ labels: string[];
2305
+ }>;
2306
+ //#endregion
2307
+ //#region src/services/kiosk.d.ts
2308
+ declare const isDeviceNotLinked: (error: unknown) => boolean;
2309
+ declare const isKioskUnauthorized: (error: unknown) => boolean;
2310
+ declare const getKioskConfig: (input: {
2311
+ device_code: string;
2312
+ device_secret: string;
2313
+ }, options?: ServiceHttpOptions) => Promise<KioskDeviceConfig>;
2314
+ declare const postKioskHeartbeat: (input: KioskHeartbeatInput, options?: ServiceHttpOptions) => Promise<KioskHeartbeatResult>;
2315
+ declare const postKioskHealthSamples: (input: KioskHealthBatchInput, options?: ServiceHttpOptions) => Promise<KioskHealthBatchResult>;
2316
+ declare const patchKioskOverrides: (input: {
2317
+ device_uid: string;
2318
+ device_secret: string;
2319
+ settings_overrides: KioskDeviceOverrides;
2320
+ }, options?: ServiceHttpOptions) => Promise<{
2321
+ overrides: KioskDeviceOverrides;
2322
+ }>;
2323
+ declare const unlinkKioskSelf: (input: {
2324
+ device_uid: string;
2325
+ device_secret: string;
2326
+ }, options?: ServiceHttpOptions) => Promise<{
2327
+ ok: boolean;
2328
+ }>;
2329
+ /** 403 wrong or expired code, 429 too many tries for the current code. */
2330
+ declare const verifyKioskAdminCode: (input: {
2331
+ device_uid: string;
2332
+ device_secret: string;
2333
+ code: string;
2334
+ }, options?: ServiceHttpOptions) => Promise<{
2335
+ ok: boolean;
2336
+ }>;
2337
+ declare const isKioskAdminCodeInvalid: (error: unknown) => boolean;
2338
+ declare const isKioskAdminCodeLocked: (error: unknown) => boolean;
2339
+ declare const fetchKioskRealtimeToken: (input: {
2340
+ device_uid: string;
2341
+ device_secret: string;
2342
+ }, options?: ServiceHttpOptions) => Promise<KioskRealtimeToken>;
2343
+ //#endregion
2344
+ //#region src/services/menus.types.d.ts
2345
+ type ListMenusStreamOptions = ServiceHttpOptions & StorefrontMenuStreamOptions;
2346
+ //#endregion
2347
+ //#region src/services/menus.d.ts
2348
+ declare const listMenus: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<{
2349
+ id: string;
2350
+ uid: string;
2351
+ merchant_id: string;
2352
+ brand_id: string;
2353
+ store_id: string;
2354
+ store_uid?: string | null | undefined;
2355
+ channel_id: string;
2356
+ channel_uid?: string | null | undefined;
2357
+ fulfillment_id: string;
2358
+ fulfillment_uid?: string | null | undefined;
2359
+ name: Record<string, string>;
2360
+ description: Record<string, string> | null;
2361
+ schedules: {
2362
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2363
+ periods: {
2364
+ closed: boolean;
2365
+ start_time?: string | undefined;
2366
+ end_time?: string | undefined;
2367
+ start_date?: string | null | undefined;
2368
+ end_date?: string | null | undefined;
2369
+ }[];
2370
+ }[] | null;
2371
+ products: {
2372
+ id: string;
2373
+ name: Record<string, string>;
2374
+ description: Record<string, string> | null;
2375
+ image_url: string | null;
2376
+ cms_template_id?: string | null | undefined;
2377
+ bundled_items: {
2378
+ id: string;
2379
+ refund_price: number;
2380
+ included_quantity: number;
2381
+ }[];
2382
+ pricing: {
2383
+ minimum_quantity: number;
2384
+ maximum_quantity: number;
2385
+ is_tax_inclusive: boolean;
2386
+ tax_rate: number;
2387
+ price: number;
2388
+ anchor_price?: number | undefined;
2389
+ anchor_price_percentage?: number | undefined;
2390
+ modifiers: {
2391
+ modifier_group_id: string;
2392
+ default_quantity: number;
2393
+ charge_above_quantity?: number | null | undefined;
2394
+ display_type?: "CHECKBOX" | "QUANTITY" | "RADIO" | null | undefined;
2395
+ recommendations: {
2396
+ recommendation_id: string;
2397
+ default_quantity: number;
2398
+ }[];
2399
+ minimum_quantity: number;
2400
+ maximum_quantity?: number | undefined;
2401
+ is_tax_inclusive: boolean;
2402
+ tax_rate: number;
2403
+ price: number;
2404
+ anchor_price?: number | undefined;
2405
+ anchor_price_percentage?: number | undefined;
2406
+ }[];
2407
+ modifier_group_ids: string[];
2408
+ recommendations: {
2409
+ recommendation_id: string;
2410
+ default_quantity: number;
2411
+ }[];
2412
+ recommendations_ids: string[];
2413
+ };
2414
+ availability: {
2415
+ schedules?: {
2416
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2417
+ periods: {
2418
+ closed: boolean;
2419
+ start_time?: string | undefined;
2420
+ end_time?: string | undefined;
2421
+ start_date?: string | null | undefined;
2422
+ end_date?: string | null | undefined;
2423
+ }[];
2424
+ }[] | null | undefined;
2425
+ out_of_stock_until?: string | null | undefined;
2426
+ status: "AVAILABLE" | "HIDDEN" | "OUT_OF_STOCK";
2427
+ };
2428
+ image_origin_url?: string | null | undefined;
2429
+ labels: string[];
2430
+ tags: Record<string, string | number | boolean>;
2431
+ metadata: Record<string, unknown>;
2432
+ }[];
2433
+ categories: {
2434
+ id: string;
2435
+ name: Record<string, string>;
2436
+ description?: Record<string, string> | null | undefined;
2437
+ cms_template_id?: string | null | undefined;
2438
+ cms?: {
2439
+ id: string;
2440
+ merchant_id: string;
2441
+ env: string;
2442
+ name: string;
2443
+ fields: {
2444
+ name: string;
2445
+ type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
2446
+ label?: Record<string, string> | null | undefined;
2447
+ required: boolean;
2448
+ placeholder?: string | null | undefined;
2449
+ options?: {
2450
+ label: string;
2451
+ value: string;
2452
+ }[] | null | undefined;
2453
+ altText?: string | null | undefined;
2454
+ src?: string | null | undefined;
2455
+ href?: string | null | undefined;
2456
+ }[];
2457
+ entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
2458
+ status: string;
2459
+ } | null | undefined;
2460
+ items: {
2461
+ type: "CATEGORY" | "PRODUCT";
2462
+ id: string;
2463
+ }[];
2464
+ availability: {
2465
+ schedules?: {
2466
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2467
+ periods: {
2468
+ closed: boolean;
2469
+ start_time?: string | undefined;
2470
+ end_time?: string | undefined;
2471
+ start_date?: string | null | undefined;
2472
+ end_date?: string | null | undefined;
2473
+ }[];
2474
+ }[] | null | undefined;
2475
+ inactive_until?: string | null | undefined;
2476
+ status: "ACTIVE" | "HIDDEN" | "INACTIVE";
2477
+ };
2478
+ image_url: string | null;
2479
+ image_origin_url?: string | null | undefined;
2480
+ labels: string[];
2481
+ tags: Record<string, string | number | boolean>;
2482
+ metadata: Record<string, unknown>;
2483
+ }[];
2484
+ modifier_groups: {
2485
+ id: string;
2486
+ title: Record<string, string>;
2487
+ description?: Record<string, string> | null | undefined;
2488
+ display_type?: "GRID" | "LIST" | null | undefined;
2489
+ modifier_ids: string[];
2490
+ minimum_quantity: number;
2491
+ maximum_quantity: number;
2492
+ charge_above_quantity?: number | null | undefined;
2493
+ metadata: Record<string, unknown>;
2494
+ }[];
2495
+ recommendations: ({
2496
+ id: string;
2497
+ title: Record<string, string>;
2498
+ description?: Record<string, string> | null | undefined;
2499
+ metadata: Record<string, unknown>;
2500
+ target_product_id: string;
2501
+ type: "UPSELL";
2502
+ } | {
2503
+ id: string;
2504
+ title: Record<string, string>;
2505
+ description?: Record<string, string> | null | undefined;
2506
+ metadata: Record<string, unknown>;
2507
+ target_product_id: string;
2508
+ type: "CROSS_SELL";
2509
+ } | {
2510
+ id: string;
2511
+ title: Record<string, string>;
2512
+ description?: Record<string, string> | null | undefined;
2513
+ metadata: Record<string, unknown>;
2514
+ target_product_id: string;
2515
+ type: "DOWNSELL";
2516
+ })[];
2517
+ metadata: Record<string, unknown>;
2518
+ cms_template_id?: string | null | undefined;
2519
+ status: string;
2520
+ release: string;
2521
+ cms?: {
2522
+ id: string;
2523
+ name: string;
2524
+ entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
2525
+ status: string;
2526
+ fields: {
2527
+ name: string;
2528
+ type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
2529
+ label?: Record<string, string> | null | undefined;
2530
+ required: boolean;
2531
+ placeholder?: string | null | undefined;
2532
+ options?: {
2533
+ label: string;
2534
+ value: string;
2535
+ }[] | null | undefined;
2536
+ altText?: string | null | undefined;
2537
+ src?: string | null | undefined;
2538
+ href?: string | null | undefined;
2539
+ value?: unknown;
2540
+ }[];
2541
+ } | null | undefined;
2542
+ }[]>;
2543
+ declare const listMenusStream: (scope?: StorefrontMenuScope, options?: ListMenusStreamOptions) => AsyncGenerator<{
2544
+ id: string;
2545
+ uid: string;
2546
+ merchant_id: string;
2547
+ brand_id: string;
2548
+ store_id: string;
2549
+ store_uid?: string | null | undefined;
2550
+ channel_id: string;
2551
+ channel_uid?: string | null | undefined;
2552
+ fulfillment_id: string;
2553
+ fulfillment_uid?: string | null | undefined;
2554
+ name: Record<string, string>;
2555
+ description: Record<string, string> | null;
2556
+ schedules: {
2557
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2558
+ periods: {
2559
+ closed: boolean;
2560
+ start_time?: string | undefined;
2561
+ end_time?: string | undefined;
2562
+ start_date?: string | null | undefined;
2563
+ end_date?: string | null | undefined;
2564
+ }[];
2565
+ }[] | null;
2566
+ products: {
2567
+ id: string;
2568
+ name: Record<string, string>;
2569
+ description: Record<string, string> | null;
2570
+ image_url: string | null;
2571
+ cms_template_id?: string | null | undefined;
2572
+ bundled_items: {
2573
+ id: string;
2574
+ refund_price: number;
2575
+ included_quantity: number;
2576
+ }[];
2577
+ pricing: {
2578
+ minimum_quantity: number;
2579
+ maximum_quantity: number;
2580
+ is_tax_inclusive: boolean;
2581
+ tax_rate: number;
2582
+ price: number;
2583
+ anchor_price?: number | undefined;
2584
+ anchor_price_percentage?: number | undefined;
2585
+ modifiers: {
2586
+ modifier_group_id: string;
2587
+ default_quantity: number;
2588
+ charge_above_quantity?: number | null | undefined;
2589
+ display_type?: "CHECKBOX" | "QUANTITY" | "RADIO" | null | undefined;
2590
+ recommendations: {
2591
+ recommendation_id: string;
2592
+ default_quantity: number;
2593
+ }[];
2594
+ minimum_quantity: number;
2595
+ maximum_quantity?: number | undefined;
2596
+ is_tax_inclusive: boolean;
2597
+ tax_rate: number;
2598
+ price: number;
2599
+ anchor_price?: number | undefined;
2600
+ anchor_price_percentage?: number | undefined;
2601
+ }[];
2602
+ modifier_group_ids: string[];
2603
+ recommendations: {
2604
+ recommendation_id: string;
2605
+ default_quantity: number;
2606
+ }[];
2607
+ recommendations_ids: string[];
2608
+ };
2609
+ availability: {
2610
+ schedules?: {
2611
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2612
+ periods: {
2613
+ closed: boolean;
2614
+ start_time?: string | undefined;
2615
+ end_time?: string | undefined;
2616
+ start_date?: string | null | undefined;
2617
+ end_date?: string | null | undefined;
2618
+ }[];
2619
+ }[] | null | undefined;
2620
+ out_of_stock_until?: string | null | undefined;
2621
+ status: "AVAILABLE" | "HIDDEN" | "OUT_OF_STOCK";
2622
+ };
2623
+ image_origin_url?: string | null | undefined;
2624
+ labels: string[];
2625
+ tags: Record<string, string | number | boolean>;
2626
+ metadata: Record<string, unknown>;
2627
+ }[];
2628
+ categories: {
2629
+ id: string;
2630
+ name: Record<string, string>;
2631
+ description?: Record<string, string> | null | undefined;
2632
+ cms_template_id?: string | null | undefined;
2633
+ cms?: {
2634
+ id: string;
2635
+ merchant_id: string;
2636
+ env: string;
2637
+ name: string;
2638
+ fields: {
2639
+ name: string;
2640
+ type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
2641
+ label?: Record<string, string> | null | undefined;
2642
+ required: boolean;
2643
+ placeholder?: string | null | undefined;
2644
+ options?: {
2645
+ label: string;
2646
+ value: string;
2647
+ }[] | null | undefined;
2648
+ altText?: string | null | undefined;
2649
+ src?: string | null | undefined;
2650
+ href?: string | null | undefined;
2651
+ }[];
2652
+ entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
2653
+ status: string;
2654
+ } | null | undefined;
2655
+ items: {
2656
+ type: "CATEGORY" | "PRODUCT";
2657
+ id: string;
2658
+ }[];
2659
+ availability: {
2660
+ schedules?: {
2661
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2662
+ periods: {
2663
+ closed: boolean;
2664
+ start_time?: string | undefined;
2665
+ end_time?: string | undefined;
2666
+ start_date?: string | null | undefined;
2667
+ end_date?: string | null | undefined;
2668
+ }[];
2669
+ }[] | null | undefined;
2670
+ inactive_until?: string | null | undefined;
2671
+ status: "ACTIVE" | "HIDDEN" | "INACTIVE";
2672
+ };
2673
+ image_url: string | null;
2674
+ image_origin_url?: string | null | undefined;
2675
+ labels: string[];
2676
+ tags: Record<string, string | number | boolean>;
2677
+ metadata: Record<string, unknown>;
2678
+ }[];
2679
+ modifier_groups: {
2680
+ id: string;
2681
+ title: Record<string, string>;
2682
+ description?: Record<string, string> | null | undefined;
2683
+ display_type?: "GRID" | "LIST" | null | undefined;
2684
+ modifier_ids: string[];
2685
+ minimum_quantity: number;
2686
+ maximum_quantity: number;
2687
+ charge_above_quantity?: number | null | undefined;
2688
+ metadata: Record<string, unknown>;
2689
+ }[];
2690
+ recommendations: ({
2691
+ id: string;
2692
+ title: Record<string, string>;
2693
+ description?: Record<string, string> | null | undefined;
2694
+ metadata: Record<string, unknown>;
2695
+ target_product_id: string;
2696
+ type: "UPSELL";
2697
+ } | {
2698
+ id: string;
2699
+ title: Record<string, string>;
2700
+ description?: Record<string, string> | null | undefined;
2701
+ metadata: Record<string, unknown>;
2702
+ target_product_id: string;
2703
+ type: "CROSS_SELL";
2704
+ } | {
2705
+ id: string;
2706
+ title: Record<string, string>;
2707
+ description?: Record<string, string> | null | undefined;
2708
+ metadata: Record<string, unknown>;
2709
+ target_product_id: string;
2710
+ type: "DOWNSELL";
2711
+ })[];
2712
+ metadata: Record<string, unknown>;
2713
+ cms_template_id?: string | null | undefined;
2714
+ status: string;
2715
+ release: string;
2716
+ cms?: {
2717
+ id: string;
2718
+ name: string;
2719
+ entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
2720
+ status: string;
2721
+ fields: {
2722
+ name: string;
2723
+ type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
2724
+ label?: Record<string, string> | null | undefined;
2725
+ required: boolean;
2726
+ placeholder?: string | null | undefined;
2727
+ options?: {
2728
+ label: string;
2729
+ value: string;
2730
+ }[] | null | undefined;
2731
+ altText?: string | null | undefined;
2732
+ src?: string | null | undefined;
2733
+ href?: string | null | undefined;
2734
+ value?: unknown;
2735
+ }[];
2736
+ } | null | undefined;
2737
+ }[], any, any>;
2738
+ //#endregion
2739
+ //#region src/services/payments.d.ts
2740
+ declare const listPayments: (input: StorefrontPaymentsListInput, options?: ServiceHttpOptions) => Promise<{
2741
+ created_at: string;
2742
+ updated_at: string;
2743
+ deleted_at: string | null;
2744
+ id: string;
2745
+ payment_provider_id: string;
2746
+ payment_method_id: string;
2747
+ rules: {
2748
+ minimum_order_value: number;
2749
+ maximum_order_value: number;
2750
+ }[];
2751
+ conditions: ({
2752
+ interpretation?: "both" | "client" | "server" | undefined;
2753
+ product_id?: string | undefined;
2754
+ tag?: string | undefined;
2755
+ fulfillment_id: string;
2756
+ store_id: string;
2757
+ channel_id: string;
2758
+ brand_id: string;
2759
+ primitive: "string";
2760
+ type: "Failure message" | "Order includes product with tag" | "Request path";
2761
+ operator: "contains" | "ends with" | "equal to" | "not equal to" | "starts with";
2762
+ caseInsensitive?: boolean | undefined;
2763
+ value: string;
2764
+ invalidMessage?: string | undefined;
2765
+ } | {
2766
+ interpretation?: "both" | "client" | "server" | undefined;
2767
+ product_id?: string | undefined;
2768
+ tag?: string | undefined;
2769
+ fulfillment_id: string;
2770
+ store_id: string;
2771
+ channel_id: string;
2772
+ brand_id: string;
2773
+ primitive: "number";
2774
+ type: "API error rate" | "Accumulated events" | "Cart product count" | "Customer age" | "HTTP status" | "Order includes product" | "Order includes product with tag";
2775
+ operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
2776
+ value: number;
2777
+ include_modifiers?: boolean | undefined;
2778
+ window_minutes?: number | undefined;
2779
+ invalidMessage?: string | undefined;
2780
+ } | {
2781
+ interpretation?: "both" | "client" | "server" | undefined;
2782
+ product_id?: string | undefined;
2783
+ tag?: string | undefined;
2784
+ fulfillment_id: string;
2785
+ store_id: string;
2786
+ channel_id: string;
2787
+ brand_id: string;
2788
+ primitive: "currency";
2789
+ type: "Order includes product with tag" | "Order total";
2790
+ operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
2791
+ value: number;
2792
+ invalidMessage?: string | undefined;
2793
+ } | {
2794
+ interpretation?: "both" | "client" | "server" | undefined;
2795
+ product_id?: string | undefined;
2796
+ tag?: string | undefined;
2797
+ fulfillment_id: string;
2798
+ store_id: string;
2799
+ channel_id: string;
2800
+ brand_id: string;
2801
+ primitive: "boolean";
2802
+ type: "Customer is anonymous" | "Is anonymous order" | "Order includes product with tag";
2803
+ operator: "is" | "is not";
2804
+ value: boolean;
2805
+ invalidMessage?: string | undefined;
2806
+ } | {
2807
+ interpretation?: "both" | "client" | "server" | undefined;
2808
+ primitive: "enum";
2809
+ type: "Payment collect at" | "Payment method" | "Payment status";
2810
+ operator: "is" | "is any of" | "is none of" | "is not";
2811
+ value: string | string[];
2812
+ invalidMessage?: string | undefined;
2813
+ } | {
2814
+ interpretation?: "both" | "client" | "server" | undefined;
2815
+ primitive: "absolute date";
2816
+ type: "Today";
2817
+ operator: "is" | "is after" | "is before" | "is not";
2818
+ value: Date;
2819
+ invalidMessage?: string | undefined;
2820
+ } | {
2821
+ interpretation?: "both" | "client" | "server" | undefined;
2822
+ primitive: "relative date";
2823
+ type: "Birthday" | "Customer last session" | "Customer last visit" | "Registration";
2824
+ operator: "occurred" | "occurred in the last" | "occurred more than";
2825
+ value: string;
2826
+ invalidMessage?: string | undefined;
2827
+ } | {
2828
+ interpretation?: "both" | "client" | "server" | undefined;
2829
+ primitive: "recurring date";
2830
+ type: "Current date";
2831
+ operator: "falls within period";
2832
+ startDate: Date;
2833
+ endDate: Date;
2834
+ allDay: boolean;
2835
+ repeat: "CUSTOM" | "DAILY" | "FORTNIGHTLY" | "LAST_DAY_OF_MONTH" | "MONTHLY" | "NONE" | "WEEKDAYS" | "WEEKENDS" | "WEEKLY" | "WEEK_OF_MONTH";
2836
+ value: string;
2837
+ invalidMessage?: string | undefined;
2838
+ } | {
2839
+ interpretation?: "both" | "client" | "server" | undefined;
2840
+ primitive: "custom";
2841
+ type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
2842
+ operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
2843
+ value: string;
2844
+ label_ids?: string[] | undefined;
2845
+ invalidMessage?: string | undefined;
2846
+ })[][];
2847
+ status: string;
2848
+ provider: {
2849
+ id: string;
2850
+ provider_id: string;
2851
+ name: string;
2852
+ logo_url?: string | null | undefined;
2853
+ };
2854
+ method: {
2855
+ id: string;
2856
+ method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
2857
+ name: string;
2858
+ version: string;
2859
+ };
2860
+ config: Record<string, unknown>;
2861
+ has_conditions: boolean;
2862
+ }[]>;
2863
+ //#endregion
2864
+ //#region src/services/preferences.d.ts
2865
+ declare const getPreferences: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<{
2866
+ availability: {
2867
+ status: "AVAILABLE";
2868
+ next_change_at: string | null;
2869
+ } | {
2870
+ status: "UNAVAILABLE";
2871
+ rule: {
2872
+ id: string;
2873
+ title: string;
2874
+ description: string;
2875
+ schedule: {
2876
+ mode: "IMMEDIATE";
2877
+ } | {
2878
+ mode: "SCHEDULED";
2879
+ start_date: string;
2880
+ end_date: string;
2881
+ };
2882
+ };
2883
+ next_change_at: string | null;
2884
+ };
2885
+ analytics: {
2886
+ session: {
2887
+ value: number;
2888
+ unit: "h" | "min" | "s";
2889
+ };
2890
+ session_ms: number;
2891
+ };
2892
+ prep_time: {
2893
+ strategy: "PER_ITEM" | "PER_ORDER";
2894
+ value: number;
2895
+ unit: "min";
2896
+ operator?: "eq" | "gt" | "gte" | "lt" | "lte" | undefined;
2897
+ preparing?: number | undefined;
2898
+ };
2899
+ order_rules: {
2900
+ order: {
2901
+ min_items: number;
2902
+ max_items: number;
2903
+ min_total: number;
2904
+ max_total: number;
2905
+ };
2906
+ redeems: {
2907
+ max_redeems: number;
2908
+ max_total: number;
2909
+ };
2910
+ };
2911
+ release: {
2912
+ min_version: string | null;
2913
+ title: string;
2914
+ description: string;
2915
+ ios_store_url: string;
2916
+ android_store_url: string;
2917
+ };
2918
+ }>;
2919
+ //#endregion
2920
+ //#region src/services/stores.d.ts
2921
+ /** Active stores of the merchant/env in the access token (one page). */
2922
+ declare const listStores: (input?: StoreListInput, options?: ServiceHttpOptions) => Promise<{
2923
+ id: string;
2924
+ uid: string;
2925
+ merchant_id: string;
2926
+ brand_id?: string | null | undefined;
2927
+ name: string;
2928
+ contact: {
2929
+ email: string;
2930
+ phone: string;
2931
+ name?: string | null | undefined;
2932
+ };
2933
+ location: {
2934
+ latitude: number;
2935
+ longitude: number;
2936
+ address_line_1: string;
2937
+ address_line_2?: string | null | undefined;
2938
+ city: string;
2939
+ country: string;
2940
+ postal_code?: string | null | undefined;
2941
+ business_name: string;
2942
+ unit_number?: string | null | undefined;
2943
+ };
2944
+ timezone: string;
2945
+ instructions?: Record<string, string> | null | undefined;
2946
+ availability: {
2947
+ schedules: {
2948
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2949
+ periods: {
2950
+ closed: boolean;
2951
+ start_time?: string | undefined;
2952
+ end_time?: string | undefined;
2953
+ start_date?: string | null | undefined;
2954
+ end_date?: string | null | undefined;
2955
+ }[];
2956
+ }[] | null;
2957
+ temporary_closed_reason?: Record<string, string> | null | undefined;
2958
+ temporary_closed_until?: string | null | undefined;
2959
+ status: "CLOSED" | "OPEN" | "TEMPORARILY_CLOSED";
2960
+ };
2961
+ tags: Record<string, string | number | boolean>;
2962
+ cms_template_id?: string | null | undefined;
2963
+ status: string;
2964
+ coverage_zones: {
2965
+ id: string;
2966
+ name: string;
2967
+ type: "POLYGON" | "RADIUS";
2968
+ radius_info?: {
2969
+ latitude: number;
2970
+ longitude: number;
2971
+ radius: number;
2972
+ } | null | undefined;
2973
+ polygon_info?: {
2974
+ polygon: {
2975
+ latitude: number;
2976
+ longitude: number;
2977
+ }[];
2978
+ } | null | undefined;
2979
+ schedules: {
2980
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2981
+ periods: {
2982
+ closed: boolean;
2983
+ start_time?: string | undefined;
2984
+ end_time?: string | undefined;
2985
+ start_date?: string | null | undefined;
2986
+ end_date?: string | null | undefined;
2987
+ }[];
2988
+ }[] | null;
2989
+ labels: string[];
2990
+ tags: Record<string, string | number | boolean>;
2991
+ status: string;
2992
+ }[];
2993
+ cms?: {
2994
+ id: string;
2995
+ name: string;
2996
+ entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
2997
+ status: string;
2998
+ fields: {
2999
+ name: string;
3000
+ type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
3001
+ label?: Record<string, string> | null | undefined;
3002
+ required: boolean;
3003
+ placeholder?: string | null | undefined;
3004
+ options?: {
3005
+ label: string;
3006
+ value: string;
3007
+ }[] | null | undefined;
3008
+ altText?: string | null | undefined;
3009
+ src?: string | null | undefined;
3010
+ href?: string | null | undefined;
3011
+ value?: unknown;
3012
+ }[];
3013
+ } | null | undefined;
3014
+ labels: string[];
3015
+ }[]>;
3016
+ declare const listNearbyStores: (input: StoreNearbyInput, options?: ServiceHttpOptions) => Promise<{
3017
+ id: string;
3018
+ uid: string;
3019
+ merchant_id: string;
3020
+ brand_id?: string | null | undefined;
3021
+ name: string;
3022
+ contact: {
3023
+ email: string;
3024
+ phone: string;
3025
+ name?: string | null | undefined;
3026
+ };
3027
+ location: {
3028
+ latitude: number;
3029
+ longitude: number;
3030
+ address_line_1: string;
3031
+ address_line_2?: string | null | undefined;
3032
+ city: string;
3033
+ country: string;
3034
+ postal_code?: string | null | undefined;
3035
+ business_name: string;
3036
+ unit_number?: string | null | undefined;
3037
+ };
3038
+ timezone: string;
3039
+ instructions?: Record<string, string> | null | undefined;
3040
+ availability: {
3041
+ schedules: {
3042
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3043
+ periods: {
3044
+ closed: boolean;
3045
+ start_time?: string | undefined;
3046
+ end_time?: string | undefined;
3047
+ start_date?: string | null | undefined;
3048
+ end_date?: string | null | undefined;
3049
+ }[];
3050
+ }[] | null;
3051
+ temporary_closed_reason?: Record<string, string> | null | undefined;
3052
+ temporary_closed_until?: string | null | undefined;
3053
+ status: "CLOSED" | "OPEN" | "TEMPORARILY_CLOSED";
3054
+ };
3055
+ tags: Record<string, string | number | boolean>;
3056
+ cms_template_id?: string | null | undefined;
3057
+ status: string;
3058
+ coverage_zones: {
3059
+ id: string;
3060
+ name: string;
3061
+ type: "POLYGON" | "RADIUS";
3062
+ radius_info?: {
3063
+ latitude: number;
3064
+ longitude: number;
3065
+ radius: number;
3066
+ } | null | undefined;
3067
+ polygon_info?: {
3068
+ polygon: {
3069
+ latitude: number;
3070
+ longitude: number;
3071
+ }[];
3072
+ } | null | undefined;
3073
+ schedules: {
3074
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3075
+ periods: {
3076
+ closed: boolean;
3077
+ start_time?: string | undefined;
3078
+ end_time?: string | undefined;
3079
+ start_date?: string | null | undefined;
3080
+ end_date?: string | null | undefined;
3081
+ }[];
3082
+ }[] | null;
3083
+ labels: string[];
3084
+ tags: Record<string, string | number | boolean>;
3085
+ status: string;
3086
+ }[];
3087
+ cms?: {
3088
+ id: string;
3089
+ name: string;
3090
+ entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
3091
+ status: string;
3092
+ fields: {
3093
+ name: string;
3094
+ type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
3095
+ label?: Record<string, string> | null | undefined;
3096
+ required: boolean;
3097
+ placeholder?: string | null | undefined;
3098
+ options?: {
3099
+ label: string;
3100
+ value: string;
3101
+ }[] | null | undefined;
3102
+ altText?: string | null | undefined;
3103
+ src?: string | null | undefined;
3104
+ href?: string | null | undefined;
3105
+ value?: unknown;
3106
+ }[];
3107
+ } | null | undefined;
3108
+ labels: string[];
3109
+ }[]>;
3110
+ declare const getStore: (id: string, options?: ServiceHttpOptions) => Promise<{
3111
+ id: string;
3112
+ uid: string;
3113
+ merchant_id: string;
3114
+ brand_id?: string | null | undefined;
3115
+ name: string;
3116
+ contact: {
3117
+ email: string;
3118
+ phone: string;
3119
+ name?: string | null | undefined;
3120
+ };
3121
+ location: {
3122
+ latitude: number;
3123
+ longitude: number;
3124
+ address_line_1: string;
3125
+ address_line_2?: string | null | undefined;
3126
+ city: string;
3127
+ country: string;
3128
+ postal_code?: string | null | undefined;
3129
+ business_name: string;
3130
+ unit_number?: string | null | undefined;
3131
+ };
3132
+ timezone: string;
3133
+ instructions?: Record<string, string> | null | undefined;
3134
+ availability: {
3135
+ schedules: {
3136
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3137
+ periods: {
3138
+ closed: boolean;
3139
+ start_time?: string | undefined;
3140
+ end_time?: string | undefined;
3141
+ start_date?: string | null | undefined;
3142
+ end_date?: string | null | undefined;
3143
+ }[];
3144
+ }[] | null;
3145
+ temporary_closed_reason?: Record<string, string> | null | undefined;
3146
+ temporary_closed_until?: string | null | undefined;
3147
+ status: "CLOSED" | "OPEN" | "TEMPORARILY_CLOSED";
3148
+ };
3149
+ tags: Record<string, string | number | boolean>;
3150
+ cms_template_id?: string | null | undefined;
3151
+ status: string;
3152
+ coverage_zones: {
3153
+ id: string;
3154
+ name: string;
3155
+ type: "POLYGON" | "RADIUS";
3156
+ radius_info?: {
3157
+ latitude: number;
3158
+ longitude: number;
3159
+ radius: number;
3160
+ } | null | undefined;
3161
+ polygon_info?: {
3162
+ polygon: {
3163
+ latitude: number;
3164
+ longitude: number;
3165
+ }[];
3166
+ } | null | undefined;
3167
+ schedules: {
3168
+ day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3169
+ periods: {
3170
+ closed: boolean;
3171
+ start_time?: string | undefined;
3172
+ end_time?: string | undefined;
3173
+ start_date?: string | null | undefined;
3174
+ end_date?: string | null | undefined;
3175
+ }[];
3176
+ }[] | null;
3177
+ labels: string[];
3178
+ tags: Record<string, string | number | boolean>;
3179
+ status: string;
3180
+ }[];
3181
+ cms?: {
3182
+ id: string;
3183
+ name: string;
3184
+ entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
3185
+ status: string;
3186
+ fields: {
3187
+ name: string;
3188
+ type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
3189
+ label?: Record<string, string> | null | undefined;
3190
+ required: boolean;
3191
+ placeholder?: string | null | undefined;
3192
+ options?: {
3193
+ label: string;
3194
+ value: string;
3195
+ }[] | null | undefined;
3196
+ altText?: string | null | undefined;
3197
+ src?: string | null | undefined;
3198
+ href?: string | null | undefined;
3199
+ value?: unknown;
3200
+ }[];
3201
+ } | null | undefined;
3202
+ labels: string[];
3203
+ }>;
3204
+ //#endregion
3205
+ //#region src/services/index.d.ts
3206
+ declare const services: {
3207
+ preferences: {
3208
+ get: typeof getPreferences;
3209
+ };
3210
+ availability: {
3211
+ get: typeof getAvailability;
3212
+ };
3213
+ cms: {
3214
+ getBlock: typeof getCmsBlock;
3215
+ };
3216
+ customers: {
3217
+ get: typeof getCustomer;
3218
+ post: typeof createCustomer;
3219
+ patch: typeof updateCustomer;
3220
+ delete: typeof deleteCustomer;
3221
+ identifyAnonymous: typeof identifyAnonymousCustomer;
3222
+ };
3223
+ fulfillment: {
3224
+ list: typeof listFulfillment;
3225
+ get: typeof getFulfillment;
3226
+ };
3227
+ menus: {
3228
+ get: typeof listMenus;
3229
+ stream: typeof listMenusStream;
3230
+ };
3231
+ orders: {
3232
+ list: typeof listOrders;
3233
+ post: typeof createOrder;
3234
+ get: typeof getOrder;
3235
+ patch: typeof updateOrder;
3236
+ cancel: typeof cancelOrder;
3237
+ refund: typeof refundOrder;
3238
+ reorder: typeof reorderOrder;
3239
+ validate: typeof validateOrder;
3240
+ place: typeof placeOrder;
3241
+ getFulfillment: typeof getOrderFulfillment;
3242
+ listFulfillments: typeof listOrderFulfillments;
3243
+ };
3244
+ payments: {
3245
+ list: typeof listPayments;
3246
+ };
3247
+ stores: {
3248
+ list: typeof listStores;
3249
+ nearby: typeof listNearbyStores;
3250
+ get: typeof getStore;
3251
+ };
3252
+ kiosk: {
3253
+ getConfig: typeof getKioskConfig;
3254
+ heartbeat: typeof postKioskHeartbeat;
3255
+ postHealthSamples: typeof postKioskHealthSamples;
3256
+ patchOverrides: typeof patchKioskOverrides;
3257
+ realtimeToken: typeof fetchKioskRealtimeToken;
3258
+ unlink: typeof unlinkKioskSelf;
3259
+ verifyAdminCode: typeof verifyKioskAdminCode;
3260
+ isAdminCodeInvalid: typeof isKioskAdminCodeInvalid;
3261
+ isAdminCodeLocked: typeof isKioskAdminCodeLocked;
3262
+ isDeviceNotLinked: typeof isDeviceNotLinked;
3263
+ isKioskUnauthorized: typeof isKioskUnauthorized;
3264
+ };
3265
+ };
3266
+ //#endregion
3267
+ //#region src/schedule/schedule.d.ts
3268
+ type ScheduleWindow = {
3269
+ active: true;
3270
+ until: Date | null;
3271
+ } | {
3272
+ active: false;
3273
+ next: Date | null;
3274
+ };
3275
+ /** Whether `schedule` is in hours now, and until / next open. */
3276
+ declare const getScheduleWindow: (schedule: Schedule | null | undefined, now?: Date) => ScheduleWindow;
3277
+ declare const isOnSchedule: (schedule: Schedule | null | undefined, now?: Date) => boolean;
3278
+ //#endregion
3279
+ //#region src/rules/RulesEngine.d.ts
3280
+ declare class RulesEngine {
3281
+ order?: RulesEngineParams["order"];
3282
+ customer?: RulesEngineParams["customer"];
3283
+ payment?: RulesEngineParams["payment"];
3284
+ monitoring?: RulesEngineParams["monitoring"];
3285
+ referenceDate?: string;
3286
+ runtime?: RulesEngineParams["runtime"];
3287
+ constructor(params?: RulesEngineParams);
3288
+ private getDependency;
3289
+ private selectError;
3290
+ private getProductId;
3291
+ private getProductTag;
3292
+ private matchOrderProductTag;
3293
+ private assertString;
3294
+ private assertNumber;
3295
+ private assertBoolean;
3296
+ private assertCurrency;
3297
+ private assertEnum;
3298
+ private assertAbsoluteDate;
3299
+ private assertRelativeDate;
3300
+ private assertRecurringDate;
3301
+ private assertCustom;
3302
+ assertCondition: (condition: Condition) => boolean;
3303
+ matchCondition: (condition: Condition) => MatchResult<Condition>;
3304
+ matchAndConditions: (andConditions: AndConditions) => MatchResult<AndConditions>;
3305
+ matchOrConditions: (orConditions: OrConditions) => MatchResult<AndConditions>;
3306
+ matchRules: <T extends MatchableRule>(rules: T[], options?: {
3307
+ exclusive?: boolean;
3308
+ }) => T[];
3309
+ }
3310
+ //#endregion
3311
+ //#region src/rules/common.d.ts
3312
+ declare const defaultConditionError = "Condition was not met";
3313
+ declare const countCartProducts: (lines: RulesEngineOrderLine[] | undefined, includeModifiers: boolean) => number;
3314
+ //#endregion
3315
+ //#region src/rules/absoluteDateMatcher.d.ts
3316
+ declare const matchAbsoluteDateOperator: (condition: Condition, matcher: Date | string | undefined) => boolean;
3317
+ //#endregion
3318
+ //#region src/rules/relativeDateMatcher.d.ts
3319
+ declare const matchRelativeDateOperator: (condition: Condition, matcher: string | undefined, referenceDate?: string) => boolean;
3320
+ //#endregion
3321
+ //#region src/rules/recurringDateMatcher.d.ts
3322
+ declare const matchRecurringDateOperator: (condition: Condition, matcher: string | undefined) => boolean;
3323
+ //#endregion
3324
+ //#region src/rules/stringMatcher.d.ts
3325
+ declare const matchStringOperator: (condition: Condition, matcher: string | undefined) => boolean;
3326
+ //#endregion
3327
+ //#region src/rules/numberMatcher.d.ts
3328
+ declare const matchNumberOperator: (condition: Condition, matcher: number | undefined) => boolean;
3329
+ //#endregion
3330
+ //#region src/rules/currencyMatcher.d.ts
3331
+ declare const matchCurrencyOperator: (condition: Condition, matcher: number | undefined) => boolean;
3332
+ //#endregion
3333
+ //#region src/rules/booleanMatcher.d.ts
3334
+ declare const matchBooleanOperator: (condition: Condition, matcher: boolean | undefined) => boolean;
3335
+ //#endregion
3336
+ //#region src/rules/enumMatcher.d.ts
3337
+ declare const matchEnumOperator: (condition: Condition, matcher: string | undefined) => boolean;
3338
+ //#endregion
3339
+ //#region src/rules/recurringDateCron.d.ts
3340
+ declare class RecurringDateCron {
3341
+ private startDate;
3342
+ private endDate;
3343
+ private repeat;
3344
+ private timezone;
3345
+ constructor(values: RecurringDateCronValues, timezone?: string);
3346
+ private day;
3347
+ private getExpression;
3348
+ private getDescription;
3349
+ get result(): RecurringDateCronResult;
3350
+ match: (date: string) => boolean;
3351
+ }
3352
+ //#endregion
3353
+ //#region src/rules/checkout.d.ts
3354
+ interface CheckoutRule extends MatchableRule {
3355
+ fallback?: boolean;
3356
+ effect: {
3357
+ mode: CheckoutMode;
3358
+ };
3359
+ conditions?: OrConditions | null;
3360
+ }
3361
+ interface CheckoutSection {
3362
+ fields: Record<string, CheckoutMode>;
3363
+ rules: CheckoutRule[];
3364
+ }
3365
+ interface CheckoutPreferences {
3366
+ shipping: CheckoutSection;
3367
+ billing: CheckoutSection;
3368
+ }
3369
+ declare const isCheckoutFieldFilled: (info: Record<string, unknown> | null | undefined, key: string) => boolean;
3370
+ interface CheckoutOrderInput {
3371
+ fulfillment_id?: string;
3372
+ brand_id?: string | null;
3373
+ store_id?: string;
3374
+ channel_id?: string;
3375
+ is_anonymous?: boolean;
3376
+ totals?: {
3377
+ total?: number;
3378
+ };
3379
+ lines?: Order$1["lines"];
3380
+ metadata?: Order$1["metadata"];
3381
+ }
3382
+ declare const resolveCheckout: (order: CheckoutOrderInput, options?: {
3383
+ runtime?: RulesEngineRuntime;
3384
+ now?: string;
3385
+ checkout?: CheckoutPreferences;
3386
+ /** When known, non-delivery fulfillments never ask for shipping. */
3387
+ fulfillmentType?: string | null;
3388
+ }) => CheckoutResolved;
3389
+ //#endregion
3390
+ //#region src/rules/payments.d.ts
3391
+ /**
3392
+ * Client pre-filter for a payment's conditions against a local order.
3393
+ * Server-only conditions count as met; place order checks them all.
3394
+ */
3395
+ declare const paymentMatchesClientConditions: (conditions: OrConditions | null | undefined, order: CheckoutOrderInput, options?: {
3396
+ now?: string;
3397
+ }) => boolean;
3398
+ //#endregion
3399
+ export { type AuthConfigureOptions, type CreateOrderOptions, type CreateSessionOptions, type CustomizationPath, type CustomizationSession, DEFAULT_RECOMMENDATION_TYPES, type ExchangeOptions, type FlatMenuCategory, type GroupDisplayType, type ListMenusStreamOptions, type Menu, type MenuCategoryNode, type MenuLookup, type MilestoneSteps, type MilestoneTrackItem, type ModifierControlType, type ModifierCtx, type ModifierGroupCtx, type NestedMenuCategory, Order, type OrderCustomerSource, type OrderDraft, type OrderIssue, type OrderIssueCode, type OrderLineDiff, type OrderLineIssue, type OrderLineIssueCode, type OrderScope, OrderSyncPendingError, OrderValidationError, type OrderValidationResult, type PricingModifier, type Product, type ProductCtx, type QuantitiesByPath, type RecommendationType, RecurringDateCron, type ReorderOrderOptions, type ResetOptions, RulesEngine, type ScheduleWindow, type SelectionStatus, type ServiceHttpOptions, type Snapshot, type StorefrontAccessToken, StorefrontHttpError, type TrackWorkflow, type ValidateOptions, type ValidateOrderAgainstMenuInput, type VisitedState, addLines, auth, buildCustomerSnapshot, collectOrderLineDiffs, countCartProducts, createSession, currentNodes, defaultConditionError, flattenMenuCategories, fromOrderLines, getScheduleWindow, indexMenu, isCheckoutFieldFilled, isDeviceNotLinked, isKioskUnauthorized, isMilestoneStepDone, isOnSchedule, isOrderValidationError, isStorefrontNotFound, listMenusStream, matchAbsoluteDateOperator, matchBooleanOperator, matchCurrencyOperator, matchEnumOperator, matchNumberOperator, matchRecurringDateOperator, matchRelativeDateOperator, matchStringOperator, milestoneSteps, milestoneTrack, nestMenuCategories, paymentMatchesClientConditions, recomputeTotals, resolveCheckout, services, storefrontJson, toOrderLines, validateOrderAgainstMenu, visitedStates };