@compassdigital/sdk.typescript 4.23.1 → 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.1",
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
  }
@@ -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
  };
@@ -637,6 +637,7 @@ export interface DraftModifierGroupDTO {
637
637
  limit?: number;
638
638
  brand_id?: string;
639
639
  order_type?: "selection" | "option" | "quantity";
640
+ sizing?: string;
640
641
  is_out_of_stock?: FilterFieldDTO;
641
642
  applied_diff_snapshot?: FilterFieldDTO;
642
643
  brand?: Record<string, any>;
@@ -682,9 +683,13 @@ export interface DraftModifierDTO {
682
683
  reporting?: ReportingMetadataDTO;
683
684
  posid_segment?: FilterFieldDTO;
684
685
  brand_id?: string;
685
- sizing?: FilterFieldDTO[];
686
686
  menu_works?: MenuWorksDTO;
687
687
  is_out_of_stock?: FilterFieldDTO;
688
+ price_for_none?: number;
689
+ price_for_less?: number;
690
+ price_for_more?: number;
691
+ pre_surcharge?: number;
692
+ post_surcharge?: number;
688
693
  applied_diff_snapshot?: FilterFieldDTO;
689
694
  brand?: Record<string, any>;
690
695
  changes?: ModifierChangeDTO[];
@@ -858,8 +863,12 @@ export interface DraftModifierDraftModifierDTO {
858
863
  posid?: FilterFieldDTO;
859
864
  posid_segment?: FilterFieldDTO;
860
865
  brand_id?: FilterFieldDTO;
861
- sizing?: FilterFieldDTO[];
862
866
  is_out_of_stock?: FilterFieldDTO;
867
+ price_for_none?: FilterFieldDTO;
868
+ price_for_less?: FilterFieldDTO;
869
+ price_for_more?: FilterFieldDTO;
870
+ pre_surcharge?: FilterFieldDTO;
871
+ post_surcharge?: FilterFieldDTO;
863
872
  id?: FilterFieldDTO;
864
873
  version?: FilterFieldDTO;
865
874
  created_at?: FilterFieldDTO;
@@ -890,6 +899,7 @@ export interface DraftModifierGroupDraftModifierGroupDTO {
890
899
  limit?: FilterFieldDTO;
891
900
  brand_id?: FilterFieldDTO;
892
901
  order_type?: FilterFieldDTO;
902
+ sizing?: FilterFieldDTO;
893
903
  is_out_of_stock?: FilterFieldDTO;
894
904
  id?: FilterFieldDTO;
895
905
  version?: FilterFieldDTO;
@@ -1089,6 +1099,7 @@ export interface PublishedModifierGroupDTO {
1089
1099
  limit?: number;
1090
1100
  brand_id?: string;
1091
1101
  order_type?: "selection" | "option" | "quantity";
1102
+ sizing?: string;
1092
1103
  is_out_of_stock?: boolean;
1093
1104
  permissions?: Record<string, any>;
1094
1105
  [index: string]: any;
@@ -1118,8 +1129,12 @@ export interface PublishedModifierDTO {
1118
1129
  posid?: string;
1119
1130
  posid_segment?: string;
1120
1131
  brand_id?: string;
1121
- sizing?: Record<string, any>[];
1122
1132
  is_out_of_stock?: boolean;
1133
+ price_for_none?: number;
1134
+ price_for_less?: number;
1135
+ price_for_more?: number;
1136
+ pre_surcharge?: number;
1137
+ post_surcharge?: number;
1123
1138
  permissions?: Record<string, any>;
1124
1139
  [index: string]: any;
1125
1140
  }
@@ -1648,6 +1663,7 @@ export interface PublishedModifierGroupPublishedModifierGroupDTO {
1648
1663
  limit?: FilterFieldDTO;
1649
1664
  brand_id?: FilterFieldDTO;
1650
1665
  order_type?: FilterFieldDTO;
1666
+ sizing?: FilterFieldDTO;
1651
1667
  is_out_of_stock?: FilterFieldDTO;
1652
1668
  id?: FilterFieldDTO;
1653
1669
  version?: FilterFieldDTO;
@@ -1726,9 +1742,13 @@ export interface DraftModifierEntityDTO {
1726
1742
  reporting: ReportingMetadataDTO;
1727
1743
  posid_segment?: string;
1728
1744
  brand_id: string;
1729
- sizing?: Record<string, any>[];
1730
1745
  menu_works?: MenuWorksDTO;
1731
1746
  is_out_of_stock?: boolean;
1747
+ price_for_none: number;
1748
+ price_for_less: number;
1749
+ price_for_more: number;
1750
+ pre_surcharge: number;
1751
+ post_surcharge: number;
1732
1752
  applied_diff_snapshot?: Record<string, any>;
1733
1753
  version?: number;
1734
1754
  brand?: DraftBrandDTO;
@@ -1752,8 +1772,12 @@ export interface PublishedModifierPublishedModifierDTO {
1752
1772
  posid?: FilterFieldDTO;
1753
1773
  posid_segment?: FilterFieldDTO;
1754
1774
  brand_id?: FilterFieldDTO;
1755
- sizing?: FilterFieldDTO[];
1756
1775
  is_out_of_stock?: FilterFieldDTO;
1776
+ price_for_none?: FilterFieldDTO;
1777
+ price_for_less?: FilterFieldDTO;
1778
+ price_for_more?: FilterFieldDTO;
1779
+ pre_surcharge?: FilterFieldDTO;
1780
+ post_surcharge?: FilterFieldDTO;
1757
1781
  id?: FilterFieldDTO;
1758
1782
  version?: FilterFieldDTO;
1759
1783
  created_at?: FilterFieldDTO;
@@ -5364,6 +5388,7 @@ export interface PostMenuV3DraftModifierGroupBody {
5364
5388
  limit?: number;
5365
5389
  brand_id: string;
5366
5390
  order_type?: "selection" | "option" | "quantity";
5391
+ sizing?: string;
5367
5392
  is_out_of_stock?: boolean;
5368
5393
  id?: Record<string, any>;
5369
5394
  applied_diff_snapshot?: Record<string, any>;
@@ -5423,6 +5448,7 @@ export interface PatchMenuV3DraftModifierGroupBody {
5423
5448
  limit?: number;
5424
5449
  brand_id?: string;
5425
5450
  order_type?: "selection" | "option" | "quantity";
5451
+ sizing?: string;
5426
5452
  is_out_of_stock?: boolean;
5427
5453
  applied_diff_snapshot?: Record<string, any>;
5428
5454
  version?: number;
@@ -5502,6 +5528,7 @@ export type PostMenuV3DraftModifierGroupsBody = {
5502
5528
  limit?: number;
5503
5529
  brand_id: string;
5504
5530
  order_type?: "selection" | "option" | "quantity";
5531
+ sizing?: string;
5505
5532
  is_out_of_stock?: boolean;
5506
5533
  id?: Record<string, any>;
5507
5534
  applied_diff_snapshot?: Record<string, any>;
@@ -5566,6 +5593,7 @@ export interface PostMenuV3DraftModifierGroupDuplicateResponse {
5566
5593
  limit?: number;
5567
5594
  brand_id: string;
5568
5595
  order_type?: "selection" | "option" | "quantity";
5596
+ sizing?: string;
5569
5597
  is_out_of_stock?: boolean;
5570
5598
  applied_diff_snapshot?: Record<string, any>;
5571
5599
  version?: number;
@@ -5938,9 +5966,13 @@ export interface PostMenuV3DraftModifierBody {
5938
5966
  reporting: ReportingMetadataDTO;
5939
5967
  posid_segment?: string;
5940
5968
  brand_id: string;
5941
- sizing?: Record<string, any>[];
5942
5969
  menu_works?: MenuWorksDTO;
5943
5970
  is_out_of_stock?: boolean;
5971
+ price_for_none: number;
5972
+ price_for_less: number;
5973
+ price_for_more: number;
5974
+ pre_surcharge: number;
5975
+ post_surcharge: number;
5944
5976
  id?: Record<string, any>;
5945
5977
  applied_diff_snapshot?: Record<string, any>;
5946
5978
  brand?: DraftBrandDTO;
@@ -6003,9 +6035,13 @@ export interface PatchMenuV3DraftModifierBody {
6003
6035
  reporting?: ReportingMetadataDTO;
6004
6036
  posid_segment?: string;
6005
6037
  brand_id?: string;
6006
- sizing?: Record<string, any>[];
6007
6038
  menu_works?: MenuWorksDTO;
6008
6039
  is_out_of_stock?: boolean;
6040
+ price_for_none?: number;
6041
+ price_for_less?: number;
6042
+ price_for_more?: number;
6043
+ pre_surcharge?: number;
6044
+ post_surcharge?: number;
6009
6045
  applied_diff_snapshot?: Record<string, any>;
6010
6046
  version?: number;
6011
6047
  brand?: DraftBrandDTO;
@@ -6086,9 +6122,13 @@ export type PostMenuV3DraftModifiersBody = {
6086
6122
  reporting: ReportingMetadataDTO;
6087
6123
  posid_segment?: string;
6088
6124
  brand_id: string;
6089
- sizing?: Record<string, any>[];
6090
6125
  menu_works?: MenuWorksDTO;
6091
6126
  is_out_of_stock?: boolean;
6127
+ price_for_none: number;
6128
+ price_for_less: number;
6129
+ price_for_more: number;
6130
+ pre_surcharge: number;
6131
+ post_surcharge: number;
6092
6132
  id?: Record<string, any>;
6093
6133
  applied_diff_snapshot?: Record<string, any>;
6094
6134
  brand?: DraftBrandDTO;
@@ -6150,9 +6190,13 @@ export interface PatchMenuV3DraftModifiersBulkUpdateBody {
6150
6190
  reporting?: ReportingMetadataDTO;
6151
6191
  posid_segment?: string;
6152
6192
  brand_id?: string;
6153
- sizing?: Record<string, any>[];
6154
6193
  menu_works?: MenuWorksDTO;
6155
6194
  is_out_of_stock?: boolean;
6195
+ price_for_none?: number;
6196
+ price_for_less?: number;
6197
+ price_for_more?: number;
6198
+ pre_surcharge?: number;
6199
+ post_surcharge?: number;
6156
6200
  applied_diff_snapshot?: Record<string, any>;
6157
6201
  brand?: DraftBrandDTO;
6158
6202
  changes?: ModifierChangeDTO[];