@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.
Files changed (31) hide show
  1. package/cjs/lib/entity/vas-base.model.d.ts +1 -1
  2. package/cjs/lib/entity/vas-base.model.d.ts.map +1 -1
  3. package/cjs/lib/entity/vas-base.model.js.map +1 -1
  4. package/cjs/lib/entity/vas-field.model.js +1 -1
  5. package/cjs/lib/entity/vas-field.model.js.map +1 -1
  6. package/cjs/lib/entity/vas-form.model.d.ts +1 -1
  7. package/cjs/lib/entity/vas-form.model.d.ts.map +1 -1
  8. package/cjs/lib/entity/vas-form.model.js.map +1 -1
  9. package/cjs/lib/entity/vas-job-copy.d.ts +12 -12
  10. package/cjs/lib/entity/vas-job-copy.d.ts.map +1 -1
  11. package/cjs/lib/entity/vas-job-copy.js.map +1 -1
  12. package/cjs/lib/entity/vas-job.dto.d.ts +9 -3
  13. package/cjs/lib/entity/vas-job.dto.d.ts.map +1 -1
  14. package/cjs/lib/entity/vas-job.dto.js.map +1 -1
  15. package/cjs/lib/entity/vas-job.model.d.ts +25 -13
  16. package/cjs/lib/entity/vas-job.model.d.ts.map +1 -1
  17. package/cjs/lib/entity/vas-job.model.js +139 -90
  18. package/cjs/lib/entity/vas-job.model.js.map +1 -1
  19. package/cjs/lib/utils/get-value-by-path.d.ts +1 -1
  20. package/cjs/lib/utils/get-value-by-path.d.ts.map +1 -1
  21. package/cjs/lib/utils/get-value-by-path.js +4 -4
  22. package/cjs/lib/utils/get-value-by-path.js.map +1 -1
  23. package/fesm2022/ironcode-vas-lib.mjs +157 -109
  24. package/fesm2022/ironcode-vas-lib.mjs.map +1 -1
  25. package/lib/entity/vas-base.model.d.ts +1 -1
  26. package/lib/entity/vas-form.model.d.ts +1 -1
  27. package/lib/entity/vas-job-copy.d.ts +12 -12
  28. package/lib/entity/vas-job.dto.d.ts +9 -3
  29. package/lib/entity/vas-job.model.d.ts +25 -13
  30. package/lib/utils/get-value-by-path.d.ts +1 -1
  31. package/package.json +1 -1
