@compassdigital/sdk.typescript 4.32.0 → 4.34.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/src/index.ts CHANGED
@@ -940,10 +940,17 @@ import {
940
940
  import {
941
941
  TaxHealthCheckQuery,
942
942
  TaxHealthCheckResponse,
943
- QuoteBody,
944
- QuoteResponse,
943
+ PostQuoteTaxBody,
944
+ PostQuoteTaxResponse,
945
945
  } from "./interface/tax";
946
946
 
947
+ import {
948
+ GetSearchOrderQuery,
949
+ GetSearchOrderResponse,
950
+ GetSearchLocationQuery,
951
+ GetSearchLocationResponse,
952
+ } from "./interface/search";
953
+
947
954
  import { BaseServiceClient, RequestOptions, ResponsePromise } from "./base";
948
955
  export * from "./base";
949
956
 
@@ -9602,7 +9609,36 @@ export class ServiceClient extends BaseServiceClient {
9602
9609
  * @param body
9603
9610
  * @param options - additional request options
9604
9611
  */
9605
- quote(body: QuoteBody, options?: RequestOptions): ResponsePromise<QuoteResponse> {
9606
- return this.request("tax", "quote", "post", `/tax/quote`, body, options);
9612
+ post_quote_tax(
9613
+ body: PostQuoteTaxBody,
9614
+ options?: RequestOptions,
9615
+ ): ResponsePromise<PostQuoteTaxResponse> {
9616
+ return this.request("tax", "post_quote_tax", "post", `/tax/quote`, body, options);
9617
+ }
9618
+
9619
+ /**
9620
+ * GET /search/order
9621
+ *
9622
+ * @param options - additional request options
9623
+ */
9624
+ get_search_order(
9625
+ options?: {
9626
+ query?: GetSearchOrderQuery;
9627
+ } & RequestOptions,
9628
+ ): ResponsePromise<GetSearchOrderResponse> {
9629
+ return this.request("search", "get_search_order", "get", `/search/order`, null, options);
9630
+ }
9631
+
9632
+ /**
9633
+ * GET /search/location
9634
+ *
9635
+ * @param options - additional request options
9636
+ */
9637
+ get_search_location(
9638
+ options?: {
9639
+ query?: GetSearchLocationQuery;
9640
+ } & RequestOptions,
9641
+ ): ResponsePromise<GetSearchLocationResponse> {
9642
+ return this.request("search", "get_search_location", "get", `/search/location`, null, options);
9607
9643
  }
9608
9644
  }
@@ -0,0 +1,180 @@
1
+ /* eslint-disable */
2
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
3
+
4
+ import { RequestQuery, BaseRequest } from "./util";
5
+
6
+ export interface MetaResultsDto {
7
+ limit: number;
8
+ page: number;
9
+ sortBy?: Record<string, any>;
10
+ sortOrder?: Record<string, any>;
11
+ totalResults: number;
12
+ totalPages: number;
13
+ resultsCount: number;
14
+ }
15
+
16
+ export interface GetShoppingcartDto {
17
+ id: string;
18
+ source_id: string;
19
+ menu: string;
20
+ location: string;
21
+ meta: {
22
+ [index: string]: any;
23
+ };
24
+ sub_total: Record<string, any>;
25
+ payment_method: Record<string, any>;
26
+ loyalty: Record<string, any>;
27
+ total: Record<string, any>;
28
+ exemptions: Record<string, any>;
29
+ brand: string;
30
+ is: Record<string, any>;
31
+ source_order_id: string;
32
+ items: Record<string, any>;
33
+ discount: Record<string, any>;
34
+ delivery_fee: Record<string, any>;
35
+ source_date_created: string;
36
+ source_date_modified: string;
37
+ promo: Record<string, any>;
38
+ taxes: Record<string, any>;
39
+ service_fee: Record<string, any>;
40
+ }
41
+
42
+ export interface OrderGroupDetails {
43
+ source_id?: string;
44
+ name?: string;
45
+ }
46
+
47
+ export interface OrderBrandDetails {
48
+ source_id?: string;
49
+ name?: string;
50
+ }
51
+
52
+ export interface GetOrderDto {
53
+ source_id: string;
54
+ requested_date: string;
55
+ pickup_id: string;
56
+ pickup: string;
57
+ is: Record<string, any>;
58
+ mealplan: Record<string, any>;
59
+ shoppingcart: GetShoppingcartDto;
60
+ date: Record<string, any>;
61
+ pickup_name: string;
62
+ details: Record<string, any>;
63
+ payment: Record<string, any>;
64
+ meal_swipes: Record<string, any>;
65
+ meal_exchange: Record<string, any>;
66
+ issue: Record<string, any>;
67
+ source_group: OrderGroupDetails;
68
+ source_brand: OrderBrandDetails;
69
+ date_created: string;
70
+ refund_status: string;
71
+ payment_type: string;
72
+ payment_category: string;
73
+ market_place_stations: OrderBrandDetails[];
74
+ // Order original cart amount before refunds
75
+ total: string;
76
+ // Customer email
77
+ email: string;
78
+ // Order type: pickup/delivery/etc
79
+ order_type: string;
80
+ // Order status: accepted/in_progress/ready/etc
81
+ status: string;
82
+ }
83
+
84
+ export interface GetOrderPaginatedResult {
85
+ meta: MetaResultsDto;
86
+ results: GetOrderDto[];
87
+ }
88
+
89
+ export interface GetLocationDto {
90
+ source_id: string;
91
+ source_type: string;
92
+ name: string;
93
+ }
94
+
95
+ export interface GetLocationPaginatedResult {
96
+ meta: MetaResultsDto;
97
+ results: GetLocationDto[];
98
+ }
99
+
100
+ // GET /search/order
101
+
102
+ export interface GetSearchOrderQuery {
103
+ // Items to return in response
104
+ limit?: number;
105
+ // Pagination param
106
+ page?: number;
107
+ // Return items sorted by this column
108
+ sortBy?:
109
+ | "date_created"
110
+ | "destination"
111
+ | "id"
112
+ | "pickup"
113
+ | "pickup_id"
114
+ | "pickup_name"
115
+ | "source_id"
116
+ | "sub_total"
117
+ | "total"
118
+ | "site_name"
119
+ | "status"
120
+ | "order_type"
121
+ | "fulfillment_date";
122
+ sortOrder?: "ASC" | "DESC";
123
+ // Filter orders by site id
124
+ source_group_id?: string;
125
+ // Filter orders by station id
126
+ source_brand_id?: string;
127
+ // Filter orders with created date not earlier than
128
+ date_created_start?: string;
129
+ // Filter orders with created date not later than this date
130
+ date_created_end?: string;
131
+ // Filter orders having specific order number
132
+ pickup_id?: string;
133
+ // Filter orders by user pickup name
134
+ pickup_name?: string;
135
+ // Search order by order ID
136
+ source_id?: string;
137
+ // Search order by refund_status
138
+ refund_status?: ("" | "partial" | "full")[];
139
+ // Filter orders by payment type
140
+ payment_type?: string;
141
+ // Filter orders by payment category
142
+ payment_category?: ("digital wallet" | "badge pay" | "credit card" | "mealplan")[];
143
+ // Filter orders by customer email
144
+ email?: string;
145
+ // Filter orders by order type
146
+ order_type?: "frictionless" | "delivery" | "pickup" | "scan_and_go";
147
+ // Filter orders by order status/progress
148
+ status?: "ready" | "accepted" | "delivered" | "in_progress" | "out_for_delivery" | "created";
149
+ // Graphql query string
150
+ _query?: string;
151
+ }
152
+
153
+ export type GetSearchOrderResponse = GetOrderPaginatedResult;
154
+
155
+ export interface GetSearchOrderRequest extends BaseRequest, RequestQuery<GetSearchOrderQuery> {}
156
+
157
+ // GET /search/location
158
+
159
+ export interface GetSearchLocationQuery {
160
+ // Items to return in response
161
+ limit?: number;
162
+ // Pagination param
163
+ page?: number;
164
+ // Filter entities with names containing this value
165
+ name?: string;
166
+ // Filter entities with specific type
167
+ source_type?: "brand" | "location" | "group" | "multigroup" | "sector" | "company";
168
+ // Filter entities with specific group id as a parent
169
+ source_group_parent?: string;
170
+ // Filter entities with specific multigroup id as a parent
171
+ source_multigroup_parent?: string;
172
+ // Graphql query string
173
+ _query?: string;
174
+ }
175
+
176
+ export type GetSearchLocationResponse = GetLocationPaginatedResult;
177
+
178
+ export interface GetSearchLocationRequest
179
+ extends BaseRequest,
180
+ RequestQuery<GetSearchLocationQuery> {}
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { RequestQuery, BaseRequest } from "./util";
5
5
 
6
- export interface LocationData {
6
+ export interface TaxLocationData {
7
7
  // unique location identifier
8
8
  id: string;
9
9
  // country of transaction
@@ -18,11 +18,11 @@ export interface LocationData {
18
18
  streetAddress: string;
19
19
  }
20
20
 
21
- export interface ItemDTO {
21
+ export interface TaxItemDTO {
22
22
  // unique item identifier
23
23
  id: string;
24
24
  // indicates a tax rule for an item
25
- taxTag: string;
25
+ taxTagCode: string;
26
26
  // amount of an item
27
27
  quantity: number;
28
28
  // decimal price of an item
@@ -31,7 +31,7 @@ export interface ItemDTO {
31
31
  taxedAmount?: number;
32
32
  }
33
33
 
34
- export interface Refund {
34
+ export interface TaxRefund {
35
35
  // unique identifier of the refunded item
36
36
  refundItemId: string;
37
37
  // quantity amount of the item to be refunded
@@ -39,7 +39,7 @@ export interface Refund {
39
39
  }
40
40
 
41
41
  export interface TaxRequestDTO {
42
- // the unique location code
42
+ // a unique identifier representing the transaction
43
43
  id: string;
44
44
  // the order fulfillment type
45
45
  transactionType: "pickup" | "delivery";
@@ -47,16 +47,16 @@ export interface TaxRequestDTO {
47
47
  serviceFee?: number;
48
48
  // numeric value of delivery fee
49
49
  deliveryFee?: number;
50
- locationData: LocationData;
50
+ locationData: TaxLocationData;
51
51
  // items to calculate tax on
52
- items: ItemDTO[];
52
+ items: TaxItemDTO[];
53
53
  // iso timstamp of transaction date
54
- transactionDate: string;
54
+ transactionDate?: string;
55
55
  // an array of items to refund
56
- refunds: Refund[];
56
+ refunds?: TaxRefund[];
57
57
  }
58
58
 
59
- export interface TaxBreakdown {
59
+ export interface TaxBreakdownDTO {
60
60
  // canadian value: goods and services tax
61
61
  gst?: number;
62
62
  // canadian value: provincial sales tax
@@ -70,7 +70,9 @@ export interface TaxResponseDTO {
70
70
  amount: number;
71
71
  // the total tax rate applied to the items to determine the total tax of the transaction
72
72
  rate: number;
73
- breakdown: TaxBreakdown;
73
+ // items with calculated tax data added
74
+ items: TaxItemDTO[];
75
+ breakdown: TaxBreakdownDTO;
74
76
  }
75
77
 
76
78
  export interface BadRequestErrorDTO {
@@ -104,10 +106,10 @@ export interface TaxHealthCheckRequest extends BaseRequest, RequestQuery<TaxHeal
104
106
 
105
107
  // POST /tax/quote - get tax quote from 3rd party tax library
106
108
 
107
- export type QuoteBody = TaxRequestDTO;
109
+ export type PostQuoteTaxBody = TaxRequestDTO;
108
110
 
109
- export type QuoteResponse = TaxResponseDTO;
111
+ export type PostQuoteTaxResponse = TaxResponseDTO;
110
112
 
111
- export interface QuoteRequest extends BaseRequest {
112
- body: QuoteBody;
113
+ export interface PostQuoteTaxRequest extends BaseRequest {
114
+ body: PostQuoteTaxBody;
113
115
  }
@@ -1,5 +0,0 @@
1
- {
2
- "conventionalCommits.scopes": [
3
- "typescript.sdk"
4
- ]
5
- }