@ironcode/vas-lib 1.5.2 → 1.6.2

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 (45) hide show
  1. package/cjs/lib/entity/index.d.ts +2 -1
  2. package/cjs/lib/entity/index.d.ts.map +1 -1
  3. package/cjs/lib/entity/index.js +2 -1
  4. package/cjs/lib/entity/index.js.map +1 -1
  5. package/cjs/lib/entity/vas-form-config.dto.d.ts +19 -1
  6. package/cjs/lib/entity/vas-form-config.dto.d.ts.map +1 -1
  7. package/cjs/lib/entity/vas-form-config.dto.js.map +1 -1
  8. package/cjs/lib/entity/vas-form-config.model.d.ts +22 -0
  9. package/cjs/lib/entity/vas-form-config.model.d.ts.map +1 -0
  10. package/cjs/lib/entity/vas-form-config.model.js +35 -0
  11. package/cjs/lib/entity/vas-form-config.model.js.map +1 -0
  12. package/cjs/lib/entity/vas-form.model.d.ts +3 -2
  13. package/cjs/lib/entity/vas-form.model.d.ts.map +1 -1
  14. package/cjs/lib/entity/vas-form.model.js +3 -2
  15. package/cjs/lib/entity/vas-form.model.js.map +1 -1
  16. package/cjs/lib/entity/vas-instruction-provider.dto.d.ts +1 -0
  17. package/cjs/lib/entity/vas-instruction-provider.dto.d.ts.map +1 -1
  18. package/cjs/lib/entity/vas-instruction-provider.dto.js.map +1 -1
  19. package/cjs/lib/entity/vas-instruction-provider.model.d.ts +2 -1
  20. package/cjs/lib/entity/vas-instruction-provider.model.d.ts.map +1 -1
  21. package/cjs/lib/entity/vas-instruction-provider.model.js +6 -4
  22. package/cjs/lib/entity/vas-instruction-provider.model.js.map +1 -1
  23. package/cjs/lib/entity/vas-job.model.d.ts +4 -3
  24. package/cjs/lib/entity/vas-job.model.d.ts.map +1 -1
  25. package/cjs/lib/entity/vas-job.model.js +3 -2
  26. package/cjs/lib/entity/vas-job.model.js.map +1 -1
  27. package/esm2020/lib/entity/index.mjs +3 -2
  28. package/esm2020/lib/entity/vas-form-config.dto.mjs +1 -1
  29. package/esm2020/lib/entity/vas-form-config.model.mjs +31 -0
  30. package/esm2020/lib/entity/vas-form.model.mjs +4 -3
  31. package/esm2020/lib/entity/vas-instruction-provider.dto.mjs +1 -1
  32. package/esm2020/lib/entity/vas-instruction-provider.model.mjs +8 -5
  33. package/esm2020/lib/entity/vas-job.model.mjs +4 -3
  34. package/fesm2015/ironcode-vas-lib.mjs +43 -9
  35. package/fesm2015/ironcode-vas-lib.mjs.map +1 -1
  36. package/fesm2020/ironcode-vas-lib.mjs +44 -9
  37. package/fesm2020/ironcode-vas-lib.mjs.map +1 -1
  38. package/lib/entity/index.d.ts +2 -1
  39. package/lib/entity/vas-form-config.dto.d.ts +19 -1
  40. package/lib/entity/vas-form-config.model.d.ts +21 -0
  41. package/lib/entity/vas-form.model.d.ts +3 -2
  42. package/lib/entity/vas-instruction-provider.dto.d.ts +1 -0
  43. package/lib/entity/vas-instruction-provider.model.d.ts +2 -1
  44. package/lib/entity/vas-job.model.d.ts +4 -3
  45. package/package.json +1 -1
@@ -951,6 +951,37 @@ class VasGroupModel extends VasRestrictedAccountObjectModel {
951
951
  }
952
952
  }
953
953
 
954
+ class VasFormConfigModel {
955
+ constructor(emailRecipients, actions) {
956
+ this.emailRecipients = emailRecipients;
957
+ this.actions = actions;
958
+ }
959
+ toDto() {
960
+ return {
961
+ emailRecipients: this.emailRecipients,
962
+ actions: this.actions
963
+ };
964
+ }
965
+ toJsonString() {
966
+ return JSON.stringify(this.toDto());
967
+ }
968
+ static create() {
969
+ return new VasFormConfigModel();
970
+ }
971
+ static fromDto(dto) {
972
+ return new VasFormConfigModel(dto.emailRecipients, dto.actions);
973
+ }
974
+ static fromJsonString(value) {
975
+ try {
976
+ const dto = JSON.parse(value || '{}');
977
+ return VasFormConfigModel.fromDto(dto);
978
+ }
979
+ catch (e) {
980
+ return VasFormConfigModel.create();
981
+ }
982
+ }
983
+ }
984
+
954
985
  /**
955
986
  * VasFormModel
956
987
  */
@@ -1032,7 +1063,7 @@ class VasFormModel extends VasRestrictedAccountObjectModel {
1032
1063
  static fromDto(dto) {
1033
1064
  return new VasFormModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.accessGroup || '', dto.jobType || '', dto.title || '', dto.description || '', (dto.groups || [])
1034
1065
  .sort((a, b) => a.sequence - b.sequence)
1035
- .map(g => VasGroupModel.fromDto(g)), dto.dynamicDescriptor || '', dto.indexName || '', dto.pipelineName || '', dto.config || '', dto.geoLocationEnabled || false, dto.filesEnabled || false);
1066
+ .map(g => VasGroupModel.fromDto(g)), dto.dynamicDescriptor || '', dto.indexName || '', dto.pipelineName || '', VasFormConfigModel.fromJsonString(dto.config), dto.geoLocationEnabled || false, dto.filesEnabled || false);
1036
1067
  }
