@fire-spark/core 0.0.3 → 0.1.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 +318 -3088
  2. package/dist/index.js +1733 -14
  3. package/package.json +4 -2
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
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, OrderRedeem, OrderRedemptionStep, OrderReorderInput, OrderTotals, OrderUpdateInput, OrderValidateInput, OrderValidateOutput, PaymentIntentInput, PaymentMethod, PaymentProvider, PricingModifier, Product, Product as Product$1, Recommendation, RecurringDateCronResult, RecurringDateCronValues, RulesEngineOrderLine, RulesEngineParams, RulesEngineRuntime, Schedule, StoreGetInput, StoreListInput, StoreNearbyInput, StorefrontAvailability, StorefrontMenuScope, StorefrontMenuStreamOptions, StorefrontPaymentsListInput, Variant, VariantGroup } from "@fire-spark/types";
1
+ import { PaymentAdapter, PaymentCollectAt, PaymentContext, PaymentResult, PaymentStorage, PaymentUI } from "@fire-spark/payments";
2
+ import { AndConditions, CheckoutMode, CheckoutResolved, CmsBlock, Condition, Customer, CustomerIdentifyInput, CustomerRegisterInput, CustomerUpdateInput, Fulfillment, FulfillmentListInput, GroupDisplayType, KioskDeviceConfig, KioskDeviceOverrides, KioskHealthBatchInput, KioskHealthBatchResult, KioskHeartbeatInput, KioskHeartbeatResult, KioskRealtimeToken, MatchResult, MatchableRule, Menu, Menu as Menu$1, MenuLookup, MenuLookup as MenuLookup$1, MerchantPayment, ModifierControlType, ModifierGroup, OrConditions, Order as Order$1, Order as Order$2, OrderFulfillment, OrderInsertInput, OrderLine, OrderListInput, OrderRecordPaymentInput, OrderRedeem, OrderRedemptionStep, OrderReorderInput, OrderTotals, OrderUpdateInput, OrderValidateInput, OrderValidateOutput, PaymentIntentInput, PaymentMethod, PaymentProvider, PlaceOrderResult, PosCatalog, PosHealthBatchInput, PosHealthBatchResult, PosHeartbeatInput, PosHeartbeatResult, PosKioskOrder, PosKioskSettleInput, PosKioskSettleResult, PosOrderInput, PosOrderResult, PricingModifier, Product, Product as Product$1, Recommendation, RecurringDateCronResult, RecurringDateCronValues, RulesEngineOrderLine, RulesEngineParams, RulesEngineRuntime, Schedule, SdkLogContext, SdkLogErrorInfo, SdkLogLevel, SdkLogOptions, Store, StoreGetInput, StoreListInput, StoreNearbyInput, StorefrontAvailability, StorefrontMenu, StorefrontMenuScope, StorefrontMenuStreamOptions, StorefrontPaymentsListInput, StorefrontPreferences, Variant, VariantGroup } from "@fire-spark/types";
2
3
  import { Big } from "big.js";
3
4
  //#region src/productCustomization/types.d.ts
4
5
  type SelectionStatus = "IDLE" | "INCOMPLETE" | "VALID" | "INVALID";
@@ -222,1650 +223,78 @@ declare const isStorefrontNotFound: (error: unknown) => boolean;
222
223
  declare const storefrontJson: <T>(path: string, init?: RequestInit, options?: ServiceHttpOptions) => Promise<T>;
223
224
  //#endregion
224
225
  //#region src/services/orders.d.ts
225
- declare const listOrders: (input?: OrderListInput, options?: ServiceHttpOptions) => Promise<{
226
- uid: string;
227
- id: string;
228
- brand_id?: string | null | undefined;
229
- store_id: string;
230
- channel_id: string;
231
- customer_id: string;
232
- fulfillment_id: string;
233
- is_anonymous: boolean;
234
- lines: {
235
- type: "FEE" | "PRODUCT";
236
- uid: string;
237
- id: string;
238
- parent_uid: string | null;
239
- parent_id: string | null;
240
- name: string;
241
- image_url?: string | undefined;
242
- menu_id?: string | undefined;
243
- internal_attribution_source?: string | undefined;
244
- internal_attribution_id?: string | undefined;
245
- metadata: Record<string, unknown>;
246
- bundled_items: {
247
- id: string;
248
- refund_price: number;
249
- included_quantity: number;
250
- }[];
251
- redeem: {
252
- reward_id: string;
253
- quantity: number;
254
- discount_rate?: number | undefined;
255
- discount_amount?: number | undefined;
256
- expires_at?: string | undefined;
257
- }[];
258
- quantity: number;
259
- tax_rate: number | null;
260
- discount_rate: number;
261
- unit_subtotal: number;
262
- unit_discount: number;
263
- unit_tax_total: number;
264
- unit_total: number;
265
- subtotal: number;
266
- discount_total: number;
267
- tax_total: number;
268
- total: number;
269
- unit_group_subtotal: number;
270
- unit_group_discount: number;
271
- unit_group_tax_total: number;
272
- unit_group_total: number;
273
- group_subtotal: number;
274
- group_discount: number;
275
- group_tax_total: number;
276
- group_total: number;
277
- }[];
278
- redeem: {
279
- reward_id: string;
280
- quantity: number;
281
- discount_rate?: number | undefined;
282
- discount_amount?: number | undefined;
283
- expires_at?: string | undefined;
284
- }[];
285
- redemption_steps: {
286
- reward_id: string;
287
- reward_quantity: number;
288
- target: "LINE" | "ORDER";
289
- target_id?: string | undefined;
290
- action: "CREATE" | "DELETE" | "READ" | "UPDATE";
291
- discount_amount: number;
292
- before: {
293
- value: number;
294
- quantity: number;
295
- discount_amount: number;
296
- discount_rate: number;
297
- };
298
- after: {
299
- value: number;
300
- quantity: number;
301
- discount_amount: number;
302
- discount_rate: number;
303
- };
304
- target_before?: {
305
- value: number;
306
- quantity: number;
307
- discount_amount: number;
308
- discount_rate: number;
309
- } | undefined;
310
- target_after?: {
311
- value: number;
312
- quantity: number;
313
- discount_amount: number;
314
- discount_rate: number;
315
- } | undefined;
316
- error?: string | undefined;
317
- }[];
318
- customer: {
319
- customer_info: {
320
- display_name: string;
321
- first_name: string;
322
- middle_name?: string | undefined;
323
- last_name: string;
324
- second_last_name?: string | undefined;
325
- email: string;
326
- phone: string;
327
- gender?: "FEMALE" | "MALE" | undefined;
328
- dob?: string | undefined;
329
- document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
330
- document_number?: string | undefined;
331
- city?: string | undefined;
332
- country?: string | undefined;
333
- };
334
- address_info?: {
335
- address_line1: string;
336
- address_line2?: string | undefined;
337
- city?: string | undefined;
338
- state?: string | undefined;
339
- zip?: string | undefined;
340
- country?: string | undefined;
341
- reference?: string | undefined;
342
- latitude?: number | undefined;
343
- longitude?: number | undefined;
344
- instructions?: string | undefined;
345
- metadata: Record<string, unknown> | null;
346
- } | null | undefined;
347
- billing_info?: {
348
- type: "BUSINESS" | "INDIVIDUAL";
349
- legal_name: string;
350
- address_line1: string;
351
- address_line2?: string | undefined;
352
- city?: string | undefined;
353
- state?: string | undefined;
354
- zip?: string | undefined;
355
- country?: string | undefined;
356
- tax_id: string;
357
- tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
358
- metadata: Record<string, unknown> | null;
359
- } | null | undefined;
360
- };
361
- payment_intents: {
362
- id?: string | undefined;
363
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
364
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
365
- collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
366
- status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
367
- totals: {
368
- currency: string;
369
- subtotal: number;
370
- discount_rate: number;
371
- discount_total: number;
372
- tax_rate: number;
373
- tax_total: number;
374
- total: number;
375
- };
376
- error_message?: string | undefined;
377
- placed_at: string;
378
- resolved_at?: string | undefined;
379
- metadata: Record<string, unknown>;
380
- }[];
381
- totals: {
382
- currency: string;
383
- subtotal: number;
384
- discount_rate: number;
385
- discount_total: number;
386
- tax_rate: number;
387
- tax_total: number;
388
- total: number;
389
- };
390
- metadata: Record<string, unknown>;
391
- payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
392
- fulfillment_status: string;
393
- status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
394
- issued_at?: string | null | undefined;
395
- resolved_at?: string | null | undefined;
396
- }[]>;
397
- declare const createOrder: (body: OrderInsertInput, options?: ServiceHttpOptions) => Promise<{
398
- uid: string;
399
- id: string;
400
- brand_id?: string | null | undefined;
401
- store_id: string;
402
- channel_id: string;
403
- customer_id: string;
404
- fulfillment_id: string;
405
- is_anonymous: boolean;
406
- lines: {
407
- type: "FEE" | "PRODUCT";
408
- uid: string;
409
- id: string;
410
- parent_uid: string | null;
411
- parent_id: string | null;
412
- name: string;
413
- image_url?: string | undefined;
414
- menu_id?: string | undefined;
415
- internal_attribution_source?: string | undefined;
416
- internal_attribution_id?: string | undefined;
417
- metadata: Record<string, unknown>;
418
- bundled_items: {
419
- id: string;
420
- refund_price: number;
421
- included_quantity: number;
422
- }[];
423
- redeem: {
424
- reward_id: string;
425
- quantity: number;
426
- discount_rate?: number | undefined;
427
- discount_amount?: number | undefined;
428
- expires_at?: string | undefined;
429
- }[];
430
- quantity: number;
431
- tax_rate: number | null;
432
- discount_rate: number;
433
- unit_subtotal: number;
434
- unit_discount: number;
435
- unit_tax_total: number;
436
- unit_total: number;
437
- subtotal: number;
438
- discount_total: number;
439
- tax_total: number;
440
- total: number;
441
- unit_group_subtotal: number;
442
- unit_group_discount: number;
443
- unit_group_tax_total: number;
444
- unit_group_total: number;
445
- group_subtotal: number;
446
- group_discount: number;
447
- group_tax_total: number;
448
- group_total: number;
449
- }[];
450
- redeem: {
451
- reward_id: string;
452
- quantity: number;
453
- discount_rate?: number | undefined;
454
- discount_amount?: number | undefined;
455
- expires_at?: string | undefined;
456
- }[];
457
- redemption_steps: {
458
- reward_id: string;
459
- reward_quantity: number;
460
- target: "LINE" | "ORDER";
461
- target_id?: string | undefined;
462
- action: "CREATE" | "DELETE" | "READ" | "UPDATE";
463
- discount_amount: number;
464
- before: {
465
- value: number;
466
- quantity: number;
467
- discount_amount: number;
468
- discount_rate: number;
469
- };
470
- after: {
471
- value: number;
472
- quantity: number;
473
- discount_amount: number;
474
- discount_rate: number;
475
- };
476
- target_before?: {
477
- value: number;
478
- quantity: number;
479
- discount_amount: number;
480
- discount_rate: number;
481
- } | undefined;
482
- target_after?: {
483
- value: number;
484
- quantity: number;
485
- discount_amount: number;
486
- discount_rate: number;
487
- } | undefined;
488
- error?: string | undefined;
489
- }[];
490
- customer: {
491
- customer_info: {
492
- display_name: string;
493
- first_name: string;
494
- middle_name?: string | undefined;
495
- last_name: string;
496
- second_last_name?: string | undefined;
497
- email: string;
498
- phone: string;
499
- gender?: "FEMALE" | "MALE" | undefined;
500
- dob?: string | undefined;
501
- document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
502
- document_number?: string | undefined;
503
- city?: string | undefined;
504
- country?: string | undefined;
505
- };
506
- address_info?: {
507
- address_line1: string;
508
- address_line2?: string | undefined;
509
- city?: string | undefined;
510
- state?: string | undefined;
511
- zip?: string | undefined;
512
- country?: string | undefined;
513
- reference?: string | undefined;
514
- latitude?: number | undefined;
515
- longitude?: number | undefined;
516
- instructions?: string | undefined;
517
- metadata: Record<string, unknown> | null;
518
- } | null | undefined;
519
- billing_info?: {
520
- type: "BUSINESS" | "INDIVIDUAL";
521
- legal_name: string;
522
- address_line1: string;
523
- address_line2?: string | undefined;
524
- city?: string | undefined;
525
- state?: string | undefined;
526
- zip?: string | undefined;
527
- country?: string | undefined;
528
- tax_id: string;
529
- tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
530
- metadata: Record<string, unknown> | null;
531
- } | null | undefined;
532
- };
533
- payment_intents: {
534
- id?: string | undefined;
535
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
536
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
537
- collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
538
- status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
539
- totals: {
540
- currency: string;
541
- subtotal: number;
542
- discount_rate: number;
543
- discount_total: number;
544
- tax_rate: number;
545
- tax_total: number;
546
- total: number;
547
- };
548
- error_message?: string | undefined;
549
- placed_at: string;
550
- resolved_at?: string | undefined;
551
- metadata: Record<string, unknown>;
552
- }[];
553
- totals: {
554
- currency: string;
555
- subtotal: number;
556
- discount_rate: number;
557
- discount_total: number;
558
- tax_rate: number;
559
- tax_total: number;
560
- total: number;
561
- };
562
- metadata: Record<string, unknown>;
563
- payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
564
- fulfillment_status: string;
565
- status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
566
- issued_at?: string | null | undefined;
567
- resolved_at?: string | null | undefined;
568
- }>;
569
- declare const getOrder: (id: string, options?: ServiceHttpOptions) => Promise<{
570
- uid: string;
571
- id: string;
572
- brand_id?: string | null | undefined;
573
- store_id: string;
574
- channel_id: string;
575
- customer_id: string;
576
- fulfillment_id: string;
577
- is_anonymous: boolean;
578
- lines: {
579
- type: "FEE" | "PRODUCT";
580
- uid: string;
581
- id: string;
582
- parent_uid: string | null;
583
- parent_id: string | null;
584
- name: string;
585
- image_url?: string | undefined;
586
- menu_id?: string | undefined;
587
- internal_attribution_source?: string | undefined;
588
- internal_attribution_id?: string | undefined;
589
- metadata: Record<string, unknown>;
590
- bundled_items: {
591
- id: string;
592
- refund_price: number;
593
- included_quantity: number;
594
- }[];
595
- redeem: {
596
- reward_id: string;
597
- quantity: number;
598
- discount_rate?: number | undefined;
599
- discount_amount?: number | undefined;
600
- expires_at?: string | undefined;
601
- }[];
602
- quantity: number;
603
- tax_rate: number | null;
604
- discount_rate: number;
605
- unit_subtotal: number;
606
- unit_discount: number;
607
- unit_tax_total: number;
608
- unit_total: number;
609
- subtotal: number;
610
- discount_total: number;
611
- tax_total: number;
612
- total: number;
613
- unit_group_subtotal: number;
614
- unit_group_discount: number;
615
- unit_group_tax_total: number;
616
- unit_group_total: number;
617
- group_subtotal: number;
618
- group_discount: number;
619
- group_tax_total: number;
620
- group_total: number;
621
- }[];
622
- redeem: {
623
- reward_id: string;
624
- quantity: number;
625
- discount_rate?: number | undefined;
626
- discount_amount?: number | undefined;
627
- expires_at?: string | undefined;
628
- }[];
629
- redemption_steps: {
630
- reward_id: string;
631
- reward_quantity: number;
632
- target: "LINE" | "ORDER";
633
- target_id?: string | undefined;
634
- action: "CREATE" | "DELETE" | "READ" | "UPDATE";
635
- discount_amount: number;
636
- before: {
637
- value: number;
638
- quantity: number;
639
- discount_amount: number;
640
- discount_rate: number;
641
- };
642
- after: {
643
- value: number;
644
- quantity: number;
645
- discount_amount: number;
646
- discount_rate: number;
647
- };
648
- target_before?: {
649
- value: number;
650
- quantity: number;
651
- discount_amount: number;
652
- discount_rate: number;
653
- } | undefined;
654
- target_after?: {
655
- value: number;
656
- quantity: number;
657
- discount_amount: number;
658
- discount_rate: number;
659
- } | undefined;
660
- error?: string | undefined;
661
- }[];
662
- customer: {
663
- customer_info: {
664
- display_name: string;
665
- first_name: string;
666
- middle_name?: string | undefined;
667
- last_name: string;
668
- second_last_name?: string | undefined;
669
- email: string;
670
- phone: string;
671
- gender?: "FEMALE" | "MALE" | undefined;
672
- dob?: string | undefined;
673
- document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
674
- document_number?: string | undefined;
675
- city?: string | undefined;
676
- country?: string | undefined;
677
- };
678
- address_info?: {
679
- address_line1: string;
680
- address_line2?: string | undefined;
681
- city?: string | undefined;
682
- state?: string | undefined;
683
- zip?: string | undefined;
684
- country?: string | undefined;
685
- reference?: string | undefined;
686
- latitude?: number | undefined;
687
- longitude?: number | undefined;
688
- instructions?: string | undefined;
689
- metadata: Record<string, unknown> | null;
690
- } | null | undefined;
691
- billing_info?: {
692
- type: "BUSINESS" | "INDIVIDUAL";
693
- legal_name: string;
694
- address_line1: string;
695
- address_line2?: string | undefined;
696
- city?: string | undefined;
697
- state?: string | undefined;
698
- zip?: string | undefined;
699
- country?: string | undefined;
700
- tax_id: string;
701
- tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
702
- metadata: Record<string, unknown> | null;
703
- } | null | undefined;
704
- };
705
- payment_intents: {
706
- id?: string | undefined;
707
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
708
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
709
- collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
710
- status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
711
- totals: {
712
- currency: string;
713
- subtotal: number;
714
- discount_rate: number;
715
- discount_total: number;
716
- tax_rate: number;
717
- tax_total: number;
718
- total: number;
719
- };
720
- error_message?: string | undefined;
721
- placed_at: string;
722
- resolved_at?: string | undefined;
723
- metadata: Record<string, unknown>;
724
- }[];
725
- totals: {
726
- currency: string;
727
- subtotal: number;
728
- discount_rate: number;
729
- discount_total: number;
730
- tax_rate: number;
731
- tax_total: number;
732
- total: number;
733
- };
734
- metadata: Record<string, unknown>;
735
- payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
736
- fulfillment_status: string;
737
- status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
738
- issued_at?: string | null | undefined;
739
- resolved_at?: string | null | undefined;
740
- }>;
226
+ declare const listOrders: (input?: OrderListInput, options?: ServiceHttpOptions) => Promise<Order$1[]>;
227
+ declare const createOrder: (body: OrderInsertInput, options?: ServiceHttpOptions) => Promise<Order$1>;
228
+ declare const getOrder: (id: string, options?: ServiceHttpOptions) => Promise<Order$1>;
741
229
  type PlaceOrderInput = {
742
230
  payment?: {
231
+ id?: string;
743
232
  type?: PaymentMethod;
744
233
  provider?: PaymentProvider;
745
234
  intents?: PaymentIntentInput[];
746
235
  };
747
236
  };
