@ironcode/vas-lib 1.11.0 → 1.13.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.
@@ -1,5 +1,5 @@
1
- import moment from 'moment';
2
1
  import { UUID } from 'angular2-uuid';
2
+ import moment from 'moment';
3
3
 
4
4
  function isCameraControlValueV1(object) {
5
5
  return object instanceof Object
@@ -58,7 +58,7 @@ class VasBaseModel {
58
58
  }
59
59
  }
60
60
 
61
- class VasUserModel extends VasBaseModel {
61
+ class VasAccountObjectModel extends VasBaseModel {
62
62
  id;
63
63
  created;
64
64
  serverCreated;
@@ -68,12 +68,8 @@ class VasUserModel extends VasBaseModel {
68
68
  modifiedBy;
69
69
  createdByName;
70
70
  modifiedByName;
71
- email;
72
- name;
73
- username;
74
- memberships;
75
- instructionProviders;
76
- constructor(id, created = '', serverCreated = '', createdBy = '', modified = '', serverModified = '', modifiedBy = '', createdByName, modifiedByName, email, name, username, memberships, instructionProviders) {
71
+ account;
72
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account) {
77
73
  super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName);
78
74
  this.id = id;
79
75
  this.created = created;
@@ -84,152 +80,15 @@ class VasUserModel extends VasBaseModel {
84
80
  this.modifiedBy = modifiedBy;
85
81
  this.createdByName = createdByName;
86
82
  this.modifiedByName = modifiedByName;
87
- this.email = email;
88
- this.name = name;
89
- this.username = username;
90
- this.memberships = memberships;
91
- this.instructionProviders = instructionProviders;
92
- }
93
- static fromDto(dto) {
94
- return new VasUserModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.email || '', dto.name || '', dto.username || '', dto.memberships || [], dto.instructionProviders || []);
95
- }
96
- toDto() {
97
- return {
98
- id: this.id,
99
- created: this.created,
100
- serverCreated: this.serverCreated,
101
- createdBy: this.createdBy,
102
- modified: this.modified,
103
- serverModified: this.serverModified,
104
- modifiedBy: this.modifiedBy,
105
- createdByName: this.createdByName,
106
- modifiedByName: this.modifiedByName,
107
- email: this.email,
108
- name: this.name,
109
- username: this.username,
110
- memberships: this.memberships,
111
- instructionProviders: this.instructionProviders
112
- };
113
- }
114
- }
115
-
116
- class VasFireUserModel extends VasUserModel {
117
- id;
118
- created;
119
- serverCreated;
120
- createdBy;
121
- modified;
122
- serverModified;
123
- modifiedBy;
124
- createdByName;
125
- modifiedByName;
126
- email;
127
- name;
128
- username;
129
- memberships;
130
- instructionProviders;
131
- accounts;
132
- tokens;
133
- topics;
134
- language;
135
- displayName;
136
- constructor(id, created = '', serverCreated = '', createdBy = '', modified = '', serverModified = '', modifiedBy = '', createdByName, modifiedByName, email, name, username, memberships, instructionProviders, accounts, tokens, topics, language, displayName) {
137
- super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, email, name, username, memberships, instructionProviders);
138
- this.id = id;
139
- this.created = created;
140
- this.serverCreated = serverCreated;
141
- this.createdBy = createdBy;
142
- this.modified = modified;
143
- this.serverModified = serverModified;
144
- this.modifiedBy = modifiedBy;
145
- this.createdByName = createdByName;
146
- this.modifiedByName = modifiedByName;
147
- this.email = email;
148
- this.name = name;
149
- this.username = username;
150
- this.memberships = memberships;
151
- this.instructionProviders = instructionProviders;
152
- this.accounts = accounts;
153
- this.tokens = tokens;
154
- this.topics = topics;
155
- this.language = language;
156
- this.displayName = displayName;
157
- }
158
- static fromDto(dto) {
159
- return new VasFireUserModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.email || '', dto.name || '', dto.username || '', dto.memberships || [], dto.instructionProviders || [], dto.accounts || {}, dto.tokens || [], dto.topics || [], dto.language || '', dto.displayName || '');
160
- }
161
- static newUser(uid, displayName, email) {
162
- return new VasFireUserModel(uid, moment().toISOString(), moment().toISOString(), uid, moment().toISOString(), moment().toISOString(), uid, '', '', email, displayName, email, [], [], {}, [], [], '', displayName);
83
+ this.account = account;
163
84
  }
