@compassdigital/sdk.typescript 3.0.0-beta.19 → 3.0.0-beta.21
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 +41 -12
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +47 -11
- package/lib/index.js.map +1 -1
- package/lib/interface/email.d.ts +16 -0
- package/lib/interface/email.d.ts.map +1 -1
- package/lib/interface/location.d.ts +23 -18
- package/lib/interface/location.d.ts.map +1 -1
- package/lib/interface/menu.d.ts +17 -3
- package/lib/interface/menu.d.ts.map +1 -1
- package/lib/interface/order.d.ts +7 -0
- package/lib/interface/order.d.ts.map +1 -1
- package/lib/interface/partner.d.ts +230 -4
- package/lib/interface/partner.d.ts.map +1 -1
- package/lib/interface/shoppingcart.d.ts +10 -1
- package/lib/interface/shoppingcart.d.ts.map +1 -1
- package/lib/interface/user.d.ts +17 -0
- package/lib/interface/user.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +102 -24
- package/src/interface/email.ts +24 -0
- package/src/interface/location.ts +39 -33
- package/src/interface/menu.ts +25 -3
- package/src/interface/order.ts +13 -0
- package/src/interface/partner.ts +266 -5
- package/src/interface/shoppingcart.ts +12 -1
- package/src/interface/user.ts +27 -0
package/src/index.ts
CHANGED
|
@@ -51,6 +51,7 @@ import {
|
|
|
51
51
|
GetOrderLocationOrdersResponse,
|
|
52
52
|
GetOrderGroupOrdersQuery,
|
|
53
53
|
GetOrderGroupOrdersResponse,
|
|
54
|
+
PatchOrderCheckinResponse,
|
|
54
55
|
} from "./interface/order";
|
|
55
56
|
|
|
56
57
|
import {
|
|
@@ -97,10 +98,11 @@ import {
|
|
|
97
98
|
GetLocationGroupDeliverydestinationsResponse,
|
|
98
99
|
PostLocationGroupDeliverydestinationBody,
|
|
99
100
|
PostLocationGroupDeliverydestinationResponse,
|
|
100
|
-
GetLocationGroupDeliverydestinationResponse,
|
|
101
101
|
PatchLocationGroupDeliverydestinationBody,
|
|
102
102
|
PatchLocationGroupDeliverydestinationResponse,
|
|
103
|
+
DeleteLocationGroupDeliverydestinationBody,
|
|
103
104
|
DeleteLocationGroupDeliverydestinationResponse,
|
|
105
|
+
GetLocationGroupDeliverydestinationResponse,
|
|
104
106
|
GetLocationUserGroupQuery,
|
|
105
107
|
GetLocationUserGroupResponse,
|
|
106
108
|
GetLocationBrandsResponse,
|
|
@@ -180,11 +182,15 @@ import {
|
|
|
180
182
|
PostPartnerStandardcognitionShoppingcartResponse,
|
|
181
183
|
GetPartnerStandardcognitionLocationsResponse,
|
|
182
184
|
GetPartnerStandardcognitionStoresResponse,
|
|
185
|
+
PostPartnerStandardcognitionMenuBody,
|
|
186
|
+
PostPartnerStandardcognitionMenuResponse,
|
|
183
187
|
GetPartnerCoolrLocationsResponse,
|
|
184
188
|
GetPartnerCoolrImagesResponse,
|
|
185
189
|
GetPartnerSwaggerResponse,
|
|
186
190
|
} from "./interface/partner";
|
|
187
191
|
|
|
192
|
+
import { PostEmailBody, PostEmailResponse } from "./interface/email";
|
|
193
|
+
|
|
188
194
|
import {
|
|
189
195
|
PostTaskBody,
|
|
190
196
|
PostTaskResponse,
|
|
@@ -386,6 +392,8 @@ import {
|
|
|
386
392
|
PostUserSendEmailVerificationResponse,
|
|
387
393
|
PutUserVerifyUserEmailBody,
|
|
388
394
|
PutUserVerifyUserEmailResponse,
|
|
395
|
+
PutUserVerificationPhoneBody,
|
|
396
|
+
PutUserVerificationPhoneResponse,
|
|
389
397
|
} from "./interface/user";
|
|
390
398
|
|
|
391
399
|
import {
|
|
@@ -966,6 +974,26 @@ export class ServiceClient extends BaseServiceClient {
|
|
|
966
974
|
);
|
|
967
975
|
}
|
|
968
976
|
|
|
977
|
+
/**
|
|
978
|
+
* PATCH /order/{id}/checkin - Accept an order by checking in
|
|
979
|
+
*
|
|
980
|
+
* @param id - The order ID
|
|
981
|
+
* @param options - additional request options
|
|
982
|
+
*/
|
|
983
|
+
patch_order_checkin(
|
|
984
|
+
id: string,
|
|
985
|
+
options?: RequestOptions
|
|
986
|
+
): ResponsePromise<PatchOrderCheckinResponse> {
|
|
987
|
+
return this.request(
|
|
988
|
+
"order",
|
|
989
|
+
"patch_order_checkin",
|
|
990
|
+
"patch",
|
|
991
|
+
`/order/${id}/checkin`,
|
|
992
|
+
null,
|
|
993
|
+
options
|
|
994
|
+
);
|
|
995
|
+
}
|
|
996
|
+
|
|
969
997
|
/**
|
|
970
998
|
* POST /location - Create a new location
|
|
971
999
|
*
|
|
@@ -1410,67 +1438,65 @@ export class ServiceClient extends BaseServiceClient {
|
|
|
1410
1438
|
}
|
|
1411
1439
|
|
|
1412
1440
|
/**
|
|
1413
|
-
*
|
|
1441
|
+
* PATCH /location/group/{id}/deliverydestination - Patch single or multiple delivery destinations
|
|
1414
1442
|
*
|
|
1415
1443
|
* @param id - Group ID
|
|
1416
|
-
* @param
|
|
1444
|
+
* @param body
|
|
1417
1445
|
* @param options - additional request options
|
|
1418
1446
|
*/
|
|
1419
|
-
|
|
1447
|
+
patch_location_group_deliverydestination(
|
|
1420
1448
|
id: string,
|
|
1421
|
-
|
|
1449
|
+
body: PatchLocationGroupDeliverydestinationBody,
|
|
1422
1450
|
options?: RequestOptions
|
|
1423
|
-
): ResponsePromise<
|
|
1451
|
+
): ResponsePromise<PatchLocationGroupDeliverydestinationResponse> {
|
|
1424
1452
|
return this.request(
|
|
1425
1453
|
"location",
|
|
1426
|
-
"
|
|
1427
|
-
"
|
|
1428
|
-
`/location/group/${id}/deliverydestination
|
|
1429
|
-
|
|
1454
|
+
"patch_location_group_deliverydestination",
|
|
1455
|
+
"patch",
|
|
1456
|
+
`/location/group/${id}/deliverydestination`,
|
|
1457
|
+
body,
|
|
1430
1458
|
options
|
|
1431
1459
|
);
|
|
1432
1460
|
}
|
|
1433
1461
|
|
|
1434
1462
|
/**
|
|
1435
|
-
*
|
|
1463
|
+
* DELETE /location/group/{id}/deliverydestination - Delete single or multiple delivery destinations
|
|
1436
1464
|
*
|
|
1437
1465
|
* @param id - Group ID
|
|
1438
|
-
* @param delivery_destination - Delivery Destination ID
|
|
1439
1466
|
* @param body
|
|
1440
1467
|
* @param options - additional request options
|
|
1441
1468
|
*/
|
|
1442
|
-
|
|
1469
|
+
delete_location_group_deliverydestination(
|
|
1443
1470
|
id: string,
|
|
1444
|
-
|
|
1445
|
-
body: PatchLocationGroupDeliverydestinationBody,
|
|
1471
|
+
body: DeleteLocationGroupDeliverydestinationBody,
|
|
1446
1472
|
options?: RequestOptions
|
|
1447
|
-
): ResponsePromise<
|
|
1473
|
+
): ResponsePromise<DeleteLocationGroupDeliverydestinationResponse> {
|
|
1448
1474
|
return this.request(
|
|
1449
1475
|
"location",
|
|
1450
|
-
"
|
|
1451
|
-
"
|
|
1452
|
-
`/location/group/${id}/deliverydestination
|
|
1476
|
+
"delete_location_group_deliverydestination",
|
|
1477
|
+
"delete",
|
|
1478
|
+
`/location/group/${id}/deliverydestination`,
|
|
1453
1479
|
body,
|
|
1454
1480
|
options
|
|
1455
1481
|
);
|
|
1456
1482
|
}
|
|
1457
1483
|
|
|
1458
1484
|
/**
|
|
1459
|
-
*
|
|
1485
|
+
* GET /location/group/{id}/deliverydestination/{delivery_destination} - Get a delivery destination
|
|
1460
1486
|
*
|
|
1461
1487
|
* @param id - Group ID
|
|
1462
1488
|
* @param delivery_destination - Delivery Destination ID
|
|
1463
1489
|
* @param options - additional request options
|
|
1464
1490
|
*/
|
|
1465
|
-
|
|
1491
|
+
get_location_group_deliverydestination(
|
|
1466
1492
|
id: string,
|
|
1467
1493
|
delivery_destination: string,
|
|
1468
1494
|
options?: RequestOptions
|
|
1469
|
-
): ResponsePromise<
|
|
1495
|
+
): ResponsePromise<GetLocationGroupDeliverydestinationResponse> {
|
|
1470
1496
|
return this.request(
|
|
1471
1497
|
"location",
|
|
1472
|
-
"
|
|
1473
|
-
"
|
|
1498
|
+
"get_location_group_deliverydestination",
|
|
1499
|
+
"get",
|
|
1474
1500
|
`/location/group/${id}/deliverydestination/${delivery_destination}`,
|
|
1475
1501
|
null,
|
|
1476
1502
|
options
|
|
@@ -2343,6 +2369,26 @@ export class ServiceClient extends BaseServiceClient {
|
|
|
2343
2369
|
);
|
|
2344
2370
|
}
|
|
2345
2371
|
|
|
2372
|
+
/**
|
|
2373
|
+
* POST /partner/standardcognition/menu - Create new Standard Cognition menu from JSON files
|
|
2374
|
+
*
|
|
2375
|
+
* @param body
|
|
2376
|
+
* @param options - additional request options
|
|
2377
|
+
*/
|
|
2378
|
+
post_partner_standardcognition_menu(
|
|
2379
|
+
body: PostPartnerStandardcognitionMenuBody,
|
|
2380
|
+
options?: RequestOptions
|
|
2381
|
+
): ResponsePromise<PostPartnerStandardcognitionMenuResponse> {
|
|
2382
|
+
return this.request(
|
|
2383
|
+
"partner",
|
|
2384
|
+
"post_partner_standardcognition_menu",
|
|
2385
|
+
"post",
|
|
2386
|
+
`/partner/standardcognition/menu`,
|
|
2387
|
+
body,
|
|
2388
|
+
options
|
|
2389
|
+
);
|
|
2390
|
+
}
|
|
2391
|
+
|
|
2346
2392
|
/**
|
|
2347
2393
|
* GET /partner/coolr/locations - Gets the locations where Coolr is available
|
|
2348
2394
|
*
|
|
@@ -2397,6 +2443,16 @@ export class ServiceClient extends BaseServiceClient {
|
|
|
2397
2443
|
);
|
|
2398
2444
|
}
|
|
2399
2445
|
|
|
2446
|
+
/**
|
|
2447
|
+
* POST /email - Send an email
|
|
2448
|
+
*
|
|
2449
|
+
* @param body
|
|
2450
|
+
* @param options - additional request options
|
|
2451
|
+
*/
|
|
2452
|
+
post_email(body: PostEmailBody, options?: RequestOptions): ResponsePromise<PostEmailResponse> {
|
|
2453
|
+
return this.request("email", "post_email", "post", `/email`, body, options);
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2400
2456
|
/**
|
|
2401
2457
|
* POST /task/ - Create new Task
|
|
2402
2458
|
*
|
|
@@ -4141,6 +4197,28 @@ export class ServiceClient extends BaseServiceClient {
|
|
|
4141
4197
|
);
|
|
4142
4198
|
}
|
|
4143
4199
|
|
|
4200
|
+
/**
|
|
4201
|
+
* PUT /user/{id}/verification/phone - Send phone verification to user
|
|
4202
|
+
*
|
|
4203
|
+
* @param id - realm
|
|
4204
|
+
* @param body
|
|
4205
|
+
* @param options - additional request options
|
|
4206
|
+
*/
|
|
4207
|
+
put_user_verification_phone(
|
|
4208
|
+
id: string,
|
|
4209
|
+
body: PutUserVerificationPhoneBody,
|
|
4210
|
+
options?: RequestOptions
|
|
4211
|
+
): ResponsePromise<PutUserVerificationPhoneResponse> {
|
|
4212
|
+
return this.request(
|
|
4213
|
+
"user",
|
|
4214
|
+
"put_user_verification_phone",
|
|
4215
|
+
"put",
|
|
4216
|
+
`/user/${id}/verification/phone`,
|
|
4217
|
+
body,
|
|
4218
|
+
options
|
|
4219
|
+
);
|
|
4220
|
+
}
|
|
4221
|
+
|
|
4144
4222
|
/**
|
|
4145
4223
|
* POST /loyalty/{id}/enroll/{user_id} - Enroll logged in user in Loyalty program
|
|
4146
4224
|
*
|
package/src/interface/email.ts
CHANGED
|
@@ -4,3 +4,27 @@ export interface Error {
|
|
|
4
4
|
message?: string;
|
|
5
5
|
code?: number;
|
|
6
6
|
}
|
|
7
|
+
|
|
8
|
+
export interface Success {
|
|
9
|
+
success?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface EmailPayload {
|
|
13
|
+
from: string;
|
|
14
|
+
to: string;
|
|
15
|
+
subject?: string;
|
|
16
|
+
// Text of an email instead of template_id/data
|
|
17
|
+
text?: string;
|
|
18
|
+
template_id?: string;
|
|
19
|
+
data?: any;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// POST /email - Send an email
|
|
23
|
+
|
|
24
|
+
export type PostEmailBody = EmailPayload;
|
|
25
|
+
|
|
26
|
+
export type PostEmailResponse = Success;
|
|
27
|
+
|
|
28
|
+
export interface PostEmailRequest {
|
|
29
|
+
body: PostEmailBody;
|
|
30
|
+
}
|
|
@@ -135,6 +135,8 @@ export interface Brand {
|
|
|
135
135
|
brand?: string;
|
|
136
136
|
// location
|
|
137
137
|
location?: string;
|
|
138
|
+
// location group
|
|
139
|
+
group?: string;
|
|
138
140
|
// payment
|
|
139
141
|
payment_provider?: string;
|
|
140
142
|
location_description?: string;
|
|
@@ -341,7 +343,7 @@ export interface PostOrPatchDeliveryDestination {
|
|
|
341
343
|
}
|
|
342
344
|
|
|
343
345
|
export interface DeliveryDestination {
|
|
344
|
-
//
|
|
346
|
+
// delivery_destination
|
|
345
347
|
id?: string;
|
|
346
348
|
// Name of the delivery destination
|
|
347
349
|
name: string;
|
|
@@ -751,53 +753,59 @@ export interface PostLocationGroupDeliverydestinationRequest
|
|
|
751
753
|
body: PostLocationGroupDeliverydestinationBody;
|
|
752
754
|
}
|
|
753
755
|
|
|
754
|
-
//
|
|
756
|
+
// PATCH /location/group/{id}/deliverydestination - Patch single or multiple delivery destinations
|
|
755
757
|
|
|
756
|
-
export interface
|
|
758
|
+
export interface PatchLocationGroupDeliverydestinationPath {
|
|
757
759
|
// Group ID
|
|
758
760
|
id: string;
|
|
759
|
-
// Delivery Destination ID
|
|
760
|
-
delivery_destination: string;
|
|
761
761
|
}
|
|
762
762
|
|
|
763
|
-
export
|
|
763
|
+
export interface PatchLocationGroupDeliverydestinationBody {
|
|
764
|
+
delivery_destinations?: PostOrPatchDeliveryDestination;
|
|
765
|
+
}
|
|
764
766
|
|
|
765
|
-
export interface
|
|
766
|
-
|
|
767
|
+
export interface PatchLocationGroupDeliverydestinationResponse {
|
|
768
|
+
delivery_destinations?: DeliveryDestination;
|
|
769
|
+
}
|
|
767
770
|
|
|
768
|
-
|
|
771
|
+
export interface PatchLocationGroupDeliverydestinationRequest
|
|
772
|
+
extends PatchLocationGroupDeliverydestinationPath {
|
|
773
|
+
body: PatchLocationGroupDeliverydestinationBody;
|
|
774
|
+
}
|
|
769
775
|
|
|
770
|
-
|
|
776
|
+
// DELETE /location/group/{id}/deliverydestination - Delete single or multiple delivery destinations
|
|
777
|
+
|
|
778
|
+
export interface DeleteLocationGroupDeliverydestinationPath {
|
|
771
779
|
// Group ID
|
|
772
780
|
id: string;
|
|
773
|
-
// Delivery Destination ID
|
|
774
|
-
delivery_destination: string;
|
|
775
781
|
}
|
|
776
782
|
|
|
777
|
-
export
|
|
783
|
+
export interface DeleteLocationGroupDeliverydestinationBody {
|
|
784
|
+
delivery_destination_ids?: string[];
|
|
785
|
+
}
|
|
778
786
|
|
|
779
|
-
export
|
|
787
|
+
export interface DeleteLocationGroupDeliverydestinationResponse {
|
|
788
|
+
deleted_delivery_destinations?: DeliveryDestination;
|
|
789
|
+
}
|
|
780
790
|
|
|
781
|
-
export interface
|
|
782
|
-
extends
|
|
783
|
-
body:
|
|
791
|
+
export interface DeleteLocationGroupDeliverydestinationRequest
|
|
792
|
+
extends DeleteLocationGroupDeliverydestinationPath {
|
|
793
|
+
body: DeleteLocationGroupDeliverydestinationBody;
|
|
784
794
|
}
|
|
785
795
|
|
|
786
|
-
//
|
|
796
|
+
// GET /location/group/{id}/deliverydestination/{delivery_destination} - Get a delivery destination
|
|
787
797
|
|
|
788
|
-
export interface
|
|
798
|
+
export interface GetLocationGroupDeliverydestinationPath {
|
|
789
799
|
// Group ID
|
|
790
800
|
id: string;
|
|
791
801
|
// Delivery Destination ID
|
|
792
802
|
delivery_destination: string;
|
|
793
803
|
}
|
|
794
804
|
|
|
795
|
-
export
|
|
796
|
-
deleted_delivery_destination?: DeliveryDestination;
|
|
797
|
-
}
|
|
805
|
+
export type GetLocationGroupDeliverydestinationResponse = DeliveryDestination;
|
|
798
806
|
|
|
799
|
-
export interface
|
|
800
|
-
extends
|
|
807
|
+
export interface GetLocationGroupDeliverydestinationRequest
|
|
808
|
+
extends GetLocationGroupDeliverydestinationPath {}
|
|
801
809
|
|
|
802
810
|
// GET /location/group/{id}/user/{user_id} - Get a location group info specific to user read permissions
|
|
803
811
|
|
|
@@ -1147,15 +1155,13 @@ export interface PatchLocationSectorRequest
|
|
|
1147
1155
|
// POST /location/company - Create a new company
|
|
1148
1156
|
|
|
1149
1157
|
export interface PostLocationCompanyBody {
|
|
1150
|
-
name
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
global_images_enabled?: boolean;
|
|
1158
|
-
};
|
|
1158
|
+
// Sector name
|
|
1159
|
+
name: string;
|
|
1160
|
+
// sector
|
|
1161
|
+
sector: string;
|
|
1162
|
+
label?: any;
|
|
1163
|
+
is?: {
|
|
1164
|
+
global_images_enabled?: boolean;
|
|
1159
1165
|
};
|
|
1160
1166
|
}
|
|
1161
1167
|
|
package/src/interface/menu.ts
CHANGED
|
@@ -127,6 +127,10 @@ export interface Item {
|
|
|
127
127
|
end?: string;
|
|
128
128
|
};
|
|
129
129
|
};
|
|
130
|
+
// chit sort order
|
|
131
|
+
sort_number?: number;
|
|
132
|
+
// menu sort order
|
|
133
|
+
menu_sort_number?: number;
|
|
130
134
|
};
|
|
131
135
|
category?: {
|
|
132
136
|
en?: string;
|
|
@@ -162,7 +166,13 @@ export interface Group {
|
|
|
162
166
|
disabled?: boolean;
|
|
163
167
|
hidden?: boolean;
|
|
164
168
|
};
|
|
165
|
-
meta?:
|
|
169
|
+
meta?: {
|
|
170
|
+
// chit sort order
|
|
171
|
+
sort_number?: number;
|
|
172
|
+
// menu sort order
|
|
173
|
+
menu_sort_number?: number;
|
|
174
|
+
[index: string]: any;
|
|
175
|
+
};
|
|
166
176
|
}
|
|
167
177
|
|
|
168
178
|
export interface Option {
|
|
@@ -187,7 +197,13 @@ export interface Option {
|
|
|
187
197
|
category?: string;
|
|
188
198
|
list?: string[];
|
|
189
199
|
}[];
|
|
190
|
-
meta?:
|
|
200
|
+
meta?: {
|
|
201
|
+
// chit sort order
|
|
202
|
+
sort_number?: number;
|
|
203
|
+
// menu sort order
|
|
204
|
+
menu_sort_number?: number;
|
|
205
|
+
[index: string]: any;
|
|
206
|
+
};
|
|
191
207
|
is?: {
|
|
192
208
|
disabled?: boolean;
|
|
193
209
|
hidden?: boolean;
|
|
@@ -211,7 +227,13 @@ export interface OptionsGroup {
|
|
|
211
227
|
hidden?: boolean;
|
|
212
228
|
out_of_stock?: boolean;
|
|
213
229
|
};
|
|
214
|
-
meta?:
|
|
230
|
+
meta?: {
|
|
231
|
+
// chit sort order
|
|
232
|
+
sort_number?: number;
|
|
233
|
+
// menu sort order
|
|
234
|
+
menu_sort_number?: number;
|
|
235
|
+
[index: string]: any;
|
|
236
|
+
};
|
|
215
237
|
[index: string]: any;
|
|
216
238
|
}
|
|
217
239
|
|
package/src/interface/order.ts
CHANGED
|
@@ -452,6 +452,8 @@ export interface GetOrderGroupOrdersQuery {
|
|
|
452
452
|
end?: number;
|
|
453
453
|
// Filter orders by their order type
|
|
454
454
|
order_type?: string;
|
|
455
|
+
// Filter orders by brand ID. Only return orders that involve brand ID, either as the only brand, or as part of a market place order.
|
|
456
|
+
brand?: string;
|
|
455
457
|
}
|
|
456
458
|
|
|
457
459
|
export interface GetOrderGroupOrdersResponse {
|
|
@@ -461,3 +463,14 @@ export interface GetOrderGroupOrdersResponse {
|
|
|
461
463
|
export interface GetOrderGroupOrdersRequest
|
|
462
464
|
extends GetOrderGroupOrdersQuery,
|
|
463
465
|
GetOrderGroupOrdersPath {}
|
|
466
|
+
|
|
467
|
+
// PATCH /order/{id}/checkin - Accept an order by checking in
|
|
468
|
+
|
|
469
|
+
export interface PatchOrderCheckinPath {
|
|
470
|
+
// The order ID
|
|
471
|
+
id: string;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
export type PatchOrderCheckinResponse = Order;
|
|
475
|
+
|
|
476
|
+
export interface PatchOrderCheckinRequest extends PatchOrderCheckinPath {}
|