@kohost/api-client 3.0.0-beta.41 → 3.0.0-beta.43

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
  },
@@ -1822,7 +1828,7 @@ var require_camera = __commonJS({
1822
1828
  driver: {
1823
1829
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/driver"
1824
1830
  },
1825
- streams: {
1831
+ liveStreams: {
1826
1832
  type: "object",
1827
1833
  additionalProperties: false,
1828
1834
  properties: {
@@ -1971,6 +1977,9 @@ var require_mediaSource = __commonJS({
1971
1977
  "uncontrolledDevice"
1972
1978
  ]
1973
1979
  },
1980
+ name: {
1981
+ $ref: "https://api.kohost.io/schemas/v3/definitions/device.json#/definitions/name"
1982
+ },
1974
1983
  driver: {
1975
1984
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/driver"
1976
1985
  },
@@ -2727,13 +2736,14 @@ var require_reservation = __commonJS({
2727
2736
  properties: {
2728
2737
  date: {
2729
2738
  type: "string",
2730
- format: "date"
2739
+ format: "date-time"
2731
2740
  },
2732
2741
  amount: {
2733
2742
  type: "number"
2734
2743
  },
2735
2744
  type: {
2736
- type: "string"
2745
+ type: "string",
2746
+ enum: ["service", "product"]
2737
2747
  }
2738
2748
  }
2739
2749
  }
@@ -3495,7 +3505,7 @@ var require_product = __commonJS({
3495
3505
  $id: "https://api.kohost.io/schemas/v3/product.json",
3496
3506
  title: "Product",
3497
3507
  type: "object",
3498
- required: ["name", "price", "currency", "driver"],
3508
+ required: ["name", "price", "driver"],
3499
3509
  properties: {
3500
3510
  id: {
3501
3511
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
@@ -3515,15 +3525,12 @@ var require_product = __commonJS({
3515
3525
  price: {
3516
3526
  type: "number"
3517
3527
  },
3518
- currency: {
3519
- type: "string",
3520
- description: "ISO 4217 format",
3521
- minLength: 3,
3522
- maxLength: 3
3523
- },
3524
3528
  image: {
3525
3529
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/file"
3526
3530
  },
3531
+ category: {
3532
+ type: "string"
3533
+ },
3527
3534
  imageUrl: {
3528
3535
  format: "uri",
3529
3536
  pattern: "^https?://"
@@ -4043,6 +4050,9 @@ var require_smsMessage = __commonJS({
4043
4050
  driver: {
4044
4051
  type: "string"
4045
4052
  },
4053
+ appData: {
4054
+ type: "object"
4055
+ },
4046
4056
  createdAt: {
4047
4057
  $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/date"
4048
4058
  },
@@ -4086,6 +4096,112 @@ var require_smsMessage2 = __commonJS({
4086
4096
  }
4087
4097
  });
4088
4098
 
4099
+ // src/schemas/emailMessage.json
4100
+ var require_emailMessage = __commonJS({
4101
+ "src/schemas/emailMessage.json"(exports2, module2) {
4102
+ module2.exports = {
4103
+ $schema: "http://json-schema.org/draft-07/schema",
4104
+ $id: "https://api.kohost.io/schemas/v3/emailMessage.json",
4105
+ title: "Email Message",
4106
+ type: "object",
4107
+ required: ["to", "from", "status", "subject"],
4108
+ properties: {
4109
+ id: {
4110
+ $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/id"
4111
+ },
4112
+ type: {
4113
+ type: "string",
4114
+ default: "emailMessage"
4115
+ },
4116
+ to: {
4117
+ type: "string",
4118
+ pattern: "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$"
4119
+ },
4120
+ from: {
4121
+ type: "string",
4122
+ pattern: ".*<[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+>.*",
4123
+ description: "Must be in the format of 'Sender <email@example.com>"
4124
+ },
4125
+ subject: {
4126
+ type: "string"
4127
+ },
4128
+ status: {
4129
+ type: "string",
4130
+ enum: [
4131
+ "queued",
4132
+ "sending",
4133
+ "sent",
4134
+ "deferred",
4135
+ "delivered",
4136
+ "undelivered",
4137
+ "bounced",
4138
+ "blocked",
4139
+ "receiving",
4140
+ "received",
4141
+ "opened",
4142
+ "clicked",
4143
+ "unsubscribed",
4144
+ "spamReport"
4145
+ ]
4146
+ },
4147
+ statusMessage: {
4148
+ type: "string"
4149
+ },
4150
+ html: {
4151
+ type: "string"
4152
+ },
4153
+ text: {
4154
+ type: "string"
4155
+ },
4156
+ driver: {
4157
+ type: "string"
4158
+ },
4159
+ appData: {
4160
+ type: "object"
4161
+ },
4162
+ createdAt: {
4163
+ $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/date"
4164
+ },
4165
+ updatedAt: {
4166
+ $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/date"
4167
+ },
4168
+ systemData: {
4169
+ $ref: "https://api.kohost.io/schemas/v3/definitions/common.json#/definitions/systemData"
4170
+ }
4171
+ }
4172
+ };
4173
+ }
4174
+ });
4175
+
4176
+ // src/Models/emailMessage.js
4177
+ var require_emailMessage2 = __commonJS({
4178
+ "src/Models/emailMessage.js"(exports2, module2) {
4179
+ var schemas = require_schema();
4180
+ var schema = require_emailMessage();
4181
+ var Kohost = require_kohost();
4182
+ schemas.add(schema);
4183
+ var validator = schemas.compile(schema);
4184
+ var EmailMessage2 = class extends Kohost {
4185
+ constructor(data) {
4186
+ super(data);
4187
+ }
4188
+ };
4189
+ __name(EmailMessage2, "EmailMessage");
4190
+ Object.defineProperty(EmailMessage2.prototype, "schema", {
4191
+ value: schema
4192
+ });
4193
+ Object.defineProperty(EmailMessage2.prototype, "validator", {
4194
+ get: function() {
4195
+ return validator;
4196
+ }
4197
+ });
4198
+ Object.defineProperty(EmailMessage2, "validProperties", {
4199
+ value: Object.keys(schema.properties)
4200
+ });
4201
+ module2.exports = EmailMessage2;
4202
+ }
4203
+ });
4204
+
4089
4205
  // src/schemas/property.json
4090
4206
  var require_property = __commonJS({
4091
4207
  "src/schemas/property.json"(exports2, module2) {
@@ -4255,7 +4371,21 @@ var require_property = __commonJS({
4255
4371
  type: "object",
4256
4372
  properties: {
4257
4373
  RoomControl: {},
4258
- CheckIn: {},
4374
+ CheckIn: {
4375
+ properties: {
4376
+ payment: {},
4377
+ identification: {},
4378
+ earlyCheckIn: {
4379
+ properties: {
4380
+ dynamic: {
4381
+ type: "boolean",
4382
+ default: false
4383
+ }
4384
+ }
4385
+ },
4386
+ roomUpgrades: {}
4387
+ }
4388
+ },
4259
4389
  CheckOut: {},
4260
4390
  Concierge: {},
4261
4391
  DigitalKey: {
@@ -4440,6 +4570,7 @@ var ShortLink = require_shortLink2();
4440
4570
  var EnergyReportShard = require_energyReportShard2();
4441
4571
  var EnergyReport = require_energyReport2();
4442
4572
  var SMSMessage = require_smsMessage2();
4573
+ var EmailMessage = require_emailMessage2();
4443
4574
  var Property = require_property2();
4444
4575
  var Organization = require_organization2();
4445
4576
  module.exports = {
@@ -4472,5 +4603,6 @@ module.exports = {
4472
4603
  EnergyReportShard,
4473
4604
  EnergyReport,
4474
4605
  SMSMessage,
4606
+ EmailMessage,
4475
4607
  MediaFile
4476
4608
  };
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
  });