1037
1068
  /**
1038
1069
  * @param {string} id
@@ -1126,7 +1157,7 @@ class VasFormModel extends VasRestrictedAccountObjectModel {
1126
1157
  dynamicDescriptor: this.dynamicDescriptor,
1127
1158
  indexName: this.indexName,
1128
1159
  pipelineName: this.pipelineName,
1129
- config: this.config,
1160
+ config: this.config.toJsonString(),
1130
1161
  geoLocationEnabled: this.geoLocationEnabled,
1131
1162
  filesEnabled: this.filesEnabled
1132
1163
  };
@@ -1469,7 +1500,7 @@ class VasInstructionJobModel extends VasBaseModel {
1469
1500
  * VasInstructionProviderModel
1470
1501
  */
1471
1502
  class VasInstructionProviderModel extends VasAccountObjectModel {
1472
- constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, form, title, secret, portalEnabled) {
1503
+ constructor(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account, form, title, secret, portalEnabled, portalVisible) {
1473
1504
  super(id, created, serverCreated, createdBy, modified, serverModified, modifiedBy, createdByName, modifiedByName, account);
1474
1505
  this.id = id;
1475
1506
  this.created = created;
@@ -1485,6 +1516,7 @@ class VasInstructionProviderModel extends VasAccountObjectModel {
1485
1516
  this.title = title;
1486
1517
  this.secret = secret;
1487
1518
  this.portalEnabled = portalEnabled;
1519
+ this.portalVisible = portalVisible;
1488
1520
  }
1489
1521
  /**
1490
1522
  * @param dto VasInstructionDto
@@ -1493,7 +1525,7 @@ class VasInstructionProviderModel extends VasAccountObjectModel {
1493
1525
  static fromDto(dto) {
1494
1526
  return new VasInstructionProviderModel(dto.id || '', dto.created || '', dto.serverCreated || '', dto.createdBy || '', dto.modified || '', dto.serverModified || '', dto.modifiedBy || '', dto.createdByName || '', dto.modifiedByName || '', dto.account || '', dto.form ?
1495
1527
  VasFormModel.fromDto(dto.form) :
1496
- VasFormModel.empty(), dto.title || '', dto.secret || '', dto.portalEnabled || false);
1528
+ VasFormModel.empty(), dto.title || '', dto.secret || '', dto.portalEnabled || false, dto.portalVisible || true);
1497
1529
  }
1498
1530
  /**
1499
1531
  * @returns VasNoteDto
@@ -1513,7 +1545,8 @@ class VasInstructionProviderModel extends VasAccountObjectModel {
1513
1545
  form: this.form.toDto(),
1514
1546
  title: this.title,
1515
1547
  secret: this.secret,
1516
- portalEnabled: this.portalEnabled
1548
+ portalEnabled: this.portalEnabled,
1549
+ portalVisible: this.portalVisible
1517
1550
  };
1518
1551
  }
1519
1552
  toApiDto(options) {
@@ -1521,7 +1554,8 @@ class VasInstructionProviderModel extends VasAccountObjectModel {
1521
1554
  ...super.toApiDto(options),
1522
1555
  title: this.title,
1523
1556
  form: this.form.id,
1524
- portalEnabled: this.portalEnabled
1557
+ portalEnabled: this.portalEnabled,
1558
+ portalVisible: this.portalVisible
1525
1559
  };
1526
1560
  }
1527
1561
  }
@@ -1843,8 +1877,9 @@ class VasJobModel extends VasRestrictedAccountObjectModel {
1843
1877
  /**
1844
1878
  * Will return an object whose keys are the names of all fields in the job.
1845
1879
  * This method is similar to `getFields` except that this method will only
1846
- * return values where a value was set, as opposed to `getFields` which
1847
- * return a property regardless (because it uses the form to drive the logic)
1880
+ * return values where a value was set, as opposed to `getFields` which will
1881
+ * return a value for every control even if not value was set, because it uses
1882
+ * the form to drive the logic
1848
1883
  * @return {Record<string, VasFieldDtoValue>}
1849
1884
  */
1850
1885
  getFields2() {
@@ -2401,5 +2436,5 @@ class VasVehicleModel extends VasAccountObjectModel {
2401
2436
  * Generated bundle index. Do not edit.
2402
2437
  */
2403
2438
 
2404
- export { VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobDataModel, VasJobEmailModel, VasJobModel, VasMembershipModel, VasNoteModel, VasReportLayoutModel, VasReportModel, VasReportRequestModel, VasRestrictedAccountObjectModel, VasUserModel, VasVehicleModel, getEmptyGeoLocation, isCameraControlValueV1, isFileDto };
2439
+ export { VasAccountIndexingMode, VasAccountObjectModel, VasBaseModel, VasBranchModel, VasContactModel, VasControlConfigDirection, VasControlModel, VasControlTypeModel, VasFieldModel, VasFileModel, VasFireUserModel, VasFormConfigModel, VasFormModel, VasGroupModel, VasInstructionJobFieldModel, VasInstructionJobModel, VasInstructionModel, VasInstructionProviderModel, VasInvitationModel, VasInvitationTypeEnum, VasJobDataModel, VasJobEmailModel, VasJobModel, VasMembershipModel, VasNoteModel, VasReportLayoutModel, VasReportModel, VasReportRequestModel, VasRestrictedAccountObjectModel, VasUserModel, VasVehicleModel, getEmptyGeoLocation, isCameraControlValueV1, isFileDto };
2405
2440
  //# sourceMappingURL=ironcode-vas-lib.mjs.map