164
- toDto() {
85
+ toApiDto(options) {
165
86
  return {
166
87
  id: this.id,
167
88
  created: this.created,
168
- serverCreated: this.serverCreated,
169
- createdBy: this.createdBy,
170
- modified: this.modified,
171
- serverModified: this.serverModified,
172
- modifiedBy: this.modifiedBy,
173
- createdByName: this.createdByName,
174
- modifiedByName: this.modifiedByName,
175
- email: this.email,
176
- name: this.name,
177
- username: this.username,
178
- memberships: this.memberships,
179
- instructionProviders: this.instructionProviders,
180
- accounts: this.accounts,
181
- tokens: this.tokens,
182
- topics: this.topics,
183
- language: this.language,
184
- displayName: this.displayName
89
+ modified: this.modified
185
90
  };
186
91
  }
187
- /**
188
- * Adds token to tokens list if it is not already present
189
- * @param token the new token
190
- */
191
- addToken(token) {
192
- if (this.tokens.includes(token)) {
193
- return;
194
- }
195
- this.tokens.push(token);
196
- }
197
- /**
198
- * Remove token from tokens list
199
- * @param token the token to remove
200
- */
201
- removeToken(token) {
202
- this.tokens = this.tokens.filter(t => t !== token);
203
- }
204
- /**
205
- * Resets the tokens list
206
- */
207
- resetTokens() {
208
- this.tokens = [];
209
- }
210
- /**
211
- * Adds topic to topics list if it is not already present
212
- * @param topic the new token
213
- */
214
- addTopic(topic) {
215
- if (this.topics.includes(topic)) {
216
- return;
217
- }
218
- this.topics.push(topic);
219
- }
220
- /**
221
- * Remove topic from topic list
222
- * @param topic the topic to remove
223
- */
224
- removeTopic(topic) {
225
- this.topics = this.topics.filter(t => t !== topic);
226
- }
227
- /**
228
- * Resets the topic list
229
- */
230
- resetTopics() {
231
- this.topics = [];
232
- }
233
92
  }
234
93
 
235
94
  var VasAccountIndexingMode;
@@ -239,39 +98,6 @@ var VasAccountIndexingMode;
239
98
  VasAccountIndexingMode[VasAccountIndexingMode["ON_REPORT"] = 2] = "ON_REPORT";
240
99
  })(VasAccountIndexingMode || (VasAccountIndexingMode = {}));
241
100
 
242
- class VasAccountObjectModel extends VasBaseModel {
243
- id;
244
- created;
245
- serverCreated;
246
- createdBy;
247
- modified;
248
- serverModified;
249
- modifiedBy;
250
- createdByName;
251
- modifiedByName;
252
- account;
253
- constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account) {
254
- super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName);
255
- this.id = id;
256
- this.created = created;
257
- this.serverCreated = serverCreated;
258
- this.createdBy = createdBy;
259
- this.modified = modified;
260
- this.serverModified = serverModified;
261
- this.modifiedBy = modifiedBy;
262
- this.createdByName = createdByName;
263
- this.modifiedByName = modifiedByName;
264
- this.account = account;
265
- }
266
- toApiDto(options) {
267
- return {
268
- id: this.id,
269
- created: this.created,
270
- modified: this.modified
271
- };
272
- }
273
- }
274
-
275
101
  class VasRestrictedAccountObjectModel extends VasAccountObjectModel {
276
102
  id;
277
103
  created;
@@ -1138,10 +964,7 @@ class VasFileModel extends VasJobDataModel {
1138
964
  }
1139
965
  }
1140
966
 
