@compassdigital/sdk.typescript 4.143.0 → 4.145.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.
@@ -0,0 +1,34 @@
1
+ export interface Timeslot {
2
+ start_time: string;
3
+ number_orders: number;
4
+ }
5
+ export interface GetTimeslotResponse {
6
+ timeslots: Timeslot[];
7
+ }
8
+ export interface ErrorDisplayMessage {
9
+ title: string;
10
+ description: string;
11
+ }
12
+ export interface ErrorData {
13
+ statusCode: number;
14
+ statusText: string;
15
+ timestamp: string;
16
+ displayMessage: ErrorDisplayMessage;
17
+ }
18
+ export interface Error {
19
+ code: number;
20
+ message: string;
21
+ data: ErrorData;
22
+ }
23
+ export interface GetTimeslotsBrandPath {
24
+ brandId: string;
25
+ }
26
+ export interface GetTimeslotsBrandQuery {
27
+ duration: number;
28
+ type: 'pickup' | 'delivery';
29
+ startTime: string;
30
+ endTime: string;
31
+ _query?: string;
32
+ }
33
+ export type GetTimeslotsBrandResponse = GetTimeslotResponse;
34
+ //# sourceMappingURL=timeslots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeslots.d.ts","sourceRoot":"","sources":["../../src/interface/timeslots.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,QAAQ;IAExB,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAEnC,SAAS,EAAE,QAAQ,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAEnC,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,SAAS;IAEzB,UAAU,EAAE,MAAM,CAAC;IAEnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,mBAAmB,CAAC;CACpC;AAED,MAAM,WAAW,KAAK;IAErB,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;CAChB;AAID,MAAM,WAAW,qBAAqB;IAErC,OAAO,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IAEtC,QAAQ,EAAE,MAAM,CAAC;IAEjB,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAC;IAE5B,SAAS,EAAE,MAAM,CAAC;IAElB,OAAO,EAAE,MAAM,CAAC;IAEhB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,yBAAyB,GAAG,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=timeslots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeslots.js","sourceRoot":"","sources":["../../src/interface/timeslots.ts"],"names":[],"mappings":";AAAA,oBAAoB;AACpB,sDAAsD"}
@@ -0,0 +1,68 @@
1
+ export interface DiscountStatus {
2
+ live?: boolean;
3
+ publishedTo3rdParty?: boolean;
4
+ readyToPublish?: boolean;
5
+ active?: boolean;
6
+ }
7
+ export interface DiscountIs {
8
+ badgepayPromo?: boolean;
9
+ mealplanPromo?: boolean;
10
+ decliningBalancePromo?: boolean;
11
+ voucherPromo?: boolean;
12
+ }
13
+ export interface VoucherifyMetaDataDiscount {
14
+ type: 'AMOUNT_OFF' | 'PERCENT_OFF';
15
+ amountOff?: number;
16
+ percentOff?: number;
17
+ }
18
+ export interface VoucherifyMetaData {
19
+ id?: string;
20
+ code?: string;
21
+ discount?: VoucherifyMetaDataDiscount;
22
+ }
23
+ export interface MetaProvider {
24
+ voucherify?: VoucherifyMetaData;
25
+ }
26
+ export interface DiscountMeta {
27
+ provider: MetaProvider;
28
+ }
29
+ export interface DiscountAssociation {
30
+ id: string;
31
+ createdAt: string;
32
+ updatedAt: string;
33
+ discount: string;
34
+ site?: string;
35
+ brand?: string;
36
+ providerData?: ProviderData;
37
+ }
38
+ export interface ProviderData {
39
+ voucherify?: {
40
+ id?: string;
41
+ code?: string;
42
+ };
43
+ }
44
+ export interface DiscountCreatedEvent {
45
+ id: string;
46
+ type: 'DiscountCreatedEvent';
47
+ version: '0.0.1';
48
+ timestamp: string;
49
+ traceContext: {
50
+ traceId?: string;
51
+ };
52
+ payload: {
53
+ discount: {
54
+ id: string;
55
+ createdBy: string;
56
+ updatedBy?: string;
57
+ createdAt: string;
58
+ updatedAt: string;
59
+ name: string;
60
+ status?: DiscountStatus;
61
+ is?: DiscountIs;
62
+ meta?: DiscountMeta;
63
+ };
64
+ discountAssociations?: DiscountAssociation[];
65
+ };
66
+ source: string;
67
+ }
68
+ //# sourceMappingURL=DiscountCreatedEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiscountCreatedEvent.d.ts","sourceRoot":"","sources":["../../../src/messages/events/DiscountCreatedEvent.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,cAAc;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,MAAM,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,0BAA0B;IAC1C,IAAI,EAAE,YAAY,GAAG,aAAa,CAAC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kBAAkB;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EA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@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ // THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=DiscountCreatedEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiscountCreatedEvent.js","sourceRoot":"","sources":["../../../src/messages/events/DiscountCreatedEvent.ts"],"names":[],"mappings":";AAAA,sDAAsD"}
@@ -1,2 +1,3 @@
1
+ export { DiscountCreatedEvent } from './DiscountCreatedEvent';
1
2
  export { FakeEvent } from './FakeEvent';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/messages/events/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/messages/events/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
package/manifest.json CHANGED
@@ -150,6 +150,13 @@
150
150
  "options": {
151
151
  "request": false
152
152
  }
153
+ },
154
+ {
155
+ "name": "timeslots",
156
+ "swagger": "../../api/platform2/timeslots/swagger.json",
157
+ "options": {
158
+ "request": false
159
+ }
153
160
  }
154
161
  ]
