@fire-spark/core 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +758 -35
- package/dist/index.js +2654 -362
- package/package.json +8 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PaymentAdapter, PaymentCollectAt, PaymentContext, PaymentResult, PaymentStorage, PaymentUI } from "@fire-spark/payments";
|
|
2
|
+
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, MerchantPayment, ModifierControlType, ModifierGroup, OrConditions, Order as Order$1, Order as Order$2, OrderInsertInput, OrderLine, OrderListInput, OrderRecordPaymentInput, OrderRedeem, OrderRedemptionStep, OrderReorderInput, OrderTotals, OrderUpdateInput, OrderValidateInput, OrderValidateOutput, PaymentIntentInput, PaymentMethod, PaymentProvider, 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, StoreGetInput, StoreListInput, StoreNearbyInput, StorefrontAvailability, StorefrontMenuScope, StorefrontMenuStreamOptions, StorefrontPaymentsListInput, Variant, VariantGroup } from "@fire-spark/types";
|
|
3
|
+
import { Big } from "big.js";
|
|
2
4
|
//#region src/productCustomization/types.d.ts
|
|
3
5
|
type SelectionStatus = "IDLE" | "INCOMPLETE" | "VALID" | "INVALID";
|
|
6
|
+
type StartingPriceCache = Map<string, Big>;
|
|
4
7
|
type CustomizationPath = string;
|
|
5
8
|
type QuantitiesByPath = Record<CustomizationPath, number>;
|
|
9
|
+
type SelectionsByPath = Record<CustomizationPath, VariantSelection>;
|
|
6
10
|
interface Snapshot {
|
|
7
11
|
productId: string;
|
|
8
12
|
quantities: QuantitiesByPath;
|
|
13
|
+
/** Variant picks of modifiers whose product is a variant base. */
|
|
14
|
+
variants?: SelectionsByPath;
|
|
9
15
|
}
|
|
10
16
|
interface CreateSessionOptions {
|
|
11
17
|
initial?: QuantitiesByPath;
|
|
@@ -50,12 +56,40 @@ interface ModifierCtx {
|
|
|
50
56
|
status: SelectionStatus;
|
|
51
57
|
data: Product;
|
|
52
58
|
type: ModifierControlType;
|
|
59
|
+
/** Nested customization; for a variant base, the resolved variant (or the
|
|
60
|
+
* base while options are pending). */
|
|
53
61
|
product: ProductCtx | null;
|
|
62
|
+
/** Variant questions when `data` is a variant base; empty otherwise. */
|
|
63
|
+
variants: VariantGroupCtx[];
|
|
64
|
+
/** Product that is ordered: `data`, the resolved variant, or null while a
|
|
65
|
+
* variant base still has unanswered options. */
|
|
66
|
+
resolved: Product | null;
|
|
54
67
|
onChange: (quantity: number) => void;
|
|
55
68
|
linePrice: number;
|
|
56
69
|
}
|
|
70
|
+
/** Variant group id → chosen variant (option) id. */
|
|
71
|
+
type VariantSelection = Record<string, string>;
|
|
72
|
+
interface VariantOptionCtx {
|
|
73
|
+
path: CustomizationPath;
|
|
74
|
+
data: Variant;
|
|
75
|
+
selected: boolean;
|
|
76
|
+
disabled: boolean;
|
|
77
|
+
select: () => void;
|
|
78
|
+
}
|
|
79
|
+
interface VariantGroupCtx {
|
|
80
|
+
path: CustomizationPath;
|
|
81
|
+
data: VariantGroup;
|
|
82
|
+
selectedId: string | null;
|
|
83
|
+
status: SelectionStatus;
|
|
84
|
+
options: VariantOptionCtx[];
|
|
85
|
+
}
|
|
57
86
|
interface CustomizationSession {
|
|
87
|
+
/** Resolved product; the base selector until every variant group is chosen. */
|
|
58
88
|
root: ProductCtx;
|
|
89
|
+
/** Product carrying variant_group_ids, or null for plain products. */
|
|
90
|
+
base: Product | null;
|
|
91
|
+
/** Rendered before modifier groups; empty for plain products. */
|
|
92
|
+
variants: VariantGroupCtx[];
|
|
59
93
|
subscribe: (listener: () => void) => () => void;
|
|
60
94
|
snapshot: () => Snapshot;
|
|
61
95
|
totalPrice: () => number;
|
|
@@ -100,10 +134,18 @@ declare const fromOrderLines: (root: OrderLine, lines: OrderLine[], lookup: Menu
|
|
|
100
134
|
//#region src/productCustomization/menu.d.ts
|
|
101
135
|
declare const indexMenu: (menu: Menu$1) => MenuLookup$1;
|
|
102
136
|
//#endregion
|
|
137
|
+
//#region src/productCustomization/startingPrice.d.ts
|
|
138
|
+
/** Lowest unit price reachable while satisfying every required modifier.
|
|
139
|
+
* For a variant base, the cheapest of its variant products. */
|
|
140
|
+
declare const computeStartingPrice: (lookup: MenuLookup$1, product: Product$1, cache?: StartingPriceCache) => number;
|
|
141
|
+
//#endregion
|
|
103
142
|
//#region src/productCustomization/toOrderLines.d.ts
|
|
104
143
|
/** Flatten a customized product tree into priced OrderLine rows. */
|
|
105
144
|
declare const toOrderLines: (root: ProductCtx, locale: string) => OrderLine[];
|
|
106
145
|
//#endregion
|
|
146
|
+
//#region src/productCustomization/variants.d.ts
|
|
147
|
+
declare const isVariantBase: (product: Product$1) => boolean;
|
|
148
|
+
//#endregion
|
|
107
149
|
//#region src/shared/baseUrl.d.ts
|
|
108
150
|
declare const resolveBaseUrl: (baseUrl?: string) => string;
|
|
109
151
|
//#endregion
|
|
@@ -319,8 +361,9 @@ declare const listOrders: (input?: OrderListInput, options?: ServiceHttpOptions)
|
|
|
319
361
|
};
|
|
320
362
|
payment_intents: {
|
|
321
363
|
id?: string | undefined;
|
|
322
|
-
|
|
323
|
-
|
|
364
|
+
payment_id?: string | undefined;
|
|
365
|
+
method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
|
|
366
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
324
367
|
collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
|
|
325
368
|
status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
|
|
326
369
|
totals: {
|
|
@@ -491,8 +534,9 @@ declare const createOrder: (body: OrderInsertInput, options?: ServiceHttpOptions
|
|
|
491
534
|
};
|
|
492
535
|
payment_intents: {
|
|
493
536
|
id?: string | undefined;
|
|
494
|
-
|
|
495
|
-
|
|
537
|
+
payment_id?: string | undefined;
|
|
538
|
+
method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
|
|
539
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
496
540
|
collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
|
|
497
541
|
status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
|
|
498
542
|
totals: {
|
|
@@ -663,8 +707,9 @@ declare const getOrder: (id: string, options?: ServiceHttpOptions) => Promise<{
|
|
|
663
707
|
};
|
|
664
708
|
payment_intents: {
|
|
665
709
|
id?: string | undefined;
|
|
666
|
-
|
|
667
|
-
|
|
710
|
+
payment_id?: string | undefined;
|
|
711
|
+
method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
|
|
712
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
668
713
|
collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
|
|
669
714
|
status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
|
|
670
715
|
totals: {
|
|
@@ -699,6 +744,7 @@ declare const getOrder: (id: string, options?: ServiceHttpOptions) => Promise<{
|
|
|
699
744
|
}>;
|
|
700
745
|
type PlaceOrderInput = {
|
|
701
746
|
payment?: {
|
|
747
|
+
id?: string;
|
|
702
748
|
type?: PaymentMethod;
|
|
703
749
|
provider?: PaymentProvider;
|
|
704
750
|
intents?: PaymentIntentInput[];
|
|
@@ -709,6 +755,180 @@ declare const placeOrder: (id: string, body?: PlaceOrderInput, options?: Service
|
|
|
709
755
|
order_fulfillment_id: string;
|
|
710
756
|
status: "ACCEPTED" | "EXISTS" | "IN_PROGRESS";
|
|
711
757
|
}>;
|
|
758
|
+
/** Records (or updates by `metadata.attempt_reference`) one payment intent. */
|
|
759
|
+
declare const recordOrderPayment: (id: string, body: OrderRecordPaymentInput, options?: ServiceHttpOptions) => Promise<{
|
|
760
|
+
uid: string;
|
|
761
|
+
id: string;
|
|
762
|
+
brand_id?: string | null | undefined;
|
|
763
|
+
store_id: string;
|
|
764
|
+
channel_id: string;
|
|
765
|
+
customer_id: string;
|
|
766
|
+
fulfillment_id: string;
|
|
767
|
+
is_anonymous: boolean;
|
|
768
|
+
lines: {
|
|
769
|
+
type: "FEE" | "PRODUCT";
|
|
770
|
+
uid: string;
|
|
771
|
+
id: string;
|
|
772
|
+
parent_uid: string | null;
|
|
773
|
+
parent_id: string | null;
|
|
774
|
+
name: string;
|
|
775
|
+
image_url?: string | undefined;
|
|
776
|
+
menu_id?: string | undefined;
|
|
777
|
+
internal_attribution_source?: string | undefined;
|
|
778
|
+
internal_attribution_id?: string | undefined;
|
|
779
|
+
metadata: Record<string, unknown>;
|
|
780
|
+
bundled_items: {
|
|
781
|
+
id: string;
|
|
782
|
+
refund_price: number;
|
|
783
|
+
included_quantity: number;
|
|
784
|
+
}[];
|
|
785
|
+
redeem: {
|
|
786
|
+
reward_id: string;
|
|
787
|
+
quantity: number;
|
|
788
|
+
discount_rate?: number | undefined;
|
|
789
|
+
discount_amount?: number | undefined;
|
|
790
|
+
expires_at?: string | undefined;
|
|
791
|
+
}[];
|
|
792
|
+
quantity: number;
|
|
793
|
+
tax_rate: number | null;
|
|
794
|
+
discount_rate: number;
|
|
795
|
+
unit_subtotal: number;
|
|
796
|
+
unit_discount: number;
|
|
797
|
+
unit_tax_total: number;
|
|
798
|
+
unit_total: number;
|
|
799
|
+
subtotal: number;
|
|
800
|
+
discount_total: number;
|
|
801
|
+
tax_total: number;
|
|
802
|
+
total: number;
|
|
803
|
+
unit_group_subtotal: number;
|
|
804
|
+
unit_group_discount: number;
|
|
805
|
+
unit_group_tax_total: number;
|
|
806
|
+
unit_group_total: number;
|
|
807
|
+
group_subtotal: number;
|
|
808
|
+
group_discount: number;
|
|
809
|
+
group_tax_total: number;
|
|
810
|
+
group_total: number;
|
|
811
|
+
}[];
|
|
812
|
+
redeem: {
|
|
813
|
+
reward_id: string;
|
|
814
|
+
quantity: number;
|
|
815
|
+
discount_rate?: number | undefined;
|
|
816
|
+
discount_amount?: number | undefined;
|
|
817
|
+
expires_at?: string | undefined;
|
|
818
|
+
}[];
|
|
819
|
+
redemption_steps: {
|
|
820
|
+
reward_id: string;
|
|
821
|
+
reward_quantity: number;
|
|
822
|
+
target: "LINE" | "ORDER";
|
|
823
|
+
target_id?: string | undefined;
|
|
824
|
+
action: "CREATE" | "DELETE" | "READ" | "UPDATE";
|
|
825
|
+
discount_amount: number;
|
|
826
|
+
before: {
|
|
827
|
+
value: number;
|
|
828
|
+
quantity: number;
|
|
829
|
+
discount_amount: number;
|
|
830
|
+
discount_rate: number;
|
|
831
|
+
};
|
|
832
|
+
after: {
|
|
833
|
+
value: number;
|
|
834
|
+
quantity: number;
|
|
835
|
+
discount_amount: number;
|
|
836
|
+
discount_rate: number;
|
|
837
|
+
};
|
|
838
|
+
target_before?: {
|
|
839
|
+
value: number;
|
|
840
|
+
quantity: number;
|
|
841
|
+
discount_amount: number;
|
|
842
|
+
discount_rate: number;
|
|
843
|
+
} | undefined;
|
|
844
|
+
target_after?: {
|
|
845
|
+
value: number;
|
|
846
|
+
quantity: number;
|
|
847
|
+
discount_amount: number;
|
|
848
|
+
discount_rate: number;
|
|
849
|
+
} | undefined;
|
|
850
|
+
error?: string | undefined;
|
|
851
|
+
}[];
|
|
852
|
+
customer: {
|
|
853
|
+
customer_info: {
|
|
854
|
+
display_name: string;
|
|
855
|
+
first_name: string;
|
|
856
|
+
middle_name?: string | undefined;
|
|
857
|
+
last_name: string;
|
|
858
|
+
second_last_name?: string | undefined;
|
|
859
|
+
email: string;
|
|
860
|
+
phone: string;
|
|
861
|
+
gender?: "FEMALE" | "MALE" | undefined;
|
|
862
|
+
dob?: string | undefined;
|
|
863
|
+
document_type?: "CI" | "DNI" | "OTHER" | "PASSPORT" | "RUC" | undefined;
|
|
864
|
+
document_number?: string | undefined;
|
|
865
|
+
city?: string | undefined;
|
|
866
|
+
country?: string | undefined;
|
|
867
|
+
};
|
|
868
|
+
address_info?: {
|
|
869
|
+
address_line1: string;
|
|
870
|
+
address_line2?: string | undefined;
|
|
871
|
+
city?: string | undefined;
|
|
872
|
+
state?: string | undefined;
|
|
873
|
+
zip?: string | undefined;
|
|
874
|
+
country?: string | undefined;
|
|
875
|
+
reference?: string | undefined;
|
|
876
|
+
latitude?: number | undefined;
|
|
877
|
+
longitude?: number | undefined;
|
|
878
|
+
instructions?: string | undefined;
|
|
879
|
+
metadata: Record<string, unknown> | null;
|
|
880
|
+
} | null | undefined;
|
|
881
|
+
billing_info?: {
|
|
882
|
+
type: "BUSINESS" | "INDIVIDUAL";
|
|
883
|
+
legal_name: string;
|
|
884
|
+
address_line1: string;
|
|
885
|
+
address_line2?: string | undefined;
|
|
886
|
+
city?: string | undefined;
|
|
887
|
+
state?: string | undefined;
|
|
888
|
+
zip?: string | undefined;
|
|
889
|
+
country?: string | undefined;
|
|
890
|
+
tax_id: string;
|
|
891
|
+
tax_id_type: "CI" | "CUIT" | "DNI" | "EIN" | "NIF" | "NIT" | "OTHER" | "PASSPORT" | "RCN" | "RUC" | "RUT" | "SSN" | "TIN" | "VAT";
|
|
892
|
+
metadata: Record<string, unknown> | null;
|
|
893
|
+
} | null | undefined;
|
|
894
|
+
};
|
|
895
|
+
payment_intents: {
|
|
896
|
+
id?: string | undefined;
|
|
897
|
+
payment_id?: string | undefined;
|
|
898
|
+
method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
|
|
899
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
900
|
+
collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
|
|
901
|
+
status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
|
|
902
|
+
totals: {
|
|
903
|
+
currency: string;
|
|
904
|
+
subtotal: number;
|
|
905
|
+
discount_rate: number;
|
|
906
|
+
discount_total: number;
|
|
907
|
+
tax_rate: number;
|
|
908
|
+
tax_total: number;
|
|
909
|
+
total: number;
|
|
910
|
+
};
|
|
911
|
+
error_message?: string | undefined;
|
|
912
|
+
placed_at: string;
|
|
913
|
+
resolved_at?: string | undefined;
|
|
914
|
+
metadata: Record<string, unknown>;
|
|
915
|
+
}[];
|
|
916
|
+
totals: {
|
|
917
|
+
currency: string;
|
|
918
|
+
subtotal: number;
|
|
919
|
+
discount_rate: number;
|
|
920
|
+
discount_total: number;
|
|
921
|
+
tax_rate: number;
|
|
922
|
+
tax_total: number;
|
|
923
|
+
total: number;
|
|
924
|
+
};
|
|
925
|
+
metadata: Record<string, unknown>;
|
|
926
|
+
payment_status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
|
|
927
|
+
fulfillment_status: string;
|
|
928
|
+
status: "CANCELLED" | "CLOSED" | "COMPLETED" | "OPEN" | "REFUNDED" | "REVERSED" | "VOIDED";
|
|
929
|
+
issued_at?: string | null | undefined;
|
|
930
|
+
resolved_at?: string | null | undefined;
|
|
931
|
+
}>;
|
|
712
932
|
declare const getOrderFulfillment: (id: string, options?: ServiceHttpOptions) => Promise<{
|
|
713
933
|
uid: string;
|
|
714
934
|
id: string;
|
|
@@ -884,7 +1104,7 @@ declare const getOrderFulfillment: (id: string, options?: ServiceHttpOptions) =>
|
|
|
884
1104
|
} | {
|
|
885
1105
|
interpretation?: "both" | "client" | "server" | undefined;
|
|
886
1106
|
primitive: "custom";
|
|
887
|
-
type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
|
|
1107
|
+
type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Payment" | "Payments" | "Store" | "Stores";
|
|
888
1108
|
operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
|
|
889
1109
|
value: string;
|
|
890
1110
|
label_ids?: string[] | undefined;
|
|
@@ -1097,7 +1317,7 @@ declare const listOrderFulfillments: (ids: string[], options?: ServiceHttpOption
|
|
|
1097
1317
|
} | {
|
|
1098
1318
|
interpretation?: "both" | "client" | "server" | undefined;
|
|
1099
1319
|
primitive: "custom";
|
|
1100
|
-
type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
|
|
1320
|
+
type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Payment" | "Payments" | "Store" | "Stores";
|
|
1101
1321
|
operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
|
|
1102
1322
|
value: string;
|
|
1103
1323
|
label_ids?: string[] | undefined;
|
|
@@ -1273,8 +1493,9 @@ declare const updateOrder: (id: string, body: OrderUpdateInput, options?: Servic
|
|
|
1273
1493
|
};
|
|
1274
1494
|
payment_intents: {
|
|
1275
1495
|
id?: string | undefined;
|
|
1276
|
-
|
|
1277
|
-
|
|
1496
|
+
payment_id?: string | undefined;
|
|
1497
|
+
method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
|
|
1498
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
1278
1499
|
collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
|
|
1279
1500
|
status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
|
|
1280
1501
|
totals: {
|
|
@@ -1445,8 +1666,9 @@ declare const cancelOrder: (id: string, options?: ServiceHttpOptions) => Promise
|
|
|
1445
1666
|
};
|
|
1446
1667
|
payment_intents: {
|
|
1447
1668
|
id?: string | undefined;
|
|
1448
|
-
|
|
1449
|
-
|
|
1669
|
+
payment_id?: string | undefined;
|
|
1670
|
+
method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
|
|
1671
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
1450
1672
|
collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
|
|
1451
1673
|
status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
|
|
1452
1674
|
totals: {
|
|
@@ -1617,8 +1839,9 @@ declare const refundOrder: (id: string, options?: ServiceHttpOptions) => Promise
|
|
|
1617
1839
|
};
|
|
1618
1840
|
payment_intents: {
|
|
1619
1841
|
id?: string | undefined;
|
|
1620
|
-
|
|
1621
|
-
|
|
1842
|
+
payment_id?: string | undefined;
|
|
1843
|
+
method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
|
|
1844
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
1622
1845
|
collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
|
|
1623
1846
|
status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
|
|
1624
1847
|
totals: {
|
|
@@ -1789,8 +2012,9 @@ declare const reorderOrder: (id: string, body?: OrderReorderInput, options?: Ser
|
|
|
1789
2012
|
};
|
|
1790
2013
|
payment_intents: {
|
|
1791
2014
|
id?: string | undefined;
|
|
1792
|
-
|
|
1793
|
-
|
|
2015
|
+
payment_id?: string | undefined;
|
|
2016
|
+
method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
|
|
2017
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
1794
2018
|
collect_at: "COUNTER" | "DEVICE" | "DOOR" | "KIOSK" | "OTHER";
|
|
1795
2019
|
status: "CANCELLED" | "FAILED" | "IDLE" | "PAID" | "PENDING" | "REFUNDED";
|
|
1796
2020
|
totals: {
|
|
@@ -1825,6 +2049,56 @@ declare const reorderOrder: (id: string, body?: OrderReorderInput, options?: Ser
|
|
|
1825
2049
|
}>;
|
|
1826
2050
|
declare const validateOrder: (body: OrderValidateInput, options?: ServiceHttpOptions) => Promise<OrderValidateOutput>;
|
|
1827
2051
|
//#endregion
|
|
2052
|
+
//#region src/order/payments/orchestrator.d.ts
|
|
2053
|
+
type Clock = {
|
|
2054
|
+
now: () => number;
|
|
2055
|
+
sleep: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
2056
|
+
};
|
|
2057
|
+
type PaymentRunOptions = {
|
|
2058
|
+
clock?: Clock;
|
|
2059
|
+
/** Called with every intermediate result (e.g. to record PENDING + QR). */
|
|
2060
|
+
onProgress?: (result: PaymentResult) => void | Promise<void>;
|
|
2061
|
+
};
|
|
2062
|
+
/**
|
|
2063
|
+
* One payment attempt with the policy of section 7: timeout, retries on
|
|
2064
|
+
* retryable errors (same `attempt_reference`), batch close and retry,
|
|
2065
|
+
* polling for actions and resolution of ambiguous results.
|
|
2066
|
+
*/
|
|
2067
|
+
declare const runPaymentAttempt: (adapter: PaymentAdapter, ctx: PaymentContext, options?: PaymentRunOptions) => Promise<PaymentResult>;
|
|
2068
|
+
type ReversalOutcome = {
|
|
2069
|
+
kind: "cancel" | "refund" | "manual";
|
|
2070
|
+
result: PaymentResult;
|
|
2071
|
+
};
|
|
2072
|
+
/** Undo a charge after a failed injection or an incomplete split payment. */
|
|
2073
|
+
declare const reversePayment: (adapter: PaymentAdapter, ctx: PaymentContext, result: PaymentResult, options?: {
|
|
2074
|
+
clock?: Clock;
|
|
2075
|
+
now?: Date;
|
|
2076
|
+
}) => Promise<ReversalOutcome>;
|
|
2077
|
+
//#endregion
|
|
2078
|
+
//#region src/order/payments/session.d.ts
|
|
2079
|
+
type Intent = Order$1["payment_intents"][number];
|
|
2080
|
+
type PaymentSessionOptions = {
|
|
2081
|
+
/** Merchant env is production (`env_is_prod`). */
|
|
2082
|
+
isProduction?: boolean;
|
|
2083
|
+
/** Where the customer pays: `KIOSK` on a kiosk, `DEVICE` on web/app. */
|
|
2084
|
+
collectAt?: PaymentCollectAt;
|
|
2085
|
+
/** Where cash is collected: `COUNTER` on a kiosk, `DOOR` on delivery. */
|
|
2086
|
+
cashCollectAt?: PaymentCollectAt;
|
|
2087
|
+
/** `settings_overrides.payment_settings` of this device, by payment id. */
|
|
2088
|
+
deviceSettings?: Record<string, Record<string, unknown>>;
|
|
2089
|
+
/** Kiosk device id, sent with terminal failure reports. */
|
|
2090
|
+
deviceId?: string | null;
|
|
2091
|
+
};
|
|
2092
|
+
type PayOptions = {
|
|
2093
|
+
/** Amount in the order currency; defaults to the remaining amount. */
|
|
2094
|
+
amount?: number;
|
|
2095
|
+
signal?: AbortSignal;
|
|
2096
|
+
onProgress?: PaymentRunOptions["onProgress"];
|
|
2097
|
+
};
|
|
2098
|
+
/** PAID plus PENDING with `confirm_after_inject`, in the order currency. */
|
|
2099
|
+
declare const coveredAmount: (intents: Intent[]) => number;
|
|
2100
|
+
declare const remainingAmount: (order: Order$1) => number;
|
|
2101
|
+
//#endregion
|
|
1828
2102
|
//#region src/order/recommendations.d.ts
|
|
1829
2103
|
type RecommendationType = Recommendation["type"];
|
|
1830
2104
|
declare const DEFAULT_RECOMMENDATION_TYPES: RecommendationType[];
|
|
@@ -1884,6 +2158,7 @@ declare class Order {
|
|
|
1884
2158
|
private readonly externalNotify?;
|
|
1885
2159
|
private readonly http;
|
|
1886
2160
|
private readonly flush;
|
|
2161
|
+
private readonly payments;
|
|
1887
2162
|
private constructor();
|
|
1888
2163
|
/**
|
|
1889
2164
|
* Opens a cart session: reuses an existing OPEN order for the scope, or a
|
|
@@ -1939,6 +2214,7 @@ declare class Order {
|
|
|
1939
2214
|
* latest applied first. Removing more units than applied clears them all.
|
|
1940
2215
|
*/
|
|
1941
2216
|
removeRedeem(input: RemoveRedeemInput): void;
|
|
2217
|
+
private rememberLogScope;
|
|
1942
2218
|
setScope(scope: Partial<OrderScope>): void;
|
|
1943
2219
|
/** Shallow-merges into order metadata; `null` values are kept as-is. */
|
|
1944
2220
|
setMetadata(patch: Record<string, unknown>): void;
|
|
@@ -1950,6 +2226,165 @@ declare class Order {
|
|
|
1950
2226
|
refundOrder(): Promise<void>;
|
|
1951
2227
|
validateOrder(): Promise<void>;
|
|
1952
2228
|
placeOrder(input?: PlaceOrderInput): Promise<void>;
|
|
2229
|
+
/** Installed `@fire-spark/payments-*` adapters (provider + method). */
|
|
2230
|
+
setPaymentAdapters(adapters: PaymentAdapter[]): void;
|
|
2231
|
+
/** Template modal/sheet the adapters use to talk to the customer. */
|
|
2232
|
+
setPaymentUI(ui: PaymentUI): void;
|
|
2233
|
+
/** Persistent device storage (terminal keys, last batch close). */
|
|
2234
|
+
setPaymentStorage(storage: PaymentStorage): void;
|
|
2235
|
+
/** Environment, collect point and this device's `payment_settings`. */
|
|
2236
|
+
setPaymentOptions(options: PaymentSessionOptions): void;
|
|
2237
|
+
/** Merchant payments with an adapter installed and configured here. */
|
|
2238
|
+
getPaymentOptions(payments: MerchantPayment[]): {
|
|
2239
|
+
created_at: string;
|
|
2240
|
+
updated_at: string;
|
|
2241
|
+
deleted_at: string | null;
|
|
2242
|
+
id: string;
|
|
2243
|
+
payment_provider_id: string;
|
|
2244
|
+
payment_method_id: string;
|
|
2245
|
+
rules: {
|
|
2246
|
+
minimum_order_value: number;
|
|
2247
|
+
maximum_order_value: number;
|
|
2248
|
+
}[];
|
|
2249
|
+
conditions: ({
|
|
2250
|
+
interpretation?: "both" | "client" | "server" | undefined;
|
|
2251
|
+
product_id?: string | undefined;
|
|
2252
|
+
tag?: string | undefined;
|
|
2253
|
+
fulfillment_id: string;
|
|
2254
|
+
store_id: string;
|
|
2255
|
+
channel_id: string;
|
|
2256
|
+
brand_id: string;
|
|
2257
|
+
primitive: "string";
|
|
2258
|
+
type: "Failure message" | "Order includes product with tag" | "Request path";
|
|
2259
|
+
operator: "contains" | "ends with" | "equal to" | "not equal to" | "starts with";
|
|
2260
|
+
caseInsensitive?: boolean | undefined;
|
|
2261
|
+
value: string;
|
|
2262
|
+
invalidMessage?: string | undefined;
|
|
2263
|
+
} | {
|
|
2264
|
+
interpretation?: "both" | "client" | "server" | undefined;
|
|
2265
|
+
product_id?: string | undefined;
|
|
2266
|
+
tag?: string | undefined;
|
|
2267
|
+
fulfillment_id: string;
|
|
2268
|
+
store_id: string;
|
|
2269
|
+
channel_id: string;
|
|
2270
|
+
brand_id: string;
|
|
2271
|
+
primitive: "number";
|
|
2272
|
+
type: "API error rate" | "Accumulated events" | "Cart product count" | "Customer age" | "HTTP status" | "Order includes product" | "Order includes product with tag";
|
|
2273
|
+
operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
|
|
2274
|
+
value: number;
|
|
2275
|
+
include_modifiers?: boolean | undefined;
|
|
2276
|
+
window_minutes?: number | undefined;
|
|
2277
|
+
invalidMessage?: string | undefined;
|
|
2278
|
+
} | {
|
|
2279
|
+
interpretation?: "both" | "client" | "server" | undefined;
|
|
2280
|
+
product_id?: string | undefined;
|
|
2281
|
+
tag?: string | undefined;
|
|
2282
|
+
fulfillment_id: string;
|
|
2283
|
+
store_id: string;
|
|
2284
|
+
channel_id: string;
|
|
2285
|
+
brand_id: string;
|
|
2286
|
+
primitive: "currency";
|
|
2287
|
+
type: "Order includes product with tag" | "Order total";
|
|
2288
|
+
operator: "equal to" | "greater than" | "greater than or equal to" | "less than" | "less than or equal to" | "not equal to";
|
|
2289
|
+
value: number;
|
|
2290
|
+
invalidMessage?: string | undefined;
|
|
2291
|
+
} | {
|
|
2292
|
+
interpretation?: "both" | "client" | "server" | undefined;
|
|
2293
|
+
product_id?: string | undefined;
|
|
2294
|
+
tag?: string | undefined;
|
|
2295
|
+
fulfillment_id: string;
|
|
2296
|
+
store_id: string;
|
|
2297
|
+
channel_id: string;
|
|
2298
|
+
brand_id: string;
|
|
2299
|
+
primitive: "boolean";
|
|
2300
|
+
type: "Customer is anonymous" | "Is anonymous order" | "Order includes product with tag";
|
|
2301
|
+
operator: "is" | "is not";
|
|
2302
|
+
value: boolean;
|
|
2303
|
+
invalidMessage?: string | undefined;
|
|
2304
|
+
} | {
|
|
2305
|
+
interpretation?: "both" | "client" | "server" | undefined;
|
|
2306
|
+
primitive: "enum";
|
|
2307
|
+
type: "Payment collect at" | "Payment method" | "Payment status";
|
|
2308
|
+
operator: "is" | "is any of" | "is none of" | "is not";
|
|
2309
|
+
value: string | string[];
|
|
2310
|
+
invalidMessage?: string | undefined;
|
|
2311
|
+
} | {
|
|
2312
|
+
interpretation?: "both" | "client" | "server" | undefined;
|
|
2313
|
+
primitive: "absolute date";
|
|
2314
|
+
type: "Today";
|
|
2315
|
+
operator: "is" | "is after" | "is before" | "is not";
|
|
2316
|
+
value: Date;
|
|
2317
|
+
invalidMessage?: string | undefined;
|
|
2318
|
+
} | {
|
|
2319
|
+
interpretation?: "both" | "client" | "server" | undefined;
|
|
2320
|
+
primitive: "relative date";
|
|
2321
|
+
type: "Birthday" | "Customer last session" | "Customer last visit" | "Registration";
|
|
2322
|
+
operator: "occurred" | "occurred in the last" | "occurred more than";
|
|
2323
|
+
value: string;
|
|
2324
|
+
invalidMessage?: string | undefined;
|
|
2325
|
+
} | {
|
|
2326
|
+
interpretation?: "both" | "client" | "server" | undefined;
|
|
2327
|
+
primitive: "recurring date";
|
|
2328
|
+
type: "Current date";
|
|
2329
|
+
operator: "falls within period";
|
|
2330
|
+
startDate: Date;
|
|
2331
|
+
endDate: Date;
|
|
2332
|
+
allDay: boolean;
|
|
2333
|
+
repeat: "CUSTOM" | "DAILY" | "FORTNIGHTLY" | "LAST_DAY_OF_MONTH" | "MONTHLY" | "NONE" | "WEEKDAYS" | "WEEKENDS" | "WEEKLY" | "WEEK_OF_MONTH";
|
|
2334
|
+
value: string;
|
|
2335
|
+
invalidMessage?: string | undefined;
|
|
2336
|
+
} | {
|
|
2337
|
+
interpretation?: "both" | "client" | "server" | undefined;
|
|
2338
|
+
primitive: "custom";
|
|
2339
|
+
type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Payment" | "Payments" | "Store" | "Stores";
|
|
2340
|
+
operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
|
|
2341
|
+
value: string;
|
|
2342
|
+
label_ids?: string[] | undefined;
|
|
2343
|
+
invalidMessage?: string | undefined;
|
|
2344
|
+
})[][];
|
|
2345
|
+
status: string;
|
|
2346
|
+
provider: {
|
|
2347
|
+
id: string;
|
|
2348
|
+
provider_id: string;
|
|
2349
|
+
name: string;
|
|
2350
|
+
logo_url?: string | null | undefined;
|
|
2351
|
+
};
|
|
2352
|
+
method: {
|
|
2353
|
+
id: string;
|
|
2354
|
+
method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
|
|
2355
|
+
name: string;
|
|
2356
|
+
version: string;
|
|
2357
|
+
config?: {
|
|
2358
|
+
[x: string]: unknown;
|
|
2359
|
+
device_fields?: {
|
|
2360
|
+
key: string;
|
|
2361
|
+
label: string;
|
|
2362
|
+
type: "boolean" | "number" | "password" | "select" | "text";
|
|
2363
|
+
required: boolean;
|
|
2364
|
+
secret: boolean;
|
|
2365
|
+
options?: string[] | undefined;
|
|
2366
|
+
visible_if?: Record<string, unknown> | undefined;
|
|
2367
|
+
}[] | undefined;
|
|
2368
|
+
qr_ttl_ms?: number | undefined;
|
|
2369
|
+
terminal_models?: string[] | undefined;
|
|
2370
|
+
supports_installments?: boolean | undefined;
|
|
2371
|
+
} | undefined;
|
|
2372
|
+
};
|
|
2373
|
+
config: Record<string, unknown>;
|
|
2374
|
+
has_conditions: boolean;
|
|
2375
|
+
}[];
|
|
2376
|
+
/** Device fields still missing for `payment` on this device. */
|
|
2377
|
+
getMissingPaymentFields(payment: MerchantPayment): import("@fire-spark/payments").DeviceField[];
|
|
2378
|
+
/** Order total minus PAID (and confirm-after-inject) intents. */
|
|
2379
|
+
getRemainingAmount(): number;
|
|
2380
|
+
/** Places the order if needed and charges `payment` (all or part). */
|
|
2381
|
+
pay(payment: MerchantPayment, options?: PayOptions): Promise<import("@fire-spark/payments").PaymentResult>;
|
|
2382
|
+
/** Confirms intents that waited for the order injection. */
|
|
2383
|
+
confirmPaymentsAfterInject(): Promise<import("@fire-spark/payments").PaymentResult[]>;
|
|
2384
|
+
/** Cancels or refunds every charge of this order (or flags it manual). */
|
|
2385
|
+
reversePayments(): Promise<ReversalOutcome[]>;
|
|
2386
|
+
/** Terminal admin operation (init, test, closeBatch, status, extra). */
|
|
2387
|
+
runPaymentTerminal(payment: MerchantPayment, key: string): Promise<import("@fire-spark/payments").TerminalResult>;
|
|
1953
2388
|
/** Applies lines/redeem, replaying redemption steps and totals. */
|
|
1954
2389
|
private commitLines;
|
|
1955
2390
|
private scheduleAfterMutate;
|
|
@@ -2016,8 +2451,8 @@ declare const milestoneTrack: (workflow: TrackWorkflow) => MilestoneTrackItem[];
|
|
|
2016
2451
|
declare const milestoneSteps: (workflow: TrackWorkflow, currentNodeIds: string[]) => MilestoneSteps | null;
|
|
2017
2452
|
//#endregion
|
|
2018
2453
|
//#region src/order/validate.d.ts
|
|
2019
|
-
type OrderLineIssueCode = "PRODUCT_NOT_FOUND" | "HIDDEN" | "OUT_OF_STOCK" | "OUTSIDE_HOURS" | "MODIFIER_NOT_FOUND" | "MODIFIER_RULES_INVALID" | "PRICE_MISMATCH" | "TAX_MISMATCH" | "DISCOUNT_MISMATCH" | "QUANTITY_MISMATCH" | "QUANTITY_BELOW_MINIMUM" | "QUANTITY_ABOVE_MAXIMUM" | "STRUCTURE_MISMATCH" | "FEE_MISMATCH" | "REDEEM_EXPIRED" | "REDEMPTION_STEPS_MISMATCH";
|
|
2020
|
-
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";
|
|
2454
|
+
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";
|
|
2455
|
+
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";
|
|
2021
2456
|
type OrderLineIssue = {
|
|
2022
2457
|
code: OrderLineIssueCode;
|
|
2023
2458
|
field?: string;
|
|
@@ -2131,6 +2566,11 @@ declare const recomputeTotals: (lines: OrderLine[], currency?: string) => OrderT
|
|
|
2131
2566
|
//#endregion
|
|
2132
2567
|
//#region src/order/lines.d.ts
|
|
2133
2568
|
declare const addLines: (lines: OrderLine[], incoming: OrderLine | OrderLine[]) => OrderLine[];
|
|
2569
|
+
declare const removeLine: (lines: OrderLine[], lineUid: string) => OrderLine[];
|
|
2570
|
+
/** Rescale one line's money to `quantity`; zero or less drops its subtree. */
|
|
2571
|
+
declare const setLineQuantity: (lines: OrderLine[], lineUid: string, quantity: number) => OrderLine[];
|
|
2572
|
+
/** Drop a root subtree, then add the replacement tree (may merge by fingerprint). */
|
|
2573
|
+
declare const replaceLine: (lines: OrderLine[], lineUid: string, next: OrderLine | OrderLine[]) => OrderLine[];
|
|
2134
2574
|
//#endregion
|
|
2135
2575
|
//#region src/services/availability.d.ts
|
|
2136
2576
|
declare const getAvailability: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<StorefrontAvailability>;
|
|
@@ -2272,7 +2712,7 @@ declare const getCustomer: (id: string, options?: ServiceHttpOptions) => Promise
|
|
|
2272
2712
|
last4: string;
|
|
2273
2713
|
exp_month: number;
|
|
2274
2714
|
exp_year: number;
|
|
2275
|
-
provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
|
|
2715
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
2276
2716
|
provider_payment_method_id: string;
|
|
2277
2717
|
preferred: boolean;
|
|
2278
2718
|
metadata: Record<string, unknown> | null;
|
|
@@ -2280,7 +2720,7 @@ declare const getCustomer: (id: string, options?: ServiceHttpOptions) => Promise
|
|
|
2280
2720
|
id: string;
|
|
2281
2721
|
type: "WALLET";
|
|
2282
2722
|
alias: string;
|
|
2283
|
-
provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
|
|
2723
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
2284
2724
|
provider_payment_method_id: string;
|
|
2285
2725
|
account_hint?: string | undefined;
|
|
2286
2726
|
preferred: boolean;
|
|
@@ -2291,7 +2731,7 @@ declare const getCustomer: (id: string, options?: ServiceHttpOptions) => Promise
|
|
|
2291
2731
|
alias: string;
|
|
2292
2732
|
bank_name?: string | undefined;
|
|
2293
2733
|
last4: string;
|
|
2294
|
-
provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
|
|
2734
|
+
provider?: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape" | undefined;
|
|
2295
2735
|
provider_payment_method_id?: string | undefined;
|
|
2296
2736
|
preferred: boolean;
|
|
2297
2737
|
metadata: Record<string, unknown> | null;
|
|
@@ -2376,7 +2816,7 @@ declare const createCustomer: (body: CustomerRegisterInput, options?: ServiceHtt
|
|
|
2376
2816
|
last4: string;
|
|
2377
2817
|
exp_month: number;
|
|
2378
2818
|
exp_year: number;
|
|
2379
|
-
provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
|
|
2819
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
2380
2820
|
provider_payment_method_id: string;
|
|
2381
2821
|
preferred: boolean;
|
|
2382
2822
|
metadata: Record<string, unknown> | null;
|
|
@@ -2384,7 +2824,7 @@ declare const createCustomer: (body: CustomerRegisterInput, options?: ServiceHtt
|
|
|
2384
2824
|
id: string;
|
|
2385
2825
|
type: "WALLET";
|
|
2386
2826
|
alias: string;
|
|
2387
|
-
provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
|
|
2827
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
2388
2828
|
provider_payment_method_id: string;
|
|
2389
2829
|
account_hint?: string | undefined;
|
|
2390
2830
|
preferred: boolean;
|
|
@@ -2395,7 +2835,7 @@ declare const createCustomer: (body: CustomerRegisterInput, options?: ServiceHtt
|
|
|
2395
2835
|
alias: string;
|
|
2396
2836
|
bank_name?: string | undefined;
|
|
2397
2837
|
last4: string;
|
|
2398
|
-
provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
|
|
2838
|
+
provider?: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape" | undefined;
|
|
2399
2839
|
provider_payment_method_id?: string | undefined;
|
|
2400
2840
|
preferred: boolean;
|
|
2401
2841
|
metadata: Record<string, unknown> | null;
|
|
@@ -2480,7 +2920,7 @@ declare const identifyAnonymousCustomer: (id: string, body: CustomerIdentifyInpu
|
|
|
2480
2920
|
last4: string;
|
|
2481
2921
|
exp_month: number;
|
|
2482
2922
|
exp_year: number;
|
|
2483
|
-
provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
|
|
2923
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
2484
2924
|
provider_payment_method_id: string;
|
|
2485
2925
|
preferred: boolean;
|
|
2486
2926
|
metadata: Record<string, unknown> | null;
|
|
@@ -2488,7 +2928,7 @@ declare const identifyAnonymousCustomer: (id: string, body: CustomerIdentifyInpu
|
|
|
2488
2928
|
id: string;
|
|
2489
2929
|
type: "WALLET";
|
|
2490
2930
|
alias: string;
|
|
2491
|
-
provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
|
|
2931
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
2492
2932
|
provider_payment_method_id: string;
|
|
2493
2933
|
account_hint?: string | undefined;
|
|
2494
2934
|
preferred: boolean;
|
|
@@ -2499,7 +2939,7 @@ declare const identifyAnonymousCustomer: (id: string, body: CustomerIdentifyInpu
|
|
|
2499
2939
|
alias: string;
|
|
2500
2940
|
bank_name?: string | undefined;
|
|
2501
2941
|
last4: string;
|
|
2502
|
-
provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
|
|
2942
|
+
provider?: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape" | undefined;
|
|
2503
2943
|
provider_payment_method_id?: string | undefined;
|
|
2504
2944
|
preferred: boolean;
|
|
2505
2945
|
metadata: Record<string, unknown> | null;
|
|
@@ -2584,7 +3024,7 @@ declare const updateCustomer: (id: string, body: CustomerUpdateInput, options?:
|
|
|
2584
3024
|
last4: string;
|
|
2585
3025
|
exp_month: number;
|
|
2586
3026
|
exp_year: number;
|
|
2587
|
-
provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
|
|
3027
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
2588
3028
|
provider_payment_method_id: string;
|
|
2589
3029
|
preferred: boolean;
|
|
2590
3030
|
metadata: Record<string, unknown> | null;
|
|
@@ -2592,7 +3032,7 @@ declare const updateCustomer: (id: string, body: CustomerUpdateInput, options?:
|
|
|
2592
3032
|
id: string;
|
|
2593
3033
|
type: "WALLET";
|
|
2594
3034
|
alias: string;
|
|
2595
|
-
provider: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape";
|
|
3035
|
+
provider: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape";
|
|
2596
3036
|
provider_payment_method_id: string;
|
|
2597
3037
|
account_hint?: string | undefined;
|
|
2598
3038
|
preferred: boolean;
|
|
@@ -2603,7 +3043,7 @@ declare const updateCustomer: (id: string, body: CustomerUpdateInput, options?:
|
|
|
2603
3043
|
alias: string;
|
|
2604
3044
|
bank_name?: string | undefined;
|
|
2605
3045
|
last4: string;
|
|
2606
|
-
provider?: "firespark" | "kushki" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "stripe" | "yape" | undefined;
|
|
3046
|
+
provider?: "amipass" | "cashea" | "clisitef" | "credibanco" | "datafast" | "deuna" | "edenred" | "firespark" | "kushki" | "mach" | "medianet" | "mercadopago" | "niubiz" | "paymentz" | "paypal" | "payphone" | "place_to_pay" | "pluxee" | "posnet" | "redeban" | "rutpay" | "sitef_venezuela" | "stripe" | "transbank" | "yape" | undefined;
|
|
2607
3047
|
provider_payment_method_id?: string | undefined;
|
|
2608
3048
|
preferred: boolean;
|
|
2609
3049
|
metadata: Record<string, unknown> | null;
|
|
@@ -2734,6 +3174,7 @@ declare const listMenus: (scope?: StorefrontMenuScope, options?: ServiceHttpOpti
|
|
|
2734
3174
|
price: number;
|
|
2735
3175
|
anchor_price?: number | undefined;
|
|
2736
3176
|
anchor_price_percentage?: number | undefined;
|
|
3177
|
+
starting_price?: number | null | undefined;
|
|
2737
3178
|
modifiers: {
|
|
2738
3179
|
modifier_group_id: string;
|
|
2739
3180
|
default_quantity: number;
|
|
@@ -2752,6 +3193,11 @@ declare const listMenus: (scope?: StorefrontMenuScope, options?: ServiceHttpOpti
|
|
|
2752
3193
|
anchor_price_percentage?: number | undefined;
|
|
2753
3194
|
}[];
|
|
2754
3195
|
modifier_group_ids: string[];
|
|
3196
|
+
variants: {
|
|
3197
|
+
product_id: string;
|
|
3198
|
+
variant_group_option_ids: string[];
|
|
3199
|
+
}[];
|
|
3200
|
+
variant_group_ids: string[];
|
|
2755
3201
|
recommendations: {
|
|
2756
3202
|
recommendation_id: string;
|
|
2757
3203
|
default_quantity: number;
|
|
@@ -2839,6 +3285,22 @@ declare const listMenus: (scope?: StorefrontMenuScope, options?: ServiceHttpOpti
|
|
|
2839
3285
|
charge_above_quantity?: number | null | undefined;
|
|
2840
3286
|
metadata: Record<string, unknown>;
|
|
2841
3287
|
}[];
|
|
3288
|
+
variant_groups: {
|
|
3289
|
+
id: string;
|
|
3290
|
+
title: Record<string, string>;
|
|
3291
|
+
description?: Record<string, string> | null | undefined;
|
|
3292
|
+
display_type?: "GRID" | "LIST" | null | undefined;
|
|
3293
|
+
variants: {
|
|
3294
|
+
id: string;
|
|
3295
|
+
name: Record<string, string>;
|
|
3296
|
+
description?: Record<string, string> | null | undefined;
|
|
3297
|
+
image_url?: string | null | undefined;
|
|
3298
|
+
image_origin_url?: string | null | undefined;
|
|
3299
|
+
product_ids: string[];
|
|
3300
|
+
metadata: Record<string, unknown>;
|
|
3301
|
+
}[];
|
|
3302
|
+
metadata: Record<string, unknown>;
|
|
3303
|
+
}[];
|
|
2842
3304
|
recommendations: ({
|
|
2843
3305
|
id: string;
|
|
2844
3306
|
title: Record<string, string>;
|
|
@@ -2929,6 +3391,7 @@ declare const listMenusStream: (scope?: StorefrontMenuScope, options?: ListMenus
|
|
|
2929
3391
|
price: number;
|
|
2930
3392
|
anchor_price?: number | undefined;
|
|
2931
3393
|
anchor_price_percentage?: number | undefined;
|
|
3394
|
+
starting_price?: number | null | undefined;
|
|
2932
3395
|
modifiers: {
|
|
2933
3396
|
modifier_group_id: string;
|
|
2934
3397
|
default_quantity: number;
|
|
@@ -2947,6 +3410,11 @@ declare const listMenusStream: (scope?: StorefrontMenuScope, options?: ListMenus
|
|
|
2947
3410
|
anchor_price_percentage?: number | undefined;
|
|
2948
3411
|
}[];
|
|
2949
3412
|
modifier_group_ids: string[];
|
|
3413
|
+
variants: {
|
|
3414
|
+
product_id: string;
|
|
3415
|
+
variant_group_option_ids: string[];
|
|
3416
|
+
}[];
|
|
3417
|
+
variant_group_ids: string[];
|
|
2950
3418
|
recommendations: {
|
|
2951
3419
|
recommendation_id: string;
|
|
2952
3420
|
default_quantity: number;
|
|
@@ -3034,6 +3502,22 @@ declare const listMenusStream: (scope?: StorefrontMenuScope, options?: ListMenus
|
|
|
3034
3502
|
charge_above_quantity?: number | null | undefined;
|
|
3035
3503
|
metadata: Record<string, unknown>;
|
|
3036
3504
|
}[];
|
|
3505
|
+
variant_groups: {
|
|
3506
|
+
id: string;
|
|
3507
|
+
title: Record<string, string>;
|
|
3508
|
+
description?: Record<string, string> | null | undefined;
|
|
3509
|
+
display_type?: "GRID" | "LIST" | null | undefined;
|
|
3510
|
+
variants: {
|
|
3511
|
+
id: string;
|
|
3512
|
+
name: Record<string, string>;
|
|
3513
|
+
description?: Record<string, string> | null | undefined;
|
|
3514
|
+
image_url?: string | null | undefined;
|
|
3515
|
+
image_origin_url?: string | null | undefined;
|
|
3516
|
+
product_ids: string[];
|
|
3517
|
+
metadata: Record<string, unknown>;
|
|
3518
|
+
}[];
|
|
3519
|
+
metadata: Record<string, unknown>;
|
|
3520
|
+
}[];
|
|
3037
3521
|
recommendations: ({
|
|
3038
3522
|
id: string;
|
|
3039
3523
|
title: Record<string, string>;
|
|
@@ -3185,7 +3669,7 @@ declare const listPayments: (input: StorefrontPaymentsListInput, options?: Servi
|
|
|
3185
3669
|
} | {
|
|
3186
3670
|
interpretation?: "both" | "client" | "server" | undefined;
|
|
3187
3671
|
primitive: "custom";
|
|
3188
|
-
type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Store" | "Stores";
|
|
3672
|
+
type: "Brand" | "Brands" | "Channel" | "Channels" | "Fulfillment" | "Fulfillments" | "Payment" | "Payments" | "Store" | "Stores";
|
|
3189
3673
|
operator: "is" | "is all of" | "is any of" | "is none of" | "is not";
|
|
3190
3674
|
value: string;
|
|
3191
3675
|
label_ids?: string[] | undefined;
|
|
@@ -3200,13 +3684,109 @@ declare const listPayments: (input: StorefrontPaymentsListInput, options?: Servi
|
|
|
3200
3684
|
};
|
|
3201
3685
|
method: {
|
|
3202
3686
|
id: string;
|
|
3203
|
-
method: "BANK_TRANSFER" | "CARD" | "CASH" | "PIN_PAD" | "WALLET";
|
|
3687
|
+
method: "BANK_TRANSFER" | "CARD" | "CASH" | "FINANCING" | "PIN_PAD" | "WALLET";
|
|
3204
3688
|
name: string;
|
|
3205
3689
|
version: string;
|
|
3690
|
+
config?: {
|
|
3691
|
+
[x: string]: unknown;
|
|
3692
|
+
device_fields?: {
|
|
3693
|
+
key: string;
|
|
3694
|
+
label: string;
|
|
3695
|
+
type: "boolean" | "number" | "password" | "select" | "text";
|
|
3696
|
+
required: boolean;
|
|
3697
|
+
secret: boolean;
|
|
3698
|
+
options?: string[] | undefined;
|
|
3699
|
+
visible_if?: Record<string, unknown> | undefined;
|
|
3700
|
+
}[] | undefined;
|
|
3701
|
+
qr_ttl_ms?: number | undefined;
|
|
3702
|
+
terminal_models?: string[] | undefined;
|
|
3703
|
+
supports_installments?: boolean | undefined;
|
|
3704
|
+
} | undefined;
|
|
3206
3705
|
};
|
|
3207
3706
|
config: Record<string, unknown>;
|
|
3208
3707
|
has_conditions: boolean;
|
|
3209
3708
|
}[]>;
|
|
3709
|
+
type PaymentOperationBody = {
|
|
3710
|
+
order_id: string | null;
|
|
3711
|
+
attempt_reference: string | null;
|
|
3712
|
+
input: Record<string, unknown>;
|
|
3713
|
+
};
|
|
3714
|
+
/** Server half of an adapter (`POST /payments/:id/operations/:operation`). */
|
|
3715
|
+
declare const callPaymentOperation: <T>(paymentId: string, operation: string, body: PaymentOperationBody, options?: ServiceHttpOptions) => Promise<T>;
|
|
3716
|
+
type TerminalFailureBody = {
|
|
3717
|
+
operation: string;
|
|
3718
|
+
device_id?: string | null;
|
|
3719
|
+
error: {
|
|
3720
|
+
code: string;
|
|
3721
|
+
message: string;
|
|
3722
|
+
} & Record<string, unknown>;
|
|
3723
|
+
};
|
|
3724
|
+
/** Reports a failed terminal operation (`payment.terminal_failed`). */
|
|
3725
|
+
declare const reportTerminalFailure: (paymentId: string, body: TerminalFailureBody, options?: ServiceHttpOptions) => Promise<{
|
|
3726
|
+
reported: boolean;
|
|
3727
|
+
}>;
|
|
3728
|
+
//#endregion
|
|
3729
|
+
//#region src/i18n/pos.d.ts
|
|
3730
|
+
type PosMessageLocale = "en" | "en-US" | "es" | "pt-BR";
|
|
3731
|
+
//#endregion
|
|
3732
|
+
//#region src/services/pos.d.ts
|
|
3733
|
+
declare const isPosDeviceNotLinked: (error: unknown) => boolean;
|
|
3734
|
+
declare const isPosUnauthorized: (error: unknown) => boolean;
|
|
3735
|
+
declare const isPosPinLocked: (error: unknown) => boolean;
|
|
3736
|
+
declare const localizePosError: (error: unknown, locale?: PosMessageLocale) => string | undefined;
|
|
3737
|
+
declare const pairPosDevice: (input: {
|
|
3738
|
+
pairing_code: string;
|
|
3739
|
+
device_secret: string;
|
|
3740
|
+
}, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3741
|
+
declare const relinkPosDevice: (input: {
|
|
3742
|
+
relink_code: string;
|
|
3743
|
+
device_secret: string;
|
|
3744
|
+
}, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3745
|
+
declare const postPosHeartbeat: (input: PosHeartbeatInput, options?: ServiceHttpOptions) => Promise<PosHeartbeatResult>;
|
|
3746
|
+
declare const postPosHealthSamples: (input: PosHealthBatchInput, options?: ServiceHttpOptions) => Promise<PosHealthBatchResult>;
|
|
3747
|
+
declare const postPosDeviceLogs: (input: unknown, options?: ServiceHttpOptions) => Promise<{
|
|
3748
|
+
ok: boolean;
|
|
3749
|
+
accepted: number;
|
|
3750
|
+
}>;
|
|
3751
|
+
declare const listPosOperators: (input: {
|
|
3752
|
+
device_uid: string;
|
|
3753
|
+
device_secret: string;
|
|
3754
|
+
}, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3755
|
+
declare const verifyPosOperator: (input: {
|
|
3756
|
+
device_uid: string;
|
|
3757
|
+
device_secret: string;
|
|
3758
|
+
operator_id: string;
|
|
3759
|
+
pin: string;
|
|
3760
|
+
}, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3761
|
+
declare const listPosAuthorizers: (input: {
|
|
3762
|
+
device_uid: string;
|
|
3763
|
+
device_secret: string;
|
|
3764
|
+
action: string;
|
|
3765
|
+
}, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3766
|
+
declare const verifyPosAuthorizer: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3767
|
+
declare const openPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3768
|
+
declare const countPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3769
|
+
declare const withdrawPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3770
|
+
declare const drawerPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3771
|
+
declare const closePosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3772
|
+
declare const shiftEndPosSession: (input: unknown, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3773
|
+
/** The device's open caja and its events, or `{ session: null }`. */
|
|
3774
|
+
declare const getPosCurrentSession: (input: {
|
|
3775
|
+
device_uid: string;
|
|
3776
|
+
device_secret: string;
|
|
3777
|
+
}, options?: ServiceHttpOptions) => Promise<unknown>;
|
|
3778
|
+
declare const listPosKioskOrders: (input: {
|
|
3779
|
+
device_uid: string;
|
|
3780
|
+
device_secret: string;
|
|
3781
|
+
}, options?: ServiceHttpOptions) => Promise<PosKioskOrder[]>;
|
|
3782
|
+
/** Safe to retry with the same `client_id`; the server dedupes the settle. */
|
|
3783
|
+
declare const settlePosKioskOrder: (input: PosKioskSettleInput, options?: ServiceHttpOptions) => Promise<PosKioskSettleResult>;
|
|
3784
|
+
declare const getPosCatalog: (input: {
|
|
3785
|
+
device_uid: string;
|
|
3786
|
+
device_secret: string;
|
|
3787
|
+
}, options?: ServiceHttpOptions) => Promise<PosCatalog>;
|
|
3788
|
+
/** Safe to retry with the same `client_id`; the server dedupes the sale. */
|
|
3789
|
+
declare const createPosOrder: (input: PosOrderInput, options?: ServiceHttpOptions) => Promise<PosOrderResult>;
|
|
3210
3790
|
//#endregion
|
|
3211
3791
|
//#region src/services/preferences.d.ts
|
|
3212
3792
|
declare const getPreferences: (scope?: StorefrontMenuScope, options?: ServiceHttpOptions) => Promise<{
|
|
@@ -3262,6 +3842,18 @@ declare const getPreferences: (scope?: StorefrontMenuScope, options?: ServiceHtt
|
|
|
3262
3842
|
ios_store_url: string;
|
|
3263
3843
|
android_store_url: string;
|
|
3264
3844
|
};
|
|
3845
|
+
country?: string | undefined;
|
|
3846
|
+
locale?: string | undefined;
|
|
3847
|
+
currency?: {
|
|
3848
|
+
code: string;
|
|
3849
|
+
symbol: string;
|
|
3850
|
+
name: string;
|
|
3851
|
+
} | undefined;
|
|
3852
|
+
denominations?: {
|
|
3853
|
+
kind: "BILL" | "COIN";
|
|
3854
|
+
value: number;
|
|
3855
|
+
sort_order: number;
|
|
3856
|
+
}[] | undefined;
|
|
3265
3857
|
}>;
|
|
3266
3858
|
//#endregion
|
|
3267
3859
|
//#region src/services/stores.d.ts
|
|
@@ -3305,6 +3897,8 @@ declare const listStores: (input?: StoreListInput, options?: ServiceHttpOptions)
|
|
|
3305
3897
|
temporary_closed_until?: string | null | undefined;
|
|
3306
3898
|
status: "CLOSED" | "OPEN" | "TEMPORARILY_CLOSED";
|
|
3307
3899
|
};
|
|
3900
|
+
channel_ids: string[];
|
|
3901
|
+
fulfillment_ids: string[];
|
|
3308
3902
|
tags: Record<string, string | number | boolean>;
|
|
3309
3903
|
cms_template_id?: string | null | undefined;
|
|
3310
3904
|
status: string;
|
|
@@ -3399,6 +3993,8 @@ declare const listNearbyStores: (input: StoreNearbyInput, options?: ServiceHttpO
|
|
|
3399
3993
|
temporary_closed_until?: string | null | undefined;
|
|
3400
3994
|
status: "CLOSED" | "OPEN" | "TEMPORARILY_CLOSED";
|
|
3401
3995
|
};
|
|
3996
|
+
channel_ids: string[];
|
|
3997
|
+
fulfillment_ids: string[];
|
|
3402
3998
|
tags: Record<string, string | number | boolean>;
|
|
3403
3999
|
cms_template_id?: string | null | undefined;
|
|
3404
4000
|
status: string;
|
|
@@ -3454,7 +4050,7 @@ declare const listNearbyStores: (input: StoreNearbyInput, options?: ServiceHttpO
|
|
|
3454
4050
|
} | null | undefined;
|
|
3455
4051
|
labels: string[];
|
|
3456
4052
|
}[]>;
|
|
3457
|
-
declare const getStore: (id: string, options?: ServiceHttpOptions) => Promise<{
|
|
4053
|
+
declare const getStore: (id: string, input?: StoreGetInput, options?: ServiceHttpOptions) => Promise<{
|
|
3458
4054
|
id: string;
|
|
3459
4055
|
uid: string;
|
|
3460
4056
|
merchant_id: string;
|
|
@@ -3493,6 +4089,8 @@ declare const getStore: (id: string, options?: ServiceHttpOptions) => Promise<{
|
|
|
3493
4089
|
temporary_closed_until?: string | null | undefined;
|
|
3494
4090
|
status: "CLOSED" | "OPEN" | "TEMPORARILY_CLOSED";
|
|
3495
4091
|
};
|
|
4092
|
+
channel_ids: string[];
|
|
4093
|
+
fulfillment_ids: string[];
|
|
3496
4094
|
tags: Record<string, string | number | boolean>;
|
|
3497
4095
|
cms_template_id?: string | null | undefined;
|
|
3498
4096
|
status: string;
|
|
@@ -3585,11 +4183,14 @@ declare const services: {
|
|
|
3585
4183
|
reorder: typeof reorderOrder;
|
|
3586
4184
|
validate: typeof validateOrder;
|
|
3587
4185
|
place: typeof placeOrder;
|
|
4186
|
+
recordPayment: typeof recordOrderPayment;
|
|
3588
4187
|
getFulfillment: typeof getOrderFulfillment;
|
|
3589
4188
|
listFulfillments: typeof listOrderFulfillments;
|
|
3590
4189
|
};
|
|
3591
4190
|
payments: {
|
|
3592
4191
|
list: typeof listPayments;
|
|
4192
|
+
operation: typeof callPaymentOperation;
|
|
4193
|
+
terminalFailure: typeof reportTerminalFailure;
|
|
3593
4194
|
};
|
|
3594
4195
|
stores: {
|
|
3595
4196
|
list: typeof listStores;
|
|
@@ -3609,6 +4210,32 @@ declare const services: {
|
|
|
3609
4210
|
isDeviceNotLinked: typeof isDeviceNotLinked;
|
|
3610
4211
|
isKioskUnauthorized: typeof isKioskUnauthorized;
|
|
3611
4212
|
};
|
|
4213
|
+
pos: {
|
|
4214
|
+
pair: typeof pairPosDevice;
|
|
4215
|
+
relink: typeof relinkPosDevice;
|
|
4216
|
+
heartbeat: typeof postPosHeartbeat;
|
|
4217
|
+
postHealthSamples: typeof postPosHealthSamples;
|
|
4218
|
+
postLogs: typeof postPosDeviceLogs;
|
|
4219
|
+
listOperators: typeof listPosOperators;
|
|
4220
|
+
verifyOperator: typeof verifyPosOperator;
|
|
4221
|
+
listAuthorizers: typeof listPosAuthorizers;
|
|
4222
|
+
verifyAuthorizer: typeof verifyPosAuthorizer;
|
|
4223
|
+
openSession: typeof openPosSession;
|
|
4224
|
+
countSession: typeof countPosSession;
|
|
4225
|
+
withdraw: typeof withdrawPosSession;
|
|
4226
|
+
drawer: typeof drawerPosSession;
|
|
4227
|
+
closeSession: typeof closePosSession;
|
|
4228
|
+
shiftEnd: typeof shiftEndPosSession;
|
|
4229
|
+
currentSession: typeof getPosCurrentSession;
|
|
4230
|
+
listKioskOrders: typeof listPosKioskOrders;
|
|
4231
|
+
settleKioskOrder: typeof settlePosKioskOrder;
|
|
4232
|
+
getCatalog: typeof getPosCatalog;
|
|
4233
|
+
createOrder: typeof createPosOrder;
|
|
4234
|
+
isDeviceNotLinked: typeof isPosDeviceNotLinked;
|
|
4235
|
+
isUnauthorized: typeof isPosUnauthorized;
|
|
4236
|
+
isPinLocked: typeof isPosPinLocked;
|
|
4237
|
+
localizeError: typeof localizePosError;
|
|
4238
|
+
};
|
|
3612
4239
|
};
|
|
3613
4240
|
//#endregion
|
|
3614
4241
|
//#region src/schedule/schedule.d.ts
|
|
@@ -3623,6 +4250,29 @@ type ScheduleWindow = {
|
|
|
3623
4250
|
declare const getScheduleWindow: (schedule: Schedule | null | undefined, now?: Date) => ScheduleWindow;
|
|
3624
4251
|
declare const isOnSchedule: (schedule: Schedule | null | undefined, now?: Date) => boolean;
|
|
3625
4252
|
//#endregion
|
|
4253
|
+
//#region src/logs/context.d.ts
|
|
4254
|
+
declare const getLogContext: () => SdkLogContext;
|
|
4255
|
+
//#endregion
|
|
4256
|
+
//#region src/logs/log.d.ts
|
|
4257
|
+
/** Sends queued logs now; resolves once every batch has been attempted. */
|
|
4258
|
+
declare const flushLogs: () => Promise<void>;
|
|
4259
|
+
/**
|
|
4260
|
+
* Reports a log to the merchant dashboard with the SDK's current context
|
|
4261
|
+
* (channel, fulfillment, store, brand, device). Never throws; resolves to
|
|
4262
|
+
* `false` when the log could not be delivered.
|
|
4263
|
+
*/
|
|
4264
|
+
declare const log: (level: SdkLogLevel, message: string, options?: SdkLogOptions) => Promise<boolean>;
|
|
4265
|
+
/** `log("error", …)` with message, name, stack and cause read from `error`. */
|
|
4266
|
+
declare const logError: (error: unknown, options?: SdkLogOptions) => Promise<boolean>;
|
|
4267
|
+
//#endregion
|
|
4268
|
+
//#region src/logs/serializeError.d.ts
|
|
4269
|
+
type SerializedError = {
|
|
4270
|
+
message: string;
|
|
4271
|
+
error: SdkLogErrorInfo;
|
|
4272
|
+
};
|
|
4273
|
+
/** Accepts anything a `catch` can receive. */
|
|
4274
|
+
declare const serializeError: (value: unknown) => SerializedError;
|
|
4275
|
+
//#endregion
|
|
3626
4276
|
//#region src/shared/genId.d.ts
|
|
3627
4277
|
type IdBuilder = {
|
|
3628
4278
|
/**
|
|
@@ -3766,4 +4416,77 @@ declare const paymentMatchesClientConditions: (conditions: OrConditions | null |
|
|
|
3766
4416
|
now?: string;
|
|
3767
4417
|
}) => boolean;
|
|
3768
4418
|
//#endregion
|
|
3769
|
-
|
|
4419
|
+
//#region src/card/card.types.d.ts
|
|
4420
|
+
type CardBrand = "visa" | "mastercard" | "amex" | "diners" | "discover" | "jcb" | "unionpay" | "unknown";
|
|
4421
|
+
/** Brands accepted by the customer `payments[].brand` contract. */
|
|
4422
|
+
type PaymentCardBrand = "visa" | "mastercard" | "amex" | "diners" | "discover" | "other";
|
|
4423
|
+
interface CardBrandSpec {
|
|
4424
|
+
brand: CardBrand;
|
|
4425
|
+
label: string;
|
|
4426
|
+
pattern: RegExp;
|
|
4427
|
+
/** Valid PAN lengths, ascending. */
|
|
4428
|
+
lengths: number[];
|
|
4429
|
+
/** Digit indexes where a space is inserted (e.g. `[4, 10]` for 4-6-5). */
|
|
4430
|
+
gaps: number[];
|
|
4431
|
+
/** Valid CVC lengths, ascending. */
|
|
4432
|
+
cvcLengths: number[];
|
|
4433
|
+
}
|
|
4434
|
+
type CardNumberError = "required" | "incomplete" | "invalid";
|
|
4435
|
+
type CardExpiryError = "required" | "incomplete" | "invalid_month" | "expired" | "too_far";
|
|
4436
|
+
type CardCvcError = "required" | "incomplete";
|
|
4437
|
+
type CardholderNameError = "required" | "too_short" | "too_long" | "invalid_chars";
|
|
4438
|
+
interface CardExpiry {
|
|
4439
|
+
month: number;
|
|
4440
|
+
/** Four-digit year. */
|
|
4441
|
+
year: number;
|
|
4442
|
+
}
|
|
4443
|
+
interface CardPreviewSlot {
|
|
4444
|
+
/** Digit, `•` for masked digits, or empty when not typed yet. */
|
|
4445
|
+
char: string;
|
|
4446
|
+
filled: boolean;
|
|
4447
|
+
}
|
|
4448
|
+
//#endregion
|
|
4449
|
+
//#region src/card/card.d.ts
|
|
4450
|
+
/** Detection order matters: narrower prefixes first. */
|
|
4451
|
+
declare const CARD_BRANDS: readonly CardBrandSpec[];
|
|
4452
|
+
declare const cardDigits: (value: string) => string;
|
|
4453
|
+
/** Mod-10 checksum. Expects digits only (non-digits are ignored). */
|
|
4454
|
+
declare const luhnCheck: (value: string) => boolean;
|
|
4455
|
+
declare const cardBrandSpec: (brand: CardBrand) => CardBrandSpec;
|
|
4456
|
+
/** Brand from the typed prefix; `unknown` until the prefix is unambiguous. */
|
|
4457
|
+
declare const detectCardBrand: (value: string) => CardBrand;
|
|
4458
|
+
declare const toPaymentCardBrand: (brand: CardBrand) => PaymentCardBrand;
|
|
4459
|
+
declare const cardNumberMaxLength: (brand: CardBrand) => number;
|
|
4460
|
+
/** Space positions for a PAN of `length` digits (Diners 14 → 4-6-4). */
|
|
4461
|
+
declare const cardNumberGaps: (brand: CardBrand, length: number) => number[];
|
|
4462
|
+
/** Digits only, capped to the brand max length, grouped with spaces. */
|
|
4463
|
+
declare const formatCardNumber: (value: string) => string;
|
|
4464
|
+
/** Caret index in `formatted` right after its `digitCount`-th digit. */
|
|
4465
|
+
declare const caretAfterDigits: (formatted: string, digitCount: number) => number;
|
|
4466
|
+
declare const validateCardNumber: (value: string) => CardNumberError | null;
|
|
4467
|
+
/** Ready to move focus on: a valid length for the brand that passes Luhn. */
|
|
4468
|
+
declare const isCardNumberComplete: (value: string) => boolean;
|
|
4469
|
+
/** Full-length PAN that fails Luhn — safe to flag while the user types. */
|
|
4470
|
+
declare const isCardNumberDefinitelyInvalid: (value: string) => boolean;
|
|
4471
|
+
/**
|
|
4472
|
+
* `MM/YY` as the user types or pastes: `4` → `04`, `13` → `01/3`,
|
|
4473
|
+
* `12/2030` → `12/30`. The slash only appears once a year digit exists so
|
|
4474
|
+
* backspace never gets stuck.
|
|
4475
|
+
*/
|
|
4476
|
+
declare const formatExpiry: (value: string) => string;
|
|
4477
|
+
declare const parseExpiry: (value: string) => CardExpiry | null;
|
|
4478
|
+
declare const isExpiryComplete: (value: string) => boolean;
|
|
4479
|
+
declare const validateExpiry: (value: string, now?: Date) => CardExpiryError | null;
|
|
4480
|
+
declare const cvcMaxLength: (brand: CardBrand) => number;
|
|
4481
|
+
declare const formatCvc: (value: string, brand: CardBrand) => string;
|
|
4482
|
+
declare const validateCvc: (value: string, brand: CardBrand) => CardCvcError | null;
|
|
4483
|
+
declare const isCvcComplete: (value: string, brand: CardBrand) => boolean;
|
|
4484
|
+
declare const normalizeCardholderName: (value: string) => string;
|
|
4485
|
+
declare const validateCardholderName: (value: string) => CardholderNameError | null;
|
|
4486
|
+
/**
|
|
4487
|
+
* Digit slots for a card preview, grouped like the formatted number. Middle
|
|
4488
|
+
* digits are masked as `•`; first and last groups stay readable.
|
|
4489
|
+
*/
|
|
4490
|
+
declare const cardPreviewGroups: (value: string) => CardPreviewSlot[][];
|
|
4491
|
+
//#endregion
|
|
4492
|
+
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 };
|