@compassdigital/sdk.typescript 4.29.0 → 4.32.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/.vscode/settings.json +5 -0
- package/lib/base.js +5 -5
- package/lib/base.js.map +1 -1
- package/lib/index.d.ts +67 -28
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +73 -31
- package/lib/index.js.map +1 -1
- package/lib/interface/consumer.d.ts +2 -1
- package/lib/interface/consumer.d.ts.map +1 -1
- package/lib/interface/location.d.ts +3 -3
- package/lib/interface/location.d.ts.map +1 -1
- package/lib/interface/menu.d.ts +68 -4
- package/lib/interface/menu.d.ts.map +1 -1
- package/lib/interface/partner.d.ts +3 -2
- package/lib/interface/partner.d.ts.map +1 -1
- package/lib/interface/payment.d.ts +0 -11
- package/lib/interface/payment.d.ts.map +1 -1
- package/lib/interface/promo.d.ts.map +1 -1
- package/lib/interface/tax.d.ts +67 -0
- package/lib/interface/tax.d.ts.map +1 -0
- package/lib/interface/tax.js +5 -0
- package/lib/interface/tax.js.map +1 -0
- package/manifest.json +4 -0
- package/package.json +1 -1
- package/src/index.ts +144 -48
- package/src/interface/consumer.ts +3 -1
- package/src/interface/location.ts +3 -3
- package/src/interface/menu.ts +99 -4
- package/src/interface/partner.ts +3 -2
- package/src/interface/payment.ts +8 -28
- package/src/interface/promo.ts +2 -4
- package/src/interface/shoppingcart.ts +3 -3
- package/src/interface/tax.ts +113 -0
package/src/interface/payment.ts
CHANGED
|
@@ -204,7 +204,7 @@ export interface ApplePayMerchantSession {
|
|
|
204
204
|
// POST /payment/{id}/transaction
|
|
205
205
|
|
|
206
206
|
export interface PostPaymentTransactionPath {
|
|
207
|
-
//
|
|
207
|
+
// Payment ID
|
|
208
208
|
id: string;
|
|
209
209
|
}
|
|
210
210
|
|
|
@@ -242,9 +242,9 @@ export interface PostPaymentTransactionRequest extends BaseRequest, PostPaymentT
|
|
|
242
242
|
// POST /payment/{id}/transaction/{transaction_id}/refund
|
|
243
243
|
|
|
244
244
|
export interface PostPaymentTransactionRefundPath {
|
|
245
|
-
//
|
|
245
|
+
// Payment ID
|
|
246
246
|
id: string;
|
|
247
|
-
//
|
|
247
|
+
// Transaction ID
|
|
248
248
|
transaction_id: string;
|
|
249
249
|
}
|
|
250
250
|
|
|
@@ -266,7 +266,7 @@ export interface PostPaymentTransactionRefundRequest
|
|
|
266
266
|
// GET /payment/{id}/clienttoken
|
|
267
267
|
|
|
268
268
|
export interface GetPaymentClienttokenPath {
|
|
269
|
-
//
|
|
269
|
+
// Payment ID
|
|
270
270
|
id: string;
|
|
271
271
|
}
|
|
272
272
|
|
|
@@ -287,7 +287,7 @@ export interface GetPaymentClienttokenRequest
|
|
|
287
287
|
// POST /payment/{id}/paymenttoken
|
|
288
288
|
|
|
289
289
|
export interface PostPaymentPaymenttokenPath {
|
|
290
|
-
//
|
|
290
|
+
// Payment ID
|
|
291
291
|
id: string;
|
|
292
292
|
}
|
|
293
293
|
|
|
@@ -345,26 +345,6 @@ export interface PostPaymentMethodRequest extends BaseRequest {
|
|
|
345
345
|
body: PostPaymentMethodBody;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
// DELETE /payment/{id}/method/{method_id}
|
|
349
|
-
|
|
350
|
-
export interface DeletePaymentMethodPath {
|
|
351
|
-
// TODO: add parameter to swagger.json
|
|
352
|
-
id: string;
|
|
353
|
-
// TODO: add parameter to swagger.json
|
|
354
|
-
method_id: string;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
export interface DeletePaymentMethodBody {
|
|
358
|
-
// The user from where the payment method will be deleted
|
|
359
|
-
user: string;
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
export type DeletePaymentMethodResponse = Success;
|
|
363
|
-
|
|
364
|
-
export interface DeletePaymentMethodRequest extends BaseRequest, DeletePaymentMethodPath {
|
|
365
|
-
body: DeletePaymentMethodBody;
|
|
366
|
-
}
|
|
367
|
-
|
|
368
348
|
// GET /payment/token
|
|
369
349
|
|
|
370
350
|
export interface GetPaymentTokenQuery {
|
|
@@ -462,7 +442,7 @@ export interface GetPaymentHpcRequest extends BaseRequest, RequestQuery<GetPayme
|
|
|
462
442
|
// GET /payment/{id}/cashless
|
|
463
443
|
|
|
464
444
|
export interface GetPaymentCashlessPath {
|
|
465
|
-
//
|
|
445
|
+
// Payment ID
|
|
466
446
|
id: string;
|
|
467
447
|
}
|
|
468
448
|
|
|
@@ -483,7 +463,7 @@ export interface GetPaymentCashlessRequest
|
|
|
483
463
|
// POST /payment/{id}/cashless
|
|
484
464
|
|
|
485
465
|
export interface PostPaymentCashlessPath {
|
|
486
|
-
//
|
|
466
|
+
// Payment ID
|
|
487
467
|
id: string;
|
|
488
468
|
}
|
|
489
469
|
|
|
@@ -503,7 +483,7 @@ export interface PostPaymentCashlessRequest extends BaseRequest, PostPaymentCash
|
|
|
503
483
|
// DELETE /payment/{id}/cashless
|
|
504
484
|
|
|
505
485
|
export interface DeletePaymentCashlessPath {
|
|
506
|
-
//
|
|
486
|
+
// Payment ID
|
|
507
487
|
id: string;
|
|
508
488
|
}
|
|
509
489
|
|
package/src/interface/promo.ts
CHANGED
|
@@ -427,7 +427,6 @@ export interface PostPromoVoucherRequest extends BaseRequest {
|
|
|
427
427
|
// PUT /promo/voucher/{id} - Update voucher
|
|
428
428
|
|
|
429
429
|
export interface PutPromoVoucherPath {
|
|
430
|
-
// TODO: add parameter to swagger.json
|
|
431
430
|
id: string;
|
|
432
431
|
}
|
|
433
432
|
|
|
@@ -442,7 +441,6 @@ export interface PutPromoVoucherRequest extends BaseRequest, PutPromoVoucherPath
|
|
|
442
441
|
// DELETE /promo/voucher/{id} - Delete voucher
|
|
443
442
|
|
|
444
443
|
export interface DeletePromoVoucherPath {
|
|
445
|
-
// TODO: add parameter to swagger.json
|
|
446
444
|
id: string;
|
|
447
445
|
}
|
|
448
446
|
|
|
@@ -460,7 +458,7 @@ export interface DeletePromoVoucherRequest
|
|
|
460
458
|
RequestQuery<DeletePromoVoucherQuery>,
|
|
461
459
|
DeletePromoVoucherPath {}
|
|
462
460
|
|
|
463
|
-
// POST /promo/customer
|
|
461
|
+
// POST /promo/customer - Add user to voucherify
|
|
464
462
|
|
|
465
463
|
export type PostPromoCustomerBody = VoucherifyCustomer;
|
|
466
464
|
|
|
@@ -470,7 +468,7 @@ export interface PostPromoCustomerRequest extends BaseRequest {
|
|
|
470
468
|
body: PostPromoCustomerBody;
|
|
471
469
|
}
|
|
472
470
|
|
|
473
|
-
// DELETE /promo/customer
|
|
471
|
+
// DELETE /promo/customer - Delete user from voucherify
|
|
474
472
|
|
|
475
473
|
export interface DeletePromoCustomerBody {
|
|
476
474
|
user_id?: string;
|
|
@@ -430,7 +430,7 @@ export interface FPValidationData {
|
|
|
430
430
|
|
|
431
431
|
export type AmountOffExclusion = "discount" | "promo";
|
|
432
432
|
|
|
433
|
-
// POST /shoppingcart
|
|
433
|
+
// POST /shoppingcart - Create a new ShoppingCart
|
|
434
434
|
|
|
435
435
|
export type PostShoppingcartCartBody = ShoppingCartRequest;
|
|
436
436
|
|
|
@@ -534,7 +534,7 @@ export interface DeleteShoppingcartCartPromoRequest
|
|
|
534
534
|
extends BaseRequest,
|
|
535
535
|
DeleteShoppingcartCartPromoPath {}
|
|
536
536
|
|
|
537
|
-
// PUT /shoppingcart/{id}/paymentmethod
|
|
537
|
+
// PUT /shoppingcart/{id}/paymentmethod - Change payment method used in shopping cart
|
|
538
538
|
|
|
539
539
|
export interface PutShoppingcartCartPaymentPath {
|
|
540
540
|
// Shopping cart ID
|
|
@@ -570,7 +570,7 @@ export interface GetShoppingcartPaymentMethodsRequest
|
|
|
570
570
|
RequestQuery<GetShoppingcartPaymentMethodsQuery>,
|
|
571
571
|
GetShoppingcartPaymentMethodsPath {}
|
|
572
572
|
|
|
573
|
-
// PUT /shoppingcart/{id}/order
|
|
573
|
+
// PUT /shoppingcart/{id}/order - Store information about the order created with this shopping cart
|
|
574
574
|
|
|
575
575
|
export interface PutShoppingcartCartOrderPath {
|
|
576
576
|
// Shopping cart ID
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
|
|
3
|
+
|
|
4
|
+
import { RequestQuery, BaseRequest } from "./util";
|
|
5
|
+
|
|
6
|
+
export interface LocationData {
|
|
7
|
+
// unique location identifier
|
|
8
|
+
id: string;
|
|
9
|
+
// country of transaction
|
|
10
|
+
country: string;
|
|
11
|
+
// state or province of transaction
|
|
12
|
+
stateOrProvince: string;
|
|
13
|
+
// city of transaction
|
|
14
|
+
city: string;
|
|
15
|
+
// postal code of transaction
|
|
16
|
+
postalCode: string;
|
|
17
|
+
// street address of transaction
|
|
18
|
+
streetAddress: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ItemDTO {
|
|
22
|
+
// unique item identifier
|
|
23
|
+
id: string;
|
|
24
|
+
// indicates a tax rule for an item
|
|
25
|
+
taxTag: string;
|
|
26
|
+
// amount of an item
|
|
27
|
+
quantity: number;
|
|
28
|
+
// decimal price of an item
|
|
29
|
+
price: number;
|
|
30
|
+
// amount of tax charged on an item after funds are captured
|
|
31
|
+
taxedAmount?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Refund {
|
|
35
|
+
// unique identifier of the refunded item
|
|
36
|
+
refundItemId: string;
|
|
37
|
+
// quantity amount of the item to be refunded
|
|
38
|
+
refundItemQuantity: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface TaxRequestDTO {
|
|
42
|
+
// the unique location code
|
|
43
|
+
id: string;
|
|
44
|
+
// the order fulfillment type
|
|
45
|
+
transactionType: "pickup" | "delivery";
|
|
46
|
+
// numeric value of service fee
|
|
47
|
+
serviceFee?: number;
|
|
48
|
+
// numeric value of delivery fee
|
|
49
|
+
deliveryFee?: number;
|
|
50
|
+
locationData: LocationData;
|
|
51
|
+
// items to calculate tax on
|
|
52
|
+
items: ItemDTO[];
|
|
53
|
+
// iso timstamp of transaction date
|
|
54
|
+
transactionDate: string;
|
|
55
|
+
// an array of items to refund
|
|
56
|
+
refunds: Refund[];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface TaxBreakdown {
|
|
60
|
+
// canadian value: goods and services tax
|
|
61
|
+
gst?: number;
|
|
62
|
+
// canadian value: provincial sales tax
|
|
63
|
+
pst?: number;
|
|
64
|
+
// canadian value: quebec sales tax
|
|
65
|
+
qst?: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface TaxResponseDTO {
|
|
69
|
+
// the total tax calculated on a transaction
|
|
70
|
+
amount: number;
|
|
71
|
+
// the total tax rate applied to the items to determine the total tax of the transaction
|
|
72
|
+
rate: number;
|
|
73
|
+
breakdown: TaxBreakdown;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface BadRequestErrorDTO {
|
|
77
|
+
message: string;
|
|
78
|
+
code: number;
|
|
79
|
+
data: Record<string, any>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export interface UnauthorizedErrorDTO {
|
|
83
|
+
message: string;
|
|
84
|
+
code: number;
|
|
85
|
+
data: Record<string, any>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface ServiceUnavailableErrorDTO {
|
|
89
|
+
message: string;
|
|
90
|
+
code: number;
|
|
91
|
+
data: Record<string, any>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// GET /tax/v1/health-check - Health Check
|
|
95
|
+
|
|
96
|
+
export interface TaxHealthCheckQuery {
|
|
97
|
+
// Graphql query string
|
|
98
|
+
_query?: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type TaxHealthCheckResponse = {};
|
|
102
|
+
|
|
103
|
+
export interface TaxHealthCheckRequest extends BaseRequest, RequestQuery<TaxHealthCheckQuery> {}
|
|
104
|
+
|
|
105
|
+
// POST /tax/quote - get tax quote from 3rd party tax library
|
|
106
|
+
|
|
107
|
+
export type QuoteBody = TaxRequestDTO;
|
|
108
|
+
|
|
109
|
+
export type QuoteResponse = TaxResponseDTO;
|
|
110
|
+
|
|
111
|
+
export interface QuoteRequest extends BaseRequest {
|
|
112
|
+
body: QuoteBody;
|
|
113
|
+
}
|