@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.
- package/dist/cjs/Client.js +408 -8
- package/dist/cjs/Commands.js +134 -11
- package/dist/cjs/Events.js +24 -22
- package/dist/cjs/Models.js +384 -17
- package/dist/cjs/utils.js +8 -1
- package/dist/esm/Client.js +421 -13
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Commands.js +134 -11
- package/dist/esm/Commands.js.map +3 -3
- package/dist/esm/Events.js +24 -22
- package/dist/esm/Events.js.map +3 -3
- package/dist/esm/Models.js +384 -17
- package/dist/esm/Models.js.map +4 -4
- package/dist/esm/SocketIoClient.js +277 -89
- package/dist/esm/SocketIoClient.js.map +4 -4
- package/dist/esm/defs.js +13 -5
- package/dist/esm/defs.js.map +2 -2
- package/dist/esm/utils.js +8 -1
- package/dist/esm/utils.js.map +2 -2
- package/dist/useCases/CreateImageUploadEndpoint.js +32 -0
- package/dist/useCases/DeleteMediaFile.js +32 -0
- package/dist/useCases/{GetMobileKey.js → DescribeLockCredential.js} +2 -2
- package/dist/useCases/DescribeMyAccessCredentials.js +32 -0
- package/dist/useCases/DescribeProduct.js +32 -0
- package/dist/useCases/DescribeReservationEarlyCheckInProducts.js +32 -0
- package/dist/useCases/DescribeReservationRoomUpgrades.js +32 -0
- package/dist/useCases/ListUserSpaces.js +32 -0
- package/dist/useCases/PurchaseReservationEarlyCheckInProducts.js +32 -0
- package/dist/useCases/PurchaseReservationRoomUpgrades.js +32 -0
- package/dist/useCases/UploadImage.js +32 -0
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function CreateImageUploadEndpoint(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = null;
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/mediaFiles/imageUploadEndpoint";
|
|
7
|
+
if (pathParams && data) {
|
|
8
|
+
for (const param of pathParams) {
|
|
9
|
+
const paramName = param.replace(":", "");
|
|
10
|
+
url = url.replace(param, data[paramName]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
14
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
15
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
16
|
+
return Promise.reject(
|
|
17
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const config = {
|
|
21
|
+
method: "post",
|
|
22
|
+
url,
|
|
23
|
+
...httpConfigOptions
|
|
24
|
+
};
|
|
25
|
+
if (data)
|
|
26
|
+
config.data = data;
|
|
27
|
+
if (query)
|
|
28
|
+
config.params = query;
|
|
29
|
+
if (headers)
|
|
30
|
+
config.headers = headers;
|
|
31
|
+
return this._http.request(config);
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function DeleteMediaFile(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = [":id"];
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/mediaFiles/:id";
|
|
7
|
+
if (pathParams && data) {
|
|
8
|
+
for (const param of pathParams) {
|
|
9
|
+
const paramName = param.replace(":", "");
|
|
10
|
+
url = url.replace(param, data[paramName]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
14
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
15
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
16
|
+
return Promise.reject(
|
|
17
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const config = {
|
|
21
|
+
method: "delete",
|
|
22
|
+
url,
|
|
23
|
+
...httpConfigOptions
|
|
24
|
+
};
|
|
25
|
+
if (data)
|
|
26
|
+
config.data = data;
|
|
27
|
+
if (query)
|
|
28
|
+
config.params = query;
|
|
29
|
+
if (headers)
|
|
30
|
+
config.headers = headers;
|
|
31
|
+
return this._http.request(config);
|
|
32
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = function
|
|
1
|
+
module.exports = function DescribeLockCredential(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
2
|
if (!requestData)
|
|
3
3
|
requestData = {};
|
|
4
4
|
const pathParams = [":roomId", ":id"];
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/rooms/:roomId/locks/:id/
|
|
6
|
+
let url = "/rooms/:roomId/locks/:id/credential";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function DescribeMyAccessCredentials(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = null;
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/users/me/accessCredentials";
|
|
7
|
+
if (pathParams && data) {
|
|
8
|
+
for (const param of pathParams) {
|
|
9
|
+
const paramName = param.replace(":", "");
|
|
10
|
+
url = url.replace(param, data[paramName]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
14
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
15
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
16
|
+
return Promise.reject(
|
|
17
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const config = {
|
|
21
|
+
method: "get",
|
|
22
|
+
url,
|
|
23
|
+
...httpConfigOptions
|
|
24
|
+
};
|
|
25
|
+
if (data)
|
|
26
|
+
config.data = data;
|
|
27
|
+
if (query)
|
|
28
|
+
config.params = query;
|
|
29
|
+
if (headers)
|
|
30
|
+
config.headers = headers;
|
|
31
|
+
return this._http.request(config);
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function DescribeProduct(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = [":id"];
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/products/:id";
|
|
7
|
+
if (pathParams && data) {
|
|
8
|
+
for (const param of pathParams) {
|
|
9
|
+
const paramName = param.replace(":", "");
|
|
10
|
+
url = url.replace(param, data[paramName]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
14
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
15
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
16
|
+
return Promise.reject(
|
|
17
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const config = {
|
|
21
|
+
method: "get",
|
|
22
|
+
url,
|
|
23
|
+
...httpConfigOptions
|
|
24
|
+
};
|
|
25
|
+
if (data)
|
|
26
|
+
config.data = data;
|
|
27
|
+
if (query)
|
|
28
|
+
config.params = query;
|
|
29
|
+
if (headers)
|
|
30
|
+
config.headers = headers;
|
|
31
|
+
return this._http.request(config);
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function DescribeReservationEarlyCheckInProducts(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = [":id"];
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/reservations/:id/products/earlyCheckIn";
|
|
7
|
+
if (pathParams && data) {
|
|
8
|
+
for (const param of pathParams) {
|
|
9
|
+
const paramName = param.replace(":", "");
|
|
10
|
+
url = url.replace(param, data[paramName]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
14
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
15
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
16
|
+
return Promise.reject(
|
|
17
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const config = {
|
|
21
|
+
method: "get",
|
|
22
|
+
url,
|
|
23
|
+
...httpConfigOptions
|
|
24
|
+
};
|
|
25
|
+
if (data)
|
|
26
|
+
config.data = data;
|
|
27
|
+
if (query)
|
|
28
|
+
config.params = query;
|
|
29
|
+
if (headers)
|
|
30
|
+
config.headers = headers;
|
|
31
|
+
return this._http.request(config);
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function DescribeReservationRoomUpgrades(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = [":id"];
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/reservations/:id/products/roomUpgrades";
|
|
7
|
+
if (pathParams && data) {
|
|
8
|
+
for (const param of pathParams) {
|
|
9
|
+
const paramName = param.replace(":", "");
|
|
10
|
+
url = url.replace(param, data[paramName]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
14
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
15
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
16
|
+
return Promise.reject(
|
|
17
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const config = {
|
|
21
|
+
method: "get",
|
|
22
|
+
url,
|
|
23
|
+
...httpConfigOptions
|
|
24
|
+
};
|
|
25
|
+
if (data)
|
|
26
|
+
config.data = data;
|
|
27
|
+
if (query)
|
|
28
|
+
config.params = query;
|
|
29
|
+
if (headers)
|
|
30
|
+
config.headers = headers;
|
|
31
|
+
return this._http.request(config);
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function ListUserSpaces(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = [":id"];
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/users/:id/spaces";
|
|
7
|
+
if (pathParams && data) {
|
|
8
|
+
for (const param of pathParams) {
|
|
9
|
+
const paramName = param.replace(":", "");
|
|
10
|
+
url = url.replace(param, data[paramName]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
14
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
15
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
16
|
+
return Promise.reject(
|
|
17
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const config = {
|
|
21
|
+
method: "get",
|
|
22
|
+
url,
|
|
23
|
+
...httpConfigOptions
|
|
24
|
+
};
|
|
25
|
+
if (data)
|
|
26
|
+
config.data = data;
|
|
27
|
+
if (query)
|
|
28
|
+
config.params = query;
|
|
29
|
+
if (headers)
|
|
30
|
+
config.headers = headers;
|
|
31
|
+
return this._http.request(config);
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function PurchaseReservationEarlyCheckInProducts(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = [":id"];
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/reservations/:id/products/earlyCheckIn";
|
|
7
|
+
if (pathParams && data) {
|
|
8
|
+
for (const param of pathParams) {
|
|
9
|
+
const paramName = param.replace(":", "");
|
|
10
|
+
url = url.replace(param, data[paramName]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
14
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
15
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
16
|
+
return Promise.reject(
|
|
17
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const config = {
|
|
21
|
+
method: "post",
|
|
22
|
+
url,
|
|
23
|
+
...httpConfigOptions
|
|
24
|
+
};
|
|
25
|
+
if (data)
|
|
26
|
+
config.data = data;
|
|
27
|
+
if (query)
|
|
28
|
+
config.params = query;
|
|
29
|
+
if (headers)
|
|
30
|
+
config.headers = headers;
|
|
31
|
+
return this._http.request(config);
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function PurchaseReservationRoomUpgrades(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = [":id"];
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/reservations/:id/products/roomUpgrades";
|
|
7
|
+
if (pathParams && data) {
|
|
8
|
+
for (const param of pathParams) {
|
|
9
|
+
const paramName = param.replace(":", "");
|
|
10
|
+
url = url.replace(param, data[paramName]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
14
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
15
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
16
|
+
return Promise.reject(
|
|
17
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const config = {
|
|
21
|
+
method: "post",
|
|
22
|
+
url,
|
|
23
|
+
...httpConfigOptions
|
|
24
|
+
};
|
|
25
|
+
if (data)
|
|
26
|
+
config.data = data;
|
|
27
|
+
if (query)
|
|
28
|
+
config.params = query;
|
|
29
|
+
if (headers)
|
|
30
|
+
config.headers = headers;
|
|
31
|
+
return this._http.request(config);
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function UploadImage(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = null;
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/mediaFiles/uploadImage";
|
|
7
|
+
if (pathParams && data) {
|
|
8
|
+
for (const param of pathParams) {
|
|
9
|
+
const paramName = param.replace(":", "");
|
|
10
|
+
url = url.replace(param, data[paramName]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
14
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
15
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
16
|
+
return Promise.reject(
|
|
17
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const config = {
|
|
21
|
+
method: "post",
|
|
22
|
+
url,
|
|
23
|
+
...httpConfigOptions
|
|
24
|
+
};
|
|
25
|
+
if (data)
|
|
26
|
+
config.data = data;
|
|
27
|
+
if (query)
|
|
28
|
+
config.params = query;
|
|
29
|
+
if (headers)
|
|
30
|
+
config.headers = headers;
|
|
31
|
+
return this._http.request(config);
|
|
32
|
+
};
|