1141
- /**
1142
- * GroupModel
1143
- */
1144
- class VasGroupModel extends VasRestrictedAccountObjectModel {
967
+ class VasUserModel extends VasBaseModel {
1145
968
  id;
1146
969
  created;
1147
970
  serverCreated;
@@ -1151,20 +974,13 @@ class VasGroupModel extends VasRestrictedAccountObjectModel {
1151
974
  modifiedBy;
1152
975
  createdByName;
1153
976
  modifiedByName;
1154
- account;
1155
- accessGroup;
977
+ email;
1156
978
  name;
1157
- title;
1158
- description;
1159
- sequence;
1160
- includeInSummary;
1161
- forms;
1162
- visibilityControl;
1163
- visibleIfEquals;
1164
- controls;
1165
- scoreWeight;
1166
- constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup, name, title, description, sequence, includeInSummary, forms, visibilityControl, visibleIfEquals, controls, scoreWeight) {
1167
- super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup);
979
+ username;
980
+ memberships;
981
+ instructionProviders;
982
+ constructor(id, created = '', serverCreated = '', createdBy = '', modified = '', serverModified = '', modifiedBy = '', createdByName, modifiedByName, email, name, username, memberships, instructionProviders) {
983
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName);
1168
984
  this.id = id;
1169
985
  this.created = created;
1170
986
  this.serverCreated = serverCreated;
@@ -1174,50 +990,15 @@ class VasGroupModel extends VasRestrictedAccountObjectModel {
1174
990
  this.modifiedBy = modifiedBy;
1175
991
  this.createdByName = createdByName;
1176
992
  this.modifiedByName = modifiedByName;
1177
- this.account = account;
1178
- this.accessGroup = accessGroup;
993
+ this.email = email;
1179
994
  this.name = name;
1180
- this.title = title;
1181
- this.description = description;
1182
- this.sequence = sequence;
1183
- this.includeInSummary = includeInSummary;
1184
- this.forms = forms;
1185
- this.visibilityControl = visibilityControl;
1186
- this.visibleIfEquals = visibleIfEquals;
1187
- this.controls = controls;
1188
- this.scoreWeight = scoreWeight;
995
+ this.username = username;
996
+ this.memberships = memberships;
997
+ this.instructionProviders = instructionProviders;
1189
998
  }
1190
- /**
1191
- * @param {VasGroupDto} dto
1192
- * @return {VasGroupModel}
1193
- */
1194
999
  static fromDto(dto) {
1195
- return new VasGroupModel(
1196
- // eslint-disable-next-line new-cap
1197
- dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', dto.name || '', dto.title || '', dto.description || '', dto.sequence || 0, dto.includeInSummary || false, dto.forms || [], dto.visibilityControl || '', dto.visibleIfEquals || '', (dto.controls || [])
1198
- .filter(control => control.name.startsWith('fields.'))
1199
- .sort((a, b) => a.sequence - b.sequence)
1200
- .map(c => VasControlModel.fromDto(c)), dto.scoreWeight || 1);
1201
- }
1202
- /**
1203
- * @param {Array<VasControlModel>} valuesByControlId
1204
- * @return {boolean}
1205
- */
1206
- isVisible(valuesByControlId) {
1207
- if (!this.visibilityControl || !this.visibleIfEquals) {
1208
- return true;
1209
- }
1210
- const control = valuesByControlId
1211
- .find(c => c.id === this.visibilityControl);
1212
- if (!control) {
1213
- console.warn(`control with id ${this.visibilityControl} not found`);
1214
- return true;
1215
- }
1216
- return (control.value || '').toString() === this.visibleIfEquals;
1000
+ return new VasUserModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.email || '', dto.name || '', dto.username || '', dto.memberships || [], dto.instructionProviders || []);
1217
1001
  }
1218
- /**
1219
- * @return {VasGroupDto}
1220
- */
1221
1002
  toDto() {
1222
1003
  return {
1223
1004
  id: this.id,
@@ -1229,38 +1010,131 @@ class VasGroupModel extends VasRestrictedAccountObjectModel {
1229
1010
  modifiedBy: this.modifiedBy,
1230
1011
  createdByName: this.createdByName,
1231
1012
  modifiedByName: this.modifiedByName,
1232
- account: this.account,
1233
- accessGroup: this.accessGroup,
1013
+ email: this.email,
1234
1014
  name: this.name,
1235
- title: this.title,
1236
- description: this.description,
1237
- sequence: this.sequence,
1238
- includeInSummary: this.includeInSummary,
1239
- forms: this.forms,
1240
- visibilityControl: this.visibilityControl,
1241
- visibleIfEquals: this.visibleIfEquals,
1242
- controls: this.controls.map(control => control.toDto()),
1243
- scoreWeight: this.scoreWeight
1015
+ username: this.username,
1016
+ memberships: this.memberships,
1017
+ instructionProviders: this.instructionProviders
1244
1018
  };
1245
1019
  }
1246
- toApiDto(options) {
1020
+ }
1021
+
1022
+ class VasFireUserModel extends VasUserModel {
1023
+ id;
1024
+ created;
1025
+ serverCreated;
1026
+ createdBy;
1027
+ modified;
1028
+ serverModified;
1029
+ modifiedBy;
1030
+ createdByName;
1031
+ modifiedByName;
1032
+ email;
1033
+ name;
1034
+ username;
1035
+ memberships;
1036
+ instructionProviders;
1037
+ accounts;
1038
+ tokens;
1039
+ topics;
1040
+ language;
1041
+ displayName;
1042
+ constructor(id, created = '', serverCreated = '', createdBy = '', modified = '', serverModified = '', modifiedBy = '', createdByName, modifiedByName, email, name, username, memberships, instructionProviders, accounts, tokens, topics, language, displayName) {
1043
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, email, name, username, memberships, instructionProviders);
1044
+ this.id = id;
1045
+ this.created = created;
1046
+ this.serverCreated = serverCreated;
1047
+ this.createdBy = createdBy;
1048
+ this.modified = modified;
1049
+ this.serverModified = serverModified;
1050
+ this.modifiedBy = modifiedBy;
1051
+ this.createdByName = createdByName;
1052
+ this.modifiedByName = modifiedByName;
1053
+ this.email = email;
1054
+ this.name = name;
1055
+ this.username = username;
1056
+ this.memberships = memberships;
1057
+ this.instructionProviders = instructionProviders;
1058
+ this.accounts = accounts;
1059
+ this.tokens = tokens;
1060
+ this.topics = topics;
1061
+ this.language = language;
1062
+ this.displayName = displayName;
1063
+ }
1064
+ static fromDto(dto) {
1065
+ return new VasFireUserModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.email || '', dto.name || '', dto.username || '', dto.memberships || [], dto.instructionProviders || [], dto.accounts || {}, dto.tokens || [], dto.topics || [], dto.language || '', dto.displayName || '');
1066
+ }
1067
+ static newUser(uid, displayName, email) {
1068
+ return new VasFireUserModel(uid, moment().toISOString(), moment().toISOString(), uid, moment().toISOString(), moment().toISOString(), uid, '', '', email, displayName, email, [], [], {}, [], [], '', displayName);
1069
+ }
1070
+ toDto() {
1247
1071
  return {
1248
- ...super.toApiDto(options),
1249
- name: this.name || '~',
1250
- title: this.title || '~',
1251
- sequence: this.sequence || 0,
1252
- includeInSummary: this.includeInSummary
1072
+ id: this.id,
1073
+ created: this.created,
1074
+ serverCreated: this.serverCreated,
1075
+ createdBy: this.createdBy,
1076
+ modified: this.modified,
1077
+ serverModified: this.serverModified,
1078
+ modifiedBy: this.modifiedBy,
1079
+ createdByName: this.createdByName,
1080
+ modifiedByName: this.modifiedByName,
1081
+ email: this.email,
1082
+ name: this.name,
1083
+ username: this.username,
1084
+ memberships: this.memberships,
1085
+ instructionProviders: this.instructionProviders,
1086
+ accounts: this.accounts,
1087
+ tokens: this.tokens,
1088
+ topics: this.topics,
1089
+ language: this.language,
1090
+ displayName: this.displayName
1253
1091
  };
1254
1092
  }
1255
- static toApiPatchDto(item) {
1256
- return only(item, [
1257
- 'created',
1258
- 'modified',
1259
- 'name',
1260
- 'title',
1261
- 'sequence',
1262
- 'includeInSummary'
1263
- ]);
1093
+ /**
1094
+ * Adds token to tokens list if it is not already present
1095
+ * @param token the new token
1096
+ */
1097
+ addToken(token) {
1098
+ if (this.tokens.includes(token)) {
1099
+ return;
1100
+ }
1101
+ this.tokens.push(token);
1102
+ }
1103
+ /**
1104
+ * Remove token from tokens list
1105
+ * @param token the token to remove
1106
+ */
1107
+ removeToken(token) {
1108
+ this.tokens = this.tokens.filter(t => t !== token);
1109
+ }
1110
+ /**
1111
+ * Resets the tokens list
1112
+ */
1113
+ resetTokens() {
1114
+ this.tokens = [];
1115
+ }
1116
+ /**
1117
+ * Adds topic to topics list if it is not already present
1118
+ * @param topic the new token
1119
+ */
1120
+ addTopic(topic) {
1121
+ if (this.topics.includes(topic)) {
1122
+ return;
1123
+ }
1124
+ this.topics.push(topic);
1125
+ }
1126
+ /**
1127
+ * Remove topic from topic list
1128
+ * @param topic the topic to remove
1129
+ */
1130
+ removeTopic(topic) {
1131
+ this.topics = this.topics.filter(t => t !== topic);
1132
+ }
1133
+ /**
1134
+ * Resets the topic list
1135
+ */
1136
+ resetTopics() {
1137
+ this.topics = [];
1264
1138
  }
1265
1139
  }
1266
1140
 
@@ -1297,6 +1171,132 @@ class VasFormConfigModel {
1297
1171
  }
1298
1172
  }
