@compassdigital/sdk.typescript 4.30.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 +16 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +17 -0
- package/lib/index.js.map +1 -1
- package/lib/interface/menu.d.ts +25 -3
- package/lib/interface/menu.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 +30 -0
- package/src/interface/menu.ts +26 -3
- package/src/interface/tax.ts +113 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { RequestQuery, BaseRequest } from "./util";
|
|
2
|
+
export interface LocationData {
|
|
3
|
+
id: string;
|
|
4
|
+
country: string;
|
|
5
|
+
stateOrProvince: string;
|
|
6
|
+
city: string;
|
|
7
|
+
postalCode: string;
|
|
8
|
+
streetAddress: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ItemDTO {
|
|
11
|
+
id: string;
|
|
12
|
+
taxTag: string;
|
|
13
|
+
quantity: number;
|
|
14
|
+
price: number;
|
|
15
|
+
taxedAmount?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface Refund {
|
|
18
|
+
refundItemId: string;
|
|
19
|
+
refundItemQuantity: number;
|
|
20
|
+
}
|
|
21
|
+
export interface TaxRequestDTO {
|
|
22
|
+
id: string;
|
|
23
|
+
transactionType: "pickup" | "delivery";
|
|
24
|
+
serviceFee?: number;
|
|
25
|
+
deliveryFee?: number;
|
|
26
|
+
locationData: LocationData;
|
|
27
|
+
items: ItemDTO[];
|
|
28
|
+
transactionDate: string;
|
|
29
|
+
refunds: Refund[];
|
|
30
|
+
}
|
|
31
|
+
export interface TaxBreakdown {
|
|
32
|
+
gst?: number;
|
|
33
|
+
pst?: number;
|
|
34
|
+
qst?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface TaxResponseDTO {
|
|
37
|
+
amount: number;
|
|
38
|
+
rate: number;
|
|
39
|
+
breakdown: TaxBreakdown;
|
|
40
|
+
}
|
|
41
|
+
export interface BadRequestErrorDTO {
|
|
42
|
+
message: string;
|
|
43
|
+
code: number;
|
|
44
|
+
data: Record<string, any>;
|
|
45
|
+
}
|
|
46
|
+
export interface UnauthorizedErrorDTO {
|
|
47
|
+
message: string;
|
|
48
|
+
code: number;
|
|
49
|
+
data: Record<string, any>;
|
|
50
|
+
}
|
|
51
|
+
export interface ServiceUnavailableErrorDTO {
|
|
52
|
+
message: string;
|
|
53
|
+
code: number;
|
|
54
|
+
data: Record<string, any>;
|
|
55
|
+
}
|
|
56
|
+
export interface TaxHealthCheckQuery {
|
|
57
|
+
_query?: string;
|
|
58
|
+
}
|
|
59
|
+
export type TaxHealthCheckResponse = {};
|
|
60
|
+
export interface TaxHealthCheckRequest extends BaseRequest, RequestQuery<TaxHealthCheckQuery> {
|
|
61
|
+
}
|
|
62
|
+
export type QuoteBody = TaxRequestDTO;
|
|
63
|
+
export type QuoteResponse = TaxResponseDTO;
|
|
64
|
+
export interface QuoteRequest extends BaseRequest {
|
|
65
|
+
body: QuoteBody;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=tax.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tax.d.ts","sourceRoot":"","sources":["../../src/interface/tax.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEnD,MAAM,WAAW,YAAY;IAE3B,EAAE,EAAE,MAAM,CAAC;IAEX,OAAO,EAAE,MAAM,CAAC;IAEhB,eAAe,EAAE,MAAM,CAAC;IAExB,IAAI,EAAE,MAAM,CAAC;IAEb,UAAU,EAAE,MAAM,CAAC;I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,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC3B;AAID,MAAM,WAAW,mBAAmB;IAElC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAExC,MAAM,WAAW,qBAAsB,SAAQ,WAAW,EAAE,YAAY,CAAC,mBAAmB,CAAC;CAAG;AAIhG,MAAM,MAAM,SAAS,GAAG,aAAa,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;AAE3C,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,IAAI,EAAE,SAAS,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tax.js","sourceRoot":"","sources":["../../src/interface/tax.ts"],"names":[],"mappings":";AAAA,oBAAoB;AACpB,sDAAsD"}
|
package/manifest.json
CHANGED
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -937,6 +937,13 @@ import {
|
|
|
937
937
|
GetCentricosLookerEmbedurlResponse,
|
|
938
938
|
} from "./interface/centricos";
|
|
939
939
|
|
|
940
|
+
import {
|
|
941
|
+
TaxHealthCheckQuery,
|
|
942
|
+
TaxHealthCheckResponse,
|
|
943
|
+
QuoteBody,
|
|
944
|
+
QuoteResponse,
|
|
945
|
+
} from "./interface/tax";
|
|
946
|
+
|
|
940
947
|
import { BaseServiceClient, RequestOptions, ResponsePromise } from "./base";
|
|
941
948
|
export * from "./base";
|
|
942
949
|
|
|
@@ -9575,4 +9582,27 @@ export class ServiceClient extends BaseServiceClient {
|
|
|
9575
9582
|
options,
|
|
9576
9583
|
);
|
|
9577
9584
|
}
|
|
9585
|
+
|
|
9586
|
+
/**
|
|
9587
|
+
* GET /tax/v1/health-check - Health Check
|
|
9588
|
+
*
|
|
9589
|
+
* @param options - additional request options
|
|
9590
|
+
*/
|
|
9591
|
+
tax_health_check(
|
|
9592
|
+
options?: {
|
|
9593
|
+
query?: TaxHealthCheckQuery;
|
|
9594
|
+
} & RequestOptions,
|
|
9595
|
+
): ResponsePromise<TaxHealthCheckResponse> {
|
|
9596
|
+
return this.request("tax", "tax_health_check", "get", `/tax/v1/health-check`, null, options);
|
|
9597
|
+
}
|
|
9598
|
+
|
|
9599
|
+
/**
|
|
9600
|
+
* POST /tax/quote - get tax quote from 3rd party tax library
|
|
9601
|
+
*
|
|
9602
|
+
* @param body
|
|
9603
|
+
* @param options - additional request options
|
|
9604
|
+
*/
|
|
9605
|
+
quote(body: QuoteBody, options?: RequestOptions): ResponsePromise<QuoteResponse> {
|
|
9606
|
+
return this.request("tax", "quote", "post", `/tax/quote`, body, options);
|
|
9607
|
+
}
|
|
9578
9608
|
}
|
package/src/interface/menu.ts
CHANGED
|
@@ -644,6 +644,7 @@ export interface DraftModifierGroupDTO {
|
|
|
644
644
|
order_type?: "selection" | "option" | "quantity";
|
|
645
645
|
sizing?: string;
|
|
646
646
|
is_out_of_stock?: FilterFieldDTO;
|
|
647
|
+
is_incremental?: FilterFieldDTO;
|
|
647
648
|
applied_diff_snapshot?: FilterFieldDTO;
|
|
648
649
|
brand?: Record<string, any>;
|
|
649
650
|
changes?: ModifierGroupChangeDTO[];
|
|
@@ -833,6 +834,15 @@ export interface BrandStatusDTO {
|
|
|
833
834
|
[index: string]: any;
|
|
834
835
|
}
|
|
835
836
|
|
|
837
|
+
export interface SiteGroupWithMenuGroupNameResponseDTO {
|
|
838
|
+
site_id: string;
|
|
839
|
+
local_menu_group_id: string;
|
|
840
|
+
local_menu_group_name: string;
|
|
841
|
+
created_at?: string;
|
|
842
|
+
updated_at?: string;
|
|
843
|
+
[index: string]: any;
|
|
844
|
+
}
|
|
845
|
+
|
|
836
846
|
export interface SiteGroupDTO {
|
|
837
847
|
site_id: string;
|
|
838
848
|
local_menu_group_id: string;
|
|
@@ -913,6 +923,7 @@ export interface DraftModifierGroupDraftModifierGroupDTO {
|
|
|
913
923
|
order_type?: FilterFieldDTO;
|
|
914
924
|
sizing?: FilterFieldDTO;
|
|
915
925
|
is_out_of_stock?: FilterFieldDTO;
|
|
926
|
+
is_incremental?: FilterFieldDTO;
|
|
916
927
|
id?: FilterFieldDTO;
|
|
917
928
|
version?: FilterFieldDTO;
|
|
918
929
|
created_at?: FilterFieldDTO;
|
|
@@ -1113,6 +1124,7 @@ export interface PublishedModifierGroupDTO {
|
|
|
1113
1124
|
order_type?: "selection" | "option" | "quantity";
|
|
1114
1125
|
sizing?: string;
|
|
1115
1126
|
is_out_of_stock?: boolean;
|
|
1127
|
+
is_incremental?: boolean;
|
|
1116
1128
|
permissions?: Record<string, any>;
|
|
1117
1129
|
[index: string]: any;
|
|
1118
1130
|
}
|
|
@@ -1677,6 +1689,7 @@ export interface PublishedModifierGroupPublishedModifierGroupDTO {
|
|
|
1677
1689
|
order_type?: FilterFieldDTO;
|
|
1678
1690
|
sizing?: FilterFieldDTO;
|
|
1679
1691
|
is_out_of_stock?: FilterFieldDTO;
|
|
1692
|
+
is_incremental?: FilterFieldDTO;
|
|
1680
1693
|
id?: FilterFieldDTO;
|
|
1681
1694
|
version?: FilterFieldDTO;
|
|
1682
1695
|
created_at?: FilterFieldDTO;
|
|
@@ -2726,7 +2739,7 @@ export interface GetMenuV3LocalMenuGroupSiteQuery {
|
|
|
2726
2739
|
}
|
|
2727
2740
|
|
|
2728
2741
|
export interface GetMenuV3LocalMenuGroupSiteResponse {
|
|
2729
|
-
results?:
|
|
2742
|
+
results?: SiteGroupWithMenuGroupNameResponseDTO[];
|
|
2730
2743
|
}
|
|
2731
2744
|
|
|
2732
2745
|
export interface GetMenuV3LocalMenuGroupSiteRequest
|
|
@@ -2746,7 +2759,7 @@ export interface GetMenuV3LocalMenuGroupMenuGroupQuery {
|
|
|
2746
2759
|
}
|
|
2747
2760
|
|
|
2748
2761
|
export interface GetMenuV3LocalMenuGroupMenuGroupResponse {
|
|
2749
|
-
results?:
|
|
2762
|
+
results?: SiteGroupWithMenuGroupNameResponseDTO[];
|
|
2750
2763
|
}
|
|
2751
2764
|
|
|
2752
2765
|
export interface GetMenuV3LocalMenuGroupMenuGroupRequest
|
|
@@ -2756,7 +2769,13 @@ export interface GetMenuV3LocalMenuGroupMenuGroupRequest
|
|
|
2756
2769
|
|
|
2757
2770
|
// POST /menu/v3/local-menu-groups/site-groups
|
|
2758
2771
|
|
|
2759
|
-
export type PostMenuV3LocalMenuGroupsSiteGroupsBody =
|
|
2772
|
+
export type PostMenuV3LocalMenuGroupsSiteGroupsBody = {
|
|
2773
|
+
site_id: string;
|
|
2774
|
+
local_menu_group_id: string;
|
|
2775
|
+
created_at?: string;
|
|
2776
|
+
updated_at?: string;
|
|
2777
|
+
[index: string]: any;
|
|
2778
|
+
}[];
|
|
2760
2779
|
|
|
2761
2780
|
export interface PostMenuV3LocalMenuGroupsSiteGroupsResponse {
|
|
2762
2781
|
results?: SiteGroupDTO[];
|
|
@@ -5468,6 +5487,7 @@ export interface PostMenuV3DraftModifierGroupBody {
|
|
|
5468
5487
|
order_type?: "selection" | "option" | "quantity";
|
|
5469
5488
|
sizing?: string;
|
|
5470
5489
|
is_out_of_stock?: boolean;
|
|
5490
|
+
is_incremental?: boolean;
|
|
5471
5491
|
id?: Record<string, any>;
|
|
5472
5492
|
applied_diff_snapshot?: Record<string, any>;
|
|
5473
5493
|
brand?: DraftBrandDTO;
|
|
@@ -5528,6 +5548,7 @@ export interface PatchMenuV3DraftModifierGroupBody {
|
|
|
5528
5548
|
order_type?: "selection" | "option" | "quantity";
|
|
5529
5549
|
sizing?: string;
|
|
5530
5550
|
is_out_of_stock?: boolean;
|
|
5551
|
+
is_incremental?: boolean;
|
|
5531
5552
|
applied_diff_snapshot?: Record<string, any>;
|
|
5532
5553
|
version?: number;
|
|
5533
5554
|
brand?: DraftBrandDTO;
|
|
@@ -5608,6 +5629,7 @@ export type PostMenuV3DraftModifierGroupsBody = {
|
|
|
5608
5629
|
order_type?: "selection" | "option" | "quantity";
|
|
5609
5630
|
sizing?: string;
|
|
5610
5631
|
is_out_of_stock?: boolean;
|
|
5632
|
+
is_incremental?: boolean;
|
|
5611
5633
|
id?: Record<string, any>;
|
|
5612
5634
|
applied_diff_snapshot?: Record<string, any>;
|
|
5613
5635
|
brand?: DraftBrandDTO;
|
|
@@ -5673,6 +5695,7 @@ export interface PostMenuV3DraftModifierGroupDuplicateResponse {
|
|
|
5673
5695
|
order_type?: "selection" | "option" | "quantity";
|
|
5674
5696
|
sizing?: string;
|
|
5675
5697
|
is_out_of_stock?: boolean;
|
|
5698
|
+
is_incremental?: boolean;
|
|
5676
5699
|
applied_diff_snapshot?: Record<string, any>;
|
|
5677
5700
|
version?: number;
|
|
5678
5701
|
brand?: DraftBrandDTO;
|
|
@@ -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
|
+
}
|