@compassdigital/sdk.typescript 4.157.0 → 4.159.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.
@@ -7,8 +7,8 @@ export interface SendPushNotificationCommand {
7
7
  traceId?: string;
8
8
  };
9
9
  payload: {
10
- notification?: {
11
- targets: Record<string, any>[];
10
+ notification: {
11
+ targets: string[];
12
12
  createdAt: string;
13
13
  updatedAt: string;
14
14
  title: string;
@@ -1 +1 @@
1
- {"version":3,"file":"SendPushNotificationCommand.d.ts","sourceRoot":"","sources":["../../../src/messages/commands/SendPushNotificationCommand.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,2BAA2B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,OAAO,EAAE;QACR,YAAY,CAAC,EAAE;YACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;YAC/B,SAAS,EAAE,MAAM,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;YAClB,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;SAC3B,CAAC;KACF,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"SendPushNotificationCommand.d.ts","sourceRoot":"","sources":["../../../src/messages/commands/SendPushNotificationCommand.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,2BAA2B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,6BAA6B,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,OAAO,EAAE;QACR,YAAY,EAAE;YACb,OAAO,EAAE,MAAM,EAAE,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;YAClB,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;SAC3B,CAAC;KACF,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.157.0",
3
+ "version": "4.159.0",
4
4
  "description": "Compass Digital Labs TypeScript SDK",
5
5
  "type": "commonjs",
6
6
  "main": "./lib/index.js",
package/src/index.ts CHANGED
@@ -909,7 +909,11 @@ import {
909
909
  PostMenuV4BrandResponse,
910
910
  GetMenuV4BrandQuery,
911
911
  GetMenuV4BrandResponse,
912
+ PatchMenuV4BrandBody,
913
+ PatchMenuV4BrandResponse,
912
914
  DeleteMenuV4BrandResponse,
915
+ PostMenuV4BrandAttachmentQuery,
916
+ PostMenuV4BrandAttachmentResponse,
913
917
  PostMenuV4BrandMenuBody,
914
918
  PostMenuV4BrandMenuResponse,
915
919
  PatchMenuV4BrandMenuBody,
@@ -1137,6 +1141,8 @@ import {
1137
1141
  GetPaymentListByBrandResponse,
1138
1142
  GetCustomerOrdersQuery,
1139
1143
  GetCustomerOrdersResponse,
1144
+ PostConsumerOrderBody,
1145
+ PostConsumerOrderResponse,
1140
1146
  PostReviewOrderItemsBody,
1141
1147
  PostReviewOrderItemsResponse,
1142
1148
  GetConsumerHomePageQuery,
@@ -9881,6 +9887,28 @@ export class ServiceClient extends BaseServiceClient {
9881
9887
  );
9882
9888
  }
9883
9889
 
9890
+ /**
9891
+ * PATCH /menu/v4/brand/{id}
9892
+ *
9893
+ * @param id
9894
+ * @param body
9895
+ * @param options - additional request options
9896
+ */
9897
+ patch_menu_v4_brand(
9898
+ id: string,
9899
+ body: PatchMenuV4BrandBody,
9900
+ options?: RequestOptions,
9901
+ ): ResponsePromise<PatchMenuV4BrandResponse> {
9902
+ return this.request(
9903
+ 'menu',
9904
+ '/menu/v4/brand/{id}',
9905
+ 'PATCH',
9906
+ `/menu/v4/brand/${id}`,
9907
+ body,
9908
+ options,
9909
+ );
9910
+ }
9911
+
9884
9912
  /**
9885
9913
  * DELETE /menu/v4/brand/{id}
9886
9914
  *
@@ -9901,6 +9929,30 @@ export class ServiceClient extends BaseServiceClient {
9901
9929
  );
9902
9930
  }
9903
9931
 
9932
+ /**
9933
+ * POST /menu/v4/brand/{id}/attachment/{name}
9934
+ *
9935
+ * @param id
9936
+ * @param name
9937
+ * @param options - additional request options
9938
+ */
9939
+ post_menu_v4_brand_attachment(
9940
+ id: string,
9941
+ name: 'thumbnail',
9942
+ options?: {
9943
+ query?: PostMenuV4BrandAttachmentQuery;
9944
+ } & RequestOptions,
9945
+ ): ResponsePromise<PostMenuV4BrandAttachmentResponse> {
9946
+ return this.request(
9947
+ 'menu',
9948
+ '/menu/v4/brand/{id}/attachment/{name}',
9949
+ 'POST',
9950
+ `/menu/v4/brand/${id}/attachment/${name}`,
9951
+ null,
9952
+ options,
9953
+ );
9954
+ }
9955
+
9904
9956
  /**
9905
9957
  * POST /menu/v4/brand/{id}/menu
9906
9958
  *
@@ -12148,6 +12200,19 @@ export class ServiceClient extends BaseServiceClient {
12148
12200
  );
12149
12201
  }
12150
12202
 
12203
+ /**
12204
+ * POST /consumer/order - Create a new order
12205
+ *
12206
+ * @param body
12207
+ * @param options - additional request options
12208
+ */
12209
+ post_consumer_order(
12210
+ body: PostConsumerOrderBody,
12211
+ options?: RequestOptions,
12212
+ ): ResponsePromise<PostConsumerOrderResponse> {
12213
+ return this.request('consumer', '/consumer/order', 'POST', `/consumer/order`, body, options);
12214
+ }
12215
+
12151
12216
  /**
12152
12217
  * POST /consumer/review/order-items - Submit reviews for order items
12153
12218
  *
@@ -24,7 +24,6 @@ export interface AnnouncementPostRequestBody {
24
24
  is_global?: boolean;
25
25
  allowed_resources?: string[];
26
26
  position?: number;
27
- // @deprecated
28
27
  active?: boolean;
29
28
  status?: Status;
30
29
  // Announcement Properties
@@ -65,7 +64,6 @@ export interface AnnouncementPatchRequestBody {
65
64
  is_global?: boolean;
66
65
  allowed_resources?: string[];
67
66
  position?: number;
68
- // @deprecated
69
67
  active?: boolean;
70
68
  status?: Status;
71
69
  // Announcement Properties
@@ -89,7 +87,6 @@ export interface Announcement {
89
87
  // True if all the sites are linked
90
88
  is_global: boolean;
91
89
  allowed_resources: string[];
92
- // @deprecated
93
90
  active: boolean;
94
91
  status?: Status;
95
92
  schedule?: Schedule;
@@ -238,8 +238,6 @@ export interface CentricVoucherifyMetaData {
238
238
  export interface CentricDiscountIs {
239
239
  badgepayPromo?: boolean;
240
240
  mealplanPromo?: boolean;
241
- decliningBalancePromo?: boolean;
242
- voucherPromo?: boolean;
243
241
  }
244
242
 
245
243
  export interface PutDiscountVoucherifyRequestDiscount {
@@ -258,6 +256,8 @@ export interface PutDiscountVoucherifyRequestDTO {
258
256
  discount: PutDiscountVoucherifyRequestDiscount;
259
257
  // List of site IDs
260
258
  sites?: string[];
259
+ // List of brand IDs
260
+ brands?: string[];
261
261
  }
262
262
 
263
263
  export interface CentricDiscountStatus {
@@ -287,10 +287,12 @@ export interface DiscountResponseDTO {
287
287
  export interface PutDiscountVoucherifyResponseDTO {
288
288
  // List of site IDs
289
289
  sites: string[];
290
+ // List of brand IDs
291
+ brands: string[];
290
292
  discount: DiscountResponseDTO;
291
293
  }
292
294
 
293
- export interface SiteDTO {
295
+ export interface DiscountEntityDTO {
294
296
  // The ID of the site
295
297
  id: string;
296
298
  // The name of the site
@@ -309,7 +311,7 @@ export interface PutDiscountVoucherifyPublishResponseDTO {
309
311
  [index: string]: any;
310
312
  } & CentricVoucherifyMetaData;
311
313
  // List of sites where discount is published
312
- sites?: SiteDTO[];
314
+ sites?: DiscountEntityDTO[];
313
315
  id: string;
314
316
  createdAt: string;
315
317
  updatedAt: string;
@@ -338,17 +340,21 @@ export interface DiscountDTO {
338
340
  export interface GetDiscountResponseDTO {
339
341
  discount: DiscountDTO;
340
342
  // The sites associated with the discount
341
- sites: SiteDTO[];
343
+ sites: DiscountEntityDTO[];
344
+ // The brands associated with the discount
345
+ brands: DiscountEntityDTO[];
342
346
  }
343
347
 
344
- export interface DiscountWithSitesDTO {
348
+ export interface DiscountWithEntitiesDTO {
345
349
  discount: DiscountDTO;
346
350
  // The sites associated with the discount
347
- sites: SiteDTO[];
351
+ sites: DiscountEntityDTO[];
352
+ // The brands associated with the discount
353
+ brands: DiscountEntityDTO[];
348
354
  }
349
355
 
350
356
  export interface GetAllDiscountsResponseDTO {
351
- discounts: DiscountWithSitesDTO[];
357
+ discounts: DiscountWithEntitiesDTO[];
352
358
  }
353
359
 
354
360
  // POST /centricos/ai/item/description - Generate item description
@@ -235,7 +235,7 @@ export interface OrderRefundItem {
235
235
  }
236
236
 
237
237
  export interface OrderCreditCard {
238
- // The credit card type (Amex, Visa, Mastercard, etc...
238
+ // The credit card type (Amex, Visa, Mastercard, etc...)
239
239
  card_type?: string;
240
240
  // The last 4 digits of the card number
241
241
  last4?: string;
@@ -267,6 +267,7 @@ export interface OrderMealplan {
267
267
  id?: string;
268
268
  // tender
269
269
  tender?: string;
270
+ // mealplan name
270
271
  name?: string;
271
272
  }
272
273
 
@@ -553,7 +554,7 @@ export interface ConsumerDiscountIs {
553
554
  }
554
555
 
555
556
  export interface ConsumerVoucherifyMetaDataDiscount {
556
- type: Record<string, any>;
557
+ type: 'AMOUNT_OFF' | 'PERCENT_OFF';
557
558
  amountOff?: number;
558
559
  percentOff?: number;
559
560
  }
@@ -582,7 +583,7 @@ export interface ConsumerStackedDiscount {
582
583
  status?: ConsumerDiscountStatus;
583
584
  is?: ConsumerDiscountIs;
584
585
  meta?: ConsumerDiscountMeta;
585
- applied_amount?: number;
586
+ applied_amount: number;
586
587
  }
587
588
 
588
589
  export interface Discounts {
@@ -800,6 +801,138 @@ export interface GetCustomerOrdersResponseDTO {
800
801
  orders: CustomerOrder[];
801
802
  }
802
803
 
804
+ export interface CreateOrderPayment {
805
+ token?: string;
806
+ credit_card?: OrderCreditCard;
807
+ badge_pay?: OrderCashlessPayment;
808
+ stipend?: OrderCashlessPayment;
809
+ voucher?: OrderCashlessPayment;
810
+ coupon_voucher?: OrderCashlessPayment;
811
+ }
812
+
813
+ export interface CreateOrderIs {
814
+ in_progress?: boolean;
815
+ ready?: boolean;
816
+ }
817
+
818
+ export interface CreateOrderMeta {
819
+ // which ui the order was placed on
820
+ source?: 'web' | 'mobile';
821
+ // Override for meta.active for testing purposes
822
+ active_override?: boolean;
823
+ }
824
+
825
+ export interface CreateOrderDetails {
826
+ name?: string;
827
+ contact_number?: string;
828
+ country_code?: string;
829
+ order_type?: string;
830
+ duration?: string;
831
+ destination?: string;
832
+ // Pickup or delivery instructions
833
+ instructions?: string;
834
+ }
835
+
836
+ export interface PostOrderBodyDto {
837
+ // The location brand
838
+ location_brand?: string;
839
+ // The location
840
+ location?: string;
841
+ // The shoppingcart
842
+ shoppingcart?: string;
843
+ payment?: CreateOrderPayment;
844
+ mealplan?: OrderMealplan;
845
+ // User ID
846
+ customer?: string;
847
+ is?: CreateOrderIs;
848
+ meta?: {
849
+ [index: string]: any;
850
+ } & CreateOrderMeta;
851
+ // Pickup (deprecated)
852
+ pickup?: string;
853
+ // Pickup name (deprecated)
854
+ pickup_name?: string;
855
+ // Requested date
856
+ requested_date?: string;
857
+ details?: CreateOrderDetails;
858
+ }
859
+
860
+ export interface PlacedOrderMeta {
861
+ // Check-in UUID for frictionless orders
862
+ checkin_uuid?: string;
863
+ // which ui the order was placed on
864
+ source?: 'web' | 'mobile';
865
+ transaction?: OrderTransaction;
866
+ shoppingcart?: OrderMetaShoppingcart;
867
+ // Indicate whether the order is active or inactive
868
+ active?: boolean;
869
+ // Override for meta.active for testing purposes
870
+ active_override?: boolean;
871
+ delivery?: OrderDelivery;
872
+ discount?: OrderDiscount;
873
+ // The type of kds that the brand uses
874
+ type_of_kds?: string;
875
+ // Indicate whether the order is eligible for cancellation
876
+ cancel_eligible?: boolean;
877
+ refunds?: OrderRefundTransaction[];
878
+ }
879
+
880
+ export interface PostOrderResponseDto {
881
+ // Order ID
882
+ id?: string;
883
+ // Brand/location ID
884
+ location_brand?: string;
885
+ // Location ID
886
+ location?: string;
887
+ // Shopping cart ID
888
+ shoppingcart?: string;
889
+ payment?: OrderPayment;
890
+ mealplan?: OrderMealplan;
891
+ meal_swipes?: OrderMealSwipes;
892
+ meal_exchange?: OrderMealplan;
893
+ // User ID
894
+ customer?: string;
895
+ is?: OrderIs;
896
+ date?: OrderDate;
897
+ // Pickup (deprecated)
898
+ pickup?: string;
899
+ // Pickup name (deprecated)
900
+ pickup_name?: string;
901
+ // Pickup ID (deprecated)
902
+ pickup_id?: string;
903
+ // Requested date
904
+ requested_date?: string;
905
+ details?: OrderDetails;
906
+ meta?: {
907
+ [index: string]: any;
908
+ } & PlacedOrderMeta;
909
+ issue?: OrderIssue;
910
+ // Past issues
911
+ past_issues?: OrderIssue[];
912
+ // Delivery user
913
+ runner?: string;
914
+ // Reorder eligibility
915
+ reorder_eligibility?:
916
+ | 'eligible'
917
+ | 'order_type_ineligible'
918
+ | 'location_ineligible'
919
+ | 'active_order'
920
+ | 'old_order'
921
+ | 'marketplace_order'
922
+ | 'duplicate_order'
923
+ | 'brand_unavailable'
924
+ | 'menu_unavailable'
925
+ | 'items_unavailable'
926
+ | 'refunded_order'
927
+ | 'modifiers_unavailable'
928
+ | 'modified_items'
929
+ | 'cancelled_order';
930
+ // Refunds
931
+ refunds?: OrderRefundItem[];
932
+ // Latest refunds
933
+ latest_refunds?: OrderRefundItem[];
934
+ }
935
+
803
936
  export interface PostReviewOrderItemRequest {
804
937
  // rating score
805
938
  score: number;
@@ -1987,6 +2120,12 @@ export interface GetCustomerOrdersQuery {
1987
2120
 
1988
2121
  export type GetCustomerOrdersResponse = GetCustomerOrdersResponseDTO;
1989
2122
 
2123
+ // POST /consumer/order - Create a new order
2124
+
2125
+ export type PostConsumerOrderBody = PostOrderBodyDto;
2126
+
2127
+ export type PostConsumerOrderResponse = PostOrderResponseDto;
2128
+
1990
2129
  // POST /consumer/review/order-items - Submit reviews for order items
1991
2130
 
1992
2131
  export type PostReviewOrderItemsBody = PostReviewOrderItemsRequestDTO;
@@ -14,8 +14,6 @@ export interface DiscountStatus {
14
14
  export interface DiscountIs {
15
15
  badgepayPromo?: boolean;
16
16
  mealplanPromo?: boolean;
17
- decliningBalancePromo?: boolean;
18
- voucherPromo?: boolean;
19
17
  }
20
18
 
21
19
  export interface VoucherifyMetaDataDiscount {
@@ -7578,6 +7578,99 @@ export interface GetMenuV4BrandRequest
7578
7578
  RequestQuery<GetMenuV4BrandQuery>,
7579
7579
  GetMenuV4BrandPath {}
7580
7580
 
7581
+ // PATCH /menu/v4/brand/{id}
7582
+
7583
+ export interface PatchMenuV4BrandPath {
7584
+ id: string;
7585
+ }
7586
+
7587
+ export interface PatchMenuV4BrandBody {
7588
+ parent?: DraftBrandDTO;
7589
+ children?: DraftBrandDTO[];
7590
+ menus?: DraftMenuDTO[];
7591
+ categories?: DraftCategoryDTO[];
7592
+ category_to_item_relationships?: DraftCategoryToItemRelationshipDTO[];
7593
+ items?: DraftItemDTO[];
7594
+ item_to_modifier_group_relationships?: DraftItemToModifierGroupRelationshipDTO[];
7595
+ modifier_groups?: DraftModifierGroupDTO[];
7596
+ modifier_group_to_modifier_relationships?: DraftModifierGroupToModifierRelationshipDTO[];
7597
+ modifiers?: DraftModifierDTO[];
7598
+ statuses?: BrandStatusDTO[];
7599
+ audit_logs?: AuditDTO[];
7600
+ catalog_id?: number;
7601
+ published_catalog_id?: number;
7602
+ stocks?: StockDTO[];
7603
+ name: string;
7604
+ description?: string;
7605
+ is_active?: boolean;
7606
+ type?: 'global' | 'local';
7607
+ parent_id?: string;
7608
+ local_menu_group_id?: string;
7609
+ global_menu_group_id?: string;
7610
+ posid_segment?: string;
7611
+ is_simplified_view?: boolean;
7612
+ auto_push_to_local?: boolean;
7613
+ frictionless_partner?: string;
7614
+ meta?: BrandMeta;
7615
+ supported_languages?: SupportedLanguages;
7616
+ applied_diff_snapshot?: Record<string, any>;
7617
+ changes?: BrandChangeDTO[];
7618
+ local_menu_group?: LocalMenuGroupDTO;
7619
+ global_menu_group?: GlobalMenuGroupDTO;
7620
+ vendor_metadata?: VendorMetadataDTO[];
7621
+ attachments?: FileAttachmentsDTO;
7622
+ permissions?: Record<string, any>;
7623
+ [index: string]: any;
7624
+ }
7625
+
7626
+ export interface PatchMenuV4BrandResponse {
7627
+ parent?: DraftBrandDTO;
7628
+ children?: DraftBrandDTO[];
7629
+ menus?: DraftMenuDTO[];
7630
+ categories?: DraftCategoryDTO[];
7631
+ category_to_item_relationships?: DraftCategoryToItemRelationshipDTO[];
7632
+ items?: DraftItemDTO[];
7633
+ item_to_modifier_group_relationships?: DraftItemToModifierGroupRelationshipDTO[];
7634
+ modifier_groups?: DraftModifierGroupDTO[];
7635
+ modifier_group_to_modifier_relationships?: DraftModifierGroupToModifierRelationshipDTO[];
7636
+ modifiers?: DraftModifierDTO[];
7637
+ statuses?: BrandStatusDTO[];
7638
+ audit_logs?: AuditDTO[];
7639
+ catalog_id?: number;
7640
+ published_catalog_id?: number;
7641
+ stocks?: StockDTO[];
7642
+ id: string;
7643
+ created_at?: string;
7644
+ updated_at?: string;
7645
+ deleted_at?: string;
7646
+ name: string;
7647
+ description?: string;
7648
+ is_active?: boolean;
7649
+ type?: 'global' | 'local';
7650
+ parent_id?: string;
7651
+ local_menu_group_id?: string;
7652
+ global_menu_group_id?: string;
7653
+ posid_segment?: string;
7654
+ is_simplified_view?: boolean;
7655
+ auto_push_to_local?: boolean;
7656
+ frictionless_partner?: string;
7657
+ meta?: BrandMeta;
7658
+ supported_languages?: SupportedLanguages;
7659
+ applied_diff_snapshot?: Record<string, any>;
7660
+ version?: number;
7661
+ changes?: BrandChangeDTO[];
7662
+ local_menu_group?: LocalMenuGroupDTO;
7663
+ global_menu_group?: GlobalMenuGroupDTO;
7664
+ vendor_metadata?: VendorMetadataDTO[];
7665
+ attachments?: FileAttachmentsDTO;
7666
+ permissions?: Record<string, any>;
7667
+ [index: string]: any;
7668
+ }
7669
+
7670
+ export interface PatchMenuV4BrandRequest extends BaseRequest, PatchMenuV4BrandPath {
7671
+ body: PatchMenuV4BrandBody;
7672
+ }
7673
+
7581
7674
  // DELETE /menu/v4/brand/{id}
7582
7675
 
7583
7676
  export interface DeleteMenuV4BrandPath {
@@ -7630,6 +7723,26 @@ export interface DeleteMenuV4BrandResponse {
7630
7723
 
7631
7724
  export interface DeleteMenuV4BrandRequest extends BaseRequest, DeleteMenuV4BrandPath {}
7632
7725
 
7726
+ // POST /menu/v4/brand/{id}/attachment/{name}
7727
+
7728
+ export interface PostMenuV4BrandAttachmentPath {
7729
+ name: 'thumbnail';
7730
+ id: string;
7731
+ }
7732
+
7733
+ export interface PostMenuV4BrandAttachmentQuery {
7734
+ 'body.data'?: string;
7735
+ }
7736
+
7737
+ export interface PostMenuV4BrandAttachmentResponse {
7738
+ status?: string;
7739
+ }
7740
+
7741
+ export interface PostMenuV4BrandAttachmentRequest
7742
+ extends BaseRequest,
7743
+ RequestQuery<PostMenuV4BrandAttachmentQuery>,
7744
+ PostMenuV4BrandAttachmentPath {}
7745
+
7633
7746
  // POST /menu/v4/brand/{id}/menu
7634
7747
 
7635
7748
  export interface PostMenuV4BrandMenuPath {
@@ -9,8 +9,8 @@ export interface SendPushNotificationCommand {
9
9
  traceId?: string;
10
10
  };
11
11
  payload: {
12
- notification?: {
13
- targets: Record<string, any>[];
12
+ notification: {
13
+ targets: string[];
14
14
  createdAt: string;
15
15
  updatedAt: string;
16
16
  title: string;