@compassdigital/sdk.typescript 4.71.0 → 4.73.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/base.d.ts +3 -3
- package/lib/base.d.ts.map +1 -1
- package/lib/base.js +27 -31
- package/lib/base.js.map +1 -1
- package/lib/index.d.ts +35 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +507 -482
- package/lib/index.js.map +1 -1
- package/lib/interface/config.d.ts +1 -0
- package/lib/interface/config.d.ts.map +1 -1
- package/lib/interface/consumer.d.ts +1 -1
- package/lib/interface/consumer.d.ts.map +1 -1
- package/lib/interface/location.d.ts +0 -6
- package/lib/interface/location.d.ts.map +1 -1
- package/lib/interface/mealplan.d.ts +1 -0
- package/lib/interface/mealplan.d.ts.map +1 -1
- package/lib/interface/menu.d.ts +35 -14
- package/lib/interface/menu.d.ts.map +1 -1
- package/lib/interface/shoppingcart.d.ts +2 -2
- package/lib/interface/shoppingcart.d.ts.map +1 -1
- package/lib/interface/util.d.ts.map +1 -1
- package/manifest.json +2 -2
- package/package.json +2 -2
- package/src/base.ts +455 -448
- package/src/index.ts +596 -631
- package/src/interface/config.ts +1 -0
- package/src/interface/consumer.ts +52 -52
- package/src/interface/location.ts +0 -7
- package/src/interface/mealplan.ts +1 -0
- package/src/interface/menu.ts +51 -15
- package/src/interface/shoppingcart.ts +4 -4
- package/src/interface/util.ts +3 -3
- package/test/client.test.ts +1 -1
package/src/interface/config.ts
CHANGED
|
@@ -1,107 +1,107 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
// THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
|
|
3
3
|
|
|
4
|
-
import { RequestQuery, BaseRequest } from
|
|
4
|
+
import { RequestQuery, BaseRequest } from './util';
|
|
5
5
|
|
|
6
6
|
export interface IsStatus {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
eligible: boolean;
|
|
8
|
+
validated?: boolean;
|
|
9
|
+
preferred?: boolean;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export interface Tender {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
id: string;
|
|
14
|
+
name?: string;
|
|
15
|
+
balance?: number;
|
|
16
|
+
type?: string;
|
|
17
|
+
currency?: string;
|
|
18
|
+
tender_number?: string;
|
|
19
|
+
is: IsStatus;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export interface TenderList {
|
|
23
|
-
|
|
23
|
+
tenders: Tender[];
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export interface BillingAddress {
|
|
27
|
-
|
|
27
|
+
postal_code?: string;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export interface ExpiryDate {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
month: number;
|
|
32
|
+
year: number;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export interface CreditCard {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
billing_address?: BillingAddress;
|
|
37
|
+
card_type?: string;
|
|
38
|
+
expiry?: ExpiryDate;
|
|
39
|
+
is: IsStatus;
|
|
40
|
+
masked_card_number?: string;
|
|
41
|
+
name_on_card?: string;
|
|
42
|
+
nickname?: string;
|
|
43
|
+
token: string;
|
|
44
|
+
token_expiration_date?: string;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export interface CreditCardData {
|
|
48
|
-
|
|
48
|
+
data: CreditCard[];
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export interface DigitalWalletFlavor {
|
|
52
|
-
|
|
52
|
+
is: IsStatus;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export interface DigitalWallet {
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
applewallet: DigitalWalletFlavor;
|
|
57
|
+
googlewallet: DigitalWalletFlavor;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
export interface ListAvailablePaymentsResponseDTO {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
mealplan: TenderList;
|
|
62
|
+
cashless: TenderList;
|
|
63
|
+
credit_cards: CreditCardData;
|
|
64
|
+
digital_wallet_pay: DigitalWallet;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
export interface UnauthorizedErrorDTO {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
message: string;
|
|
69
|
+
code: number;
|
|
70
|
+
data: Record<string, any>;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
export interface NotFoundErrorDTO {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
message: string;
|
|
75
|
+
code: number;
|
|
76
|
+
data: Record<string, any>;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
// GET /
|
|
79
|
+
// GET /consumer/v1/health-check
|
|
80
80
|
|
|
81
81
|
export interface HealthCheckControllerExecuteQuery {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
// Graphql query string
|
|
83
|
+
_query?: string;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
export type HealthCheckControllerExecuteResponse = {};
|
|
87
87
|
|
|
88
88
|
export interface HealthCheckControllerExecuteRequest
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
extends BaseRequest,
|
|
90
|
+
RequestQuery<HealthCheckControllerExecuteQuery> {}
|
|
91
91
|
|
|
92
|
-
// GET /
|
|
92
|
+
// GET /consumer/v1/payment-methods - List payment methods available in a given brand
|
|
93
93
|
|
|
94
94
|
export interface GetPaymentListByBrandQuery {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
95
|
+
// Brand ID as Encoded CDL ID
|
|
96
|
+
brandID?: string;
|
|
97
|
+
// Site ID as Encoded CDL ID
|
|
98
|
+
siteID?: string;
|
|
99
|
+
// Graphql query string
|
|
100
|
+
_query?: string;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
export type GetPaymentListByBrandResponse = ListAvailablePaymentsResponseDTO;
|
|
104
104
|
|
|
105
105
|
export interface GetPaymentListByBrandRequest
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
extends BaseRequest,
|
|
107
|
+
RequestQuery<GetPaymentListByBrandQuery> {}
|
|
@@ -127,9 +127,7 @@ export interface Brand {
|
|
|
127
127
|
start_time: string;
|
|
128
128
|
end_time: string;
|
|
129
129
|
delivery_destinations?: string[];
|
|
130
|
-
sorted_delivery_destinations?: SortedDeliveryDestination[];
|
|
131
130
|
}[];
|
|
132
|
-
sorted_delivery_destinations?: SortedDeliveryDestination[];
|
|
133
131
|
};
|
|
134
132
|
is?: {
|
|
135
133
|
pickup_supported?: boolean;
|
|
@@ -409,11 +407,6 @@ export interface TimeSlots {
|
|
|
409
407
|
timeslots?: Timeslot[];
|
|
410
408
|
}
|
|
411
409
|
|
|
412
|
-
export interface SortedDeliveryDestination {
|
|
413
|
-
name: string;
|
|
414
|
-
sort_sequence: number;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
410
|
export interface Sectors {
|
|
418
411
|
sectors?: Sector[];
|
|
419
412
|
}
|
|
@@ -232,6 +232,7 @@ export interface DeleteMealplanTenderResponse {
|
|
|
232
232
|
tender_id?: number;
|
|
233
233
|
currency?: string;
|
|
234
234
|
transaction_amount?: number;
|
|
235
|
+
drained_tender_name?: string;
|
|
235
236
|
}
|
|
236
237
|
|
|
237
238
|
export interface DeleteMealplanTenderRequest extends BaseRequest, DeleteMealplanTenderPath {
|
package/src/interface/menu.ts
CHANGED
|
@@ -633,7 +633,7 @@ export interface DraftItemDTO {
|
|
|
633
633
|
tax_tags?: string[];
|
|
634
634
|
brand_id?: string;
|
|
635
635
|
line_route?: string;
|
|
636
|
-
posid_segment?:
|
|
636
|
+
posid_segment?: number;
|
|
637
637
|
menu_works?: Record<string, any>;
|
|
638
638
|
is_out_of_stock?: boolean;
|
|
639
639
|
tax_tag_code?: string;
|
|
@@ -732,7 +732,7 @@ export interface DraftModifierDTO {
|
|
|
732
732
|
is_active?: boolean;
|
|
733
733
|
posid?: string;
|
|
734
734
|
reporting?: ReportingMetadataDTO;
|
|
735
|
-
posid_segment?:
|
|
735
|
+
posid_segment?: number;
|
|
736
736
|
brand_id?: string;
|
|
737
737
|
line_route?: string;
|
|
738
738
|
menu_works?: MenuWorksDTO;
|
|
@@ -1049,7 +1049,7 @@ export interface PublishedItemDTO {
|
|
|
1049
1049
|
tax_tags?: string[];
|
|
1050
1050
|
brand_id?: string;
|
|
1051
1051
|
line_route?: string;
|
|
1052
|
-
posid_segment?:
|
|
1052
|
+
posid_segment?: number;
|
|
1053
1053
|
is_out_of_stock?: boolean;
|
|
1054
1054
|
tax_tag_code?: string;
|
|
1055
1055
|
tags?: string[];
|
|
@@ -1112,7 +1112,7 @@ export interface PublishedModifierDTO {
|
|
|
1112
1112
|
tax_tags?: string[];
|
|
1113
1113
|
is_active?: boolean;
|
|
1114
1114
|
posid?: string;
|
|
1115
|
-
posid_segment?:
|
|
1115
|
+
posid_segment?: number;
|
|
1116
1116
|
brand_id?: string;
|
|
1117
1117
|
line_route?: string;
|
|
1118
1118
|
is_out_of_stock?: boolean;
|
|
@@ -1413,7 +1413,7 @@ export interface DraftItemEntityDTO {
|
|
|
1413
1413
|
tax_tags?: string[];
|
|
1414
1414
|
brand_id: string;
|
|
1415
1415
|
line_route?: string;
|
|
1416
|
-
posid_segment?:
|
|
1416
|
+
posid_segment?: number;
|
|
1417
1417
|
menu_works?: MenuWorksDTO;
|
|
1418
1418
|
is_out_of_stock?: boolean;
|
|
1419
1419
|
tax_tag_code?: string;
|
|
@@ -1452,7 +1452,7 @@ export interface DraftModifierEntityDTO {
|
|
|
1452
1452
|
is_active?: boolean;
|
|
1453
1453
|
posid?: string;
|
|
1454
1454
|
reporting: ReportingMetadataDTO;
|
|
1455
|
-
posid_segment?:
|
|
1455
|
+
posid_segment?: number;
|
|
1456
1456
|
brand_id: string;
|
|
1457
1457
|
line_route?: string;
|
|
1458
1458
|
menu_works?: MenuWorksDTO;
|
|
@@ -2324,6 +2324,42 @@ export interface GetMenuV3DraftLocalMenuGroupBrandsRequest
|
|
|
2324
2324
|
RequestQuery<GetMenuV3DraftLocalMenuGroupBrandsQuery>,
|
|
2325
2325
|
GetMenuV3DraftLocalMenuGroupBrandsPath {}
|
|
2326
2326
|
|
|
2327
|
+
// GET /menu/v3/draft/local-menu-group/{id}/items
|
|
2328
|
+
|
|
2329
|
+
export interface GetMenuV3DraftLocalMenuGroupItemsPath {
|
|
2330
|
+
id: string;
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
export interface GetMenuV3DraftLocalMenuGroupItemsQuery {
|
|
2334
|
+
// If specified, only the selected fields will be returned
|
|
2335
|
+
select?: string[];
|
|
2336
|
+
// List of relationships to load alongside this entity. Can load nested relationships using the pattern 'children.grand_children.foo'
|
|
2337
|
+
relationships?: string[];
|
|
2338
|
+
// The fields that filtering is allowed on
|
|
2339
|
+
filter?: string;
|
|
2340
|
+
// Number of records to load per page
|
|
2341
|
+
limit?: number;
|
|
2342
|
+
page?: number;
|
|
2343
|
+
// A field to sort the results based on
|
|
2344
|
+
sort_by?: string;
|
|
2345
|
+
sort_order?: 'DESC' | 'ASC';
|
|
2346
|
+
// How soft deleted records should be shown in the list
|
|
2347
|
+
soft_deleted?: 'include' | 'exclude' | 'only';
|
|
2348
|
+
// Graphql query string
|
|
2349
|
+
_query?: string;
|
|
2350
|
+
}
|
|
2351
|
+
|
|
2352
|
+
export interface GetMenuV3DraftLocalMenuGroupItemsResponse {
|
|
2353
|
+
results: DraftItemDTO[];
|
|
2354
|
+
meta?: ListResponseMetadataDTO;
|
|
2355
|
+
[index: string]: any;
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
export interface GetMenuV3DraftLocalMenuGroupItemsRequest
|
|
2359
|
+
extends BaseRequest,
|
|
2360
|
+
RequestQuery<GetMenuV3DraftLocalMenuGroupItemsQuery>,
|
|
2361
|
+
GetMenuV3DraftLocalMenuGroupItemsPath {}
|
|
2362
|
+
|
|
2327
2363
|
// GET /menu/v3/local-menu-group/{id}/brands
|
|
2328
2364
|
|
|
2329
2365
|
export interface GetMenuV3LocalMenuGroupBrandsPath {
|
|
@@ -2519,7 +2555,7 @@ export interface GetMenuV3LocalMenuGroupExportSolutionsRequest
|
|
|
2519
2555
|
// GET /menu/v3/local-menu-group/{id}/export/solution/{solution_id}
|
|
2520
2556
|
|
|
2521
2557
|
export interface GetMenuV3LocalMenuGroupExportSolutionPath {
|
|
2522
|
-
//
|
|
2558
|
+
// local_menu_group
|
|
2523
2559
|
id: string;
|
|
2524
2560
|
// export_solution
|
|
2525
2561
|
solution_id: string;
|
|
@@ -4736,7 +4772,7 @@ export interface PostMenuV3DraftItemBody {
|
|
|
4736
4772
|
tax_tags?: string[];
|
|
4737
4773
|
brand_id: string;
|
|
4738
4774
|
line_route?: string;
|
|
4739
|
-
posid_segment?:
|
|
4775
|
+
posid_segment?: number;
|
|
4740
4776
|
menu_works?: MenuWorksDTO;
|
|
4741
4777
|
is_out_of_stock?: boolean;
|
|
4742
4778
|
tax_tag_code?: string;
|
|
@@ -4809,7 +4845,7 @@ export interface PatchMenuV3DraftItemBody {
|
|
|
4809
4845
|
tax_tags?: string[];
|
|
4810
4846
|
brand_id?: string;
|
|
4811
4847
|
line_route?: string;
|
|
4812
|
-
posid_segment?:
|
|
4848
|
+
posid_segment?: number;
|
|
4813
4849
|
menu_works?: MenuWorksDTO;
|
|
4814
4850
|
is_out_of_stock?: boolean;
|
|
4815
4851
|
tax_tag_code?: string;
|
|
@@ -4921,7 +4957,7 @@ export type PostMenuV3DraftItemsBody = {
|
|
|
4921
4957
|
tax_tags?: string[];
|
|
4922
4958
|
brand_id: string;
|
|
4923
4959
|
line_route?: string;
|
|
4924
|
-
posid_segment?:
|
|
4960
|
+
posid_segment?: number;
|
|
4925
4961
|
menu_works?: MenuWorksDTO;
|
|
4926
4962
|
is_out_of_stock?: boolean;
|
|
4927
4963
|
tax_tag_code?: string;
|
|
@@ -5024,7 +5060,7 @@ export interface PatchMenuV3DraftItemsBulkUpdateBody {
|
|
|
5024
5060
|
tax_tags?: string[];
|
|
5025
5061
|
brand_id?: string;
|
|
5026
5062
|
line_route?: string;
|
|
5027
|
-
posid_segment?:
|
|
5063
|
+
posid_segment?: number;
|
|
5028
5064
|
menu_works?: MenuWorksDTO;
|
|
5029
5065
|
is_out_of_stock?: boolean;
|
|
5030
5066
|
tax_tag_code?: string;
|
|
@@ -6151,7 +6187,7 @@ export interface PostMenuV3DraftModifierBody {
|
|
|
6151
6187
|
is_active?: boolean;
|
|
6152
6188
|
posid?: string;
|
|
6153
6189
|
reporting: ReportingMetadataDTO;
|
|
6154
|
-
posid_segment?:
|
|
6190
|
+
posid_segment?: number;
|
|
6155
6191
|
brand_id: string;
|
|
6156
6192
|
line_route?: string;
|
|
6157
6193
|
menu_works?: MenuWorksDTO;
|
|
@@ -6224,7 +6260,7 @@ export interface PatchMenuV3DraftModifierBody {
|
|
|
6224
6260
|
is_active?: boolean;
|
|
6225
6261
|
posid?: string;
|
|
6226
6262
|
reporting?: ReportingMetadataDTO;
|
|
6227
|
-
posid_segment?:
|
|
6263
|
+
posid_segment?: number;
|
|
6228
6264
|
brand_id?: string;
|
|
6229
6265
|
line_route?: string;
|
|
6230
6266
|
menu_works?: MenuWorksDTO;
|
|
@@ -6336,7 +6372,7 @@ export type PostMenuV3DraftModifiersBody = {
|
|
|
6336
6372
|
is_active?: boolean;
|
|
6337
6373
|
posid?: string;
|
|
6338
6374
|
reporting: ReportingMetadataDTO;
|
|
6339
|
-
posid_segment?:
|
|
6375
|
+
posid_segment?: number;
|
|
6340
6376
|
brand_id: string;
|
|
6341
6377
|
line_route?: string;
|
|
6342
6378
|
menu_works?: MenuWorksDTO;
|
|
@@ -6439,7 +6475,7 @@ export interface PatchMenuV3DraftModifiersBulkUpdateBody {
|
|
|
6439
6475
|
is_active?: boolean;
|
|
6440
6476
|
posid?: string;
|
|
6441
6477
|
reporting?: ReportingMetadataDTO;
|
|
6442
|
-
posid_segment?:
|
|
6478
|
+
posid_segment?: number;
|
|
6443
6479
|
brand_id?: string;
|
|
6444
6480
|
line_route?: string;
|
|
6445
6481
|
menu_works?: MenuWorksDTO;
|
|
@@ -484,8 +484,8 @@ export interface DrainOrderType {
|
|
|
484
484
|
// POST /shoppingcart - Create a new ShoppingCart
|
|
485
485
|
|
|
486
486
|
export interface PostShoppingcartCartQuery {
|
|
487
|
-
// If set to true then
|
|
488
|
-
|
|
487
|
+
// If set to true then the hidden brand validation will be skipped, requires global write permission
|
|
488
|
+
skip_hidden_brand_check?: boolean;
|
|
489
489
|
}
|
|
490
490
|
|
|
491
491
|
export type PostShoppingcartCartBody = ShoppingCartRequest;
|
|
@@ -679,8 +679,8 @@ export interface PutShoppingcartCheckoutPath {
|
|
|
679
679
|
}
|
|
680
680
|
|
|
681
681
|
export interface PutShoppingcartCheckoutQuery {
|
|
682
|
-
// If set to true then
|
|
683
|
-
|
|
682
|
+
// If set to true then the hidden brand validation will be skipped, requires global write permission
|
|
683
|
+
skip_hidden_brand_check?: boolean;
|
|
684
684
|
}
|
|
685
685
|
|
|
686
686
|
export type PutShoppingcartCheckoutResponse = ShoppingCartResponse;
|
package/src/interface/util.ts
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Convert number query parameters to string.
|
|
3
3
|
*/
|
|
4
4
|
export type RequestQuery<T extends object> = {
|
|
5
|
-
|
|
6
|
-
}
|
|
5
|
+
[K in keyof T]: T[K] extends number | undefined ? string : T[K];
|
|
6
|
+
};
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* All requests implement this interface.
|
|
10
10
|
*/
|
|
11
11
|
export interface BaseRequest {
|
|
12
|
-
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
13
|
}
|
package/test/client.test.ts
CHANGED
|
@@ -26,7 +26,7 @@ describe('ServiceClient', () => {
|
|
|
26
26
|
expect(task).toEqual(fake);
|
|
27
27
|
const req = intercept.mock.calls[0][0];
|
|
28
28
|
expect(req).toEqual({
|
|
29
|
-
|
|
29
|
+
route: '/task/{id}',
|
|
30
30
|
service: 'task',
|
|
31
31
|
url: 'https://dev.api.compassdigital.org/task/some_id',
|
|
32
32
|
method: 'get',
|