@kohost/api-client 3.0.0-beta.40 → 3.0.0-beta.42

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.
@@ -301,7 +301,7 @@ var require_SendEmailCommand = __commonJS({
301
301
  var Command = require_Command();
302
302
  var RequestError = require_RequestError();
303
303
  var SendEmailCommand2 = class extends Command {
304
- constructor({ text, html, to, from, subject, eventData }) {
304
+ constructor({ text, html, to, from, subject, ...rest }) {
305
305
  if (!to)
306
306
  throw new RequestError("email to is required");
307
307
  if (!from)
@@ -310,7 +310,7 @@ var require_SendEmailCommand = __commonJS({
310
310
  throw new RequestError("email subject is required");
311
311
  if (!text && !html)
312
312
  throw new RequestError("email text or html is required");
313
- super({ text, html, to, from, subject, eventData });
313
+ super({ text, html, to, from, subject, ...rest });
314
314
  }
315
315
  get name() {
316
316
  return "SendEmail";
@@ -330,14 +330,14 @@ var require_SendSMSCommand = __commonJS({
330
330
  var Command = require_Command();
331
331
  var RequestError = require_RequestError();
332
332
  var SendSMSCommand2 = class extends Command {
333
- constructor({ body, to, from, eventData }) {
333
+ constructor({ id, body, to, from, ...rest }) {
334
334
  if (!body)
335
335
  throw new RequestError("sms body is required");
336
336
  if (!to)
337
337
  throw new RequestError("sms to is required");
338
338
  if (!from)
339
339
  throw new RequestError("sms from is required");
340
- super({ body, to, from, eventData });
340
+ super({ id, body, to, from, ...rest });
341
341
  }
342
342
  get name() {
343
343
  return "SendSMS";
@@ -506,8 +506,8 @@ var require_DiscoverReservationsCommand = __commonJS({
506
506
  constructor(options) {
507
507
  if (!options)
508
508
  throw new RequestError("options are required");
509
- const { id, startDate, endDate, status } = options;
510
- super({ id, startDate, endDate, status });
509
+ const { id, startDate, endDate, status, ...rest } = options;
510
+ super({ id, startDate, endDate, status, ...rest });
511
511
  }
512
512
  get name() {
513
513
  return "DiscoverReservations";
@@ -521,6 +521,30 @@ var require_DiscoverReservationsCommand = __commonJS({
521
521
  }
522
522
  });
523
523
 
524
+ // src/Commands/DiscoverReservationRoomTypeUpsellOptionsCommand.js
525
+ var require_DiscoverReservationRoomTypeUpsellOptionsCommand = __commonJS({
526
+ "src/Commands/DiscoverReservationRoomTypeUpsellOptionsCommand.js"(exports2, module2) {
527
+ var { RequestError } = require_Errors();
528
+ var Command = require_Command();
529
+ var DiscoverReservationRoomTypeUpsellOptionsCommand2 = class extends Command {
530
+ constructor(options) {
531
+ if (!options)
532
+ throw new RequestError("options are required");
533
+ const { id, ...rest } = options;
534
+ super({ id, ...rest });
535
+ }
536
+ get name() {
537
+ return "DiscoverReservationRoomTypeUpsellOptions";
538
+ }
539
+ get routingKey() {
540
+ return "reservation.discoverRoomUpsells";
541
+ }
542
+ };
543
+ __name(DiscoverReservationRoomTypeUpsellOptionsCommand2, "DiscoverReservationRoomTypeUpsellOptionsCommand");
544
+ module2.exports = DiscoverReservationRoomTypeUpsellOptionsCommand2;
545
+ }
546
+ });
547
+
524
548
  // src/Commands/DiscoverRoomsCommand.js
525
549
  var require_DiscoverRoomsCommand = __commonJS({
526
550
  "src/Commands/DiscoverRoomsCommand.js"(exports2, module2) {
@@ -532,9 +556,18 @@ var require_DiscoverRoomsCommand = __commonJS({
532
556
  startDate,
533
557
  endDate,
534
558
  serviceStatus,
535
- housekeepingStatus
559
+ housekeepingStatus,
560
+ ...rest
536
561
  }) {
537
- super({ id, types, startDate, endDate, serviceStatus, housekeepingStatus });
562
+ super({
563
+ id,
564
+ types,
565
+ startDate,
566
+ endDate,
567
+ serviceStatus,
568
+ housekeepingStatus,
569
+ ...rest
570
+ });
538
571
  }
539
572
  get name() {
540
573
  return "DiscoverRooms";
@@ -607,10 +640,10 @@ var require_UpdateReservationCommand = __commonJS({
607
640
  var Command = require_Command();
608
641
  var RequestError = require_RequestError();
609
642
  var UpdateReservationCommand2 = class extends Command {
610
- constructor({ id, space }) {
643
+ constructor({ id, ...rest }) {
611
644
  if (!id)
612
645
  throw new RequestError("document type is required");
613
- super({ id, space });
646
+ super({ id, ...rest });
614
647
  }
615
648
  get name() {
616
649
  return "UpdateReservation";
@@ -694,6 +727,86 @@ var require_GetMobileKeyCommand = __commonJS({
694
727
  }
695
728
  });
696
729
 
730
+ // src/Commands/CreateImageUploadEndpointCommand.js
731
+ var require_CreateImageUploadEndpointCommand = __commonJS({
732
+ "src/Commands/CreateImageUploadEndpointCommand.js"(exports2, module2) {
733
+ var Command = require_Command();
734
+ var CreateImageUploadEndpointCommand2 = class extends Command {
735
+ constructor({ id, expires, ...rest }) {
736
+ super({ id, expires, ...rest });
737
+ }
738
+ get name() {
739
+ return "CreateImageUploadEndpoint";
740
+ }
741
+ get routingKey() {
742
+ return "image.createUploadEndpoint";
743
+ }
744
+ };
745
+ __name(CreateImageUploadEndpointCommand2, "CreateImageUploadEndpointCommand");
746
+ module2.exports = CreateImageUploadEndpointCommand2;
747
+ }
748
+ });
749
+
750
+ // src/Commands/UploadImageCommand.js
751
+ var require_UploadImageCommand = __commonJS({
752
+ "src/Commands/UploadImageCommand.js"(exports2, module2) {
753
+ var Command = require_Command();
754
+ var UploadImageCommand2 = class extends Command {
755
+ constructor({ id, url, file, ...rest }) {
756
+ super({ id, url, file, ...rest });
757
+ }
758
+ get name() {
759
+ return "UploadImage";
760
+ }
761
+ get routingKey() {
762
+ return `image.${this.data.id}.upload`;
763
+ }
764
+ };
765
+ __name(UploadImageCommand2, "UploadImageCommand");
766
+ module2.exports = UploadImageCommand2;
767
+ }
768
+ });
769
+
770
+ // src/Commands/GetProductsCommand.js
771
+ var require_GetProductsCommand = __commonJS({
772
+ "src/Commands/GetProductsCommand.js"(exports2, module2) {
773
+ var Command = require_Command();
774
+ var GetProductsCommand2 = class extends Command {
775
+ constructor({ id, externalSystemId, ...rest }) {
776
+ super({ id, externalSystemId, ...rest });
777
+ }
778
+ get name() {
779
+ return "GetProducts";
780
+ }
781
+ get routingKey() {
782
+ return `product.${this.data.id}.get`;
783
+ }
784
+ };
785
+ __name(GetProductsCommand2, "GetProductsCommand");
786
+ module2.exports = GetProductsCommand2;
787
+ }
788
+ });
789
+
790
+ // src/Commands/SellProductsCommand.js
791
+ var require_SellProductsCommand = __commonJS({
792
+ "src/Commands/SellProductsCommand.js"(exports2, module2) {
793
+ var Command = require_Command();
794
+ var SellProductsCommand2 = class extends Command {
795
+ constructor({ reservationId, userId, products, ...rest }) {
796
+ super({ reservationId, userId, products, ...rest });
797
+ }
798
+ get name() {
799
+ return "SellProducts";
800
+ }
801
+ get routingKey() {
802
+ return `product.${this.data.id}.sell`;
803
+ }
804
+ };
805
+ __name(SellProductsCommand2, "SellProductsCommand");
806
+ module2.exports = SellProductsCommand2;
807
+ }
808
+ });
809
+
697
810
  // src/Commands/index.js
698
811
  var SetAlarmCommand = require_SetAlarmCommand();
699
812
  var SetDimmerCommand = require_SetDimmerCommand();
@@ -709,12 +822,17 @@ var CheckInReservationCommand = require_CheckInReservationCommand();
709
822
  var SendEmailCommand = require_SendEmailCommand();
710
823
  var SendSMSCommand = require_SendSMSCommand();
711
824
  var DiscoverReservationsCommand = require_DiscoverReservationsCommand();
825
+ var DiscoverReservationRoomTypeUpsellOptionsCommand = require_DiscoverReservationRoomTypeUpsellOptionsCommand();
712
826
  var DiscoverRoomsCommand = require_DiscoverRoomsCommand();
713
827
  var DiscoverRoomTypesCommand = require_DiscoverRoomTypesCommand();
714
828
  var CreateShortLinkCommand = require_CreateShortLinkCommand();
715
829
  var UpdateReservationCommand = require_UpdateReservationCommand();
716
830
  var UpdateUserCommand = require_UpdateUserCommand();
717
831
  var GetMobileKeyCommand = require_GetMobileKeyCommand();
832
+ var CreateImageUploadEndpointCommand = require_CreateImageUploadEndpointCommand();
833
+ var UploadImageCommand = require_UploadImageCommand();
834
+ var GetProductsCommand = require_GetProductsCommand();
835
+ var SellProductsCommand = require_SellProductsCommand();
718
836
  module.exports = {
719
837
  SetAlarmCommand,
720
838
  SetDimmerCommand,
@@ -730,10 +848,15 @@ module.exports = {
730
848
  SendSMSCommand,
731
849
  SendEmailCommand,
732
850
  DiscoverReservationsCommand,
851
+ DiscoverReservationRoomTypeUpsellOptionsCommand,
733
852
  DiscoverRoomsCommand,
734
853
  DiscoverRoomTypesCommand,
735
854
  CreateShortLinkCommand,
736
855
  UpdateReservationCommand,
737
856
  UpdateUserCommand,
738
- GetMobileKeyCommand
857
+ GetMobileKeyCommand,
858
+ CreateImageUploadEndpointCommand,
859
+ UploadImageCommand,
860
+ GetProductsCommand,
861
+ SellProductsCommand
739
862
  };
@@ -385,43 +385,45 @@ var require_SystemReservationUpdatedEvent = __commonJS({
385
385
  }
386
386
  });
387
387
 
388
- // src/Events/SMSSentEvent.js
389
- var require_SMSSentEvent = __commonJS({
390
- "src/Events/SMSSentEvent.js"(exports2, module2) {
388
+ // src/Events/SMSEvent.js
389
+ var require_SMSEvent = __commonJS({
390
+ "src/Events/SMSEvent.js"(exports2, module2) {
391
391
  var Event = require_Event();
392
- var SMSSentEvent2 = class extends Event {
393
- constructor(email, context) {
394
- super(email, context);
392
+ var SMSEvent2 = class extends Event {
393
+ constructor(sms, context) {
394
+ super(sms, context);
395
+ this.status = sms.status;
395
396
  }
396
397
  get name() {
397
- return "SMSSent";
398
+ return "SMSEvent";
398
399
  }
399
400
  get routingKey() {
400
- return "comm.sms.sent";
401
+ return `comm.sms.${this.status}`;
401
402
  }
402
403
  };
403
- __name(SMSSentEvent2, "SMSSentEvent");
404
- module2.exports = SMSSentEvent2;
404
+ __name(SMSEvent2, "SMSEvent");
405
+ module2.exports = SMSEvent2;
405
406
  }
406
407
  });
407
408
 
408
- // src/Events/EmailSentEvent.js
409
- var require_EmailSentEvent = __commonJS({
410
- "src/Events/EmailSentEvent.js"(exports2, module2) {
409
+ // src/Events/EmailEvent.js
410
+ var require_EmailEvent = __commonJS({
411
+ "src/Events/EmailEvent.js"(exports2, module2) {
411
412
  var Event = require_Event();
412
- var EmailSentEvent2 = class extends Event {
413
+ var EmailEvent2 = class extends Event {
413
414
  constructor(email, context) {
414
415
  super(email, context);
416
+ this.status = email.status;
415
417
  }
416
418
  get name() {
417
- return "EmailSent";
419
+ return "EmailEvent";
418
420
  }
419
421
  get routingKey() {
420
- return "comm.email.sent";
422
+ return `comm.email.${this.status}`;
421
423
  }
422
424
  };
423
- __name(EmailSentEvent2, "EmailSentEvent");
424
- module2.exports = EmailSentEvent2;
425
+ __name(EmailEvent2, "EmailEvent");
426
+ module2.exports = EmailEvent2;
425
427
  }
426
428
  });
427
429
 
@@ -502,8 +504,8 @@ var SystemSpaceUpdatedEvent = require_SystemSpaceUpdatedEvent();
502
504
  var SystemSpaceTypeUpdatedEvent = require_SystemSpaceTypeUpdatedEvent();
503
505
  var SystemProductUpdatedEvent = require_SystemProductUpdatedEvent();
504
506
  var SystemReservationUpdatedEvent = require_SystemReservationUpdatedEvent();
505
- var SMSSentEvent = require_SMSSentEvent();
506
- var EmailSentEvent = require_EmailSentEvent();
507
+ var SMSEvent = require_SMSEvent();
508
+ var EmailEvent = require_EmailEvent();
507
509
  var ShortLinkCreatedEvent = require_ShortLinkCreatedEvent();
508
510
  var ApplicationInUseEvent = require_ApplicationInUseEvent();
509
511
  var ApplicationOutOfUseEvent = require_ApplicationOutOfUseEvent();
@@ -524,8 +526,8 @@ module.exports = {
524
526
  SystemSpaceTypeUpdatedEvent,
525
527
  SystemProductUpdatedEvent,
526
528
  SystemReservationUpdatedEvent,
527
- SMSSentEvent,
528
- EmailSentEvent,
529
+ SMSEvent,
530
+ EmailEvent,
529
531
  ShortLinkCreatedEvent,
530
532
  ApplicationInUseEvent,
531
533
  ApplicationOutOfUseEvent