@ironcode/vas-lib 1.8.0-alpha.7 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/cjs/lib/entity/index.d.ts +1 -0
  2. package/cjs/lib/entity/index.d.ts.map +1 -1
  3. package/cjs/lib/entity/index.js +1 -0
  4. package/cjs/lib/entity/index.js.map +1 -1
  5. package/cjs/lib/entity/vas-base.model.d.ts +1 -2
  6. package/cjs/lib/entity/vas-base.model.d.ts.map +1 -1
  7. package/cjs/lib/entity/vas-base.model.js +1 -1
  8. package/cjs/lib/entity/vas-base.model.js.map +1 -1
  9. package/cjs/lib/entity/vas-contact.model.d.ts.map +1 -1
  10. package/cjs/lib/entity/vas-contact.model.js +2 -0
  11. package/cjs/lib/entity/vas-contact.model.js.map +1 -1
  12. package/cjs/lib/entity/vas-control.model.d.ts +2 -1
  13. package/cjs/lib/entity/vas-control.model.d.ts.map +1 -1
  14. package/cjs/lib/entity/vas-control.model.js +21 -1
  15. package/cjs/lib/entity/vas-control.model.js.map +1 -1
  16. package/cjs/lib/entity/vas-field.model.d.ts +10 -9
  17. package/cjs/lib/entity/vas-field.model.d.ts.map +1 -1
  18. package/cjs/lib/entity/vas-field.model.js +43 -27
  19. package/cjs/lib/entity/vas-field.model.js.map +1 -1
  20. package/cjs/lib/entity/vas-file.model.d.ts +1 -0
  21. package/cjs/lib/entity/vas-file.model.d.ts.map +1 -1
  22. package/cjs/lib/entity/vas-file.model.js +10 -0
  23. package/cjs/lib/entity/vas-file.model.js.map +1 -1
  24. package/cjs/lib/entity/vas-form-config.dto.d.ts +2 -23
  25. package/cjs/lib/entity/vas-form-config.dto.d.ts.map +1 -1
  26. package/cjs/lib/entity/vas-form-config.dto.js.map +1 -1
  27. package/cjs/lib/entity/vas-form.model.d.ts +1 -0
  28. package/cjs/lib/entity/vas-form.model.d.ts.map +1 -1
  29. package/cjs/lib/entity/vas-form.model.js +12 -1
  30. package/cjs/lib/entity/vas-form.model.js.map +1 -1
  31. package/cjs/lib/entity/vas-group.model.d.ts +1 -0
  32. package/cjs/lib/entity/vas-group.model.d.ts.map +1 -1
  33. package/cjs/lib/entity/vas-group.model.js +11 -0
  34. package/cjs/lib/entity/vas-group.model.js.map +1 -1
  35. package/cjs/lib/entity/vas-job-action.dto.d.ts +67 -0
  36. package/cjs/lib/entity/vas-job-action.dto.d.ts.map +1 -0
  37. package/cjs/lib/entity/vas-job-action.dto.js +20 -0
  38. package/cjs/lib/entity/vas-job-action.dto.js.map +1 -0
  39. package/cjs/lib/entity/vas-job-email.model.d.ts +2 -0
  40. package/cjs/lib/entity/vas-job-email.model.d.ts.map +1 -1
  41. package/cjs/lib/entity/vas-job-email.model.js +15 -9
  42. package/cjs/lib/entity/vas-job-email.model.js.map +1 -1
  43. package/cjs/lib/entity/vas-job.dto.d.ts +10 -2
  44. package/cjs/lib/entity/vas-job.dto.d.ts.map +1 -1
  45. package/cjs/lib/entity/vas-job.dto.js.map +1 -1
  46. package/cjs/lib/entity/vas-job.model.d.ts +13 -4
  47. package/cjs/lib/entity/vas-job.model.d.ts.map +1 -1
  48. package/cjs/lib/entity/vas-job.model.js +46 -16
  49. package/cjs/lib/entity/vas-job.model.js.map +1 -1
  50. package/cjs/lib/entity/vas-lookup.model.d.ts +1 -0
  51. package/cjs/lib/entity/vas-lookup.model.d.ts.map +1 -1
  52. package/cjs/lib/entity/vas-lookup.model.js +13 -1
  53. package/cjs/lib/entity/vas-lookup.model.js.map +1 -1
  54. package/cjs/lib/entity/vas-note.model.d.ts +1 -0
  55. package/cjs/lib/entity/vas-note.model.d.ts.map +1 -1
  56. package/cjs/lib/entity/vas-note.model.js +9 -0
  57. package/cjs/lib/entity/vas-note.model.js.map +1 -1
  58. package/cjs/lib/entity/vas-report.dto.d.ts +1 -1
  59. package/cjs/lib/entity/vas-report.dto.d.ts.map +1 -1
  60. package/cjs/lib/entity/vas-report.dto.js.map +1 -1
  61. package/cjs/lib/entity/vas-report.model.d.ts +5 -2
  62. package/cjs/lib/entity/vas-report.model.d.ts.map +1 -1
  63. package/cjs/lib/entity/vas-report.model.js +15 -4
  64. package/cjs/lib/entity/vas-report.model.js.map +1 -1
  65. package/cjs/lib/entity/vas-task.model.d.ts +1 -0
  66. package/cjs/lib/entity/vas-task.model.d.ts.map +1 -1
  67. package/cjs/lib/entity/vas-task.model.js +12 -0
  68. package/cjs/lib/entity/vas-task.model.js.map +1 -1
  69. package/cjs/lib/entity/vas-vehicle.model.d.ts.map +1 -1
  70. package/cjs/lib/entity/vas-vehicle.model.js.map +1 -1
  71. package/fesm2022/ironcode-vas-lib.mjs +222 -62
  72. package/fesm2022/ironcode-vas-lib.mjs.map +1 -1
  73. package/lib/entity/index.d.ts +1 -0
  74. package/lib/entity/vas-base.model.d.ts +1 -2
  75. package/lib/entity/vas-control.model.d.ts +2 -1
  76. package/lib/entity/vas-field.model.d.ts +10 -9
  77. package/lib/entity/vas-file.model.d.ts +1 -0
  78. package/lib/entity/vas-form-config.dto.d.ts +2 -23
  79. package/lib/entity/vas-form.model.d.ts +1 -0
  80. package/lib/entity/vas-group.model.d.ts +1 -0
  81. package/lib/entity/vas-job-action.dto.d.ts +66 -0
  82. package/lib/entity/vas-job-email.model.d.ts +2 -0
  83. package/lib/entity/vas-job.dto.d.ts +10 -2
  84. package/lib/entity/vas-job.model.d.ts +13 -4
  85. package/lib/entity/vas-lookup.model.d.ts +1 -0
  86. package/lib/entity/vas-note.model.d.ts +1 -0
  87. package/lib/entity/vas-report.dto.d.ts +1 -1
  88. package/lib/entity/vas-report.model.d.ts +5 -2
  89. package/lib/entity/vas-task.model.d.ts +1 -0
  90. package/package.json +1 -1
