@ironcode/vas-lib 0.0.33 → 0.0.34
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-field.dto.d.ts +2 -1
- package/cjs/lib/entity/vas-field.dto.d.ts.map +1 -1
- package/cjs/lib/entity/vas-field.dto.js.map +1 -1
- package/cjs/lib/entity/vas-job.dto.d.ts +2 -0
- 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 +27 -24
- package/cjs/lib/entity/vas-job.model.d.ts.map +1 -1
- package/cjs/lib/entity/vas-job.model.js +31 -27
- package/cjs/lib/entity/vas-job.model.js.map +1 -1
- package/cjs/lib/model/geo-location.d.ts +13 -0
- package/cjs/lib/model/geo-location.d.ts.map +1 -0
- package/cjs/lib/model/geo-location.js +16 -0
- package/cjs/lib/model/geo-location.js.map +1 -0
- package/cjs/lib/model/index.d.ts +1 -0
- package/cjs/lib/model/index.d.ts.map +1 -1
- package/cjs/lib/model/index.js +1 -0
- package/cjs/lib/model/index.js.map +1 -1
- package/cjs/package.json +4 -4
- package/esm2020/lib/entity/vas-field.dto.mjs +1 -1
- package/esm2020/lib/entity/vas-job.dto.mjs +1 -1
- package/esm2020/lib/entity/vas-job.model.mjs +32 -28
- package/esm2020/lib/model/geo-location.mjs +12 -0
- package/esm2020/lib/model/index.mjs +2 -1
- package/fesm2015/ironcode-vas-lib.mjs +43 -28
- package/fesm2015/ironcode-vas-lib.mjs.map +1 -1
- package/fesm2020/ironcode-vas-lib.mjs +43 -28
- package/fesm2020/ironcode-vas-lib.mjs.map +1 -1
- package/lib/entity/vas-field.dto.d.ts +2 -1
- package/lib/entity/vas-job.dto.d.ts +2 -0
- package/lib/entity/vas-job.model.d.ts +27 -24
- package/lib/model/geo-location.d.ts +12 -0
- package/lib/model/index.d.ts +1 -0
- package/package.json +3 -3
- /package/{ironcode-vas-lib.d.ts → index.d.ts} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VasJobDataDto } from './vas-job-data.dto';
|
|
2
2
|
import { VasFileDto } from './vas-file.dto';
|
|
3
|
-
|
|
3
|
+
import { GeoLocation } from '../model/geo-location';
|
|
4
|
+
export declare type VasFieldDtoValue = string | number | boolean | undefined | GeoLocation | Array<object | string | number | boolean | VasFileDto> | Record<string, object | string | number | boolean | Array<object | string | number | boolean | VasFileDto>>;
|
|
4
5
|
export interface VasFieldDto extends VasJobDataDto {
|
|
5
6
|
control: string;
|
|
6
7
|
fieldJobPointers: Array<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-field.dto.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-field.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"vas-field.dto.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-field.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,CAAC,OAAO,MAAM,gBAAgB,GAClC,MAAM,GACJ,MAAM,GACN,OAAO,GACP,SAAS,GACT,WAAW,GACX,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC,GACtD,MAAM,CAAC,MAAM,EAEf,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC;AAE/F,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-field.dto.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-field.dto.ts"],"names":[],"mappings":"","sourcesContent":["import { VasJobDataDto } from './vas-job-data.dto';\nimport { VasFileDto } from './vas-file.dto';\n\nexport declare type VasFieldDtoValue =\n string\n | number\n | boolean\n | undefined\n | Array<object | string | number | boolean | VasFileDto>\n | Record<string,\n // eslint-disable-next-line max-len\n object | string | number | boolean | Array<object | string | number | boolean | VasFileDto>>;\n\nexport interface VasFieldDto extends VasJobDataDto {\n control: string;\n fieldJobPointers: Array<string>;\n value: VasFieldDtoValue;\n version: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"vas-field.dto.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-field.dto.ts"],"names":[],"mappings":"","sourcesContent":["import { VasJobDataDto } from './vas-job-data.dto';\nimport { VasFileDto } from './vas-file.dto';\nimport { GeoLocation } from '../model/geo-location';\n\nexport declare type VasFieldDtoValue =\n string\n | number\n | boolean\n | undefined\n | GeoLocation\n | Array<object | string | number | boolean | VasFileDto>\n | Record<string,\n // eslint-disable-next-line max-len\n object | string | number | boolean | Array<object | string | number | boolean | VasFileDto>>;\n\nexport interface VasFieldDto extends VasJobDataDto {\n control: string;\n fieldJobPointers: Array<string>;\n value: VasFieldDtoValue;\n version: number;\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VasFileDto } from './vas-file.dto';
|
|
2
2
|
import { VasRestrictedAccountObjectDto } from './vas-restricted-account-object.dto';
|
|
3
3
|
import { VasFieldDto, VasFieldDtoValue } from './vas-field.dto';
|
|
4
|
+
import { GeoLocation } from '../model/geo-location';
|
|
4
5
|
export interface VasJobStaticDto extends VasRestrictedAccountObjectDto {
|
|
5
6
|
reference: string;
|
|
6
7
|
jobDate: string;
|
|
@@ -16,6 +17,7 @@ export interface VasJobStaticDto extends VasRestrictedAccountObjectDto {
|
|
|
16
17
|
fields: Array<VasFieldDto>;
|
|
17
18
|
createdByDisplayName: string;
|
|
18
19
|
modifiedByDisplayName: string;
|
|
20
|
+
geoLocation: GeoLocation;
|
|
19
21
|
}
|
|
20
22
|
export declare type VasJobDto = VasJobStaticDto & Record<string, VasFieldDtoValue>;
|
|
21
23
|
//# sourceMappingURL=vas-job.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-job.dto.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-job.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"vas-job.dto.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-job.dto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,WAAW,eAAgB,SAAQ,6BAA6B;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACzB,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,WAAW,EAAE,WAAW,CAAC;CAC1B;AACD,MAAM,CAAC,OAAO,MAAM,SAAS,GAAG,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-job.dto.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-job.dto.ts"],"names":[],"mappings":"","sourcesContent":["import { VasFileDto } from './vas-file.dto';\nimport { VasRestrictedAccountObjectDto } from './vas-restricted-account-object.dto';\nimport { VasFieldDto, VasFieldDtoValue } from './vas-field.dto';\n\nexport interface VasJobStaticDto extends VasRestrictedAccountObjectDto {\n reference: string;\n jobDate: string;\n jobStatus: string;\n jobType: string;\n assigneeId: string;\n formId: string;\n timeZoneOffset: number;\n pendingFields: number;\n childModified: string;\n version: number;\n files: Array<VasFileDto>;\n fields: Array<VasFieldDto>;\n createdByDisplayName: string;\n modifiedByDisplayName: string;\n}\nexport declare type VasJobDto = VasJobStaticDto & Record<string, VasFieldDtoValue>;\n"]}
|
|
1
|
+
{"version":3,"file":"vas-job.dto.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-job.dto.ts"],"names":[],"mappings":"","sourcesContent":["import { VasFileDto } from './vas-file.dto';\nimport { VasRestrictedAccountObjectDto } from './vas-restricted-account-object.dto';\nimport { VasFieldDto, VasFieldDtoValue } from './vas-field.dto';\nimport { GeoLocation } from '../model/geo-location';\n\nexport interface VasJobStaticDto extends VasRestrictedAccountObjectDto {\n reference: string;\n jobDate: string;\n jobStatus: string;\n jobType: string;\n assigneeId: string;\n formId: string;\n timeZoneOffset: number;\n pendingFields: number;\n childModified: string;\n version: number;\n files: Array<VasFileDto>;\n fields: Array<VasFieldDto>;\n createdByDisplayName: string;\n modifiedByDisplayName: string;\n geoLocation: GeoLocation;\n}\nexport declare type VasJobDto = VasJobStaticDto & Record<string, VasFieldDtoValue>;\n"]}
|
|
@@ -4,6 +4,7 @@ import { VasFieldDto, VasFieldDtoValue } from './vas-field.dto';
|
|
|
4
4
|
import { VasFormModel } from './vas-form.model';
|
|
5
5
|
import { VasJobDto } from './vas-job.dto';
|
|
6
6
|
import { VasRestrictedAccountObjectModel } from './vas-restricted-account-object.model';
|
|
7
|
+
import { GeoLocation } from '../model/geo-location';
|
|
7
8
|
export declare interface VasJobModelDynamicInterface {
|
|
8
9
|
[s: string]: string | number | Record<string, VasFieldDtoValue>;
|
|
9
10
|
}
|
|
@@ -38,32 +39,34 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
|
|
|
38
39
|
files: Array<VasFileDto>;
|
|
39
40
|
createdByDisplayName: string;
|
|
40
41
|
modifiedByDisplayName: string;
|
|
42
|
+
geoLocation: GeoLocation;
|
|
41
43
|
/**
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
* @param
|
|
50
|
-
* @param
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
53
|
-
* @param
|
|
54
|
-
* @param
|
|
55
|
-
* @param
|
|
56
|
-
* @param
|
|
57
|
-
* @param
|
|
58
|
-
* @param
|
|
59
|
-
* @param
|
|
60
|
-
* @param
|
|
61
|
-
* @param
|
|
62
|
-
* @param
|
|
63
|
-
* @param
|
|
64
|
-
* @param
|
|
44
|
+
* @param id
|
|
45
|
+
* @param created
|
|
46
|
+
* @param serverCreated
|
|
47
|
+
* @param createdBy
|
|
48
|
+
* @param modified
|
|
49
|
+
* @param serverModified
|
|
50
|
+
* @param modifiedBy
|
|
51
|
+
* @param account
|
|
52
|
+
* @param accessGroup
|
|
53
|
+
* @param reference
|
|
54
|
+
* @param jobDate
|
|
55
|
+
* @param jobStatus
|
|
56
|
+
* @param jobType
|
|
57
|
+
* @param assigneeId
|
|
58
|
+
* @param formId
|
|
59
|
+
* @param timeZoneOffset
|
|
60
|
+
* @param pendingFields
|
|
61
|
+
* @param childModified
|
|
62
|
+
* @param version
|
|
63
|
+
* @param fields
|
|
64
|
+
* @param files,
|
|
65
|
+
* @param createdByDisplayName
|
|
66
|
+
* @param modifiedByDisplayName
|
|
67
|
+
* @param geoLocation
|
|
65
68
|
*/
|
|
66
|
-
constructor(id: string, created: string, serverCreated: string, createdBy: string, modified: string, serverModified: string, modifiedBy: string, account: string, accessGroup: string, reference: string, jobDate: string, jobStatus: string, jobType: string, assigneeId: string, formId: string, timeZoneOffset: number, pendingFields: number, childModified: string, version: number, fields: Array<VasFieldDto>, files: Array<VasFileDto>, createdByDisplayName: string, modifiedByDisplayName: string);
|
|
69
|
+
constructor(id: string, created: string, serverCreated: string, createdBy: string, modified: string, serverModified: string, modifiedBy: string, account: string, accessGroup: string, reference: string, jobDate: string, jobStatus: string, jobType: string, assigneeId: string, formId: string, timeZoneOffset: number, pendingFields: number, childModified: string, version: number, fields: Array<VasFieldDto>, files: Array<VasFileDto>, createdByDisplayName: string, modifiedByDisplayName: string, geoLocation: GeoLocation);
|
|
67
70
|
/**
|
|
68
71
|
* Returns this with the dynamic interface
|
|
69
72
|
* @return {VasJobModelDynamicInterface}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-job.model.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-job.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB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1 = tslib_1.__importDefault(require("moment"));
|
|
|
7
7
|
const get_value_by_path_1 = require("../utils/get-value-by-path");
|
|
8
8
|
const vas_field_model_1 = require("./vas-field.model");
|
|
9
9
|
const vas_restricted_account_object_model_1 = require("./vas-restricted-account-object.model");
|
|
10
|
+
const geo_location_1 = require("../model/geo-location");
|
|
10
11
|
/**
|
|
11
12
|
* JobModel
|
|
12
13
|
*/
|
|
13
14
|
class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAccountObjectModel {
|
|
14
15
|
/**
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
19
|
-
* @param
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
25
|
-
* @param
|
|
26
|
-
* @param
|
|
27
|
-
* @param
|
|
28
|
-
* @param
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @param
|
|
34
|
-
* @param
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
37
|
-
* @param
|
|
16
|
+
* @param id
|
|
17
|
+
* @param created
|
|
18
|
+
* @param serverCreated
|
|
19
|
+
* @param createdBy
|
|
20
|
+
* @param modified
|
|
21
|
+
* @param serverModified
|
|
22
|
+
* @param modifiedBy
|
|
23
|
+
* @param account
|
|
24
|
+
* @param accessGroup
|
|
25
|
+
* @param reference
|
|
26
|
+
* @param jobDate
|
|
27
|
+
* @param jobStatus
|
|
28
|
+
* @param jobType
|
|
29
|
+
* @param assigneeId
|
|
30
|
+
* @param formId
|
|
31
|
+
* @param timeZoneOffset
|
|
32
|
+
* @param pendingFields
|
|
33
|
+
* @param childModified
|
|
34
|
+
* @param version
|
|
35
|
+
* @param fields
|
|
36
|
+
* @param files,
|
|
37
|
+
* @param createdByDisplayName
|
|
38
|
+
* @param modifiedByDisplayName
|
|
39
|
+
* @param geoLocation
|
|
38
40
|
*/
|
|
39
|
-
constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, account, accessGroup, reference, jobDate, jobStatus, jobType, assigneeId, formId, timeZoneOffset, pendingFields, childModified, version, fields, files, createdByDisplayName, modifiedByDisplayName) {
|
|
41
|
+
constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, account, accessGroup, reference, jobDate, jobStatus, jobType, assigneeId, formId, timeZoneOffset, pendingFields, childModified, version, fields, files, createdByDisplayName, modifiedByDisplayName, geoLocation) {
|
|
40
42
|
super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, account, accessGroup);
|
|
41
43
|
this.id = id;
|
|
42
44
|
this.created = created;
|
|
@@ -61,6 +63,7 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
61
63
|
this.files = files;
|
|
62
64
|
this.createdByDisplayName = createdByDisplayName;
|
|
63
65
|
this.modifiedByDisplayName = modifiedByDisplayName;
|
|
66
|
+
this.geoLocation = geoLocation;
|
|
64
67
|
}
|
|
65
68
|
/**
|
|
66
69
|
* Returns this with the dynamic interface
|
|
@@ -92,7 +95,7 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
92
95
|
static empty() {
|
|
93
96
|
return new VasJobModel(
|
|
94
97
|
// eslint-disable-next-line new-cap
|
|
95
|
-
angular2_uuid_1.UUID.UUID(), '', '', '', '', '', '', '', '', '', '', '', '', '', '', (0, moment_1.default)().utcOffset(), 0, '', 0, [], [], '', '');
|
|
98
|
+
angular2_uuid_1.UUID.UUID(), '', '', '', '', '', '', '', '', '', '', '', '', '', '', (0, moment_1.default)().utcOffset(), 0, '', 0, [], [], '', '', (0, geo_location_1.getEmptyGeoLocation)());
|
|
96
99
|
}
|
|
97
100
|
/**
|
|
98
101
|
* @param {VasJobDto} jobDto
|
|
@@ -101,7 +104,7 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
101
104
|
static fromDto(jobDto) {
|
|
102
105
|
const model = new VasJobModel(
|
|
103
106
|
// eslint-disable-next-line new-cap
|
|
104
|
-
jobDto.id || angular2_uuid_1.UUID.UUID(), jobDto.created || '', jobDto.serverCreated || '', jobDto.createdBy || '', jobDto.modified || '', jobDto.serverModified || '', jobDto.modifiedBy || '', jobDto.account || '', jobDto.accessGroup || '', jobDto.reference || '', jobDto.jobDate || '', jobDto.jobStatus || '', jobDto.jobType || '', jobDto.assigneeId || '', jobDto.formId || '', jobDto.timeZoneOffset || (0, moment_1.default)().utcOffset(), jobDto.pendingFields || 0, jobDto.childModified || '', jobDto.version || 0, jobDto.fields || [], jobDto.files || [], jobDto.createdByDisplayName || '', jobDto.modifiedByDisplayName || '');
|
|
107
|
+
jobDto.id || angular2_uuid_1.UUID.UUID(), jobDto.created || '', jobDto.serverCreated || '', jobDto.createdBy || '', jobDto.modified || '', jobDto.serverModified || '', jobDto.modifiedBy || '', jobDto.account || '', jobDto.accessGroup || '', jobDto.reference || '', jobDto.jobDate || '', jobDto.jobStatus || '', jobDto.jobType || '', jobDto.assigneeId || '', jobDto.formId || '', jobDto.timeZoneOffset || (0, moment_1.default)().utcOffset(), jobDto.pendingFields || 0, jobDto.childModified || '', jobDto.version || 0, jobDto.fields || [], jobDto.files || [], jobDto.createdByDisplayName || '', jobDto.modifiedByDisplayName || '', jobDto.geoLocation || (0, geo_location_1.getEmptyGeoLocation)());
|
|
105
108
|
const emptyKeys = model.staticProperties;
|
|
106
109
|
Object
|
|
107
110
|
.keys(jobDto)
|
|
@@ -332,7 +335,8 @@ class VasJobModel extends vas_restricted_account_object_model_1.VasRestrictedAcc
|
|
|
332
335
|
fields: this.fields,
|
|
333
336
|
files: this.files,
|
|
334
337
|
createdByDisplayName: this.createdByDisplayName,
|
|
335
|
-
modifiedByDisplayName: this.modifiedByDisplayName
|
|
338
|
+
modifiedByDisplayName: this.modifiedByDisplayName,
|
|
339
|
+
geoLocation: this.geoLocation
|
|
336
340
|
};
|
|
337
341
|
}
|
|
338
342
|
const dto = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vas-job.model.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-job.model.ts"],"names":[],"mappings":";;;;AACA,iDAAqC;AACrC,4DAA4B;AAC5B,kEAA4D;AAG5D,uDAAkD;AAGlD,+FAAwF;AAoBxF;;GAEG;AACH,MAAa,WAAY,SAAQ,qEAA+B;IAC9D;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,YACkB,EAAU,EACV,OAAe,EACf,aAAqB,EACrB,SAAiB,EACjB,QAAgB,EAChB,cAAsB,EACtB,UAAkB,EAClB,OAAe,EACf,WAAmB,EAC5B,SAAiB,EACjB,OAAe,EACf,SAAiB,EACjB,OAAe,EACf,UAAkB,EAClB,MAAc,EACd,cAAsB,EACtB,aAAqB,EACrB,aAAqB,EACrB,OAAe,EACf,MAA0B,EAC1B,KAAwB,EACxB,oBAA4B,EAC5B,qBAA6B;QAEpC,KAAK,CACH,EAAE,EACF,OAAO,EACP,aAAa,EACb,SAAS,EACT,QAAQ,EACR,cAAc,EACd,UAAU,EACV,OAAO,EACP,WAAW,CACZ,CAAC;QAlCc,OAAE,GAAF,EAAE,CAAQ;QACV,YAAO,GAAP,OAAO,CAAQ;QACf,kBAAa,GAAb,aAAa,CAAQ;QACrB,cAAS,GAAT,SAAS,CAAQ;QACjB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,mBAAc,GAAd,cAAc,CAAQ;QACtB,eAAU,GAAV,UAAU,CAAQ;QAClB,YAAO,GAAP,OAAO,CAAQ;QACf,gBAAW,GAAX,WAAW,CAAQ;QAC5B,cAAS,GAAT,SAAS,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,eAAU,GAAV,UAAU,CAAQ;QAClB,WAAM,GAAN,MAAM,CAAQ;QACd,mBAAc,GAAd,cAAc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CAAC,EACtC,QAAQ,EAAE,IAAI,CAAC,MAAM,IAAI,GAAG,IAC5B;IACJ,CAAC;CACF;AAzhBD,kCAyhBC","sourcesContent":["import { VasFileDto } from './vas-file.dto';\nimport { UUID } from 'angular2-uuid';\nimport moment from 'moment';\nimport { getValueByPath } from '../utils/get-value-by-path';\nimport { VasBaseDto } from './vas-base.dto';\nimport { VasFieldDto, VasFieldDtoValue } from './vas-field.dto';\nimport { VasFieldModel } from './vas-field.model';\nimport { VasFormModel } from './vas-form.model';\nimport { VasJobDto } from './vas-job.dto';\nimport { VasRestrictedAccountObjectModel } from './vas-restricted-account-object.model';\n\nexport declare interface VasJobModelDynamicInterface {\n [s: string]: string | number | Record<string, VasFieldDtoValue>;\n}\n\nexport interface ParseSyntaxOptions {\n // This value will be used to adjust any datetime values that are referenced\n // in the syntax string. See\n // https://momentjscom.readthedocs.io/en/latest/moment/03-manipulating/09-utc-offset/\n // for more information about how `moment` will handle the value.\n timeZoneOffset: number,\n // this dictionary can be passed in to contain other objects to be referenced\n // in the syntax. For example if we have {job.foo} this will reference the\n // job's `foo` property, however if we have \"reportLayout.title\" this will\n // expect to find a property of `objects` called `reportLayout` which will\n // have a property called `title`\n objects?: Record<string, Partial<VasBaseDto> | Record<string, VasFieldDtoValue>>;\n}\n\n/**\n * JobModel\n */\nexport class VasJobModel extends VasRestrictedAccountObjectModel {\n /**\n * @param {string} id\n * @param {string} created\n * @param {string} serverCreated\n * @param {string} createdBy\n * @param {string} modified\n * @param {string} serverModified\n * @param {string} modifiedBy\n * @param {string} account\n * @param {string} accessGroup\n * @param {string} reference\n * @param {string} jobDate\n * @param {string} jobStatus\n * @param {string} jobType\n * @param {string} assigneeId\n * @param {string} formId\n * @param {number} timeZoneOffset\n * @param {number} pendingFields\n * @param {string} childModified\n * @param {number} version\n * @param {Array<VasFieldDto>} fields\n * @param {Array<VasFileDto>} files,\n * @param {string} createdByDisplayName\n * @param {string} modifiedByDisplayName\n */\n constructor(\n public override id: string,\n public override created: string,\n public override serverCreated: string,\n public override createdBy: string,\n public override modified: string,\n public override serverModified: string,\n public override modifiedBy: string,\n public override account: string,\n public override accessGroup: string,\n public reference: string,\n public jobDate: string,\n public jobStatus: string,\n public jobType: string,\n public assigneeId: string,\n public formId: string,\n public timeZoneOffset: number,\n public pendingFields: number,\n public childModified: string,\n public version: number,\n public fields: Array<VasFieldDto>,\n public files: Array<VasFileDto>,\n public createdByDisplayName: string,\n public modifiedByDisplayName: string,\n ) {\n super(\n id,\n created,\n serverCreated,\n createdBy,\n modified,\n serverModified,\n modifiedBy,\n account,\n accessGroup\n );\n }\n\n /**\n * Returns this with the dynamic interface\n * @return {VasJobModelDynamicInterface}\n */\n get $this(): VasJobModelDynamicInterface {\n return this as any;\n }\n\n /**\n * Returns a list of Job dynamic properties i.e. those that are added by the\n * dynamic forms\n */\n get dynamicProperties(): Array<string> {\n const nativeProps = this.staticProperties;\n return Object\n .getOwnPropertyNames(this)\n .filter(prop => !nativeProps.includes(prop));\n }\n\n /**\n * Returns a list of Job static properties i.e. those that are declared by\n * the type\n */\n get staticProperties(): Array<string> {\n return Object.getOwnPropertyNames(VasJobModel.empty());\n }\n\n /**\n * @return {VasJobModel}\n */\n public static empty(): VasJobModel {\n return new VasJobModel(\n // eslint-disable-next-line new-cap\n UUID.UUID(),\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n moment().utcOffset(),\n 0,\n '',\n 0,\n [],\n [],\n '',\n ''\n );\n }\n\n /**\n * @param {VasJobDto} jobDto\n * @return {VasJobModel}\n */\n public static fromDto(jobDto: Partial<VasJobDto>): VasJobModel {\n const model = new VasJobModel(\n // eslint-disable-next-line new-cap\n jobDto.id || UUID.UUID(),\n jobDto.created || '',\n jobDto.serverCreated || '',\n jobDto.createdBy || '',\n jobDto.modified || '',\n jobDto.serverModified || '',\n jobDto.modifiedBy || '',\n jobDto.account || '',\n jobDto.accessGroup || '',\n jobDto.reference || '',\n jobDto.jobDate || '',\n jobDto.jobStatus || '',\n jobDto.jobType || '',\n jobDto.assigneeId || '',\n jobDto.formId || '',\n jobDto.timeZoneOffset || moment().utcOffset(),\n jobDto.pendingFields || 0,\n jobDto.childModified || '',\n jobDto.version || 0,\n jobDto.fields || [],\n jobDto.files || [],\n jobDto.createdByDisplayName || '',\n jobDto.modifiedByDisplayName || '',\n );\n const emptyKeys = model.staticProperties;\n Object\n .keys(jobDto)\n .filter(key => emptyKeys.indexOf(key) === -1)\n .forEach((key: string) =>\n model.$this[key] = (jobDto as VasJobModelDynamicInterface)[key]\n );\n return model;\n }\n\n /**\n * @param {VasFormModel} formModel\n * @return {Record<string, VasFieldDtoValue>}\n */\n getFields(formModel: VasFormModel): Record<string, VasFieldDtoValue> {\n const fields: {[key: string]: VasFieldDtoValue} = {};\n formModel.groups\n .forEach(group => {\n group.controls.forEach(control => {\n (fields)[control.reportTemplateName] =\n this.getValueByPath([group.name, control.name]);\n });\n });\n return fields;\n }\n\n /**\n * Will return an object whose keys are the names of all fields in the job but\n * with the \"fields.\" part removed. This method is similar to `getFields`\n * except that this method will only return values that are set whereas\n * `getFields` will return a property regardless (because it uses the form to\n * drive the logic)\n * @return {Record<string, VasFieldDtoValue>}\n */\n getFields2(): Record<string, VasFieldDtoValue> {\n let fields: {[key: string]: VasFieldDtoValue} = {};\n this.dynamicProperties\n .forEach((groupName) => {\n Object\n .keys(this.$this[groupName])\n .forEach(controlName => {\n const controlNameShort = controlName.replace(/fields\\./, '');\n fields[controlNameShort] = this.getValueByPath(\n [groupName, controlName]\n )\n })\n }, {})\n return fields;\n }\n\n /**\n * This method will hydrate the `fields` property of the model. The reason for\n * this is that we have different ways to store the field data. One way, is\n * we store them as dynamic properties of the job. For example job.foo.bar,\n * where `foo` is the name of a Group, and `bar` is the name of a control.\n * Thus, when we create a job using a form in the client, the job object will\n * have its static properties (id, account, reference etc), and also a number\n * of dynamic properties determined by the Groups and Controls. This kind of\n * object is nice to work with in certain circumstances. However, the api\n * works differently. In the API a Job is a record, and references a number of\n * Field records. Each Field stores the value. Comparing these two models we\n * have:\n * A) job with dynamic properties, e.g.\n * {\n * id: <guid>,\n * reference: \"something\"\n * <other static job properties>...\n * foo: {\n * bar: \"value\"\n * }\n * }\n *\n * B) job with fields\n * {\n * id: <guid>,\n * reference: \"something\"\n * <other static job properties>...\n * <will not have dynamic properties>...\n * fields: [\n * {\n * id: <guid>,\n * <other field properties>,\n * value: \"value\"\n * }\n * ]\n * }\n *\n * So, what this method does is given a JobModel in the form of A, read all\n * of those dynamic properties and set them into `fields`. Doing this requires\n * knowledge of the Form that was used to create the job. Moreover, since the\n * dynamic properties do not contain the ids of the fields, we also allow to\n * pass in a `controlFieldIdMap`. This map stores the mapping between Control\n * and the Field that was created in the Job to store the value for that\n * Control. This is useful, if for example you want to compare a Job in form A\n * with a Job in form B, for example if you want to update the Job on the API\n * with a Job that was saved by a client in form A.\n *\n * E.g.\n * Client -> API: client requests form\n * User -> Client: user fills in the form and submits\n * Client -> Firestore: client saves the Job in form A i.e. dynamic props\n * Firestore -> Function: A function is triggered to sync the job to the API\n * Function -> API: Function checks if job already exists, it receives 404\n * Function -> Function: The function calls `hydrateFields(...)`\n * Function -> API: The function POST the Job to /jobs\n * Function -> API: The function POST each field to /fields\n *\n * Similarly, if the user updates the job\n * Client -> API: client requests form\n * User -> Client: user fills in the form and submits an update\n * Client -> Firestore: client saves the Job in form A i.e. dynamic props\n * Firestore -> Function: A function is triggered to sync the job to the API\n * Function -> API: Function checks if job already exists, it receives 200\n * Function -> Function: The function calls `hydrateFields(...)` passing in\n * the map is made by iterating over the fields it\n * received from the API and storing the mappings\n * between controlId and fieldId for each field\n * Function -> API: The function PATCH the Job to /jobs\n * Function -> API: The function POST/PATCH each field to /fields\n * treated as new\n *\n * @param {VasFormModel} formModel the VasFormModel that was used to create\n * the job\n * @param {Map<string, string>} controlFieldIdMap a mapping of control to\n * field ids. This is used to determine whether a new id for the field should\n * be generated, or to reuse an existing one from the map.\n * @param {Array<string>} controlNames if a value is provided, it will be used\n * to filter the fields that are returned.\n * @return {Array<VasFieldDto>}\n */\n hydrateFields(\n formModel: VasFormModel,\n controlFieldIdMap: Map<string, string> = new Map<string, string>(),\n controlNames?: Array<string>\n ): void {\n const fields: Array<VasFieldDto> = [];\n formModel.groups\n .forEach(group => {\n group.controls.forEach(control => {\n\n if (!control.name.startsWith('fields.')) {\n return;\n }\n\n if (controlNames && !controlNames.includes(control.name)) {\n return;\n }\n\n fields.push(VasFieldModel.fromDto({\n // if the controlId exists in the map, use the associated fieldId,\n // otherwise generate a new id for the field.\n id: controlFieldIdMap.get(control.id) || UUID.UUID(),\n account: this.account,\n job: this.id,\n createdBy: this.createdBy,\n created: this.created,\n modifiedBy: this.modifiedBy,\n modified: this.modified,\n control: control.id,\n value: this.getValueByPath(\n [group.name, control.name]\n )\n }));\n });\n });\n this.fields = fields;\n }\n\n /**\n\n * @param {string[]} path path segments\n * @return {void}\n */\n getValueByPath<T extends VasFieldDtoValue>(\n path: string[] = []\n ): T | undefined {\n return getValueByPath(path, this.$this);\n }\n\n /**\n * A very non sophisticated way to set values in the job via paths\n *\n * For example:\n *\n * setValueByPath('value', ['foo', 'bar']);\n *\n * will make results in job\n * {\n * foo: {\n * bar: 'value'\n * }\n * }\n *\n * @param {any} value the value to set\n * @param {string[]} path path segments\n */\n setValueByPath(value: VasFieldDtoValue, path: string[] = []): void {\n switch (path.length) {\n case 0: {\n return;\n }\n case 1: {\n (this as any)[path[0]] = value;\n return;\n }\n case 2: {\n // eslint-disable-next-line max-len\n (this.$this[path[0]] as Record<string, VasFieldDtoValue>)[path[1]] = value;\n return;\n }\n case 3: {\n // eslint-disable-next-line max-len\n ((this.$this[path[0]] as Record<string, VasFieldDtoValue>)[path[1]] as Record<string, VasFieldDtoValue>)[path[2]] = value;\n return;\n }\n default: {\n throw Error('path has too many segments');\n }\n }\n }\n\n /**\n * @param {boolean} staticOnly if true, will only output values for the static\n * properties in the dto\n * @return {VasJobDto}\n */\n public toDto(staticOnly = false): VasJobDto {\n\n if (staticOnly) {\n return {\n id: this.id,\n created: this.created,\n createdBy: this.createdBy,\n modified: this.modified,\n modifiedBy: this.modifiedBy,\n serverCreated: this.serverCreated,\n serverModified: this.serverModified,\n account: this.account,\n accessGroup: this.accessGroup,\n reference: this.reference,\n jobDate: this.jobDate,\n jobStatus: this.jobStatus,\n jobType: this.jobType,\n assigneeId: this.assigneeId,\n formId: this.formId,\n timeZoneOffset: this.timeZoneOffset,\n pendingFields: this.pendingFields,\n childModified: this.childModified,\n version: this.version,\n fields: this.fields,\n files: this.files,\n createdByDisplayName: this.createdByDisplayName,\n modifiedByDisplayName: this.modifiedByDisplayName\n };\n }\n\n const dto = {} as VasJobModelDynamicInterface;\n [...this.staticProperties, ...this.dynamicProperties]\n .forEach(prop =>\n (dto)[prop] = this.$this[prop]);\n\n return dto as any;\n }\n\n /**\n * This method will parse a syntax that allows us to build strings from the\n * values of from the job model. For example if the job model was:\n *\n * {\n * foo: 'bar'\n * }\n *\n * and we pass \"i am foo {foo}\", the result would be:\n *\n * \"i am foo bar\"\n *\n * we can also use moment to parse dates, for example if the job model was:\n *\n * {\n * created: \"2022-01-01T00:00:00+0000\"\n * }\n *\n * and we pass \"{created|date:YY-MM-DD}\", the result would be:\n *\n * \"2022-01-01\"\n *\n * @param {string} value a string with the syntax\n * @param {ParseSyntaxOptions} options\n * @return {string} the results of parsing the syntax on this job\n */\n parseSyntax(\n value: string,\n options: ParseSyntaxOptions = {\n timeZoneOffset: 0\n }\n ): string {\n\n if (!value || typeof value !== 'string') {\n return '';\n }\n return value.replace(/({[^}]*})/g, (match: string, token: string) => {\n const syntax = token.substring(1, token.length - 1);\n\n let [key, filter] = syntax.split('|');\n key = (key || '').trim();\n filter = (filter || '').trim()\n\n let filterName, filterArg: string = '';\n if (filter) {\n const splitIndex = filter.indexOf(':');\n if (splitIndex !== -1) {\n filterName = filter.substring(0, splitIndex);\n filterArg = filter.substring(splitIndex + 1);\n } else {\n filterName = filter;\n filterArg = '';\n }\n filterName = (filterName || '').trim();\n filterArg = (filterArg || '').trim();\n }\n const path = key.split('.');\n const objectKey = path.shift() || '';\n let result = '';\n if (objectKey === 'job') {\n result = (this.getValueByPath(path) || '').toString();\n } else if (objectKey === 'fields') {\n result = (getValueByPath(path, this.getFields2()) || '').toString();\n } else if (objectKey.length) {\n if (options.objects) {\n if (options.objects[objectKey] === undefined) {\n console.debug(\n `objectKey ${objectKey} is not present in options.object`\n );\n result = '';\n } else {\n result = (getValueByPath(path, options.objects[objectKey]) || '')\n .toString();\n }\n } else {\n console.debug(\n `objectKey ${objectKey} was used but options.object is not set`\n );\n return '';\n }\n } else {\n return '';\n }\n\n\n if (filterName && result) {\n switch (filterName) {\n case 'date': {\n return moment(result)\n .utcOffset(options.timeZoneOffset)\n .format(filterArg || '');\n }\n default: {\n console.warn('unknown filter %s', filterName);\n }\n }\n }\n\n return result;\n }).trim();\n };\n\n /**\n * @return {object}\n */\n override toApiDto(): Record<string, string | number | boolean> {\n return {\n ...super.toApiDto(),\n reference: this.reference || '~',\n jobDate: this.jobDate || '~',\n jobType: this.jobType || '~',\n accessGroup: this.accessGroup || '~',\n jobStatus: this.jobStatus || '~',\n assigneeId: this.assigneeId || '~',\n timeZoneOffset: this.timeZoneOffset || 0,\n pendingFields: this.pendingFields || 0,\n lastForm: this.formId || '~'\n };\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"vas-job.model.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/entity/vas-job.model.ts"],"names":[],"mappings":";;;;AACA,iDAAqC;AACrC,4DAA4B;AAC5B,kEAA4D;AAG5D,uDAAkD;AAGlD,+FAAwF;AACxF,wDAAyE;AAoBzE;;GAEG;AACH,MAAa,WAAY,SAAQ,qEAA+B;IAC9D;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,YACkB,EAAU,EACV,OAAe,EACf,aAAqB,EACrB,SAAiB,EACjB,QAAgB,EAChB,cAAsB,EACtB,UAA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,KAAK,CACX,aAAa,SAAS,yCAAyC,CAChE,CAAC;oBACF,OAAO,EAAE,CAAC;iBACX;aACF;iBAAM;gBACL,OAAO,EAAE,CAAC;aACX;YAGD,IAAI,UAAU,IAAI,MAAM,EAAE;gBACxB,QAAQ,UAAU,EAAE;oBAClB,KAAK,MAAM,CAAC,CAAC;wBACX,OAAO,IAAA,gBAAM,EAAC,MAAM,CAAC;6BAClB,SAAS,CAAC,OAAO,CAAC,cAAc,CAAC;6BACjC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;qBAC5B;oBACD,OAAO,CAAC,CAAC;wBACP,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAAC;qBAC/C;iBACF;aACF;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACZ,CAAC;IAAA,CAAC;IAEF;;OAEG;IACM,QAAQ;QACf,uCACK,KAAK,CAAC,QAAQ,EAAE,KACnB,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,GAAG,EAChC,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,GAAG,EAC5B,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,GAAG,EAC5B,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,GAAG,EACpC,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,GAAG,EAChC,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,GAAG,EAClC,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,CAAC,EACxC,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,CAAC,EACtC,QAAQ,EAAE,IAAI,CAAC,MAAM,IAAI,GAAG,IAC5B;IACJ,CAAC;CACF;AA9hBD,kCA8hBC","sourcesContent":["import { VasFileDto } from './vas-file.dto';\nimport { UUID } from 'angular2-uuid';\nimport moment from 'moment';\nimport { getValueByPath } from '../utils/get-value-by-path';\nimport { VasBaseDto } from './vas-base.dto';\nimport { VasFieldDto, VasFieldDtoValue } from './vas-field.dto';\nimport { VasFieldModel } from './vas-field.model';\nimport { VasFormModel } from './vas-form.model';\nimport { VasJobDto } from './vas-job.dto';\nimport { VasRestrictedAccountObjectModel } from './vas-restricted-account-object.model';\nimport { GeoLocation, getEmptyGeoLocation } from '../model/geo-location';\n\nexport declare interface VasJobModelDynamicInterface {\n [s: string]: string | number | Record<string, VasFieldDtoValue>;\n}\n\nexport interface ParseSyntaxOptions {\n // This value will be used to adjust any datetime values that are referenced\n // in the syntax string. See\n // https://momentjscom.readthedocs.io/en/latest/moment/03-manipulating/09-utc-offset/\n // for more information about how `moment` will handle the value.\n timeZoneOffset: number,\n // this dictionary can be passed in to contain other objects to be referenced\n // in the syntax. For example if we have {job.foo} this will reference the\n // job's `foo` property, however if we have \"reportLayout.title\" this will\n // expect to find a property of `objects` called `reportLayout` which will\n // have a property called `title`\n objects?: Record<string, Partial<VasBaseDto> | Record<string, VasFieldDtoValue>>;\n}\n\n/**\n * JobModel\n */\nexport class VasJobModel extends VasRestrictedAccountObjectModel {\n /**\n * @param id\n * @param created\n * @param serverCreated\n * @param createdBy\n * @param modified\n * @param serverModified\n * @param modifiedBy\n * @param account\n * @param accessGroup\n * @param reference\n * @param jobDate\n * @param jobStatus\n * @param jobType\n * @param assigneeId\n * @param formId\n * @param timeZoneOffset\n * @param pendingFields\n * @param childModified\n * @param version\n * @param fields\n * @param files,\n * @param createdByDisplayName\n * @param modifiedByDisplayName\n * @param geoLocation\n */\n constructor(\n public override id: string,\n public override created: string,\n public override serverCreated: string,\n public override createdBy: string,\n public override modified: string,\n public override serverModified: string,\n public override modifiedBy: string,\n public override account: string,\n public override accessGroup: string,\n public reference: string,\n public jobDate: string,\n public jobStatus: string,\n public jobType: string,\n public assigneeId: string,\n public formId: string,\n public timeZoneOffset: number,\n public pendingFields: number,\n public childModified: string,\n public version: number,\n public fields: Array<VasFieldDto>,\n public files: Array<VasFileDto>,\n public createdByDisplayName: string,\n public modifiedByDisplayName: string,\n public geoLocation: GeoLocation\n ) {\n super(\n id,\n created,\n serverCreated,\n createdBy,\n modified,\n serverModified,\n modifiedBy,\n account,\n accessGroup\n );\n }\n\n /**\n * Returns this with the dynamic interface\n * @return {VasJobModelDynamicInterface}\n */\n get $this(): VasJobModelDynamicInterface {\n return this as any;\n }\n\n /**\n * Returns a list of Job dynamic properties i.e. those that are added by the\n * dynamic forms\n */\n get dynamicProperties(): Array<string> {\n const nativeProps = this.staticProperties;\n return Object\n .getOwnPropertyNames(this)\n .filter(prop => !nativeProps.includes(prop));\n }\n\n /**\n * Returns a list of Job static properties i.e. those that are declared by\n * the type\n */\n get staticProperties(): Array<string> {\n return Object.getOwnPropertyNames(VasJobModel.empty());\n }\n\n /**\n * @return {VasJobModel}\n */\n public static empty(): VasJobModel {\n return new VasJobModel(\n // eslint-disable-next-line new-cap\n UUID.UUID(),\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n '',\n moment().utcOffset(),\n 0,\n '',\n 0,\n [],\n [],\n '',\n '',\n getEmptyGeoLocation()\n );\n }\n\n /**\n * @param {VasJobDto} jobDto\n * @return {VasJobModel}\n */\n public static fromDto(jobDto: Partial<VasJobDto>): VasJobModel {\n const model = new VasJobModel(\n // eslint-disable-next-line new-cap\n jobDto.id || UUID.UUID(),\n jobDto.created || '',\n jobDto.serverCreated || '',\n jobDto.createdBy || '',\n jobDto.modified || '',\n jobDto.serverModified || '',\n jobDto.modifiedBy || '',\n jobDto.account || '',\n jobDto.accessGroup || '',\n jobDto.reference || '',\n jobDto.jobDate || '',\n jobDto.jobStatus || '',\n jobDto.jobType || '',\n jobDto.assigneeId || '',\n jobDto.formId || '',\n jobDto.timeZoneOffset || moment().utcOffset(),\n jobDto.pendingFields || 0,\n jobDto.childModified || '',\n jobDto.version || 0,\n jobDto.fields || [],\n jobDto.files || [],\n jobDto.createdByDisplayName || '',\n jobDto.modifiedByDisplayName || '',\n jobDto.geoLocation || getEmptyGeoLocation()\n );\n const emptyKeys = model.staticProperties;\n Object\n .keys(jobDto)\n .filter(key => emptyKeys.indexOf(key) === -1)\n .forEach((key: string) =>\n model.$this[key] = (jobDto as VasJobModelDynamicInterface)[key]\n );\n return model;\n }\n\n /**\n * @param {VasFormModel} formModel\n * @return {Record<string, VasFieldDtoValue>}\n */\n getFields(formModel: VasFormModel): Record<string, VasFieldDtoValue> {\n const fields: {[key: string]: VasFieldDtoValue} = {};\n formModel.groups\n .forEach(group => {\n group.controls.forEach(control => {\n (fields)[control.reportTemplateName] =\n this.getValueByPath([group.name, control.name]);\n });\n });\n return fields;\n }\n\n /**\n * Will return an object whose keys are the names of all fields in the job but\n * with the \"fields.\" part removed. This method is similar to `getFields`\n * except that this method will only return values that are set whereas\n * `getFields` will return a property regardless (because it uses the form to\n * drive the logic)\n * @return {Record<string, VasFieldDtoValue>}\n */\n getFields2(): Record<string, VasFieldDtoValue> {\n let fields: {[key: string]: VasFieldDtoValue} = {};\n this.dynamicProperties\n .forEach((groupName) => {\n Object\n .keys(this.$this[groupName])\n .forEach(controlName => {\n const controlNameShort = controlName.replace(/fields\\./, '');\n fields[controlNameShort] = this.getValueByPath(\n [groupName, controlName]\n )\n })\n }, {})\n return fields;\n }\n\n /**\n * This method will hydrate the `fields` property of the model. The reason for\n * this is that we have different ways to store the field data. One way, is\n * we store them as dynamic properties of the job. For example job.foo.bar,\n * where `foo` is the name of a Group, and `bar` is the name of a control.\n * Thus, when we create a job using a form in the client, the job object will\n * have its static properties (id, account, reference etc), and also a number\n * of dynamic properties determined by the Groups and Controls. This kind of\n * object is nice to work with in certain circumstances. However, the api\n * works differently. In the API a Job is a record, and references a number of\n * Field records. Each Field stores the value. Comparing these two models we\n * have:\n * A) job with dynamic properties, e.g.\n * {\n * id: <guid>,\n * reference: \"something\"\n * <other static job properties>...\n * foo: {\n * bar: \"value\"\n * }\n * }\n *\n * B) job with fields\n * {\n * id: <guid>,\n * reference: \"something\"\n * <other static job properties>...\n * <will not have dynamic properties>...\n * fields: [\n * {\n * id: <guid>,\n * <other field properties>,\n * value: \"value\"\n * }\n * ]\n * }\n *\n * So, what this method does is given a JobModel in the form of A, read all\n * of those dynamic properties and set them into `fields`. Doing this requires\n * knowledge of the Form that was used to create the job. Moreover, since the\n * dynamic properties do not contain the ids of the fields, we also allow to\n * pass in a `controlFieldIdMap`. This map stores the mapping between Control\n * and the Field that was created in the Job to store the value for that\n * Control. This is useful, if for example you want to compare a Job in form A\n * with a Job in form B, for example if you want to update the Job on the API\n * with a Job that was saved by a client in form A.\n *\n * E.g.\n * Client -> API: client requests form\n * User -> Client: user fills in the form and submits\n * Client -> Firestore: client saves the Job in form A i.e. dynamic props\n * Firestore -> Function: A function is triggered to sync the job to the API\n * Function -> API: Function checks if job already exists, it receives 404\n * Function -> Function: The function calls `hydrateFields(...)`\n * Function -> API: The function POST the Job to /jobs\n * Function -> API: The function POST each field to /fields\n *\n * Similarly, if the user updates the job\n * Client -> API: client requests form\n * User -> Client: user fills in the form and submits an update\n * Client -> Firestore: client saves the Job in form A i.e. dynamic props\n * Firestore -> Function: A function is triggered to sync the job to the API\n * Function -> API: Function checks if job already exists, it receives 200\n * Function -> Function: The function calls `hydrateFields(...)` passing in\n * the map is made by iterating over the fields it\n * received from the API and storing the mappings\n * between controlId and fieldId for each field\n * Function -> API: The function PATCH the Job to /jobs\n * Function -> API: The function POST/PATCH each field to /fields\n * treated as new\n *\n * @param {VasFormModel} formModel the VasFormModel that was used to create\n * the job\n * @param {Map<string, string>} controlFieldIdMap a mapping of control to\n * field ids. This is used to determine whether a new id for the field should\n * be generated, or to reuse an existing one from the map.\n * @param {Array<string>} controlNames if a value is provided, it will be used\n * to filter the fields that are returned.\n * @return {Array<VasFieldDto>}\n */\n hydrateFields(\n formModel: VasFormModel,\n controlFieldIdMap: Map<string, string> = new Map<string, string>(),\n controlNames?: Array<string>\n ): void {\n const fields: Array<VasFieldDto> = [];\n formModel.groups\n .forEach(group => {\n group.controls.forEach(control => {\n\n if (!control.name.startsWith('fields.')) {\n return;\n }\n\n if (controlNames && !controlNames.includes(control.name)) {\n return;\n }\n\n fields.push(VasFieldModel.fromDto({\n // if the controlId exists in the map, use the associated fieldId,\n // otherwise generate a new id for the field.\n id: controlFieldIdMap.get(control.id) || UUID.UUID(),\n account: this.account,\n job: this.id,\n createdBy: this.createdBy,\n created: this.created,\n modifiedBy: this.modifiedBy,\n modified: this.modified,\n control: control.id,\n value: this.getValueByPath(\n [group.name, control.name]\n )\n }));\n });\n });\n this.fields = fields;\n }\n\n /**\n\n * @param {string[]} path path segments\n * @return {void}\n */\n getValueByPath<T extends VasFieldDtoValue>(\n path: string[] = []\n ): T | undefined {\n return getValueByPath(path, this.$this);\n }\n\n /**\n * A very non sophisticated way to set values in the job via paths\n *\n * For example:\n *\n * setValueByPath('value', ['foo', 'bar']);\n *\n * will make results in job\n * {\n * foo: {\n * bar: 'value'\n * }\n * }\n *\n * @param {any} value the value to set\n * @param {string[]} path path segments\n */\n setValueByPath(value: VasFieldDtoValue, path: string[] = []): void {\n switch (path.length) {\n case 0: {\n return;\n }\n case 1: {\n (this as any)[path[0]] = value;\n return;\n }\n case 2: {\n // eslint-disable-next-line max-len\n (this.$this[path[0]] as Record<string, VasFieldDtoValue>)[path[1]] = value;\n return;\n }\n case 3: {\n // eslint-disable-next-line max-len\n ((this.$this[path[0]] as Record<string, VasFieldDtoValue>)[path[1]] as Record<string, VasFieldDtoValue>)[path[2]] = value;\n return;\n }\n default: {\n throw Error('path has too many segments');\n }\n }\n }\n\n /**\n * @param {boolean} staticOnly if true, will only output values for the static\n * properties in the dto\n * @return {VasJobDto}\n */\n public toDto(staticOnly = false): VasJobDto {\n\n if (staticOnly) {\n return {\n id: this.id,\n created: this.created,\n createdBy: this.createdBy,\n modified: this.modified,\n modifiedBy: this.modifiedBy,\n serverCreated: this.serverCreated,\n serverModified: this.serverModified,\n account: this.account,\n accessGroup: this.accessGroup,\n reference: this.reference,\n jobDate: this.jobDate,\n jobStatus: this.jobStatus,\n jobType: this.jobType,\n assigneeId: this.assigneeId,\n formId: this.formId,\n timeZoneOffset: this.timeZoneOffset,\n pendingFields: this.pendingFields,\n childModified: this.childModified,\n version: this.version,\n fields: this.fields,\n files: this.files,\n createdByDisplayName: this.createdByDisplayName,\n modifiedByDisplayName: this.modifiedByDisplayName,\n geoLocation: this.geoLocation\n };\n }\n\n const dto = {} as VasJobModelDynamicInterface;\n [...this.staticProperties, ...this.dynamicProperties]\n .forEach(prop =>\n (dto)[prop] = this.$this[prop]);\n\n return dto as any;\n }\n\n /**\n * This method will parse a syntax that allows us to build strings from the\n * values of from the job model. For example if the job model was:\n *\n * {\n * foo: 'bar'\n * }\n *\n * and we pass \"i am foo {foo}\", the result would be:\n *\n * \"i am foo bar\"\n *\n * we can also use moment to parse dates, for example if the job model was:\n *\n * {\n * created: \"2022-01-01T00:00:00+0000\"\n * }\n *\n * and we pass \"{created|date:YY-MM-DD}\", the result would be:\n *\n * \"2022-01-01\"\n *\n * @param {string} value a string with the syntax\n * @param {ParseSyntaxOptions} options\n * @return {string} the results of parsing the syntax on this job\n */\n parseSyntax(\n value: string,\n options: ParseSyntaxOptions = {\n timeZoneOffset: 0\n }\n ): string {\n\n if (!value || typeof value !== 'string') {\n return '';\n }\n return value.replace(/({[^}]*})/g, (match: string, token: string) => {\n const syntax = token.substring(1, token.length - 1);\n\n let [key, filter] = syntax.split('|');\n key = (key || '').trim();\n filter = (filter || '').trim()\n\n let filterName, filterArg: string = '';\n if (filter) {\n const splitIndex = filter.indexOf(':');\n if (splitIndex !== -1) {\n filterName = filter.substring(0, splitIndex);\n filterArg = filter.substring(splitIndex + 1);\n } else {\n filterName = filter;\n filterArg = '';\n }\n filterName = (filterName || '').trim();\n filterArg = (filterArg || '').trim();\n }\n const path = key.split('.');\n const objectKey = path.shift() || '';\n let result = '';\n if (objectKey === 'job') {\n result = (this.getValueByPath(path) || '').toString();\n } else if (objectKey === 'fields') {\n result = (getValueByPath(path, this.getFields2()) || '').toString();\n } else if (objectKey.length) {\n if (options.objects) {\n if (options.objects[objectKey] === undefined) {\n console.debug(\n `objectKey ${objectKey} is not present in options.object`\n );\n result = '';\n } else {\n result = (getValueByPath(path, options.objects[objectKey]) || '')\n .toString();\n }\n } else {\n console.debug(\n `objectKey ${objectKey} was used but options.object is not set`\n );\n return '';\n }\n } else {\n return '';\n }\n\n\n if (filterName && result) {\n switch (filterName) {\n case 'date': {\n return moment(result)\n .utcOffset(options.timeZoneOffset)\n .format(filterArg || '');\n }\n default: {\n console.warn('unknown filter %s', filterName);\n }\n }\n }\n\n return result;\n }).trim();\n };\n\n /**\n * @return {object}\n */\n override toApiDto(): Record<string, string | number | boolean> {\n return {\n ...super.toApiDto(),\n reference: this.reference || '~',\n jobDate: this.jobDate || '~',\n jobType: this.jobType || '~',\n accessGroup: this.accessGroup || '~',\n jobStatus: this.jobStatus || '~',\n assigneeId: this.assigneeId || '~',\n timeZoneOffset: this.timeZoneOffset || 0,\n pendingFields: this.pendingFields || 0,\n lastForm: this.formId || '~'\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface GeoLocation {
|
|
2
|
+
accuracy: number;
|
|
3
|
+
altitude: number;
|
|
4
|
+
altitudeAccuracy: number;
|
|
5
|
+
geoPoint: Array<number>;
|
|
6
|
+
lonLat: {
|
|
7
|
+
lon: number;
|
|
8
|
+
lat: number;
|
|
9
|
+
};
|
|
10
|
+
timestamp: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const getEmptyGeoLocation: () => GeoLocation;
|
|
13
|
+
//# sourceMappingURL=geo-location.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo-location.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/model/geo-location.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,MAAM,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,mBAAmB,QAAO,WAUrC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEmptyGeoLocation = void 0;
|
|
4
|
+
const getEmptyGeoLocation = () => ({
|
|
5
|
+
accuracy: 0,
|
|
6
|
+
altitude: 0,
|
|
7
|
+
altitudeAccuracy: 0,
|
|
8
|
+
geoPoint: [],
|
|
9
|
+
lonLat: {
|
|
10
|
+
lon: 0,
|
|
11
|
+
lat: 0,
|
|
12
|
+
},
|
|
13
|
+
timestamp: ''
|
|
14
|
+
});
|
|
15
|
+
exports.getEmptyGeoLocation = getEmptyGeoLocation;
|
|
16
|
+
//# sourceMappingURL=geo-location.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geo-location.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/model/geo-location.ts"],"names":[],"mappings":";;;AAaO,MAAM,mBAAmB,GAAG,GAAgB,EAAE,CAAC,CAAC;IACrD,QAAQ,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC;IACX,gBAAgB,EAAE,CAAC;IACnB,QAAQ,EAAE,EAAE;IACZ,MAAM,EAAE;QACN,GAAG,EAAE,CAAC;QACN,GAAG,EAAE,CAAC;KACP;IACD,SAAS,EAAE,EAAE;CACd,CAAC,CAAA;AAVW,QAAA,mBAAmB,uBAU9B","sourcesContent":["\nexport interface GeoLocation {\n accuracy: number;\n altitude: number;\n altitudeAccuracy: number;\n geoPoint: Array<number>;\n lonLat: {\n lon: number;\n lat: number;\n };\n timestamp: string;\n}\n\nexport const getEmptyGeoLocation = (): GeoLocation => ({\n accuracy: 0,\n altitude: 0,\n altitudeAccuracy: 0,\n geoPoint: [],\n lonLat: {\n lon: 0,\n lat: 0,\n },\n timestamp: ''\n})\n"]}
|
package/cjs/lib/model/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/model/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC"}
|
package/cjs/lib/model/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./geo-location"), exports);
|
|
4
5
|
tslib_1.__exportStar(require("./vas-time-range.model"), exports);
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/model/index.ts"],"names":[],"mappings":";;;AAAA,iEAAuC","sourcesContent":["export * from './vas-time-range.model';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../projects/vas-lib/src/lib/model/index.ts"],"names":[],"mappings":";;;AAAA,yDAA+B;AAC/B,iEAAuC","sourcesContent":["export * from './geo-location';\nexport * from './vas-time-range.model';\n"]}
|
package/cjs/package.json
CHANGED
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"zone.js": "~0.11.4"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@angular-devkit/build-angular": "~
|
|
40
|
-
"@angular/cli": "~
|
|
41
|
-
"@angular/compiler-cli": "~
|
|
39
|
+
"@angular-devkit/build-angular": "~14",
|
|
40
|
+
"@angular/cli": "~14",
|
|
41
|
+
"@angular/compiler-cli": "~14",
|
|
42
42
|
"@types/jasmine": "~3.10.0",
|
|
43
43
|
"@types/node": "^12.11.1",
|
|
44
44
|
"@types/nodemailer": "^6.4.6",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"karma-coverage": "~2.1.0",
|
|
49
49
|
"karma-jasmine": "~4.0.0",
|
|
50
50
|
"karma-jasmine-html-reporter": "~1.7.0",
|
|
51
|
-
"ng-packagr": "
|
|
51
|
+
"ng-packagr": "~14",
|
|
52
52
|
"typescript": "~4.6.2"
|
|
53
53
|
},
|
|
54
54
|
"type": "commonjs"
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFzLWZpZWxkLmR0by5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3Zhcy1saWIvc3JjL2xpYi9lbnRpdHkvdmFzLWZpZWxkLmR0by50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgVmFzSm9iRGF0YUR0byB9IGZyb20gJy4vdmFzLWpvYi1kYXRhLmR0byc7XG5pbXBvcnQgeyBWYXNGaWxlRHRvIH0gZnJvbSAnLi92YXMtZmlsZS5kdG8nO1xuaW1wb3J0IHsgR2VvTG9jYXRpb24gfSBmcm9tICcuLi9tb2RlbC9nZW8tbG9jYXRpb24nO1xuXG5leHBvcnQgZGVjbGFyZSB0eXBlIFZhc0ZpZWxkRHRvVmFsdWUgPVxuICBzdHJpbmdcbiAgfCBudW1iZXJcbiAgfCBib29sZWFuXG4gIHwgdW5kZWZpbmVkXG4gIHwgR2VvTG9jYXRpb25cbiAgfCBBcnJheTxvYmplY3QgfCBzdHJpbmcgfCBudW1iZXIgfCBib29sZWFuIHwgVmFzRmlsZUR0bz5cbiAgfCBSZWNvcmQ8c3RyaW5nLFxuICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbWF4LWxlblxuICBvYmplY3QgfCBzdHJpbmcgfCBudW1iZXIgfCBib29sZWFuIHwgQXJyYXk8b2JqZWN0IHwgc3RyaW5nIHwgbnVtYmVyIHwgYm9vbGVhbiB8IFZhc0ZpbGVEdG8+PjtcblxuZXhwb3J0IGludGVyZmFjZSBWYXNGaWVsZER0byBleHRlbmRzIFZhc0pvYkRhdGFEdG8ge1xuICBjb250cm9sOiBzdHJpbmc7XG4gIGZpZWxkSm9iUG9pbnRlcnM6IEFycmF5PHN0cmluZz47XG4gIHZhbHVlOiBWYXNGaWVsZER0b1ZhbHVlO1xuICB2ZXJzaW9uOiBudW1iZXI7XG59XG4iXX0=
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmFzLWpvYi5kdG8uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy92YXMtbGliL3NyYy9saWIvZW50aXR5L3Zhcy1qb2IuZHRvLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBWYXNGaWxlRHRvIH0gZnJvbSAnLi92YXMtZmlsZS5kdG8nO1xuaW1wb3J0IHsgVmFzUmVzdHJpY3RlZEFjY291bnRPYmplY3REdG8gfSBmcm9tICcuL3Zhcy1yZXN0cmljdGVkLWFjY291bnQtb2JqZWN0LmR0byc7XG5pbXBvcnQgeyBWYXNGaWVsZER0bywgVmFzRmllbGREdG9WYWx1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