@degenerate/generic 0.1.9 → 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.
- package/dist/application/audit-log/create-application-audit-log.d.ts.map +1 -1
- package/dist/application/audit-log/create-application-audit-log.js +1 -1
- package/dist/application/database/firestore/generics/add-items-to-database.d.ts.map +1 -1
- package/dist/application/database/firestore/generics/add-items-to-database.js +2 -2
- package/dist/application/database/firestore/generics/add-or-update-items-to-database.d.ts.map +1 -1
- package/dist/application/database/firestore/generics/add-or-update-items-to-database.js +3 -3
- package/dist/application/database/firestore/generics/delete-items-on-database.d.ts.map +1 -1
- package/dist/application/database/firestore/generics/delete-items-on-database.js +2 -2
- package/dist/application/database/firestore/generics/get-item-from-database.d.ts.map +1 -1
- package/dist/application/database/firestore/generics/get-item-from-database.js +2 -2
- package/dist/application/database/firestore/generics/get-items-different-path-on-database.d.ts.map +1 -1
- package/dist/application/database/firestore/generics/get-items-different-path-on-database.js +2 -2
- package/dist/application/database/firestore/generics/get-items-from-database.d.ts.map +1 -1
- package/dist/application/database/firestore/generics/get-items-from-database.js +2 -2
- package/dist/application/database/firestore/generics/update-items-on-database.d.ts.map +1 -1
- package/dist/application/database/firestore/generics/update-items-on-database.js +2 -2
- package/dist/application/database/firestore/generics/update-items-properties-on-database.d.ts.map +1 -1
- package/dist/application/database/firestore/generics/update-items-properties-on-database.js +2 -2
- package/dist/authorization/safe/authorization/authorized-authorities.d.ts.map +1 -1
- package/dist/helpers/request/params-object-helpers.d.ts +7 -1
- package/dist/helpers/request/params-object-helpers.d.ts.map +1 -1
- package/dist/helpers/request/params-object-helpers.js +10 -1
- package/dist/helpers/request/request-object-helpers.d.ts +16 -1
- package/dist/helpers/request/request-object-helpers.d.ts.map +1 -1
- package/dist/helpers/request/request-object-helpers.js +25 -2
- package/dist/models/application/audit-log/application-audit-log-models.d.ts +144 -60
- package/dist/models/application/audit-log/application-audit-log-models.d.ts.map +1 -1
- package/dist/models/application/audit-log/application-audit-log-models.js +87 -41
- package/dist/models/application/database/firestore-models.d.ts +370 -54
- package/dist/models/application/database/firestore-models.d.ts.map +1 -1
- package/dist/models/application/database/firestore-models.js +119 -1
- package/dist/models/authorization/authorization-models.d.ts +76 -33
- package/dist/models/authorization/authorization-models.d.ts.map +1 -1
- package/dist/models/authorization/authorization-models.js +80 -12
- package/dist/models/rules/share-rule-models.d.ts.map +1 -1
- package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts +14 -0
- package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts.map +1 -0
- package/dist/transactions/authority/create-safe-transaction-authority-data.js +21 -0
- package/dist/transactions/authority/create-safe-transaction-authority.d.ts +15 -0
- package/dist/transactions/authority/create-safe-transaction-authority.d.ts.map +1 -0
- package/dist/transactions/authority/create-safe-transaction-authority.js +29 -0
- package/dist/transactions/index.d.ts +3 -0
- package/dist/transactions/index.d.ts.map +1 -0
- package/dist/transactions/index.js +20 -0
- 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,
|
|
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.
|
|
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,
|
|
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.
|
|
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.
|
|
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
|
}
|
package/dist/application/database/firestore/generics/add-or-update-items-to-database.d.ts.map
CHANGED
|
@@ -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,
|
|
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.
|
|
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.
|
|
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.
|
|
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,
|
|
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.
|
|
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.
|
|
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,
|
|
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.
|
|
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.
|
|
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.
|
package/dist/application/database/firestore/generics/get-items-different-path-on-database.d.ts.map
CHANGED
|
@@ -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,
|
|
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"}
|
package/dist/application/database/firestore/generics/get-items-different-path-on-database.js
CHANGED
|
@@ -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.
|
|
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.
|
|
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,
|
|
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.
|
|
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.
|
|
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,
|
|
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.
|
|
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.
|
|
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);
|
package/dist/application/database/firestore/generics/update-items-properties-on-database.d.ts.map
CHANGED
|
@@ -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,
|
|
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.
|
|
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.
|
|
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,
|
|
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"}
|
|
@@ -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;
|
|
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 = '
|
|
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
|
|
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
|
|
5
|
+
export declare const AdministrationAuditLogSubTypeSchema: z.ZodEnum<["administrator"]>;
|
|
6
|
+
export type AdministrationAuditLogSubType = z.infer<typeof AdministrationAuditLogSubTypeSchema>;
|
|
6
7
|
/**
|
|
7
|
-
* This
|
|
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
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
export
|
|
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
|
-
*
|
|
64
|
+
* Application Audit Log Unstructured Schema
|
|
47
65
|
*/
|
|
48
|
-
export declare
|
|
49
|
-
|
|
50
|
-
|
|
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
|
|
111
|
+
* This contains the interface for the application audit log.
|
|
54
112
|
*/
|
|
55
|
-
export declare
|
|
56
|
-
|
|
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
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
export type
|
|
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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application-audit-log-models.d.ts","sourceRoot":"","sources":["../../../../src/models/application/audit-log/application-audit-log-models.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"application-audit-log-models.d.ts","sourceRoot":"","sources":["../../../../src/models/application/audit-log/application-audit-log-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,mCAAmC,8BAE9C,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG;;GAEG;AACH,eAAO,MAAM,+BAA+B,mEAO1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAIxF;;GAEG;AACH,eAAO,MAAM,6BAA6B,8CAGxC,CAAC;AAEH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;;GAEG;AACH,eAAO,MAAM,iCAAiC,iCAE5C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F;;GAEG;AACH,eAAO,MAAM,+BAA+B,mCAE1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,yBAAyB,wBAEpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,gCAAgC,wIAK3C,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAO1F;;;GAGG;AAIH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;EAGjD,CAAC;AAEH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAEvG;;GAEG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASjD,CAAC;AAEH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC;AAGtG;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAyC,CAAC;AAEjF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI9E;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;;;;EAG/C,CAAC;AAEH,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC"}
|