1299
1173
 
1174
+ /**
1175
+ * GroupModel
1176
+ */
1177
+ class VasGroupModel extends VasRestrictedAccountObjectModel {
1178
+ id;
1179
+ created;
1180
+ serverCreated;
1181
+ createdBy;
1182
+ modified;
1183
+ serverModified;
1184
+ modifiedBy;
1185
+ createdByName;
1186
+ modifiedByName;
1187
+ account;
1188
+ accessGroup;
1189
+ name;
1190
+ title;
1191
+ description;
1192
+ sequence;
1193
+ includeInSummary;
1194
+ forms;
1195
+ visibilityControl;
1196
+ visibleIfEquals;
1197
+ controls;
1198
+ scoreWeight;
1199
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup, name, title, description, sequence, includeInSummary, forms, visibilityControl, visibleIfEquals, controls, scoreWeight) {
1200
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, accessGroup);
1201
+ this.id = id;
1202
+ this.created = created;
1203
+ this.serverCreated = serverCreated;
1204
+ this.createdBy = createdBy;
1205
+ this.modified = modified;
1206
+ this.serverModified = serverModified;
1207
+ this.modifiedBy = modifiedBy;
1208
+ this.createdByName = createdByName;
1209
+ this.modifiedByName = modifiedByName;
1210
+ this.account = account;
1211
+ this.accessGroup = accessGroup;
1212
+ this.name = name;
1213
+ this.title = title;
1214
+ this.description = description;
1215
+ this.sequence = sequence;
1216
+ this.includeInSummary = includeInSummary;
1217
+ this.forms = forms;
1218
+ this.visibilityControl = visibilityControl;
1219
+ this.visibleIfEquals = visibleIfEquals;
1220
+ this.controls = controls;
1221
+ this.scoreWeight = scoreWeight;
1222
+ }
1223
+ /**
1224
+ * @param {VasGroupDto} dto
1225
+ * @return {VasGroupModel}
1226
+ */
1227
+ static fromDto(dto) {
1228
+ return new VasGroupModel(
1229
+ // eslint-disable-next-line new-cap
1230
+ dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', dto.name || '', dto.title || '', dto.description || '', dto.sequence || 0, dto.includeInSummary || false, dto.forms || [], dto.visibilityControl || '', dto.visibleIfEquals || '', (dto.controls || [])
1231
+ .filter(control => control.name.startsWith('fields.'))
1232
+ .sort((a, b) => a.sequence - b.sequence)
1233
+ .map(c => VasControlModel.fromDto(c)), dto.scoreWeight || 1);
1234
+ }
1235
+ /**
1236
+ * @param {Array<VasControlModel>} valuesByControlId
1237
+ * @return {boolean}
1238
+ */
1239
+ isVisible(valuesByControlId) {
1240
+ if (!this.visibilityControl || !this.visibleIfEquals) {
1241
+ return true;
1242
+ }
1243
+ const control = valuesByControlId
1244
+ .find(c => c.id === this.visibilityControl);
1245
+ if (!control) {
1246
+ console.warn(`control with id ${this.visibilityControl} not found`);
1247
+ return true;
1248
+ }
1249
+ return (control.value || '').toString() === this.visibleIfEquals;
1250
+ }
1251
+ /**
1252
+ * @return {VasGroupDto}
1253
+ */
1254
+ toDto() {
1255
+ return {
1256
+ id: this.id,
1257
+ created: this.created,
1258
+ serverCreated: this.serverCreated,
1259
+ createdBy: this.createdBy,
1260
+ modified: this.modified,
1261
+ serverModified: this.serverModified,
1262
+ modifiedBy: this.modifiedBy,
1263
+ createdByName: this.createdByName,
1264
+ modifiedByName: this.modifiedByName,
1265
+ account: this.account,
1266
+ accessGroup: this.accessGroup,
1267
+ name: this.name,
1268
+ title: this.title,
1269
+ description: this.description,
1270
+ sequence: this.sequence,
1271
+ includeInSummary: this.includeInSummary,
1272
+ forms: this.forms,
1273
+ visibilityControl: this.visibilityControl,
1274
+ visibleIfEquals: this.visibleIfEquals,
1275
+ controls: this.controls.map(control => control.toDto()),
1276
+ scoreWeight: this.scoreWeight
1277
+ };
1278
+ }
1279
+ toApiDto(options) {
1280
+ return {
1281
+ ...super.toApiDto(options),
1282
+ name: this.name || '~',
1283
+ title: this.title || '~',
1284
+ sequence: this.sequence || 0,
1285
+ includeInSummary: this.includeInSummary
1286
+ };
1287
+ }
1288
+ static toApiPatchDto(item) {
1289
+ return only(item, [
1290
+ 'created',
1291
+ 'modified',
1292
+ 'name',
1293
+ 'title',
1294
+ 'sequence',
1295
+ 'includeInSummary'
1296
+ ]);
1297
+ }
1298
+ }
1299
+
1300
1300
  /**
1301
1301
  * VasFormModel
1302
1302
  */
