@compassdigital/sdk.typescript 4.23.0 → 4.24.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compassdigital/sdk.typescript",
3
- "version": "4.23.0",
3
+ "version": "4.24.0",
4
4
  "description": "Compass Digital Labs TypeScript SDK",
5
5
  "type": "commonjs",
6
6
  "main": "./lib/index.js",
@@ -22,7 +22,7 @@
22
22
  "jest": {
23
23
  "testEnvironment": "node",
24
24
  "transform": {
25
- "^.+\\.tsx?$": "esbuild-jest"
25
+ "^.+\\.(t|j)sx?$": "@swc/jest"
26
26
  }
27
27
  },
28
28
  "scripts": {
@@ -47,11 +47,12 @@
47
47
  "devDependencies": {
48
48
  "@compassdigital/review": "^7.3.0",
49
49
  "@compassdigital/sdk.typescript.cli": "^4.14.0",
50
+ "@swc/core": "^1.4.1",
51
+ "@swc/jest": "^0.2.36",
50
52
  "@types/jest": "^29.2.4",
51
53
  "@types/node": "^20.1.0",
52
54
  "esbuild": "^0.20.0",
53
- "esbuild-jest": "^0.5.0",
54
- "jest": "^29.3.1",
55
+ "jest": "^29.7.0",
55
56
  "rimraf": "^5.0.0",
56
57
  "typescript": "^5.0.2"
57
58
  }
package/src/index.ts CHANGED
@@ -647,6 +647,8 @@ import {
647
647
  GetMenuV3MenusCountResponse,
648
648
  GetMenuV3MenuCategoriesQuery,
649
649
  GetMenuV3MenuCategoriesResponse,
650
+ PatchMenuV3StockBody,
651
+ PatchMenuV3StockResponse,
650
652
  PostMenuV3DraftCategoryBody,
651
653
  PostMenuV3DraftCategoryResponse,
652
654
  GetMenuV3DraftCategoryQuery,
@@ -803,6 +805,8 @@ import {
803
805
  GetMenuV3GlobalDiffsResponse,
804
806
  GetMenuV3GlobalDiffsCountQuery,
805
807
  GetMenuV3GlobalDiffsCountResponse,
808
+ GetMenuV3MenuworksQuery,
809
+ GetMenuV3MenuworksResponse,
806
810
  } from "./interface/menu";
807
811
 
808
812
  import {
@@ -2972,13 +2976,13 @@ export class ServiceClient extends BaseServiceClient {
2972
2976
  }
2973
2977
 
2974
2978
  /**
2975
- * POST /task/ - Create new Task
2979
+ * POST /task - Create new Task
2976
2980
  *
2977
2981
  * @param body - Task Information
2978
2982
  * @param options - additional request options
2979
2983
  */
2980
2984
  post_task(body: PostTaskBody, options?: RequestOptions): ResponsePromise<PostTaskResponse> {
2981
- return this.request("task", "post_task", "post", `/task/`, body, options);
2985
+ return this.request("task", "post_task", "post", `/task`, body, options);
2982
2986
  }
2983
2987
 
2984
2988
  /**
@@ -6775,6 +6779,28 @@ export class ServiceClient extends BaseServiceClient {
6775
6779
  );
6776
6780
  }
6777
6781
 
6782
+ /**
6783
+ * PATCH /menu/v3/{id}/stock
6784
+ *
6785
+ * @param id
6786
+ * @param body
6787
+ * @param options - additional request options
6788
+ */
6789
+ patch_menu_v3_stock(
6790
+ id: string,
6791
+ body: PatchMenuV3StockBody,
6792
+ options?: RequestOptions,
6793
+ ): ResponsePromise<PatchMenuV3StockResponse> {
6794
+ return this.request(
6795
+ "menu",
6796
+ "patch_menu_v3_stock",
6797
+ "patch",
6798
+ `/menu/v3/${id}/stock`,
6799
+ body,
6800
+ options,
6801
+ );
6802
+ }
6803
+
6778
6804
  /**
6779
6805
  * POST /menu/v3/draft/category
6780
6806
  *
@@ -8459,6 +8485,19 @@ export class ServiceClient extends BaseServiceClient {
8459
8485
  );
8460
8486
  }
8461
8487
 
8488
+ /**
8489
+ * GET menu/v3/menuworks
8490
+ *
8491
+ * @param options - additional request options
8492
+ */
8493
+ get_menu_v3_menuworks(
8494
+ options?: {
8495
+ query?: GetMenuV3MenuworksQuery;
8496
+ } & RequestOptions,
8497
+ ): ResponsePromise<GetMenuV3MenuworksResponse> {
8498
+ return this.request("menu", "get_menu_v3_menuworks", "get", `menu/v3/menuworks`, null, options);
8499
+ }
8500
+
8462
8501
  /**
8463
8502
  * GET /notification - Get all notifications
8464
8503
  *
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ // /* eslint-disable */
2
2
  // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
3
3
 
4
4
  import { RequestQuery, BaseRequest } from "./util";
@@ -95,10 +95,10 @@ export interface Brand {
95
95
  };
96
96
  hours?: Hours[];
97
97
  deliveryHours?: DeliveryHours[];
98
- style?: Record<string, any>;
98
+ style?: any;
99
99
  // pos
100
100
  pos?: string;
101
- terminals?: Record<string, any>[];
101
+ terminals?: any[];
102
102
  timeslots?: {
103
103
  time?: string;
104
104
  averagePrepTime?: string;
@@ -145,8 +145,8 @@ export interface Brand {
145
145
  // company
146
146
  company?: string;
147
147
  config?: {
148
- private?: Record<string, any>;
149
- public?: Record<string, any>;
148
+ private?: any;
149
+ public?: any;
150
150
  };
151
151
  tax_rate?: number;
152
152
  meta?: {
@@ -254,8 +254,8 @@ export interface Location {
254
254
  en?: string;
255
255
  fr?: string;
256
256
  };
257
- hours?: Record<string, any>;
258
- deliveryHours?: Record<string, any>;
257
+ hours?: any;
258
+ deliveryHours?: any;
259
259
  service_fee?: {
260
260
  type?: string;
261
261
  value?: number;
@@ -280,7 +280,7 @@ export interface Group {
280
280
  meta?: {
281
281
  [index: string]: any;
282
282
  };
283
- style?: Record<string, any>;
283
+ style?: any;
284
284
  timezone?: string;
285
285
  [index: string]: any;
286
286
  }
@@ -300,7 +300,7 @@ export interface success {
300
300
  export interface Error {
301
301
  error?: string;
302
302
  code?: number;
303
- data?: Record<string, any>;
303
+ data?: any;
304
304
  }
305
305
 
306
306
  export interface Sector {
@@ -419,7 +419,7 @@ export interface BadRequest {
419
419
  error?: string;
420
420
  }
421
421
 
422
- export type PartnerStatus = "await_partner" | "await_scout" | "completed";
422
+ export type PartnerStatus = string;
423
423
 
424
424
  export interface WaitTime {
425
425
  // maxium wait time to the next time slot in minutes
@@ -430,7 +430,7 @@ export interface WaitTime {
430
430
  ready_time: number;
431
431
  }
432
432
 
433
- export type BrandOrMenuState = "open" | "closed" | "preorder";
433
+ export type BrandOrMenuState = string;
434
434
 
435
435
  export interface MenuAssociations {
436
436
  menu_associations?: MenuAssociation[];
@@ -449,6 +449,23 @@ export interface MenuAssociation {
449
449
  [index: string]: any;
450
450
  }
451
451
 
452
+ export interface WaitTimeResponse {
453
+ // group
454
+ id?: string;
455
+ locations?: {
456
+ // location
457
+ id?: string;
458
+ brands?: {
459
+ // location
460
+ id?: string;
461
+ estimated_wait_time?: {
462
+ delivery?: WaitTime;
463
+ pickup?: WaitTime;
464
+ };
465
+ }[];
466
+ }[];
467
+ }
468
+
452
469
  // POST /location - Create a new location
453
470
 
454
471
  export type PostLocationBody = Location;
@@ -473,9 +490,9 @@ export interface GetLocationsRequest extends BaseRequest, RequestQuery<GetLocati
473
490
  // GET /location/search - Gets Location within a radius of the provided point
474
491
 
475
492
  export interface GetLocationSearchQuery {
476
- //@deprecated
493
+ // The latitude to be used
477
494
  lat?: number;
478
- //@deprecated
495
+ // The longitude to be used
479
496
  long?: number;
480
497
  // Operation id to be used
481
498
  operation_id?: number;
@@ -500,7 +517,7 @@ export interface GetLocationQuery {
500
517
  // When fetching location, brands will come with private and public configs
501
518
  include_brands_config?: boolean;
502
519
  // active cafes
503
- active_cafes?: Record<string, any>[];
520
+ active_cafes?: any[];
504
521
  // show additional hidden properties/entities
505
522
  extended?: boolean;
506
523
  // Graphql query string
@@ -728,7 +745,7 @@ export interface GetLocationGroupQuery {
728
745
  non_market_places?: boolean;
729
746
  // return only groups with non-scan & go locations/brands
730
747
  non_scan_go?: boolean;
731
- // determine whether to calculate estimated_wait_time
748
+ //@deprecated
732
749
  include_estimated_wait_time?: boolean;
733
750
  // Graphql query string
734
751
  _query?: string;
@@ -790,6 +807,28 @@ export interface PatchLocationGroupRequest extends BaseRequest, PatchLocationGro
790
807
  body: PatchLocationGroupBody;
791
808
  }
792
809
 
810
+ // GET /location/group/{id}/waittimes - Get an individual Group's estimated wait times based on id
811
+
812
+ export interface GetLocationGroupWaittimesPath {
813
+ // group id
814
+ id: string;
815
+ }
816
+
817
+ export interface GetLocationGroupWaittimesQuery {
818
+ // show additional hidden properties/entities
819
+ extended?: boolean;
820
+ // Graphql query string
821
+ _query?: string;
822
+ nocache?: boolean;
823
+ }
824
+
825
+ export type GetLocationGroupWaittimesResponse = WaitTimeResponse;
826
+
827
+ export interface GetLocationGroupWaittimesRequest
828
+ extends BaseRequest,
829
+ RequestQuery<GetLocationGroupWaittimesQuery>,
830
+ GetLocationGroupWaittimesPath {}
831
+
793
832
  // GET /location/group/{id}/deliverydestination - Get all delivery destinations for group
794
833
 
795
834
  export interface GetLocationGroupDeliverydestinationsPath {
@@ -1234,7 +1273,7 @@ export interface PostLocationCompanyBody {
1234
1273
  name: string;
1235
1274
  // sector
1236
1275
  sector: string;
1237
- label?: Record<string, any>;
1276
+ label?: any;
1238
1277
  is?: {
1239
1278
  global_images_enabled?: boolean;
1240
1279
  };
@@ -220,7 +220,6 @@ export interface DeleteMealplanTenderBody {
220
220
  type?: string;
221
221
  conversion_amount?: number;
222
222
  terminal_id?: string;
223
- is_split_tender?: boolean;
224
223
  }
225
224
 
226
225
  export interface DeleteMealplanTenderResponse {
@@ -255,7 +254,6 @@ export interface PatchMealplanTenderBody {
255
254
  // Amount for order paid by user
256
255
  transaction_amount?: number;
257
256
  terminal_id?: string;
258
- is_split_tender?: boolean;
259
257
  }
260
258
 
261
259
  export type PatchMealplanTenderResponse = Tender;