@kohost/api-client 3.0.0-beta.11 → 3.0.0-beta.12
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/README.md +71 -0
- package/dist/cjs/Client.js +288 -1
- package/dist/cjs/Commands.js +67 -3
- package/dist/cjs/Events.js +60 -25
- package/dist/cjs/Models.js +134 -4
- package/dist/cjs/defs.js +7 -0
- package/dist/esm/Client.js +337 -20
- package/dist/esm/Client.js.map +4 -4
- package/dist/esm/Commands.js +67 -3
- package/dist/esm/Commands.js.map +3 -3
- package/dist/esm/Events.js +60 -25
- package/dist/esm/Events.js.map +3 -3
- package/dist/esm/Models.js +134 -4
- package/dist/esm/Models.js.map +4 -4
- package/dist/esm/defs.js +56 -19
- package/dist/esm/defs.js.map +4 -4
- package/dist/useCases/AssignSpaceToReservation.js +32 -0
- package/dist/useCases/BatchNotifyCheckIn.js +32 -0
- package/dist/useCases/CreateSpaceType.js +32 -0
- package/dist/useCases/DeleteSpaceType.js +32 -0
- package/dist/useCases/DescribeSpaceType.js +32 -0
- package/dist/useCases/ListSpaceTypes.js +32 -0
- package/dist/useCases/SetDimmer.js +32 -0
- package/dist/useCases/UpdateSpace.js +1 -1
- package/package.json +8 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function AssignSpaceToReservation(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/space";
|
|
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 BatchNotifyCheckIn(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 = "/reservations/batchNotifyCheckIn";
|
|
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 CreateSpaceType(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 = "/spaceTypes";
|
|
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 DeleteSpaceType(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 = "/spaceTypes/: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
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function DescribeSpaceType(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 = "/spaceTypes/: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 ListSpaceTypes(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 = "/spaceTypes";
|
|
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 SetDimmer(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = [":roomId", ":id"];
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/rooms/:roomId/dimmers/: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: "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
|
+
};
|
|
@@ -3,7 +3,7 @@ module.exports = function UpdateSpace(requestData = { data: null, query: null, h
|
|
|
3
3
|
requestData = {};
|
|
4
4
|
const pathParams = [":id"];
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/
|
|
6
|
+
let url = "/spaceTypes/:id";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kohost/api-client",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.12",
|
|
4
4
|
"description": "API client, models, schemas, commands, and events for Kohost applications",
|
|
5
5
|
"author": "Ian Rogers",
|
|
6
|
+
"readme": "README.md",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/kohost/api-client"
|
|
10
|
+
},
|
|
6
11
|
"main": "dist/cjs/index.cjs.js",
|
|
7
12
|
"module": "dist/esm/index.js",
|
|
8
13
|
"exports": {
|
|
@@ -26,7 +31,8 @@
|
|
|
26
31
|
"clean": "rm -rf ./dist"
|
|
27
32
|
},
|
|
28
33
|
"files": [
|
|
29
|
-
"dist"
|
|
34
|
+
"dist",
|
|
35
|
+
"README.md"
|
|
30
36
|
],
|
|
31
37
|
"devDependencies": {
|
|
32
38
|
"@kohost/eslint-config": "^1.0.0",
|