@@ -40,6 +40,7 @@ export * from './vas-job-email.dto';
40
40
  export * from './vas-job-email.model';
41
41
  export * from './vas-job.dto';
42
42
  export * from './vas-job.model';
43
+ export * from './vas-job-action.dto';
43
44
  export * from './vas-job-status.dto';
44
45
  export * from './vas-job-type.dto';
45
46
  export * from './vas-lookup.dto';
@@ -1,5 +1,5 @@
1
1
  import { VasBaseDto } from './vas-base.dto';
2
- interface VasModelStatic<T extends VasBaseModel> {
2
+ export interface VasModelStatic<T extends VasBaseModel> {
3
3
  new (...args: any[]): T;
4
4
  fromDto(dto: Partial<VasBaseDto>): T;
5
5
  }
@@ -23,4 +23,3 @@ export declare class VasBaseModel implements VasBaseDto {
23
23
  name: string;
24
24
  }, values?: Partial<T>): T;
25
25
  }
26
- export {};
@@ -1,7 +1,7 @@
1
1
  import { VasControlTypeModel } from './vas-control-type.model';
2
2
  import { VasControlDto } from './vas-control.dto';
3
3
  import { VasRestrictedAccountObjectModel } from './vas-restricted-account-object.model';
4
- import { VasFieldDtoValue } from "./vas-field.dto";
4
+ import { VasFieldDtoValue } from './vas-field.dto';
5
5
  export declare type VasControlModelDefaultValueType = string | number | object;