@@ -1528,15 +1528,10 @@ class VasFormModel extends VasRestrictedAccountObjectModel {
1528
1528
  }
1529
1529
  }
1530
1530
 
1531
- var VasInvitationTypeEnum;
1532
- (function (VasInvitationTypeEnum) {
1533
- VasInvitationTypeEnum["TYPE_VAS_DESKTOP"] = "vas-desktop";
1534
- VasInvitationTypeEnum["TYPE_VAS_MOBILE"] = "vas-mobile";
1535
- VasInvitationTypeEnum["TYPE_VAS_PORTAL"] = "vas-portal";
1536
- VasInvitationTypeEnum["TYPE_P2C_DESKTOP"] = "p2c-desktop";
1537
- VasInvitationTypeEnum["TYPE_P2C_MOBILE"] = "p2c-mobile";
1538
- })(VasInvitationTypeEnum || (VasInvitationTypeEnum = {}));
1539
- class VasInvitationModel extends VasAccountObjectModel {
1531
+ /**
1532
+ * VasInstructionJobFieldModel
1533
+ */
1534
+ class VasInstructionJobFieldModel extends VasBaseModel {
1540
1535
  id;
1541
1536
  created;
1542
1537
  serverCreated;
@@ -1546,18 +1541,13 @@ class VasInvitationModel extends VasAccountObjectModel {
1546
1541
  modifiedBy;
1547
1542
  createdByName;
1548
1543
  modifiedByName;
1549
- account;
1550
- secret;
1551
- type;
1552
- accessGroups;
1553
- contactTypes;
1554
- jobStatuses;
1555
- jobTypes;
1556
- lookupTypes;
1557
- taskTypes;
1558
- instructionProviders;
1559
- constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, secret, type, accessGroups, contactTypes, jobStatuses, jobTypes, lookupTypes, taskTypes, instructionProviders) {
1560
- super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account);
1544
+ value;
1545
+ name;
1546
+ title;
1547
+ sequence;
1548
+ controlType;
1549
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, value, name, title, sequence, controlType) {
1550
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName);
1561
1551
  this.id = id;
1562
1552
  this.created = created;
1563
1553
  this.serverCreated = serverCreated;
@@ -1567,70 +1557,35 @@ class VasInvitationModel extends VasAccountObjectModel {
1567
1557
  this.modifiedBy = modifiedBy;
1568
1558
  this.createdByName = createdByName;
1569
1559
  this.modifiedByName = modifiedByName;
1570
- this.account = account;
1571
- this.secret = secret;
1572
- this.type = type;
1573
- this.accessGroups = accessGroups;
1574
- this.contactTypes = contactTypes;
1575
- this.jobStatuses = jobStatuses;
1576
- this.jobTypes = jobTypes;
1577
- this.lookupTypes = lookupTypes;
1578
- this.taskTypes = taskTypes;
1579
- this.instructionProviders = instructionProviders;
1560
+ this.value = value;
1561
+ this.name = name;
1562
+ this.title = title;
1563
+ this.sequence = sequence;
1564
+ this.controlType = controlType;
1565
+ }
1566
+ static empty() {
1567
+ return new VasInstructionJobFieldModel('', '', '', '', '', '', '', '', '', '', '', '', 0, '');
1568
+ }
1569
+ static fromDto(dto) {
1570
+ return new VasInstructionJobFieldModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.value || '', dto.name || '', dto.title || '', dto.sequence || 0, dto.controlType || '');
1580
1571
  }