748
- declare const placeOrder: (id: string, body?: PlaceOrderInput, options?: ServiceHttpOptions) => Promise<{
749
- order_id: string;
750
- order_fulfillment_id: string;
751
- status: "ACCEPTED" | "EXISTS" | "IN_PROGRESS";
752
- }>;
753
- declare const getOrderFulfillment: (id: string, options?: ServiceHttpOptions) => Promise<{
754
- uid: string;
755
- id: string;
756
- order_id: string;
757
- fulfillment_id: string;
758
- workflow: {
759
- nodes: {
760
- id: string;
761
- type: "fulfillmentStep";
762
- position: {
763
- x: number;
764
- y: number;
765
- };
766
- data: {
767
- kind: "join" | "start" | "state" | "terminal";
768
- label: Record<string, string>;
769
- description?: Record<string, string> | undefined;
770
- mappedStatus: string;
771
- milestone?: string | undefined;
772
- checkout_release?: boolean | undefined;
773
- joinPolicy?: "all" | "any" | undefined;
774
- actions?: {
775
- id: string;
776
- type: "invoke_callback" | "notify_webhook";
777
- webhook_ids?: string[] | undefined;
778
- callback_ids?: string[] | undefined;
779
- }[] | undefined;
780
- entered_at?: string | undefined;
781
- exited_at?: string | undefined;
782
- logs?: {
783
- type: "error" | "info" | "success" | "warning";
784
- message: string;
785
- at: string;
786
- actor_name?: string | undefined;
787
- actor_avatar_url?: string | undefined;
788
- }[] | undefined;
789
- callback_run?: {
790
- attempt: number;
791
- errors: {
792
- attempt: number;
793
- at: string;
794
- message: string;
795
- status?: number | undefined;
796
- body?: unknown;
797
- started_at?: string | undefined;
798
- duration_ms?: number | undefined;
799
- }[];
800
- response?: unknown;
801
- started_at?: string | undefined;
802
- finished_at?: string | undefined;
803
- duration_ms?: number | undefined;
804
- } | undefined;
805
- webhook_runs?: {
806
- id: string;
807
- webhook_id: string;
808
- alias?: string | null | undefined;
809
- url: string;
810
- type: string;
811
- status: string;
812
- started_at: string;
813
- finished_at: string;
814
- duration_ms: number;
815
- ok: boolean;
816
- http_status?: number | undefined;
817
- error?: string | undefined;
818
- }[] | undefined;
819
- manual_advance?: {
820
- reason: string;
821
- to_status: string;
822
- at: string;
823
- actor_name?: string | undefined;
824
- actor_avatar_url?: string | undefined;
825
- } | undefined;
826
- };
827
- }[];
828
- edges: {
829
- id: string;
830
- source: string;
831
- target: string;
832
- type?: "fulfillmentEdge" | undefined;
833
- sourceHandle?: string | null | undefined;
834
- targetHandle?: string | null | undefined;
835
- data?: {
836
- label?: string | undefined;
837
- pathKind?: "cancel" | "default" | "refund" | "success" | undefined;
838
- conditions?: ({
839
- interpretation?: "both" | "client" | "server" | undefined;
840
- product_id?: string | undefined;
841
- tag?: string | undefined;
842
- fulfillment_id: string;
843
- store_id: string;
844
- channel_id: string;
845
- brand_id: string;
846
- primitive: "string";
847
- type: "Failure message" | "Order includes product with tag" | "Request path";
848
- operator: "contains" | "ends with" | "equal to" | "not equal to" | "starts with";
849
- caseInsensitive?: boolean | undefined;
850
- value: string;
851
- invalidMessage?: string | undefined;
852
- } | {
853
- interpretation?: "both" | "client" | "server" | undefined;
854
- product_id?: string | undefined;
855
- tag?: string | undefined;
856
- fulfillment_id: string;
857
- store_id: string;
858
- channel_id: string;
859
- brand_id: string;
860
- primitive: "number";
861
- type: "API error rate" | "Accumulated events" | "Cart product count" | "Customer age" | "HTTP status" | "Order includes product" | "Order includes product with tag";
862
- operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
863
- value: number;
864
- include_modifiers?: boolean | undefined;
865
- window_minutes?: number | undefined;
866
- invalidMessage?: string | undefined;
867
- } | {
868
- interpretation?: "both" | "client" | "server" | undefined;
869
- product_id?: string | undefined;
870
- tag?: string | undefined;
871
- fulfillment_id: string;
872
- store_id: string;
873
- channel_id: string;
874
- brand_id: string;
875
- primitive: "currency";
876
- type: "Order includes product with tag" | "Order total";
877
- operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
878
- value: number;
879
- invalidMessage?: string | undefined;
880
- } | {
881
- interpretation?: "both" | "client" | "server" | undefined;
882
- product_id?: string | undefined;
883
- tag?: string | undefined;
884
- fulfillment_id: string;
885
- store_id: string;
886
- channel_id: string;
887
- brand_id: string;
888
- primitive: "boolean";
889
- type: "Customer is anonymous" | "Is anonymous order" | "Order includes product with tag";
890
- operator: "is" | "is not";
891
- value: boolean;
892
- invalidMessage?: string | undefined;
893
- } | {
894
- interpretation?: "both" | "client" | "server" | undefined;
895
- primitive: "enum";
896
- type: "Payment collect at" | "Payment method" | "Payment status";
897
- operator: "is" | "is any of" | "is none of" | "is not";
898
- value: string | string[];
899
- invalidMessage?: string | undefined;
900
- } | {
901
- interpretation?: "both" | "client" | "server" | undefined;
902
- primitive: "absolute date";
903
- type: "Today";
904
- operator: "is" | "is after" | "is before" | "is not";
905
- value: Date;
906
- invalidMessage?: string | undefined;
907
- } | {
908
- interpretation?: "both" | "client" | "server" | undefined;
909
- primitive: "relative date";
910
- type: "Birthday" | "Customer last session" | "Customer last visit" | "Registration";
911
- operator: "occurred" | "occurred in the last" | "occurred more than";
912
- value: string;
913
- invalidMessage?: string | undefined;
914
- } | {
915
- interpretation?: "both" | "client" | "server" | undefined;
916
- primitive: "recurring date";
917
- type: "Current date";
918
- operator: "falls within period";
919
- startDate: Date;
920
- endDate: Date;
921
- allDay: boolean;
922
- repeat: "CUSTOM" | "DAILY" | "FORTNIGHTLY" | "LAST_DAY_OF_MONTH" | "MONTHLY" | "NONE" | "WEEKDAYS" | "WEEKENDS" | "WEEKLY" | "WEEK_OF_MONTH";
923
- value: string;
924
- invalidMessage?: string | undefined;
925
- } | {
926
- interpretation?: "both" | "client" | "server" | undefined;
927
- primitive: "custom";
928
- type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
929
- operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
930
- value: string;
931
- label_ids?: string[] | undefined;
932
- invalidMessage?: string | undefined;
933
- })[][] | undefined;
934
- taken_at?: string | undefined;
935
- } | undefined;
936
- }[];
937
- viewport?: {
938
- x: number;
939
- y: number;
940
- zoom: number;
941
- } | undefined;
942
- };
943
- current_node_ids: string[];
944
- step: "ACCEPTING" | "FINALIZE" | "PAUSE_FOR_ADVANCE" | "PROCESS_STATE_NODE" | "ROLLBACK_ACCEPT" | "ROLLBACK_PROCESS_STATE_NODE" | "WARN_NO_EDGE";
945
- status: "FAILED" | "PROCESSING" | "SUCCESS" | "WAITING";
946
- steps_logs: {
947
- started_at: string;
948
- ended_at: string | null;
949
- step: "ACCEPTING" | "FINALIZE" | "PAUSE_FOR_ADVANCE" | "PROCESS_STATE_NODE" | "ROLLBACK_ACCEPT" | "ROLLBACK_PROCESS_STATE_NODE" | "WARN_NO_EDGE";
950
- logs: {
951
- type: "error" | "info" | "success" | "warning";
952
- message: string;
953
- }[];
954
- }[];
955
- warning_count: number;
956
- checkout_state: "failed" | "pending" | "released";
957
- error: {
958
- node_id?: string | undefined;
959
- status?: string | undefined;
960
- message: string;
961
- } | null;
962
- customer_id: string;
963
- payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
964
- fulfillment_status: string;
965
- }>;
966
- declare const listOrderFulfillments: (ids: string[], options?: ServiceHttpOptions) => Promise<{
967
- uid: string;
968
- id: string;
969
- order_id: string;
970
- fulfillment_id: string;
971
- workflow: {
972
- nodes: {
973
- id: string;
974
- type: "fulfillmentStep";
975
- position: {
976
- x: number;
977
- y: number;
978
- };
979
- data: {
980
- kind: "join" | "start" | "state" | "terminal";
981
- label: Record<string, string>;
982
- description?: Record<string, string> | undefined;
983
- mappedStatus: string;
984
- milestone?: string | undefined;
985
- checkout_release?: boolean | undefined;
986
- joinPolicy?: "all" | "any" | undefined;
987
- actions?: {
988
- id: string;
989
- type: "invoke_callback" | "notify_webhook";
990
- webhook_ids?: string[] | undefined;
991
- callback_ids?: string[] | undefined;
992
- }[] | undefined;
993
- entered_at?: string | undefined;
994
- exited_at?: string | undefined;
995
- logs?: {
996
- type: "error" | "info" | "success" | "warning";
997
- message: string;
998
- at: string;
999
- actor_name?: string | undefined;
1000
- actor_avatar_url?: string | undefined;
1001
- }[] | undefined;
1002
- callback_run?: {
1003
- attempt: number;
1004
- errors: {
1005
- attempt: number;
1006
- at: string;
1007
- message: string;
1008
- status?: number | undefined;
1009
- body?: unknown;
1010
- started_at?: string | undefined;
1011
- duration_ms?: number | undefined;
1012
- }[];
1013
- response?: unknown;
1014
- started_at?: string | undefined;
1015
- finished_at?: string | undefined;
1016
- duration_ms?: number | undefined;
1017
- } | undefined;
1018
- webhook_runs?: {
1019
- id: string;
1020
- webhook_id: string;
1021
- alias?: string | null | undefined;
1022
- url: string;
1023
- type: string;
1024
- status: string;
1025
- started_at: string;
1026
- finished_at: string;
1027
- duration_ms: number;
1028
- ok: boolean;
1029
- http_status?: number | undefined;
1030
- error?: string | undefined;
1031
- }[] | undefined;
1032
- manual_advance?: {
1033
- reason: string;
1034
- to_status: string;
1035
- at: string;
1036
- actor_name?: string | undefined;
1037
- actor_avatar_url?: string | undefined;
1038
- } | undefined;
1039
- };
1040
- }[];
1041
- edges: {
1042
- id: string;
1043
- source: string;
1044
- target: string;
1045
- type?: "fulfillmentEdge" | undefined;
1046
- sourceHandle?: string | null | undefined;
1047
- targetHandle?: string | null | undefined;
1048
- data?: {
1049
- label?: string | undefined;
1050
- pathKind?: "cancel" | "default" | "refund" | "success" | undefined;
1051
- conditions?: ({
1052
- interpretation?: "both" | "client" | "server" | undefined;
1053
- product_id?: string | undefined;
1054
- tag?: string | undefined;
1055
- fulfillment_id: string;
1056
- store_id: string;
1057
- channel_id: string;
1058
- brand_id: string;
1059
- primitive: "string";
1060
- type: "Failure message" | "Order includes product with tag" | "Request path";
1061
- operator: "contains" | "ends with" | "equal to" | "not equal to" | "starts with";
1062
- caseInsensitive?: boolean | undefined;
1063
- value: string;
1064
- invalidMessage?: string | undefined;
1065
- } | {
1066
- interpretation?: "both" | "client" | "server" | undefined;
1067
- product_id?: string | undefined;
1068
- tag?: string | undefined;
1069
- fulfillment_id: string;
1070
- store_id: string;
1071
- channel_id: string;
1072
- brand_id: string;
1073
- primitive: "number";
1074
- type: "API error rate" | "Accumulated events" | "Cart product count" | "Customer age" | "HTTP status" | "Order includes product" | "Order includes product with tag";
1075
- operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
1076
- value: number;
1077
- include_modifiers?: boolean | undefined;
1078
- window_minutes?: number | undefined;
1079
- invalidMessage?: string | undefined;
1080
- } | {
1081
- interpretation?: "both" | "client" | "server" | undefined;
1082
- product_id?: string | undefined;
1083
- tag?: string | undefined;
1084
- fulfillment_id: string;
1085
- store_id: string;
1086
- channel_id: string;
1087
- brand_id: string;
1088
- primitive: "currency";
1089
- type: "Order includes product with tag" | "Order total";
1090
- operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
1091
- value: number;
1092
- invalidMessage?: string | undefined;
1093
- } | {
1094
- interpretation?: "both" | "client" | "server" | undefined;
1095
- product_id?: string | undefined;
1096
- tag?: string | undefined;
1097
- fulfillment_id: string;
1098
- store_id: string;
1099
- channel_id: string;
1100
- brand_id: string;
1101
- primitive: "boolean";
1102
- type: "Customer is anonymous" | "Is anonymous order" | "Order includes product with tag";
1103
- operator: "is" | "is not";
1104
- value: boolean;
1105
- invalidMessage?: string | undefined;
1106
- } | {
1107
- interpretation?: "both" | "client" | "server" | undefined;
1108
- primitive: "enum";
1109
- type: "Payment collect at" | "Payment method" | "Payment status";
1110
- operator: "is" | "is any of" | "is none of" | "is not";
1111
- value: string | string[];
1112
- invalidMessage?: string | undefined;
1113
- } | {
1114
- interpretation?: "both" | "client" | "server" | undefined;
1115
- primitive: "absolute date";
1116
- type: "Today";
1117
- operator: "is" | "is after" | "is before" | "is not";
1118
- value: Date;
1119
- invalidMessage?: string | undefined;
1120
- } | {
1121
- interpretation?: "both" | "client" | "server" | undefined;
1122
- primitive: "relative date";
1123
- type: "Birthday" | "Customer last session" | "Customer last visit" | "Registration";
1124
- operator: "occurred" | "occurred in the last" | "occurred more than";
1125
- value: string;
1126
- invalidMessage?: string | undefined;
1127
- } | {
1128
- interpretation?: "both" | "client" | "server" | undefined;
1129
- primitive: "recurring date";
1130
- type: "Current date";
1131
- operator: "falls within period";
1132
- startDate: Date;
1133
- endDate: Date;
1134
- allDay: boolean;
1135
- repeat: "CUSTOM" | "DAILY" | "FORTNIGHTLY" | "LAST_DAY_OF_MONTH" | "MONTHLY" | "NONE" | "WEEKDAYS" | "WEEKENDS" | "WEEKLY" | "WEEK_OF_MONTH";
1136
- value: string;
1137
- invalidMessage?: string | undefined;
1138
- } | {
1139
- interpretation?: "both" | "client" | "server" | undefined;
1140
- primitive: "custom";
1141
- type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
1142
- operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
1143
- value: string;
1144
- label_ids?: string[] | undefined;
1145
- invalidMessage?: string | undefined;
1146
- })[][] | undefined;
1147
- taken_at?: string | undefined;
1148
- } | undefined;
1149
- }[];
1150
- viewport?: {
1151
- x: number;
1152
- y: number;
1153
- zoom: number;
1154
- } | undefined;
1155
- };
1156
- current_node_ids: string[];
1157
- step: "ACCEPTING" | "FINALIZE" | "PAUSE_FOR_ADVANCE" | "PROCESS_STATE_NODE" | "ROLLBACK_ACCEPT" | "ROLLBACK_PROCESS_STATE_NODE" | "WARN_NO_EDGE";
1158
- status: "FAILED" | "PROCESSING" | "SUCCESS" | "WAITING";
1159
- steps_logs: {
1160
- started_at: string;
1161
- ended_at: string | null;
1162
- step: "ACCEPTING" | "FINALIZE" | "PAUSE_FOR_ADVANCE" | "PROCESS_STATE_NODE" | "ROLLBACK_ACCEPT" | "ROLLBACK_PROCESS_STATE_NODE" | "WARN_NO_EDGE";
1163
- logs: {
1164
- type: "error" | "info" | "success" | "warning";
1165
- message: string;
1166
- }[];
1167
- }[];
1168
- warning_count: number;
1169
- checkout_state: "failed" | "pending" | "released";
1170
- error: {
1171
- node_id?: string | undefined;
1172
- status?: string | undefined;
1173
- message: string;
1174
- } | null;
1175
- customer_id: string;
1176
- payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1177
- fulfillment_status: string;
1178
- }[]>;
1179
- declare const updateOrder: (id: string, body: OrderUpdateInput, options?: ServiceHttpOptions) => Promise<{
1180
- uid: string;
1181
- id: string;
1182
- brand_id?: string | null | undefined;
1183
- store_id: string;
1184
- channel_id: string;
1185
- customer_id: string;
1186
- fulfillment_id: string;
1187
- is_anonymous: boolean;
1188
- lines: {
1189
- type: "FEE" | "PRODUCT";
1190
- uid: string;
1191
- id: string;
1192
- parent_uid: string | null;
1193
- parent_id: string | null;
1194
- name: string;
1195
- image_url?: string | undefined;
1196
- menu_id?: string | undefined;
1197
- internal_attribution_source?: string | undefined;
1198
- internal_attribution_id?: string | undefined;
1199
- metadata: Record<string, unknown>;
1200
- bundled_items: {
1201
- id: string;
1202
- refund_price: number;
1203
- included_quantity: number;
1204
- }[];
1205
- redeem: {
1206
- reward_id: string;
1207
- quantity: number;
1208
- discount_rate?: number | undefined;
1209
- discount_amount?: number | undefined;
1210
- expires_at?: string | undefined;
1211
- }[];
1212
- quantity: number;
1213
- tax_rate: number | null;
1214
- discount_rate: number;
1215
- unit_subtotal: number;
1216
- unit_discount: number;
1217
- unit_tax_total: number;
1218
- unit_total: number;
1219
- subtotal: number;
1220
- discount_total: number;
1221
- tax_total: number;
1222
- total: number;
1223
- unit_group_subtotal: number;
1224
- unit_group_discount: number;
1225
- unit_group_tax_total: number;
1226
- unit_group_total: number;
1227
- group_subtotal: number;
1228
- group_discount: number;
1229
- group_tax_total: number;
1230
- group_total: number;
1231
- }[];
1232
- redeem: {
1233
- reward_id: string;
1234
- quantity: number;
1235
- discount_rate?: number | undefined;
1236
- discount_amount?: number | undefined;
1237
- expires_at?: string | undefined;
1238
- }[];
1239
- redemption_steps: {
1240
- reward_id: string;
1241
- reward_quantity: number;
1242
- target: "LINE" | "ORDER";
1243
- target_id?: string | undefined;
1244
- action: "CREATE" | "DELETE" | "READ" | "UPDATE";
1245
- discount_amount: number;
1246
- before: {
1247
- value: number;
1248
- quantity: number;
1249
- discount_amount: number;
1250
- discount_rate: number;
1251
- };
1252
- after: {
1253
- value: number;
1254
- quantity: number;
1255
- discount_amount: number;
1256
- discount_rate: number;
1257
- };
1258
- target_before?: {
1259
- value: number;
1260
- quantity: number;
1261
- discount_amount: number;
1262
- discount_rate: number;
1263
- } | undefined;
1264
- target_after?: {
1265
- value: number;
1266
- quantity: number;
1267
- discount_amount: number;
1268
- discount_rate: number;
1269
- } | undefined;
1270
- error?: string | undefined;
1271
- }[];
1272
- customer: {
1273
- customer_info: {
1274
- display_name: string;
1275
- first_name: string;
1276
- middle_name?: string | undefined;
1277
- last_name: string;
1278
- second_last_name?: string | undefined;
1279
- email: string;
1280
- phone: string;
1281
- gender?: "FEMALE" | "MALE" | undefined;
1282
- dob?: string | undefined;
1283
- document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
1284
- document_number?: string | undefined;
1285
- city?: string | undefined;
1286
- country?: string | undefined;
1287
- };
1288
- address_info?: {
1289
- address_line1: string;
1290
- address_line2?: string | undefined;
1291
- city?: string | undefined;
1292
- state?: string | undefined;
1293
- zip?: string | undefined;
1294
- country?: string | undefined;
1295
- reference?: string | undefined;
1296
- latitude?: number | undefined;
1297
- longitude?: number | undefined;
1298
- instructions?: string | undefined;
1299
- metadata: Record<string, unknown> | null;
1300
- } | null | undefined;
1301
- billing_info?: {
1302
- type: "BUSINESS" | "INDIVIDUAL";
1303
- legal_name: string;
1304
- address_line1: string;
1305
- address_line2?: string | undefined;
1306
- city?: string | undefined;
1307
- state?: string | undefined;
1308
- zip?: string | undefined;
1309
- country?: string | undefined;
1310
- tax_id: string;
1311
- tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
1312
- metadata: Record<string, unknown> | null;
1313
- } | null | undefined;
1314
- };
1315
- payment_intents: {
1316
- id?: string | undefined;
1317
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1318
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1319
- collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1320
- status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1321
- totals: {
1322
- currency: string;
1323
- subtotal: number;
1324
- discount_rate: number;
1325
- discount_total: number;
1326
- tax_rate: number;
1327
- tax_total: number;
1328
- total: number;
1329
- };
1330
- error_message?: string | undefined;
1331
- placed_at: string;
1332
- resolved_at?: string | undefined;
1333
- metadata: Record<string, unknown>;
1334
- }[];
1335
- totals: {
1336
- currency: string;
1337
- subtotal: number;
1338
- discount_rate: number;
1339
- discount_total: number;
1340
- tax_rate: number;
1341
- tax_total: number;
1342
- total: number;
1343
- };
1344
- metadata: Record<string, unknown>;
1345
- payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1346
- fulfillment_status: string;
1347
- status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
1348
- issued_at?: string | null | undefined;
1349
- resolved_at?: string | null | undefined;
1350
- }>;
1351
- declare const cancelOrder: (id: string, options?: ServiceHttpOptions) => Promise<{
1352
- uid: string;
1353
- id: string;
1354
- brand_id?: string | null | undefined;
1355
- store_id: string;
1356
- channel_id: string;
1357
- customer_id: string;
1358
- fulfillment_id: string;
1359
- is_anonymous: boolean;
1360
- lines: {
1361
- type: "FEE" | "PRODUCT";
1362
- uid: string;
1363
- id: string;
1364
- parent_uid: string | null;
1365
- parent_id: string | null;
1366
- name: string;
1367
- image_url?: string | undefined;
1368
- menu_id?: string | undefined;
1369
- internal_attribution_source?: string | undefined;
1370
- internal_attribution_id?: string | undefined;
1371
- metadata: Record<string, unknown>;
1372
- bundled_items: {
1373
- id: string;
1374
- refund_price: number;
1375
- included_quantity: number;
1376
- }[];
1377
- redeem: {
1378
- reward_id: string;
1379
- quantity: number;
1380
- discount_rate?: number | undefined;
1381
- discount_amount?: number | undefined;
1382
- expires_at?: string | undefined;
1383
- }[];
1384
- quantity: number;
1385
- tax_rate: number | null;
1386
- discount_rate: number;
1387
- unit_subtotal: number;
1388
- unit_discount: number;
1389
- unit_tax_total: number;
1390
- unit_total: number;
1391
- subtotal: number;
1392
- discount_total: number;
1393
- tax_total: number;
1394
- total: number;
1395
- unit_group_subtotal: number;
1396
- unit_group_discount: number;
1397
- unit_group_tax_total: number;
1398
- unit_group_total: number;
1399
- group_subtotal: number;
1400
- group_discount: number;
1401
- group_tax_total: number;
1402
- group_total: number;
1403
- }[];
1404
- redeem: {
1405
- reward_id: string;
1406
- quantity: number;
1407
- discount_rate?: number | undefined;
1408
- discount_amount?: number | undefined;
1409
- expires_at?: string | undefined;
1410
- }[];
1411
- redemption_steps: {
1412
- reward_id: string;
1413
- reward_quantity: number;
1414
- target: "LINE" | "ORDER";
1415
- target_id?: string | undefined;
1416
- action: "CREATE" | "DELETE" | "READ" | "UPDATE";
1417
- discount_amount: number;
1418
- before: {
1419
- value: number;
1420
- quantity: number;
1421
- discount_amount: number;
1422
- discount_rate: number;
1423
- };
1424
- after: {
1425
- value: number;
1426
- quantity: number;
1427
- discount_amount: number;
1428
- discount_rate: number;
1429
- };
1430
- target_before?: {
1431
- value: number;
1432
- quantity: number;
1433
- discount_amount: number;
1434
- discount_rate: number;
1435
- } | undefined;
1436
- target_after?: {
1437
- value: number;
1438
- quantity: number;
1439
- discount_amount: number;
1440
- discount_rate: number;
1441
- } | undefined;
1442
- error?: string | undefined;
1443
- }[];
1444
- customer: {
1445
- customer_info: {
1446
- display_name: string;
1447
- first_name: string;
1448
- middle_name?: string | undefined;
1449
- last_name: string;
1450
- second_last_name?: string | undefined;
1451
- email: string;
1452
- phone: string;
1453
- gender?: "FEMALE" | "MALE" | undefined;
1454
- dob?: string | undefined;
1455
- document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
1456
- document_number?: string | undefined;
1457
- city?: string | undefined;
1458
- country?: string | undefined;
1459
- };
1460
- address_info?: {
1461
- address_line1: string;
1462
- address_line2?: string | undefined;
1463
- city?: string | undefined;
1464
- state?: string | undefined;
1465
- zip?: string | undefined;
1466
- country?: string | undefined;
1467
- reference?: string | undefined;
1468
- latitude?: number | undefined;
1469
- longitude?: number | undefined;
1470
- instructions?: string | undefined;
1471
- metadata: Record<string, unknown> | null;
1472
- } | null | undefined;
1473
- billing_info?: {
1474
- type: "BUSINESS" | "INDIVIDUAL";
1475
- legal_name: string;
1476
- address_line1: string;
1477
- address_line2?: string | undefined;
1478
- city?: string | undefined;
1479
- state?: string | undefined;
1480
- zip?: string | undefined;
1481
- country?: string | undefined;
1482
- tax_id: string;
1483
- tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
1484
- metadata: Record<string, unknown> | null;
1485
- } | null | undefined;
1486
- };
1487
- payment_intents: {
1488
- id?: string | undefined;
1489
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1490
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1491
- collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1492
- status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1493
- totals: {
1494
- currency: string;
1495
- subtotal: number;
1496
- discount_rate: number;
1497
- discount_total: number;
1498
- tax_rate: number;
1499
- tax_total: number;
1500
- total: number;
1501
- };
1502
- error_message?: string | undefined;
1503
- placed_at: string;
1504
- resolved_at?: string | undefined;
1505
- metadata: Record<string, unknown>;
1506
- }[];
1507
- totals: {
1508
- currency: string;
1509
- subtotal: number;
1510
- discount_rate: number;
1511
- discount_total: number;
1512
- tax_rate: number;
1513
- tax_total: number;
1514
- total: number;
1515
- };
1516
- metadata: Record<string, unknown>;
1517
- payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1518
- fulfillment_status: string;
1519
- status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
1520
- issued_at?: string | null | undefined;
1521
- resolved_at?: string | null | undefined;
1522
- }>;
1523
- declare const refundOrder: (id: string, options?: ServiceHttpOptions) => Promise<{
1524
- uid: string;
1525
- id: string;
1526
- brand_id?: string | null | undefined;
1527
- store_id: string;
1528
- channel_id: string;
1529
- customer_id: string;
1530
- fulfillment_id: string;
1531
- is_anonymous: boolean;
1532
- lines: {
1533
- type: "FEE" | "PRODUCT";
1534
- uid: string;
1535
- id: string;
1536
- parent_uid: string | null;
1537
- parent_id: string | null;
1538
- name: string;
1539
- image_url?: string | undefined;
1540
- menu_id?: string | undefined;
1541
- internal_attribution_source?: string | undefined;
1542
- internal_attribution_id?: string | undefined;
1543
- metadata: Record<string, unknown>;
1544
- bundled_items: {
1545
- id: string;
1546
- refund_price: number;
1547
- included_quantity: number;
1548
- }[];
1549
- redeem: {
1550
- reward_id: string;
1551
- quantity: number;
1552
- discount_rate?: number | undefined;
1553
- discount_amount?: number | undefined;
1554
- expires_at?: string | undefined;
1555
- }[];
1556
- quantity: number;
1557
- tax_rate: number | null;
1558
- discount_rate: number;
1559
- unit_subtotal: number;
1560
- unit_discount: number;
1561
- unit_tax_total: number;
1562
- unit_total: number;
1563
- subtotal: number;
1564
- discount_total: number;
1565
- tax_total: number;
1566
- total: number;
1567
- unit_group_subtotal: number;
1568
- unit_group_discount: number;
1569
- unit_group_tax_total: number;
1570
- unit_group_total: number;
1571
- group_subtotal: number;
1572
- group_discount: number;
1573
- group_tax_total: number;
1574
- group_total: number;
1575
- }[];
1576
- redeem: {
1577
- reward_id: string;
1578
- quantity: number;
1579
- discount_rate?: number | undefined;
1580
- discount_amount?: number | undefined;
1581
- expires_at?: string | undefined;
1582
- }[];
1583
- redemption_steps: {
1584
- reward_id: string;
1585
- reward_quantity: number;
1586
- target: "LINE" | "ORDER";
1587
- target_id?: string | undefined;
1588
- action: "CREATE" | "DELETE" | "READ" | "UPDATE";
1589
- discount_amount: number;
1590
- before: {
1591
- value: number;
1592
- quantity: number;
1593
- discount_amount: number;
1594
- discount_rate: number;
1595
- };
1596
- after: {
1597
- value: number;
1598
- quantity: number;
1599
- discount_amount: number;
1600
- discount_rate: number;
1601
- };
1602
- target_before?: {
1603
- value: number;
1604
- quantity: number;
1605
- discount_amount: number;
1606
- discount_rate: number;
1607
- } | undefined;
1608
- target_after?: {
1609
- value: number;
1610
- quantity: number;
1611
- discount_amount: number;
1612
- discount_rate: number;
1613
- } | undefined;
1614
- error?: string | undefined;
1615
- }[];
1616
- customer: {
1617
- customer_info: {
1618
- display_name: string;
1619
- first_name: string;
1620
- middle_name?: string | undefined;
1621
- last_name: string;
1622
- second_last_name?: string | undefined;
1623
- email: string;
1624
- phone: string;
1625
- gender?: "FEMALE" | "MALE" | undefined;
1626
- dob?: string | undefined;
1627
- document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
1628
- document_number?: string | undefined;
1629
- city?: string | undefined;
1630
- country?: string | undefined;
1631
- };
1632
- address_info?: {
1633
- address_line1: string;
1634
- address_line2?: string | undefined;
1635
- city?: string | undefined;
1636
- state?: string | undefined;
1637
- zip?: string | undefined;
1638
- country?: string | undefined;
1639
- reference?: string | undefined;
1640
- latitude?: number | undefined;
1641
- longitude?: number | undefined;
1642
- instructions?: string | undefined;
1643
- metadata: Record<string, unknown> | null;
1644
- } | null | undefined;
1645
- billing_info?: {
1646
- type: "BUSINESS" | "INDIVIDUAL";
1647
- legal_name: string;
1648
- address_line1: string;
1649
- address_line2?: string | undefined;
1650
- city?: string | undefined;
1651
- state?: string | undefined;
1652
- zip?: string | undefined;
1653
- country?: string | undefined;
1654
- tax_id: string;
1655
- tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
1656
- metadata: Record<string, unknown> | null;
1657
- } | null | undefined;
1658
- };
1659
- payment_intents: {
1660
- id?: string | undefined;
1661
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1662
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1663
- collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1664
- status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1665
- totals: {
1666
- currency: string;
1667
- subtotal: number;
1668
- discount_rate: number;
1669
- discount_total: number;
1670
- tax_rate: number;
1671
- tax_total: number;
1672
- total: number;
1673
- };
1674
- error_message?: string | undefined;
1675
- placed_at: string;
1676
- resolved_at?: string | undefined;
1677
- metadata: Record<string, unknown>;
1678
- }[];
1679
- totals: {
1680
- currency: string;
1681
- subtotal: number;
1682
- discount_rate: number;
1683
- discount_total: number;
1684
- tax_rate: number;
1685
- tax_total: number;
1686
- total: number;
1687
- };
1688
- metadata: Record<string, unknown>;
1689
- payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1690
- fulfillment_status: string;
1691
- status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
1692
- issued_at?: string | null | undefined;
1693
- resolved_at?: string | null | undefined;
1694
- }>;
1695
- declare const reorderOrder: (id: string, body?: OrderReorderInput, options?: ServiceHttpOptions) => Promise<{
1696
- uid: string;
1697
- id: string;
1698
- brand_id?: string | null | undefined;
1699
- store_id: string;
1700
- channel_id: string;
1701
- customer_id: string;
1702
- fulfillment_id: string;
1703
- is_anonymous: boolean;
1704
- lines: {
1705
- type: "FEE" | "PRODUCT";
1706
- uid: string;
1707
- id: string;
1708
- parent_uid: string | null;
1709
- parent_id: string | null;
1710
- name: string;
1711
- image_url?: string | undefined;
1712
- menu_id?: string | undefined;
1713
- internal_attribution_source?: string | undefined;
1714
- internal_attribution_id?: string | undefined;
1715
- metadata: Record<string, unknown>;
1716
- bundled_items: {
1717
- id: string;
1718
- refund_price: number;
1719
- included_quantity: number;
1720
- }[];
1721
- redeem: {
1722
- reward_id: string;
1723
- quantity: number;
1724
- discount_rate?: number | undefined;
1725
- discount_amount?: number | undefined;
1726
- expires_at?: string | undefined;
1727
- }[];
1728
- quantity: number;
1729
- tax_rate: number | null;
1730
- discount_rate: number;
1731
- unit_subtotal: number;
1732
- unit_discount: number;
1733
- unit_tax_total: number;
1734
- unit_total: number;
1735
- subtotal: number;
1736
- discount_total: number;
1737
- tax_total: number;
1738
- total: number;
1739
- unit_group_subtotal: number;
1740
- unit_group_discount: number;
1741
- unit_group_tax_total: number;
1742
- unit_group_total: number;
1743
- group_subtotal: number;
1744
- group_discount: number;
1745
- group_tax_total: number;
1746
- group_total: number;
1747
- }[];
1748
- redeem: {
1749
- reward_id: string;
1750
- quantity: number;
1751
- discount_rate?: number | undefined;
1752
- discount_amount?: number | undefined;
1753
- expires_at?: string | undefined;
1754
- }[];
1755
- redemption_steps: {
1756
- reward_id: string;
1757
- reward_quantity: number;
1758
- target: "LINE" | "ORDER";
1759
- target_id?: string | undefined;
1760
- action: "CREATE" | "DELETE" | "READ" | "UPDATE";
1761
- discount_amount: number;
1762
- before: {
1763
- value: number;
1764
- quantity: number;
1765
- discount_amount: number;
1766
- discount_rate: number;
1767
- };
1768
- after: {
1769
- value: number;
1770
- quantity: number;
1771
- discount_amount: number;
1772
- discount_rate: number;
1773
- };
1774
- target_before?: {
1775
- value: number;
1776
- quantity: number;
1777
- discount_amount: number;
1778
- discount_rate: number;
1779
- } | undefined;
1780
- target_after?: {
1781
- value: number;
1782
- quantity: number;
1783
- discount_amount: number;
1784
- discount_rate: number;
1785
- } | undefined;
1786
- error?: string | undefined;
1787
- }[];
1788
- customer: {
1789
- customer_info: {
1790
- display_name: string;
1791
- first_name: string;
1792
- middle_name?: string | undefined;
1793
- last_name: string;
1794
- second_last_name?: string | undefined;
1795
- email: string;
1796
- phone: string;
1797
- gender?: "FEMALE" | "MALE" | undefined;
1798
- dob?: string | undefined;
1799
- document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
1800
- document_number?: string | undefined;
1801
- city?: string | undefined;
1802
- country?: string | undefined;
1803
- };
1804
- address_info?: {
1805
- address_line1: string;
1806
- address_line2?: string | undefined;
1807
- city?: string | undefined;
1808
- state?: string | undefined;
1809
- zip?: string | undefined;
1810
- country?: string | undefined;
1811
- reference?: string | undefined;
1812
- latitude?: number | undefined;
1813
- longitude?: number | undefined;
1814
- instructions?: string | undefined;
1815
- metadata: Record<string, unknown> | null;
1816
- } | null | undefined;
1817
- billing_info?: {
1818
- type: "BUSINESS" | "INDIVIDUAL";
1819
- legal_name: string;
1820
- address_line1: string;
1821
- address_line2?: string | undefined;
1822
- city?: string | undefined;
1823
- state?: string | undefined;
1824
- zip?: string | undefined;
1825
- country?: string | undefined;
1826
- tax_id: string;
1827
- tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
1828
- metadata: Record<string, unknown> | null;
1829
- } | null | undefined;
1830
- };
1831
- payment_intents: {
1832
- id?: string | undefined;
1833
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
1834
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
1835
- collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
1836
- status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1837
- totals: {
1838
- currency: string;
1839
- subtotal: number;
1840
- discount_rate: number;
1841
- discount_total: number;
1842
- tax_rate: number;
1843
- tax_total: number;
1844
- total: number;
1845
- };
1846
- error_message?: string | undefined;
1847
- placed_at: string;
1848
- resolved_at?: string | undefined;
1849
- metadata: Record<string, unknown>;
1850
- }[];
1851
- totals: {
1852
- currency: string;
1853
- subtotal: number;
1854
- discount_rate: number;
1855
- discount_total: number;
1856
- tax_rate: number;
1857
- tax_total: number;
1858
- total: number;
1859
- };
1860
- metadata: Record<string, unknown>;
1861
- payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
1862
- fulfillment_status: string;
1863
- status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
1864
- issued_at?: string | null | undefined;
1865
- resolved_at?: string | null | undefined;
1866
- }>;
237
+ declare const placeOrder: (id: string, body?: PlaceOrderInput, options?: ServiceHttpOptions) => Promise<PlaceOrderResult>;
238
+ /** Records (or updates by `metadata.attempt_reference`) one payment intent. */
239
+ declare const recordOrderPayment: (id: string, body: OrderRecordPaymentInput, options?: ServiceHttpOptions) => Promise<Order$1>;
240
+ declare const getOrderFulfillment: (id: string, options?: ServiceHttpOptions) => Promise<OrderFulfillment>;
241
+ declare const listOrderFulfillments: (ids: string[], options?: ServiceHttpOptions) => Promise<OrderFulfillment[]>;
242
+ declare const updateOrder: (id: string, body: OrderUpdateInput, options?: ServiceHttpOptions) => Promise<Order$1>;
243
+ declare const cancelOrder: (id: string, options?: ServiceHttpOptions) => Promise<Order$1>;
244
+ declare const refundOrder: (id: string, options?: ServiceHttpOptions) => Promise<Order$1>;
245
+ declare const reorderOrder: (id: string, body?: OrderReorderInput, options?: ServiceHttpOptions) => Promise<Order$1>;
1867
246
  declare const validateOrder: (body: OrderValidateInput, options?: ServiceHttpOptions) => Promise<OrderValidateOutput>;
