@ironcode/vas-lib 1.8.0-alpha.7 → 1.8.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/cjs/lib/entity/index.d.ts +1 -0
- package/cjs/lib/entity/index.d.ts.map +1 -1
- package/cjs/lib/entity/index.js +1 -0
- package/cjs/lib/entity/index.js.map +1 -1
- package/cjs/lib/entity/vas-base.model.d.ts +1 -2
- package/cjs/lib/entity/vas-base.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-base.model.js +1 -1
- package/cjs/lib/entity/vas-base.model.js.map +1 -1
- package/cjs/lib/entity/vas-contact.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-contact.model.js +2 -0
- package/cjs/lib/entity/vas-contact.model.js.map +1 -1
- package/cjs/lib/entity/vas-control.model.d.ts +2 -1
- package/cjs/lib/entity/vas-control.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-control.model.js +21 -1
- package/cjs/lib/entity/vas-control.model.js.map +1 -1
- package/cjs/lib/entity/vas-field.model.d.ts +10 -9
- package/cjs/lib/entity/vas-field.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-field.model.js +43 -27
- package/cjs/lib/entity/vas-field.model.js.map +1 -1
- package/cjs/lib/entity/vas-file.model.d.ts +1 -0
- package/cjs/lib/entity/vas-file.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-file.model.js +10 -0
- package/cjs/lib/entity/vas-file.model.js.map +1 -1
- package/cjs/lib/entity/vas-form-config.dto.d.ts +2 -23
- package/cjs/lib/entity/vas-form-config.dto.d.ts.map +1 -1
- package/cjs/lib/entity/vas-form-config.dto.js.map +1 -1
- package/cjs/lib/entity/vas-form.model.d.ts +1 -0
- package/cjs/lib/entity/vas-form.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-form.model.js +12 -1
- package/cjs/lib/entity/vas-form.model.js.map +1 -1
- package/cjs/lib/entity/vas-group.model.d.ts +1 -0
- package/cjs/lib/entity/vas-group.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-group.model.js +11 -0
- package/cjs/lib/entity/vas-group.model.js.map +1 -1
- package/cjs/lib/entity/vas-job-action.dto.d.ts +67 -0
- package/cjs/lib/entity/vas-job-action.dto.d.ts.map +1 -0
- package/cjs/lib/entity/vas-job-action.dto.js +20 -0
- package/cjs/lib/entity/vas-job-action.dto.js.map +1 -0
- package/cjs/lib/entity/vas-job-email.model.d.ts +2 -0
- package/cjs/lib/entity/vas-job-email.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job-email.model.js +15 -9
- package/cjs/lib/entity/vas-job-email.model.js.map +1 -1
- package/cjs/lib/entity/vas-job.dto.d.ts +10 -2
- package/cjs/lib/entity/vas-job.dto.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.dto.js.map +1 -1
- package/cjs/lib/entity/vas-job.model.d.ts +13 -4
- package/cjs/lib/entity/vas-job.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.model.js +46 -16
- package/cjs/lib/entity/vas-job.model.js.map +1 -1
- package/cjs/lib/entity/vas-lookup.model.d.ts +1 -0
- package/cjs/lib/entity/vas-lookup.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-lookup.model.js +13 -1
- package/cjs/lib/entity/vas-lookup.model.js.map +1 -1
- package/cjs/lib/entity/vas-note.model.d.ts +1 -0
- package/cjs/lib/entity/vas-note.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-note.model.js +9 -0
- package/cjs/lib/entity/vas-note.model.js.map +1 -1
- package/cjs/lib/entity/vas-report.dto.d.ts +1 -1
- package/cjs/lib/entity/vas-report.dto.d.ts.map +1 -1
- package/cjs/lib/entity/vas-report.dto.js.map +1 -1
- package/cjs/lib/entity/vas-report.model.d.ts +5 -2
- package/cjs/lib/entity/vas-report.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-report.model.js +15 -4
- package/cjs/lib/entity/vas-report.model.js.map +1 -1
- package/cjs/lib/entity/vas-task.model.d.ts +1 -0
- package/cjs/lib/entity/vas-task.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-task.model.js +12 -0
- package/cjs/lib/entity/vas-task.model.js.map +1 -1
- package/cjs/lib/entity/vas-vehicle.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-vehicle.model.js.map +1 -1
- package/fesm2022/ironcode-vas-lib.mjs +222 -62
- package/fesm2022/ironcode-vas-lib.mjs.map +1 -1
- package/lib/entity/index.d.ts +1 -0
- package/lib/entity/vas-base.model.d.ts +1 -2
- package/lib/entity/vas-control.model.d.ts +2 -1
- package/lib/entity/vas-field.model.d.ts +10 -9
- package/lib/entity/vas-file.model.d.ts +1 -0
- package/lib/entity/vas-form-config.dto.d.ts +2 -23
- package/lib/entity/vas-form.model.d.ts +1 -0
- package/lib/entity/vas-group.model.d.ts +1 -0
- package/lib/entity/vas-job-action.dto.d.ts +66 -0
- package/lib/entity/vas-job-email.model.d.ts +2 -0
- package/lib/entity/vas-job.dto.d.ts +10 -2
- package/lib/entity/vas-job.model.d.ts +13 -4
- package/lib/entity/vas-lookup.model.d.ts +1 -0
- package/lib/entity/vas-note.model.d.ts +1 -0
- package/lib/entity/vas-report.dto.d.ts +1 -1
- package/lib/entity/vas-report.model.d.ts +5 -2
- package/lib/entity/vas-task.model.d.ts +1 -0
- package/package.json +1 -1
|
@@ -47,14 +47,14 @@ class VasBaseModel {
|
|
|
47
47
|
}
|
|
48
48
|
static create(user, values = {}) {
|
|
49
49
|
return this.fromDto({
|
|
50
|
-
...values,
|
|
51
50
|
id: UUID.UUID(),
|
|
52
51
|
created: moment().toISOString(),
|
|
53
52
|
modified: moment().toISOString(),
|
|
54
53
|
createdBy: user?.id || '',
|
|
55
54
|
createdByName: user?.name || '',
|
|
56
55
|
modifiedBy: user?.id || '',
|
|
57
|
-
modifiedByName: user?.name || ''
|
|
56
|
+
modifiedByName: user?.name || '',
|
|
57
|
+
...values,
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -526,6 +526,8 @@ class VasContactModel extends VasRestrictedAccountObjectModel {
|
|
|
526
526
|
}
|
|
527
527
|
static toApiPatchDto(contact) {
|
|
528
528
|
return only(contact, [
|
|
529
|
+
'created',
|
|
530
|
+
'modified',
|
|
529
531
|
'accessGroup',
|
|
530
532
|
'contactType',
|
|
531
533
|
'name',
|
|
@@ -731,7 +733,9 @@ class VasControlModel extends VasRestrictedAccountObjectModel {
|
|
|
731
733
|
};
|
|
732
734
|
return new VasControlModel(
|
|
733
735
|
// eslint-disable-next-line new-cap
|
|
734
|
-
dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', handleControlType(dto.controlType), dto.group || '', dto.validators || [], dto.name || '', dto.title || '', dto.linkable || false, dto.sequence || 0, dto.description || '', dto.defaultValue || '',
|
|
736
|
+
dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', handleControlType(dto.controlType), dto.group || '', dto.validators || [], dto.name || '', dto.title || '', dto.linkable || false, dto.sequence || 0, dto.description || '', dto.defaultValue || '', typeof dto.config === 'string' ?
|
|
737
|
+
JSON.parse(dto.config || '{}') :
|
|
738
|
+
dto.config, dto.descriptionImage || '', dto.portalEnabled || false);
|
|
735
739
|
}
|
|
736
740
|
/**
|
|
737
741
|
* @param {any} value the value to be parsed
|
|
@@ -794,6 +798,23 @@ class VasControlModel extends VasRestrictedAccountObjectModel {
|
|
|
794
798
|
linkable: this.linkable
|
|
795
799
|
};
|
|
796
800
|
}
|
|
801
|
+
static toApiPatchDto(item) {
|
|
802
|
+
return only(item, [
|
|
803
|
+
'created',
|
|
804
|
+
'modified',
|
|
805
|
+
'title',
|
|
806
|
+
'name',
|
|
807
|
+
'portalEnabled',
|
|
808
|
+
'sequence',
|
|
809
|
+
'description',
|
|
810
|
+
'defaultValue',
|
|
811
|
+
'config',
|
|
812
|
+
'controlType',
|
|
813
|
+
'group',
|
|
814
|
+
'validators',
|
|
815
|
+
'linkable',
|
|
816
|
+
]);
|
|
817
|
+
}
|
|
797
818
|
}
|
|
798
819
|
|
|
799
820
|
/**
|
|
@@ -827,6 +848,33 @@ class VasJobDataModel extends VasAccountObjectModel {
|
|
|
827
848
|
}
|
|
828
849
|
}
|
|
829
850
|
|
|
851
|
+
/**
|
|
852
|
+
* Prepares the value to be sent to the API. The api will only accept strings,
|
|
853
|
+
* numbers and booleans, thus if we have an array or object, we need to JSON
|
|
854
|
+
* encode it
|
|
855
|
+
* @param {VasFieldDto} value
|
|
856
|
+
* @return {string | number | boolean}
|
|
857
|
+
* @protected
|
|
858
|
+
*/
|
|
859
|
+
const prepareFieldApiValue = (value) => {
|
|
860
|
+
switch (typeof value) {
|
|
861
|
+
case 'object': {
|
|
862
|
+
return JSON.stringify(value);
|
|
863
|
+
}
|
|
864
|
+
case 'boolean': {
|
|
865
|
+
return value;
|
|
866
|
+
}
|
|
867
|
+
case 'string': {
|
|
868
|
+
return value;
|
|
869
|
+
}
|
|
870
|
+
case 'number': {
|
|
871
|
+
return value;
|
|
872
|
+
}
|
|
873
|
+
default: {
|
|
874
|
+
return '';
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
};
|
|
830
878
|
/**
|
|
831
879
|
* VasFieldModel
|
|
832
880
|
*/
|
|
@@ -909,35 +957,22 @@ class VasFieldModel extends VasJobDataModel {
|
|
|
909
957
|
return {
|
|
910
958
|
...super.toApiDto(),
|
|
911
959
|
control: this.control,
|
|
912
|
-
value:
|
|
960
|
+
value: prepareFieldApiValue(this.value)
|
|
913
961
|
};
|
|
914
962
|
}
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
*/
|
|
923
|
-
prepareApiValue(value) {
|
|
924
|
-
switch (typeof value) {
|
|
925
|
-
case 'object': {
|
|
926
|
-
return JSON.stringify(value);
|
|
927
|
-
}
|
|
928
|
-
case 'boolean': {
|
|
929
|
-
return value;
|
|
930
|
-
}
|
|
931
|
-
case 'string': {
|
|
932
|
-
return value;
|
|
933
|
-
}
|
|
934
|
-
case 'number': {
|
|
935
|
-
return value;
|
|
936
|
-
}
|
|
937
|
-
default: {
|
|
938
|
-
return '';
|
|
939
|
-
}
|
|
963
|
+
static toApiPatchDto(item) {
|
|
964
|
+
const clone = JSON.parse(JSON.stringify(item));
|
|
965
|
+
if (clone.value !== undefined && clone.value !== null) {
|
|
966
|
+
clone.value = prepareFieldApiValue(clone.value);
|
|
967
|
+
}
|
|
968
|
+
else {
|
|
969
|
+
clone.value = '';
|
|
940
970
|
}
|
|
971
|
+
return only(clone, [
|
|
972
|
+
'created',
|
|
973
|
+
'modified',
|
|
974
|
+
'value'
|
|
975
|
+
]);
|
|
941
976
|
}
|
|
942
977
|
}
|
|
943
978
|
|
|
@@ -1093,6 +1128,15 @@ class VasFileModel extends VasJobDataModel {
|
|
|
1093
1128
|
}
|
|
1094
1129
|
return value;
|
|
1095
1130
|
}
|
|
1131
|
+
static toApiPatchDto(item) {
|
|
1132
|
+
return only(item, [
|
|
1133
|
+
'created',
|
|
1134
|
+
'modified',
|
|
1135
|
+
'name',
|
|
1136
|
+
'sequence',
|
|
1137
|
+
'config'
|
|
1138
|
+
]);
|
|
1139
|
+
}
|
|
1096
1140
|
}
|
|
1097
1141
|
|
|
1098
1142
|
/**
|
|
@@ -1209,6 +1253,16 @@ class VasGroupModel extends VasRestrictedAccountObjectModel {
|
|
|
1209
1253
|
includeInSummary: this.includeInSummary
|
|
1210
1254
|
};
|
|
1211
1255
|
}
|
|
1256
|
+
static toApiPatchDto(item) {
|
|
1257
|
+
return only(item, [
|
|
1258
|
+
'created',
|
|
1259
|
+
'modified',
|
|
1260
|
+
'name',
|
|
1261
|
+
'title',
|
|
1262
|
+
'sequence',
|
|
1263
|
+
'includeInSummary'
|
|
1264
|
+
]);
|
|
1265
|
+
}
|
|
1212
1266
|
}
|
|
1213
1267
|
|
|
1214
1268
|
class VasFormConfigModel {
|
|
@@ -1459,9 +1513,20 @@ class VasFormModel extends VasRestrictedAccountObjectModel {
|
|
|
1459
1513
|
...super.toApiDto(options),
|
|
1460
1514
|
title: this.title || '~',
|
|
1461
1515
|
description: this.description || '~',
|
|
1462
|
-
jobType: this.jobType
|
|
1516
|
+
jobType: this.jobType,
|
|
1517
|
+
config: this.config.toJsonString()
|
|
1463
1518
|
};
|
|
1464
1519
|
}
|
|
1520
|
+
static toApiPatchDto(item) {
|
|
1521
|
+
return only(item, [
|
|
1522
|
+
'created',
|
|
1523
|
+
'modified',
|
|
1524
|
+
'title',
|
|
1525
|
+
'description',
|
|
1526
|
+
'jobType',
|
|
1527
|
+
'config'
|
|
1528
|
+
]);
|
|
1529
|
+
}
|
|
1465
1530
|
}
|
|
1466
1531
|
|
|
1467
1532
|
var VasInvitationTypeEnum;
|
|
@@ -1639,6 +1704,14 @@ class VasNoteModel extends VasJobDataModel {
|
|
|
1639
1704
|
modified: this.modified
|
|
1640
1705
|
};
|
|
1641
1706
|
}
|
|
1707
|
+
static toApiPatchDto(item) {
|
|
1708
|
+
return only(item, [
|
|
1709
|
+
'created',
|
|
1710
|
+
'modified',
|
|
1711
|
+
'content',
|
|
1712
|
+
'sensitive'
|
|
1713
|
+
]);
|
|
1714
|
+
}
|
|
1642
1715
|
}
|
|
1643
1716
|
|
|
1644
1717
|
/**
|
|
@@ -1714,7 +1787,7 @@ class VasReportModel extends VasJobDataModel {
|
|
|
1714
1787
|
modifiedByName;
|
|
1715
1788
|
account;
|
|
1716
1789
|
job;
|
|
1717
|
-
|
|
1790
|
+
reportLayout;
|
|
1718
1791
|
title;
|
|
1719
1792
|
sendEmail;
|
|
1720
1793
|
message;
|
|
@@ -1723,7 +1796,7 @@ class VasReportModel extends VasJobDataModel {
|
|
|
1723
1796
|
succeeded;
|
|
1724
1797
|
attempts;
|
|
1725
1798
|
notificationId;
|
|
1726
|
-
constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, job,
|
|
1799
|
+
constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, job, reportLayout, title, sendEmail, message, attempted, completed, succeeded, attempts, notificationId) {
|
|
1727
1800
|
super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, job);
|
|
1728
1801
|
this.id = id;
|
|
1729
1802
|
this.created = created;
|
|
@@ -1736,7 +1809,7 @@ class VasReportModel extends VasJobDataModel {
|
|
|
1736
1809
|
this.modifiedByName = modifiedByName;
|
|
1737
1810
|
this.account = account;
|
|
1738
1811
|
this.job = job;
|
|
1739
|
-
this.
|
|
1812
|
+
this.reportLayout = reportLayout;
|
|
1740
1813
|
this.title = title;
|
|
1741
1814
|
this.sendEmail = sendEmail;
|
|
1742
1815
|
this.message = message;
|
|
@@ -1750,7 +1823,7 @@ class VasReportModel extends VasJobDataModel {
|
|
|
1750
1823
|
return VasReportModel.fromDto({});
|
|
1751
1824
|
}
|
|
1752
1825
|
static fromDto(dto) {
|
|
1753
|
-
return new VasReportModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.job || '', dto.
|
|
1826
|
+
return new VasReportModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.job || '', dto.reportLayout || '', dto.title || '', dto.sendEmail || '', dto.message || '', dto.attempted || '', dto.completed || '', dto.succeeded || '', dto.attempts || 0, dto.notificationId || '');
|
|
1754
1827
|
}
|
|
1755
1828
|
toDto() {
|
|
1756
1829
|
return {
|
|
@@ -1765,7 +1838,7 @@ class VasReportModel extends VasJobDataModel {
|
|
|
1765
1838
|
modifiedByName: this.modifiedByName,
|
|
1766
1839
|
account: this.account,
|
|
1767
1840
|
job: this.job,
|
|
1768
|
-
|
|
1841
|
+
reportLayout: this.reportLayout,
|
|
1769
1842
|
title: this.title,
|
|
1770
1843
|
sendEmail: this.sendEmail,
|
|
1771
1844
|
message: this.message,
|
|
@@ -1776,6 +1849,20 @@ class VasReportModel extends VasJobDataModel {
|
|
|
1776
1849
|
notificationId: this.notificationId,
|
|
1777
1850
|
};
|
|
1778
1851
|
}
|
|
1852
|
+
toApiDto(options) {
|
|
1853
|
+
return {
|
|
1854
|
+
...super.toApiDto(options),
|
|
1855
|
+
job: this.job,
|
|
1856
|
+
reportLayout: this.reportLayout
|
|
1857
|
+
};
|
|
1858
|
+
}
|
|
1859
|
+
static toApiPatchDto(item) {
|
|
1860
|
+
return only(item, [
|
|
1861
|
+
'created',
|
|
1862
|
+
'modified',
|
|
1863
|
+
'portalVisible',
|
|
1864
|
+
]);
|
|
1865
|
+
}
|
|
1779
1866
|
}
|
|
1780
1867
|
|
|
1781
1868
|
/**
|
|
@@ -2088,25 +2175,30 @@ class VasJobEmailModel extends VasJobDataModel {
|
|
|
2088
2175
|
}
|
|
2089
2176
|
toApiDto(options) {
|
|
2090
2177
|
return {
|
|
2091
|
-
id: this.id,
|
|
2178
|
+
// id: this.id,
|
|
2092
2179
|
created: this.created,
|
|
2093
|
-
createdBy: this.createdBy,
|
|
2094
2180
|
modified: this.modified,
|
|
2095
|
-
account: this.account,
|
|
2096
|
-
job: this.job,
|
|
2097
2181
|
body: this.body,
|
|
2098
2182
|
cc: this.cc,
|
|
2099
2183
|
files: this.files,
|
|
2100
|
-
message: this.message,
|
|
2101
2184
|
recipients: this.recipients,
|
|
2102
|
-
replyTo: this.replyTo,
|
|
2103
2185
|
reports: this.reports,
|
|
2104
|
-
sender: this.sender,
|
|
2105
|
-
sentTime: this.sentTime,
|
|
2106
2186
|
subject: this.subject,
|
|
2107
|
-
succeeded: this.succeeded,
|
|
2108
2187
|
};
|
|
2109
2188
|
}
|
|
2189
|
+
static toApiPatchDto(item) {
|
|
2190
|
+
return only(item, [
|
|
2191
|
+
'created',
|
|
2192
|
+
'modified',
|
|
2193
|
+
'body',
|
|
2194
|
+
'cc',
|
|
2195
|
+
'files',
|
|
2196
|
+
'message',
|
|
2197
|
+
'recipients',
|
|
2198
|
+
'reports',
|
|
2199
|
+
'subject',
|
|
2200
|
+
]);
|
|
2201
|
+
}
|
|
2110
2202
|
}
|
|
2111
2203
|
|
|
2112
2204
|
/**
|
|
@@ -2214,12 +2306,16 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
2214
2306
|
pendingFields;
|
|
2215
2307
|
childModified;
|
|
2216
2308
|
version;
|
|
2217
|
-
fields;
|
|
2218
|
-
files;
|
|
2219
2309
|
createdByDisplayName;
|
|
2220
2310
|
modifiedByDisplayName;
|
|
2221
2311
|
geoLocation;
|
|
2222
|
-
|
|
2312
|
+
files;
|
|
2313
|
+
fields;
|
|
2314
|
+
jobEmails;
|
|
2315
|
+
notes;
|
|
2316
|
+
reports;
|
|
2317
|
+
tasks;
|
|
2318
|
+
constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup, reference, jobDate, jobStatus, jobType, assigneeId, formId, timeZoneOffset, pendingFields, childModified, version, createdByDisplayName, modifiedByDisplayName, geoLocation, files, fields, jobEmails, notes, reports, tasks) {
|
|
2223
2319
|
super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup);
|
|
2224
2320
|
this.id = id;
|
|
2225
2321
|
this.created = created;
|
|
@@ -2242,11 +2338,15 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
2242
2338
|
this.pendingFields = pendingFields;
|
|
2243
2339
|
this.childModified = childModified;
|
|
2244
2340
|
this.version = version;
|
|
2245
|
-
this.fields = fields;
|
|
2246
|
-
this.files = files;
|
|
2247
2341
|
this.createdByDisplayName = createdByDisplayName;
|
|
2248
2342
|
this.modifiedByDisplayName = modifiedByDisplayName;
|
|
2249
2343
|
this.geoLocation = geoLocation;
|
|
2344
|
+
this.files = files;
|
|
2345
|
+
this.fields = fields;
|
|
2346
|
+
this.jobEmails = jobEmails;
|
|
2347
|
+
this.notes = notes;
|
|
2348
|
+
this.reports = reports;
|
|
2349
|
+
this.tasks = tasks;
|
|
2250
2350
|
}
|
|
2251
2351
|
/**
|
|
2252
2352
|
* Returns this with the dynamic interface
|
|
@@ -2275,10 +2375,10 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
2275
2375
|
* @return {VasJobModel}
|
|
2276
2376
|
*/
|
|
2277
2377
|
static empty() {
|
|
2278
|
-
return new VasJobModel('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', moment$1().utcOffset(), 0, '', 0, [], [],
|
|
2378
|
+
return new VasJobModel('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', moment$1().utcOffset(), 0, '', 0, '', '', getEmptyGeoLocation(), [], [], [], [], [], []);
|
|
2279
2379
|
}
|
|
2280
2380
|
static fromDto(dto) {
|
|
2281
|
-
const model = new VasJobModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', dto.reference || '', dto.jobDate || '', dto.jobStatus || '', dto.jobType || '', dto.assigneeId || '', dto.formId || dto.lastForm || '', dto.timeZoneOffset || moment$1().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.fields || [], dto.
|
|
2381
|
+
const model = new VasJobModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', dto.reference || '', dto.jobDate || '', dto.jobStatus || '', dto.jobType || '', dto.assigneeId || '', dto.formId || dto.lastForm || '', dto.timeZoneOffset || moment$1().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.createdByDisplayName || '', dto.modifiedByDisplayName || '', dto.geoLocation || getEmptyGeoLocation(), dto.files || [], dto.fields || [], dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || []);
|
|
2282
2382
|
const emptyKeys = model.staticProperties;
|
|
2283
2383
|
Object
|
|
2284
2384
|
.keys(dto)
|
|
@@ -2293,7 +2393,7 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
2293
2393
|
*
|
|
2294
2394
|
*/
|
|
2295
2395
|
static fromRelational(dto, form) {
|
|
2296
|
-
const model = new VasJobModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', dto.reference || '', dto.jobDate || '', dto.jobStatus || '', dto.jobType || '', dto.assigneeId || '', dto.formId || '', dto.timeZoneOffset || moment$1().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.fields || [], dto.
|
|
2396
|
+
const model = new VasJobModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', dto.reference || '', dto.jobDate || '', dto.jobStatus || '', dto.jobType || '', dto.assigneeId || '', dto.formId || '', dto.timeZoneOffset || moment$1().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.createdByDisplayName || '', dto.modifiedByDisplayName || '', dto.geoLocation || getEmptyGeoLocation(), dto.files || [], dto.fields || [], dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || []);
|
|
2297
2397
|
form.groups
|
|
2298
2398
|
.forEach(group => {
|
|
2299
2399
|
group.controls
|
|
@@ -2577,11 +2677,15 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
2577
2677
|
pendingFields: this.pendingFields,
|
|
2578
2678
|
childModified: this.childModified,
|
|
2579
2679
|
version: this.version,
|
|
2580
|
-
fields: this.fields,
|
|
2581
|
-
files: this.files,
|
|
2582
2680
|
createdByDisplayName: this.createdByDisplayName,
|
|
2583
2681
|
modifiedByDisplayName: this.modifiedByDisplayName,
|
|
2584
|
-
geoLocation: this.geoLocation
|
|
2682
|
+
geoLocation: this.geoLocation,
|
|
2683
|
+
files: this.files,
|
|
2684
|
+
fields: this.fields,
|
|
2685
|
+
jobEmails: this.jobEmails,
|
|
2686
|
+
notes: this.notes,
|
|
2687
|
+
reports: this.reports,
|
|
2688
|
+
tasks: this.tasks,
|
|
2585
2689
|
};
|
|
2586
2690
|
}
|
|
2587
2691
|
const dto = {};
|
|
@@ -2621,6 +2725,7 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
2621
2725
|
if (!value || typeof value !== 'string') {
|
|
2622
2726
|
return '';
|
|
2623
2727
|
}
|
|
2728
|
+
const fields = this.getFields2();
|
|
2624
2729
|
return value.replace(/({[^}]*})/g, (match, token) => {
|
|
2625
2730
|
const syntax = token.substring(1, token.length - 1);
|
|
2626
2731
|
let [key, filter] = syntax.split('|');
|
|
@@ -2647,7 +2752,7 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
2647
2752
|
result = (this.getValueByPath(path) || '').toString();
|
|
2648
2753
|
}
|
|
2649
2754
|
else if (objectKey === 'fields') {
|
|
2650
|
-
result = (getValueByPath(['fields.' + path.shift(), ...path],
|
|
2755
|
+
result = (getValueByPath(['fields.' + path.shift(), ...path], fields) || '').toString();
|
|
2651
2756
|
}
|
|
2652
2757
|
else if (objectKey.length) {
|
|
2653
2758
|
if (options.objects) {
|
|
@@ -2671,9 +2776,14 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
2671
2776
|
if (filterName && result) {
|
|
2672
2777
|
switch (filterName) {
|
|
2673
2778
|
case 'date': {
|
|
2674
|
-
|
|
2675
|
-
.
|
|
2676
|
-
|
|
2779
|
+
if (!options.timeZoneOffset) {
|
|
2780
|
+
return moment$1(result).format(filterArg || '');
|
|
2781
|
+
}
|
|
2782
|
+
else {
|
|
2783
|
+
return moment$1(result)
|
|
2784
|
+
.utcOffset(options.timeZoneOffset)
|
|
2785
|
+
.format(filterArg || '');
|
|
2786
|
+
}
|
|
2677
2787
|
}
|
|
2678
2788
|
default: {
|
|
2679
2789
|
console.warn('unknown filter %s', filterName);
|
|
@@ -2701,8 +2811,36 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
2701
2811
|
lastForm: this.formId || '~'
|
|
2702
2812
|
};
|
|
2703
2813
|
}
|
|
2814
|
+
static toApiPatchDto(item) {
|
|
2815
|
+
return only(item, [
|
|
2816
|
+
'created',
|
|
2817
|
+
'modified',
|
|
2818
|
+
'reference',
|
|
2819
|
+
'jobDate',
|
|
2820
|
+
'jobType',
|
|
2821
|
+
'accessGroup',
|
|
2822
|
+
'jobStatus',
|
|
2823
|
+
'assigneeId',
|
|
2824
|
+
'timeZoneOffset',
|
|
2825
|
+
'pendingFields',
|
|
2826
|
+
'lastForm'
|
|
2827
|
+
]);
|
|
2828
|
+
}
|
|
2704
2829
|
}
|
|
2705
2830
|
|
|
2831
|
+
const isJobAutomationStep = (step) => {
|
|
2832
|
+
return step && step.type === 'automation';
|
|
2833
|
+
};
|
|
2834
|
+
const isJobControlsStep = (step) => {
|
|
2835
|
+
return step && step.type === 'controls';
|
|
2836
|
+
};
|
|
2837
|
+
const isJobEmailFormStep = (step) => {
|
|
2838
|
+
return step && step.type === 'email-form';
|
|
2839
|
+
};
|
|
2840
|
+
const isJobSetJobStatusStep = (step) => {
|
|
2841
|
+
return step && step.type === 'set-job-status';
|
|
2842
|
+
};
|
|
2843
|
+
|
|
2706
2844
|
/**
|
|
2707
2845
|
* VasLookupModel
|
|
2708
2846
|
*/
|
|
@@ -2772,12 +2910,23 @@ class VasLookupModel extends VasRestrictedAccountObjectModel {
|
|
|
2772
2910
|
toApiDto(options) {
|
|
2773
2911
|
return {
|
|
2774
2912
|
...super.toApiDto(options),
|
|
2775
|
-
content: this.content || '
|
|
2913
|
+
content: this.content || '',
|
|
2776
2914
|
lookupType: this.lookupType || '~',
|
|
2777
2915
|
sequence: Number.isSafeInteger(this.sequence) || 0,
|
|
2778
|
-
title: this.title || '
|
|
2916
|
+
title: this.title || '',
|
|
2779
2917
|
};
|
|
2780
2918
|
}
|
|
2919
|
+
static toApiPatchDto(item) {
|
|
2920
|
+
return only(item, [
|
|
2921
|
+
'created',
|
|
2922
|
+
'modified',
|
|
2923
|
+
'accessGroup',
|
|
2924
|
+
'lookupType',
|
|
2925
|
+
'title',
|
|
2926
|
+
'content',
|
|
2927
|
+
'sequence'
|
|
2928
|
+
]);
|
|
2929
|
+
}
|
|
2781
2930
|
}
|
|
2782
2931
|
|
|
2783
2932
|
/**
|
|
@@ -3034,6 +3183,17 @@ class VasTaskModel extends VasJobDataModel {
|
|
|
3034
3183
|
title: this.title,
|
|
3035
3184
|
};
|
|
3036
3185
|
}
|
|
3186
|
+
static toApiPatchDto(item) {
|
|
3187
|
+
return only(item, [
|
|
3188
|
+
'created',
|
|
3189
|
+
'modified',
|
|
3190
|
+
'assignee',
|
|
3191
|
+
'done',
|
|
3192
|
+
'dueDate',
|
|
3193
|
+
'taskType',
|
|
3194
|
+
'title'
|
|
3195
|
+
]);
|
|
3196
|
+
}
|
|
3037
3197
|
}
|
|
3038
3198
|
|
|
3039
3199
|
class VasVehicleModel extends VasAccountObjectModel {
|
|
@@ -3122,5 +3282,5 @@ class VasVehicleModel extends VasAccountObjectModel {
|
|
|
3122
3282
|
* Generated bundle index. Do not edit.
|
|
3123
3283
|
*/
|
|
3124
3284
|
|
|
3125
|
-
export { VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormConfigModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobDataModel, VasJobEmailModel, VasJobModel, VasLookupModel, VasMembershipModel, VasNoteModel, VasReportLayoutModel, VasReportModel, VasReportRequestModel, VasRestrictedAccountObjectModel, VasTaskModel, VasUserModel, VasVehicleModel, getEmptyGeoLocation, isCameraControlValueV1, isFileDto };
|
|
3285
|
+
export { VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormConfigModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobDataModel, VasJobEmailModel, VasJobModel, VasLookupModel, VasMembershipModel, VasNoteModel, VasReportLayoutModel, VasReportModel, VasReportRequestModel, VasRestrictedAccountObjectModel, VasTaskModel, VasUserModel, VasVehicleModel, getEmptyGeoLocation, isCameraControlValueV1, isFileDto, isJobAutomationStep, isJobControlsStep, isJobEmailFormStep, isJobSetJobStatusStep, prepareFieldApiValue };
|
|
3126
3286
|
//# sourceMappingURL=ironcode-vas-lib.mjs.map
|