1581
1572
  toDto() {
1582
1573
  return {
1583
1574
  id: this.id,
1584
1575
  created: this.created,
1585
1576
  serverCreated: this.serverCreated,
1586
- createdBy: this.createdBy,
1587
- modified: this.modified,
1588
- serverModified: this.serverModified,
1589
- modifiedBy: this.modifiedBy,
1590
- createdByName: this.createdByName,
1591
- modifiedByName: this.modifiedByName,
1592
- account: this.account,
1593
- secret: this.secret,
1594
- type: this.type,
1595
- accessGroups: this.accessGroups,
1596
- contactTypes: this.contactTypes,
1597
- jobStatuses: this.jobStatuses,
1598
- jobTypes: this.jobTypes,
1599
- lookupTypes: this.lookupTypes,
1600
- taskTypes: this.taskTypes,
1601
- instructionProviders: this.instructionProviders,
1602
- };
1603
- }
1604
- static fromDto(dto) {
1605
- return new VasInvitationModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.secret || '', dto.type || VasInvitationTypeEnum.TYPE_VAS_PORTAL, dto.accessGroups || [], dto.contactTypes || [], dto.jobStatuses || [], dto.jobTypes || [], dto.lookupTypes || [], dto.taskTypes || [], dto.instructionProviders || []);
1606
- }
1607
- toApiDto(options) {
1608
- const dto = {
1609
- ...super.toApiDto(),
1610
- type: this.type
1611
- };
1612
- if (this.accessGroups.length) {
1613
- dto['accessGroups'] = this.accessGroups.map(d => d.id);
1614
- }
1615
- if (this.contactTypes.length) {
1616
- dto['contactTypes'] = this.contactTypes.map(d => d.id);
1617
- }
1618
- if (this.jobStatuses.length) {
1619
- dto['jobStatuses'] = this.jobStatuses.map(d => d.id);
1620
- }
1621
- if (this.jobTypes.length) {
1622
- dto['jobTypes'] = this.jobTypes.map(d => d.id);
1623
- }
1624
- if (this.lookupTypes.length) {
1625
- dto['lookupTypes'] = this.lookupTypes.map(d => d.id);
1626
- }
1627
- if (this.taskTypes.length) {
1628
- dto['taskTypes'] = this.taskTypes.map(d => d.id);
1629
- }
1630
- if (this.instructionProviders.length) {
1631
- dto['instructionProviders'] = this.instructionProviders.map(d => d.id);
1632
- }
1633
- return dto;
1577
+ createdBy: this.createdBy,
1578
+ modified: this.modified,
1579
+ serverModified: this.serverModified,
1580
+ modifiedBy: this.modifiedBy,
1581
+ createdByName: this.createdByName,
1582
+ modifiedByName: this.modifiedByName,
1583
+ value: this.value,
1584
+ name: this.name,
1585
+ title: this.title,
1586
+ sequence: this.sequence,
1587
+ controlType: this.controlType
1588
+ };
1634
1589
  }
1635
1590
  }
1636
1591
 
@@ -1713,67 +1668,6 @@ class VasNoteModel extends VasJobDataModel {
1713
1668
  }
1714
1669
  }
1715
1670
 
1716
- /**
1717
- * VasInstructionJobFieldModel
1718
- */
1719
- class VasInstructionJobFieldModel extends VasBaseModel {
1720
- id;
1721
- created;
1722
- serverCreated;
1723
- createdBy;
1724
- modified;
1725
- serverModified;
1726
- modifiedBy;
1727
- createdByName;
1728
- modifiedByName;
1729
- value;
1730
- name;
1731
- title;
1732
- sequence;
1733
- controlType;
1734
- constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, value, name, title, sequence, controlType) {
1735
- super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName);
1736
- this.id = id;
1737
- this.created = created;
1738
- this.serverCreated = serverCreated;
1739
- this.createdBy = createdBy;
1740
- this.modified = modified;
1741
- this.serverModified = serverModified;
1742
- this.modifiedBy = modifiedBy;
1743
- this.createdByName = createdByName;
1744
- this.modifiedByName = modifiedByName;
1745
- this.value = value;
1746
- this.name = name;
1747
- this.title = title;
1748
- this.sequence = sequence;
1749
- this.controlType = controlType;
1750
- }
1751
- static empty() {
1752
- return new VasInstructionJobFieldModel('', '', '', '', '', '', '', '', '', '', '', '', 0, '');
1753
- }
1754
- static fromDto(dto) {
1755
- return new VasInstructionJobFieldModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.value || '', dto.name || '', dto.title || '', dto.sequence || 0, dto.controlType || '');
1756
- }
1757
- toDto() {
1758
- return {
1759
- id: this.id,
1760
- created: this.created,
1761
- serverCreated: this.serverCreated,
1762
- createdBy: this.createdBy,
1763
- modified: this.modified,
1764
- serverModified: this.serverModified,
1765
- modifiedBy: this.modifiedBy,
1766
- createdByName: this.createdByName,
1767
- modifiedByName: this.modifiedByName,
1768
- value: this.value,
1769
- name: this.name,
1770
- title: this.title,
1771
- sequence: this.sequence,
1772
- controlType: this.controlType
1773
- };
1774
- }
1775
- }
1776
-
1777
1671
  class VasReportModel extends VasJobDataModel {
1778
1672
  id;
1779
1673
  created;
@@ -2095,6 +1989,181 @@ class VasInstructionModel extends VasAccountObjectModel {
2095
1989
  }
2096
1990
  }