6
6
  /**
7
7
  * ControlModel
@@ -68,4 +68,5 @@ export declare class VasControlModel extends VasRestrictedAccountObjectModel {
68
68
  */
69
69
  toDto(): VasControlDto;
70
70
  toApiDto(options?: any): Record<string, any>;
71
+ static toApiPatchDto(item: Partial<VasControlDto>): Partial<VasControlDto>;
71
72
  }
@@ -1,5 +1,14 @@
1
1
  import { VasFieldDto, VasFieldDtoValue } from './vas-field.dto';
2
2
  import { VasJobDataModel } from './vas-job-data.model';
3
+ /**
4
+ * Prepares the value to be sent to the API. The api will only accept strings,
5
+ * numbers and booleans, thus if we have an array or object, we need to JSON
6
+ * encode it
7
+ * @param {VasFieldDto} value
8
+ * @return {string | number | boolean}
9
+ * @protected
10
+ */
11
+ export declare const prepareFieldApiValue: (value: VasFieldDtoValue) => string | number | boolean;
3
12
  /**
4
13
  * VasFieldModel
5
14
  */
@@ -36,13 +45,5 @@ export declare class VasFieldModel extends VasJobDataModel {
36
45
  * @return {object}
37
46
  */
38
47
  toApiDto(): Record<string, string | number | boolean>;
39
- /**
40
- * Prepares the value to be sent to the API. The api will only accept strings,
41
- * numbers and booleans, thus if we have an array or object, we need to JSON
42
- * encode it
43
- * @param {VasFieldDto} value
44
- * @return {string | number | boolean}
45
- * @protected
46
- */
47
- protected prepareApiValue(value: VasFieldDtoValue): string | number | boolean;
48
+ static toApiPatchDto(item: Partial<VasFieldDto>): Partial<VasFieldDto>;
48
49
  }
@@ -39,4 +39,5 @@ export declare class VasFileModel extends VasJobDataModel {
39
39
  stringifyConfig(config: VasFileDtoConfigDto): string;
40
40
  toApiDto(options?: VasFileModelToApiDtoOptions): Record<string, string | number | boolean>;
41
41
  protected safeNumber(value: number): number;
42
+ static toApiPatchDto(item: Partial<VasFileDto>): Partial<VasFileDto>;
42
43
  }
