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

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.
@@ -613,6 +613,44 @@ var require_ListUserReservations = __commonJS({
613
613
  }
614
614
  });
615
615
 
616
+ // dist/useCases/ListUserSpaces.js
617
+ var require_ListUserSpaces = __commonJS({
618
+ "dist/useCases/ListUserSpaces.js"(exports2, module2) {
619
+ module2.exports = /* @__PURE__ */ __name(function ListUserSpaces2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
620
+ if (!requestData)
621
+ requestData = {};
622
+ const pathParams = [":id"];
623
+ const { data, query, headers } = requestData;
624
+ let url = "/users/:id/spaces";
625
+ if (pathParams && data) {
626
+ for (const param of pathParams) {
627
+ const paramName = param.replace(":", "");
628
+ url = url.replace(param, data[paramName]);
629
+ }
630
+ }
631
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
632
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
633
+ const missing = missingParams.map((param) => param.replace(":", ""));
634
+ return Promise.reject(
635
+ new Error("Missing parameters: " + missing.join(", "))
636
+ );
637
+ }
638
+ const config = {
639
+ method: "get",
640
+ url,
641
+ ...httpConfigOptions
642
+ };
643
+ if (data)
644
+ config.data = data;
645
+ if (query)
646
+ config.params = query;
647
+ if (headers)
648
+ config.headers = headers;
649
+ return this._http.request(config);
650
+ }, "ListUserSpaces");
651
+ }
652
+ });
653
+
616
654
  // dist/useCases/ListTeam.js
617
655
  var require_ListTeam = __commonJS({
618
656
  "dist/useCases/ListTeam.js"(exports2, module2) {
@@ -651,6 +689,44 @@ var require_ListTeam = __commonJS({
651
689
  }
652
690
  });
653
691
 
692
+ // dist/useCases/DescribeMyAccessCredentials.js
693
+ var require_DescribeMyAccessCredentials = __commonJS({
694
+ "dist/useCases/DescribeMyAccessCredentials.js"(exports2, module2) {
695
+ module2.exports = /* @__PURE__ */ __name(function DescribeMyAccessCredentials2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
696
+ if (!requestData)
697
+ requestData = {};
698
+ const pathParams = null;
699
+ const { data, query, headers } = requestData;
700
+ let url = "/users/me/accessCredentials";
701
+ if (pathParams && data) {
702
+ for (const param of pathParams) {
703
+ const paramName = param.replace(":", "");
704
+ url = url.replace(param, data[paramName]);
705
+ }
706
+ }
707
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
708
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
709
+ const missing = missingParams.map((param) => param.replace(":", ""));
710
+ return Promise.reject(
711
+ new Error("Missing parameters: " + missing.join(", "))
712
+ );
713
+ }
714
+ const config = {
715
+ method: "get",
716
+ url,
717
+ ...httpConfigOptions
718
+ };
719
+ if (data)
720
+ config.data = data;
721
+ if (query)
722
+ config.params = query;
723
+ if (headers)
724
+ config.headers = headers;
725
+ return this._http.request(config);
726
+ }, "DescribeMyAccessCredentials");
727
+ }
728
+ });
729
+
654
730
  // dist/useCases/ListSpaces.js