1868
247
  //#endregion
248
+ //#region src/order/payments/orchestrator.d.ts
249
+ type Clock = {
250
+ now: () => number;
251
+ sleep: (ms: number, signal?: AbortSignal) => Promise<void>;
252
+ };
253
+ type PaymentRunOptions = {
254
+ clock?: Clock;
255
+ /** Called with every intermediate result (e.g. to record PENDING + QR). */
256
+ onProgress?: (result: PaymentResult) => void | Promise<void>;
257
+ };
258
+ /**
259
+ * One payment attempt with the policy of section 7: timeout, retries on
260
+ * retryable errors (same `attempt_reference`), batch close and retry,
261
+ * polling for actions and resolution of ambiguous results.
262
+ */
263
+ declare const runPaymentAttempt: (adapter: PaymentAdapter, ctx: PaymentContext, options?: PaymentRunOptions) => Promise<PaymentResult>;
264
+ type ReversalOutcome = {
265
+ kind: "cancel" | "refund" | "manual";
266
+ result: PaymentResult;
267
+ };
268
+ /** Undo a charge after a failed injection or an incomplete split payment. */
269
+ declare const reversePayment: (adapter: PaymentAdapter, ctx: PaymentContext, result: PaymentResult, options?: {
270
+ clock?: Clock;
271
+ now?: Date;
272
+ }) => Promise<ReversalOutcome>;
273
+ //#endregion
274
+ //#region src/order/payments/session.d.ts
275
+ type Intent = Order$1["payment_intents"][number];
276
+ type PaymentSessionOptions = {
277
+ /** Merchant env is production (`env_is_prod`). */
278
+ isProduction?: boolean;
279
+ /** Where the customer pays: `KIOSK` on a kiosk, `DEVICE` on web/app. */
280
+ collectAt?: PaymentCollectAt;
281
+ /** Where cash is collected: `COUNTER` on a kiosk, `DOOR` on delivery. */
282
+ cashCollectAt?: PaymentCollectAt;
283
+ /** `settings_overrides.payment_settings` of this device, by payment id. */
284
+ deviceSettings?: Record<string, Record<string, unknown>>;
285
+ /** Kiosk device id, sent with terminal failure reports. */
286
+ deviceId?: string | null;
287
+ };
288
+ type PayOptions = {
289
+ /** Amount in the order currency; defaults to the remaining amount. */
290
+ amount?: number;
291
+ signal?: AbortSignal;
292
+ onProgress?: PaymentRunOptions["onProgress"];
293
+ };
294
+ /** PAID plus PENDING with `confirm_after_inject`, in the order currency. */
295
+ declare const coveredAmount: (intents: Intent[]) => number;
296
+ declare const remainingAmount: (order: Order$1) => number;
297
+ //#endregion
1869
298
  //#region src/order/recommendations.d.ts