@@ -1,25 +1,4 @@
1
- /**
2
- * Describes an action that can be performed on jobs created by this form
3
- */
4
- export interface VasFormActionDto {
5
- title: string;
6
- instruction?: {
7
- instructionProviderId: string;
8
- linkControl: string;
9
- };
10
- updates?: {
11
- promptNote: boolean;
12
- changes: Array<{
13
- controlName: string;
14
- value: string | '$now';
15
- }>;
16
- };
17
- automation?: {
18
- promptNote: boolean;
19
- url: string;
20
- key: string;
21
- };
22
- }
1
+ import { VasJobActionDto } from './vas-job-action.dto';
23
2
  export interface VasFormConfigDto {
24
3
  emailRecipients?: {
25
4
  job: Array<{
@@ -27,5 +6,5 @@ export interface VasFormConfigDto {
27
6
  }>;
28
7
  static: Array<string>;
29
8
  };
30
- actions?: Array<VasFormActionDto>;
9
+ actions?: Array<VasJobActionDto>;
31
10
  }
@@ -89,4 +89,5 @@ export declare class VasFormModel extends VasRestrictedAccountObjectModel {
89
89
  */
90
90
  toDto(): VasFormDto;
91
91
  toApiDto(options?: any): Record<string, any>;
92
+ static toApiPatchDto(item: Partial<VasFormDto>): Partial<VasFormDto>;
92
93
  }
@@ -46,4 +46,5 @@ export declare class VasGroupModel extends VasRestrictedAccountObjectModel {
46
46
  */
47
47
  toDto(): VasGroupDto;
48
48
  toApiDto(options?: any): Record<string, any>;
49
+ static toApiPatchDto(item: Partial<VasGroupDto>): Partial<VasGroupDto>;
49
50
  }
@@ -0,0 +1,66 @@
1
+ export declare type VasJobActionStepStage = 'initializing' | 'running' | 'succeeded' | 'failed';
2
+ export interface VasJobActionStepDto {
3
+ id: string;
4
+ type: 'automation' | 'controls' | 'email-form' | 'instruction' | 'set-job-status';
5
+ stage: VasJobActionStepStage;
6
+ }
7
+ /**
8
+ * Describes an action that can be performed on a job
9
+ */
10
+ export interface VasJobActionDto {
11
+ id: string;
12
+ title: string;
13
+ steps: Array<VasJobActionStepDto>;
14
+ succeededControl?: string;
15
+ jobStatuses?: Array<string>;
16
+ context: 'portal-instruction' | 'job-form';
17
+ }
18
+ /**
19
+ * Automation steps allow us to send the job along with some configuration
20
+ * parameters to some backend automation
21
+ */
22
+ export interface VasJobActionAutomationStepDto extends VasJobActionStepDto {
23
+ type: 'automation';
24
+ url: string;
25
+ params?: Record<string, any>;
26
+ }
27
+ export declare const isJobAutomationStep: (step: VasJobActionStepDto) => step is VasJobActionAutomationStepDto;
28
+ /**
29
+ * Controls step allow us to specify a number of controls to present to the user
30
+ */
31
+ export interface VasJobActionControlsStepDto extends VasJobActionStepDto {
32
+ type: 'controls';
33
+ controlNames: Array<string>;
34
+ }
35
+ export declare const isJobControlsStep: (step: VasJobActionStepDto) => step is VasJobActionControlsStepDto;
36
+ /**
37
+ * Email form step allow us to present the email form with some values already
38
+ * set
39
+ */
40
+ export interface VasJobActionEmailFormStepDto extends VasJobActionStepDto {
41
+ type: 'email-form';
42
+ params: {
43
+ $recipients: Array<string>;
44
+ $subject: string;
45
+ $body: Array<string>;
46
+ };
47
+ }
48
+ export declare const isJobEmailFormStep: (step: VasJobActionStepDto) => step is VasJobActionEmailFormStepDto;
49
+ /**
50
+ * This step is designed to allow us to add an action button that will be
51
+ * displayed on the instruction. If the user invokes the action, a form will be
52
+ * displayed. The form id is discovered by looking up the instruction provider.
53
+ */
54
+ export interface VasJobActionInstructionStepDto extends VasJobActionStepDto {
55
+ type: 'instruction';
56
+ instructionProviderId: string;
57
+ linkControl: string;
58
+ }
59
+ /**
60
+ * SetJobStatus step allow us set the job status to some value
61
+ */
62
+ export interface VasJobActionSetJobStatusStepDto extends VasJobActionStepDto {
63
+ type: 'set-job-status';
64
+ value: string;
65
+ }
66
+ export declare const isJobSetJobStatusStep: (step: VasJobActionStepDto) => step is VasJobActionSetJobStatusStepDto;
@@ -1,5 +1,6 @@
1
1
  import { VasJobDataModel } from './vas-job-data.model';
2
2
  import { VasJobEmailDto } from './vas-job-email.dto';
3
+ import { VasNoteDto } from './vas-note.dto';
3
4
  export declare class VasJobEmailModel extends VasJobDataModel {
4
5
  id: string;
5
6
  created: string;
@@ -27,4 +28,5 @@ export declare class VasJobEmailModel extends VasJobDataModel {
27
28
  static fromDto(dto: Partial<VasJobEmailDto>): VasJobEmailModel;
28
29
  toDto(): VasJobEmailDto;
29
30
  toApiDto(options?: any): Record<string, any>;
31
+ static toApiPatchDto(item: Partial<VasNoteDto>): Partial<VasNoteDto>;
30
32
  }
@@ -2,6 +2,10 @@ 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
4
  import { GeoLocation } from '../model/geo-location';
5
+ import { VasReportDto } from './vas-report.dto';
6
+ import { VasTaskDto } from './vas-task.dto';
7
+ import { VasNoteDto } from './vas-note.dto';
8
+ import { VasJobEmailDto } from './vas-job-email.dto';
5
9
  export interface VasJobStaticDto extends VasRestrictedAccountObjectDto {
6
10
  reference: string;
7
11
  jobDate: string;
@@ -13,10 +17,14 @@ export interface VasJobStaticDto extends VasRestrictedAccountObjectDto {
13
17
  pendingFields: number;
14
18
  childModified: string;
15
19
  version: number;
16
- files: Array<VasFileDto>;
17
- fields: Array<VasFieldDto>;
18
20
  createdByDisplayName: string;
19
21
  modifiedByDisplayName: string;
20
22
  geoLocation: GeoLocation;
23
+ files: Array<VasFileDto>;
24
+ fields: Array<VasFieldDto>;
25
+ jobEmails: Array<VasJobEmailDto>;
26
+ notes: Array<VasNoteDto>;
27
+ reports: Array<VasReportDto>;
28
+ tasks: Array<VasTaskDto>;
21
29
  }
22
30
  export declare type VasJobDto = VasJobStaticDto & Record<string, VasFieldDtoValue>;
@@ -4,8 +4,12 @@ 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
+ import { GeoLocation } from '../model';
8
8
  import { VasFormDto } from './vas-form.dto';
9
+ import { VasReportDto } from './vas-report.dto';
10
+ import { VasTaskDto } from './vas-task.dto';
11
+ import { VasNoteDto } from './vas-note.dto';
12
+ import { VasJobEmailDto } from './vas-job-email.dto';
9
13
  export declare interface VasJobModelDynamicInterface {
10
14
  [s: string]: string | number | Record<string, VasFieldDtoValue>;
11
15
  }
@@ -38,12 +42,16 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
38
42
  pendingFields: number;
39
43
  childModified: string;
40
44
  version: number;
41
- fields: Array<VasFieldDto>;
42
- files: Array<VasFileDto>;
43
45
  createdByDisplayName: string;
44
46
  modifiedByDisplayName: string;
45
47
  geoLocation: GeoLocation;
46
- 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, fields: Array<VasFieldDto>, files: Array<VasFileDto>, createdByDisplayName: string, modifiedByDisplayName: string, geoLocation: GeoLocation);
48
+ files: Array<VasFileDto>;
49
+ fields: Array<VasFieldDto>;
50
+ jobEmails: Array<VasJobEmailDto>;
51
+ notes: Array<VasNoteDto>;
52
+ reports: Array<VasReportDto>;
53
+ tasks: Array<VasTaskDto>;
54
+ 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, createdByDisplayName: string, modifiedByDisplayName: string, geoLocation: GeoLocation, files: Array<VasFileDto>, fields: Array<VasFieldDto>, jobEmails: Array<VasJobEmailDto>, notes: Array<VasNoteDto>, reports: Array<VasReportDto>, tasks: Array<VasTaskDto>);
47
55
  /**
48
56
  * Returns this with the dynamic interface
49
57
  * @return {VasJobModelDynamicInterface}
@@ -219,4 +227,5 @@ export declare class VasJobModel extends VasRestrictedAccountObjectModel {
219
227
  * @return {object}
220
228
  */
221
229
  toApiDto(): Record<string, string | number | boolean>;
230
+ static toApiPatchDto(item: Partial<VasJobDto>): Partial<VasJobDto>;
222
231
  }
