@kohost/api-client 3.0.2 → 3.1.1
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/index.js +440 -0
- package/dist/cjs/Models/TimeSheet.js +60 -0
- package/dist/cjs/Models/index.js +2 -0
- package/dist/cjs/schemas/PropertySchema.d.ts +5 -1
- package/dist/cjs/schemas/TimeSheetSchema.d.ts +38 -0
- package/dist/cjs/schemas/UserSchema.d.ts +5 -1
- package/dist/cjs/schemas/property.json +13 -1
- package/dist/cjs/schemas/timeSheet.json +61 -0
- package/dist/cjs/schemas/user.json +13 -1
- package/dist/esm/Client.js +478 -47
- package/dist/esm/Client.js.map +3 -3
- package/dist/esm/Models.js +159 -4
- package/dist/esm/Models.js.map +4 -4
- package/dist/esm/SocketIoClient.js +1 -1
- package/dist/esm/SocketIoClient.js.map +1 -1
- package/dist/esm/defs.js +38 -47
- package/dist/esm/defs.js.map +2 -2
- package/dist/esm/utils.js +1 -1
- package/dist/useCases/CreateTimeSheet.js +32 -0
- package/dist/useCases/CreateTimeSheetTimeEntry.js +32 -0
- package/dist/useCases/DeleteTimeSheet.js +32 -0
- package/dist/useCases/DeleteTimeSheetTimeEntry.js +32 -0
- package/dist/useCases/DescribeTicketStats.js +32 -0
- package/dist/useCases/DescribeTimeSheet.js +32 -0
- package/dist/useCases/DescribeTimeSheetStats.js +32 -0
- package/dist/useCases/ListMyTimeSheets.js +32 -0
- package/dist/useCases/ListTimeSheets.js +32 -0
- package/dist/useCases/UpdateTimeSheet.js +32 -0
- package/dist/useCases/UpdateTimeSheetTimeEntry.js +32 -0
- package/package.json +1 -1
package/dist/esm/utils.js
CHANGED
|
@@ -3456,7 +3456,7 @@ var require_uri_all = __commonJS({
|
|
|
3456
3456
|
__name(buildExps, "buildExps");
|
|
3457
3457
|
var URI_PROTOCOL = buildExps(false);
|
|
3458
3458
|
var IRI_PROTOCOL = buildExps(true);
|
|
3459
|
-
var slicedToArray = function() {
|
|
3459
|
+
var slicedToArray = /* @__PURE__ */ function() {
|
|
3460
3460
|
function sliceIterator(arr, i) {
|
|
3461
3461
|
var _arr = [];
|
|
3462
3462
|
var _n = true;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function CreateTimeSheet(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 = "/timesheets";
|
|
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 CreateTimeSheetTimeEntry(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = [":timeSheetId"];
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/timesheets/:timeSheetId/timeEntries";
|
|
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 DeleteTimeSheet(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 = "/timesheets/: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 DeleteTimeSheetTimeEntry(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = [":timeSheetId", ":id"];
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/timesheets/:timeSheetId/timeEntries/: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 DescribeTicketStats(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 = "/tickets/stats";
|
|
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 DescribeTimeSheet(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 = "/timesheets/: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 DescribeTimeSheetStats(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 = "/timesheets/stats";
|
|
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 ListMyTimeSheets(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 = "/timesheets/mine";
|
|
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 ListTimeSheets(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 = "/timesheets";
|
|
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 UpdateTimeSheet(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 = "/timesheets/: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
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
module.exports = function UpdateTimeSheetTimeEntry(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
2
|
+
if (!requestData)
|
|
3
|
+
requestData = {};
|
|
4
|
+
const pathParams = [":timeSheetId", ":id"];
|
|
5
|
+
const { data, query, headers } = requestData;
|
|
6
|
+
let url = "/timesheets/:timeSheetId/timeEntries/: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
|
+
};
|