@kohost/api-client 3.0.0-beta.41 → 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.
@@ -101,6 +101,7 @@ var require_common = __commonJS({
101
101
  "lg",
102
102
  "lirc",
103
103
  "mews",
104
+ "paxton",
104
105
  "pelican-wireless",
105
106
  "rebrandly",
106
107
  "salto",
@@ -108,7 +109,9 @@ var require_common = __commonJS({
108
109
  "se",
109
110
  "sendgrid",
110
111
  "stay-n-touch",
111
- "twilio"
112
+ "twilio",
113
+ "cloudflare-images",
114
+ "cloudflare-stream"
112
115
  ]
113
116
  }
114
117
  }
@@ -836,6 +839,9 @@ var require_lock = __commonJS({
836
839
  type: {
837
840
  $ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/type"
838
841
  },
842
+ offline: {
843
+ type: "boolean"
844
+ },
839
845
  supportedNotifications: {
840
846
  $ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/supportedNotifications"
841
847
  },
@@ -1837,6 +1843,9 @@ var require_camera = __commonJS({
1837
1843
  }
1838
1844
  }
1839
1845
  },
1846
+ previewImage: {
1847
+ type: "string"
1848
+ },
1840
1849
  systemData: {
1841
1850
  $ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/systemData"
1842
1851
  },
@@ -1971,6 +1980,9 @@ var require_mediaSource = __commonJS({
1971
1980
  "uncontrolledDevice"
1972
1981
  ]
1973
1982
  },
1983
+ name: {
1984
+ $ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/name"
1985
+ },
1974
1986
  driver: {
1975
1987
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/driver"
1976
1988
  },
@@ -2727,13 +2739,14 @@ var require_reservation = __commonJS({
2727
2739
  properties: {
2728
2740
  date: {
2729
2741
  type: "string",
2730
- format: "date"
2742
+ format: "date-time"
2731
2743
  },
2732
2744
  amount: {
2733
2745
  type: "number"
2734
2746
  },
2735
2747
  type: {
2736
- type: "string"
2748
+ type: "string",
2749
+ enum: ["service", "product"]
2737
2750
  }
2738
2751
  }
2739
2752
  }
@@ -3495,7 +3508,7 @@ var require_product = __commonJS({
3495
3508
  $id: "https://api.kohost.io/schemas/v3/product.json",
3496
3509
  title: "Product",
3497
3510
  type: "object",
3498
- required: ["name", "price", "currency", "driver"],
3511
+ required: ["name", "price", "driver"],
3499
3512
  properties: {
3500
3513
  id: {
3501
3514
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
@@ -3515,15 +3528,12 @@ var require_product = __commonJS({
3515
3528
  price: {
3516
3529
  type: "number"
3517
3530
  },
3518
- currency: {
3519
- type: "string",
3520
- description: "ISO 4217 format",
3521
- minLength: 3,
3522
- maxLength: 3
3523
- },
3524
3531
  image: {
3525
3532
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/file"
3526
3533
  },
3534
+ category: {
3535
+ type: "string"
3536
+ },
3527
3537
  imageUrl: {
3528
3538
  format: "uri",
3529
3539
  pattern: "^https?://"
@@ -4043,6 +4053,9 @@ var require_smsMessage = __commonJS({
4043
4053
  driver: {
4044
4054
  type: "string"
4045
4055
  },
4056
+ appData: {
4057
+ type: "object"
4058
+ },
4046
4059
  createdAt: {
4047
4060
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/date"
4048
4061
  },
@@ -4086,6 +4099,112 @@ var require_smsMessage2 = __commonJS({
4086
4099
  }
4087
4100
  });
4088
4101
 
4102
+ // src/schemas/emailMessage.json
4103
+ var require_emailMessage = __commonJS({
4104
+ "src/schemas/emailMessage.json"(exports2, module2) {
4105
+ module2.exports = {
4106
+ $schema: "http://json-schema.org/draft-07/schema",
4107
+ $id: "https://api.kohost.io/schemas/v3/emailMessage.json",
4108
+ title: "Email Message",
4109
+ type: "object",
4110
+ required: ["to", "from", "status", "subject"],
4111
+ properties: {
4112
+ id: {
4113
+ $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
4114
+ },
4115
+ type: {
4116
+ type: "string",
4117
+ default: "emailMessage"
4118
+ },
4119
+ to: {
4120
+ type: "string",
4121
+ pattern: "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$"
4122
+ },
4123
+ from: {
4124
+ type: "string",
4125
+ pattern: ".*<[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+>.*",
4126
+ description: "Must be in the format of 'Sender <email@example.com>"
4127
+ },
4128
+ subject: {
4129
+ type: "string"
4130
+ },
4131
+ status: {
4132
+ type: "string",
4133
+ enum: [
4134
+ "queued",
4135
+ "sending",
4136
+ "sent",
4137
+ "deferred",
4138
+ "delivered",
4139
+ "undelivered",
4140
+ "bounced",
4141
+ "blocked",
4142
+ "receiving",
4143
+ "received",
4144
+ "opened",
4145
+ "clicked",
4146
+ "unsubscribed",
4147
+ "spamReport"
4148
+ ]
4149
+ },
4150
+ statusMessage: {
4151
+ type: "string"
4152
+ },
4153
+ html: {
4154
+ type: "string"
4155
+ },
4156
+ text: {
4157
+ type: "string"
4158
+ },
4159
+ driver: {
4160
+ type: "string"
4161
+ },
4162
+ appData: {
4163
+ type: "object"
4164
+ },
4165
+ createdAt: {
4166
+ $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/date"
4167
+ },
4168
+ updatedAt: {
4169
+ $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/date"
4170
+ },
4171
+ systemData: {
4172
+ $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/systemData"
4173
+ }
4174
+ }
4175
+ };
4176
+ }
4177
+ });
4178
+
4179
+ // src/Models/emailMessage.js
4180
+ var require_emailMessage2 = __commonJS({
4181
+ "src/Models/emailMessage.js"(exports2, module2) {
4182
+ var schemas = require_schema();
4183
+ var schema = require_emailMessage();
4184
+ var Kohost = require_kohost();
4185
+ schemas.add(schema);
4186
+ var validator = schemas.compile(schema);
4187
+ var EmailMessage2 = class extends Kohost {
4188
+ constructor(data) {
4189
+ super(data);
4190
+ }
4191
+ };
4192
+ __name(EmailMessage2, "EmailMessage");
4193
+ Object.defineProperty(EmailMessage2.prototype, "schema", {
4194
+ value: schema
4195
+ });
4196
+ Object.defineProperty(EmailMessage2.prototype, "validator", {
4197
+ get: function() {
4198
+ return validator;
4199
+ }
4200
+ });
4201
+ Object.defineProperty(EmailMessage2, "validProperties", {
4202
+ value: Object.keys(schema.properties)
4203
+ });
4204
+ module2.exports = EmailMessage2;
4205
+ }
4206
+ });
4207
+
4089
4208
  // src/schemas/property.json
4090
4209
  var require_property = __commonJS({
4091
4210
  "src/schemas/property.json"(exports2, module2) {
@@ -4255,7 +4374,21 @@ var require_property = __commonJS({
4255
4374
  type: "object",
4256
4375
  properties: {
4257
4376
  RoomControl: {},
4258
- CheckIn: {},
4377
+ CheckIn: {
4378
+ properties: {
4379
+ payment: {},
4380
+ identification: {},
4381
+ earlyCheckIn: {
4382
+ properties: {
4383
+ dynamic: {
4384
+ type: "boolean",
4385
+ default: false
4386
+ }
4387
+ }
4388
+ },
4389
+ roomUpgrades: {}
4390
+ }
4391
+ },
4259
4392
  CheckOut: {},
4260
4393
  Concierge: {},
4261
4394
  DigitalKey: {
@@ -4440,6 +4573,7 @@ var ShortLink = require_shortLink2();
4440
4573
  var EnergyReportShard = require_energyReportShard2();
4441
4574
  var EnergyReport = require_energyReport2();
4442
4575
  var SMSMessage = require_smsMessage2();
4576
+ var EmailMessage = require_emailMessage2();
4443
4577
  var Property = require_property2();
4444
4578
  var Organization = require_organization2();
4445
4579
  module.exports = {
@@ -4472,5 +4606,6 @@ module.exports = {
4472
4606
  EnergyReportShard,
4473
4607
  EnergyReport,
4474
4608
  SMSMessage,
4609
+ EmailMessage,
4475
4610
  MediaFile
4476
4611
  };
package/dist/cjs/utils.js CHANGED
@@ -144,6 +144,7 @@ var require_common = __commonJS({
144
144
  "lg",
145
145
  "lirc",
146
146
  "mews",
147
+ "paxton",
147
148
  "pelican-wireless",
148
149
  "rebrandly",
149
150
  "salto",
@@ -151,7 +152,9 @@ var require_common = __commonJS({
151
152
  "se",
152
153
  "sendgrid",
153
154
  "stay-n-touch",
154
- "twilio"
155
+ "twilio",
156
+ "cloudflare-images",
157
+ "cloudflare-stream"
155
158
  ]
156
159
  }
157
160
  }
@@ -4755,6 +4755,158 @@ var require_AssignSpaceToReservation = __commonJS({
4755
4755
  }
4756
4756
  });
4757
4757
 
4758
+ // dist/useCases/DescribeReservationEarlyCheckInProducts.js
4759
+ var require_DescribeReservationEarlyCheckInProducts = __commonJS({
4760
+ "dist/useCases/DescribeReservationEarlyCheckInProducts.js"(exports, module) {
4761
+ module.exports = /* @__PURE__ */ __name(function DescribeReservationEarlyCheckInProducts(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
4762
+ if (!requestData)
4763
+ requestData = {};
4764
+ const pathParams = [":id"];
4765
+ const { data, query, headers } = requestData;
4766
+ let url = "/reservations/:id/products/earlyCheckIn";
4767
+ if (pathParams && data) {
4768
+ for (const param of pathParams) {
4769
+ const paramName = param.replace(":", "");
4770
+ url = url.replace(param, data[paramName]);
4771
+ }
4772
+ }
4773
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
4774
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
4775
+ const missing = missingParams.map((param) => param.replace(":", ""));
4776
+ return Promise.reject(
4777
+ new Error("Missing parameters: " + missing.join(", "))
4778
+ );
4779
+ }
4780
+ const config = {
4781
+ method: "get",
4782
+ url,
4783
+ ...httpConfigOptions
4784
+ };
4785
+ if (data)
4786
+ config.data = data;
4787
+ if (query)
4788
+ config.params = query;
4789
+ if (headers)
4790
+ config.headers = headers;
4791
+ return this._http.request(config);
4792
+ }, "DescribeReservationEarlyCheckInProducts");
4793
+ }
4794
+ });
4795
+
4796
+ // dist/useCases/PurchaseReservationEarlyCheckInProducts.js
4797
+ var require_PurchaseReservationEarlyCheckInProducts = __commonJS({
4798
+ "dist/useCases/PurchaseReservationEarlyCheckInProducts.js"(exports, module) {
4799
+ module.exports = /* @__PURE__ */ __name(function PurchaseReservationEarlyCheckInProducts(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
4800
+ if (!requestData)
4801
+ requestData = {};
4802
+ const pathParams = [":id"];
4803
+ const { data, query, headers } = requestData;
4804
+ let url = "/reservations/:id/products/earlyCheckIn";
4805
+ if (pathParams && data) {
4806
+ for (const param of pathParams) {
4807
+ const paramName = param.replace(":", "");
4808
+ url = url.replace(param, data[paramName]);
4809
+ }
4810
+ }
4811
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
4812
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
4813
+ const missing = missingParams.map((param) => param.replace(":", ""));
4814
+ return Promise.reject(
4815
+ new Error("Missing parameters: " + missing.join(", "))
4816
+ );
4817
+ }
4818
+ const config = {
4819
+ method: "post",
4820
+ url,
4821
+ ...httpConfigOptions
4822
+ };
4823
+ if (data)
4824
+ config.data = data;
4825
+ if (query)
4826
+ config.params = query;
4827
+ if (headers)
4828
+ config.headers = headers;
4829
+ return this._http.request(config);
4830
+ }, "PurchaseReservationEarlyCheckInProducts");
4831
+ }
4832
+ });
4833
+
4834
+ // dist/useCases/DescribeReservationRoomUpgrades.js
4835
+ var require_DescribeReservationRoomUpgrades = __commonJS({
4836
+ "dist/useCases/DescribeReservationRoomUpgrades.js"(exports, module) {
4837
+ module.exports = /* @__PURE__ */ __name(function DescribeReservationRoomUpgrades(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
4838
+ if (!requestData)
4839
+ requestData = {};
4840
+ const pathParams = [":id"];
4841
+ const { data, query, headers } = requestData;
4842
+ let url = "/reservations/:id/products/roomUpgrades";
4843
+ if (pathParams && data) {
4844
+ for (const param of pathParams) {
4845
+ const paramName = param.replace(":", "");
4846
+ url = url.replace(param, data[paramName]);
4847
+ }
4848
+ }
4849
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
4850
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
4851
+ const missing = missingParams.map((param) => param.replace(":", ""));
4852
+ return Promise.reject(
4853
+ new Error("Missing parameters: " + missing.join(", "))
4854
+ );
4855
+ }
4856
+ const config = {
4857
+ method: "get",
4858
+ url,
4859
+ ...httpConfigOptions
4860
+ };
4861
+ if (data)
4862
+ config.data = data;
4863
+ if (query)
4864
+ config.params = query;
4865
+ if (headers)
4866
+ config.headers = headers;
4867
+ return this._http.request(config);
4868
+ }, "DescribeReservationRoomUpgrades");
4869
+ }
4870
+ });
4871
+
4872
+ // dist/useCases/PurchaseReservationRoomUpgrades.js
4873
+ var require_PurchaseReservationRoomUpgrades = __commonJS({
4874
+ "dist/useCases/PurchaseReservationRoomUpgrades.js"(exports, module) {
4875
+ module.exports = /* @__PURE__ */ __name(function PurchaseReservationRoomUpgrades(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
4876
+ if (!requestData)
4877
+ requestData = {};
4878
+ const pathParams = [":id"];
4879
+ const { data, query, headers } = requestData;
4880
+ let url = "/reservations/:id/products/roomUpgrades";
4881
+ if (pathParams && data) {
4882
+ for (const param of pathParams) {
4883
+ const paramName = param.replace(":", "");
4884
+ url = url.replace(param, data[paramName]);
4885
+ }
4886
+ }
4887
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
4888
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
4889
+ const missing = missingParams.map((param) => param.replace(":", ""));
4890
+ return Promise.reject(
4891
+ new Error("Missing parameters: " + missing.join(", "))
4892
+ );
4893
+ }
4894
+ const config = {
4895
+ method: "post",
4896
+ url,
4897
+ ...httpConfigOptions
4898
+ };
4899
+ if (data)
4900
+ config.data = data;
4901
+ if (query)
4902
+ config.params = query;
4903
+ if (headers)
4904
+ config.headers = headers;
4905
+ return this._http.request(config);
4906
+ }, "PurchaseReservationRoomUpgrades");
4907
+ }
4908
+ });
4909
+
4758
4910
  // dist/useCases/OCRDocument.js
4759
4911
  var require_OCRDocument = __commonJS({
4760
4912
  "dist/useCases/OCRDocument.js"(exports, module) {
@@ -5249,6 +5401,82 @@ var require_DeleteMediaFile = __commonJS({
5249
5401
  }
5250
5402
  });
5251
5403
 
5404
+ // dist/useCases/UploadImage.js
5405
+ var require_UploadImage = __commonJS({
5406
+ "dist/useCases/UploadImage.js"(exports, module) {
5407
+ module.exports = /* @__PURE__ */ __name(function UploadImage(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
5408
+ if (!requestData)
5409
+ requestData = {};
5410
+ const pathParams = null;
5411
+ const { data, query, headers } = requestData;
5412
+ let url = "/mediaFiles/uploadImage";
5413
+ if (pathParams && data) {
5414
+ for (const param of pathParams) {
5415
+ const paramName = param.replace(":", "");
5416
+ url = url.replace(param, data[paramName]);
5417
+ }
5418
+ }
5419
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
5420
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
5421
+ const missing = missingParams.map((param) => param.replace(":", ""));
5422
+ return Promise.reject(
5423
+ new Error("Missing parameters: " + missing.join(", "))
5424
+ );
5425
+ }
5426
+ const config = {
5427
+ method: "post",
5428
+ url,
5429
+ ...httpConfigOptions
5430
+ };
5431
+ if (data)
5432
+ config.data = data;
5433
+ if (query)
5434
+ config.params = query;
5435
+ if (headers)
5436
+ config.headers = headers;
5437
+ return this._http.request(config);
5438
+ }, "UploadImage");
5439
+ }
5440
+ });
5441
+
5442
+ // dist/useCases/DescribeProduct.js
5443
+ var require_DescribeProduct = __commonJS({
5444
+ "dist/useCases/DescribeProduct.js"(exports, module) {
5445
+ module.exports = /* @__PURE__ */ __name(function DescribeProduct(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
5446
+ if (!requestData)
5447
+ requestData = {};
5448
+ const pathParams = [":id"];
5449
+ const { data, query, headers } = requestData;
5450
+ let url = "/products/:id";
5451
+ if (pathParams && data) {
5452
+ for (const param of pathParams) {
5453
+ const paramName = param.replace(":", "");
5454
+ url = url.replace(param, data[paramName]);
5455
+ }
5456
+ }
5457
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
5458
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
5459
+ const missing = missingParams.map((param) => param.replace(":", ""));
5460
+ return Promise.reject(
5461
+ new Error("Missing parameters: " + missing.join(", "))
5462
+ );
5463
+ }
5464
+ const config = {
5465
+ method: "get",
5466
+ url,
5467
+ ...httpConfigOptions
5468
+ };
5469
+ if (data)
5470
+ config.data = data;
5471
+ if (query)
5472
+ config.params = query;
5473
+ if (headers)
5474
+ config.headers = headers;
5475
+ return this._http.request(config);
5476
+ }, "DescribeProduct");
5477
+ }
5478
+ });
5479
+
5252
5480
  // node_modules/events/events.js
5253
5481
  var require_events = __commonJS({
5254
5482
  "node_modules/events/events.js"(exports, module) {
@@ -7838,6 +8066,10 @@ var require_Client = __commonJS({
7838
8066
  var BatchNotifyPreArrival = require_BatchNotifyPreArrival();
7839
8067
  var BatchNotifyCheckIn = require_BatchNotifyCheckIn();
7840
8068
  var AssignSpaceToReservation = require_AssignSpaceToReservation();
8069
+ var DescribeReservationEarlyCheckInProducts = require_DescribeReservationEarlyCheckInProducts();
8070
+ var PurchaseReservationEarlyCheckInProducts = require_PurchaseReservationEarlyCheckInProducts();
8071
+ var DescribeReservationRoomUpgrades = require_DescribeReservationRoomUpgrades();
8072
+ var PurchaseReservationRoomUpgrades = require_PurchaseReservationRoomUpgrades();
7841
8073
  var OCRDocument = require_OCRDocument();
7842
8074
  var CreateOrganization = require_CreateOrganization();
7843
8075
  var AdminUpdateCustomer = require_AdminUpdateCustomer();
@@ -7851,6 +8083,8 @@ var require_Client = __commonJS({
7851
8083
  var EmailUserAccountSetup = require_EmailUserAccountSetup();
7852
8084
  var CreateImageUploadEndpoint = require_CreateImageUploadEndpoint();
7853
8085
  var DeleteMediaFile = require_DeleteMediaFile();
8086
+ var UploadImage = require_UploadImage();
8087
+ var DescribeProduct = require_DescribeProduct();
7854
8088
  var { EventEmitter } = require_events();
7855
8089
  var axios = require_axios();
7856
8090
  var KohostApiClient = class extends EventEmitter {
@@ -8086,6 +8320,10 @@ var require_Client = __commonJS({
8086
8320
  KohostApiClient.prototype.BatchNotifyPreArrival = BatchNotifyPreArrival;
8087
8321
  KohostApiClient.prototype.BatchNotifyCheckIn = BatchNotifyCheckIn;
8088
8322
  KohostApiClient.prototype.AssignSpaceToReservation = AssignSpaceToReservation;
8323
+ KohostApiClient.prototype.DescribeReservationEarlyCheckInProducts = DescribeReservationEarlyCheckInProducts;
8324
+ KohostApiClient.prototype.PurchaseReservationEarlyCheckInProducts = PurchaseReservationEarlyCheckInProducts;
8325
+ KohostApiClient.prototype.DescribeReservationRoomUpgrades = DescribeReservationRoomUpgrades;
8326
+ KohostApiClient.prototype.PurchaseReservationRoomUpgrades = PurchaseReservationRoomUpgrades;
8089
8327
  KohostApiClient.prototype.OCRDocument = OCRDocument;
8090
8328
  KohostApiClient.prototype.CreateOrganization = CreateOrganization;
8091
8329
  KohostApiClient.prototype.AdminUpdateCustomer = AdminUpdateCustomer;
@@ -8099,6 +8337,8 @@ var require_Client = __commonJS({
8099
8337
  KohostApiClient.prototype.EmailUserAccountSetup = EmailUserAccountSetup;
8100
8338
  KohostApiClient.prototype.CreateImageUploadEndpoint = CreateImageUploadEndpoint;
8101
8339
  KohostApiClient.prototype.DeleteMediaFile = DeleteMediaFile;
8340
+ KohostApiClient.prototype.UploadImage = UploadImage;
8341
+ KohostApiClient.prototype.DescribeProduct = DescribeProduct;
8102
8342
  module.exports = KohostApiClient;
8103
8343
  }
8104
8344
  });