2097
1991
 
1992
+ var VasInvitationTypeEnum;
1993
+ (function (VasInvitationTypeEnum) {
1994
+ VasInvitationTypeEnum["TYPE_VAS_DESKTOP"] = "vas-desktop";
1995
+ VasInvitationTypeEnum["TYPE_VAS_MOBILE"] = "vas-mobile";
1996
+ VasInvitationTypeEnum["TYPE_VAS_PORTAL"] = "vas-portal";
1997
+ VasInvitationTypeEnum["TYPE_P2C_DESKTOP"] = "p2c-desktop";
1998
+ VasInvitationTypeEnum["TYPE_P2C_MOBILE"] = "p2c-mobile";
1999
+ })(VasInvitationTypeEnum || (VasInvitationTypeEnum = {}));
2000
+ class VasInvitationModel extends VasAccountObjectModel {
2001
+ id;
2002
+ created;
2003
+ serverCreated;
2004
+ createdBy;
2005
+ modified;
2006
+ serverModified;
2007
+ modifiedBy;
2008
+ createdByName;
2009
+ modifiedByName;
2010
+ account;
2011
+ secret;
2012
+ type;
2013
+ accessGroups;
2014
+ contactTypes;
2015
+ jobStatuses;
2016
+ jobTypes;
2017
+ lookupTypes;
2018
+ taskTypes;
2019
+ instructionProviders;
2020
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, secret, type, accessGroups, contactTypes, jobStatuses, jobTypes, lookupTypes, taskTypes, instructionProviders) {
2021
+ super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account);
2022
+ this.id = id;
2023
+ this.created = created;
2024
+ this.serverCreated = serverCreated;
2025
+ this.createdBy = createdBy;
2026
+ this.modified = modified;
2027
+ this.serverModified = serverModified;
2028
+ this.modifiedBy = modifiedBy;
2029
+ this.createdByName = createdByName;
2030
+ this.modifiedByName = modifiedByName;
2031
+ this.account = account;
2032
+ this.secret = secret;
2033
+ this.type = type;
2034
+ this.accessGroups = accessGroups;
2035
+ this.contactTypes = contactTypes;
2036
+ this.jobStatuses = jobStatuses;
2037
+ this.jobTypes = jobTypes;
2038
+ this.lookupTypes = lookupTypes;
2039
+ this.taskTypes = taskTypes;
2040
+ this.instructionProviders = instructionProviders;
2041
+ }
2042
+ toDto() {
2043
+ return {
2044
+ id: this.id,
2045
+ created: this.created,
2046
+ serverCreated: this.serverCreated,
2047
+ createdBy: this.createdBy,
2048
+ modified: this.modified,
2049
+ serverModified: this.serverModified,
2050
+ modifiedBy: this.modifiedBy,
2051
+ createdByName: this.createdByName,
2052
+ modifiedByName: this.modifiedByName,
2053
+ account: this.account,
2054
+ secret: this.secret,
2055
+ type: this.type,
2056
+ accessGroups: this.accessGroups,
2057
+ contactTypes: this.contactTypes,
2058
+ jobStatuses: this.jobStatuses,
2059
+ jobTypes: this.jobTypes,
2060
+ lookupTypes: this.lookupTypes,
2061
+ taskTypes: this.taskTypes,
2062
+ instructionProviders: this.instructionProviders,
2063
+ };
2064
+ }
2065
+ static fromDto(dto) {
2066
+ return new VasInvitationModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.secret || '', dto.type || VasInvitationTypeEnum.TYPE_VAS_PORTAL, dto.accessGroups || [], dto.contactTypes || [], dto.jobStatuses || [], dto.jobTypes || [], dto.lookupTypes || [], dto.taskTypes || [], dto.instructionProviders || []);
2067
+ }
2068
+ toApiDto(options) {
2069
+ const dto = {
2070
+ ...super.toApiDto(),
2071
+ type: this.type
2072
+ };
2073
+ if (this.accessGroups.length) {
2074
+ dto['accessGroups'] = this.accessGroups.map(d => d.id);
2075
+ }
2076
+ if (this.contactTypes.length) {
2077
+ dto['contactTypes'] = this.contactTypes.map(d => d.id);
2078
+ }
2079
+ if (this.jobStatuses.length) {
2080
+ dto['jobStatuses'] = this.jobStatuses.map(d => d.id);
2081
+ }
2082
+ if (this.jobTypes.length) {
2083
+ dto['jobTypes'] = this.jobTypes.map(d => d.id);
2084
+ }
2085
+ if (this.lookupTypes.length) {
2086
+ dto['lookupTypes'] = this.lookupTypes.map(d => d.id);
2087
+ }
2088
+ if (this.taskTypes.length) {
2089
+ dto['taskTypes'] = this.taskTypes.map(d => d.id);
2090
+ }
2091
+ if (this.instructionProviders.length) {
2092
+ dto['instructionProviders'] = this.instructionProviders.map(d => d.id);
2093
+ }
2094
+ return dto;
2095
+ }
2096
+ }
2097
+
2098
+ const isJobAutomationStep = (step) => {
2099
+ return step && step.type === 'automation';
2100
+ };
2101
+ const isJobControlsStep = (step) => {
2102
+ return step && step.type === 'controls';
2103
+ };
2104
+ const isJobEmailFormStep = (step) => {
2105
+ return step && step.type === 'email-form';
2106
+ };
2107
+ const isJobNotePromptStep = (step) => {
2108
+ return step && step.type === 'note-prompt';
2109
+ };
2110
+ const isJobSetDatetimeStep = (step) => {
2111
+ return step && step.type === 'set-datetime';
2112
+ };
2113
+ const isJobSetJobStatusStep = (step) => {
2114
+ return step && step.type === 'set-job-status';
2115
+ };
2116
+ const isJobSetValueStep = (step) => {
2117
+ return step && step.type === 'set-value';
2118
+ };
2119
+
2120
+ class VasJobCopyModel {
2121
+ accessGroup;
2122
+ jobType;
2123
+ jobStatus;
2124
+ jobDate;
2125
+ assigneeId;
2126
+ fields;
2127
+ files;
2128
+ reports;
2129
+ constructor(accessGroup, jobType, jobStatus, jobDate, assigneeId, fields, files, reports) {
2130
+ this.accessGroup = accessGroup;
2131
+ this.jobType = jobType;
2132
+ this.jobStatus = jobStatus;
2133
+ this.jobDate = jobDate;
2134
+ this.assigneeId = assigneeId;
2135
+ this.fields = fields;
2136
+ this.files = files;
2137
+ this.reports = reports;
2138
+ }
2139
+ static fromDto(dto) {
2140
+ return new VasJobCopyModel(dto.accessGroup || '', dto.jobType || '', dto.jobStatus || '', dto.jobDate || '', dto.assigneeId || '', dto.fields || [], dto.files || [], dto.reports || []);
2141
+ }
2142
+ toDto() {
2143
+ return {
2144
+ accessGroup: this.accessGroup,
2145
+ jobType: this.jobType,
2146
+ jobStatus: this.jobStatus,
2147
+ jobDate: this.jobDate,
2148
+ assigneeId: this.assigneeId,
2149
+ fields: this.fields,
2150
+ files: this.files,
2151
+ reports: this.reports,
2152
+ };
2153
+ }
2154
+ toApiDto() {
2155
+ return {
2156
+ jobType: this.jobType,
2157
+ jobStatus: this.jobStatus,
2158
+ jobDate: this.jobDate,
2159
+ assigneeId: this.assigneeId,
2160
+ fields: this.fields,
2161
+ files: this.files,
2162
+ reports: this.reports,
2163
+ };
2164
+ }
2165
+ }
2166
+
2098
2167
  class VasJobEmailModel extends VasJobDataModel {
2099
2168
  id;
2100
2169
  created;
@@ -2827,25 +2896,6 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
2827
2896
  }
