@ironcode/vas-lib 3.0.0-alpha.3 → 3.0.0-alpha.5
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/vas-base.model.d.ts +1 -1
- package/cjs/lib/entity/vas-base.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-base.model.js.map +1 -1
- package/cjs/lib/entity/vas-field.model.js +1 -1
- package/cjs/lib/entity/vas-field.model.js.map +1 -1
- package/cjs/lib/entity/vas-form.model.d.ts +1 -1
- package/cjs/lib/entity/vas-form.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-form.model.js.map +1 -1
- package/cjs/lib/entity/vas-job-copy.d.ts +12 -12
- package/cjs/lib/entity/vas-job-copy.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job-copy.js.map +1 -1
- package/cjs/lib/entity/vas-job.dto.d.ts +9 -3
- 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 +25 -13
- package/cjs/lib/entity/vas-job.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.model.js +139 -90
- package/cjs/lib/entity/vas-job.model.js.map +1 -1
- package/cjs/lib/utils/get-value-by-path.d.ts +1 -1
- package/cjs/lib/utils/get-value-by-path.d.ts.map +1 -1
- package/cjs/lib/utils/get-value-by-path.js +4 -4
- package/cjs/lib/utils/get-value-by-path.js.map +1 -1
- package/fesm2022/ironcode-vas-lib.mjs +157 -109
- package/fesm2022/ironcode-vas-lib.mjs.map +1 -1
- package/lib/entity/vas-base.model.d.ts +1 -1
- package/lib/entity/vas-form.model.d.ts +1 -1
- package/lib/entity/vas-job-copy.d.ts +12 -12
- package/lib/entity/vas-job.dto.d.ts +9 -3
- package/lib/entity/vas-job.model.d.ts +25 -13
- package/lib/utils/get-value-by-path.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1539,7 +1539,7 @@ class VasFieldModel extends VasJobDataModel {
|
|
|
1539
1539
|
* @return {VasFieldModel}
|
|
1540
1540
|
*/
|
|
1541
1541
|
static fromDto(fieldDto) {
|
|
1542
|
-
return new VasFieldModel(fieldDto.id || '', fieldDto.created || '', fieldDto.serverCreated || '', fieldDto.createdBy || '', fieldDto.modified || '', fieldDto.serverModified || '', fieldDto.modifiedBy || '', fieldDto.createdByName || '', fieldDto.modifiedByName || '', fieldDto.account || '', fieldDto.job || '', fieldDto.control || '', fieldDto.fieldJobPointers || [], fieldDto.value
|
|
1542
|
+
return new VasFieldModel(fieldDto.id || '', fieldDto.created || '', fieldDto.serverCreated || '', fieldDto.createdBy || '', fieldDto.modified || '', fieldDto.serverModified || '', fieldDto.modifiedBy || '', fieldDto.createdByName || '', fieldDto.modifiedByName || '', fieldDto.account || '', fieldDto.job || '', fieldDto.control || '', fieldDto.fieldJobPointers || [], fieldDto.value !== undefined ? fieldDto.value : null, fieldDto.version || 0, fieldDto.controlName || '', fieldDto.controlTitle || '', fieldDto.controlTypeName || '');
|
|
1543
1543
|
}
|
|
1544
1544
|
/**
|
|
1545
1545
|
* @return {VasFieldDto}
|
|
@@ -3311,12 +3311,12 @@ function getValueByPath(path, object) {
|
|
|
3311
3311
|
let scope = object === undefined ? null : object;
|
|
3312
3312
|
let index = 0;
|
|
3313
3313
|
const length = p.length;
|
|
3314
|
-
while (
|
|
3314
|
+
while (index < length) {
|
|
3315
|
+
if (scope === undefined || scope === null) {
|
|
3316
|
+
return undefined;
|
|
3317
|
+
}
|
|
3315
3318
|
scope = scope[p[index++]];
|
|
3316
3319
|
}
|
|
3317
|
-
if (!(index && index == length) || scope === null) {
|
|
3318
|
-
return undefined;
|
|
3319
|
-
}
|
|
3320
3320
|
return scope;
|
|
3321
3321
|
}
|
|
3322
3322
|
|
|
@@ -3794,22 +3794,6 @@ const getEmptyGeoLocation = () => ({
|
|
|
3794
3794
|
timestamp: ''
|
|
3795
3795
|
});
|
|
3796
3796
|
|
|
3797
|
-
/**
|
|
3798
|
-
* Try to parse the value as JSON if it looks like a JSON encoded string, return
|
|
3799
|
-
* the original value if it's not a JSON string or parsing fails.
|
|
3800
|
-
*/
|
|
3801
|
-
const tryJson = (value) => {
|
|
3802
|
-
if (typeof value === 'string' && ['{', '['].includes(value.substring(0, 1))) {
|
|
3803
|
-
try {
|
|
3804
|
-
return JSON.parse(value);
|
|
3805
|
-
}
|
|
3806
|
-
catch (e) {
|
|
3807
|
-
return value;
|
|
3808
|
-
}
|
|
3809
|
-
}
|
|
3810
|
-
return value;
|
|
3811
|
-
};
|
|
3812
|
-
|
|
3813
3797
|
/**
|
|
3814
3798
|
* Return true if the argument is a plain object {}, i.e. not an array, null.
|
|
3815
3799
|
*/
|
|
@@ -3818,16 +3802,10 @@ function isPlainObject(value) {
|
|
|
3818
3802
|
}
|
|
3819
3803
|
|
|
3820
3804
|
let jobStaticProps;
|
|
3821
|
-
function getJobStaticProperties() {
|
|
3822
|
-
if (jobStaticProps) {
|
|
3823
|
-
return jobStaticProps;
|
|
3824
|
-
}
|
|
3825
|
-
return jobStaticProps = new Set(Object.getOwnPropertyNames(VasJobModel.empty()));
|
|
3826
|
-
}
|
|
3827
3805
|
/**
|
|
3828
|
-
*
|
|
3806
|
+
* VasJobBaseModel
|
|
3829
3807
|
*/
|
|
3830
|
-
class
|
|
3808
|
+
class VasJobBaseModel extends VasRestrictedAccountObjectModel {
|
|
3831
3809
|
id;
|
|
3832
3810
|
created;
|
|
3833
3811
|
serverCreated;
|
|
@@ -3842,6 +3820,7 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
3842
3820
|
reference;
|
|
3843
3821
|
jobDate;
|
|
3844
3822
|
jobStatus;
|
|
3823
|
+
jobStatusLastUpdate;
|
|
3845
3824
|
jobType;
|
|
3846
3825
|
assigneeId;
|
|
3847
3826
|
formId;
|
|
@@ -3857,7 +3836,7 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
3857
3836
|
reports;
|
|
3858
3837
|
tasks;
|
|
3859
3838
|
instruction;
|
|
3860
|
-
constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup, reference, jobDate, jobStatus, jobType, assigneeId, formId, timeZoneOffset, pendingFields, childModified, version, geoLocation, files, fields, jobEmails, notes, reports, tasks, instruction) {
|
|
3839
|
+
constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup, reference, jobDate, jobStatus, jobStatusLastUpdate, jobType, assigneeId, formId, timeZoneOffset, pendingFields, childModified, version, geoLocation, files, fields, jobEmails, notes, reports, tasks, instruction) {
|
|
3861
3840
|
super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup);
|
|
3862
3841
|
this.id = id;
|
|
3863
3842
|
this.created = created;
|
|
@@ -3873,6 +3852,7 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
3873
3852
|
this.reference = reference;
|
|
3874
3853
|
this.jobDate = jobDate;
|
|
3875
3854
|
this.jobStatus = jobStatus;
|
|
3855
|
+
this.jobStatusLastUpdate = jobStatusLastUpdate;
|
|
3876
3856
|
this.jobType = jobType;
|
|
3877
3857
|
this.assigneeId = assigneeId;
|
|
3878
3858
|
this.formId = formId;
|
|
@@ -3902,49 +3882,8 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
3902
3882
|
if (jobStaticProps) {
|
|
3903
3883
|
return jobStaticProps;
|
|
3904
3884
|
}
|
|
3905
|
-
return jobStaticProps =
|
|
3906
|
-
|
|
3907
|
-
/**
|
|
3908
|
-
* @return {VasJobModel}
|
|
3909
|
-
*/
|
|
3910
|
-
static empty() {
|
|
3911
|
-
return new VasJobModel('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', moment().utcOffset(), 0, '', 0, getEmptyGeoLocation(), [], {}, [], [], [], [], null);
|
|
3912
|
-
}
|
|
3913
|
-
static fromDto(dto) {
|
|
3914
|
-
// we have changed the job model and stopped using the dynamic properties
|
|
3915
|
-
// from form group names to hold fields. Instead, we store a simple object
|
|
3916
|
-
// where the control name (minus the "fields." prefix) is the key, and the
|
|
3917
|
-
// field value is the value. However, we have to cater for data that may
|
|
3918
|
-
// be persisted in the old structure, or an API response where fields is an
|
|
3919
|
-
// array of VasFieldDto.
|
|
3920
|
-
// 1: if dto.fields is already an object, we use the existing value
|
|
3921
|
-
const fields = isPlainObject(dto.fields) ?
|
|
3922
|
-
dto.fields :
|
|
3923
|
-
{};
|
|
3924
|
-
// 2: if dto.fields is an array, we're handling a vas-rest response, we
|
|
3925
|
-
// iterate over the fields and update the fields object.
|
|
3926
|
-
Array.isArray(dto.fields) && dto.fields.forEach((field) => {
|
|
3927
|
-
fields[field.controlName.replace('fields.', '')] = tryJson(field.value);
|
|
3928
|
-
});
|
|
3929
|
-
// 3: if `fields` still has no keys, we're restoring a VasJobDto object that
|
|
3930
|
-
// was saved in the old "form-group" style, where dynamic keys are
|
|
3931
|
-
// derived from the form-group names. We'll iterate over those keys, and
|
|
3932
|
-
// update the `fields` object. Once this model is serialized back to a
|
|
3933
|
-
// dto, it will have the new shape.
|
|
3934
|
-
if (Object.keys(fields).length === 0) {
|
|
3935
|
-
Object
|
|
3936
|
-
.keys(dto)
|
|
3937
|
-
.filter(key => !getJobStaticProperties().has(key))
|
|
3938
|
-
.forEach(groupName => {
|
|
3939
|
-
Object
|
|
3940
|
-
.keys(dto[groupName])
|
|
3941
|
-
.forEach(controlName => {
|
|
3942
|
-
const cn = controlName.replace('fields.', '');
|
|
3943
|
-
fields[cn] = dto[groupName][controlName];
|
|
3944
|
-
});
|
|
3945
|
-
});
|
|
3946
|
-
}
|
|
3947
|
-
return 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().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.geoLocation || getEmptyGeoLocation(), dto.files || [], fields, dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
3885
|
+
return jobStaticProps =
|
|
3886
|
+
new Set(Object.getOwnPropertyNames(VasJobDocumentModel.empty()));
|
|
3948
3887
|
}
|
|
3949
3888
|
/**
|
|
3950
3889
|
* Returns an object describing how many attachments were added to this job
|
|
@@ -3985,39 +3924,6 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
3985
3924
|
getValueByPath(path = []) {
|
|
3986
3925
|
return getValueByPath(Array.isArray(path) ? path : path.split('.'), this);
|
|
3987
3926
|
}
|
|
3988
|
-
toDto() {
|
|
3989
|
-
return {
|
|
3990
|
-
id: this.id,
|
|
3991
|
-
created: this.created,
|
|
3992
|
-
createdBy: this.createdBy,
|
|
3993
|
-
modified: this.modified,
|
|
3994
|
-
modifiedBy: this.modifiedBy,
|
|
3995
|
-
serverCreated: this.serverCreated,
|
|
3996
|
-
serverModified: this.serverModified,
|
|
3997
|
-
createdByName: this.createdByName,
|
|
3998
|
-
modifiedByName: this.modifiedByName,
|
|
3999
|
-
account: this.account,
|
|
4000
|
-
accessGroup: this.accessGroup,
|
|
4001
|
-
reference: this.reference,
|
|
4002
|
-
jobDate: this.jobDate,
|
|
4003
|
-
jobStatus: this.jobStatus,
|
|
4004
|
-
jobType: this.jobType,
|
|
4005
|
-
assigneeId: this.assigneeId,
|
|
4006
|
-
formId: this.formId,
|
|
4007
|
-
timeZoneOffset: this.timeZoneOffset,
|
|
4008
|
-
pendingFields: this.pendingFields,
|
|
4009
|
-
childModified: this.childModified,
|
|
4010
|
-
version: this.version,
|
|
4011
|
-
geoLocation: this.geoLocation,
|
|
4012
|
-
files: this.files,
|
|
4013
|
-
fields: this.fields,
|
|
4014
|
-
jobEmails: this.jobEmails,
|
|
4015
|
-
notes: this.notes,
|
|
4016
|
-
reports: this.reports,
|
|
4017
|
-
tasks: this.tasks,
|
|
4018
|
-
instruction: this.instruction
|
|
4019
|
-
};
|
|
4020
|
-
}
|
|
4021
3927
|
/**
|
|
4022
3928
|
* This method will parse a syntax that allows us to build strings from the
|
|
4023
3929
|
* values of from the job model. For example if the job model was:
|
|
@@ -4076,8 +3982,8 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
4076
3982
|
if (objectKey === 'job') {
|
|
4077
3983
|
result = (this.getValueByPath(path) || '').toString();
|
|
4078
3984
|
}
|
|
4079
|
-
else if (objectKey === 'fields'
|
|
4080
|
-
result = (getValueByPath(
|
|
3985
|
+
else if (objectKey === 'fields') {
|
|
3986
|
+
result = (this.getValueByPath(['fields', ...path]) || '').toString();
|
|
4081
3987
|
}
|
|
4082
3988
|
else if (objectKey.length && options.objects && options.objects[objectKey] !== undefined) {
|
|
4083
3989
|
result = (getValueByPath(path, options.objects[objectKey]) || '').toString();
|
|
@@ -4139,6 +4045,132 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
4139
4045
|
]);
|
|
4140
4046
|
}
|
|
4141
4047
|
}
|
|
4048
|
+
class VasJobRelationalModel extends VasJobBaseModel {
|
|
4049
|
+
getValueByPath(path = []) {
|
|
4050
|
+
const parts = Array.isArray(path) ? path : path.split('.');
|
|
4051
|
+
if (parts[0] === 'fields') {
|
|
4052
|
+
return this.getFieldValueByPath(parts[1], parts.slice(2));
|
|
4053
|
+
}
|
|
4054
|
+
return getValueByPath(parts, this);
|
|
4055
|
+
}
|
|
4056
|
+
getFieldsMap() {
|
|
4057
|
+
return this.fields.reduce((p, c) => {
|
|
4058
|
+
p[c.controlName] = c.value;
|
|
4059
|
+
return p;
|
|
4060
|
+
}, {});
|
|
4061
|
+
}
|
|
4062
|
+
getFieldValueByPath(controlName, path) {
|
|
4063
|
+
for (const field of this.fields) {
|
|
4064
|
+
if (field.controlName === controlName) {
|
|
4065
|
+
if (path.length === 0) {
|
|
4066
|
+
return field.value;
|
|
4067
|
+
}
|
|
4068
|
+
if (field.value === null) {
|
|
4069
|
+
return path.length >= 1 ? undefined : null;
|
|
4070
|
+
}
|
|
4071
|
+
if (isPlainObject(field.value)) {
|
|
4072
|
+
return getValueByPath(path, field.value);
|
|
4073
|
+
}
|
|
4074
|
+
return undefined;
|
|
4075
|
+
}
|
|
4076
|
+
}
|
|
4077
|
+
return undefined;
|
|
4078
|
+
}
|
|
4079
|
+
static fromDto(dto) {
|
|
4080
|
+
if (dto.fields !== undefined && !Array.isArray(dto.fields)) {
|
|
4081
|
+
throw Error('fields must be an array');
|
|
4082
|
+
}
|
|
4083
|
+
return new VasJobRelationalModel(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.jobStatusLastUpdate || '', dto.jobType || '', dto.assigneeId || '', dto.formId || dto.lastForm || '', dto.timeZoneOffset || moment().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.geoLocation || getEmptyGeoLocation(), dto.files || [], (dto.fields || []).map(f => VasFieldModel.fromDto(f)), dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
4084
|
+
}
|
|
4085
|
+
static empty() {
|
|
4086
|
+
return new VasJobRelationalModel('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', moment().utcOffset(), 0, '', 0, getEmptyGeoLocation(), [], [], [], [], [], [], null);
|
|
4087
|
+
}
|
|
4088
|
+
toDto() {
|
|
4089
|
+
return {
|
|
4090
|
+
id: this.id,
|
|
4091
|
+
created: this.created,
|
|
4092
|
+
createdBy: this.createdBy,
|
|
4093
|
+
modified: this.modified,
|
|
4094
|
+
modifiedBy: this.modifiedBy,
|
|
4095
|
+
serverCreated: this.serverCreated,
|
|
4096
|
+
serverModified: this.serverModified,
|
|
4097
|
+
createdByName: this.createdByName,
|
|
4098
|
+
modifiedByName: this.modifiedByName,
|
|
4099
|
+
account: this.account,
|
|
4100
|
+
accessGroup: this.accessGroup,
|
|
4101
|
+
reference: this.reference,
|
|
4102
|
+
jobDate: this.jobDate,
|
|
4103
|
+
jobStatus: this.jobStatus,
|
|
4104
|
+
jobStatusLastUpdate: this.jobStatusLastUpdate,
|
|
4105
|
+
jobType: this.jobType,
|
|
4106
|
+
assigneeId: this.assigneeId,
|
|
4107
|
+
formId: this.formId,
|
|
4108
|
+
timeZoneOffset: this.timeZoneOffset,
|
|
4109
|
+
pendingFields: this.pendingFields,
|
|
4110
|
+
childModified: this.childModified,
|
|
4111
|
+
version: this.version,
|
|
4112
|
+
geoLocation: this.geoLocation,
|
|
4113
|
+
files: this.files,
|
|
4114
|
+
fields: this.fields.map(f => f.toDto()),
|
|
4115
|
+
jobEmails: this.jobEmails,
|
|
4116
|
+
notes: this.notes,
|
|
4117
|
+
reports: this.reports,
|
|
4118
|
+
tasks: this.tasks,
|
|
4119
|
+
instruction: this.instruction
|
|
4120
|
+
};
|
|
4121
|
+
}
|
|
4122
|
+
}
|
|
4123
|
+
class VasJobDocumentModel extends VasJobBaseModel {
|
|
4124
|
+
static fromRelationalDto(dto) {
|
|
4125
|
+
return new VasJobDocumentModel(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.jobStatusLastUpdate || '', dto.jobType || '', dto.assigneeId || '', dto.formId || dto.lastForm || '', dto.timeZoneOffset || moment().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.geoLocation || getEmptyGeoLocation(), dto.files || [], (dto.fields || []).reduce((p, c) => {
|
|
4126
|
+
p[c.controlName.replace('fields.', '')] = c.value;
|
|
4127
|
+
return p;
|
|
4128
|
+
}, {}), dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
4129
|
+
}
|
|
4130
|
+
static fromDto(dto) {
|
|
4131
|
+
if (dto.fields !== undefined && !isPlainObject(dto.fields)) {
|
|
4132
|
+
throw Error('fields must be an object');
|
|
4133
|
+
}
|
|
4134
|
+
return new VasJobDocumentModel(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.jobStatusLastUpdate || '', dto.jobType || '', dto.assigneeId || '', dto.formId || dto.lastForm || '', dto.timeZoneOffset || moment().utcOffset(), dto.pendingFields || 0, dto.childModified || '', dto.version || 0, dto.geoLocation || getEmptyGeoLocation(), dto.files || [], dto.fields || {}, dto.jobEmails || [], dto.notes || [], dto.reports || [], dto.tasks || [], dto.instruction || null);
|
|
4135
|
+
}
|
|
4136
|
+
static empty() {
|
|
4137
|
+
return new VasJobDocumentModel('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', moment().utcOffset(), 0, '', 0, getEmptyGeoLocation(), [], {}, [], [], [], [], null);
|
|
4138
|
+
}
|
|
4139
|
+
toDto() {
|
|
4140
|
+
return {
|
|
4141
|
+
id: this.id,
|
|
4142
|
+
created: this.created,
|
|
4143
|
+
createdBy: this.createdBy,
|
|
4144
|
+
modified: this.modified,
|
|
4145
|
+
modifiedBy: this.modifiedBy,
|
|
4146
|
+
serverCreated: this.serverCreated,
|
|
4147
|
+
serverModified: this.serverModified,
|
|
4148
|
+
createdByName: this.createdByName,
|
|
4149
|
+
modifiedByName: this.modifiedByName,
|
|
4150
|
+
account: this.account,
|
|
4151
|
+
accessGroup: this.accessGroup,
|
|
4152
|
+
reference: this.reference,
|
|
4153
|
+
jobDate: this.jobDate,
|
|
4154
|
+
jobStatus: this.jobStatus,
|
|
4155
|
+
jobStatusLastUpdate: this.jobStatusLastUpdate,
|
|
4156
|
+
jobType: this.jobType,
|
|
4157
|
+
assigneeId: this.assigneeId,
|
|
4158
|
+
formId: this.formId,
|
|
4159
|
+
timeZoneOffset: this.timeZoneOffset,
|
|
4160
|
+
pendingFields: this.pendingFields,
|
|
4161
|
+
childModified: this.childModified,
|
|
4162
|
+
version: this.version,
|
|
4163
|
+
geoLocation: this.geoLocation,
|
|
4164
|
+
files: this.files,
|
|
4165
|
+
fields: this.fields,
|
|
4166
|
+
jobEmails: this.jobEmails,
|
|
4167
|
+
notes: this.notes,
|
|
4168
|
+
reports: this.reports,
|
|
4169
|
+
tasks: this.tasks,
|
|
4170
|
+
instruction: this.instruction
|
|
4171
|
+
};
|
|
4172
|
+
}
|
|
4173
|
+
}
|
|
4142
4174
|
|
|
4143
4175
|
class VasLookupTypeModel extends VasAccountObjectModel {
|
|
4144
4176
|
id;
|
|
@@ -4772,9 +4804,25 @@ const omit = (obj, omitKey) => {
|
|
|
4772
4804
|
}, {});
|
|
4773
4805
|
};
|
|
4774
4806
|
|
|
4807
|
+
/**
|
|
4808
|
+
* Try to parse the value as JSON if it looks like a JSON encoded string, return
|
|
4809
|
+
* the original value if it's not a JSON string or parsing fails.
|
|
4810
|
+
*/
|
|
4811
|
+
const tryJson = (value) => {
|
|
4812
|
+
if (typeof value === 'string' && ['{', '['].includes(value.substring(0, 1))) {
|
|
4813
|
+
try {
|
|
4814
|
+
return JSON.parse(value);
|
|
4815
|
+
}
|
|
4816
|
+
catch (e) {
|
|
4817
|
+
return value;
|
|
4818
|
+
}
|
|
4819
|
+
}
|
|
4820
|
+
return value;
|
|
4821
|
+
};
|
|
4822
|
+
|
|
4775
4823
|
/**
|
|
4776
4824
|
* Generated bundle index. Do not edit.
|
|
4777
4825
|
*/
|
|
4778
4826
|
|
|
4779
|
-
export { EstimateControlValueModel, EstimateItemModel, EstimateModel, VasAccessGroupModel, VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasContactTypeModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormConfigModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobActionControlsStepModel, VasJobActionEmailFormStepModel, VasJobActionInstructionStepModel, VasJobActionModel, VasJobActionNotePromptStepModel, VasJobActionSetDatetimeStepModel, VasJobActionSetJobStatusStepModel, VasJobActionSetValueStepModel, VasJobActionWebhookStepModel, VasJobCopyModel, VasJobDataModel, VasJobEmailModel,
|
|
4827
|
+
export { EstimateControlValueModel, EstimateItemModel, EstimateModel, VasAccessGroupModel, VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasContactTypeModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormConfigModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobActionControlsStepModel, VasJobActionEmailFormStepModel, VasJobActionInstructionStepModel, VasJobActionModel, VasJobActionNotePromptStepModel, VasJobActionSetDatetimeStepModel, VasJobActionSetJobStatusStepModel, VasJobActionSetValueStepModel, VasJobActionWebhookStepModel, VasJobBaseModel, VasJobCopyModel, VasJobDataModel, VasJobDocumentModel, VasJobEmailModel, VasJobRelationalModel, VasJobStatusModel, VasJobTypeModel, VasLookupModel, VasLookupTypeModel, VasMembershipModel, VasNoteModel, VasReportLayoutModel, VasReportModel, VasReportRequestModel, VasRestrictedAccountObjectModel, VasTaskModel, VasTaskTypeModel, VasUserModel, VasVehicleModel, getEmptyGeoLocation, getValueByPath, isArrayString, isCameraControlValueV1, isCameraControlValueV2, isFileDto, isJobAutomationStep, isJobControlsStep, isJobEmailFormStep, isJobInstructionStep, isJobNotePromptStep, isJobSetDatetimeStep, isJobSetJobStatusStep, isJobSetValueStep, isJobWebhookStep, isNumeric, isPlainObject, omit, only, prepareFieldApiValue, stepModelFactory, tryJson };
|
|
4780
4828
|
//# sourceMappingURL=ironcode-vas-lib.mjs.map
|