@@ -30,4 +30,5 @@ export declare class VasLookupModel extends VasRestrictedAccountObjectModel impl
30
30
  */
31
31
  toDto(): VasLookupDto;
32
32
  toApiDto(options?: any): Record<string, string | number | boolean>;
33
+ static toApiPatchDto(item: Partial<VasLookupDto>): Partial<VasLookupDto>;
33
34
  }
@@ -28,4 +28,5 @@ export declare class VasNoteModel extends VasJobDataModel implements VasNoteDto
28
28
  */
29
29
  toDto(): VasNoteDto;
30
30
  toApiDto(options?: any): Record<string, string | number | boolean>;
31
+ static toApiPatchDto(item: Partial<VasNoteDto>): Partial<VasNoteDto>;
31
32
  }
@@ -1,6 +1,6 @@
1
1
  import { VasJobDataDto } from './vas-job-data.dto';
2
2
  export interface VasReportDto extends VasJobDataDto {
3
- reportLayoutId: string;
3
+ reportLayout: string;
4
4
  title: string;
5
5
  sendEmail: string;
6
6
  message: string;
@@ -1,5 +1,6 @@
1
1
  import { VasJobDataModel } from './vas-job-data.model';
2
2
  import { VasReportDto } from './vas-report.dto';
3
+ import { VasTaskDto } from './vas-task.dto';
3
4
  export declare class VasReportModel extends VasJobDataModel implements VasReportDto {
4
5
  id: string;
5
6
  created: string;
@@ -12,7 +13,7 @@ export declare class VasReportModel extends VasJobDataModel implements VasReport
12
13
  modifiedByName: string;
13
14
  account: string;
14
15
  job: string;
15
- reportLayoutId: string;
16
+ reportLayout: string;
16
17
  title: string;
17
18
  sendEmail: string;
18
19
  message: string;
@@ -21,8 +22,10 @@ export declare class VasReportModel extends VasJobDataModel implements VasReport
21
22
  succeeded: string;
22
23
  attempts: number;
23
24
  notificationId: string;
24
- constructor(id: string, created: string, serverCreated: string, createdBy: string, modified: string, serverModified: string, modifiedBy: string, createdByName: string, modifiedByName: string, account: string, job: string, reportLayoutId: string, title: string, sendEmail: string, message: string, attempted: string, completed: string, succeeded: string, attempts: number, notificationId: string);
25
+ constructor(id: string, created: string, serverCreated: string, createdBy: string, modified: string, serverModified: string, modifiedBy: string, createdByName: string, modifiedByName: string, account: string, job: string, reportLayout: string, title: string, sendEmail: string, message: string, attempted: string, completed: string, succeeded: string, attempts: number, notificationId: string);
25
26
  static empty(): VasReportModel;
26
27
  static fromDto(dto: Partial<VasReportModel>): VasReportModel;
27
28
  toDto(): VasReportDto;
29
+ toApiDto(options?: any): Record<string, any>;
30
+ static toApiPatchDto(item: Partial<VasTaskDto>): Partial<VasTaskDto>;
28
31
  }
@@ -32,4 +32,5 @@ export declare class VasTaskModel extends VasJobDataModel {
32
32
  */
33
33
  toDto(): VasTaskDto;
34
34
  toApiDto(options?: any): Record<string, any>;
35
+ static toApiPatchDto(item: Partial<VasTaskDto>): Partial<VasTaskDto>;
35
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironcode/vas-lib",
3
- "version": "1.8.0-alpha.7",
3
+ "version": "1.8.0",
4
4
  "peerDependencies": {
5
5
  "angular2-uuid": "^1.1.1",
6
6
  "moment": "^2.0.0"