@compassdigital/sdk.typescript 4.690.0 → 4.694.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.
@@ -8,7 +8,7 @@ export interface UpdateOrderStatusCommand {
8
8
  };
9
9
  payload: {
10
10
  orderId: string;
11
- status: 'accepted' | 'in_progress' | 'ready' | 'out_for_delivery' | 'delivered' | 'see_kitchen';
11
+ status: 'accepted' | 'in_progress' | 'ready' | 'out_for_delivery' | 'delivered' | 'collected' | 'no_show' | 'see_kitchen';
12
12
  reason?: string;
13
13
  updateSource: string;
14
14
  };
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateOrderStatusCommand.d.ts","sourceRoot":"","sources":["../../../src/messages/commands/UpdateOrderStatusCommand.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,wBAAwB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,OAAO,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EACH,UAAU,GACV,aAAa,GACb,OAAO,GACP,kBAAkB,GAClB,WAAW,GACX,aAAa,CAAC;QAEjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"UpdateOrderStatusCommand.d.ts","sourceRoot":"","sources":["../../../src/messages/commands/UpdateOrderStatusCommand.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,wBAAwB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,0BAA0B,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,OAAO,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EACH,UAAU,GACV,aAAa,GACb,OAAO,GACP,kBAAkB,GAClB,WAAW,GACX,WAAW,GACX,SAAS,GACT,aAAa,CAAC;QAEjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CACf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compassdigital/sdk.typescript",
3
- "version": "4.690.0",
3
+ "version": "4.694.0",
4
4
  "description": "Compass Digital Labs TypeScript SDK",
5
5
  "type": "commonjs",
6
6
  "main": "./lib/index.js",
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "devDependencies": {
60
60
  "@compassdigital/review": "^7.6.3",
61
- "@compassdigital/sdk.typescript.cli": "^4.60.0",
61
+ "@compassdigital/sdk.typescript.cli": "^4.61.0",
62
62
  "@swc/core": "^1.4.1",
63
63
  "@swc/jest": "^0.2.36",
64
64
  "@types/jest": "^30.0.0",
package/src/base.ts CHANGED
@@ -414,6 +414,13 @@ export abstract class BaseServiceClient {
414
414
  * Determine the base url to use.
415
415
  */
416
416
  private base_url(service: string, { base_url, stage }: RequestOptions): string {
417
+ // An empty base_url falls back to the runtime origin (browser/jsdom),
418
+ // resolving requests the way a browser fetch would; in Node there is
419
+ // no origin, so the url stays relative.
420
+ if (base_url === '') {
421
+ const global: { location?: { origin?: string } } = globalThis;
422
+ return this.clean_url(global.location?.origin ?? '');
423
+ }
417
424
  // use the base url if one was provided.
418
425
  if (typeof base_url === 'string') {
419
426
  return this.clean_url(base_url);
package/src/index.ts CHANGED
@@ -1585,7 +1585,12 @@ import {
1585
1585
  GetForecastingHealthResponse,
1586
1586
  } from './interface/forecasting';
1587
1587
 
1588
- import { GetDeliveryHealthResponse, PostDeliveryOrderReadyResponse } from './interface/delivery';
1588
+ import {
1589
+ GetDeliveryHealthResponse,
1590
+ PostDeliveryOrderReadyResponse,
1591
+ PostDeliveryOrderOpenLidResponse,
1592
+ PostDeliveryOrderCloseLidResponse,
1593
+ } from './interface/delivery';
1589
1594
 
1590
1595
  import { BaseServiceClient, RequestOptions, ServiceClientOptions, ResponsePromise } from './base';
1591
1596
  export * from './base';
@@ -18035,4 +18040,44 @@ export class ServiceClient extends BaseServiceClient {
18035
18040
  options,
18036
18041
  );
18037
18042
  }
18043
+
18044
+ /**
18045
+ * POST /delivery/order/{id}/open - Open the lid of an AVRIDE order
18046
+ *
18047
+ * @param id
18048
+ * @param options - additional request options
18049
+ */
18050
+ post_delivery_order_open_lid(
18051
+ id: string,
18052
+ options?: RequestOptions,
18053
+ ): ResponsePromise<PostDeliveryOrderOpenLidResponse> {
18054
+ return this.request(
18055
+ 'delivery',
18056
+ '/delivery/order/{id}/open',
18057
+ 'POST',
18058
+ `/delivery/order/${id}/open`,
18059
+ null,
18060
+ options,
18061
+ );
18062
+ }
18063
+
18064
+ /**
18065
+ * POST /delivery/order/{id}/close - Close the lid of an AVRIDE order
18066
+ *
18067
+ * @param id
18068
+ * @param options - additional request options
18069
+ */
18070
+ post_delivery_order_close_lid(
18071
+ id: string,
18072
+ options?: RequestOptions,
18073
+ ): ResponsePromise<PostDeliveryOrderCloseLidResponse> {
18074
+ return this.request(
18075
+ 'delivery',
18076
+ '/delivery/order/{id}/close',
18077
+ 'POST',
18078
+ `/delivery/order/${id}/close`,
18079
+ null,
18080
+ options,
18081
+ );
18082
+ }
18038
18083
  }
@@ -1765,6 +1765,61 @@ export interface ConsumerGetActiveMenusResponse {
1765
1765
  menus: ConsumerMenuHours[];
1766
1766
  }
1767
1767
 
1768
+ export interface MenuRecipeAllergenConsumer {
1769
+ // Allergen key for localization, icons, and filtering
1770
+ key?: string;
1771
+ // Allergen name
1772
+ name?: string;
1773
+ // Allergen contains status: 'Yes' or 'AtRisk'
1774
+ contains?: 'Yes' | 'AtRisk';
1775
+ }
1776
+
1777
+ export interface GetMenuItemRecipeConsumerV2 {
1778
+ // Smart tags
1779
+ smart_tags?: string[];
1780
+ // Allergen tags
1781
+ allergen_tags?: string[];
1782
+ // MenuWorks MRN
1783
+ mrn?: string;
1784
+ // MenuWorks unit ID
1785
+ unit_id?: string;
1786
+ // MenuWorks portion quantity
1787
+ portion_quantity?: number;
1788
+ // MenuWorks portion unit name
1789
+ portion_unit_name?: string;
1790
+ // MenuWorks grams
1791
+ grams?: number;
1792
+ // MenuWorks cost per serving
1793
+ cost?: number;
1794
+ // MenuWorks ingredients
1795
+ ingredients?: string[];
1796
+ // MenuWorks allergens with contains field
1797
+ allergens?: MenuRecipeAllergenConsumer[];
1798
+ }
1799
+
1800
+ export interface GetMenuItemMetaConsumerV2 {
1801
+ // Barcodes of the item
1802
+ barcodes?: string[];
1803
+ // Recipe metadata
1804
+ recipe?: GetMenuItemRecipeConsumerV2;
1805
+ superplate?: {
1806
+ type_id?: number;
1807
+ type?: string;
1808
+ };
1809
+ // Chit sort order
1810
+ sort_number?: number;
1811
+ // Menu sort order
1812
+ menu_sort_number?: number;
1813
+ // Unique ID of the entity
1814
+ unique_id?: number;
1815
+ tax?: {
1816
+ tax_tag_code?: string;
1817
+ tax_jwo_code?: string;
1818
+ tax_rate?: number;
1819
+ tax_amount?: number;
1820
+ };
1821
+ }
1822
+
1768
1823
  export interface ConsumerOption {
1769
1824
  // Metadata for the option
1770
1825
  meta?: Record<string, any>;
@@ -1838,7 +1893,7 @@ export interface ConsumerOptionsGroup {
1838
1893
 
1839
1894
  export interface ConsumerItem {
1840
1895
  // Metadata for the item
1841
- meta?: Record<string, any>;
1896
+ meta?: GetMenuItemMetaConsumerV2;
1842
1897
  id?: string;
1843
1898
  label?: {
1844
1899
  en?: string;
@@ -2120,15 +2175,6 @@ export interface GetMenuItemOptionsGroupConsumer {
2120
2175
  meta?: GetMenuItemGroupMetaConsumer;
2121
2176
  }
2122
2177
 
2123
- export interface MenuRecipeAllergenConsumer {
2124
- // Allergen key for localization, icons, and filtering
2125
- key?: string;
2126
- // Allergen name
2127
- name?: string;
2128
- // Allergen contains status: 'Yes' or 'AtRisk'
2129
- contains?: 'Yes' | 'AtRisk';
2130
- }
2131
-
2132
2178
  export interface GetMenuItemRecipeConsumer {
2133
2179
  // Smart tags
2134
2180
  smart_tags?: string[];
@@ -2508,52 +2554,6 @@ export interface GetMenuItemOptionsGroupConsumerV2 {
2508
2554
  meta?: GetMenuItemGroupMetaConsumerV2;
2509
2555
  }
2510
2556
 
2511
- export interface GetMenuItemRecipeConsumerV2 {
2512
- // Smart tags
2513
- smart_tags?: string[];
2514
- // Allergen tags
2515
- allergen_tags?: string[];
2516
- // MenuWorks MRN
2517
- mrn?: string;
2518
- // MenuWorks unit ID
2519
- unit_id?: string;
2520
- // MenuWorks portion quantity
2521
- portion_quantity?: number;
2522
- // MenuWorks portion unit name
2523
- portion_unit_name?: string;
2524
- // MenuWorks grams
2525
- grams?: number;
2526
- // MenuWorks cost per serving
2527
- cost?: number;
2528
- // MenuWorks ingredients
2529
- ingredients?: string[];
2530
- // MenuWorks allergens with contains field
2531
- allergens?: MenuRecipeAllergenConsumer[];
2532
- }
2533
-
2534
- export interface GetMenuItemMetaConsumerV2 {
2535
- // Barcodes of the item
2536
- barcodes?: string[];
2537
- // Recipe metadata
2538
- recipe?: GetMenuItemRecipeConsumerV2;
2539
- superplate?: {
2540
- type_id?: number;
2541
- type?: string;
2542
- };
2543
- // Chit sort order
2544
- sort_number?: number;
2545
- // Menu sort order
2546
- menu_sort_number?: number;
2547
- // Unique ID of the entity
2548
- unique_id?: number;
2549
- tax?: {
2550
- tax_tag_code?: string;
2551
- tax_jwo_code?: string;
2552
- tax_rate?: number;
2553
- tax_amount?: number;
2554
- };
2555
- }
2556
-
2557
2557
  export interface GetMenuItemIsConsumerV2 {
2558
2558
  // Is the item disabled
2559
2559
  disabled?: boolean;
@@ -46,13 +46,83 @@ export interface ErrorData {
46
46
  displayMessage: ErrorDisplayMessage;
47
47
  }
48
48
 
49
- export interface Error {
50
- // business error code
51
- code: number;
52
- // business error description
53
- message: string;
54
- // additional error data
55
- data: ErrorData;
49
+ export type Error = Record<string, any>;
50
+
51
+ export interface LocationDto {
52
+ // Street address
53
+ address?: string;
54
+ // External identifier for the location
55
+ extId?: string;
56
+ // Latitude
57
+ lat?: number;
58
+ // Longitude
59
+ lon?: number;
60
+ }
61
+
62
+ export interface EtaDto {
63
+ // Estimated drop-off time
64
+ dropOff?: string;
65
+ // Estimated pick-up time
66
+ pickUp?: string;
67
+ // Estimated return time
68
+ return?: string;
69
+ }
70
+
71
+ export interface RequestLocationDto {
72
+ // Street address
73
+ address: string;
74
+ }
75
+
76
+ export interface RequestDto {
77
+ // Client name
78
+ clientName?: string;
79
+ dst?: RequestLocationDto;
80
+ src?: RequestLocationDto;
81
+ }
82
+
83
+ export interface RobotPositionDto {
84
+ // Latitude
85
+ lat: number;
86
+ // Longitude
87
+ lon: number;
88
+ // Heading, in degrees
89
+ yaw: number;
90
+ }
91
+
92
+ export interface RoutePointDto {
93
+ // Latitude
94
+ lat: number;
95
+ // Longitude
96
+ lon: number;
97
+ }
98
+
99
+ export interface RobotDto {
100
+ // Whether the robot is delivering other orders
101
+ deliveringOtherOrders?: boolean;
102
+ // Robot name
103
+ name?: string;
104
+ position?: RobotPositionDto;
105
+ route?: RoutePointDto[];
106
+ }
107
+
108
+ export interface OrderOpenLidResponseDto {
109
+ // Order creation time
110
+ createdAt?: string;
111
+ dst: LocationDto;
112
+ eta: EtaDto;
113
+ // External identifier for the order
114
+ extId?: string;
115
+ // Order identifier
116
+ id: string;
117
+ // Whether the lid is ready to be opened
118
+ ready: boolean;
119
+ request?: RequestDto;
120
+ robots?: RobotDto[];
121
+ // Scheduled pick-up time
122
+ scheduledPickUp?: string;
123
+ src?: LocationDto;
124
+ // Order status
125
+ status: string;
56
126
  }
57
127
 
58
128
  // GET /delivery/health - Delivery service readiness check
@@ -70,3 +140,27 @@ export interface PostDeliveryOrderReadyPath {
70
140
  export type PostDeliveryOrderReadyResponse = OrderReadyResponseDto;
71
141
 
72
142
  export interface PostDeliveryOrderReadyRequest extends BaseRequest, PostDeliveryOrderReadyPath {}
143
+
144
+ // POST /delivery/order/{id}/open - Open the lid of an AVRIDE order
145
+
146
+ export interface PostDeliveryOrderOpenLidPath {
147
+ id: string;
148
+ }
149
+
150
+ export type PostDeliveryOrderOpenLidResponse = OrderOpenLidResponseDto;
151
+
152
+ export interface PostDeliveryOrderOpenLidRequest
153
+ extends BaseRequest,
154
+ PostDeliveryOrderOpenLidPath {}
155
+
156
+ // POST /delivery/order/{id}/close - Close the lid of an AVRIDE order
157
+
158
+ export interface PostDeliveryOrderCloseLidPath {
159
+ id: string;
160
+ }
161
+
162
+ export type PostDeliveryOrderCloseLidResponse = OrderOpenLidResponseDto;
163
+
164
+ export interface PostDeliveryOrderCloseLidRequest
165
+ extends BaseRequest,
166
+ PostDeliveryOrderCloseLidPath {}
@@ -108,6 +108,7 @@ export interface SoftwareIntegrations {
108
108
  };
109
109
  transact?: {
110
110
  enabled?: boolean;
111
+ integration_id?: string;
111
112
  };
112
113
  grubhub?: {
113
114
  enabled?: boolean;
@@ -619,6 +619,12 @@ export interface UnauthorizedErrorDTO {
619
619
  [index: string]: any;
620
620
  }
621
621
 
622
+ export interface ForbiddenErrorDTO {
623
+ number: number;
624
+ message: string;
625
+ [index: string]: any;
626
+ }
627
+
622
628
  export interface InternalServerErrorDTO {
623
629
  number: number;
624
630
  message: string;
@@ -16,6 +16,8 @@ export interface UpdateOrderStatusCommand {
16
16
  | 'ready'
17
17
  | 'out_for_delivery'
18
18
  | 'delivered'
19
+ | 'collected'
20
+ | 'no_show'
19
21
  | 'see_kitchen';
20
22
  // Reason if the status is see_kitchen
21
23
  reason?: string;