@degenerate/generic 0.1.8 → 0.1.10

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 (47) hide show
  1. package/dist/application/audit-log/create-application-audit-log.d.ts.map +1 -1
  2. package/dist/application/audit-log/create-application-audit-log.js +1 -1
  3. package/dist/application/database/firestore/generics/add-items-to-database.d.ts.map +1 -1
  4. package/dist/application/database/firestore/generics/add-items-to-database.js +2 -2
  5. package/dist/application/database/firestore/generics/add-or-update-items-to-database.d.ts.map +1 -1
  6. package/dist/application/database/firestore/generics/add-or-update-items-to-database.js +3 -3
  7. package/dist/application/database/firestore/generics/delete-items-on-database.d.ts.map +1 -1
  8. package/dist/application/database/firestore/generics/delete-items-on-database.js +2 -2
  9. package/dist/application/database/firestore/generics/get-item-from-database.d.ts.map +1 -1
  10. package/dist/application/database/firestore/generics/get-item-from-database.js +2 -2
  11. package/dist/application/database/firestore/generics/get-items-different-path-on-database.d.ts.map +1 -1
  12. package/dist/application/database/firestore/generics/get-items-different-path-on-database.js +2 -2
  13. package/dist/application/database/firestore/generics/get-items-from-database.d.ts.map +1 -1
  14. package/dist/application/database/firestore/generics/get-items-from-database.js +2 -2
  15. package/dist/application/database/firestore/generics/update-items-on-database.d.ts.map +1 -1
  16. package/dist/application/database/firestore/generics/update-items-on-database.js +2 -2
  17. package/dist/application/database/firestore/generics/update-items-properties-on-database.d.ts.map +1 -1
  18. package/dist/application/database/firestore/generics/update-items-properties-on-database.js +2 -2
  19. package/dist/authorization/safe/authorization/authorized-authorities.d.ts.map +1 -1
  20. package/dist/errors/request/request-errors.d.ts +1 -1
  21. package/dist/errors/request/request-errors.d.ts.map +1 -1
  22. package/dist/helpers/request/params-object-helpers.d.ts +7 -1
  23. package/dist/helpers/request/params-object-helpers.d.ts.map +1 -1
  24. package/dist/helpers/request/params-object-helpers.js +10 -1
  25. package/dist/helpers/request/request-object-helpers.d.ts +16 -1
  26. package/dist/helpers/request/request-object-helpers.d.ts.map +1 -1
  27. package/dist/helpers/request/request-object-helpers.js +25 -2
  28. package/dist/models/application/audit-log/application-audit-log-models.d.ts +144 -60
  29. package/dist/models/application/audit-log/application-audit-log-models.d.ts.map +1 -1
  30. package/dist/models/application/audit-log/application-audit-log-models.js +87 -41
  31. package/dist/models/application/database/firestore-models.d.ts +370 -54
  32. package/dist/models/application/database/firestore-models.d.ts.map +1 -1
  33. package/dist/models/application/database/firestore-models.js +119 -1
  34. package/dist/models/authorization/authorization-models.d.ts +76 -33
  35. package/dist/models/authorization/authorization-models.d.ts.map +1 -1
  36. package/dist/models/authorization/authorization-models.js +80 -12
  37. package/dist/models/rules/share-rule-models.d.ts.map +1 -1
  38. package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts +14 -0
  39. package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts.map +1 -0
  40. package/dist/transactions/authority/create-safe-transaction-authority-data.js +21 -0
  41. package/dist/transactions/authority/create-safe-transaction-authority.d.ts +15 -0
  42. package/dist/transactions/authority/create-safe-transaction-authority.d.ts.map +1 -0
  43. package/dist/transactions/authority/create-safe-transaction-authority.js +29 -0
  44. package/dist/transactions/index.d.ts +3 -0
  45. package/dist/transactions/index.d.ts.map +1 -0
  46. package/dist/transactions/index.js +20 -0
  47. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"create-application-audit-log.d.ts","sourceRoot":"","sources":["../../../src/application/audit-log/create-application-audit-log.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,iCAAiC,EACjC,oBAAoB,EACvB,MAAM,iEAAiE,CAAC;AAEzE;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,yBAAyB,8BACA,yBAAyB,8BACxB,0BAA0B,aAC3C,MAAM,4BACQ,uBAAuB,SAC1C,iCAAiC,EAAE,gBAC3B,GAAG,iBACF,GAAG,KACnB,oBAaF,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
1
+ {"version":3,"file":"create-application-audit-log.d.ts","sourceRoot":"","sources":["../../../src/application/audit-log/create-application-audit-log.ts"],"names":[],"mappings":"AAEA,OAAO,EACH,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EAEvB,iCAAiC,EACjC,oBAAoB,EACvB,MAAM,iEAAiE,CAAC;AAEzE;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,yBAAyB,8BACA,yBAAyB,8BACxB,0BAA0B,aAC3C,MAAM,4BACQ,uBAAuB,SAC1C,iCAAiC,EAAE,gBAC3B,GAAG,iBACF,GAAG,KACnB,oBAaF,CAAC;AAEF,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -15,7 +15,7 @@ const application_audit_log_models_1 = require("../../models/application/audit-l
15
15
  * @param championsNetworkId the champions network Id.
16
16
  * @param organizationId the organization Id.
17
17
  */
18
- const createApplicationAuditLog = (applicationAuditLogAction, applicationAuditLogSubType, createdBy, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogType.global, alai = [], currentData, previousData) => {
18
+ const createApplicationAuditLog = (applicationAuditLogAction, applicationAuditLogSubType, createdBy, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogTypeSchema.Enum.global, alai = [], currentData, previousData) => {
19
19
  const auditLog = {
20
20
  additionalAuditLogIds: alai,
21
21
  applicationAuditLogAction,
@@ -1 +1 @@
1
- {"version":3,"file":"add-items-to-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/add-items-to-database.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC;AAEtG,OAAO,EAA6B,uBAAuB,EAAE,MAAM,uEAAuE,CAAC;AAE3I;;;;;;;GAOG;AACH,QAAA,MAAM,kBAAkB,8BACO,0BAA0B,EAAE,UAC/C,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,IAAI,CAed,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
1
+ {"version":3,"file":"add-items-to-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/add-items-to-database.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC;AAEtG,OAAO,EAAmC,uBAAuB,EAAiC,MAAM,uEAAuE,CAAC;AAEhL;;;;;;;GAOG;AACH,QAAA,MAAM,kBAAkB,8BACO,0BAA0B,EAAE,UAC/C,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,IAAI,CAed,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -37,13 +37,13 @@ const db = admin.firestore();
37
37
  * @param applicationAuditLogType the type of audit log to create
38
38
  * @returns
39
39
  */
40
- const addItemsToDatabase = async (databaseChangeInformation, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogType.global) => {
40
+ const addItemsToDatabase = async (databaseChangeInformation, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogTypeSchema.Enum.global) => {
41
41
  const auditLogColRef = (0, create_audit_log_col_ref_1.createAuditLogColRef)(); // create the audit log collection reference
42
42
  // create the new records in the database
43
43
  await db.runTransaction(async (t) => {
44
44
  for (const changeRecords of databaseChangeInformation) {
45
45
  // create the audit log
46
- const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogAction.create, changeRecords.auditLogSubType, userId, applicationAuditLogType, changeRecords.alai, changeRecords.item, undefined);
46
+ const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogActionSchema.Enum.create, changeRecords.auditLogSubType, userId, applicationAuditLogType, changeRecords.alai, changeRecords.item, undefined);
47
47
  t.create(changeRecords.itemDocRef, JSON.parse(JSON.stringify(changeRecords.item))); // add the item to the database.
48
48
  t.create(auditLogColRef.doc(), auditLog); // add the audit log to the database.
49
49
  }
@@ -1 +1 @@
1
- {"version":3,"file":"add-or-update-items-to-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/add-or-update-items-to-database.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,uBAAuB,EAAwB,MAAM,uEAAuE,CAAC;AAGjK,OAAO,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC;AAGtG;;;;;;;GAOG;AACH,QAAA,MAAM,0BAA0B,GAAU,CAAC,yBAChB,0BAA0B,EAAE,UAC3C,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,IAAI,CAoCd,CAAC;AAEF,OAAO,EAAE,0BAA0B,EAAE,CAAC"}
1
+ {"version":3,"file":"add-or-update-items-to-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/add-or-update-items-to-database.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,uBAAuB,EAG1B,MAAM,uEAAuE,CAAC;AAG/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC;AAGtG;;;;;;;GAOG;AACH,QAAA,MAAM,0BAA0B,GAAU,CAAC,yBAChB,0BAA0B,EAAE,UAC3C,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,IAAI,CAoCd,CAAC;AAEF,OAAO,EAAE,0BAA0B,EAAE,CAAC"}
@@ -37,7 +37,7 @@ const db = admin.firestore();
37
37
  * @param applicationAuditLogType the type of audit log to create
38
38
  * @returns
39
39
  */
40
- const addOrUpdateItemsToDatabase = async (databaseChangeRecords, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogType.global) => {
40
+ const addOrUpdateItemsToDatabase = async (databaseChangeRecords, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogTypeSchema.Enum.global) => {
41
41
  // loop the transaction and update the database
42
42
  await db.runTransaction(async (t) => {
43
43
  const auditLogUpdates = []; // create an array of audit log updates
@@ -52,13 +52,13 @@ const addOrUpdateItemsToDatabase = async (databaseChangeRecords, userId, applica
52
52
  // create the audit log for the update stringify and parse to ensure the deep properties are copied.
53
53
  const updatedData = { ...JSON.parse(JSON.stringify(existingRecord)), ...newRecord };
54
54
  // create the audit log
55
- const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogAction.update, changeRecord.auditLogSubType, userId, applicationAuditLogType, changeRecord.alai, updatedData, existingRecord);
55
+ const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogActionSchema.Enum.update, changeRecord.auditLogSubType, userId, applicationAuditLogType, changeRecord.alai, updatedData, existingRecord);
56
56
  auditLogUpdates.push(auditLog);
57
57
  updatedRecord.push(updatedData);
58
58
  }
59
59
  else {
60
60
  // create the audit log
61
- const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogAction.create, changeRecord.auditLogSubType, userId, applicationAuditLogType, changeRecord.alai, newRecord, undefined);
61
+ const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogActionSchema.Enum.create, changeRecord.auditLogSubType, userId, applicationAuditLogType, changeRecord.alai, newRecord, undefined);
62
62
  auditLogUpdates.push(auditLog);
63
63
  updatedRecord.push(newRecord);
64
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"delete-items-on-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/delete-items-on-database.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6B,uBAAuB,EAAE,MAAM,uEAAuE,CAAC;AAC3I,OAAO,EAAE,mBAAmB,EAAE,MAAM,0DAA0D,CAAC;AAM/F;;;;;;;GAOG;AACH,QAAA,MAAM,qBAAqB,wBACF,mBAAmB,EAAE,UAClC,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,IAAI,CA2Bd,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"delete-items-on-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/delete-items-on-database.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,uBAAuB,EAE1B,MAAM,uEAAuE,CAAC;AAC/E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0DAA0D,CAAC;AAM/F;;;;;;;GAOG;AACH,QAAA,MAAM,qBAAqB,wBACF,mBAAmB,EAAE,UAClC,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,IAAI,CA2Bd,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -38,7 +38,7 @@ const db = admin.firestore();
38
38
  * @param applicationAuditLogType the type of audit log to create
39
39
  * @returns
40
40
  */
41
- const deleteItemsOnDatabase = async (databaseDeleteItems, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogType.global) => {
41
+ const deleteItemsOnDatabase = async (databaseDeleteItems, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogTypeSchema.Enum.global) => {
42
42
  const auditLogColRef = (0, create_audit_log_col_ref_1.createAuditLogColRef)(); // create the audit log collection reference
43
43
  // create the new records in the database
44
44
  await db.runTransaction(async (t) => {
@@ -56,7 +56,7 @@ const deleteItemsOnDatabase = async (databaseDeleteItems, userId, applicationAud
56
56
  const existingRecord = existingRecords[i]; // the existing record
57
57
  const deleteRecord = databaseDeleteItems[i]; // the delete record
58
58
  // create the audit log
59
- const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogAction.delete, deleteRecord.auditLogSubType, userId, applicationAuditLogType, deleteRecord.alai, undefined, existingRecord);
59
+ const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogActionSchema.Enum.delete, deleteRecord.auditLogSubType, userId, applicationAuditLogType, deleteRecord.alai, undefined, existingRecord);
60
60
  t.delete(deleteRecord.itemDocRef); // delete the item from the database.
61
61
  t.create(auditLogColRef.doc(), auditLog); // add the audit log to the database.
62
62
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-item-from-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/get-item-from-database.ts"],"names":[],"mappings":"AAGA,OAAO,EAA6B,uBAAuB,EAAE,MAAM,uEAAuE,CAAC;AAC3I,OAAO,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AAG5F;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,GAAU,CAAC,WACvB,gBAAgB,UACjB,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,CAAC,GAAG,SAAS,CAgBvB,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
1
+ {"version":3,"file":"get-item-from-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/get-item-from-database.ts"],"names":[],"mappings":"AAGA,OAAO,EAEH,uBAAuB,EAE1B,MAAM,uEAAuE,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAC;AAG5F;;;;;;;GAOG;AACH,QAAA,MAAM,mBAAmB,GAAU,CAAC,WACvB,gBAAgB,UACjB,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,CAAC,GAAG,SAAS,CAgBvB,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -38,10 +38,10 @@ const db = admin.firestore();
38
38
  * @param applicationAuditLogType the type of audit log to create
39
39
  * @returns
40
40
  */
41
- const getItemFromDatabase = async (getItem, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogType.global) => {
41
+ const getItemFromDatabase = async (getItem, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogTypeSchema.Enum.global) => {
42
42
  const auditLogRef = (0, create_audit_log_col_ref_1.createAuditLogColRef)(); // create the audit log reference
43
43
  // create the audit log information
44
- const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogAction.read, getItem.auditLogSubType, userId, applicationAuditLogType, getItem.alai, undefined, undefined);
44
+ const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogActionSchema.Enum.read, getItem.auditLogSubType, userId, applicationAuditLogType, getItem.alai, undefined, undefined);
45
45
  const itemData = await db.runTransaction(async (t) => {
46
46
  const connectedSnap = await t.get(getItem.itemDocRef); // get the connected snap
47
47
  t.create(auditLogRef.doc(), auditLog); // add the audit log to the database.
@@ -1 +1 @@
1
- {"version":3,"file":"get-items-different-path-on-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/get-items-different-path-on-database.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6B,uBAAuB,EAA+B,MAAM,uEAAuE,CAAC;AAIxK;;;;;;;GAOG;AACH,QAAA,MAAM,gCAAgC,GAAU,CAAC,iBAC9B,MAAM,EAAE,UACf,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,CAAC,EAAE,CAwBb,CAAC;AAEF,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
1
+ {"version":3,"file":"get-items-different-path-on-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/get-items-different-path-on-database.ts"],"names":[],"mappings":"AAEA,OAAO,EAEH,uBAAuB,EAG1B,MAAM,uEAAuE,CAAC;AAI/E;;;;;;;GAOG;AACH,QAAA,MAAM,gCAAgC,GAAU,CAAC,iBAC9B,MAAM,EAAE,UACf,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,CAAC,EAAE,CA2Bb,CAAC;AAEF,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
@@ -38,7 +38,7 @@ const db = admin.firestore();
38
38
  * @param applicationAuditLogType the type of audit log to create
39
39
  * @returns
40
40
  */
41
- const getItemsDifferentPathsOnDatabase = async (documentPaths, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogType.global) => {
41
+ const getItemsDifferentPathsOnDatabase = async (documentPaths, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogTypeSchema.Enum.global) => {
42
42
  const auditLogColRef = (0, create_audit_log_col_ref_1.createAuditLogColRef)(); // create the audit log collection reference
43
43
  // create the promisees for the documents.
44
44
  const documentPromises = [];
@@ -48,7 +48,7 @@ const getItemsDifferentPathsOnDatabase = async (documentPaths, userId, applicati
48
48
  // create the audit log additional ids information
49
49
  const alai = (0, create_multiple_path_alai_1.createMultiplePathALAI)(documentPaths);
50
50
  // create the audit log information
51
- const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogAction.list, application_audit_log_models_1.MultiplePathAuditLogSubType.multiplePathALAI, userId, applicationAuditLogType, alai, undefined, undefined);
51
+ const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogActionSchema.Enum.list, application_audit_log_models_1.MultiplePathAuditLogSubTypeSchema.Enum.multiplePathALAI, userId, applicationAuditLogType, alai, undefined, undefined);
52
52
  // add in the audit log
53
53
  await auditLogColRef.add(auditLog);
54
54
  const allDocuments = await Promise.all(documentPromises);
@@ -1 +1 @@
1
- {"version":3,"file":"get-items-from-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/get-items-from-database.ts"],"names":[],"mappings":"AAEA,OAAO,EAA6B,uBAAuB,EAAE,MAAM,uEAAuE,CAAC;AAC3I,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AAKnG;;;;;;;;GAQG;AACH,QAAA,MAAM,oBAAoB,GAAU,CAAC,UACzB,MAAM,kBACE,uBAAuB,4BACd,uBAAuB,KACjD,OAAO,CAAC,CAAC,EAAE,CAuCb,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
1
+ {"version":3,"file":"get-items-from-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/get-items-from-database.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmC,uBAAuB,EAAiC,MAAM,uEAAuE,CAAC;AAChL,OAAO,EAAE,uBAAuB,EAAE,MAAM,0DAA0D,CAAC;AAKnG;;;;;;;;GAQG;AACH,QAAA,MAAM,oBAAoB,GAAU,CAAC,UACzB,MAAM,kBACE,uBAAuB,4BACd,uBAAuB,KACjD,OAAO,CAAC,CAAC,EAAE,CAuCb,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -39,7 +39,7 @@ const db = firebase.firestore();
39
39
  * @param <T> the type of the items to return
40
40
  * @returns
41
41
  */
42
- const getItemsFromDatabase = async (userId, getInformation, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogType.global) => {
42
+ const getItemsFromDatabase = async (userId, getInformation, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogTypeSchema.enum.global) => {
43
43
  const maxResults = application_settings_1.ApplicationSettings.SystemValues.MaxSnapshotSize; // the maximum number of results to return.
44
44
  const auditLogColRef = (0, create_audit_log_col_ref_1.createAuditLogColRef)(); // create the audit log collection reference
45
45
  // get the items from the database.
@@ -68,7 +68,7 @@ const getItemsFromDatabase = async (userId, getInformation, applicationAuditLogT
68
68
  databaseItems.push(item);
69
69
  }
70
70
  // create the audit log information
71
- const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogAction.list, getInformation.auditLogSubType, userId, applicationAuditLogType, getInformation.alai, undefined, undefined);
71
+ const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogActionSchema.Enum.list, getInformation.auditLogSubType, userId, applicationAuditLogType, getInformation.alai, undefined, undefined);
72
72
  t.create(auditLogColRef.doc(), auditLog); // add the audit log to the database.
73
73
  return databaseItems;
74
74
  });
@@ -1 +1 @@
1
- {"version":3,"file":"update-items-on-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/update-items-on-database.ts"],"names":[],"mappings":"AACA,OAAO,EAA6B,uBAAuB,EAAE,MAAM,uEAAuE,CAAC;AAC3I,OAAO,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC;AAMtG;;;;;;;GAOG;AACH,QAAA,MAAM,qBAAqB,GAAU,CAAC,6BACP,0BAA0B,EAAE,UAC/C,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,IAAI,CA0Bd,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
1
+ {"version":3,"file":"update-items-on-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/update-items-on-database.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,uBAAuB,EAE1B,MAAM,uEAAuE,CAAC;AAC/E,OAAO,EAAE,0BAA0B,EAAE,MAAM,0DAA0D,CAAC;AAMtG;;;;;;;GAOG;AACH,QAAA,MAAM,qBAAqB,GAAU,CAAC,6BACP,0BAA0B,EAAE,UAC/C,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,IAAI,CA0Bd,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -38,7 +38,7 @@ const db = admin.firestore();
38
38
  * @param applicationAuditLogType the type of audit log to create
39
39
  * @returns
40
40
  */
41
- const updateItemsOnDatabase = async (databaseChangeInformation, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogType.global) => {
41
+ const updateItemsOnDatabase = async (databaseChangeInformation, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogTypeSchema.Enum.global) => {
42
42
  // loop the transaction and update the database
43
43
  await db.runTransaction(async (t) => {
44
44
  // get the existing records from the database
@@ -56,7 +56,7 @@ const updateItemsOnDatabase = async (databaseChangeInformation, userId, applicat
56
56
  const changeRecord = databaseChangeInformation[i];
57
57
  const existingRecord = existingRecords[i];
58
58
  // create the audit log
59
- const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogAction.update, changeRecord.auditLogSubType, userId, applicationAuditLogType, changeRecord.alai, changeRecord.item, existingRecord);
59
+ const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogActionSchema.Enum.update, changeRecord.auditLogSubType, userId, applicationAuditLogType, changeRecord.alai, changeRecord.item, existingRecord);
60
60
  const updatedRecord = { ...existingRecord, ...changeRecord.item };
61
61
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
62
62
  t.update(changeRecord.itemDocRef, updatedRecord);
@@ -1 +1 @@
1
- {"version":3,"file":"update-items-properties-on-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/update-items-properties-on-database.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,uBAAuB,EAC1B,MAAM,uEAAuE,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,0DAA0D,CAAC;AAI9G;;;;;;;;GAQG;AACH,QAAA,MAAM,+BAA+B,GAAU,CAAC,yBACrB,kCAAkC,EAAE,UACnD,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,IAAI,CA6Bd,CAAC;AAEF,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
1
+ {"version":3,"file":"update-items-properties-on-database.d.ts","sourceRoot":"","sources":["../../../../../src/application/database/firestore/generics/update-items-properties-on-database.ts"],"names":[],"mappings":"AAEA,OAAO,EAGH,uBAAuB,EAE1B,MAAM,uEAAuE,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,0DAA0D,CAAC;AAI9G;;;;;;;;GAQG;AACH,QAAA,MAAM,+BAA+B,GAAU,CAAC,yBACrB,kCAAkC,EAAE,UACnD,MAAM,4BACW,uBAAuB,KACjD,OAAO,CAAC,IAAI,CA6Bd,CAAC;AAEF,OAAO,EAAE,+BAA+B,EAAE,CAAC"}
@@ -39,7 +39,7 @@ const db = admin.firestore();
39
39
  * @param applicationAuditLogType the type of audit log to create
40
40
  * @returns
41
41
  */
42
- const updateItemsPropertiesOnDatabase = async (databaseChangeRecords, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogType.global) => {
42
+ const updateItemsPropertiesOnDatabase = async (databaseChangeRecords, userId, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogTypeSchema.Enum.global) => {
43
43
  // loop the transaction and update the database
44
44
  await db.runTransaction(async (t) => {
45
45
  const auditLogUpdates = []; // create an array of audit log updates
@@ -55,7 +55,7 @@ const updateItemsPropertiesOnDatabase = async (databaseChangeRecords, userId, ap
55
55
  const recordExisting = JSON.parse(JSON.stringify(existingRecord));
56
56
  const updatedData = { recordExisting, ...changeRecord.partialObjectUpdate };
57
57
  // create the audit log
58
- const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogAction.update, changeRecord.auditLogSubType, userId, applicationAuditLogType, changeRecord.alai, updatedData, existingRecord);
58
+ const auditLog = (0, create_application_audit_log_1.createApplicationAuditLog)(application_audit_log_models_1.ApplicationAuditLogActionSchema.Enum.update, changeRecord.auditLogSubType, userId, applicationAuditLogType, changeRecord.alai, updatedData, existingRecord);
59
59
  auditLogUpdates.push(auditLog);
60
60
  updatedRecord.push(updatedData);
61
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"authorized-authorities.d.ts","sourceRoot":"","sources":["../../../../src/authorization/safe/authorization/authorized-authorities.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAiB,MAAM,oDAAoD,CAAC;AAEhI;;GAEG;AACH,qBAAa,qBAAqB;IAE9B,OAAO,CAAC,yBAAyB,CAAgE;IAEjG,OAAO,CAAC,0BAA0B,CAAqC;;IAYtE;;;;;;MAME;IACI,yBAAyB,CAC5B,QAAQ,EAAE,qBAAqB,EAC/B,mBAAmB,EAAE,oBAAoB,EACzC,SAAS,EAAE,MAAM,GAClB,IAAI;IAKP;;;;OAIG;IACI,4BAA4B,CAAC,QAAQ,EAAE,qBAAqB,EAAE,SAAS,EAAE,oBAAoB,GAAG,IAAI;IAO3G;;;;;OAKG;IACI,kCAAkC,CAAC,QAAQ,EAAE,qBAAqB,EAAE,SAAS,EAAE,oBAAoB,GAAG,MAAM,GAAG,SAAS;IAI/H;;;;OAIG;IACI,2BAA2B,CAAC,QAAQ,EAAE,qBAAqB,GAAG,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAItG;;;OAGG;IACI,gCAAgC,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM;CAGnF"}
1
+ {"version":3,"file":"authorized-authorities.d.ts","sourceRoot":"","sources":["../../../../src/authorization/safe/authorization/authorized-authorities.ts"],"names":[],"mappings":"AACA,OAAO,EACH,qBAAqB,EACrB,oBAAoB,EACvB,MAAM,oDAAoD,CAAC;AAE5D;;GAEG;AACH,qBAAa,qBAAqB;IAE9B,OAAO,CAAC,yBAAyB,CAAgE;IAEjG,OAAO,CAAC,0BAA0B,CAAqC;;IAYtE;;;;;;MAME;IACI,yBAAyB,CAC5B,QAAQ,EAAE,qBAAqB,EAC/B,mBAAmB,EAAE,oBAAoB,EACzC,SAAS,EAAE,MAAM,GAClB,IAAI;IAKP;;;;OAIG;IACI,4BAA4B,CAAC,QAAQ,EAAE,qBAAqB,EAAE,SAAS,EAAE,oBAAoB,GAAG,IAAI;IAO3G;;;;;OAKG;IACI,kCAAkC,CAAC,QAAQ,EAAE,qBAAqB,EAAE,SAAS,EAAE,oBAAoB,GAAG,MAAM,GAAG,SAAS;IAI/H;;;;OAIG;IACI,2BAA2B,CAAC,QAAQ,EAAE,qBAAqB,GAAG,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC;IAItG;;;OAGG;IACI,gCAAgC,CAAC,QAAQ,EAAE,qBAAqB,GAAG,MAAM;CAGnF"}
@@ -4,7 +4,7 @@ import { Request } from 'express';
4
4
  * This is thrown when the request object is not valid.
5
5
  */
6
6
  export declare class RequestValidationFailedError extends BaseError {
7
- constructor(req: Request, messages: []);
7
+ constructor(req: Request, messages: string[]);
8
8
  }
9
9
  /**
10
10
  * This is thrown when the request object is not valid.
@@ -1 +1 @@
1
- {"version":3,"file":"request-errors.d.ts","sourceRoot":"","sources":["../../../src/errors/request/request-errors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,SAAS;gBAC3C,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE;CAIzC;AAED;;;;GAIG;AACH,qBAAa,kCAAmC,SAAQ,SAAS;gBACjD,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;CAGtF;AAED;;GAEG;AACH,qBAAa,mCAAoC,SAAQ,SAAS;IAC9D;;;;;;OAMG;gBACS,gBAAgB,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;CAG7G;AAED;;GAEG;AACH,qBAAa,kCAAmC,SAAQ,SAAS;IAC7D;;;;;;OAMG;gBACS,gBAAgB,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;CAG7G;AAED;;GAEG;AACH,qBAAa,2CAA4C,SAAQ,SAAS;IACtE;;;;;;OAMG;gBACS,gBAAgB,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM;CAGlH;AAED;;GAEG;AACH,qBAAa,6CAA8C,SAAQ,SAAS;IACxE;;;;;;OAMG;gBACS,mBAAmB,EAAE,MAAM,EAAE,oBAAoB,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG;CAGzH;AAMD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,SAAS;IACpD;;;;;OAKG;gBACS,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM;CAG7E;AAMD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,SAAS;IACpD;;;;;OAKG;gBACS,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG;CAGvF;AAMD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,SAAS;IACpD;;OAEG;gBACS,YAAY,SAAiB;CAG5C"}
1
+ {"version":3,"file":"request-errors.d.ts","sourceRoot":"","sources":["../../../src/errors/request/request-errors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAGlC;;GAEG;AACH,qBAAa,4BAA6B,SAAQ,SAAS;gBAC3C,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE;CAI/C;AAED;;;;GAIG;AACH,qBAAa,kCAAmC,SAAQ,SAAS;gBACjD,gBAAgB,EAAE,GAAG,EAAE,gBAAgB,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;CAGtF;AAED;;GAEG;AACH,qBAAa,mCAAoC,SAAQ,SAAS;IAC9D;;;;;;OAMG;gBACS,gBAAgB,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;CAG7G;AAED;;GAEG;AACH,qBAAa,kCAAmC,SAAQ,SAAS;IAC7D;;;;;;OAMG;gBACS,gBAAgB,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;CAG7G;AAED;;GAEG;AACH,qBAAa,2CAA4C,SAAQ,SAAS;IACtE;;;;;;OAMG;gBACS,gBAAgB,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM;CAGlH;AAED;;GAEG;AACH,qBAAa,6CAA8C,SAAQ,SAAS;IACxE;;;;;;OAMG;gBACS,mBAAmB,EAAE,MAAM,EAAE,oBAAoB,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,EAAE,kBAAkB,EAAE,GAAG;CAGzH;AAMD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,SAAS;IACpD;;;;;OAKG;gBACS,eAAe,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM;CAG7E;AAMD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,SAAS;IACpD;;;;;OAKG;gBACS,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG;CAGvF;AAMD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,SAAS;IACpD;;OAEG;gBACS,YAAY,SAAiB;CAG5C"}
@@ -27,6 +27,12 @@ declare const getParamFunctionId: (req: any) => string;
27
27
  * @returns
28
28
  */
29
29
  declare const getParamRulesId: (req: any) => string;
30
+ /**
31
+ * The function gets the rulesets id from the restful parameter object
32
+ * @param req the incoming request
33
+ * @returns
34
+ */
35
+ declare const getParamRuleSetsId: (req: any) => string;
30
36
  /**
31
37
  * The function gets the event id from the restful parameter object
32
38
  *
@@ -41,5 +47,5 @@ declare const getParamEventId: (req: any) => string;
41
47
  * @returns
42
48
  */
43
49
  declare const getAuthorityId: (req: any) => string;
44
- export { getParamShareDataId, getParamFunctionId, getParamRulesId, getParamEventId, getAuthorityId, };
50
+ export { getParamShareDataId, getParamFunctionId, getParamRulesId, getParamRuleSetsId, getParamEventId, getAuthorityId, };
45
51
  //# sourceMappingURL=params-object-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"params-object-helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers/request/params-object-helpers.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAIH;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,QAAS,GAAG,KAAG,MAEvC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,kBAAkB,QAAS,GAAG,KAAG,MAEtC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,eAAe,QAAS,GAAG,KAAG,MAEnC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,eAAe,QAAS,GAAG,KAAG,MAEnC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,cAAc,QAAS,GAAG,KAAG,MAElC,CAAA;AAID,OAAO,EACH,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,GACjB,CAAA"}
1
+ {"version":3,"file":"params-object-helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers/request/params-object-helpers.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAIH;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,QAAS,GAAG,KAAG,MAEvC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,kBAAkB,QAAS,GAAG,KAAG,MAEtC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,eAAe,QAAS,GAAG,KAAG,MAEnC,CAAA;AAED;;;;GAIG;AACH,QAAA,MAAM,kBAAkB,QAAS,GAAG,KAAG,MAEtC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,eAAe,QAAS,GAAG,KAAG,MAEnC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,cAAc,QAAS,GAAG,KAAG,MAElC,CAAA;AAID,OAAO,EACH,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,cAAc,GACjB,CAAA"}
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
3
  // This file contains the functions to get the incoming params in the request object.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.getAuthorityId = exports.getParamEventId = exports.getParamRulesId = exports.getParamFunctionId = exports.getParamShareDataId = void 0;
5
+ exports.getAuthorityId = exports.getParamEventId = exports.getParamRuleSetsId = exports.getParamRulesId = exports.getParamFunctionId = exports.getParamShareDataId = void 0;
6
6
  /**
7
7
  * The pattern for this is:
8
8
  * Parameters are always in the request object and lowercase.
@@ -42,6 +42,15 @@ const getParamRulesId = (req) => {
42
42
  return req.params.rulesid;
43
43
  };
44
44
  exports.getParamRulesId = getParamRulesId;
45
+ /**
46
+ * The function gets the rulesets id from the restful parameter object
47
+ * @param req the incoming request
48
+ * @returns
49
+ */
50
+ const getParamRuleSetsId = (req) => {
51
+ return req.params.rulesetsid;
52
+ };
53
+ exports.getParamRuleSetsId = getParamRuleSetsId;
45
54
  /**
46
55
  * The function gets the event id from the restful parameter object
47
56
  *
@@ -17,6 +17,21 @@ declare const setAuthorizationAudience: (req: any, authorizationAudience: Author
17
17
  * @returns
18
18
  */
19
19
  declare const getAuthorizationAudience: (req: any) => AuthorizationAudience;
20
+ /**
21
+ * This function sets the unique tracking id on the request object.
22
+ *
23
+ * @param req the incoming request object
24
+ * @param uniqueTrackingId the unique tracking id to set
25
+ * @returns
26
+ */
27
+ declare const setUniqueTrackingId: (req: any, uniqueTrackingId: string) => void;
28
+ /**
29
+ * This function gets the unique tracking id from the request object.
30
+ *
31
+ * @param req the incoming request object
32
+ * @returns
33
+ */
34
+ declare const getUniqueTrackingId: (req: any) => string;
20
35
  /**
21
36
  * This function sets the IUserWithClaims object into the req.user object.
22
37
  * @param req the incoming request object
@@ -30,5 +45,5 @@ declare const setUserRequest: (req: any, userObject: any) => void;
30
45
  * @returns
31
46
  */
32
47
  declare const getUserRequest: (req: any) => any;
33
- export { setAuthorizationAudience, getAuthorizationAudience, setUserRequest, getUserRequest, };
48
+ export { setAuthorizationAudience, getAuthorizationAudience, setUniqueTrackingId, setUserRequest, getUserRequest, getUniqueTrackingId, };
34
49
  //# sourceMappingURL=request-object-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request-object-helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers/request/request-object-helpers.ts"],"names":[],"mappings":"AACA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAOxF;;;;;;GAMG;AACH,QAAA,MAAM,wBAAwB,QAAS,GAAG,yBAAyB,qBAAqB,KAAG,IAG1F,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,wBAAwB,QAAS,GAAG,KAAG,qBAE5C,CAAA;AAID;;;;;GAKG;AACH,QAAA,MAAM,cAAc,QAAS,GAAG,cAAc,GAAG,KAAG,IAEnD,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,cAAc,QAAS,GAAG,KAAG,GAElC,CAAC;AAGF,OAAO,EACH,wBAAwB,EACxB,wBAAwB,EACxB,cAAc,EACd,cAAc,GACjB,CAAC"}
1
+ {"version":3,"file":"request-object-helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers/request/request-object-helpers.ts"],"names":[],"mappings":"AACA;;;GAGG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AAQxF;;;;;;GAMG;AACH,QAAA,MAAM,wBAAwB,QAAS,GAAG,yBAAyB,qBAAqB,KAAG,IAG1F,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,wBAAwB,QAAS,GAAG,KAAG,qBAE5C,CAAA;AAED;;;;;;GAMG;AACH,QAAA,MAAM,mBAAmB,QAAS,GAAG,oBAAoB,MAAM,KAAG,IAGjE,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,QAAS,GAAG,KAAG,MAEvC,CAAA;AAGD;;;;;GAKG;AACH,QAAA,MAAM,cAAc,QAAS,GAAG,cAAc,GAAG,KAAG,IAEnD,CAAC;AAEF;;;;GAIG;AACH,QAAA,MAAM,cAAc,QAAS,GAAG,KAAG,GAElC,CAAC;AAGF,OAAO,EACH,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,mBAAmB,GACtB,CAAC"}
@@ -5,9 +5,10 @@
5
5
  * It is used to set and get the user object from the request object.
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.getUserRequest = exports.setUserRequest = exports.getAuthorizationAudience = exports.setAuthorizationAudience = void 0;
8
+ exports.getUniqueTrackingId = exports.getUserRequest = exports.setUserRequest = exports.setUniqueTrackingId = exports.getAuthorizationAudience = exports.setAuthorizationAudience = void 0;
9
9
  const USER_REQUEST_KEY = 'user';
10
- const AUTHORIZATION_AUDIENCE_KEY = 'authorizationaudience';
10
+ const AUTHORIZATION_AUDIENCE_KEY = 'authorizationAudience';
11
+ const UNIQUE_TRACKING_ID_KEY = 'uniqueTrackingId';
11
12
  //#region Authorization
12
13
  /**
13
14
  * This function sets the Authorization Audience on the request object.
@@ -30,6 +31,28 @@ const getAuthorizationAudience = (req) => {
30
31
  return req[AUTHORIZATION_AUDIENCE_KEY];
31
32
  };
32
33
  exports.getAuthorizationAudience = getAuthorizationAudience;
34
+ /**
35
+ * This function sets the unique tracking id on the request object.
36
+ *
37
+ * @param req the incoming request object
38
+ * @param uniqueTrackingId the unique tracking id to set
39
+ * @returns
40
+ */
41
+ const setUniqueTrackingId = (req, uniqueTrackingId) => {
42
+ req[UNIQUE_TRACKING_ID_KEY] = uniqueTrackingId;
43
+ return;
44
+ };
45
+ exports.setUniqueTrackingId = setUniqueTrackingId;
46
+ /**
47
+ * This function gets the unique tracking id from the request object.
48
+ *
49
+ * @param req the incoming request object
50
+ * @returns
51
+ */
52
+ const getUniqueTrackingId = (req) => {
53
+ return req[UNIQUE_TRACKING_ID_KEY];
54
+ };
55
+ exports.getUniqueTrackingId = getUniqueTrackingId;
33
56
  //#endregion Authorization
34
57
  /**
35
58
  * This function sets the IUserWithClaims object into the req.user object.
@@ -1,21 +1,43 @@
1
+ import { z } from 'zod';
1
2
  /**
2
- * This contains interfaces for the audit logs that are generated in the system.
3
- * This type of audit log is used to create and log application functions within a non structured database.
3
+ * This contains the enum for the audit log sub types for the administrator classes.
4
4
  */
5
- export type IApplicationAuditLog = IApplicationAuditLogUnstructured;
5
+ export declare const AdministrationAuditLogSubTypeSchema: z.ZodEnum<["administrator"]>;
6
+ export type AdministrationAuditLogSubType = z.infer<typeof AdministrationAuditLogSubTypeSchema>;
6
7
  /**
7
- * This is an application audit log.
8
+ * This contains the enum for the audit log actions.
9
+ */
10
+ export declare const ApplicationAuditLogActionSchema: z.ZodEnum<["create", "update", "delete", "read", "list", "file"]>;
11
+ export type ApplicationAuditLogAction = z.infer<typeof ApplicationAuditLogActionSchema>;
12
+ /**
13
+ * This contains the model for the audit logs that are generated in the system.
14
+ */
15
+ export declare const ApplicationAuditLogTypeSchema: z.ZodEnum<["authorizedAuthority", "global"]>;
16
+ export type ApplicationAuditLogType = z.infer<typeof ApplicationAuditLogTypeSchema>;
17
+ /**
18
+ * This contains the enum for the audit log sub types for the multiple path classes.
19
+ */
20
+ export declare const MultiplePathAuditLogSubTypeSchema: z.ZodEnum<["multiplePathALAI"]>;
21
+ export type MultiplePathAuditLogSubType = z.infer<typeof MultiplePathAuditLogSubTypeSchema>;
22
+ /**
23
+ * This contains the enum for the audit log sub types for the public data classes.
24
+ */
25
+ export declare const PublicDataAuditLogSubTypeSchema: z.ZodEnum<["userRelatedProfile"]>;
26
+ export type PublicDataAuditLogSubType = z.infer<typeof PublicDataAuditLogSubTypeSchema>;
27
+ /**
28
+ * This contains the enum for the audit log sub types for the user classes.
29
+ */
30
+ export declare const UserAuditLogSubTypeSchema: z.ZodEnum<["profile"]>;
31
+ export type UserAuditLogSubType = z.infer<typeof UserAuditLogSubTypeSchema>;
32
+ /**
33
+ * This contains the enum for the audit log sub types.
34
+ */
35
+ export declare const ApplicationAuditLogSubTypeSchema: z.ZodUnion<[z.ZodEnum<["administrator"]>, z.ZodEnum<["multiplePathALAI"]>, z.ZodEnum<["userRelatedProfile"]>, z.ZodEnum<["profile"]>]>;
36
+ export type ApplicationAuditLogSubType = z.infer<typeof ApplicationAuditLogSubTypeSchema>;
37
+ /**
38
+ * This contains interfaces for the audit logs that are generated in the system.
39
+ * This type of audit log is used to create and log application functions within a non structured database.
8
40
  */
9
- export interface IApplicationAuditLogUnstructured {
10
- additionalAuditLogIds: IAdditionalApplicationAuditLogIds[];
11
- applicationAuditLogAction: ApplicationAuditLogAction;
12
- applicationAuditLogType: ApplicationAuditLogType;
13
- applicationAuditLogSubType: ApplicationAuditLogSubType;
14
- createdAt: number;
15
- createdBy: string;
16
- currentData?: any;
17
- previousData?: any;
18
- }
19
41
  /**
20
42
  * This contains the additional audit log Ids in order of the access in the application
21
43
  * for database this would be the reference path and reference Id
@@ -27,61 +49,123 @@ export interface IApplicationAuditLogUnstructured {
27
49
  *
28
50
  * These are available in the helper files based on the Application Audit Log Sub Types.
29
51
  */
30
- export interface IAdditionalApplicationAuditLogIds {
52
+ export declare const AdditionalApplicationAuditLogIdsSchema: z.ZodObject<{
53
+ referencePath: z.ZodString;
54
+ referenceId: z.ZodString;
55
+ }, "strip", z.ZodTypeAny, {
31
56
  referencePath: string;
32
57
  referenceId: string;
33
- }
34
- /**
35
- * This contains the enum for the audit log actions.
36
- */
37
- export declare enum ApplicationAuditLogAction {
38
- create = "create",
39
- update = "update",
40
- delete = "delete",
41
- read = "read",
42
- list = "list",
43
- file = "file"
44
- }
58
+ }, {
59
+ referencePath: string;
60
+ referenceId: string;
61
+ }>;
62
+ export type IAdditionalApplicationAuditLogIds = z.infer<typeof AdditionalApplicationAuditLogIdsSchema>;
45
63
  /**
46
- * This contains the model for the audit logs that are generated in the system.
64
+ * Application Audit Log Unstructured Schema
47
65
  */
48
- export declare enum ApplicationAuditLogType {
49
- authorizedAuthority = "authorizedAuthority",// the authorized authority audit log
50
- global = "global"
51
- }
66
+ export declare const IApplicationAuditLogUnstructuredSchema: z.ZodObject<{
67
+ additionalAuditLogIds: z.ZodArray<z.ZodObject<{
68
+ referencePath: z.ZodString;
69
+ referenceId: z.ZodString;
70
+ }, "strip", z.ZodTypeAny, {
71
+ referencePath: string;
72
+ referenceId: string;
73
+ }, {
74
+ referencePath: string;
75
+ referenceId: string;
76
+ }>, "many">;
77
+ applicationAuditLogAction: z.ZodEnum<["create", "update", "delete", "read", "list", "file"]>;
78
+ applicationAuditLogType: z.ZodEnum<["authorizedAuthority", "global"]>;
79
+ applicationAuditLogSubType: z.ZodUnion<[z.ZodEnum<["administrator"]>, z.ZodEnum<["multiplePathALAI"]>, z.ZodEnum<["userRelatedProfile"]>, z.ZodEnum<["profile"]>]>;
80
+ createdAt: z.ZodNumber;
81
+ createdBy: z.ZodString;
82
+ currentData: z.ZodOptional<z.ZodAny>;
83
+ previousData: z.ZodOptional<z.ZodAny>;
84
+ }, "strip", z.ZodTypeAny, {
85
+ additionalAuditLogIds: {
86
+ referencePath: string;
87
+ referenceId: string;
88
+ }[];
89
+ applicationAuditLogAction: "create" | "update" | "delete" | "read" | "list" | "file";
90
+ applicationAuditLogType: "authorizedAuthority" | "global";
91
+ applicationAuditLogSubType: "administrator" | "multiplePathALAI" | "userRelatedProfile" | "profile";
92
+ createdAt: number;
93
+ createdBy: string;
94
+ currentData?: any;
95
+ previousData?: any;
96
+ }, {
97
+ additionalAuditLogIds: {
98
+ referencePath: string;
99
+ referenceId: string;
100
+ }[];
101
+ applicationAuditLogAction: "create" | "update" | "delete" | "read" | "list" | "file";
102
+ applicationAuditLogType: "authorizedAuthority" | "global";
103
+ applicationAuditLogSubType: "administrator" | "multiplePathALAI" | "userRelatedProfile" | "profile";
104
+ createdAt: number;
105
+ createdBy: string;
106
+ currentData?: any;
107
+ previousData?: any;
108
+ }>;
109
+ export type IApplicationAuditLogUnstructured = z.infer<typeof IApplicationAuditLogUnstructuredSchema>;
52
110
  /**
53
- * This contains the enum for the audit log sub types for the multiple path classes.
111
+ * This contains the interface for the application audit log.
54
112
  */
55
- export declare enum MultiplePathAuditLogSubType {
56
- multiplePathALAI = "multiplePathALAI"
57
- }
113
+ export declare const IApplicationAuditLogSchema: z.ZodObject<{
114
+ additionalAuditLogIds: z.ZodArray<z.ZodObject<{
115
+ referencePath: z.ZodString;
116
+ referenceId: z.ZodString;
117
+ }, "strip", z.ZodTypeAny, {
118
+ referencePath: string;
119
+ referenceId: string;
120
+ }, {
121
+ referencePath: string;
122
+ referenceId: string;
123
+ }>, "many">;
124
+ applicationAuditLogAction: z.ZodEnum<["create", "update", "delete", "read", "list", "file"]>;
125
+ applicationAuditLogType: z.ZodEnum<["authorizedAuthority", "global"]>;
126
+ applicationAuditLogSubType: z.ZodUnion<[z.ZodEnum<["administrator"]>, z.ZodEnum<["multiplePathALAI"]>, z.ZodEnum<["userRelatedProfile"]>, z.ZodEnum<["profile"]>]>;
127
+ createdAt: z.ZodNumber;
128
+ createdBy: z.ZodString;
129
+ currentData: z.ZodOptional<z.ZodAny>;
130
+ previousData: z.ZodOptional<z.ZodAny>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ additionalAuditLogIds: {
133
+ referencePath: string;
134
+ referenceId: string;
135
+ }[];
136
+ applicationAuditLogAction: "create" | "update" | "delete" | "read" | "list" | "file";
137
+ applicationAuditLogType: "authorizedAuthority" | "global";
138
+ applicationAuditLogSubType: "administrator" | "multiplePathALAI" | "userRelatedProfile" | "profile";
139
+ createdAt: number;
140
+ createdBy: string;
141
+ currentData?: any;
142
+ previousData?: any;
143
+ }, {
144
+ additionalAuditLogIds: {
145
+ referencePath: string;
146
+ referenceId: string;
147
+ }[];
148
+ applicationAuditLogAction: "create" | "update" | "delete" | "read" | "list" | "file";
149
+ applicationAuditLogType: "authorizedAuthority" | "global";
150
+ applicationAuditLogSubType: "administrator" | "multiplePathALAI" | "userRelatedProfile" | "profile";
151
+ createdAt: number;
152
+ createdBy: string;
153
+ currentData?: any;
154
+ previousData?: any;
155
+ }>;
156
+ export type IApplicationAuditLog = z.infer<typeof IApplicationAuditLogSchema>;
58
157
  /**
59
158
  * This contains the interface for keeping the query audit log and value.
60
159
  */
61
- export interface IQueryObjectAndValueForAuditLog {
160
+ export declare const QueryObjectAndValueForAuditLogSchema: z.ZodObject<{
161
+ queryObject: z.ZodString;
162
+ queryValue: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>;
163
+ }, "strip", z.ZodTypeAny, {
62
164
  queryObject: string;
63
165
  queryValue: string | number | boolean;
64
- }
65
- /**
66
- * This contains the enum for the audit log sub types.
67
- */
68
- export type ApplicationAuditLogSubType = AdministrationAuditLogSubType | UserAuditLogSubType | PublicDataAuditLogSubType | MultiplePathAuditLogSubType;
69
- /**
70
- * This contains the enum for the audit log sub types for the administrator classes.
71
- */
72
- export declare enum AdministrationAuditLogSubType {
73
- administrator = "administrator"
74
- }
75
- /**
76
- * This contains the enum for the audit log sub types for the user classes.
77
- */
78
- export declare enum UserAuditLogSubType {
79
- profile = "profile"
80
- }
81
- /**
82
- * This contains the enum for the audit log sub types for the public data classes.
83
- */
84
- export declare enum PublicDataAuditLogSubType {
85
- userRelatedProfile = "userRelatedProfile"
86
- }
166
+ }, {
167
+ queryObject: string;
168
+ queryValue: string | number | boolean;
169
+ }>;
170
+ export type IQueryObjectAndValueForAuditLog = z.infer<typeof QueryObjectAndValueForAuditLogSchema>;
87
171
  //# sourceMappingURL=application-audit-log-models.d.ts.map