@@ -18,7 +18,7 @@ export declare class VasBaseModel implements VasBaseDto {
18
18
  modifiedByName: string;
19
19
  constructor(id: string, created: string, serverCreated: string, createdBy: string, modified: string, serverModified: string, modifiedBy: string, createdByName: string, modifiedByName: string);
20
20
  static fromDto(dto: Partial<VasBaseDto>): VasBaseModel;
21
- static create<T extends VasBaseDto>(this: VasModelStatic<T>, user: {
21
+ static create<T extends VasBaseModel>(this: VasModelStatic<T>, user: {
22
22
  id: string;
23
23
  name: string;
24
24
  }, values?: Partial<T>): T;
@@ -4,8 +4,8 @@ import { VasControlModel } from './vas-control.model';
4
4
  import { FieldValueType } from './vas-field.dto';
5
5
  import { VasFormDto } from './vas-form.dto';
6
6
  import { VasGroupModel } from './vas-group.model';
7
- import { VasJobModel } from './vas-job.model';
8
7
  import { VasFormConfigModel } from './vas-form-config.model';
8
+ import { VasJobModel } from './vas-job.model';
9
9
  /**
10
10
  * VasFormModel
11
11
  */
@@ -1,24 +1,24 @@
1
- import { VasJobDto } from './vas-job.dto';
1
+ import { VasJobBaseDto } from './vas-job.dto';
2
2
  export interface VasJobCopyDto {
3
- accessGroup: VasJobDto['accessGroup'];
4
- jobType: VasJobDto['jobType'];
5
- jobStatus: VasJobDto['jobStatus'];
6
- jobDate: VasJobDto['jobDate'];
7
- assigneeId: VasJobDto['assigneeId'];
3
+ accessGroup: VasJobBaseDto['accessGroup'];
4
+ jobType: VasJobBaseDto['jobType'];
5
+ jobStatus: VasJobBaseDto['jobStatus'];
6
+ jobDate: VasJobBaseDto['jobDate'];
7
+ assigneeId: VasJobBaseDto['assigneeId'];
8
8
  fields: Array<string>;
9
9
  files: Array<string>;
10
10
  reports: Array<string>;
11
11
  }
12
12
  export declare class VasJobCopyModel {
13
- accessGroup: VasJobDto['accessGroup'];
14
- jobType: VasJobDto['jobType'];
15
- jobStatus: VasJobDto['jobStatus'];
16
- jobDate: VasJobDto['jobDate'];
17
- assigneeId: VasJobDto['assigneeId'];
13
+ accessGroup: VasJobBaseDto['accessGroup'];
14
+ jobType: VasJobBaseDto['jobType'];
15
+ jobStatus: VasJobBaseDto['jobStatus'];
16
+ jobDate: VasJobBaseDto['jobDate'];
17
+ assigneeId: VasJobBaseDto['assigneeId'];
18
18
  fields: Array<string>;
19
19
  files: Array<string>;
20
20
  reports: Array<string>;
21
- constructor(accessGroup: VasJobDto['accessGroup'], jobType: VasJobDto['jobType'], jobStatus: VasJobDto['jobStatus'], jobDate: VasJobDto['jobDate'], assigneeId: VasJobDto['assigneeId'], fields: Array<string>, files: Array<string>, reports: Array<string>);
21
+ constructor(accessGroup: VasJobBaseDto['accessGroup'], jobType: VasJobBaseDto['jobType'], jobStatus: VasJobBaseDto['jobStatus'], jobDate: VasJobBaseDto['jobDate'], assigneeId: VasJobBaseDto['assigneeId'], fields: Array<string>, files: Array<string>, reports: Array<string>);
22
22
  static fromDto(dto: Partial<VasJobCopyDto>): VasJobCopyModel;
23
23
  toDto(): VasJobCopyDto;
24
24
  toApiDto(): Record<string, unknown>;
@@ -1,16 +1,17 @@
1
1
  import { VasFileDto } from './vas-file.dto';
2
2
  import { VasRestrictedAccountObjectDto } from './vas-restricted-account-object.dto';
3
- import { FieldValueType } from './vas-field.dto';
3
+ import { FieldValueType, VasFieldDto } from './vas-field.dto';
4
4
  import { GeoLocation } from '../model';
5
5
  import { VasReportDto } from './vas-report.dto';
6
6
  import { VasTaskDto } from './vas-task.dto';
7
7
  import { VasNoteDto } from './vas-note.dto';
8
8
  import { VasJobEmailDto } from './vas-job-email.dto';
9
9
  import { VasInstructionDto } from './vas-instruction.dto';
10
- export interface VasJobDto extends VasRestrictedAccountObjectDto {
10
+ export interface VasJobBaseDto extends VasRestrictedAccountObjectDto {
11
11
  reference: string;
12
12
  jobDate: string;
13
13
  jobStatus: string;
14
+ jobStatusLastUpdate: string;
14
15
  jobType: string;
15
16
  assigneeId: string;
16
17
  formId: string;
@@ -20,10 +21,15 @@ export interface VasJobDto extends VasRestrictedAccountObjectDto {
20
21
  version: number;
21
22
  geoLocation: GeoLocation;
22
23
  files: Array<VasFileDto>;
23
- fields: Record<string, FieldValueType>;
24
24
  jobEmails: Array<VasJobEmailDto>;
25
25
  notes: Array<VasNoteDto>;
26
26
  reports: Array<VasReportDto>;
27
27
  tasks: Array<VasTaskDto>;
28
28
  instruction: null | VasInstructionDto;
29
29
  }
30
+ export interface VasJobRelationalDto extends VasJobBaseDto {
31
+ fields: Array<VasFieldDto>;
32
+ }
33
+ export interface VasJobDocumentDto extends VasJobBaseDto {
34
+ fields: Record<string, FieldValueType>;
35
+ }
@@ -2,7 +2,7 @@ import { VasFileDto } from './vas-file.dto';
2
2
  import { VasBaseDto } from './vas-base.dto';
3
3
  import { FieldValueType } from './vas-field.dto';
4
4
  import { VasFormModel } from './vas-form.model';
5
- import { VasJobDto } from './vas-job.dto';
5
+ import { VasJobBaseDto, VasJobDocumentDto, VasJobRelationalDto } from './vas-job.dto';
6
6
  import { VasRestrictedAccountObjectModel } from './vas-restricted-account-object.model';
7
7
  import { GeoLocation } from '../model';
8
8
  import { VasReportDto } from './vas-report.dto';
@@ -10,14 +10,15 @@ import { VasTaskDto } from './vas-task.dto';
10
10
  import { VasNoteDto } from './vas-note.dto';
11
11
  import { VasJobEmailDto } from './vas-job-email.dto';
12
12
  import { VasInstructionDto } from './vas-instruction.dto';
13
+ import { VasFieldModel } from './vas-field.model';
13
14
  export interface ParseSyntaxOptions {
14
15
  timeZoneOffset: number;
15
16
  objects?: Record<string, Partial<VasBaseDto> | Record<string, FieldValueType>>;
16
17
  }
17
18
  /**
18
- * JobModel
19
+ * VasJobBaseModel
19
20
  */
20
- export declare class VasJobModel extends VasRestrictedAccountObjectModel {
21
+ export declare abstract class VasJobBaseModel<FType extends Record<string, FieldValueType> | Array<VasFieldModel>> extends VasRestrictedAccountObjectModel {
21
22
  id: string;
22
23
  created: string;
23
24
  serverCreated: string;
@@ -32,6 +33,7 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
32
33
  reference: string;
33
34
  jobDate: string;
34
35
  jobStatus: string;
36
+ jobStatusLastUpdate: string;
35
37
  jobType: string;
36
38
  assigneeId: string;
37
39
  formId: string;
@@ -41,24 +43,19 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
41
43
  version: number;
42
44
  geoLocation: GeoLocation;
43
45
  files: Array<VasFileDto>;
44
- fields: Record<string, FieldValueType>;
46
+ fields: FType;
45
47
  jobEmails: Array<VasJobEmailDto>;
46
48
  notes: Array<VasNoteDto>;
47
49
  reports: Array<VasReportDto>;
48
50
  tasks: Array<VasTaskDto>;
49
51
  instruction: VasInstructionDto | null;
50
- constructor(id: string, created: string, serverCreated: string, createdBy: string, modified: string, serverModified: string, modifiedBy: string, createdByName: string, modifiedByName: 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, geoLocation: GeoLocation, files: Array<VasFileDto>, fields: Record<string, FieldValueType>, jobEmails: Array<VasJobEmailDto>, notes: Array<VasNoteDto>, reports: Array<VasReportDto>, tasks: Array<VasTaskDto>, instruction: VasInstructionDto | null);
52
+ constructor(id: string, created: string, serverCreated: string, createdBy: string, modified: string, serverModified: string, modifiedBy: string, createdByName: string, modifiedByName: string, account: string, accessGroup: string, reference: string, jobDate: string, jobStatus: string, jobStatusLastUpdate: string, jobType: string, assigneeId: string, formId: string, timeZoneOffset: number, pendingFields: number, childModified: string, version: number, geoLocation: GeoLocation, files: Array<VasFileDto>, fields: FType, jobEmails: Array<VasJobEmailDto>, notes: Array<VasNoteDto>, reports: Array<VasReportDto>, tasks: Array<VasTaskDto>, instruction: VasInstructionDto | null);
51
53
  get createdByDisplayName(): string;
52
54
  get modifiedByDisplayName(): string;
53
55
  /**
54
56
  * Return the list of Job properties
55
57
  */
56
58
  get staticProperties(): Set<string>;
57
- /**
58
- * @return {VasJobModel}
59
- */
60
- static empty(): VasJobModel;
61
- static fromDto(dto: Partial<VasJobDto>): VasJobModel;
62
59
  /**
63
60
  * Returns an object describing how many attachments were added to this job
64
61
  * (camera controls and files), and how many have not been uploaded yet.
@@ -73,8 +70,7 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
73
70
  /**
74
71
  * @param path path segments
75
72
  */
76
- getValueByPath<T>(path?: string | string[]): T | undefined;
77
- toDto(): VasJobDto;
73
+ getValueByPath<T>(path?: string | string[]): T | null | undefined;
78
74
  /**
79
75
  * This method will parse a syntax that allows us to build strings from the
80
76
  * values of from the job model. For example if the job model was:
@@ -106,5 +102,21 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
106
102
  * @return {object}
107
103
  */
108
104
  toApiDto(): Record<string, string | number | boolean>;
109
- static toApiPatchDto(item: Partial<VasJobDto>): Partial<VasJobDto>;
105
+ static toApiPatchDto(item: Partial<VasJobBaseDto>): Partial<VasJobBaseDto>;
106
+ }
107
+ export declare class VasJobRelationalModel extends VasJobBaseModel<Array<VasFieldModel>> {
108
+ getValueByPath<T>(path?: string | string[]): T | null | undefined;
109
+ getFieldsMap(): Record<string, FieldValueType>;
110
+ getFieldValueByPath<T extends FieldValueType>(controlName: string, path: string[]): T | null | undefined;
111
+ static fromDto(dto: Partial<VasJobRelationalDto>): VasJobRelationalModel;
112
+ static empty(): VasJobRelationalModel;
113
+ toDto(): VasJobRelationalDto;
114
+ }
115
+ export declare class VasJobDocumentModel extends VasJobBaseModel<Record<string, FieldValueType>> {
116
+ static fromRelationalDto(dto: Partial<VasJobRelationalDto>): VasJobDocumentModel;
117
+ static fromDto(dto: Partial<VasJobDocumentDto>): VasJobDocumentModel;
118
+ static empty(): VasJobDocumentModel;
119
+ toDto(): VasJobDocumentDto;
110
120
  }
121
+ /** @deprecated use either VasJobDocumentModel or VasJobRelationalModel **/
122
+ export type VasJobModel = VasJobDocumentModel | VasJobRelationalModel;
@@ -5,4 +5,4 @@
5
5
  * Path can be a string using dot notation, which can include square brackets to
6
6
  * access array positions e.g. foo.bar[0].baz
7
7
  */
8
- export declare function getValueByPath<T>(path: string | number | Array<string | number>, object: null | Record<string, any>): T | undefined;
8
+ export declare function getValueByPath<T>(path: string | number | Array<string | number>, object: null | Record<string, any>): T | null | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironcode/vas-lib",
3
- "version": "3.0.0-alpha.3",
3
+ "version": "3.0.0-alpha.5",
4
4
  "peerDependencies": {
5
5
  "angular2-uuid": "^1.1.1",
6
6
  "moment": "^2.0.0",