655
731
  var require_ListSpaces = __commonJS({
656
732
  "dist/useCases/ListSpaces.js"(exports2, module2) {
@@ -2437,15 +2513,15 @@ var require_DescribeLock = __commonJS({
2437
2513
  }
2438
2514
  });
2439
2515
 
2440
- // dist/useCases/GetMobileKey.js
2441
- var require_GetMobileKey = __commonJS({
2442
- "dist/useCases/GetMobileKey.js"(exports2, module2) {
2443
- module2.exports = /* @__PURE__ */ __name(function GetMobileKey2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2516
+ // dist/useCases/DescribeLockCredential.js
2517
+ var require_DescribeLockCredential = __commonJS({
2518
+ "dist/useCases/DescribeLockCredential.js"(exports2, module2) {
2519
+ module2.exports = /* @__PURE__ */ __name(function DescribeLockCredential2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
2444
2520
  if (!requestData)
2445
2521
  requestData = {};
2446
2522
  const pathParams = [":roomId", ":id"];
2447
2523
  const { data, query, headers } = requestData;
2448
- let url = "/rooms/:roomId/locks/:id/mobileKey";
2524
+ let url = "/rooms/:roomId/locks/:id/credential";
2449
2525
  if (pathParams && data) {
2450
2526
  for (const param of pathParams) {
2451
2527
  const paramName = param.replace(":", "");
@@ -2471,7 +2547,7 @@ var require_GetMobileKey = __commonJS({
2471
2547
  if (headers)
2472
2548
  config.headers = headers;
2473
2549
  return this._http.request(config);
2474
- }, "GetMobileKey");
2550
+ }, "DescribeLockCredential");
2475
2551
  }
2476
2552
  });
2477
2553
 
@@ -5097,6 +5173,82 @@ var require_EmailUserAccountSetup = __commonJS({
5097
5173
  }
5098
5174
  });
5099
5175
 
5176
+ // dist/useCases/CreateImageUploadEndpoint.js
5177
+ var require_CreateImageUploadEndpoint = __commonJS({
5178
+ "dist/useCases/CreateImageUploadEndpoint.js"(exports2, module2) {
5179
+ module2.exports = /* @__PURE__ */ __name(function CreateImageUploadEndpoint2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
5180
+ if (!requestData)
5181
+ requestData = {};
5182
+ const pathParams = null;
5183
+ const { data, query, headers } = requestData;
5184
+ let url = "/mediaFiles/imageUploadEndpoint";
5185
+ if (pathParams && data) {
5186
+ for (const param of pathParams) {
5187
+ const paramName = param.replace(":", "");
5188
+ url = url.replace(param, data[paramName]);
5189
+ }
5190
+ }
5191
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
5192
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
5193
+ const missing = missingParams.map((param) => param.replace(":", ""));
5194
+ return Promise.reject(
5195
+ new Error("Missing parameters: " + missing.join(", "))
5196
+ );
5197
+ }
5198
+ const config = {
5199
+ method: "post",
5200
+ url,
5201
+ ...httpConfigOptions
5202
+ };
5203
+ if (data)
5204
+ config.data = data;
5205
+ if (query)
5206
+ config.params = query;
5207
+ if (headers)
5208
+ config.headers = headers;
5209
+ return this._http.request(config);
5210
+ }, "CreateImageUploadEndpoint");
5211
+ }
5212
+ });
5213
+
5214
+ // dist/useCases/DeleteMediaFile.js
5215
+ var require_DeleteMediaFile = __commonJS({
5216
+ "dist/useCases/DeleteMediaFile.js"(exports2, module2) {
5217
+ module2.exports = /* @__PURE__ */ __name(function DeleteMediaFile2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
5218
+ if (!requestData)
5219
+ requestData = {};
5220
+ const pathParams = [":id"];
5221
+ const { data, query, headers } = requestData;
5222
+ let url = "/mediaFiles/:id";
5223
+ if (pathParams && data) {
5224
+ for (const param of pathParams) {
5225
+ const paramName = param.replace(":", "");
5226
+ url = url.replace(param, data[paramName]);
5227
+ }
5228
+ }
5229
+ if (url.match(/:[a-zA-Z0-9]+/g)) {
5230
+ const missingParams = url.match(/:[a-zA-Z0-9]+/g);
5231
+ const missing = missingParams.map((param) => param.replace(":", ""));
5232
+ return Promise.reject(
5233
+ new Error("Missing parameters: " + missing.join(", "))
5234
+ );
5235
+ }
5236
+ const config = {
5237
+ method: "delete",
5238
+ url,
5239
+ ...httpConfigOptions
5240
+ };
5241
+ if (data)
5242
+ config.data = data;
5243
+ if (query)
5244
+ config.params = query;
5245
+ if (headers)
5246
+ config.headers = headers;
5247
+ return this._http.request(config);
5248
+ }, "DeleteMediaFile");
5249
+ }
5250
+ });
5251
+
5100
5252
  // src/Client/index.js
5101
5253
  var LoginUser = require_LoginUser();
5102
5254
  var RefreshToken = require_RefreshToken();
@@ -5114,7 +5266,9 @@ var SendVerificationCode = require_SendVerificationCode();
5114
5266
  var CheckVerificationCode = require_CheckVerificationCode();
5115
5267
  var MatchUserIdentification = require_MatchUserIdentification();
5116
5268
  var ListUserReservations = require_ListUserReservations();
5269
+ var ListUserSpaces = require_ListUserSpaces();
5117
5270
  var ListTeam = require_ListTeam();
5271
+ var DescribeMyAccessCredentials = require_DescribeMyAccessCredentials();
5118
5272
  var ListSpaces = require_ListSpaces();
5119
5273
  var ListMySpaces = require_ListMySpaces();
5120
5274
  var ListRoomsInSpace = require_ListRoomsInSpace();
@@ -5162,7 +5316,7 @@ var ListLocks = require_ListLocks();
5162
5316
  var UpdateLock = require_UpdateLock();
5163
5317
  var DeleteLock = require_DeleteLock();
5164
5318
  var DescribeLock = require_DescribeLock();
5165
- var GetMobileKey = require_GetMobileKey();
5319
+ var DescribeLockCredential = require_DescribeLockCredential();
5166
5320
  var CreateSwitch = require_CreateSwitch();
5167
5321
  var ListSwitches = require_ListSwitches();
5168
5322
  var UpdateSwitch = require_UpdateSwitch();
@@ -5232,6 +5386,8 @@ var CreateProperty = require_CreateProperty();
5232
5386
  var UpdateProperty = require_UpdateProperty();
5233
5387
  var DescribeProperty = require_DescribeProperty();
5234
5388
  var EmailUserAccountSetup = require_EmailUserAccountSetup();
5389
+ var CreateImageUploadEndpoint = require_CreateImageUploadEndpoint();
5390
+ var DeleteMediaFile = require_DeleteMediaFile();
5235
5391
  var { EventEmitter } = require("events");
5236
5392
  var axios = require("axios");
5237
5393
  var KohostApiClient = class extends EventEmitter {
@@ -5358,7 +5514,9 @@ KohostApiClient.prototype.SendVerificationCode = SendVerificationCode;
5358
5514
  KohostApiClient.prototype.CheckVerificationCode = CheckVerificationCode;
5359
5515
  KohostApiClient.prototype.MatchUserIdentification = MatchUserIdentification;
5360
5516
  KohostApiClient.prototype.ListUserReservations = ListUserReservations;
5517
+ KohostApiClient.prototype.ListUserSpaces = ListUserSpaces;
5361
5518
  KohostApiClient.prototype.ListTeam = ListTeam;
5519
+ KohostApiClient.prototype.DescribeMyAccessCredentials = DescribeMyAccessCredentials;
5362
5520
  KohostApiClient.prototype.ListSpaces = ListSpaces;
5363
5521
  KohostApiClient.prototype.ListMySpaces = ListMySpaces;
5364
5522
  KohostApiClient.prototype.ListRoomsInSpace = ListRoomsInSpace;
@@ -5406,7 +5564,7 @@ KohostApiClient.prototype.ListLocks = ListLocks;
5406
5564
  KohostApiClient.prototype.UpdateLock = UpdateLock;
5407
5565
  KohostApiClient.prototype.DeleteLock = DeleteLock;
5408
5566
  KohostApiClient.prototype.DescribeLock = DescribeLock;
5409
- KohostApiClient.prototype.GetMobileKey = GetMobileKey;
5567
+ KohostApiClient.prototype.DescribeLockCredential = DescribeLockCredential;
5410
5568
  KohostApiClient.prototype.CreateSwitch = CreateSwitch;
5411
5569
  KohostApiClient.prototype.ListSwitches = ListSwitches;
5412
5570
  KohostApiClient.prototype.UpdateSwitch = UpdateSwitch;
@@ -5476,4 +5634,6 @@ KohostApiClient.prototype.CreateProperty = CreateProperty;
5476
5634
  KohostApiClient.prototype.UpdateProperty = UpdateProperty;
5477
5635
  KohostApiClient.prototype.DescribeProperty = DescribeProperty;
5478
5636
  KohostApiClient.prototype.EmailUserAccountSetup = EmailUserAccountSetup;
5637
+ KohostApiClient.prototype.CreateImageUploadEndpoint = CreateImageUploadEndpoint;
5638
+ KohostApiClient.prototype.DeleteMediaFile = DeleteMediaFile;
5479
5639
  module.exports = KohostApiClient;
@@ -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";
@@ -694,6 +694,46 @@ var require_GetMobileKeyCommand = __commonJS({
694
694
  }
695
695
  });
696
696
 
697
+ // src/Commands/CreateImageUploadEndpointCommand.js
698
+ var require_CreateImageUploadEndpointCommand = __commonJS({
699
+ "src/Commands/CreateImageUploadEndpointCommand.js"(exports2, module2) {
700
+ var Command = require_Command();
701
+ var CreateImageUploadEndpointCommand2 = class extends Command {
702
+ constructor({ id, expires, ...rest }) {
703
+ super({ id, expires, ...rest });
704
+ }
705
+ get name() {
706
+ return "CreateImageUploadEndpoint";
707
+ }
708
+ get routingKey() {
709
+ return "image.createUploadEndpoint";
710
+ }
711
+ };
712
+ __name(CreateImageUploadEndpointCommand2, "CreateImageUploadEndpointCommand");
713
+ module2.exports = CreateImageUploadEndpointCommand2;
714
+ }
715
+ });
716
+
717
+ // src/Commands/UploadImageCommand.js
718
+ var require_UploadImageCommand = __commonJS({
719
+ "src/Commands/UploadImageCommand.js"(exports2, module2) {
720
+ var Command = require_Command();
721
+ var UploadImageCommand2 = class extends Command {
722
+ constructor({ id, url, file, ...rest }) {
723
+ super({ id, url, file, ...rest });
724
+ }
725
+ get name() {
726
+ return "UploadImage";
727
+ }
728
+ get routingKey() {
729
+ return `image.${this.data.id}.upload`;
730
+ }
731
+ };
732
+ __name(UploadImageCommand2, "UploadImageCommand");
733
+ module2.exports = UploadImageCommand2;
734
+ }
735
+ });
736
+
697
737
  // src/Commands/index.js
698
738
  var SetAlarmCommand = require_SetAlarmCommand();
699
739
  var SetDimmerCommand = require_SetDimmerCommand();
@@ -715,6 +755,8 @@ var CreateShortLinkCommand = require_CreateShortLinkCommand();
715
755
  var UpdateReservationCommand = require_UpdateReservationCommand();
716
756
  var UpdateUserCommand = require_UpdateUserCommand();
717
757
  var GetMobileKeyCommand = require_GetMobileKeyCommand();
758
+ var CreateImageUploadEndpointCommand = require_CreateImageUploadEndpointCommand();
759
+ var UploadImageCommand = require_UploadImageCommand();
718
760
  module.exports = {
719
761
  SetAlarmCommand,
720
762
  SetDimmerCommand,
@@ -735,5 +777,7 @@ module.exports = {
735
777
  CreateShortLinkCommand,
736
778
  UpdateReservationCommand,
737
779
  UpdateUserCommand,
738
- GetMobileKeyCommand
780
+ GetMobileKeyCommand,
781
+ CreateImageUploadEndpointCommand,
782
+ UploadImageCommand
739
783
  };
@@ -385,13 +385,34 @@ var require_SystemReservationUpdatedEvent = __commonJS({
385
385
  }
386
386
  });
387
387
 
388
+ // src/Events/SMSEvent.js
389
+ var require_SMSEvent = __commonJS({
390
+ "src/Events/SMSEvent.js"(exports2, module2) {
391
+ var Event = require_Event();
392
+ var SMSEvent2 = class extends Event {
393
+ constructor(sms, context) {
394
+ super(sms, context);
395
+ this.status = sms.status;
396
+ }
397
+ get name() {
398
+ return "SMSEvent";
399
+ }
400
+ get routingKey() {
401
+ return `comm.sms.${this.status}`;
402
+ }
403
+ };
404
+ __name(SMSEvent2, "SMSEvent");
405
+ module2.exports = SMSEvent2;
406
+ }
407
+ });
408
+
388
409
  // src/Events/SMSSentEvent.js
389
410
  var require_SMSSentEvent = __commonJS({
390
411
  "src/Events/SMSSentEvent.js"(exports2, module2) {
391
412
  var Event = require_Event();
392
413
  var SMSSentEvent2 = class extends Event {
393
- constructor(email, context) {
394
- super(email, context);
414
+ constructor(sms, context) {
415
+ super(sms, context);
395
416
  }
396
417
  get name() {
397
418
  return "SMSSent";
@@ -502,6 +523,7 @@ var SystemSpaceUpdatedEvent = require_SystemSpaceUpdatedEvent();
502
523
  var SystemSpaceTypeUpdatedEvent = require_SystemSpaceTypeUpdatedEvent();
503
524
  var SystemProductUpdatedEvent = require_SystemProductUpdatedEvent();
504
525
  var SystemReservationUpdatedEvent = require_SystemReservationUpdatedEvent();
526
+ var SMSEvent = require_SMSEvent();
505
527
  var SMSSentEvent = require_SMSSentEvent();
506
528
  var EmailSentEvent = require_EmailSentEvent();
507
529
  var ShortLinkCreatedEvent = require_ShortLinkCreatedEvent();
@@ -524,6 +546,7 @@ module.exports = {
524
546
  SystemSpaceTypeUpdatedEvent,
525
547
  SystemProductUpdatedEvent,
526
548
  SystemReservationUpdatedEvent,
549
+ SMSEvent,
527
550
  SMSSentEvent,
528
551
  EmailSentEvent,
529
552
  ShortLinkCreatedEvent,