@kohost/api-client 3.0.1 → 3.1.0
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 +6 -2
- package/dist/cjs/schemas/TimeSheetSchema.d.ts +38 -0
- package/dist/cjs/schemas/UserSchema.d.ts +5 -1
- package/dist/cjs/schemas/property.json +14 -2
- 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 +160 -5
- 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 +2 -1
package/dist/cjs/Client/index.js
CHANGED
|
@@ -3919,6 +3919,44 @@ var require_AddDefaultScenesToRooms = __commonJS({
|
|
|
3919
3919
|
}
|
|
3920
3920
|
});
|
|
3921
3921
|
|
|
3922
|
+
// dist/useCases/DescribeTicketStats.js
|
|
3923
|
+
var require_DescribeTicketStats = __commonJS({
|
|
3924
|
+
"dist/useCases/DescribeTicketStats.js"(exports2, module2) {
|
|
3925
|
+
module2.exports = /* @__PURE__ */ __name(function DescribeTicketStats2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
3926
|
+
if (!requestData)
|
|
3927
|
+
requestData = {};
|
|
3928
|
+
const pathParams = null;
|
|
3929
|
+
const { data, query, headers } = requestData;
|
|
3930
|
+
let url = "/tickets/stats";
|
|
3931
|
+
if (pathParams && data) {
|
|
3932
|
+
for (const param of pathParams) {
|
|
3933
|
+
const paramName = param.replace(":", "");
|
|
3934
|
+
url = url.replace(param, data[paramName]);
|
|
3935
|
+
}
|
|
3936
|
+
}
|
|
3937
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
3938
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
3939
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
3940
|
+
return Promise.reject(
|
|
3941
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
3942
|
+
);
|
|
3943
|
+
}
|
|
3944
|
+
const config = {
|
|
3945
|
+
method: "get",
|
|
3946
|
+
url,
|
|
3947
|
+
...httpConfigOptions
|
|
3948
|
+
};
|
|
3949
|
+
if (data)
|
|
3950
|
+
config.data = data;
|
|
3951
|
+
if (query)
|
|
3952
|
+
config.params = query;
|
|
3953
|
+
if (headers)
|
|
3954
|
+
config.headers = headers;
|
|
3955
|
+
return this._http.request(config);
|
|
3956
|
+
}, "DescribeTicketStats");
|
|
3957
|
+
}
|
|
3958
|
+
});
|
|
3959
|
+
|
|
3922
3960
|
// dist/useCases/CreateTicket.js
|
|
3923
3961
|
var require_CreateTicket = __commonJS({
|
|
3924
3962
|
"dist/useCases/CreateTicket.js"(exports2, module2) {
|
|
@@ -6503,6 +6541,386 @@ var require_ListAnnouncements = __commonJS({
|
|
|
6503
6541
|
}
|
|
6504
6542
|
});
|
|
6505
6543
|
|
|
6544
|
+
// dist/useCases/DescribeTimeSheetStats.js
|
|
6545
|
+
var require_DescribeTimeSheetStats = __commonJS({
|
|
6546
|
+
"dist/useCases/DescribeTimeSheetStats.js"(exports2, module2) {
|
|
6547
|
+
module2.exports = /* @__PURE__ */ __name(function DescribeTimeSheetStats2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
6548
|
+
if (!requestData)
|
|
6549
|
+
requestData = {};
|
|
6550
|
+
const pathParams = null;
|
|
6551
|
+
const { data, query, headers } = requestData;
|
|
6552
|
+
let url = "/timesheets/stats";
|
|
6553
|
+
if (pathParams && data) {
|
|
6554
|
+
for (const param of pathParams) {
|
|
6555
|
+
const paramName = param.replace(":", "");
|
|
6556
|
+
url = url.replace(param, data[paramName]);
|
|
6557
|
+
}
|
|
6558
|
+
}
|
|
6559
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
6560
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
6561
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
6562
|
+
return Promise.reject(
|
|
6563
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
6564
|
+
);
|
|
6565
|
+
}
|
|
6566
|
+
const config = {
|
|
6567
|
+
method: "get",
|
|
6568
|
+
url,
|
|
6569
|
+
...httpConfigOptions
|
|
6570
|
+
};
|
|
6571
|
+
if (data)
|
|
6572
|
+
config.data = data;
|
|
6573
|
+
if (query)
|
|
6574
|
+
config.params = query;
|
|
6575
|
+
if (headers)
|
|
6576
|
+
config.headers = headers;
|
|
6577
|
+
return this._http.request(config);
|
|
6578
|
+
}, "DescribeTimeSheetStats");
|
|
6579
|
+
}
|
|
6580
|
+
});
|
|
6581
|
+
|
|
6582
|
+
// dist/useCases/ListMyTimeSheets.js
|
|
6583
|
+
var require_ListMyTimeSheets = __commonJS({
|
|
6584
|
+
"dist/useCases/ListMyTimeSheets.js"(exports2, module2) {
|
|
6585
|
+
module2.exports = /* @__PURE__ */ __name(function ListMyTimeSheets2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
6586
|
+
if (!requestData)
|
|
6587
|
+
requestData = {};
|
|
6588
|
+
const pathParams = null;
|
|
6589
|
+
const { data, query, headers } = requestData;
|
|
6590
|
+
let url = "/timesheets/mine";
|
|
6591
|
+
if (pathParams && data) {
|
|
6592
|
+
for (const param of pathParams) {
|
|
6593
|
+
const paramName = param.replace(":", "");
|
|
6594
|
+
url = url.replace(param, data[paramName]);
|
|
6595
|
+
}
|
|
6596
|
+
}
|
|
6597
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
6598
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
6599
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
6600
|
+
return Promise.reject(
|
|
6601
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
6602
|
+
);
|
|
6603
|
+
}
|
|
6604
|
+
const config = {
|
|
6605
|
+
method: "get",
|
|
6606
|
+
url,
|
|
6607
|
+
...httpConfigOptions
|
|
6608
|
+
};
|
|
6609
|
+
if (data)
|
|
6610
|
+
config.data = data;
|
|
6611
|
+
if (query)
|
|
6612
|
+
config.params = query;
|
|
6613
|
+
if (headers)
|
|
6614
|
+
config.headers = headers;
|
|
6615
|
+
return this._http.request(config);
|
|
6616
|
+
}, "ListMyTimeSheets");
|
|
6617
|
+
}
|
|
6618
|
+
});
|
|
6619
|
+
|
|
6620
|
+
// dist/useCases/DescribeTimeSheet.js
|
|
6621
|
+
var require_DescribeTimeSheet = __commonJS({
|
|
6622
|
+
"dist/useCases/DescribeTimeSheet.js"(exports2, module2) {
|
|
6623
|
+
module2.exports = /* @__PURE__ */ __name(function DescribeTimeSheet2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
6624
|
+
if (!requestData)
|
|
6625
|
+
requestData = {};
|
|
6626
|
+
const pathParams = [":id"];
|
|
6627
|
+
const { data, query, headers } = requestData;
|
|
6628
|
+
let url = "/timesheets/:id";
|
|
6629
|
+
if (pathParams && data) {
|
|
6630
|
+
for (const param of pathParams) {
|
|
6631
|
+
const paramName = param.replace(":", "");
|
|
6632
|
+
url = url.replace(param, data[paramName]);
|
|
6633
|
+
}
|
|
6634
|
+
}
|
|
6635
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
6636
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
6637
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
6638
|
+
return Promise.reject(
|
|
6639
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
6640
|
+
);
|
|
6641
|
+
}
|
|
6642
|
+
const config = {
|
|
6643
|
+
method: "get",
|
|
6644
|
+
url,
|
|
6645
|
+
...httpConfigOptions
|
|
6646
|
+
};
|
|
6647
|
+
if (data)
|
|
6648
|
+
config.data = data;
|
|
6649
|
+
if (query)
|
|
6650
|
+
config.params = query;
|
|
6651
|
+
if (headers)
|
|
6652
|
+
config.headers = headers;
|
|
6653
|
+
return this._http.request(config);
|
|
6654
|
+
}, "DescribeTimeSheet");
|
|
6655
|
+
}
|
|
6656
|
+
});
|
|
6657
|
+
|
|
6658
|
+
// dist/useCases/ListTimeSheets.js
|
|
6659
|
+
var require_ListTimeSheets = __commonJS({
|
|
6660
|
+
"dist/useCases/ListTimeSheets.js"(exports2, module2) {
|
|
6661
|
+
module2.exports = /* @__PURE__ */ __name(function ListTimeSheets2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
6662
|
+
if (!requestData)
|
|
6663
|
+
requestData = {};
|
|
6664
|
+
const pathParams = null;
|
|
6665
|
+
const { data, query, headers } = requestData;
|
|
6666
|
+
let url = "/timesheets";
|
|
6667
|
+
if (pathParams && data) {
|
|
6668
|
+
for (const param of pathParams) {
|
|
6669
|
+
const paramName = param.replace(":", "");
|
|
6670
|
+
url = url.replace(param, data[paramName]);
|
|
6671
|
+
}
|
|
6672
|
+
}
|
|
6673
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
6674
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
6675
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
6676
|
+
return Promise.reject(
|
|
6677
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
6678
|
+
);
|
|
6679
|
+
}
|
|
6680
|
+
const config = {
|
|
6681
|
+
method: "get",
|
|
6682
|
+
url,
|
|
6683
|
+
...httpConfigOptions
|
|
6684
|
+
};
|
|
6685
|
+
if (data)
|
|
6686
|
+
config.data = data;
|
|
6687
|
+
if (query)
|
|
6688
|
+
config.params = query;
|
|
6689
|
+
if (headers)
|
|
6690
|
+
config.headers = headers;
|
|
6691
|
+
return this._http.request(config);
|
|
6692
|
+
}, "ListTimeSheets");
|
|
6693
|
+
}
|
|
6694
|
+
});
|
|
6695
|
+
|
|
6696
|
+
// dist/useCases/CreateTimeSheet.js
|
|
6697
|
+
var require_CreateTimeSheet = __commonJS({
|
|
6698
|
+
"dist/useCases/CreateTimeSheet.js"(exports2, module2) {
|
|
6699
|
+
module2.exports = /* @__PURE__ */ __name(function CreateTimeSheet2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
6700
|
+
if (!requestData)
|
|
6701
|
+
requestData = {};
|
|
6702
|
+
const pathParams = null;
|
|
6703
|
+
const { data, query, headers } = requestData;
|
|
6704
|
+
let url = "/timesheets";
|
|
6705
|
+
if (pathParams && data) {
|
|
6706
|
+
for (const param of pathParams) {
|
|
6707
|
+
const paramName = param.replace(":", "");
|
|
6708
|
+
url = url.replace(param, data[paramName]);
|
|
6709
|
+
}
|
|
6710
|
+
}
|
|
6711
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
6712
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
6713
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
6714
|
+
return Promise.reject(
|
|
6715
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
6716
|
+
);
|
|
6717
|
+
}
|
|
6718
|
+
const config = {
|
|
6719
|
+
method: "post",
|
|
6720
|
+
url,
|
|
6721
|
+
...httpConfigOptions
|
|
6722
|
+
};
|
|
6723
|
+
if (data)
|
|
6724
|
+
config.data = data;
|
|
6725
|
+
if (query)
|
|
6726
|
+
config.params = query;
|
|
6727
|
+
if (headers)
|
|
6728
|
+
config.headers = headers;
|
|
6729
|
+
return this._http.request(config);
|
|
6730
|
+
}, "CreateTimeSheet");
|
|
6731
|
+
}
|
|
6732
|
+
});
|
|
6733
|
+
|
|
6734
|
+
// dist/useCases/DeleteTimeSheet.js
|
|
6735
|
+
var require_DeleteTimeSheet = __commonJS({
|
|
6736
|
+
"dist/useCases/DeleteTimeSheet.js"(exports2, module2) {
|
|
6737
|
+
module2.exports = /* @__PURE__ */ __name(function DeleteTimeSheet2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
6738
|
+
if (!requestData)
|
|
6739
|
+
requestData = {};
|
|
6740
|
+
const pathParams = [":id"];
|
|
6741
|
+
const { data, query, headers } = requestData;
|
|
6742
|
+
let url = "/timesheets/:id";
|
|
6743
|
+
if (pathParams && data) {
|
|
6744
|
+
for (const param of pathParams) {
|
|
6745
|
+
const paramName = param.replace(":", "");
|
|
6746
|
+
url = url.replace(param, data[paramName]);
|
|
6747
|
+
}
|
|
6748
|
+
}
|
|
6749
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
6750
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
6751
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
6752
|
+
return Promise.reject(
|
|
6753
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
6754
|
+
);
|
|
6755
|
+
}
|
|
6756
|
+
const config = {
|
|
6757
|
+
method: "delete",
|
|
6758
|
+
url,
|
|
6759
|
+
...httpConfigOptions
|
|
6760
|
+
};
|
|
6761
|
+
if (data)
|
|
6762
|
+
config.data = data;
|
|
6763
|
+
if (query)
|
|
6764
|
+
config.params = query;
|
|
6765
|
+
if (headers)
|
|
6766
|
+
config.headers = headers;
|
|
6767
|
+
return this._http.request(config);
|
|
6768
|
+
}, "DeleteTimeSheet");
|
|
6769
|
+
}
|
|
6770
|
+
});
|
|
6771
|
+
|
|
6772
|
+
// dist/useCases/UpdateTimeSheet.js
|
|
6773
|
+
var require_UpdateTimeSheet = __commonJS({
|
|
6774
|
+
"dist/useCases/UpdateTimeSheet.js"(exports2, module2) {
|
|
6775
|
+
module2.exports = /* @__PURE__ */ __name(function UpdateTimeSheet2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
6776
|
+
if (!requestData)
|
|
6777
|
+
requestData = {};
|
|
6778
|
+
const pathParams = [":id"];
|
|
6779
|
+
const { data, query, headers } = requestData;
|
|
6780
|
+
let url = "/timesheets/:id";
|
|
6781
|
+
if (pathParams && data) {
|
|
6782
|
+
for (const param of pathParams) {
|
|
6783
|
+
const paramName = param.replace(":", "");
|
|
6784
|
+
url = url.replace(param, data[paramName]);
|
|
6785
|
+
}
|
|
6786
|
+
}
|
|
6787
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
6788
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
6789
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
6790
|
+
return Promise.reject(
|
|
6791
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
6792
|
+
);
|
|
6793
|
+
}
|
|
6794
|
+
const config = {
|
|
6795
|
+
method: "put",
|
|
6796
|
+
url,
|
|
6797
|
+
...httpConfigOptions
|
|
6798
|
+
};
|
|
6799
|
+
if (data)
|
|
6800
|
+
config.data = data;
|
|
6801
|
+
if (query)
|
|
6802
|
+
config.params = query;
|
|
6803
|
+
if (headers)
|
|
6804
|
+
config.headers = headers;
|
|
6805
|
+
return this._http.request(config);
|
|
6806
|
+
}, "UpdateTimeSheet");
|
|
6807
|
+
}
|
|
6808
|
+
});
|
|
6809
|
+
|
|
6810
|
+
// dist/useCases/CreateTimeSheetTimeEntry.js
|
|
6811
|
+
var require_CreateTimeSheetTimeEntry = __commonJS({
|
|
6812
|
+
"dist/useCases/CreateTimeSheetTimeEntry.js"(exports2, module2) {
|
|
6813
|
+
module2.exports = /* @__PURE__ */ __name(function CreateTimeSheetTimeEntry2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
6814
|
+
if (!requestData)
|
|
6815
|
+
requestData = {};
|
|
6816
|
+
const pathParams = [":timeSheetId"];
|
|
6817
|
+
const { data, query, headers } = requestData;
|
|
6818
|
+
let url = "/timesheets/:timeSheetId/timeEntries";
|
|
6819
|
+
if (pathParams && data) {
|
|
6820
|
+
for (const param of pathParams) {
|
|
6821
|
+
const paramName = param.replace(":", "");
|
|
6822
|
+
url = url.replace(param, data[paramName]);
|
|
6823
|
+
}
|
|
6824
|
+
}
|
|
6825
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
6826
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
6827
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
6828
|
+
return Promise.reject(
|
|
6829
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
6830
|
+
);
|
|
6831
|
+
}
|
|
6832
|
+
const config = {
|
|
6833
|
+
method: "post",
|
|
6834
|
+
url,
|
|
6835
|
+
...httpConfigOptions
|
|
6836
|
+
};
|
|
6837
|
+
if (data)
|
|
6838
|
+
config.data = data;
|
|
6839
|
+
if (query)
|
|
6840
|
+
config.params = query;
|
|
6841
|
+
if (headers)
|
|
6842
|
+
config.headers = headers;
|
|
6843
|
+
return this._http.request(config);
|
|
6844
|
+
}, "CreateTimeSheetTimeEntry");
|
|
6845
|
+
}
|
|
6846
|
+
});
|
|
6847
|
+
|
|
6848
|
+
// dist/useCases/DeleteTimeSheetTimeEntry.js
|
|
6849
|
+
var require_DeleteTimeSheetTimeEntry = __commonJS({
|
|
6850
|
+
"dist/useCases/DeleteTimeSheetTimeEntry.js"(exports2, module2) {
|
|
6851
|
+
module2.exports = /* @__PURE__ */ __name(function DeleteTimeSheetTimeEntry2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
6852
|
+
if (!requestData)
|
|
6853
|
+
requestData = {};
|
|
6854
|
+
const pathParams = [":timeSheetId", ":id"];
|
|
6855
|
+
const { data, query, headers } = requestData;
|
|
6856
|
+
let url = "/timesheets/:timeSheetId/timeEntries/:id";
|
|
6857
|
+
if (pathParams && data) {
|
|
6858
|
+
for (const param of pathParams) {
|
|
6859
|
+
const paramName = param.replace(":", "");
|
|
6860
|
+
url = url.replace(param, data[paramName]);
|
|
6861
|
+
}
|
|
6862
|
+
}
|
|
6863
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
6864
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
6865
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
6866
|
+
return Promise.reject(
|
|
6867
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
6868
|
+
);
|
|
6869
|
+
}
|
|
6870
|
+
const config = {
|
|
6871
|
+
method: "delete",
|
|
6872
|
+
url,
|
|
6873
|
+
...httpConfigOptions
|
|
6874
|
+
};
|
|
6875
|
+
if (data)
|
|
6876
|
+
config.data = data;
|
|
6877
|
+
if (query)
|
|
6878
|
+
config.params = query;
|
|
6879
|
+
if (headers)
|
|
6880
|
+
config.headers = headers;
|
|
6881
|
+
return this._http.request(config);
|
|
6882
|
+
}, "DeleteTimeSheetTimeEntry");
|
|
6883
|
+
}
|
|
6884
|
+
});
|
|
6885
|
+
|
|
6886
|
+
// dist/useCases/UpdateTimeSheetTimeEntry.js
|
|
6887
|
+
var require_UpdateTimeSheetTimeEntry = __commonJS({
|
|
6888
|
+
"dist/useCases/UpdateTimeSheetTimeEntry.js"(exports2, module2) {
|
|
6889
|
+
module2.exports = /* @__PURE__ */ __name(function UpdateTimeSheetTimeEntry2(requestData = { data: null, query: null, headers: null }, httpConfigOptions = {}) {
|
|
6890
|
+
if (!requestData)
|
|
6891
|
+
requestData = {};
|
|
6892
|
+
const pathParams = [":timeSheetId", ":id"];
|
|
6893
|
+
const { data, query, headers } = requestData;
|
|
6894
|
+
let url = "/timesheets/:timeSheetId/timeEntries/:id";
|
|
6895
|
+
if (pathParams && data) {
|
|
6896
|
+
for (const param of pathParams) {
|
|
6897
|
+
const paramName = param.replace(":", "");
|
|
6898
|
+
url = url.replace(param, data[paramName]);
|
|
6899
|
+
}
|
|
6900
|
+
}
|
|
6901
|
+
if (url.match(/:[a-zA-Z0-9]+/g)) {
|
|
6902
|
+
const missingParams = url.match(/:[a-zA-Z0-9]+/g);
|
|
6903
|
+
const missing = missingParams.map((param) => param.replace(":", ""));
|
|
6904
|
+
return Promise.reject(
|
|
6905
|
+
new Error("Missing parameters: " + missing.join(", "))
|
|
6906
|
+
);
|
|
6907
|
+
}
|
|
6908
|
+
const config = {
|
|
6909
|
+
method: "put",
|
|
6910
|
+
url,
|
|
6911
|
+
...httpConfigOptions
|
|
6912
|
+
};
|
|
6913
|
+
if (data)
|
|
6914
|
+
config.data = data;
|
|
6915
|
+
if (query)
|
|
6916
|
+
config.params = query;
|
|
6917
|
+
if (headers)
|
|
6918
|
+
config.headers = headers;
|
|
6919
|
+
return this._http.request(config);
|
|
6920
|
+
}, "UpdateTimeSheetTimeEntry");
|
|
6921
|
+
}
|
|
6922
|
+
});
|
|
6923
|
+
|
|
6506
6924
|
// src/Client/index.js
|
|
6507
6925
|
var LoginStart = require_LoginStart();
|
|
6508
6926
|
var RefreshToken = require_RefreshToken();
|
|
@@ -6607,6 +7025,7 @@ var SetRoomScene = require_SetRoomScene();
|
|
|
6607
7025
|
var SetCustomScene = require_SetCustomScene();
|
|
6608
7026
|
var AddScenesToRoom = require_AddScenesToRoom();
|
|
6609
7027
|
var AddDefaultScenesToRooms = require_AddDefaultScenesToRooms();
|
|
7028
|
+
var DescribeTicketStats = require_DescribeTicketStats();
|
|
6610
7029
|
var CreateTicket = require_CreateTicket();
|
|
6611
7030
|
var CreateTicketMessage = require_CreateTicketMessage();
|
|
6612
7031
|
var DeleteTicket = require_DeleteTicket();
|
|
@@ -6675,6 +7094,16 @@ var UpdateAnnouncement = require_UpdateAnnouncement();
|
|
|
6675
7094
|
var DescribeAnnouncement = require_DescribeAnnouncement();
|
|
6676
7095
|
var DeleteAnnouncement = require_DeleteAnnouncement();
|
|
6677
7096
|
var ListAnnouncements = require_ListAnnouncements();
|
|
7097
|
+
var DescribeTimeSheetStats = require_DescribeTimeSheetStats();
|
|
7098
|
+
var ListMyTimeSheets = require_ListMyTimeSheets();
|
|
7099
|
+
var DescribeTimeSheet = require_DescribeTimeSheet();
|
|
7100
|
+
var ListTimeSheets = require_ListTimeSheets();
|
|
7101
|
+
var CreateTimeSheet = require_CreateTimeSheet();
|
|
7102
|
+
var DeleteTimeSheet = require_DeleteTimeSheet();
|
|
7103
|
+
var UpdateTimeSheet = require_UpdateTimeSheet();
|
|
7104
|
+
var CreateTimeSheetTimeEntry = require_CreateTimeSheetTimeEntry();
|
|
7105
|
+
var DeleteTimeSheetTimeEntry = require_DeleteTimeSheetTimeEntry();
|
|
7106
|
+
var UpdateTimeSheetTimeEntry = require_UpdateTimeSheetTimeEntry();
|
|
6678
7107
|
var { EventEmitter } = require("events");
|
|
6679
7108
|
var axios = require("axios");
|
|
6680
7109
|
var KohostApiClient = class _KohostApiClient extends EventEmitter {
|
|
@@ -6917,6 +7346,7 @@ KohostApiClient.prototype.SetRoomScene = SetRoomScene;
|
|
|
6917
7346
|
KohostApiClient.prototype.SetCustomScene = SetCustomScene;
|
|
6918
7347
|
KohostApiClient.prototype.AddScenesToRoom = AddScenesToRoom;
|
|
6919
7348
|
KohostApiClient.prototype.AddDefaultScenesToRooms = AddDefaultScenesToRooms;
|
|
7349
|
+
KohostApiClient.prototype.DescribeTicketStats = DescribeTicketStats;
|
|
6920
7350
|
KohostApiClient.prototype.CreateTicket = CreateTicket;
|
|
6921
7351
|
KohostApiClient.prototype.CreateTicketMessage = CreateTicketMessage;
|
|
6922
7352
|
KohostApiClient.prototype.DeleteTicket = DeleteTicket;
|
|
@@ -6985,4 +7415,14 @@ KohostApiClient.prototype.UpdateAnnouncement = UpdateAnnouncement;
|
|
|
6985
7415
|
KohostApiClient.prototype.DescribeAnnouncement = DescribeAnnouncement;
|
|
6986
7416
|
KohostApiClient.prototype.DeleteAnnouncement = DeleteAnnouncement;
|
|
6987
7417
|
KohostApiClient.prototype.ListAnnouncements = ListAnnouncements;
|
|
7418
|
+
KohostApiClient.prototype.DescribeTimeSheetStats = DescribeTimeSheetStats;
|
|
7419
|
+
KohostApiClient.prototype.ListMyTimeSheets = ListMyTimeSheets;
|
|
7420
|
+
KohostApiClient.prototype.DescribeTimeSheet = DescribeTimeSheet;
|
|
7421
|
+
KohostApiClient.prototype.ListTimeSheets = ListTimeSheets;
|
|
7422
|
+
KohostApiClient.prototype.CreateTimeSheet = CreateTimeSheet;
|
|
7423
|
+
KohostApiClient.prototype.DeleteTimeSheet = DeleteTimeSheet;
|
|
7424
|
+
KohostApiClient.prototype.UpdateTimeSheet = UpdateTimeSheet;
|
|
7425
|
+
KohostApiClient.prototype.CreateTimeSheetTimeEntry = CreateTimeSheetTimeEntry;
|
|
7426
|
+
KohostApiClient.prototype.DeleteTimeSheetTimeEntry = DeleteTimeSheetTimeEntry;
|
|
7427
|
+
KohostApiClient.prototype.UpdateTimeSheetTimeEntry = UpdateTimeSheetTimeEntry;
|
|
6988
7428
|
module.exports = KohostApiClient;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Create the TimeSheet Model
|
|
2
|
+
const schemas = require("../utils/schema");
|
|
3
|
+
const schema = require("../schemas/timeSheet.json");
|
|
4
|
+
const Entity = require("./Entity");
|
|
5
|
+
|
|
6
|
+
const { nanoid } = require("nanoid");
|
|
7
|
+
|
|
8
|
+
schemas.add(schema);
|
|
9
|
+
const validator = schemas.compile(schema);
|
|
10
|
+
|
|
11
|
+
class TimeSheet extends Entity {
|
|
12
|
+
/**
|
|
13
|
+
* @typedef {import("../schemas/TimeSheetSchema").TimeSheet} TimeSheetType
|
|
14
|
+
* Create a TimeSheet instance.
|
|
15
|
+
* @constructor
|
|
16
|
+
* @param {TimeSheetType} timesheet - The timesheet object of type TimeSheet.
|
|
17
|
+
*/
|
|
18
|
+
constructor(timesheet) {
|
|
19
|
+
if (timesheet.day) {
|
|
20
|
+
timesheet.day = new Date(timesheet.day);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (timesheet.timeEntries && Array.isArray(timesheet.timeEntries)) {
|
|
24
|
+
timesheet.timeEntries = timesheet.timeEntries.map((t) => {
|
|
25
|
+
if (!t.id) t.id = TimeSheet.generateTimeEntryId();
|
|
26
|
+
if (t.start) t.start = new Date(t.start);
|
|
27
|
+
if (t.end) t.end = new Date(t.end);
|
|
28
|
+
return t;
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// sort by start time
|
|
32
|
+
timesheet.timeEntries.sort((a, b) => {
|
|
33
|
+
if (a.start < b.start) return -1;
|
|
34
|
+
if (a.start > b.start) return 1;
|
|
35
|
+
return 0;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
super(timesheet);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
static generateTimeEntryId(len = 16) {
|
|
42
|
+
return nanoid(len);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
Object.defineProperty(TimeSheet.prototype, "schema", {
|
|
47
|
+
value: schema,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
Object.defineProperty(TimeSheet.prototype, "validator", {
|
|
51
|
+
get: function () {
|
|
52
|
+
return validator;
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
Object.defineProperty(TimeSheet, "validProperties", {
|
|
57
|
+
value: Object.keys(schema.properties),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
module.exports = TimeSheet;
|
package/dist/cjs/Models/index.js
CHANGED
|
@@ -32,6 +32,7 @@ const EnergyReport = require("./EnergyReport");
|
|
|
32
32
|
const SMSMessage = require("./SmsMessage");
|
|
33
33
|
const EmailMessage = require("./EmailMessage");
|
|
34
34
|
const Announcement = require("./Announcement");
|
|
35
|
+
const TimeSheet = require("./TimeSheet");
|
|
35
36
|
|
|
36
37
|
const Property = require("./Property");
|
|
37
38
|
const Organization = require("./Organization");
|
|
@@ -74,4 +75,5 @@ module.exports = {
|
|
|
74
75
|
EmailMessage,
|
|
75
76
|
Order,
|
|
76
77
|
Announcement,
|
|
78
|
+
TimeSheet,
|
|
77
79
|
};
|
|
@@ -77,9 +77,13 @@ export interface Property {
|
|
|
77
77
|
};
|
|
78
78
|
[k: string]: unknown;
|
|
79
79
|
};
|
|
80
|
-
Concierge?:
|
|
80
|
+
Concierge?: {
|
|
81
|
+
timeTracking?: boolean;
|
|
82
|
+
tipping?: boolean;
|
|
83
|
+
[k: string]: unknown;
|
|
84
|
+
};
|
|
81
85
|
DigitalKey?: {
|
|
82
|
-
system?: "salto" | "
|
|
86
|
+
system?: "salto" | "dormakaba";
|
|
83
87
|
systemOnline?: boolean;
|
|
84
88
|
enableApp?: boolean;
|
|
85
89
|
branding?: {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* This file was automatically generated by json-schema-to-typescript.
|
|
4
|
+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
|
|
5
|
+
* and run json-schema-to-typescript to regenerate this file.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface TimeSheet {
|
|
9
|
+
id?: string;
|
|
10
|
+
type?: "timeSheet";
|
|
11
|
+
userId: string;
|
|
12
|
+
day:
|
|
13
|
+
| string
|
|
14
|
+
| {
|
|
15
|
+
[k: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* If true, the time sheet is locked and cannot be modified
|
|
19
|
+
*/
|
|
20
|
+
locked?: boolean;
|
|
21
|
+
timeEntries?: {
|
|
22
|
+
id?: string;
|
|
23
|
+
discriminator: "working" | "driving" | "meeting";
|
|
24
|
+
start:
|
|
25
|
+
| string
|
|
26
|
+
| {
|
|
27
|
+
[k: string]: unknown;
|
|
28
|
+
};
|
|
29
|
+
end?:
|
|
30
|
+
| string
|
|
31
|
+
| {
|
|
32
|
+
[k: string]: unknown;
|
|
33
|
+
};
|
|
34
|
+
comment?: string;
|
|
35
|
+
ticketId?: string;
|
|
36
|
+
}[];
|
|
37
|
+
[k: string]: unknown;
|
|
38
|
+
}
|
|
@@ -63,7 +63,11 @@ export interface User {
|
|
|
63
63
|
*/
|
|
64
64
|
property: string;
|
|
65
65
|
role: "Guest" | "User" | "Manager" | "Administrator" | "SuperAdmin";
|
|
66
|
-
customPermissions?:
|
|
66
|
+
customPermissions?: {
|
|
67
|
+
discriminator?: "RoomControl.spaces" | "Concierge.timeTracking";
|
|
68
|
+
onlyIncludeIds?: string[];
|
|
69
|
+
[k: string]: unknown;
|
|
70
|
+
}[];
|
|
67
71
|
}[];
|
|
68
72
|
notes?: string[];
|
|
69
73
|
files?: MediaFile[];
|
|
@@ -161,13 +161,25 @@
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
|
-
"Concierge": {
|
|
164
|
+
"Concierge": {
|
|
165
|
+
"type": "object",
|
|
166
|
+
"properties": {
|
|
167
|
+
"timeTracking": {
|
|
168
|
+
"type": "boolean",
|
|
169
|
+
"default": false
|
|
170
|
+
},
|
|
171
|
+
"tipping": {
|
|
172
|
+
"type": "boolean",
|
|
173
|
+
"default": false
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
},
|
|
165
177
|
"DigitalKey": {
|
|
166
178
|
"type": "object",
|
|
167
179
|
"properties": {
|
|
168
180
|
"system": {
|
|
169
181
|
"type": "string",
|
|
170
|
-
"enum": ["salto", "
|
|
182
|
+
"enum": ["salto", "dormakaba"]
|
|
171
183
|
},
|
|
172
184
|
"systemOnline": {
|
|
173
185
|
"type": "boolean",
|