155
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compassdigital/sdk.typescript",
3
- "version": "4.143.0",
3
+ "version": "4.145.0",
4
4
  "description": "Compass Digital Labs TypeScript SDK",
5
5
  "type": "commonjs",
6
6
  "main": "./lib/index.js",
package/src/index.ts CHANGED
@@ -1285,6 +1285,8 @@ import {
1285
1285
  PutDiscountPublishResponse,
1286
1286
  } from './interface/discount';
1287
1287
 
1288
+ import { GetTimeslotsBrandQuery, GetTimeslotsBrandResponse } from './interface/timeslots';
1289
+
1288
1290
  import { BaseServiceClient, RequestOptions, ResponsePromise } from './base';
1289
1291
  export * from './base';
1290
1292
 
@@ -13344,4 +13346,26 @@ export class ServiceClient extends BaseServiceClient {
13344
13346
  options,
13345
13347
  );
13346
13348
  }
13349
+
13350
+ /**
13351
+ * GET /timeslots/brand/{brandId} - Get timeslots for brand
13352
+ *
13353
+ * @param brandId - brandId
13354
+ * @param options - additional request options
13355
+ */
13356
+ get_timeslots_brand(
13357
+ brandId: string,
13358
+ options: {
13359
+ query: GetTimeslotsBrandQuery;
13360
+ } & RequestOptions,
13361
+ ): ResponsePromise<GetTimeslotsBrandResponse> {
13362
+ return this.request(
13363
+ 'timeslots',
13364
+ '/timeslots/brand/{brandId}',
13365
+ 'GET',
13366
+ `/timeslots/brand/${brandId}`,
13367
+ null,
13368
+ options,
13369
+ );
13370
+ }
13347
13371
  }
@@ -550,8 +550,6 @@ export interface ConsumerDiscountStatus {
550
550
  export interface ConsumerDiscountIs {
551
551
  badgepayPromo?: boolean;
552
552
  mealplanPromo?: boolean;
553
- decliningBalancePromo?: boolean;
554
- voucherPromo?: boolean;
555
553
  }
556
554
 
557
555
  export interface ConsumerVoucherifyMetaDataDiscount {
@@ -566,12 +564,12 @@ export interface ConsumerVoucherifyMetaData {
566
564
  discount?: ConsumerVoucherifyMetaDataDiscount;
567
565
  }
568
566
 
569
- export interface ClassMetaProvider {
567
+ export interface ConsumerMetaProvider {
570
568
  voucherify?: ConsumerVoucherifyMetaData;
571
569
  }
572
570
 
573
571
  export interface ConsumerDiscountMeta {
574
- provider: ClassMetaProvider;
572
+ provider: ConsumerMetaProvider;
575
573
  }
576
574
 
577
575
  export interface ConsumerStackedDiscount {
@@ -588,7 +586,7 @@ export interface ConsumerStackedDiscount {
588
586
  }
589
587
 
590
588
  export interface Discounts {
591
- applied_amount?: number;
589
+ stacked_total?: number;
592
590
  app?: string;
593
591
  stacked_discounts?: ConsumerStackedDiscount[];
594
592
  }
@@ -1263,6 +1261,8 @@ export interface GetConsumerMenuResponse {
1263
1261
  }
1264
1262
 
1265
1263
  export interface ConsumerOption {
1264
+ // Metadata for the option
1265
+ meta?: Record<string, any>;
1266
1266
  id?: string;
1267
1267
  label?: {
1268
1268
  en?: string;
@@ -1310,6 +1310,8 @@ export interface ConsumerOption {
1310
1310
  }
1311
1311
 
1312
1312
  export interface ConsumerOptionsGroup {
1313
+ // Metadata for the options group
1314
+ meta?: Record<string, any>;
1313
1315
  id?: string;
1314
1316
  label?: {
1315
1317
  en?: string;
@@ -1330,6 +1332,8 @@ export interface ConsumerOptionsGroup {
1330
1332
  }
1331
1333
 
1332
1334
  export interface ConsumerItem {
1335
+ // Metadata for the item
1336
+ meta?: Record<string, any>;
1333
1337
  id?: string;
1334
1338
  label?: {
1335
1339
  en?: string;
@@ -1772,9 +1776,14 @@ export interface PostConsumerRecommendedRequest {
1772
1776
  excludedItems: string[];
1773
1777
  }
1774
1778
 
1779
+ export interface ConsumerRecommendedItem {
1780
+ item: ConsumerItem;
1781
+ station_name?: string;
1782
+ }
1783
+
1775
1784
  export interface PostConsumerRecommendedResponse {
1776
1785
  // items
1777
- items: ConsumerItem[];
1786
+ items: ConsumerRecommendedItem[];
1778
1787
  }
1779
1788
 
1780
1789
  export interface PostConsumerShoppingCartBodyRequest {
@@ -1893,22 +1902,11 @@ export interface PostConsumerPromoRedeemRequest {
1893
1902
  // The promo code to redeem
1894
1903
  code: string;
1895
1904
  // The email of the customer
1896
- email?: string;
1905
+ email: string;
1897
1906
  // The app of the customer
1898
- app?: string;
1899
- // The realm of the customer
1900
- realm?: string;
1907
+ app: string;
1901
1908
  // The location brand of the customer
1902
1909
  location_brand?: string;
1903
- shoppingcart?: {
1904
- id?: string;
1905
- date_created?: string;
1906
- items?: ShoppingcartItem[];
1907
- };
1908
- totals?: {
1909
- amount?: number;
1910
- currency?: string;
1911
- };
1912
1910
  }
1913
1911
 
1914
1912
  export interface ConsumerRedemption {