2828
2897
  }
2829
2898
 
2830
- const isJobAutomationStep = (step) => {
2831
- return step && step.type === 'automation';
2832
- };
2833
- const isJobControlsStep = (step) => {
2834
- return step && step.type === 'controls';
2835
- };
2836
- const isJobEmailFormStep = (step) => {
2837
- return step && step.type === 'email-form';
2838
- };
2839
- const isJobSetJobStatusStep = (step) => {
2840
- return step && step.type === 'set-job-status';
2841
- };
2842
- const isJobSetDatetimeStep = (step) => {
2843
- return step && step.type === 'set-datetime';
2844
- };
2845
- const isJobSetValueStep = (step) => {
2846
- return step && step.type === 'set-value';
2847
- };
2848
-
2849
2899
  /**
2850
2900
  * VasLookupModel
2851
2901
  */
@@ -3287,5 +3337,5 @@ class VasVehicleModel extends VasAccountObjectModel {
3287
3337
  * Generated bundle index. Do not edit.
3288
3338
  */
3289
3339
 
3290
- export { VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormConfigModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobDataModel, VasJobEmailModel, VasJobModel, VasLookupModel, VasMembershipModel, VasNoteModel, VasReportLayoutModel, VasReportModel, VasReportRequestModel, VasRestrictedAccountObjectModel, VasTaskModel, VasUserModel, VasVehicleModel, getEmptyGeoLocation, isCameraControlValueV1, isFileDto, isJobAutomationStep, isJobControlsStep, isJobEmailFormStep, isJobSetDatetimeStep, isJobSetJobStatusStep, isJobSetValueStep, prepareFieldApiValue };
3340
+ export { VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormConfigModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobCopyModel, VasJobDataModel, VasJobEmailModel, VasJobModel, VasLookupModel, VasMembershipModel, VasNoteModel, VasReportLayoutModel, VasReportModel, VasReportRequestModel, VasRestrictedAccountObjectModel, VasTaskModel, VasUserModel, VasVehicleModel, getEmptyGeoLocation, isCameraControlValueV1, isFileDto, isJobAutomationStep, isJobControlsStep, isJobEmailFormStep, isJobNotePromptStep, isJobSetDatetimeStep, isJobSetJobStatusStep, isJobSetValueStep, prepareFieldApiValue };
3291
3341
  //# sourceMappingURL=ironcode-vas-lib.mjs.map