@compassdigital/sdk.typescript 4.620.0 → 4.621.0
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/lib/index.d.ts +10 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +9 -0
- package/lib/index.js.map +1 -1
- package/lib/interface/consumer.d.ts +131 -6
- package/lib/interface/consumer.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +24 -0
- package/src/interface/consumer.ts +195 -8
|
@@ -228,6 +228,7 @@ export interface OrderDetails {
|
|
|
228
228
|
order_type?: string;
|
|
229
229
|
duration?: string;
|
|
230
230
|
destination?: string;
|
|
231
|
+
receiptEmail?: string;
|
|
231
232
|
}
|
|
232
233
|
|
|
233
234
|
export interface OrderMonetaryValue {
|
|
@@ -265,14 +266,28 @@ export interface OrderCashlessPayment {
|
|
|
265
266
|
name?: string;
|
|
266
267
|
}
|
|
267
268
|
|
|
269
|
+
export interface OrderPOSPayment {
|
|
270
|
+
type?: string;
|
|
271
|
+
transaction?: Record<string, any>;
|
|
272
|
+
}
|
|
273
|
+
|
|
268
274
|
export interface OrderPayment {
|
|
275
|
+
// Payment token
|
|
269
276
|
token?: string;
|
|
277
|
+
// Credit card payment details
|
|
270
278
|
credit_card?: OrderCreditCard;
|
|
279
|
+
// Digital wallet payment token
|
|
271
280
|
digital_wallet_pay?: string;
|
|
281
|
+
// Badge pay cashless payment details
|
|
272
282
|
badge_pay?: OrderCashlessPayment;
|
|
283
|
+
// Stipend cashless payment details
|
|
273
284
|
stipend?: OrderCashlessPayment;
|
|
285
|
+
// Voucher cashless payment details
|
|
274
286
|
voucher?: OrderCashlessPayment;
|
|
287
|
+
// Coupon voucher cashless payment details
|
|
275
288
|
coupon_voucher?: OrderCashlessPayment;
|
|
289
|
+
// POS payment details
|
|
290
|
+
pos?: OrderPOSPayment;
|
|
276
291
|
}
|
|
277
292
|
|
|
278
293
|
export interface OrderMealplan {
|
|
@@ -341,8 +356,15 @@ export interface OrderItemWithIssue {
|
|
|
341
356
|
options?: OrderedItemOptionGroup[];
|
|
342
357
|
}
|
|
343
358
|
|
|
359
|
+
export interface OrderNoRefundMeta {
|
|
360
|
+
reason?: string;
|
|
361
|
+
no_refund_date?: string;
|
|
362
|
+
processed_by?: string;
|
|
363
|
+
}
|
|
364
|
+
|
|
344
365
|
export interface OrderIssueMeta {
|
|
345
366
|
created_at?: string;
|
|
367
|
+
no_refund?: OrderNoRefundMeta;
|
|
346
368
|
}
|
|
347
369
|
|
|
348
370
|
export interface OrderIssue {
|
|
@@ -355,6 +377,7 @@ export interface OrderIssue {
|
|
|
355
377
|
// Issue Meta
|
|
356
378
|
meta?: OrderIssueMeta;
|
|
357
379
|
type?: string;
|
|
380
|
+
item?: Record<string, any>;
|
|
358
381
|
}
|
|
359
382
|
|
|
360
383
|
export interface ShoppingcartSalePrice {
|
|
@@ -818,6 +841,36 @@ export interface GetCustomerOrdersResponseDTO {
|
|
|
818
841
|
orders: CustomerOrder[];
|
|
819
842
|
}
|
|
820
843
|
|
|
844
|
+
export interface CustomerOrderV2 {
|
|
845
|
+
// Order metadata
|
|
846
|
+
meta?: OrderMeta;
|
|
847
|
+
id?: string;
|
|
848
|
+
reorder_eligibility?: string;
|
|
849
|
+
location_brand?: string;
|
|
850
|
+
location?: string;
|
|
851
|
+
customer?: string;
|
|
852
|
+
date?: OrderDate;
|
|
853
|
+
details?: OrderDetails;
|
|
854
|
+
pickup?: string;
|
|
855
|
+
pickup_name?: string;
|
|
856
|
+
requested_date?: string;
|
|
857
|
+
refunds?: OrderRefundItem[];
|
|
858
|
+
pickup_id?: string;
|
|
859
|
+
payment?: OrderPayment;
|
|
860
|
+
mealplan?: OrderMealplan;
|
|
861
|
+
meal_swipes?: OrderMealSwipes;
|
|
862
|
+
is?: OrderIs;
|
|
863
|
+
issue?: OrderIssue;
|
|
864
|
+
past_issues?: OrderIssue[];
|
|
865
|
+
shoppingcart?: string;
|
|
866
|
+
runner?: string;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
export interface GetCustomerOrdersV2ResponseDTO {
|
|
870
|
+
// customer orders
|
|
871
|
+
orders: CustomerOrderV2[];
|
|
872
|
+
}
|
|
873
|
+
|
|
821
874
|
export interface GooglePayToken {
|
|
822
875
|
// Google Pay token signature
|
|
823
876
|
signature?: string;
|
|
@@ -839,17 +892,26 @@ export interface ConsumerPaymentToken {
|
|
|
839
892
|
}
|
|
840
893
|
|
|
841
894
|
export interface CreateOrderPayment {
|
|
895
|
+
// Deprecated payment token
|
|
842
896
|
token?: string | Record<string, any>;
|
|
897
|
+
// Consumer payment token (Google Pay, Apple Pay, etc.)
|
|
843
898
|
consumer_payment_token?: ConsumerPaymentToken;
|
|
899
|
+
// Credit card payment details
|
|
844
900
|
credit_card?: OrderCreditCard;
|
|
901
|
+
// Badge pay cashless payment details
|
|
845
902
|
badge_pay?: OrderCashlessPayment;
|
|
903
|
+
// Stipend cashless payment details
|
|
846
904
|
stipend?: OrderCashlessPayment;
|
|
905
|
+
// Voucher cashless payment details
|
|
847
906
|
voucher?: OrderCashlessPayment;
|
|
907
|
+
// Coupon voucher cashless payment details
|
|
848
908
|
coupon_voucher?: OrderCashlessPayment;
|
|
849
909
|
}
|
|
850
910
|
|
|
851
911
|
export interface CreateOrderIs {
|
|
912
|
+
// Is the order in progress
|
|
852
913
|
in_progress?: boolean;
|
|
914
|
+
// Is the order ready
|
|
853
915
|
ready?: boolean;
|
|
854
916
|
}
|
|
855
917
|
|
|
@@ -861,16 +923,25 @@ export interface CreateOrderMeta {
|
|
|
861
923
|
}
|
|
862
924
|
|
|
863
925
|
export interface CreateOrderDetails {
|
|
926
|
+
// Customer name
|
|
864
927
|
name?: string;
|
|
928
|
+
// Customer contact number
|
|
865
929
|
contact_number?: string;
|
|
930
|
+
// Customer country code
|
|
931
|
+
country_code?: string;
|
|
932
|
+
// Order type
|
|
866
933
|
order_type?: string;
|
|
934
|
+
// Order duration
|
|
867
935
|
duration?: string;
|
|
936
|
+
// Delivery destination
|
|
868
937
|
destination?: string;
|
|
869
938
|
// Pickup or delivery instructions
|
|
870
939
|
instructions?: string;
|
|
871
940
|
}
|
|
872
941
|
|
|
873
942
|
export interface PostOrderBodyDto {
|
|
943
|
+
// Order ID
|
|
944
|
+
id?: string;
|
|
874
945
|
// The location brand
|
|
875
946
|
location_brand?: string;
|
|
876
947
|
// The location
|
|
@@ -897,6 +968,42 @@ export interface PostOrderBodyDto {
|
|
|
897
968
|
details?: CreateOrderDetails;
|
|
898
969
|
}
|
|
899
970
|
|
|
971
|
+
export interface OrderDiscountEffect {
|
|
972
|
+
type?: string;
|
|
973
|
+
amount_off?: number;
|
|
974
|
+
percent_off?: number;
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
export interface OrderDiscountItem {
|
|
978
|
+
id?: string;
|
|
979
|
+
date?: string;
|
|
980
|
+
result?: boolean;
|
|
981
|
+
discount?: OrderDiscountEffect;
|
|
982
|
+
type?: string;
|
|
983
|
+
original_redemption?: string;
|
|
984
|
+
app?: string;
|
|
985
|
+
name?: string;
|
|
986
|
+
resource_id?: string;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
export interface OrderDiscountsRefundItem {
|
|
990
|
+
source_id?: string;
|
|
991
|
+
quantity?: number;
|
|
992
|
+
price?: number;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
export interface OrderDiscountsRefund {
|
|
996
|
+
app?: string;
|
|
997
|
+
date?: string;
|
|
998
|
+
order_created_at?: string;
|
|
999
|
+
order_id?: string;
|
|
1000
|
+
order_items?: OrderDiscountsRefundItem[];
|
|
1001
|
+
order_total?: number;
|
|
1002
|
+
reason?: string;
|
|
1003
|
+
redemption_id?: string;
|
|
1004
|
+
result?: boolean;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
900
1007
|
export interface PlacedOrderMeta {
|
|
901
1008
|
// Check-in UUID for frictionless orders
|
|
902
1009
|
checkin_uuid?: string;
|
|
@@ -919,6 +1026,14 @@ export interface PlacedOrderMeta {
|
|
|
919
1026
|
// Indicate whether the order is eligible for cancellation
|
|
920
1027
|
cancel_eligible?: boolean;
|
|
921
1028
|
refunds?: OrderRefundTransaction[];
|
|
1029
|
+
pickup_instruction?: MultiLanguageLabel;
|
|
1030
|
+
market_place_label?: MultiLanguageLabel;
|
|
1031
|
+
market_place_description?: MultiLanguageLabel;
|
|
1032
|
+
apex_code?: string;
|
|
1033
|
+
apex_qr?: string;
|
|
1034
|
+
apex_codes?: ApexCodes;
|
|
1035
|
+
discounts?: OrderDiscountItem[];
|
|
1036
|
+
discounts_refund?: OrderDiscountsRefund;
|
|
922
1037
|
}
|
|
923
1038
|
|
|
924
1039
|
export interface PostOrderResponseDTO {
|
|
@@ -2325,12 +2440,10 @@ export interface ConsumerCashlessTender {
|
|
|
2325
2440
|
balance?: number;
|
|
2326
2441
|
// Cashless tender ID
|
|
2327
2442
|
id?: string;
|
|
2443
|
+
// Cashless tender
|
|
2444
|
+
tender?: string;
|
|
2328
2445
|
// Cashless tender name
|
|
2329
2446
|
name?: string;
|
|
2330
|
-
// Cashless tender total
|
|
2331
|
-
total?: number;
|
|
2332
|
-
// Cashless tender tender
|
|
2333
|
-
tender?: string;
|
|
2334
2447
|
// Cashless tender type
|
|
2335
2448
|
type?: 'badge_pay' | 'stipend' | 'voucher' | 'coupon_voucher';
|
|
2336
2449
|
}
|
|
@@ -2678,8 +2791,8 @@ export interface ConsumerModifierRequest {
|
|
|
2678
2791
|
quantity?: number;
|
|
2679
2792
|
amount_off_exclusions?: Record<string, any>[];
|
|
2680
2793
|
meta?: ConsumerModifierRequestMeta;
|
|
2681
|
-
|
|
2682
|
-
|
|
2794
|
+
isSelected?: boolean;
|
|
2795
|
+
parentLabel?: ConsumerLabel;
|
|
2683
2796
|
price?: ConsumerPrice;
|
|
2684
2797
|
}
|
|
2685
2798
|
|
|
@@ -2816,6 +2929,8 @@ export interface PostConsumerShoppingCartResponse {
|
|
|
2816
2929
|
export interface PostConsumerPromoValidateRequest {
|
|
2817
2930
|
// The code of the promo voucher
|
|
2818
2931
|
code?: string;
|
|
2932
|
+
// The customer ID
|
|
2933
|
+
customer_id?: string;
|
|
2819
2934
|
// The email of the customer
|
|
2820
2935
|
email?: string;
|
|
2821
2936
|
// The app of the customer
|
|
@@ -2842,6 +2957,22 @@ export interface ConsumerAppliedDiscount {
|
|
|
2842
2957
|
amount_limit?: number;
|
|
2843
2958
|
}
|
|
2844
2959
|
|
|
2960
|
+
export interface RedeemableResult {
|
|
2961
|
+
discount?: ConsumerAppliedDiscount;
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
export interface RedeemableOrder {
|
|
2965
|
+
total_applied_discount_amount?: number;
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
export interface ConsumerRedeemable {
|
|
2969
|
+
status: string;
|
|
2970
|
+
id: string;
|
|
2971
|
+
object: Record<string, any>;
|
|
2972
|
+
result?: RedeemableResult;
|
|
2973
|
+
order?: RedeemableOrder;
|
|
2974
|
+
}
|
|
2975
|
+
|
|
2845
2976
|
export interface ConsumerVoucher {
|
|
2846
2977
|
provider?: Record<string, any>;
|
|
2847
2978
|
code?: string;
|
|
@@ -2849,17 +2980,55 @@ export interface ConsumerVoucher {
|
|
|
2849
2980
|
discount?: ConsumerAppliedDiscount;
|
|
2850
2981
|
app?: string;
|
|
2851
2982
|
provider_data?: ShoppingcartFPValidationData;
|
|
2983
|
+
stacked_total?: number;
|
|
2984
|
+
redeemables?: ConsumerRedeemable[];
|
|
2985
|
+
stacked_vouchers?: ConsumerRedeemable[];
|
|
2986
|
+
inapplicable_redeemables?: ConsumerRedeemable[];
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
export interface PromoRedeemShoppingcart {
|
|
2990
|
+
// The shopping cart ID
|
|
2991
|
+
id?: string;
|
|
2992
|
+
// The date the shopping cart was created
|
|
2993
|
+
date_created?: string;
|
|
2994
|
+
// Items in the shopping cart
|
|
2995
|
+
items?: Record<string, any>[];
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
export interface PromoRedeemTotals {
|
|
2999
|
+
// The total amount
|
|
3000
|
+
amount?: number;
|
|
3001
|
+
// The discount amount
|
|
3002
|
+
discount?: number;
|
|
3003
|
+
// The currency code
|
|
3004
|
+
currency?: string;
|
|
2852
3005
|
}
|
|
2853
3006
|
|
|
2854
3007
|
export interface PostConsumerPromoRedeemRequest {
|
|
2855
3008
|
// The promo code to redeem
|
|
2856
3009
|
code: string;
|
|
2857
3010
|
// The email of the customer
|
|
2858
|
-
email
|
|
3011
|
+
email?: string;
|
|
2859
3012
|
// The app of the customer
|
|
2860
|
-
app
|
|
3013
|
+
app?: string;
|
|
3014
|
+
// The realm of the customer
|
|
3015
|
+
realm?: string;
|
|
2861
3016
|
// The location brand of the customer
|
|
2862
3017
|
location_brand?: string;
|
|
3018
|
+
// The customer ID
|
|
3019
|
+
customer_id?: string;
|
|
3020
|
+
// The order ID
|
|
3021
|
+
order_id?: string;
|
|
3022
|
+
// The brand ID
|
|
3023
|
+
brand_id?: string;
|
|
3024
|
+
// The site ID
|
|
3025
|
+
site_id?: string;
|
|
3026
|
+
// The payment request ID
|
|
3027
|
+
payment_request_id?: string;
|
|
3028
|
+
// The shopping cart details
|
|
3029
|
+
shoppingcart?: PromoRedeemShoppingcart;
|
|
3030
|
+
// The order totals
|
|
3031
|
+
totals?: PromoRedeemTotals;
|
|
2863
3032
|
}
|
|
2864
3033
|
|
|
2865
3034
|
export interface ConsumerRedemption {
|
|
@@ -4107,6 +4276,24 @@ export interface GetCustomerOrdersQuery {
|
|
|
4107
4276
|
|
|
4108
4277
|
export type GetCustomerOrdersResponse = GetCustomerOrdersResponseDTO;
|
|
4109
4278
|
|
|
4279
|
+
// GET /consumer/v2/customer-orders/{userId} - Get customer orders
|
|
4280
|
+
|
|
4281
|
+
export interface GetCustomerOrdersV2Path {
|
|
4282
|
+
// a valid CDL user id
|
|
4283
|
+
userId: string;
|
|
4284
|
+
}
|
|
4285
|
+
|
|
4286
|
+
export interface GetCustomerOrdersV2Query {
|
|
4287
|
+
// Filter orders by their requested date. Only return orders that have a date greater than or equal to the date. Default is the current time in milliseconds. Please ensure to use a millisecond timestamp, not just an epoch timestamp
|
|
4288
|
+
start?: number;
|
|
4289
|
+
// Filter orders by their requested date. Only return orders that have a date less than or equal to the date. Default is 24 hours from the current time in milliseconds. Please ensure to use a millisecond timestamp, not just an epoch timestamp
|
|
4290
|
+
end?: number;
|
|
4291
|
+
// When true, only orders eligible for reorder are returned. When false, only orders that are not eligible for reorder are returned. If omitted, no filter is applied.
|
|
4292
|
+
reorderEligible?: boolean;
|
|
4293
|
+
}
|
|
4294
|
+
|
|
4295
|
+
export type GetCustomerOrdersV2Response = GetCustomerOrdersV2ResponseDTO;
|
|
4296
|
+
|
|
4110
4297
|
// POST /consumer/order - Create a new order
|
|
4111
4298
|
|
|
4112
4299
|
export type PostConsumerOrderBody = PostOrderBodyDto;
|