1870
299
  type RecommendationType = Recommendation["type"];
1871
300
  declare const DEFAULT_RECOMMENDATION_TYPES: RecommendationType[];
@@ -1925,6 +354,7 @@ declare class Order {
1925
354
  private readonly externalNotify?;
1926
355
  private readonly http;
1927
356
  private readonly flush;
357
+ private readonly payments;
1928
358
  private constructor();
1929
359
  /**
1930
360
  * Opens a cart session: reuses an existing OPEN order for the scope, or a
@@ -1980,6 +410,7 @@ declare class Order {
1980
410
  * latest applied first. Removing more units than applied clears them all.
1981
411
  */
1982
412
  removeRedeem(input: RemoveRedeemInput): void;
413
+ private rememberLogScope;
1983
414
  setScope(scope: Partial<OrderScope>): void;
1984
415
  /** Shallow-merges into order metadata; `null` values are kept as-is. */
1985
416
  setMetadata(patch: Record<string, unknown>): void;
@@ -1991,6 +422,28 @@ declare class Order {
1991
422
  refundOrder(): Promise<void>;
1992
423
  validateOrder(): Promise<void>;
1993
424
  placeOrder(input?: PlaceOrderInput): Promise<void>;
425
+ /** Installed `@fire-spark/payments-*` adapters (provider + method). */
426
+ setPaymentAdapters(adapters: PaymentAdapter[]): void;
427
+ /** Template modal/sheet the adapters use to talk to the customer. */
428
+ setPaymentUI(ui: PaymentUI): void;
429
+ /** Persistent device storage (terminal keys, last batch close). */
430
+ setPaymentStorage(storage: PaymentStorage): void;
431
+ /** Environment, collect point and this device's `payment_settings`. */
432
+ setPaymentOptions(options: PaymentSessionOptions): void;
433
+ /** Merchant payments with an adapter installed and configured here. */
434
+ getPaymentOptions(payments: MerchantPayment[]): MerchantPayment[];
435
+ /** Device fields still missing for `payment` on this device. */
436
+ getMissingPaymentFields(payment: MerchantPayment): import("@fire-spark/payments").DeviceField[];
437
+ /** Order total minus PAID (and confirm-after-inject) intents. */
438
+ getRemainingAmount(): number;
439
+ /** Places the order if needed and charges `payment` (all or part). */
440
+ pay(payment: MerchantPayment, options?: PayOptions): Promise<import("@fire-spark/payments").PaymentResult>;
441
+ /** Confirms intents that waited for the order injection. */
442
+ confirmPaymentsAfterInject(): Promise<import("@fire-spark/payments").PaymentResult[]>;
443
+ /** Cancels or refunds every charge of this order (or flags it manual). */
444
+ reversePayments(): Promise<ReversalOutcome[]>;
445
+ /** Terminal admin operation (init, test, closeBatch, status, extra). */
446
+ runPaymentTerminal(payment: MerchantPayment, key: string): Promise<import("@fire-spark/payments").TerminalResult>;
1994
447
  /** Applies lines/redeem, replaying redemption steps and totals. */
1995
448
  private commitLines;
1996
449
  private scheduleAfterMutate;
@@ -2058,7 +511,7 @@ declare const milestoneSteps: (workflow: TrackWorkflow, currentNodeIds: string[]
2058
511
  //#endregion
2059
512
  //#region src/order/validate.d.ts
2060
513
  type OrderLineIssueCode = "PRODUCT_NOT_FOUND" | "HIDDEN" | "OUT_OF_STOCK" | "OUTSIDE_HOURS" | "MODIFIER_NOT_FOUND" | "MODIFIER_RULES_INVALID" | "VARIANT_BASE_NOT_ORDERABLE" | "VARIANT_NOT_OFFERED" | "PRICE_MISMATCH" | "TAX_MISMATCH" | "DISCOUNT_MISMATCH" | "QUANTITY_MISMATCH" | "QUANTITY_BELOW_MINIMUM" | "QUANTITY_ABOVE_MAXIMUM" | "STRUCTURE_MISMATCH" | "FEE_MISMATCH" | "REDEEM_EXPIRED" | "REDEMPTION_STEPS_MISMATCH";
2061
- type OrderIssueCode = "NO_MENU" | "MENU_CLOSED" | "SCOPE_INACTIVE" | "TOTALS_MISMATCH" | "REDEEM_EXPIRED" | "REDEMPTION_STEPS_MISMATCH" | "REDEMPTION_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";
514
+ type OrderIssueCode = "NO_MENU" | "MENU_CLOSED" | "SCOPE_INACTIVE" | "TOTALS_MISMATCH" | "REDEEM_EXPIRED" | "REDEMPTION_STEPS_MISMATCH" | "REDEMPTION_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" | "DAILY_ORDER_LIMIT_REACHED";
2062
515
  type OrderLineIssue = {
2063
516
  code: OrderLineIssueCode;
2064
517
  field?: string;
@@ -2122,48 +575,8 @@ declare const recomputeRedemptions: (input: {
2122
575
  redemption_steps: OrderRedemptionStep[];
2123
576
  currency: string;
2124
577
  }) => {
2125
- redemption_steps: {
2126
- reward_id: string;
2127
- reward_quantity: number;
2128
- target: "LINE" | "ORDER";
2129
- target_id?: string | undefined;
2130
- action: "CREATE" | "DELETE" | "READ" | "UPDATE";
2131
- discount_amount: number;
2132
- before: {
2133
- value: number;
2134
- quantity: number;
2135
- discount_amount: number;
2136
- discount_rate: number;
2137
- };
2138
- after: {
2139
- value: number;
2140
- quantity: number;
2141
- discount_amount: number;
2142
- discount_rate: number;
2143
- };
2144
- target_before?: {
2145
- value: number;
2146
- quantity: number;
2147
- discount_amount: number;
2148
- discount_rate: number;
2149
- } | undefined;
2150
- target_after?: {
2151
- value: number;
2152
- quantity: number;
2153
- discount_amount: number;
2154
- discount_rate: number;
2155
- } | undefined;
2156
- error?: string | undefined;
2157
- }[];
2158
- totals: {
2159
- currency: string;
2160
- subtotal: number;
2161
- discount_rate: number;
2162
- discount_total: number;
2163
- tax_rate: number;
2164
- tax_total: number;
2165
- total: number;
2166
- };
578
+ redemption_steps: OrderRedemptionStep[];
579
+ totals: OrderTotals;
2167
580
  };
2168
581
  //#endregion
2169
582
  //#region src/order/totals.d.ts
@@ -2172,525 +585,28 @@ declare const recomputeTotals: (lines: OrderLine[], currency?: string) => OrderT
2172
585
  //#endregion
2173
586
  //#region src/order/lines.d.ts
2174
587
  declare const addLines: (lines: OrderLine[], incoming: OrderLine | OrderLine[]) => OrderLine[];
588
+ declare const removeLine: (lines: OrderLine[], lineUid: string) => OrderLine[];
589
+ /** Rescale one line's money to `quantity`; zero or less drops its subtree. */
590
+ declare const setLineQuantity: (lines: OrderLine[], lineUid: string, quantity: number) => OrderLine[];
591
+ /** Drop a root subtree, then add the replacement tree (may merge by fingerprint). */
592
+ declare const replaceLine: (lines: OrderLine[], lineUid: string, next: OrderLine | OrderLine[]) => OrderLine[];
2175
593
  //#endregion
2176
594
  //#region src/services/availability.d.ts
2177
595
  declare const getAvailability: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<StorefrontAvailability>;
2178
596
  //#endregion
2179
597
  //#region src/services/cms.d.ts
2180
- declare const getCmsBlock: (name: string, options?: ServiceHttpOptions) => Promise<{
2181
- id: string;
2182
- name: string;
2183
- items: ({
2184
- id: string;
2185
- key: string;
2186
- label?: string | null | undefined;
2187
- type: "TEXT";
2188
- text: string;
2189
- } | {
2190
- id: string;
2191
- key: string;
2192
- label?: string | null | undefined;
2193
- type: "IMAGE";
2194
- url: string;
2195
- alt?: string | null | undefined;
2196
- mime_type?: string | null | undefined;
2197
- size_bytes?: number | null | undefined;
2198
- } | {
2199
- id: string;
2200
- key: string;
2201
- label?: string | null | undefined;
2202
- type: "VIDEO";
2203
- url: string;
2204
- title?: string | null | undefined;
2205
- mime_type?: string | null | undefined;
2206
- size_bytes?: number | null | undefined;
2207
- } | {
2208
- id: string;
2209
- key: string;
2210
- label?: string | null | undefined;
2211
- type: "DOCUMENT";
2212
- url: string;
2213
- title?: string | null | undefined;
2214
- mime_type?: string | null | undefined;
2215
- size_bytes?: number | null | undefined;
2216
- } | {
2217
- id: string;
2218
- key: string;
2219
- label?: string | null | undefined;
2220
- type: "LIST";
2221
- item_type: "DOCUMENT" | "IMAGE" | "TEXT" | "VIDEO";
2222
- items: ({
2223
- id: string;
2224
- type: "TEXT";
2225
- text: string;
2226
- } | {
2227
- id: string;
2228
- type: "IMAGE";
2229
- url: string;
2230
- alt?: string | null | undefined;
2231
- mime_type?: string | null | undefined;
2232
- size_bytes?: number | null | undefined;
2233
- } | {
2234
- id: string;
2235
- type: "VIDEO";
2236
- url: string;
2237
- title?: string | null | undefined;
2238
- mime_type?: string | null | undefined;
2239
- size_bytes?: number | null | undefined;
2240
- } | {
2241
- id: string;
2242
- type: "DOCUMENT";
2243
- url: string;
2244
- title?: string | null | undefined;
2245
- mime_type?: string | null | undefined;
2246
- size_bytes?: number | null | undefined;
2247
- })[];
2248
- })[];
2249
- status: string;
2250
- }>;
598
+ declare const getCmsBlock: (name: string, options?: ServiceHttpOptions) => Promise<CmsBlock>;
2251
599
  //#endregion
2252
600
  //#region src/services/customers.d.ts
2253
- declare const getCustomer: (id: string, options?: ServiceHttpOptions) => Promise<{
2254
- id: string;
2255
- uid: string;
2256
- merchant_id: string;
2257
- name: string;
2258
- email: string | null;
2259
- status: string;
2260
- metadata: Record<string, unknown> | null;
2261
- dob: string | null;
2262
- gender: "FEMALE" | "MALE" | "OTHER" | null;
2263
- registration_date: string;
2264
- devices: {
2265
- id: string;
2266
- os: "ANDROID" | "IOS" | "WEB";
2267
- fcm_token: string;
2268
- created_at: string;
2269
- updated_at: string;
2270
- }[];
2271
- delivery_addresses: {
2272
- alias: string;
2273
- address_line1: string;
2274
- address_line2?: string | undefined;
2275
- city?: string | undefined;
2276
- state?: string | undefined;
2277
- zip?: string | undefined;
2278
- country?: string | undefined;
2279
- reference?: string | undefined;
2280
- latitude?: number | undefined;
2281
- longitude?: number | undefined;
2282
- instructions?: string | undefined;
2283
- preferred: boolean;
2284
- metadata: Record<string, unknown> | null;
2285
- }[];
2286
- billing_profiles: {
2287
- alias: string;
2288
- type: "BUSINESS" | "INDIVIDUAL";
2289
- legal_name: string;
2290
- address_line1: string;
2291
- address_line2?: string | undefined;
2292
- city?: string | undefined;
2293
- state?: string | undefined;
2294
- zip?: string | undefined;
2295
- country?: string | undefined;
2296
- tax_id: string;
2297
- tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
2298
- preferred: boolean;
2299
- metadata: Record<string, unknown> | null;
2300
- }[];
2301
- payments: ({
2302
- id: string;
2303
- type: "CASH";
2304
- alias?: string | undefined;
2305
- preferred: boolean;
2306
- metadata: Record<string, unknown> | null;
2307
- } | {
2308
- id: string;
2309
- type: "CARD";
2310
- alias: string;
2311
- brand: "amex" | "diners" | "discover" | "mastercard" | "other" | "visa";
2312
- first4: string;
2313
- last4: string;
2314
- exp_month: number;
2315
- exp_year: number;
2316
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2317
- provider_payment_method_id: string;
2318
- preferred: boolean;
2319
- metadata: Record<string, unknown> | null;
2320
- } | {
2321
- id: string;
2322
- type: "WALLET";
2323
- alias: string;
2324
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2325
- provider_payment_method_id: string;
2326
- account_hint?: string | undefined;
2327
- preferred: boolean;
2328
- metadata: Record<string, unknown> | null;
2329
- } | {
2330
- id: string;
2331
- type: "BANK_ACCOUNT";
2332
- alias: string;
2333
- bank_name?: string | undefined;
2334
- last4: string;
2335
- provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
2336
- provider_payment_method_id?: string | undefined;
2337
- preferred: boolean;
2338
- metadata: Record<string, unknown> | null;
2339
- })[];
2340
- email_verified: boolean;
2341
- consent: {
2342
- marketing: boolean;
2343
- } | null;
2344
- notification_preferences: {
2345
- email: boolean;
2346
- push: boolean;
2347
- push_token?: string | undefined;
2348
- push_token_expires_at?: string | undefined;
2349
- };
2350
- is_anonymous: boolean;
2351
- document_type?: string | null | undefined;
2352
- document_number?: string | null | undefined;
2353
- country?: string | null | undefined;
2354
- phone?: string | null | undefined;
2355
- phone_verified: boolean;
2356
- }>;
2357
- declare const createCustomer: (body: CustomerRegisterInput, options?: ServiceHttpOptions) => Promise<{
2358
- id: string;
2359
- uid: string;
2360
- merchant_id: string;
2361
- name: string;
2362
- email: string | null;
2363
- status: string;
2364
- metadata: Record<string, unknown> | null;
2365
- dob: string | null;
2366
- gender: "FEMALE" | "MALE" | "OTHER" | null;
2367
- registration_date: string;
2368
- devices: {
2369
- id: string;
2370
- os: "ANDROID" | "IOS" | "WEB";
2371
- fcm_token: string;
2372
- created_at: string;
2373
- updated_at: string;
2374
- }[];
2375
- delivery_addresses: {
2376
- alias: string;
2377
- address_line1: string;
2378
- address_line2?: string | undefined;
2379
- city?: string | undefined;
2380
- state?: string | undefined;
2381
- zip?: string | undefined;
2382
- country?: string | undefined;
2383
- reference?: string | undefined;
2384
- latitude?: number | undefined;
2385
- longitude?: number | undefined;
2386
- instructions?: string | undefined;
2387
- preferred: boolean;
2388
- metadata: Record<string, unknown> | null;
2389
- }[];
2390
- billing_profiles: {
2391
- alias: string;
2392
- type: "BUSINESS" | "INDIVIDUAL";
2393
- legal_name: string;
2394
- address_line1: string;
2395
- address_line2?: string | undefined;
2396
- city?: string | undefined;
2397
- state?: string | undefined;
2398
- zip?: string | undefined;
2399
- country?: string | undefined;
2400
- tax_id: string;
2401
- tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
2402
- preferred: boolean;
2403
- metadata: Record<string, unknown> | null;
2404
- }[];
2405
- payments: ({
2406
- id: string;
2407
- type: "CASH";
2408
- alias?: string | undefined;
2409
- preferred: boolean;
2410
- metadata: Record<string, unknown> | null;
2411
- } | {
2412
- id: string;
2413
- type: "CARD";
2414
- alias: string;
2415
- brand: "amex" | "diners" | "discover" | "mastercard" | "other" | "visa";
2416
- first4: string;
2417
- last4: string;
2418
- exp_month: number;
2419
- exp_year: number;
2420
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2421
- provider_payment_method_id: string;
2422
- preferred: boolean;
2423
- metadata: Record<string, unknown> | null;
2424
- } | {
2425
- id: string;
2426
- type: "WALLET";
2427
- alias: string;
2428
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2429
- provider_payment_method_id: string;
2430
- account_hint?: string | undefined;
2431
- preferred: boolean;
2432
- metadata: Record<string, unknown> | null;
2433
- } | {
2434
- id: string;
2435
- type: "BANK_ACCOUNT";
2436
- alias: string;
2437
- bank_name?: string | undefined;
2438
- last4: string;
2439
- provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
2440
- provider_payment_method_id?: string | undefined;
2441
- preferred: boolean;
2442
- metadata: Record<string, unknown> | null;
2443
- })[];
2444
- email_verified: boolean;
2445
- consent: {
2446
- marketing: boolean;
2447
- } | null;
2448
- notification_preferences: {
2449
- email: boolean;
2450
- push: boolean;
2451
- push_token?: string | undefined;
2452
- push_token_expires_at?: string | undefined;
2453
- };
2454
- is_anonymous: boolean;
2455
- document_type?: string | null | undefined;
2456
- document_number?: string | null | undefined;
2457
- country?: string | null | undefined;
2458
- phone?: string | null | undefined;
2459
- phone_verified: boolean;
2460
- }>;
2461
- declare const identifyAnonymousCustomer: (id: string, body: CustomerIdentifyInput, options?: ServiceHttpOptions) => Promise<{
2462
- id: string;
2463
- uid: string;
2464
- merchant_id: string;
2465
- name: string;
2466
- email: string | null;
2467
- status: string;
2468
- metadata: Record<string, unknown> | null;
2469
- dob: string | null;
2470
- gender: "FEMALE" | "MALE" | "OTHER" | null;
2471
- registration_date: string;
2472
- devices: {
2473
- id: string;
2474
- os: "ANDROID" | "IOS" | "WEB";
2475
- fcm_token: string;
2476
- created_at: string;
2477
- updated_at: string;
2478
- }[];
2479
- delivery_addresses: {
2480
- alias: string;
2481
- address_line1: string;
2482
- address_line2?: string | undefined;
2483
- city?: string | undefined;
2484
- state?: string | undefined;
2485
- zip?: string | undefined;
2486
- country?: string | undefined;
2487
- reference?: string | undefined;
2488
- latitude?: number | undefined;
2489
- longitude?: number | undefined;
2490
- instructions?: string | undefined;
2491
- preferred: boolean;
2492
- metadata: Record<string, unknown> | null;
2493
- }[];
2494
- billing_profiles: {
2495
- alias: string;
2496
- type: "BUSINESS" | "INDIVIDUAL";
2497
- legal_name: string;
2498
- address_line1: string;
2499
- address_line2?: string | undefined;
2500
- city?: string | undefined;
2501
- state?: string | undefined;
2502
- zip?: string | undefined;
2503
- country?: string | undefined;
2504
- tax_id: string;
2505
- tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
2506
- preferred: boolean;
2507
- metadata: Record<string, unknown> | null;
2508
- }[];
2509
- payments: ({
2510
- id: string;
2511
- type: "CASH";
2512
- alias?: string | undefined;
2513
- preferred: boolean;
2514
- metadata: Record<string, unknown> | null;
2515
- } | {
2516
- id: string;
2517
- type: "CARD";
2518
- alias: string;
2519
- brand: "amex" | "diners" | "discover" | "mastercard" | "other" | "visa";
2520
- first4: string;
2521
- last4: string;
2522
- exp_month: number;
2523
- exp_year: number;
2524
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2525
- provider_payment_method_id: string;
2526
- preferred: boolean;
2527
- metadata: Record<string, unknown> | null;
2528
- } | {
2529
- id: string;
2530
- type: "WALLET";
2531
- alias: string;
2532
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2533
- provider_payment_method_id: string;
2534
- account_hint?: string | undefined;
2535
- preferred: boolean;
2536
- metadata: Record<string, unknown> | null;
2537
- } | {
2538
- id: string;
2539
- type: "BANK_ACCOUNT";
2540
- alias: string;
2541
- bank_name?: string | undefined;
2542
- last4: string;
2543
- provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
2544
- provider_payment_method_id?: string | undefined;
2545
- preferred: boolean;
2546
- metadata: Record<string, unknown> | null;
2547
- })[];
2548
- email_verified: boolean;
2549
- consent: {
2550
- marketing: boolean;
2551
- } | null;
2552
- notification_preferences: {
2553
- email: boolean;
2554
- push: boolean;
2555
- push_token?: string | undefined;
2556
- push_token_expires_at?: string | undefined;
2557
- };
2558
- is_anonymous: boolean;
2559
- document_type?: string | null | undefined;
2560
- document_number?: string | null | undefined;
2561
- country?: string | null | undefined;
2562
- phone?: string | null | undefined;
2563
- phone_verified: boolean;
2564
- }>;
2565
- declare const updateCustomer: (id: string, body: CustomerUpdateInput, options?: ServiceHttpOptions) => Promise<{
2566
- id: string;
2567
- uid: string;
2568
- merchant_id: string;
2569
- name: string;
2570
- email: string | null;
2571
- status: string;
2572
- metadata: Record<string, unknown> | null;
2573
- dob: string | null;
2574
- gender: "FEMALE" | "MALE" | "OTHER" | null;
2575
- registration_date: string;
2576
- devices: {
2577
- id: string;
2578
- os: "ANDROID" | "IOS" | "WEB";
2579
- fcm_token: string;
2580
- created_at: string;
2581
- updated_at: string;
2582
- }[];
2583
- delivery_addresses: {
2584
- alias: string;
2585
- address_line1: string;
2586
- address_line2?: string | undefined;
2587
- city?: string | undefined;
2588
- state?: string | undefined;
2589
- zip?: string | undefined;
2590
- country?: string | undefined;
2591
- reference?: string | undefined;
2592
- latitude?: number | undefined;
2593
- longitude?: number | undefined;
2594
- instructions?: string | undefined;
2595
- preferred: boolean;
2596
- metadata: Record<string, unknown> | null;
2597
- }[];
2598
- billing_profiles: {
2599
- alias: string;
2600
- type: "BUSINESS" | "INDIVIDUAL";
2601
- legal_name: string;
2602
- address_line1: string;
2603
- address_line2?: string | undefined;
2604
- city?: string | undefined;
2605
- state?: string | undefined;
2606
- zip?: string | undefined;
2607
- country?: string | undefined;
2608
- tax_id: string;
2609
- tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
2610
- preferred: boolean;
2611
- metadata: Record<string, unknown> | null;
2612
- }[];
2613
- payments: ({
2614
- id: string;
2615
- type: "CASH";
2616
- alias?: string | undefined;
2617
- preferred: boolean;
2618
- metadata: Record<string, unknown> | null;
2619
- } | {
2620
- id: string;
2621
- type: "CARD";
2622
- alias: string;
2623
- brand: "amex" | "diners" | "discover" | "mastercard" | "other" | "visa";
2624
- first4: string;
2625
- last4: string;
2626
- exp_month: number;
2627
- exp_year: number;
2628
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2629
- provider_payment_method_id: string;
2630
- preferred: boolean;
2631
- metadata: Record<string, unknown> | null;
2632
- } | {
2633
- id: string;
2634
- type: "WALLET";
2635
- alias: string;
2636
- provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
2637
- provider_payment_method_id: string;
2638
- account_hint?: string | undefined;
2639
- preferred: boolean;
2640
- metadata: Record<string, unknown> | null;
2641
- } | {
2642
- id: string;
2643
- type: "BANK_ACCOUNT";
2644
- alias: string;
2645
- bank_name?: string | undefined;
2646
- last4: string;
2647
- provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
2648
- provider_payment_method_id?: string | undefined;
2649
- preferred: boolean;
2650
- metadata: Record<string, unknown> | null;
2651
- })[];
2652
- email_verified: boolean;
2653
- consent: {
2654
- marketing: boolean;
2655
- } | null;
2656
- notification_preferences: {
2657
- email: boolean;
2658
- push: boolean;
2659
- push_token?: string | undefined;
2660
- push_token_expires_at?: string | undefined;
2661
- };
2662
- is_anonymous: boolean;
2663
- document_type?: string | null | undefined;
2664
- document_number?: string | null | undefined;
2665
- country?: string | null | undefined;
2666
- phone?: string | null | undefined;
2667
- phone_verified: boolean;
2668
- }>;
601
+ declare const getCustomer: (id: string, options?: ServiceHttpOptions) => Promise<Customer>;
602
+ declare const createCustomer: (body: CustomerRegisterInput, options?: ServiceHttpOptions) => Promise<Customer>;
603
+ declare const identifyAnonymousCustomer: (id: string, body: CustomerIdentifyInput, options?: ServiceHttpOptions) => Promise<Customer>;
604
+ declare const updateCustomer: (id: string, body: CustomerUpdateInput, options?: ServiceHttpOptions) => Promise<Customer>;
2669
605
  declare const deleteCustomer: (id: string, options?: ServiceHttpOptions) => Promise<void>;
2670
606
  //#endregion
2671
607
  //#region src/services/fulfillment.d.ts
2672
- declare const listFulfillment: (input?: FulfillmentListInput, options?: ServiceHttpOptions) => Promise<{
2673
- id: string;
2674
- uid: string;
2675
- brand_id?: string | null | undefined;
2676
- merchant_id: string;
2677
- name: string;
2678
- type: string;
2679
- status: string;
2680
- checkout_release: boolean;
2681
- labels: string[];
2682
- }[]>;
2683
- declare const getFulfillment: (id: string, input?: FulfillmentListInput, options?: ServiceHttpOptions) => Promise<{
2684
- id: string;
2685
- uid: string;
2686
- brand_id?: string | null | undefined;
2687
- merchant_id: string;
2688
- name: string;
2689
- type: string;
2690
- status: string;
2691
- checkout_release: boolean;
2692
- labels: string[];
2693
- }>;
608
+ declare const listFulfillment: (input?: FulfillmentListInput, options?: ServiceHttpOptions) => Promise<Fulfillment[]>;
609
+ declare const getFulfillment: (id: string, input?: FulfillmentListInput, options?: ServiceHttpOptions) => Promise<Fulfillment>;
2694
610
  //#endregion
2695
611
  //#region src/services/kiosk.d.ts
2696
612
  declare const isDeviceNotLinked: (error: unknown) => boolean;
@@ -2733,912 +649,101 @@ declare const fetchKioskRealtimeToken: (input: {
2733
649
  type ListMenusStreamOptions = ServiceHttpOptions & StorefrontMenuStreamOptions;
2734
650
  //#endregion
2735
651
  //#region src/services/menus.d.ts
2736
- declare const listMenus: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<{
2737
- id: string;
2738
- uid: string;
2739
- merchant_id: string;
2740
- brand_id: string;
2741
- store_id: string;
2742
- store_uid?: string | null | undefined;
2743
- channel_id: string;
2744
- channel_uid?: string | null | undefined;
2745
- fulfillment_id: string;
2746
- fulfillment_uid?: string | null | undefined;
2747
- name: Record<string, string>;
2748
- description: Record<string, string> | null;
2749
- schedules: {
2750
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2751
- periods: {
2752
- closed: boolean;
2753
- start_time?: string | undefined;
2754
- end_time?: string | undefined;
2755
- start_date?: string | null | undefined;
2756
- end_date?: string | null | undefined;
2757
- }[];
2758
- }[] | null;
2759
- products: {
2760
- id: string;
2761
- name: Record<string, string>;
2762
- description: Record<string, string> | null;
2763
- image_url: string | null;
2764
- cms_template_id?: string | null | undefined;
2765
- bundled_items: {
2766
- id: string;
2767
- refund_price: number;
2768
- included_quantity: number;
2769
- }[];
2770
- pricing: {
2771
- minimum_quantity: number;
2772
- maximum_quantity: number;
2773
- is_tax_inclusive: boolean;
2774
- tax_rate: number;
2775
- price: number;
2776
- anchor_price?: number | undefined;
2777
- anchor_price_percentage?: number | undefined;
2778
- starting_price?: number | null | undefined;
2779
- modifiers: {
2780
- modifier_group_id: string;
2781
- default_quantity: number;
2782
- charge_above_quantity?: number | null | undefined;
2783
- display_type?: "CHECKBOX" | "QUANTITY" | "RADIO" | null | undefined;
2784
- recommendations: {
2785
- recommendation_id: string;
2786
- default_quantity: number;
2787
- }[];
2788
- minimum_quantity: number;
2789
- maximum_quantity?: number | undefined;
2790
- is_tax_inclusive: boolean;
2791
- tax_rate: number;
2792
- price: number;
2793
- anchor_price?: number | undefined;
2794
- anchor_price_percentage?: number | undefined;
2795
- }[];
2796
- modifier_group_ids: string[];
2797
- variants: {
2798
- product_id: string;
2799
- variant_group_option_ids: string[];
2800
- }[];
2801
- variant_group_ids: string[];
2802
- recommendations: {
2803
- recommendation_id: string;
2804
- default_quantity: number;
2805
- }[];
2806
- recommendations_ids: string[];
2807
- };
2808
- availability: {
2809
- schedules?: {
2810
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2811
- periods: {
2812
- closed: boolean;
2813
- start_time?: string | undefined;
2814
- end_time?: string | undefined;
2815
- start_date?: string | null | undefined;
2816
- end_date?: string | null | undefined;
2817
- }[];
2818
- }[] | null | undefined;
2819
- out_of_stock_until?: string | null | undefined;
2820
- status: "AVAILABLE" | "HIDDEN" | "OUT_OF_STOCK";
2821
- };
2822
- image_origin_url?: string | null | undefined;
2823
- labels: string[];
2824
- tags: Record<string, string | number | boolean>;
2825
- metadata: Record<string, unknown>;
2826
- }[];
2827
- categories: {
2828
- id: string;
2829
- name: Record<string, string>;
2830
- description?: Record<string, string> | null | undefined;
2831
- cms_template_id?: string | null | undefined;
2832
- cms?: {
2833
- id: string;
2834
- merchant_id: string;
2835
- env: string;
2836
- name: string;
2837
- fields: {
2838
- name: string;
2839
- type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
2840
- label?: Record<string, string> | null | undefined;
2841
- required: boolean;
2842
- placeholder?: string | null | undefined;
2843
- options?: {
2844
- label: string;
2845
- value: string;
2846
- }[] | null | undefined;
2847
- altText?: string | null | undefined;
2848
- src?: string | null | undefined;
2849
- href?: string | null | undefined;
2850
- }[];
2851
- entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
2852
- status: string;
2853
- } | null | undefined;
2854
- items: {
2855
- type: "CATEGORY" | "PRODUCT";
2856
- id: string;
2857
- }[];
2858
- availability: {
2859
- schedules?: {
2860
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2861
- periods: {
2862
- closed: boolean;
2863
- start_time?: string | undefined;
2864
- end_time?: string | undefined;
2865
- start_date?: string | null | undefined;
2866
- end_date?: string | null | undefined;
2867
- }[];
2868
- }[] | null | undefined;
2869
- inactive_until?: string | null | undefined;
2870
- status: "ACTIVE" | "HIDDEN" | "INACTIVE";
2871
- };
2872
- image_url: string | null;
2873
- image_origin_url?: string | null | undefined;
2874
- labels: string[];
2875
- tags: Record<string, string | number | boolean>;
2876
- metadata: Record<string, unknown>;
2877
- }[];
2878
- modifier_groups: {
2879
- id: string;
2880
- title: Record<string, string>;
2881
- description?: Record<string, string> | null | undefined;
2882
- display_type?: "GRID" | "LIST" | null | undefined;
2883
- modifier_ids: string[];
2884
- minimum_quantity: number;
2885
- maximum_quantity: number;
2886
- charge_above_quantity?: number | null | undefined;
2887
- metadata: Record<string, unknown>;
2888
- }[];
2889
- variant_groups: {
2890
- id: string;
2891
- title: Record<string, string>;
2892
- description?: Record<string, string> | null | undefined;
2893
- display_type?: "GRID" | "LIST" | null | undefined;
2894
- variants: {
2895
- id: string;
2896
- name: Record<string, string>;
2897
- description?: Record<string, string> | null | undefined;
2898
- image_url?: string | null | undefined;
2899
- image_origin_url?: string | null | undefined;
2900
- product_ids: string[];
2901
- metadata: Record<string, unknown>;
2902
- }[];
2903
- metadata: Record<string, unknown>;
2904
- }[];
2905
- recommendations: ({
2906
- id: string;
2907
- title: Record<string, string>;
2908
- description?: Record<string, string> | null | undefined;
2909
- metadata: Record<string, unknown>;
2910
- target_product_id: string;
2911
- type: "UPSELL";
2912
- } | {
2913
- id: string;
2914
- title: Record<string, string>;
2915
- description?: Record<string, string> | null | undefined;
2916
- metadata: Record<string, unknown>;
2917
- target_product_id: string;
2918
- type: "CROSS_SELL";
2919
- } | {
2920
- id: string;
2921
- title: Record<string, string>;
2922
- description?: Record<string, string> | null | undefined;
2923
- metadata: Record<string, unknown>;
2924
- target_product_id: string;
2925
- type: "DOWNSELL";
2926
- })[];
2927
- metadata: Record<string, unknown>;
2928
- cms_template_id?: string | null | undefined;
2929
- status: string;
2930
- release: string;
2931
- cms?: {
2932
- id: string;
2933
- name: string;
2934
- entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
2935
- status: string;
2936
- fields: {
2937
- name: string;
2938
- type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
2939
- label?: Record<string, string> | null | undefined;
2940
- required: boolean;
2941
- placeholder?: string | null | undefined;
2942
- options?: {
2943
- label: string;
2944
- value: string;
2945
- }[] | null | undefined;
2946
- altText?: string | null | undefined;
2947
- src?: string | null | undefined;
2948
- href?: string | null | undefined;
2949
- value?: unknown;
2950
- }[];
2951
- } | null | undefined;
2952
- }[]>;
2953
- declare const listMenusStream: (scope?: StorefrontMenuScope, options?: ListMenusStreamOptions) => AsyncGenerator<{
2954
- id: string;
2955
- uid: string;
2956
- merchant_id: string;
2957
- brand_id: string;
2958
- store_id: string;
2959
- store_uid?: string | null | undefined;
2960
- channel_id: string;
2961
- channel_uid?: string | null | undefined;
2962
- fulfillment_id: string;
2963
- fulfillment_uid?: string | null | undefined;
2964
- name: Record<string, string>;
2965
- description: Record<string, string> | null;
2966
- schedules: {
2967
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
2968
- periods: {
2969
- closed: boolean;
2970
- start_time?: string | undefined;
2971
- end_time?: string | undefined;
2972
- start_date?: string | null | undefined;
2973
- end_date?: string | null | undefined;
2974
- }[];
2975
- }[] | null;
2976
- products: {
2977
- id: string;
2978
- name: Record<string, string>;
2979
- description: Record<string, string> | null;
2980
- image_url: string | null;
2981
- cms_template_id?: string | null | undefined;
2982
- bundled_items: {
2983
- id: string;
2984
- refund_price: number;
2985
- included_quantity: number;
2986
- }[];
2987
- pricing: {
2988
- minimum_quantity: number;
2989
- maximum_quantity: number;
2990
- is_tax_inclusive: boolean;
2991
- tax_rate: number;
2992
- price: number;
2993
- anchor_price?: number | undefined;
2994
- anchor_price_percentage?: number | undefined;
2995
- starting_price?: number | null | undefined;
2996
- modifiers: {
2997
- modifier_group_id: string;
2998
- default_quantity: number;
2999
- charge_above_quantity?: number | null | undefined;
3000
- display_type?: "CHECKBOX" | "QUANTITY" | "RADIO" | null | undefined;
3001
- recommendations: {
3002
- recommendation_id: string;
3003
- default_quantity: number;
3004
- }[];
3005
- minimum_quantity: number;
3006
- maximum_quantity?: number | undefined;
3007
- is_tax_inclusive: boolean;
3008
- tax_rate: number;
3009
- price: number;
3010
- anchor_price?: number | undefined;
3011
- anchor_price_percentage?: number | undefined;
3012
- }[];
3013
- modifier_group_ids: string[];
3014
- variants: {
3015
- product_id: string;
3016
- variant_group_option_ids: string[];
3017
- }[];
3018
- variant_group_ids: string[];
3019
- recommendations: {
3020
- recommendation_id: string;
3021
- default_quantity: number;
3022
- }[];
3023
- recommendations_ids: string[];
3024
- };
3025
- availability: {
3026
- schedules?: {
3027
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3028
- periods: {
3029
- closed: boolean;
3030
- start_time?: string | undefined;
3031
- end_time?: string | undefined;
3032
- start_date?: string | null | undefined;
3033
- end_date?: string | null | undefined;
3034
- }[];
3035
- }[] | null | undefined;
3036
- out_of_stock_until?: string | null | undefined;
3037
- status: "AVAILABLE" | "HIDDEN" | "OUT_OF_STOCK";
3038
- };
3039
- image_origin_url?: string | null | undefined;
3040
- labels: string[];
3041
- tags: Record<string, string | number | boolean>;
3042
- metadata: Record<string, unknown>;
3043
- }[];
3044
- categories: {
3045
- id: string;
3046
- name: Record<string, string>;
3047
- description?: Record<string, string> | null | undefined;
3048
- cms_template_id?: string | null | undefined;
3049
- cms?: {
3050
- id: string;
3051
- merchant_id: string;
3052
- env: string;
3053
- name: string;
3054
- fields: {
3055
- name: string;
3056
- type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
3057
- label?: Record<string, string> | null | undefined;
3058
- required: boolean;
3059
- placeholder?: string | null | undefined;
3060
- options?: {
3061
- label: string;
3062
- value: string;
3063
- }[] | null | undefined;
3064
- altText?: string | null | undefined;
3065
- src?: string | null | undefined;
3066
- href?: string | null | undefined;
3067
- }[];
3068
- entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
3069
- status: string;
3070
- } | null | undefined;
3071
- items: {
3072
- type: "CATEGORY" | "PRODUCT";
3073
- id: string;
3074
- }[];
3075
- availability: {
3076
- schedules?: {
3077
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3078
- periods: {
3079
- closed: boolean;
3080
- start_time?: string | undefined;
3081
- end_time?: string | undefined;
3082
- start_date?: string | null | undefined;
3083
- end_date?: string | null | undefined;
3084
- }[];
3085
- }[] | null | undefined;
3086
- inactive_until?: string | null | undefined;
3087
- status: "ACTIVE" | "HIDDEN" | "INACTIVE";
3088
- };
3089
- image_url: string | null;
3090
- image_origin_url?: string | null | undefined;
3091
- labels: string[];
3092
- tags: Record<string, string | number | boolean>;
3093
- metadata: Record<string, unknown>;
3094
- }[];
3095
- modifier_groups: {
3096
- id: string;
3097
- title: Record<string, string>;
3098
- description?: Record<string, string> | null | undefined;
3099
- display_type?: "GRID" | "LIST" | null | undefined;
3100
- modifier_ids: string[];
3101
- minimum_quantity: number;
3102
- maximum_quantity: number;
3103
- charge_above_quantity?: number | null | undefined;
3104
- metadata: Record<string, unknown>;
3105
- }[];
3106
- variant_groups: {
3107
- id: string;
3108
- title: Record<string, string>;
3109
- description?: Record<string, string> | null | undefined;
3110
- display_type?: "GRID" | "LIST" | null | undefined;
3111
- variants: {
3112
- id: string;
3113
- name: Record<string, string>;
3114
- description?: Record<string, string> | null | undefined;
3115
- image_url?: string | null | undefined;
3116
- image_origin_url?: string | null | undefined;
3117
- product_ids: string[];
3118
- metadata: Record<string, unknown>;
3119
- }[];
3120
- metadata: Record<string, unknown>;
3121
- }[];
3122
- recommendations: ({
3123
- id: string;
3124
- title: Record<string, string>;
3125
- description?: Record<string, string> | null | undefined;
3126
- metadata: Record<string, unknown>;
3127
- target_product_id: string;
3128
- type: "UPSELL";
3129
- } | {
3130
- id: string;
3131
- title: Record<string, string>;
3132
- description?: Record<string, string> | null | undefined;
3133
- metadata: Record<string, unknown>;
3134
- target_product_id: string;
3135
- type: "CROSS_SELL";
3136
- } | {
3137
- id: string;
3138
- title: Record<string, string>;
3139
- description?: Record<string, string> | null | undefined;
3140
- metadata: Record<string, unknown>;
3141
- target_product_id: string;
3142
- type: "DOWNSELL";
3143
- })[];
3144
- metadata: Record<string, unknown>;
3145
- cms_template_id?: string | null | undefined;
3146
- status: string;
3147
- release: string;
3148
- cms?: {
3149
- id: string;
3150
- name: string;
3151
- entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
3152
- status: string;
3153
- fields: {
3154
- name: string;
3155
- type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
3156
- label?: Record<string, string> | null | undefined;
3157
- required: boolean;
3158
- placeholder?: string | null | undefined;
3159
- options?: {
3160
- label: string;
3161
- value: string;
3162
- }[] | null | undefined;
3163
- altText?: string | null | undefined;
3164
- src?: string | null | undefined;
3165
- href?: string | null | undefined;
3166
- value?: unknown;
3167
- }[];
3168
- } | null | undefined;
3169
- }[], any, any>;
652
+ declare const listMenus: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<StorefrontMenu[]>;
653
+ declare const listMenusStream: (scope?: StorefrontMenuScope, options?: ListMenusStreamOptions) => AsyncGenerator<StorefrontMenu[], any, any>;
3170
654
  //#endregion
3171
655
  //#region src/services/payments.d.ts
3172
- declare const listPayments: (input: StorefrontPaymentsListInput, options?: ServiceHttpOptions) => Promise<{
3173
- created_at: string;
3174
- updated_at: string;
3175
- deleted_at: string | null;
3176
- id: string;
3177
- payment_provider_id: string;
3178
- payment_method_id: string;
3179
- rules: {
3180
- minimum_order_value: number;
3181
- maximum_order_value: number;
3182
- }[];
3183
- conditions: ({
3184
- interpretation?: "both" | "client" | "server" | undefined;
3185
- product_id?: string | undefined;
3186
- tag?: string | undefined;
3187
- fulfillment_id: string;
3188
- store_id: string;
3189
- channel_id: string;
3190
- brand_id: string;
3191
- primitive: "string";
3192
- type: "Failure message" | "Order includes product with tag" | "Request path";
3193
- operator: "contains" | "ends with" | "equal to" | "not equal to" | "starts with";
3194
- caseInsensitive?: boolean | undefined;
3195
- value: string;
3196
- invalidMessage?: string | undefined;
3197
- } | {
3198
- interpretation?: "both" | "client" | "server" | undefined;
3199
- product_id?: string | undefined;
3200
- tag?: string | undefined;
3201
- fulfillment_id: string;
3202
- store_id: string;
3203
- channel_id: string;
3204
- brand_id: string;
3205
- primitive: "number";
3206
- type: "API error rate" | "Accumulated events" | "Cart product count" | "Customer age" | "HTTP status" | "Order includes product" | "Order includes product with tag";
3207
- operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
3208
- value: number;
3209
- include_modifiers?: boolean | undefined;
3210
- window_minutes?: number | undefined;
3211
- invalidMessage?: string | undefined;
3212
- } | {
3213
- interpretation?: "both" | "client" | "server" | undefined;
3214
- product_id?: string | undefined;
3215
- tag?: string | undefined;
3216
- fulfillment_id: string;
3217
- store_id: string;
3218
- channel_id: string;
3219
- brand_id: string;
3220
- primitive: "currency";
3221
- type: "Order includes product with tag" | "Order total";
3222
- operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
3223
- value: number;
3224
- invalidMessage?: string | undefined;
3225
- } | {
3226
- interpretation?: "both" | "client" | "server" | undefined;
3227
- product_id?: string | undefined;
3228
- tag?: string | undefined;
3229
- fulfillment_id: string;
3230
- store_id: string;
3231
- channel_id: string;
3232
- brand_id: string;
3233
- primitive: "boolean";
3234
- type: "Customer is anonymous" | "Is anonymous order" | "Order includes product with tag";
3235
- operator: "is" | "is not";
3236
- value: boolean;
3237
- invalidMessage?: string | undefined;
3238
- } | {
3239
- interpretation?: "both" | "client" | "server" | undefined;
3240
- primitive: "enum";
3241
- type: "Payment collect at" | "Payment method" | "Payment status";
3242
- operator: "is" | "is any of" | "is none of" | "is not";
3243
- value: string | string[];
3244
- invalidMessage?: string | undefined;
3245
- } | {
3246
- interpretation?: "both" | "client" | "server" | undefined;
3247
- primitive: "absolute date";
3248
- type: "Today";
3249
- operator: "is" | "is after" | "is before" | "is not";
3250
- value: Date;
3251
- invalidMessage?: string | undefined;
3252
- } | {
3253
- interpretation?: "both" | "client" | "server" | undefined;
3254
- primitive: "relative date";
3255
- type: "Birthday" | "Customer last session" | "Customer last visit" | "Registration";
3256
- operator: "occurred" | "occurred in the last" | "occurred more than";
3257
- value: string;
3258
- invalidMessage?: string | undefined;
3259
- } | {
3260
- interpretation?: "both" | "client" | "server" | undefined;
3261
- primitive: "recurring date";
3262
- type: "Current date";
3263
- operator: "falls within period";
3264
- startDate: Date;
3265
- endDate: Date;
3266
- allDay: boolean;
3267
- repeat: "CUSTOM" | "DAILY" | "FORTNIGHTLY" | "LAST_DAY_OF_MONTH" | "MONTHLY" | "NONE" | "WEEKDAYS" | "WEEKENDS" | "WEEKLY" | "WEEK_OF_MONTH";
3268
- value: string;
3269
- invalidMessage?: string | undefined;
3270
- } | {
3271
- interpretation?: "both" | "client" | "server" | undefined;
3272
- primitive: "custom";
3273
- type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
3274
- operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
3275
- value: string;
3276
- label_ids?: string[] | undefined;
3277
- invalidMessage?: string | undefined;
3278
- })[][];
3279
- status: string;
3280
- provider: {
3281
- id: string;
3282
- provider_id: string;
3283
- name: string;
3284
- logo_url?: string | null | undefined;
3285
- };
3286
- method: {
3287
- id: string;
3288
- method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
3289
- name: string;
3290
- version: string;
3291
- };
3292
- config: Record<string, unknown>;
3293
- has_conditions: boolean;
3294
- }[]>;
656
+ declare const listPayments: (input: StorefrontPaymentsListInput, options?: ServiceHttpOptions) => Promise<MerchantPayment[]>;
657
+ type PaymentOperationBody = {
658
+ order_id: string | null;
659
+ attempt_reference: string | null;
660
+ input: Record<string, unknown>;
661
+ };
662
+ /** Server half of an adapter (`POST /payments/:id/operations/:operation`). */
663
+ declare const callPaymentOperation: <T>(paymentId: string, operation: string, body: PaymentOperationBody, options?: ServiceHttpOptions) => Promise<T>;
664
+ type TerminalFailureBody = {
665
+ operation: string;
666
+ device_id?: string | null;
667
+ error: {
668
+ code: string;
669
+ message: string;
670
+ } & Record<string, unknown>;
671
+ };
672
+ /** Reports a failed terminal operation (`payment.terminal_failed`). */
673
+ declare const reportTerminalFailure: (paymentId: string, body: TerminalFailureBody, options?: ServiceHttpOptions) => Promise<{
674
+ reported: boolean;
675
+ }>;
3295
676
  //#endregion
3296
- //#region src/services/preferences.d.ts
3297
- declare const getPreferences: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<{
3298
- availability: {
3299
- status: "AVAILABLE";
3300
- next_change_at: string | null;
3301
- } | {
3302
- status: "UNAVAILABLE";
3303
- rule: {
3304
- id: string;
3305
- title: string;
3306
- description: string;
3307
- schedule: {
3308
- mode: "IMMEDIATE";
3309
- } | {
3310
- mode: "SCHEDULED";
3311
- start_date: string;
3312
- end_date: string;
3313
- };
3314
- };
3315
- next_change_at: string | null;
3316
- };
3317
- analytics: {
3318
- session: {
3319
- value: number;
3320
- unit: "h" | "min" | "s";
3321
- };
3322
- session_ms: number;
3323
- };
3324
- prep_time: {
3325
- strategy: "PER_ITEM" | "PER_ORDER";
3326
- value: number;
3327
- unit: "min";
3328
- operator?: "eq" | "gt" | "gte" | "lt" | "lte" | undefined;
3329
- preparing?: number | undefined;
3330
- };
3331
- order_rules: {
3332
- order: {
3333
- min_items: number;
3334
- max_items: number;
3335
- min_total: number;
3336
- max_total: number;
3337
- };
3338
- redeems: {
3339
- max_redeems: number;
3340
- max_total: number;
3341
- };
3342
- };
3343
- release: {
3344
- min_version: string | null;
3345
- title: string;
3346
- description: string;
3347
- ios_store_url: string;
3348
- android_store_url: string;
3349
- };
677
+ //#region src/i18n/pos.d.ts
678
+ type PosMessageLocale = "en" | "en-US" | "es" | "pt-BR";
679
+ //#endregion
680
+ //#region src/services/pos.d.ts
681
+ declare const isPosDeviceNotLinked: (error: unknown) => boolean;
682
+ declare const isPosUnauthorized: (error: unknown) => boolean;
683
+ declare const isPosPinLocked: (error: unknown) => boolean;
684
+ declare const localizePosError: (error: unknown, locale?: PosMessageLocale) => string | undefined;
685
+ declare const pairPosDevice: (input: {
686
+ pairing_code: string;
687
+ device_secret: string;
688
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
689
+ declare const relinkPosDevice: (input: {
690
+ relink_code: string;
691
+ device_secret: string;
692
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
693
+ declare const postPosHeartbeat: (input: PosHeartbeatInput, options?: ServiceHttpOptions) => Promise<PosHeartbeatResult>;
694
+ declare const postPosHealthSamples: (input: PosHealthBatchInput, options?: ServiceHttpOptions) => Promise<PosHealthBatchResult>;
695
+ declare const postPosDeviceLogs: (input: unknown, options?: ServiceHttpOptions) => Promise<{
696
+ ok: boolean;
697
+ accepted: number;
3350
698
  }>;
699
+ declare const listPosOperators: (input: {
700
+ device_uid: string;
701
+ device_secret: string;
702
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
703
+ declare const verifyPosOperator: (input: {
704
+ device_uid: string;
705
+ device_secret: string;
706
+ operator_id: string;
707
+ pin: string;
708
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
709
+ declare const listPosAuthorizers: (input: {
710
+ device_uid: string;
711
+ device_secret: string;
712
+ action: string;
713
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
714
+ declare const verifyPosAuthorizer: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
715
+ declare const openPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
716
+ declare const countPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
717
+ declare const withdrawPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
718
+ declare const drawerPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
719
+ declare const closePosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
720
+ declare const shiftEndPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
721
+ /** The device's open caja and its events, or `{ session: null }`. */
722
+ declare const getPosCurrentSession: (input: {
723
+ device_uid: string;
724
+ device_secret: string;
725
+ }, options?: ServiceHttpOptions) => Promise<unknown>;
726
+ declare const listPosKioskOrders: (input: {
727
+ device_uid: string;
728
+ device_secret: string;
729
+ }, options?: ServiceHttpOptions) => Promise<PosKioskOrder[]>;
730
+ /** Safe to retry with the same `client_id`; the server dedupes the settle. */
731
+ declare const settlePosKioskOrder: (input: PosKioskSettleInput, options?: ServiceHttpOptions) => Promise<PosKioskSettleResult>;
732
+ declare const getPosCatalog: (input: {
733
+ device_uid: string;
734
+ device_secret: string;
735
+ }, options?: ServiceHttpOptions) => Promise<PosCatalog>;
736
+ /** Safe to retry with the same `client_id`; the server dedupes the sale. */
737
+ declare const createPosOrder: (input: PosOrderInput, options?: ServiceHttpOptions) => Promise<PosOrderResult>;
738
+ //#endregion
739
+ //#region src/services/preferences.d.ts
740
+ declare const getPreferences: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<StorefrontPreferences>;
3351
741
  //#endregion
3352
742
  //#region src/services/stores.d.ts
3353
743
  /** Active stores of the merchant/env in the access token (one page). */
3354
- declare const listStores: (input?: StoreListInput, options?: ServiceHttpOptions) => Promise<{
3355
- id: string;
3356
- uid: string;
3357
- merchant_id: string;
3358
- brand_id?: string | null | undefined;
3359
- name: string;
3360
- contact: {
3361
- email: string;
3362
- phone: string;
3363
- name?: string | null | undefined;
3364
- };
3365
- location: {
3366
- latitude: number;
3367
- longitude: number;
3368
- address_line_1: string;
3369
- address_line_2?: string | null | undefined;
3370
- city: string;
3371
- country: string;
3372
- postal_code?: string | null | undefined;
3373
- business_name: string;
3374
- unit_number?: string | null | undefined;
3375
- };
3376
- timezone: string;
3377
- instructions?: Record<string, string> | null | undefined;
3378
- availability: {
3379
- schedules: {
3380
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3381
- periods: {
3382
- closed: boolean;
3383
- start_time?: string | undefined;
3384
- end_time?: string | undefined;
3385
- start_date?: string | null | undefined;
3386
- end_date?: string | null | undefined;
3387
- }[];
3388
- }[] | null;
3389
- temporary_closed_reason?: Record<string, string> | null | undefined;
3390
- temporary_closed_until?: string | null | undefined;
3391
- status: "CLOSED" | "OPEN" | "TEMPORARILY_CLOSED";
3392
- };
3393
- channel_ids: string[];
3394
- fulfillment_ids: string[];
3395
- tags: Record<string, string | number | boolean>;
3396
- cms_template_id?: string | null | undefined;
3397
- status: string;
3398
- coverage_zones: {
3399
- id: string;
3400
- name: string;
3401
- type: "POLYGON" | "RADIUS";
3402
- radius_info?: {
3403
- latitude: number;
3404
- longitude: number;
3405
- radius: number;
3406
- } | null | undefined;
3407
- polygon_info?: {
3408
- polygon: {
3409
- latitude: number;
3410
- longitude: number;
3411
- }[];
3412
- } | null | undefined;
3413
- schedules: {
3414
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3415
- periods: {
3416
- closed: boolean;
3417
- start_time?: string | undefined;
3418
- end_time?: string | undefined;
3419
- start_date?: string | null | undefined;
3420
- end_date?: string | null | undefined;
3421
- }[];
3422
- }[] | null;
3423
- labels: string[];
3424
- tags: Record<string, string | number | boolean>;
3425
- status: string;
3426
- }[];
3427
- cms?: {
3428
- id: string;
3429
- name: string;
3430
- entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
3431
- status: string;
3432
- fields: {
3433
- name: string;
3434
- type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
3435
- label?: Record<string, string> | null | undefined;
3436
- required: boolean;
3437
- placeholder?: string | null | undefined;
3438
- options?: {
3439
- label: string;
3440
- value: string;
3441
- }[] | null | undefined;
3442
- altText?: string | null | undefined;
3443
- src?: string | null | undefined;
3444
- href?: string | null | undefined;
3445
- value?: unknown;
3446
- }[];
3447
- } | null | undefined;
3448
- labels: string[];
3449
- }[]>;
3450
- declare const listNearbyStores: (input: StoreNearbyInput, options?: ServiceHttpOptions) => Promise<{
3451
- id: string;
3452
- uid: string;
3453
- merchant_id: string;
3454
- brand_id?: string | null | undefined;
3455
- name: string;
3456
- contact: {
3457
- email: string;
3458
- phone: string;
3459
- name?: string | null | undefined;
3460
- };
3461
- location: {
3462
- latitude: number;
3463
- longitude: number;
3464
- address_line_1: string;
3465
- address_line_2?: string | null | undefined;
3466
- city: string;
3467
- country: string;
3468
- postal_code?: string | null | undefined;
3469
- business_name: string;
3470
- unit_number?: string | null | undefined;
3471
- };
3472
- timezone: string;
3473
- instructions?: Record<string, string> | null | undefined;
3474
- availability: {
3475
- schedules: {
3476
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3477
- periods: {
3478
- closed: boolean;
3479
- start_time?: string | undefined;
3480
- end_time?: string | undefined;
3481
- start_date?: string | null | undefined;
3482
- end_date?: string | null | undefined;
3483
- }[];
3484
- }[] | null;
3485
- temporary_closed_reason?: Record<string, string> | null | undefined;
3486
- temporary_closed_until?: string | null | undefined;
3487
- status: "CLOSED" | "OPEN" | "TEMPORARILY_CLOSED";
3488
- };
3489
- channel_ids: string[];
3490
- fulfillment_ids: string[];
3491
- tags: Record<string, string | number | boolean>;
3492
- cms_template_id?: string | null | undefined;
3493
- status: string;
3494
- coverage_zones: {
3495
- id: string;
3496
- name: string;
3497
- type: "POLYGON" | "RADIUS";
3498
- radius_info?: {
3499
- latitude: number;
3500
- longitude: number;
3501
- radius: number;
3502
- } | null | undefined;
3503
- polygon_info?: {
3504
- polygon: {
3505
- latitude: number;
3506
- longitude: number;
3507
- }[];
3508
- } | null | undefined;
3509
- schedules: {
3510
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3511
- periods: {
3512
- closed: boolean;
3513
- start_time?: string | undefined;
3514
- end_time?: string | undefined;
3515
- start_date?: string | null | undefined;
3516
- end_date?: string | null | undefined;
3517
- }[];
3518
- }[] | null;
3519
- labels: string[];
3520
- tags: Record<string, string | number | boolean>;
3521
- status: string;
3522
- }[];
3523
- cms?: {
3524
- id: string;
3525
- name: string;
3526
- entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
3527
- status: string;
3528
- fields: {
3529
- name: string;
3530
- type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
3531
- label?: Record<string, string> | null | undefined;
3532
- required: boolean;
3533
- placeholder?: string | null | undefined;
3534
- options?: {
3535
- label: string;
3536
- value: string;
3537
- }[] | null | undefined;
3538
- altText?: string | null | undefined;
3539
- src?: string | null | undefined;
3540
- href?: string | null | undefined;
3541
- value?: unknown;
3542
- }[];
3543
- } | null | undefined;
3544
- labels: string[];
3545
- }[]>;
3546
- declare const getStore: (id: string, input?: StoreGetInput, options?: ServiceHttpOptions) => Promise<{
3547
- id: string;
3548
- uid: string;
3549
- merchant_id: string;
3550
- brand_id?: string | null | undefined;
3551
- name: string;
3552
- contact: {
3553
- email: string;
3554
- phone: string;
3555
- name?: string | null | undefined;
3556
- };
3557
- location: {
3558
- latitude: number;
3559
- longitude: number;
3560
- address_line_1: string;
3561
- address_line_2?: string | null | undefined;
3562
- city: string;
3563
- country: string;
3564
- postal_code?: string | null | undefined;
3565
- business_name: string;
3566
- unit_number?: string | null | undefined;
3567
- };
3568
- timezone: string;
3569
- instructions?: Record<string, string> | null | undefined;
3570
- availability: {
3571
- schedules: {
3572
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3573
- periods: {
3574
- closed: boolean;
3575
- start_time?: string | undefined;
3576
- end_time?: string | undefined;
3577
- start_date?: string | null | undefined;
3578
- end_date?: string | null | undefined;
3579
- }[];
3580
- }[] | null;
3581
- temporary_closed_reason?: Record<string, string> | null | undefined;
3582
- temporary_closed_until?: string | null | undefined;
3583
- status: "CLOSED" | "OPEN" | "TEMPORARILY_CLOSED";
3584
- };
3585
- channel_ids: string[];
3586
- fulfillment_ids: string[];
3587
- tags: Record<string, string | number | boolean>;
3588
- cms_template_id?: string | null | undefined;
3589
- status: string;
3590
- coverage_zones: {
3591
- id: string;
3592
- name: string;
3593
- type: "POLYGON" | "RADIUS";
3594
- radius_info?: {
3595
- latitude: number;
3596
- longitude: number;
3597
- radius: number;
3598
- } | null | undefined;
3599
- polygon_info?: {
3600
- polygon: {
3601
- latitude: number;
3602
- longitude: number;
3603
- }[];
3604
- } | null | undefined;
3605
- schedules: {
3606
- day_of_week: "friday" | "monday" | "saturday" | "sunday" | "thursday" | "tuesday" | "wednesday";
3607
- periods: {
3608
- closed: boolean;
3609
- start_time?: string | undefined;
3610
- end_time?: string | undefined;
3611
- start_date?: string | null | undefined;
3612
- end_date?: string | null | undefined;
3613
- }[];
3614
- }[] | null;
3615
- labels: string[];
3616
- tags: Record<string, string | number | boolean>;
3617
- status: string;
3618
- }[];
3619
- cms?: {
3620
- id: string;
3621
- name: string;
3622
- entity: "BRANDS" | "CATEGORIES" | "CHANNELS" | "MENUS" | "PRODUCTS" | "STORES";
3623
- status: string;
3624
- fields: {
3625
- name: string;
3626
- type: "IMAGE" | "LIST" | "SELECT" | "TEXT";
3627
- label?: Record<string, string> | null | undefined;
3628
- required: boolean;
3629
- placeholder?: string | null | undefined;
3630
- options?: {
3631
- label: string;
3632
- value: string;
3633
- }[] | null | undefined;
3634
- altText?: string | null | undefined;
3635
- src?: string | null | undefined;
3636
- href?: string | null | undefined;
3637
- value?: unknown;
3638
- }[];
3639
- } | null | undefined;
3640
- labels: string[];
3641
- }>;
744
+ declare const listStores: (input?: StoreListInput, options?: ServiceHttpOptions) => Promise<Store[]>;
745
+ declare const listNearbyStores: (input: StoreNearbyInput, options?: ServiceHttpOptions) => Promise<Store[]>;
746
+ declare const getStore: (id: string, input?: StoreGetInput, options?: ServiceHttpOptions) => Promise<Store>;
3642
747
  //#endregion
3643
748
  //#region src/services/index.d.ts
3644
749
  declare const services: {
@@ -3676,11 +781,14 @@ declare const services: {
3676
781
  reorder: typeof reorderOrder;
3677
782
  validate: typeof validateOrder;
3678
783
  place: typeof placeOrder;
784
+ recordPayment: typeof recordOrderPayment;
3679
785
  getFulfillment: typeof getOrderFulfillment;
3680
786
  listFulfillments: typeof listOrderFulfillments;
3681
787
  };
3682
788
  payments: {
3683
789
  list: typeof listPayments;
790
+ operation: typeof callPaymentOperation;
791
+ terminalFailure: typeof reportTerminalFailure;
3684
792
  };
3685
793
  stores: {
3686
794
  list: typeof listStores;
@@ -3700,6 +808,32 @@ declare const services: {
3700
808
  isDeviceNotLinked: typeof isDeviceNotLinked;
3701
809
  isKioskUnauthorized: typeof isKioskUnauthorized;
3702
810
  };
811
+ pos: {
812
+ pair: typeof pairPosDevice;
813
+ relink: typeof relinkPosDevice;
814
+ heartbeat: typeof postPosHeartbeat;
815
+ postHealthSamples: typeof postPosHealthSamples;
816
+ postLogs: typeof postPosDeviceLogs;
817
+ listOperators: typeof listPosOperators;
818
+ verifyOperator: typeof verifyPosOperator;
819
+ listAuthorizers: typeof listPosAuthorizers;
820
+ verifyAuthorizer: typeof verifyPosAuthorizer;
821
+ openSession: typeof openPosSession;
822
+ countSession: typeof countPosSession;
823
+ withdraw: typeof withdrawPosSession;
824
+ drawer: typeof drawerPosSession;
825
+ closeSession: typeof closePosSession;
826
+ shiftEnd: typeof shiftEndPosSession;
827
+ currentSession: typeof getPosCurrentSession;
828
+ listKioskOrders: typeof listPosKioskOrders;
829
+ settleKioskOrder: typeof settlePosKioskOrder;
830
+ getCatalog: typeof getPosCatalog;
831
+ createOrder: typeof createPosOrder;
832
+ isDeviceNotLinked: typeof isPosDeviceNotLinked;
833
+ isUnauthorized: typeof isPosUnauthorized;
834
+ isPinLocked: typeof isPosPinLocked;
835
+ localizeError: typeof localizePosError;
836
+ };
3703
837
  };
3704
838
  //#endregion
3705
839
  //#region src/schedule/schedule.d.ts
@@ -3714,6 +848,29 @@ type ScheduleWindow = {
3714
848
  declare const getScheduleWindow: (schedule: Schedule | null | undefined, now?: Date) => ScheduleWindow;
3715
849
  declare const isOnSchedule: (schedule: Schedule | null | undefined, now?: Date) => boolean;
3716
850
  //#endregion
851
+ //#region src/logs/context.d.ts
852
+ declare const getLogContext: () => SdkLogContext;
853
+ //#endregion
854
+ //#region src/logs/log.d.ts
855
+ /** Sends queued logs now; resolves once every batch has been attempted. */
856
+ declare const flushLogs: () => Promise<void>;
857
+ /**
858
+ * Reports a log to the merchant dashboard with the SDK's current context
859
+ * (channel, fulfillment, store, brand, device). Never throws; resolves to
860
+ * `false` when the log could not be delivered.
861
+ */
862
+ declare const log: (level: SdkLogLevel, message: string, options?: SdkLogOptions) => Promise<boolean>;
863
+ /** `log("error", …)` with message, name, stack and cause read from `error`. */
864
+ declare const logError: (error: unknown, options?: SdkLogOptions) => Promise<boolean>;
865
+ //#endregion
866
+ //#region src/logs/serializeError.d.ts
867
+ type SerializedError = {
868
+ message: string;
869
+ error: SdkLogErrorInfo;
870
+ };
871
+ /** Accepts anything a `catch` can receive. */
872
+ declare const serializeError: (value: unknown) => SerializedError;
873
+ //#endregion
3717
874
  //#region src/shared/genId.d.ts
3718
875
  type IdBuilder = {
3719
876
  /**
@@ -3857,4 +1014,77 @@ declare const paymentMatchesClientConditions: (conditions: OrConditions | null |
3857
1014
  now?: string;
3858
1015
  }) => boolean;
3859
1016
  //#endregion
3860
- export { type ApplyRedeemInput, type AuthConfigureOptions, type CreateOrderOptions, type CreateSessionOptions, type CustomizationPath, type CustomizationSession, DEFAULT_RECOMMENDATION_TYPES, type ExchangeOptions, type FlatMenuCategory, type GroupDisplayType, type IdBuilder, 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 RemoveRedeemInput, type ReorderOrderOptions, type ResetOptions, RulesEngine, type ScheduleWindow, type SelectionStatus, type SelectionsByPath, type ServiceHttpOptions, type Snapshot, type StorefrontAccessToken, StorefrontHttpError, type TrackWorkflow, type ValidateOptions, type ValidateOrderAgainstMenuInput, type Variant, type VariantGroup, type VariantGroupCtx, type VariantOptionCtx, type VariantSelection, type VisitedState, addLines, auth, buildCustomerSnapshot, collectOrderLineDiffs, computeStartingPrice, countCartProducts, createSession, currentNodes, defaultConditionError, flattenMenuCategories, fromOrderLines, genId, genOrderId, getScheduleWindow, indexMenu, isCheckoutFieldFilled, isDeviceNotLinked, isKioskUnauthorized, isMilestoneStepDone, isOnSchedule, isOrderValidationError, isStorefrontNotFound, isVariantBase, listMenusStream, matchAbsoluteDateOperator, matchBooleanOperator, matchCurrencyOperator, matchEnumOperator, matchNumberOperator, matchRecurringDateOperator, matchRelativeDateOperator, matchStringOperator, milestoneSteps, milestoneTrack, nestMenuCategories, paymentMatchesClientConditions, recomputeRedemptions, recomputeTotals, resolveCheckout, services, storefrontJson, toOrderLines, validateOrderAgainstMenu, visitedStates };
1017
+ //#region src/card/card.types.d.ts
1018
+ type CardBrand = "visa" | "mastercard" | "amex" | "diners" | "discover" | "jcb" | "unionpay" | "unknown";
1019
+ /** Brands accepted by the customer `payments[].brand` contract. */
1020
+ type PaymentCardBrand = "visa" | "mastercard" | "amex" | "diners" | "discover" | "other";
1021
+ interface CardBrandSpec {
1022
+ brand: CardBrand;
1023
+ label: string;
1024
+ pattern: RegExp;
1025
+ /** Valid PAN lengths, ascending. */
1026
+ lengths: number[];
1027
+ /** Digit indexes where a space is inserted (e.g. `[4, 10]` for 4-6-5). */
1028
+ gaps: number[];
1029
+ /** Valid CVC lengths, ascending. */
1030
+ cvcLengths: number[];
1031
+ }
1032
+ type CardNumberError = "required" | "incomplete" | "invalid";
1033
+ type CardExpiryError = "required" | "incomplete" | "invalid_month" | "expired" | "too_far";
1034
+ type CardCvcError = "required" | "incomplete";
1035
+ type CardholderNameError = "required" | "too_short" | "too_long" | "invalid_chars";
1036
+ interface CardExpiry {
1037
+ month: number;
1038
+ /** Four-digit year. */
1039
+ year: number;
1040
+ }
1041
+ interface CardPreviewSlot {
1042
+ /** Digit, `•` for masked digits, or empty when not typed yet. */
1043
+ char: string;
1044
+ filled: boolean;
1045
+ }
1046
+ //#endregion
1047
+ //#region src/card/card.d.ts
1048
+ /** Detection order matters: narrower prefixes first. */
1049
+ declare const CARD_BRANDS: readonly CardBrandSpec[];
1050
+ declare const cardDigits: (value: string) => string;
1051
+ /** Mod-10 checksum. Expects digits only (non-digits are ignored). */
1052
+ declare const luhnCheck: (value: string) => boolean;
1053
+ declare const cardBrandSpec: (brand: CardBrand) => CardBrandSpec;
1054
+ /** Brand from the typed prefix; `unknown` until the prefix is unambiguous. */
1055
+ declare const detectCardBrand: (value: string) => CardBrand;
1056
+ declare const toPaymentCardBrand: (brand: CardBrand) => PaymentCardBrand;
1057
+ declare const cardNumberMaxLength: (brand: CardBrand) => number;
1058
+ /** Space positions for a PAN of `length` digits (Diners 14 → 4-6-4). */
1059
+ declare const cardNumberGaps: (brand: CardBrand, length: number) => number[];
1060
+ /** Digits only, capped to the brand max length, grouped with spaces. */
1061
+ declare const formatCardNumber: (value: string) => string;
1062
+ /** Caret index in `formatted` right after its `digitCount`-th digit. */
1063
+ declare const caretAfterDigits: (formatted: string, digitCount: number) => number;
1064
+ declare const validateCardNumber: (value: string) => CardNumberError | null;
1065
+ /** Ready to move focus on: a valid length for the brand that passes Luhn. */
1066
+ declare const isCardNumberComplete: (value: string) => boolean;
1067
+ /** Full-length PAN that fails Luhn — safe to flag while the user types. */
1068
+ declare const isCardNumberDefinitelyInvalid: (value: string) => boolean;
1069
+ /**
1070
+ * `MM/YY` as the user types or pastes: `4` → `04`, `13` → `01/3`,
1071
+ * `12/2030` → `12/30`. The slash only appears once a year digit exists so
1072
+ * backspace never gets stuck.
1073
+ */
1074
+ declare const formatExpiry: (value: string) => string;
1075
+ declare const parseExpiry: (value: string) => CardExpiry | null;
1076
+ declare const isExpiryComplete: (value: string) => boolean;
1077
+ declare const validateExpiry: (value: string, now?: Date) => CardExpiryError | null;
1078
+ declare const cvcMaxLength: (brand: CardBrand) => number;
1079
+ declare const formatCvc: (value: string, brand: CardBrand) => string;
1080
+ declare const validateCvc: (value: string, brand: CardBrand) => CardCvcError | null;
1081
+ declare const isCvcComplete: (value: string, brand: CardBrand) => boolean;
1082
+ declare const normalizeCardholderName: (value: string) => string;
1083
+ declare const validateCardholderName: (value: string) => CardholderNameError | null;
1084
+ /**
1085
+ * Digit slots for a card preview, grouped like the formatted number. Middle
1086
+ * digits are masked as `•`; first and last groups stay readable.
1087
+ */
1088
+ declare const cardPreviewGroups: (value: string) => CardPreviewSlot[][];
1089
+ //#endregion
1090
+ export { type ApplyRedeemInput, type AuthConfigureOptions, CARD_BRANDS, type CardBrand, type CardBrandSpec, type CardCvcError, type CardExpiry, type CardExpiryError, type CardNumberError, type CardPreviewSlot, type CardholderNameError, type CreateOrderOptions, type CreateSessionOptions, type CustomizationPath, type CustomizationSession, DEFAULT_RECOMMENDATION_TYPES, type ExchangeOptions, type FlatMenuCategory, type GroupDisplayType, type IdBuilder, 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 PayOptions, type PaymentCardBrand, type PaymentRunOptions, type PaymentSessionOptions, type PricingModifier, type Product, type ProductCtx, type QuantitiesByPath, type RecommendationType, RecurringDateCron, type RemoveRedeemInput, type ReorderOrderOptions, type ResetOptions, type ReversalOutcome, RulesEngine, type ScheduleWindow, type SelectionStatus, type SelectionsByPath, type SerializedError, type ServiceHttpOptions, type Snapshot, type StorefrontAccessToken, StorefrontHttpError, type TrackWorkflow, type ValidateOptions, type ValidateOrderAgainstMenuInput, type Variant, type VariantGroup, type VariantGroupCtx, type VariantOptionCtx, type VariantSelection, type VisitedState, addLines, auth, buildCustomerSnapshot, cardBrandSpec, cardDigits, cardNumberGaps, cardNumberMaxLength, cardPreviewGroups, caretAfterDigits, collectOrderLineDiffs, computeStartingPrice, countCartProducts, coveredAmount, createSession, currentNodes, cvcMaxLength, defaultConditionError, detectCardBrand, flattenMenuCategories, flushLogs, formatCardNumber, formatCvc, formatExpiry, fromOrderLines, genId, genOrderId, getLogContext, getScheduleWindow, indexMenu, isCardNumberComplete, isCardNumberDefinitelyInvalid, isCheckoutFieldFilled, isCvcComplete, isDeviceNotLinked, isExpiryComplete, isKioskUnauthorized, isMilestoneStepDone, isOnSchedule, isOrderValidationError, isPosDeviceNotLinked, isPosUnauthorized, isStorefrontNotFound, isVariantBase, listMenusStream, localizePosError, log, logError, luhnCheck, matchAbsoluteDateOperator, matchBooleanOperator, matchCurrencyOperator, matchEnumOperator, matchNumberOperator, matchRecurringDateOperator, matchRelativeDateOperator, matchStringOperator, milestoneSteps, milestoneTrack, nestMenuCategories, normalizeCardholderName, parseExpiry, paymentMatchesClientConditions, recomputeRedemptions, recomputeTotals, remainingAmount, removeLine, replaceLine, resolveCheckout, reversePayment, runPaymentAttempt, serializeError, services, setLineQuantity, storefrontJson, toOrderLines, toPaymentCardBrand, validateCardNumber, validateCardholderName, validateCvc, validateExpiry, validateOrderAgainstMenu, visitedStates };