@kohost/api-client 3.0.0-beta.18 → 3.0.0-beta.20
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.
- package/dist/cjs/Client.js +40 -0
- package/dist/cjs/Commands.js +33 -3
- package/dist/cjs/Models.js +7 -1
- package/dist/esm/Client.js +40 -0
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Commands.js +33 -3
- package/dist/esm/Commands.js.map +3 -3
- package/dist/esm/Models.js +7 -1
- package/dist/esm/Models.js.map +2 -2
- package/dist/useCases/RequestMyKeyToken.js +32 -0
- package/package.json +1 -1
package/dist/cjs/Client.js
CHANGED
|
@@ -119,6 +119,44 @@ var require_RequestLoginLink = __commonJS({
|
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
|
|
122
|
+
// dist/useCases/RequestMyKeyToken.js
|
|
123
|
+
var require_RequestMyKeyToken = __commonJS({
|
|
124
|
+
"dist/useCases/RequestMyKeyToken.js"(exports2, module2) {
|
|
125
|
+
module2.exports = /* @__PURE__ */ __name(function RequestMyKeyToken2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
126
|
+
if (!requestData)
|
|
127
|
+
requestData = {};
|
|
128
|
+
const pathParams = null;
|
|
129
|
+
const { data, query, headers } = requestData;
|
|
130
|
+
let url = "/auth/myKeyToken";
|
|
131
|
+
if (pathParams && data) {
|
|
132
|
+
for (const param of pathParams) {
|
|
133
|
+
const paramName = param.replace(":", "");
|
|
134
|
+
url = url.replace(param, data[paramName]);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
138
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
139
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
140
|
+
return Promise.reject(
|
|
141
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
const config = {
|
|
145
|
+
method: "post",
|
|
146
|
+
url,
|
|
147
|
+
...httpConfigOptions
|
|
148
|
+
};
|
|
149
|
+
if (data)
|
|
150
|
+
config.data = data;
|
|
151
|
+
if (query)
|
|
152
|
+
config.params = query;
|
|
153
|
+
if (headers)
|
|
154
|
+
config.headers = headers;
|
|
155
|
+
return this._http.request(config);
|
|
156
|
+
}, "RequestMyKeyToken");
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
122
160
|
// dist/useCases/LogoutUser.js
|
|
123
161
|
var require_LogoutUser = __commonJS({
|
|
124
162
|
"dist/useCases/LogoutUser.js"(exports2, module2) {
|
|
@@ -4911,6 +4949,7 @@ var require_EmailUserAccountSetup = __commonJS({
|
|
|
4911
4949
|
var LoginUser = require_LoginUser();
|
|
4912
4950
|
var RefreshToken = require_RefreshToken();
|
|
4913
4951
|
var RequestLoginLink = require_RequestLoginLink();
|
|
4952
|
+
var RequestMyKeyToken = require_RequestMyKeyToken();
|
|
4914
4953
|
var LogoutUser = require_LogoutUser();
|
|
4915
4954
|
var DescribeSelf = require_DescribeSelf();
|
|
4916
4955
|
var DescribeUser = require_DescribeUser();
|
|
@@ -5147,6 +5186,7 @@ __name(KohostApiClient, "KohostApiClient");
|
|
|
5147
5186
|
KohostApiClient.prototype.LoginUser = LoginUser;
|
|
5148
5187
|
KohostApiClient.prototype.RefreshToken = RefreshToken;
|
|
5149
5188
|
KohostApiClient.prototype.RequestLoginLink = RequestLoginLink;
|
|
5189
|
+
KohostApiClient.prototype.RequestMyKeyToken = RequestMyKeyToken;
|
|
5150
5190
|
KohostApiClient.prototype.LogoutUser = LogoutUser;
|
|
5151
5191
|
KohostApiClient.prototype.DescribeSelf = DescribeSelf;
|
|
5152
5192
|
KohostApiClient.prototype.DescribeUser = DescribeUser;
|
package/dist/cjs/Commands.js
CHANGED
|
@@ -289,8 +289,6 @@ var require_OCRDocumentCommand = __commonJS({
|
|
|
289
289
|
var RequestError = require_RequestError();
|
|
290
290
|
var OCRDocumentCommand2 = class extends Command {
|
|
291
291
|
constructor({ type, image }) {
|
|
292
|
-
if (!type)
|
|
293
|
-
throw new RequestError("document type is required");
|
|
294
292
|
if (!image)
|
|
295
293
|
throw new RequestError("document image is required");
|
|
296
294
|
super({ type, image });
|
|
@@ -720,6 +718,36 @@ var require_UpdateUserCommand = __commonJS({
|
|
|
720
718
|
}
|
|
721
719
|
});
|
|
722
720
|
|
|
721
|
+
// src/Commands/GetMobileKeyCommand.js
|
|
722
|
+
var require_GetMobileKeyCommand = __commonJS({
|
|
723
|
+
"src/Commands/GetMobileKeyCommand.js"(exports2, module2) {
|
|
724
|
+
var Command = require_Command();
|
|
725
|
+
var GetMobileKeyCommand2 = class extends Command {
|
|
726
|
+
constructor({
|
|
727
|
+
id,
|
|
728
|
+
phone,
|
|
729
|
+
beginDateTime,
|
|
730
|
+
endDateTime,
|
|
731
|
+
keyToReplace,
|
|
732
|
+
...rest
|
|
733
|
+
}) {
|
|
734
|
+
super({ id, phone, beginDateTime, endDateTime, keyToReplace, ...rest });
|
|
735
|
+
}
|
|
736
|
+
get name() {
|
|
737
|
+
return "GetMobileKey";
|
|
738
|
+
}
|
|
739
|
+
get routingKey() {
|
|
740
|
+
return `lock.${this.data.id}.set`;
|
|
741
|
+
}
|
|
742
|
+
get replyTo() {
|
|
743
|
+
return "system.response.devices";
|
|
744
|
+
}
|
|
745
|
+
};
|
|
746
|
+
__name(GetMobileKeyCommand2, "GetMobileKeyCommand");
|
|
747
|
+
module2.exports = GetMobileKeyCommand2;
|
|
748
|
+
}
|
|
749
|
+
});
|
|
750
|
+
|
|
723
751
|
// src/Commands/index.js
|
|
724
752
|
var SetAlarmCommand = require_SetAlarmCommand();
|
|
725
753
|
var SetDimmerCommand = require_SetDimmerCommand();
|
|
@@ -740,6 +768,7 @@ var DiscoverRoomTypesCommand = require_DiscoverRoomTypesCommand();
|
|
|
740
768
|
var CreateShortLinkCommand = require_CreateShortLinkCommand();
|
|
741
769
|
var UpdateReservationCommand = require_UpdateReservationCommand();
|
|
742
770
|
var UpdateUserCommand = require_UpdateUserCommand();
|
|
771
|
+
var GetMobileKeyCommand = require_GetMobileKeyCommand();
|
|
743
772
|
module.exports = {
|
|
744
773
|
SetAlarmCommand,
|
|
745
774
|
SetDimmerCommand,
|
|
@@ -759,5 +788,6 @@ module.exports = {
|
|
|
759
788
|
DiscoverRoomTypesCommand,
|
|
760
789
|
CreateShortLinkCommand,
|
|
761
790
|
UpdateReservationCommand,
|
|
762
|
-
UpdateUserCommand
|
|
791
|
+
UpdateUserCommand,
|
|
792
|
+
GetMobileKeyCommand
|
|
763
793
|
};
|
package/dist/cjs/Models.js
CHANGED
|
@@ -846,6 +846,9 @@ var require_thermostat = __commonJS({
|
|
|
846
846
|
subType: {
|
|
847
847
|
$ref: "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/subType"
|
|
848
848
|
},
|
|
849
|
+
offline: {
|
|
850
|
+
type: "boolean"
|
|
851
|
+
},
|
|
849
852
|
supportedNotifications: {
|
|
850
853
|
$ref: "https://api.kohost.app/schemas/v3/definitions/device.json#/definitions/supportedNotifications"
|
|
851
854
|
},
|
|
@@ -3454,7 +3457,7 @@ var require_credential = __commonJS({
|
|
|
3454
3457
|
},
|
|
3455
3458
|
type: {
|
|
3456
3459
|
type: "string",
|
|
3457
|
-
enum: ["verificationCode", "token"]
|
|
3460
|
+
enum: ["verificationCode", "token", "mobileKey"]
|
|
3458
3461
|
},
|
|
3459
3462
|
credential: {
|
|
3460
3463
|
type: "string"
|
|
@@ -3467,6 +3470,9 @@ var require_credential = __commonJS({
|
|
|
3467
3470
|
},
|
|
3468
3471
|
expires: {
|
|
3469
3472
|
string: "string"
|
|
3473
|
+
},
|
|
3474
|
+
systemData: {
|
|
3475
|
+
$ref: "https://api.kohost.app/schemas/v3/definitions/common.json#/definitions/systemData"
|
|
3470
3476
|
}
|
|
3471
3477
|
}
|
|
3472
3478
|
};
|
package/dist/esm/Client.js
CHANGED
|
@@ -119,6 +119,44 @@ var require_RequestLoginLink = __commonJS({
|
|
|
119
119
|
}
|
|
120
120
|
});
|
|
121
121
|
|
|
122
|
+
// dist/useCases/RequestMyKeyToken.js
|
|
123
|
+
var require_RequestMyKeyToken = __commonJS({
|
|
124
|
+
"dist/useCases/RequestMyKeyToken.js"(exports, module) {
|
|
125
|
+
module.exports = /* @__PURE__ */ __name(function RequestMyKeyToken(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
126
|
+
if (!requestData)
|
|
127
|
+
requestData = {};
|
|
128
|
+
const pathParams = null;
|
|
129
|
+
const { data, query, headers } = requestData;
|
|
130
|
+
let url = "/auth/myKeyToken";
|
|
131
|
+
if (pathParams && data) {
|
|
132
|
+
for (const param of pathParams) {
|
|
133
|
+
const paramName = param.replace(":", "");
|
|
134
|
+
url = url.replace(param, data[paramName]);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
138
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
139
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
140
|
+
return Promise.reject(
|
|
141
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
const config = {
|
|
145
|
+
method: "post",
|
|
146
|
+
url,
|
|
147
|
+
...httpConfigOptions
|
|
148
|
+
};
|
|
149
|
+
if (data)
|
|
150
|
+
config.data = data;
|
|
151
|
+
if (query)
|
|
152
|
+
config.params = query;
|
|
153
|
+
if (headers)
|
|
154
|
+
config.headers = headers;
|
|
155
|
+
return this._http.request(config);
|
|
156
|
+
}, "RequestMyKeyToken");
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
|
|
122
160
|
// dist/useCases/LogoutUser.js
|
|
123
161
|
var require_LogoutUser = __commonJS({
|
|
124
162
|
"dist/useCases/LogoutUser.js"(exports, module) {
|
|
@@ -7362,6 +7400,7 @@ var require_Client = __commonJS({
|
|
|
7362
7400
|
var LoginUser = require_LoginUser();
|
|
7363
7401
|
var RefreshToken = require_RefreshToken();
|
|
7364
7402
|
var RequestLoginLink = require_RequestLoginLink();
|
|
7403
|
+
var RequestMyKeyToken = require_RequestMyKeyToken();
|
|
7365
7404
|
var LogoutUser = require_LogoutUser();
|
|
7366
7405
|
var DescribeSelf = require_DescribeSelf();
|
|
7367
7406
|
var DescribeUser = require_DescribeUser();
|
|
@@ -7596,6 +7635,7 @@ var require_Client = __commonJS({
|
|
|
7596
7635
|
KohostApiClient.prototype.LoginUser = LoginUser;
|
|
7597
7636
|
KohostApiClient.prototype.RefreshToken = RefreshToken;
|
|
7598
7637
|
KohostApiClient.prototype.RequestLoginLink = RequestLoginLink;
|
|
7638
|
+
KohostApiClient.prototype.RequestMyKeyToken = RequestMyKeyToken;
|
|
7599
7639
|
KohostApiClient.prototype.LogoutUser = LogoutUser;
|
|
7600
7640
|
KohostApiClient.prototype.DescribeSelf = DescribeSelf;
|
|
7601
7641
|
KohostApiClient.prototype.DescribeUser = DescribeUser;
|