@compassdigital/sdk.typescript 4.82.0 → 4.84.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 +25 -16
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +21 -12
- package/lib/index.js.map +1 -1
- package/lib/interface/announcement.d.ts +36 -15
- package/lib/interface/announcement.d.ts.map +1 -1
- package/lib/interface/centricos.d.ts +1 -3
- package/lib/interface/centricos.d.ts.map +1 -1
- package/lib/interface/datalake.d.ts +1 -3
- package/lib/interface/datalake.d.ts.map +1 -1
- package/lib/interface/location.d.ts +9 -19
- package/lib/interface/location.d.ts.map +1 -1
- package/lib/interface/mealplan.d.ts +6 -3
- package/lib/interface/mealplan.d.ts.map +1 -1
- package/lib/interface/menu.d.ts +126 -7
- package/lib/interface/menu.d.ts.map +1 -1
- package/lib/interface/order.d.ts +4 -9
- package/lib/interface/order.d.ts.map +1 -1
- package/lib/interface/partner.d.ts +7 -13
- package/lib/interface/partner.d.ts.map +1 -1
- package/lib/interface/promo.d.ts +5 -15
- package/lib/interface/promo.d.ts.map +1 -1
- package/lib/interface/search.d.ts +1 -3
- package/lib/interface/search.d.ts.map +1 -1
- package/lib/interface/shoppingcart.d.ts.map +1 -1
- package/lib/interface/task.d.ts +4 -12
- package/lib/interface/task.d.ts.map +1 -1
- package/lib/interface/user.d.ts +1 -0
- package/lib/interface/user.d.ts.map +1 -1
- package/lib/interface/util.d.ts +9 -2
- package/lib/interface/util.d.ts.map +1 -1
- package/manifest.json +1 -1
- package/package.json +2 -2
- package/src/index.ts +51 -40
- package/src/interface/announcement.ts +56 -30
- package/src/interface/centricos.ts +1 -3
- package/src/interface/datalake.ts +1 -3
- package/src/interface/location.ts +9 -16
- package/src/interface/mealplan.ts +7 -3
- package/src/interface/menu.ts +159 -6
- package/src/interface/order.ts +5 -9
- package/src/interface/partner.ts +7 -10
- package/src/interface/promo.ts +5 -15
- package/src/interface/search.ts +1 -3
- package/src/interface/shoppingcart.ts +3 -0
- package/src/interface/task.ts +4 -12
- package/src/interface/user.ts +2 -0
- package/src/interface/util.ts +16 -2
package/src/interface/partner.ts
CHANGED
|
@@ -273,9 +273,7 @@ export interface LocationGroup {
|
|
|
273
273
|
distance?: number;
|
|
274
274
|
locations?: Location[];
|
|
275
275
|
address?: Address;
|
|
276
|
-
meta?:
|
|
277
|
-
[index: string]: any;
|
|
278
|
-
};
|
|
276
|
+
meta?: Record<string, any>;
|
|
279
277
|
style?: Record<string, any>;
|
|
280
278
|
timezone?: string;
|
|
281
279
|
[index: string]: any;
|
|
@@ -296,9 +294,7 @@ export interface Location {
|
|
|
296
294
|
latitude?: number;
|
|
297
295
|
longitude?: number;
|
|
298
296
|
brands?: Brand[];
|
|
299
|
-
meta?:
|
|
300
|
-
[index: string]: any;
|
|
301
|
-
};
|
|
297
|
+
meta?: Record<string, any>;
|
|
302
298
|
phone?: string;
|
|
303
299
|
// group
|
|
304
300
|
location_group?: string;
|
|
@@ -374,13 +370,14 @@ export interface Brand {
|
|
|
374
370
|
// pos
|
|
375
371
|
pos?: string;
|
|
376
372
|
terminals?: Record<string, any>[];
|
|
377
|
-
device_mapping?:
|
|
378
|
-
|
|
373
|
+
device_mapping?: Record<
|
|
374
|
+
string,
|
|
375
|
+
{
|
|
379
376
|
device_type: string;
|
|
380
377
|
site_device_id: string;
|
|
381
378
|
business_units: string[];
|
|
382
|
-
}[]
|
|
383
|
-
|
|
379
|
+
}[]
|
|
380
|
+
>;
|
|
384
381
|
timeslots?: {
|
|
385
382
|
time?: string;
|
|
386
383
|
averagePrepTime?: string;
|
package/src/interface/promo.ts
CHANGED
|
@@ -93,9 +93,7 @@ export interface Event {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
export interface Calendar {
|
|
96
|
-
timezones:
|
|
97
|
-
[index: string]: string;
|
|
98
|
-
};
|
|
96
|
+
timezones: Record<string, string>;
|
|
99
97
|
events: Event[];
|
|
100
98
|
}
|
|
101
99
|
|
|
@@ -114,9 +112,7 @@ export type PromotionMenuItems = {
|
|
|
114
112
|
min?: number;
|
|
115
113
|
max?: number;
|
|
116
114
|
quantity?: number;
|
|
117
|
-
meta?:
|
|
118
|
-
[index: string]: any;
|
|
119
|
-
};
|
|
115
|
+
meta?: Record<string, any>;
|
|
120
116
|
}[];
|
|
121
117
|
|
|
122
118
|
export interface PromoMeta {
|
|
@@ -256,16 +252,10 @@ export interface Customer {
|
|
|
256
252
|
name?: string;
|
|
257
253
|
email?: string;
|
|
258
254
|
description?: string;
|
|
259
|
-
address?:
|
|
260
|
-
[index: string]: any;
|
|
261
|
-
};
|
|
255
|
+
address?: Record<string, any>;
|
|
262
256
|
phone?: string;
|
|
263
|
-
summary?:
|
|
264
|
-
|
|
265
|
-
};
|
|
266
|
-
loyalty?: {
|
|
267
|
-
[index: string]: any;
|
|
268
|
-
};
|
|
257
|
+
summary?: Record<string, any>;
|
|
258
|
+
loyalty?: Record<string, any>;
|
|
269
259
|
metadata?: {
|
|
270
260
|
origin?: string;
|
|
271
261
|
[index: string]: any;
|
package/src/interface/search.ts
CHANGED
|
@@ -18,9 +18,7 @@ export interface GetShoppingcartDto {
|
|
|
18
18
|
source_id: string;
|
|
19
19
|
menu: string;
|
|
20
20
|
location: string;
|
|
21
|
-
meta:
|
|
22
|
-
[index: string]: any;
|
|
23
|
-
};
|
|
21
|
+
meta: Record<string, any>;
|
|
24
22
|
sub_total: Record<string, any>;
|
|
25
23
|
payment_method: Record<string, any>;
|
|
26
24
|
loyalty: Record<string, any>;
|
|
@@ -497,6 +497,7 @@ export interface DrainOrderType {
|
|
|
497
497
|
}
|
|
498
498
|
|
|
499
499
|
export interface TaxRequestDTO {
|
|
500
|
+
// a unique identifier representing the transaction
|
|
500
501
|
id: string;
|
|
501
502
|
// the app to associate the transaction with
|
|
502
503
|
appName: string;
|
|
@@ -516,6 +517,7 @@ export interface TaxRequestDTO {
|
|
|
516
517
|
}
|
|
517
518
|
|
|
518
519
|
export interface TaxLocationData {
|
|
520
|
+
// unique location identifier
|
|
519
521
|
id: string;
|
|
520
522
|
// country of transaction
|
|
521
523
|
country: string;
|
|
@@ -530,6 +532,7 @@ export interface TaxLocationData {
|
|
|
530
532
|
}
|
|
531
533
|
|
|
532
534
|
export interface TaxItemDTO {
|
|
535
|
+
// unique item identifier
|
|
533
536
|
id: string;
|
|
534
537
|
// indicates a tax rule for an item
|
|
535
538
|
taxTagCode: string;
|
package/src/interface/task.ts
CHANGED
|
@@ -43,9 +43,7 @@ export interface Task {
|
|
|
43
43
|
dropoff_details?: TaskLocation;
|
|
44
44
|
status?: TaskStatus;
|
|
45
45
|
// Any related metadata information about this Task
|
|
46
|
-
meta?:
|
|
47
|
-
[index: string]: any;
|
|
48
|
-
};
|
|
46
|
+
meta?: Record<string, any>;
|
|
49
47
|
// Date when Task was created
|
|
50
48
|
created?: string;
|
|
51
49
|
// Date when Task expires
|
|
@@ -84,9 +82,7 @@ export interface TaskCreate {
|
|
|
84
82
|
dropoff_details: TaskLocation;
|
|
85
83
|
status: TaskStatus;
|
|
86
84
|
// Any related metadata information about this Task
|
|
87
|
-
meta?:
|
|
88
|
-
[index: string]: any;
|
|
89
|
-
};
|
|
85
|
+
meta?: Record<string, any>;
|
|
90
86
|
// Task Type
|
|
91
87
|
type: 'bolter' | 'kds';
|
|
92
88
|
}
|
|
@@ -107,9 +103,7 @@ export interface TaskUpdate {
|
|
|
107
103
|
status?: TaskStatus;
|
|
108
104
|
assignee?: string;
|
|
109
105
|
// Any related metadata information about this Task
|
|
110
|
-
meta?:
|
|
111
|
-
[index: string]: any;
|
|
112
|
-
};
|
|
106
|
+
meta?: Record<string, any>;
|
|
113
107
|
}
|
|
114
108
|
|
|
115
109
|
export interface OrderUpdate {
|
|
@@ -137,9 +131,7 @@ export interface OrderIssue {
|
|
|
137
131
|
id?: string;
|
|
138
132
|
type?: string;
|
|
139
133
|
//@deprecated
|
|
140
|
-
item?:
|
|
141
|
-
[index: string]: any;
|
|
142
|
-
};
|
|
134
|
+
item?: Record<string, any>;
|
|
143
135
|
// Array of Items with issues
|
|
144
136
|
items?: Record<string, any>[];
|
|
145
137
|
// Optional additional explanation for issue: 5,10,15 for late issues, SOLD_OUT, MODIFICATION, DIETARY_RESTRICTION for see kitchen issues
|
package/src/interface/user.ts
CHANGED
|
@@ -374,6 +374,8 @@ export interface PostUserOauthRequest extends BaseRequest {
|
|
|
374
374
|
export interface PostUserZendeskBody {
|
|
375
375
|
// Zendesk JWT
|
|
376
376
|
token?: string;
|
|
377
|
+
// Name of the user from Zendesk (first and last)
|
|
378
|
+
name?: string;
|
|
377
379
|
}
|
|
378
380
|
|
|
379
381
|
export interface PostUserZendeskResponse {
|
package/src/interface/util.ts
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Convert
|
|
2
|
+
* Convert a query parameter value to the request type.
|
|
3
|
+
*
|
|
4
|
+
* - number types are converted to string
|
|
5
|
+
* - Array<T> types are converted to Array<T> | T
|
|
6
|
+
*/
|
|
7
|
+
export type RequestQueryParam<T> = T extends undefined
|
|
8
|
+
? undefined
|
|
9
|
+
: T extends number
|
|
10
|
+
? string
|
|
11
|
+
: T extends any[]
|
|
12
|
+
? RequestQueryParam<T[number]>[] | RequestQueryParam<T[number]>
|
|
13
|
+
: T;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Convert the query parameters to the request types.
|
|
3
17
|
*/
|
|
4
18
|
export type RequestQuery<T extends object> = {
|
|
5
|
-
[K in keyof T]: T[K]
|
|
19
|
+
[K in keyof T]: RequestQueryParam<T[K]>;
|
|
6
20
|
};
|
|
7
21
|
|
|
8
22
|
/**
|