@kohost/api-client 3.0.0-beta.12 → 3.0.0-beta.18
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 +329 -712
- package/dist/cjs/Commands.js +49 -1
- package/dist/cjs/Events.js +44 -0
- package/dist/cjs/Models.js +326 -153
- package/dist/cjs/SocketIoClient.js +68 -0
- package/dist/cjs/defs.js +8 -31
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/esm/Client.js +329 -712
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Commands.js +49 -1
- package/dist/esm/Commands.js.map +3 -3
- package/dist/esm/Events.js +44 -0
- package/dist/esm/Events.js.map +3 -3
- package/dist/esm/Models.js +319 -147
- package/dist/esm/Models.js.map +4 -4
- package/dist/esm/SocketIoClient.js +4533 -0
- package/dist/esm/SocketIoClient.js.map +7 -0
- package/dist/esm/defs.js +8 -31
- package/dist/esm/defs.js.map +2 -2
- package/dist/esm/index.js +2 -1
- package/dist/useCases/AdminUpdateCustomer.js +1 -1
- package/dist/useCases/{AdminListCustomers.js → CreateOrganization.js} +3 -3
- package/dist/useCases/{AdminLoginUser.js → CreateProperty.js} +2 -2
- package/dist/useCases/{AdminCreateAdminUser.js → DescribeOrganization.js} +4 -4
- package/dist/useCases/{ListIntegrations.js → DescribeProperty.js} +3 -3
- package/dist/useCases/{CreateIntegration.js → ListOrganizations.js} +3 -3
- package/dist/useCases/{AdminListAdminUsers.js → ListProperties.js} +2 -2
- package/dist/useCases/{DeleteIntegration.js → LogoutUser.js} +3 -3
- package/dist/useCases/{CreateIntegrationDeviceMapEntry.js → SendCheckInSMS.js} +2 -2
- package/dist/useCases/{UpdateIntegration.js → UpdateProperty.js} +2 -2
- package/package.json +3 -2
- package/dist/useCases/AdminCreateCustomer.js +0 -32
- package/dist/useCases/AdminCreateProperty.js +0 -32
- package/dist/useCases/AdminDescribeCustomer.js +0 -32
- package/dist/useCases/AdminDescribeProperty.js +0 -32
- package/dist/useCases/AdminListProperties.js +0 -32
- package/dist/useCases/AdminRefreshToken.js +0 -32
- package/dist/useCases/AdminRequestLoginLink.js +0 -32
- package/dist/useCases/AdminUpdateProperty.js +0 -32
- package/dist/useCases/DescribeIntegration.js +0 -32
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Client from "./Client";
|
|
2
|
+
import SocketIoClient from "./SocketIoClient";
|
|
2
3
|
import Commands from "./Commands";
|
|
3
4
|
import Events from "./Events";
|
|
4
5
|
import Models from "./Models";
|
|
@@ -7,5 +8,5 @@ import Client from "./Client";
|
|
|
7
8
|
import utils from "./utils";
|
|
8
9
|
|
|
9
10
|
export
|
|
10
|
-
{ Client, Commands, Events, Models, Errors, defs, utils };
|
|
11
|
+
{ Client, SocketIoClient, Commands, Events, Models, Errors, defs, utils };
|
|
11
12
|
|
|
@@ -3,7 +3,7 @@ module.exports = function AdminUpdateCustomer(requestData = { data: null, query:
|
|
|
3
3
|
requestData = {};
|
|
4
4
|
const pathParams = [":id"];
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/
|
|
6
|
+
let url = "/organizations/:id";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = function
|
|
1
|
+
module.exports = function CreateOrganization(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
2
|
if (!requestData)
|
|
3
3
|
requestData = {};
|
|
4
4
|
const pathParams = null;
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/
|
|
6
|
+
let url = "/organizations";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
|
@@ -18,7 +18,7 @@ module.exports = function AdminListCustomers(requestData = { data: null, query:
|
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
const config = {
|
|
21
|
-
method: "
|
|
21
|
+
method: "post",
|
|
22
22
|
url,
|
|
23
23
|
...httpConfigOptions
|
|
24
24
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = function
|
|
1
|
+
module.exports = function CreateProperty(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
2
|
if (!requestData)
|
|
3
3
|
requestData = {};
|
|
4
4
|
const pathParams = null;
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/
|
|
6
|
+
let url = "/properties";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = function
|
|
1
|
+
module.exports = function DescribeOrganization(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
2
|
if (!requestData)
|
|
3
3
|
requestData = {};
|
|
4
|
-
const pathParams =
|
|
4
|
+
const pathParams = [":id"];
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/
|
|
6
|
+
let url = "/organizations/:id";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
|
@@ -18,7 +18,7 @@ module.exports = function AdminCreateAdminUser(requestData = { data: null, query
|
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
const config = {
|
|
21
|
-
method: "
|
|
21
|
+
method: "get",
|
|
22
22
|
url,
|
|
23
23
|
...httpConfigOptions
|
|
24
24
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = function
|
|
1
|
+
module.exports = function DescribeProperty(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
2
|
if (!requestData)
|
|
3
3
|
requestData = {};
|
|
4
|
-
const pathParams =
|
|
4
|
+
const pathParams = [":id"];
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/
|
|
6
|
+
let url = "/properties/:id";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = function
|
|
1
|
+
module.exports = function ListOrganizations(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
2
|
if (!requestData)
|
|
3
3
|
requestData = {};
|
|
4
4
|
const pathParams = null;
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/
|
|
6
|
+
let url = "/organizations";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
|
@@ -18,7 +18,7 @@ module.exports = function CreateIntegration(requestData = { data: null, query: n
|
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
const config = {
|
|
21
|
-
method: "
|
|
21
|
+
method: "get",
|
|
22
22
|
url,
|
|
23
23
|
...httpConfigOptions
|
|
24
24
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = function
|
|
1
|
+
module.exports = function ListProperties(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
2
|
if (!requestData)
|
|
3
3
|
requestData = {};
|
|
4
4
|
const pathParams = null;
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/
|
|
6
|
+
let url = "/properties";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = function
|
|
1
|
+
module.exports = function LogoutUser(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
2
|
if (!requestData)
|
|
3
3
|
requestData = {};
|
|
4
4
|
const pathParams = [":id"];
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/
|
|
6
|
+
let url = "/auth/user/:id/logout";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
|
@@ -18,7 +18,7 @@ module.exports = function DeleteIntegration(requestData = { data: null, query: n
|
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
const config = {
|
|
21
|
-
method: "
|
|
21
|
+
method: "post",
|
|
22
22
|
url,
|
|
23
23
|
...httpConfigOptions
|
|
24
24
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = function
|
|
1
|
+
module.exports = function SendCheckInSMS(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
2
|
if (!requestData)
|
|
3
3
|
requestData = {};
|
|
4
4
|
const pathParams = [":id"];
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/
|
|
6
|
+
let url = "/reservations/:id/sendCheckInSMS";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
module.exports = function
|
|
1
|
+
module.exports = function UpdateProperty(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
2
|
if (!requestData)
|
|
3
3
|
requestData = {};
|
|
4
4
|
const pathParams = [":id"];
|
|
5
5
|
const { data, query, headers } = requestData;
|
|
6
|
-
let url = "/
|
|
6
|
+
let url = "/properties/:id";
|
|
7
7
|
if (pathParams && data) {
|
|
8
8
|
for (const param of pathParams) {
|
|
9
9
|
const paramName = param.replace(":", "");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kohost/api-client",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.18",
|
|
4
4
|
"description": "API client, models, schemas, commands, and events for Kohost applications",
|
|
5
5
|
"author": "Ian Rogers",
|
|
6
6
|
"readme": "README.md",
|
|
@@ -52,7 +52,8 @@
|
|
|
52
52
|
"lodash.clonedeep": "^4.5.0",
|
|
53
53
|
"lodash.findlast": "^4.6.0",
|
|
54
54
|
"lodash.sortby": "^4.7.0",
|
|
55
|
-
"nanoid": "^3.3.4"
|
|
55
|
+
"nanoid": "^3.3.4",
|
|
56
|
+
"socket.io-client": "^4.6.1"
|
|
56
57
|
},
|
|
57
58
|
"browser": {
|
|
58
59
|
"events": "events"
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module.exports = function AdminCreateCustomer(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 = "/admin/customers";
|
|
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
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module.exports = function AdminCreateProperty(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 = "/admin/properties";
|
|
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
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module.exports = function AdminDescribeCustomer(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 = "/admin/customers/: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
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module.exports = function AdminDescribeProperty(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 = "/admin/properties/: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
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module.exports = function AdminListProperties(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 = "/admin/properties";
|
|
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
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module.exports = function AdminRefreshToken(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 = "/admin/auth/refresh";
|
|
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
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module.exports = function AdminRequestLoginLink(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 = "/admin/auth/loginToken";
|
|
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
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
module.exports = function AdminUpdateProperty(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 = "/admin/properties/: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: "put",
|
|
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,32 +0,0 @@
|
|
|
1
|
-
module.exports = function DescribeIntegration(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 = "/integrations/: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
|
-
};
|