@degenerate/generic 0.0.18 → 0.0.21

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 (34) hide show
  1. package/dist/_settings/application-settings.d.ts +14 -0
  2. package/dist/_settings/application-settings.d.ts.map +1 -0
  3. package/dist/_settings/application-settings.js +16 -0
  4. package/dist/application/audit-log/additional-ids/create-audit-log-additional-ids-with-query.d.ts +12 -0
  5. package/dist/application/audit-log/additional-ids/create-audit-log-additional-ids-with-query.d.ts.map +1 -0
  6. package/dist/application/audit-log/additional-ids/create-audit-log-additional-ids-with-query.js +33 -0
  7. package/dist/application/audit-log/additional-ids/create-mulitple-path-alai.d.ts +10 -0
  8. package/dist/application/audit-log/additional-ids/create-mulitple-path-alai.d.ts.map +1 -0
  9. package/dist/application/audit-log/additional-ids/create-mulitple-path-alai.js +18 -0
  10. package/dist/application/audit-log/additional-ids/create-query-audit-log-for-alai.d.ts +10 -0
  11. package/dist/application/audit-log/additional-ids/create-query-audit-log-for-alai.d.ts.map +1 -0
  12. package/dist/application/audit-log/additional-ids/create-query-audit-log-for-alai.js +19 -0
  13. package/dist/application/audit-log/create-application-audit-log.d.ts +16 -0
  14. package/dist/application/audit-log/create-application-audit-log.d.ts.map +1 -0
  15. package/dist/application/audit-log/create-application-audit-log.js +33 -0
  16. package/dist/application/index.d.ts +5 -0
  17. package/dist/application/index.d.ts.map +1 -0
  18. package/dist/application/index.js +26 -0
  19. package/dist/errors/audit-log/audit-log-errors.d.ts +20 -0
  20. package/dist/errors/audit-log/audit-log-errors.d.ts.map +1 -0
  21. package/dist/errors/audit-log/audit-log-errors.js +31 -0
  22. package/dist/errors/index.d.ts +1 -0
  23. package/dist/errors/index.d.ts.map +1 -1
  24. package/dist/errors/index.js +1 -0
  25. package/dist/helpers/file/file-helpers.d.ts +2 -1
  26. package/dist/helpers/file/file-helpers.d.ts.map +1 -1
  27. package/dist/helpers/file/file-helpers.js +5 -1
  28. package/dist/models/application/audit-log/application-audit-log-models.d.ts +87 -0
  29. package/dist/models/application/audit-log/application-audit-log-models.d.ts.map +1 -0
  30. package/dist/models/application/audit-log/application-audit-log-models.js +59 -0
  31. package/package.json +2 -3
  32. package/dist/models/generic/__tests__/request-response-models.d.ts +0 -2
  33. package/dist/models/generic/__tests__/request-response-models.d.ts.map +0 -1
  34. package/dist/models/generic/__tests__/request-response-models.js +0 -33
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This contains the settings for the application.
3
+ */
4
+ export declare const ApplicationSettings: {
5
+ MultiplePathALAI: string;
6
+ SystemValues: {
7
+ MaxSnapshotSize: number;
8
+ MaxSnapshotSizeLargeDocSet: number;
9
+ MaxStorageRecordsPerDoc: number;
10
+ MaxDocumentsToDeleteInBatch: number;
11
+ };
12
+ SystemUser: string;
13
+ };
14
+ //# sourceMappingURL=application-settings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application-settings.d.ts","sourceRoot":"","sources":["../../src/_settings/application-settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;CAS/B,CAAC"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ApplicationSettings = void 0;
4
+ /**
5
+ * This contains the settings for the application.
6
+ */
7
+ exports.ApplicationSettings = {
8
+ MultiplePathALAI: 'MultiplePathALAI', // the multiple path ALAI (used for the reference path fo the ALAI)
9
+ SystemValues: {
10
+ MaxSnapshotSize: 20, // the maximum number of snapshots to execute aka, store or retrieve in one request.
11
+ MaxSnapshotSizeLargeDocSet: 5, // the maximum number of snapshots to execute aka, store or retrieve in one request for a large document set.
12
+ MaxStorageRecordsPerDoc: 20, // the maximum number of records to store on a document.
13
+ MaxDocumentsToDeleteInBatch: 100, // the maximum number of documents to delete in a batch.
14
+ },
15
+ SystemUser: 'System', // the system user
16
+ };
@@ -0,0 +1,12 @@
1
+ import { IAdditionalApplicationAuditLogIds, IQueryObjectAndValueForAuditLog } from '../../../models/application/audit-log/application-audit-log-models';
2
+ /**
3
+ * This function creates the Audit Log Additional Ids with a query
4
+ *
5
+ * @param isQuery this is a query
6
+ * @param additionalApplicationAuditLogs the additional application audit logs
7
+ * @param queryVariables the query variables
8
+ * @returns
9
+ */
10
+ declare const createAuditLogAdditionalIdsWithQuery: (isQuery: boolean, additionalApplicationAuditLogIds: IAdditionalApplicationAuditLogIds[], queryVariables?: IQueryObjectAndValueForAuditLog[]) => IAdditionalApplicationAuditLogIds[];
11
+ export { createAuditLogAdditionalIdsWithQuery };
12
+ //# sourceMappingURL=create-audit-log-additional-ids-with-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-audit-log-additional-ids-with-query.d.ts","sourceRoot":"","sources":["../../../../src/application/audit-log/additional-ids/create-audit-log-additional-ids-with-query.ts"],"names":[],"mappings":"AACA,OAAO,EACH,iCAAiC,EACjC,+BAA+B,EAClC,MAAM,oEAAoE,CAAC;AAG5E;;;;;;;GAOG;AACH,QAAA,MAAM,oCAAoC,YAC7B,OAAO,oCACkB,iCAAiC,EAAE,mBACrD,+BAA+B,EAAE,KAClD,iCAAiC,EAiBnC,CAAC;AAEF,OAAO,EAAE,oCAAoC,EAAE,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createAuditLogAdditionalIdsWithQuery = void 0;
4
+ const audit_log_errors_1 = require("../../../errors/audit-log/audit-log-errors");
5
+ const create_query_audit_log_for_alai_1 = require("./create-query-audit-log-for-alai");
6
+ /**
7
+ * This function creates the Audit Log Additional Ids with a query
8
+ *
9
+ * @param isQuery this is a query
10
+ * @param additionalApplicationAuditLogs the additional application audit logs
11
+ * @param queryVariables the query variables
12
+ * @returns
13
+ */
14
+ const createAuditLogAdditionalIdsWithQuery = (isQuery, additionalApplicationAuditLogIds, queryVariables = []) => {
15
+ if (isQuery) {
16
+ if (queryVariables.length === 0)
17
+ throw new audit_log_errors_1.AuditLogAlaiQueryNotProvidedError();
18
+ const queryALAI = (0, create_query_audit_log_for_alai_1.createQueryAuditLogForALAI)(queryVariables);
19
+ // get the last audit log additional id record
20
+ const lastIndex = additionalApplicationAuditLogIds.length - 1;
21
+ const queryALAIRecord = additionalApplicationAuditLogIds[lastIndex];
22
+ queryALAIRecord.referenceId = queryALAI; // update the reference path
23
+ additionalApplicationAuditLogIds[lastIndex] = queryALAIRecord;
24
+ }
25
+ else {
26
+ const lastIndex = additionalApplicationAuditLogIds.length - 1;
27
+ const lastRecord = additionalApplicationAuditLogIds[lastIndex];
28
+ if (lastRecord.referenceId === '')
29
+ throw new audit_log_errors_1.AuditLogAlaiIdNotProvidedError();
30
+ }
31
+ return additionalApplicationAuditLogIds;
32
+ };
33
+ exports.createAuditLogAdditionalIdsWithQuery = createAuditLogAdditionalIdsWithQuery;
@@ -0,0 +1,10 @@
1
+ import { IAdditionalApplicationAuditLogIds } from '../../../models/application/audit-log/application-audit-log-models';
2
+ /**
3
+ * This function creates the multiple path Audit Log Additional Ids
4
+ *
5
+ * @param referencePaths the paths to the database storage for the audit log ie. /sharedata/{id}, /sharefunctions/{id}
6
+ * @returns
7
+ */
8
+ declare const createMultiplePathALAI: (referencePaths: string[]) => IAdditionalApplicationAuditLogIds[];
9
+ export { createMultiplePathALAI };
10
+ //# sourceMappingURL=create-mulitple-path-alai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-mulitple-path-alai.d.ts","sourceRoot":"","sources":["../../../../src/application/audit-log/additional-ids/create-mulitple-path-alai.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,oEAAoE,CAAC;AAEvH;;;;;GAKG;AACH,QAAA,MAAM,sBAAsB,mBAAoB,MAAM,EAAE,KAAG,iCAAiC,EAQ3F,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createMultiplePathALAI = void 0;
4
+ const application_settings_1 = require("../../../_settings/application-settings");
5
+ /**
6
+ * This function creates the multiple path Audit Log Additional Ids
7
+ *
8
+ * @param referencePaths the paths to the database storage for the audit log ie. /sharedata/{id}, /sharefunctions/{id}
9
+ * @returns
10
+ */
11
+ const createMultiplePathALAI = (referencePaths) => {
12
+ const additionalApplicationAuditLogIds = [];
13
+ for (const referencePath of referencePaths) {
14
+ additionalApplicationAuditLogIds.push({ referencePath: application_settings_1.ApplicationSettings.MultiplePathALAI, referenceId: referencePath });
15
+ }
16
+ return additionalApplicationAuditLogIds;
17
+ };
18
+ exports.createMultiplePathALAI = createMultiplePathALAI;
@@ -0,0 +1,10 @@
1
+ import { IQueryObjectAndValueForAuditLog } from '../../../models/application/audit-log/application-audit-log-models';
2
+ /**
3
+ * this creates a query audit log for ALAI
4
+ *
5
+ * @param queryVariables the query variables to add for the audit log.
6
+ * @returns
7
+ */
8
+ declare const createQueryAuditLogForALAI: (queryVariables: IQueryObjectAndValueForAuditLog[]) => string;
9
+ export { createQueryAuditLogForALAI };
10
+ //# sourceMappingURL=create-query-audit-log-for-alai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-query-audit-log-for-alai.d.ts","sourceRoot":"","sources":["../../../../src/application/audit-log/additional-ids/create-query-audit-log-for-alai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,oEAAoE,CAAC;AAErH;;;;;GAKG;AACH,QAAA,MAAM,0BAA0B,mBAAoB,+BAA+B,EAAE,KAAG,MASvF,CAAC;AAEF,OAAO,EAAE,0BAA0B,EAAE,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createQueryAuditLogForALAI = void 0;
4
+ /**
5
+ * this creates a query audit log for ALAI
6
+ *
7
+ * @param queryVariables the query variables to add for the audit log.
8
+ * @returns
9
+ */
10
+ const createQueryAuditLogForALAI = (queryVariables) => {
11
+ let queryAuditLog = 'Query Performed with variables: ';
12
+ if (queryVariables.length > 0) {
13
+ for (const queryVariable of queryVariables) {
14
+ queryAuditLog += queryVariable.queryObject + ':' + queryVariable.queryValue.toString() + ', ';
15
+ }
16
+ }
17
+ return queryAuditLog;
18
+ };
19
+ exports.createQueryAuditLogForALAI = createQueryAuditLogForALAI;
@@ -0,0 +1,16 @@
1
+ import { ApplicationAuditLogAction, ApplicationAuditLogSubType, ApplicationAuditLogType, IAdditionalApplicationAuditLogIds, IApplicationAuditLog } from '../../models/application/audit-log/application-audit-log-models';
2
+ /**
3
+ * This creates the application audit log.
4
+ *
5
+ * @param applicationAuditLogAction this is the action that was performed.
6
+ * @param applicationAuditLogType this is the type of audit log.
7
+ * @param applicationAuditLogSubType the sub type of audit log.
8
+ * @param createdBy the is the user Id of the user that created the audit log.
9
+ * @param currentData the current data.
10
+ * @param previousData the previous data.
11
+ * @param championsNetworkId the champions network Id.
12
+ * @param organizationId the organization Id.
13
+ */
14
+ declare const createApplicationLog: (applicationAuditLogAction: ApplicationAuditLogAction, applicationAuditLogSubType: ApplicationAuditLogSubType, createdBy: string, applicationAuditLogType?: ApplicationAuditLogType, alai?: IAdditionalApplicationAuditLogIds[], currentData?: any, previousData?: any) => IApplicationAuditLog;
15
+ export { createApplicationLog };
16
+ //# sourceMappingURL=create-application-audit-log.d.ts.map
@@ -0,0 +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,oBAAoB,8BACK,yBAAyB,8BACxB,0BAA0B,aAC3C,MAAM,4BACQ,uBAAuB,SAC1C,iCAAiC,EAAE,gBAC3B,GAAG,iBACF,GAAG,KACnB,oBAaF,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.createApplicationLog = void 0;
5
+ const application_audit_log_models_1 = require("../../models/application/audit-log/application-audit-log-models");
6
+ /**
7
+ * This creates the application audit log.
8
+ *
9
+ * @param applicationAuditLogAction this is the action that was performed.
10
+ * @param applicationAuditLogType this is the type of audit log.
11
+ * @param applicationAuditLogSubType the sub type of audit log.
12
+ * @param createdBy the is the user Id of the user that created the audit log.
13
+ * @param currentData the current data.
14
+ * @param previousData the previous data.
15
+ * @param championsNetworkId the champions network Id.
16
+ * @param organizationId the organization Id.
17
+ */
18
+ const createApplicationLog = (applicationAuditLogAction, applicationAuditLogSubType, createdBy, applicationAuditLogType = application_audit_log_models_1.ApplicationAuditLogType.global, alai = [], currentData, previousData) => {
19
+ const auditLog = {
20
+ additionalAuditLogIds: alai,
21
+ applicationAuditLogAction,
22
+ applicationAuditLogType,
23
+ applicationAuditLogSubType,
24
+ createdBy,
25
+ createdAt: Date.now(),
26
+ };
27
+ if (currentData)
28
+ auditLog.currentData = currentData;
29
+ if (previousData)
30
+ auditLog.previousData = previousData;
31
+ return auditLog;
32
+ };
33
+ exports.createApplicationLog = createApplicationLog;
@@ -0,0 +1,5 @@
1
+ export * from './audit-log/additional-ids/create-audit-log-additional-ids-with-query';
2
+ export * from './audit-log/additional-ids/create-mulitple-path-alai';
3
+ export * from './audit-log/additional-ids/create-query-audit-log-for-alai';
4
+ export * from './audit-log/create-application-audit-log';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAMA,cAAc,uEAAuE,CAAC;AACtF,cAAc,sDAAsD,CAAC;AACrE,cAAc,4DAA4D,CAAC;AAI3E,cAAc,0CAA0C,CAAC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ //#region Application
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ //#region Audit Log
19
+ //#region Additional Ids
20
+ __exportStar(require("./audit-log/additional-ids/create-audit-log-additional-ids-with-query"), exports);
21
+ __exportStar(require("./audit-log/additional-ids/create-mulitple-path-alai"), exports);
22
+ __exportStar(require("./audit-log/additional-ids/create-query-audit-log-for-alai"), exports);
23
+ //#endregion Additional Ids
24
+ __exportStar(require("./audit-log/create-application-audit-log"), exports);
25
+ //#endregion Audit Log
26
+ //#endregion Application
@@ -0,0 +1,20 @@
1
+ import { BaseError } from '../base-error';
2
+ /**
3
+ * This is throw when the Audit Log Additional Id's reference id is not provided.
4
+ */
5
+ export declare class AuditLogAlaiIdNotProvidedError extends BaseError {
6
+ /**
7
+ * This is throw when the Additional Log Additional Id's reference id is not provided.
8
+ */
9
+ constructor();
10
+ }
11
+ /**
12
+ * This is throw when the Audit Log Additional Id's query is not provided.
13
+ */
14
+ export declare class AuditLogAlaiQueryNotProvidedError extends BaseError {
15
+ /**
16
+ * This is throw when the Audit Log Additional Id's query is not provided.
17
+ */
18
+ constructor();
19
+ }
20
+ //# sourceMappingURL=audit-log-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit-log-errors.d.ts","sourceRoot":"","sources":["../../../src/errors/audit-log/audit-log-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAI1C;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,SAAS;IACzD;;OAEG;;CAIN;AAED;;GAEG;AACH,qBAAa,iCAAkC,SAAQ,SAAS;IAC5D;;OAEG;;CAIN"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuditLogAlaiQueryNotProvidedError = exports.AuditLogAlaiIdNotProvidedError = void 0;
4
+ // This file contains the errors for that can occur in the audit log.
5
+ const base_error_1 = require("../base-error");
6
+ //#region Audit Log Additional Id's Errors
7
+ /**
8
+ * This is throw when the Audit Log Additional Id's reference id is not provided.
9
+ */
10
+ class AuditLogAlaiIdNotProvidedError extends base_error_1.BaseError {
11
+ /**
12
+ * This is throw when the Additional Log Additional Id's reference id is not provided.
13
+ */
14
+ constructor() {
15
+ super('Audit Log Additional Id\'s reference id is not provided');
16
+ }
17
+ }
18
+ exports.AuditLogAlaiIdNotProvidedError = AuditLogAlaiIdNotProvidedError;
19
+ /**
20
+ * This is throw when the Audit Log Additional Id's query is not provided.
21
+ */
22
+ class AuditLogAlaiQueryNotProvidedError extends base_error_1.BaseError {
23
+ /**
24
+ * This is throw when the Audit Log Additional Id's query is not provided.
25
+ */
26
+ constructor() {
27
+ super('Audit Log Additional Id\'s query is not provided');
28
+ }
29
+ }
30
+ exports.AuditLogAlaiQueryNotProvidedError = AuditLogAlaiQueryNotProvidedError;
31
+ //#endregion Audit Log Additional Id's Errors
@@ -1,3 +1,4 @@
1
+ export * from './audit-log/audit-log-errors';
1
2
  export * from './base-error';
2
3
  export * from './generic/generic-errors';
3
4
  export * from './request/request-errors';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC"}
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./audit-log/audit-log-errors"), exports);
17
18
  __exportStar(require("./base-error"), exports);
18
19
  __exportStar(require("./generic/generic-errors"), exports);
19
20
  __exportStar(require("./request/request-errors"), exports);
@@ -5,8 +5,9 @@
5
5
  * @param arrayOfFiles the array of files to add to.
6
6
  * @param ignoreIndexFiles the flag to ignore index files.
7
7
  * @param ignoreTestFiles the flag to ignore test files.
8
+ * @param ignoreTestDataFiles the flag to ignore test data files.
8
9
  * @returns
9
10
  */
10
- declare const getAllFiles: (dirPath: string, arrayOfFiles?: string[], ignoreIndexFiles?: boolean, ignoreTestFiles?: boolean) => string[];
11
+ declare const getAllFiles: (dirPath: string, arrayOfFiles?: string[], ignoreIndexFiles?: boolean, ignoreTestFiles?: boolean, ignoreTestDataFiles?: boolean) => string[];
11
12
  export { getAllFiles };
12
13
  //# sourceMappingURL=file-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"file-helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers/file/file-helpers.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,QAAA,MAAM,WAAW,YAAa,MAAM,iBAAgB,MAAM,EAAE,4DAAyD,MAAM,EAmB1H,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
1
+ {"version":3,"file":"file-helpers.d.ts","sourceRoot":"","sources":["../../../src/helpers/file/file-helpers.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,QAAA,MAAM,WAAW,YACN,MAAM,iBACD,MAAM,EAAE,2FAIrB,MAAM,EAsBR,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -14,9 +14,10 @@ const path_1 = __importDefault(require("path"));
14
14
  * @param arrayOfFiles the array of files to add to.
15
15
  * @param ignoreIndexFiles the flag to ignore index files.
16
16
  * @param ignoreTestFiles the flag to ignore test files.
17
+ * @param ignoreTestDataFiles the flag to ignore test data files.
17
18
  * @returns
18
19
  */
19
- const getAllFiles = (dirPath, arrayOfFiles = [], ignoreIndexFiles = true, ignoreTestFiles = true) => {
20
+ const getAllFiles = (dirPath, arrayOfFiles = [], ignoreIndexFiles = true, ignoreTestFiles = true, ignoreTestDataFiles = true) => {
20
21
  const files = fs_1.default.readdirSync(dirPath);
21
22
  // loop through all the files in the directory.
22
23
  files.forEach((file) => {
@@ -28,6 +29,9 @@ const getAllFiles = (dirPath, arrayOfFiles = [], ignoreIndexFiles = true, ignore
28
29
  if (ignoreTestFiles && file.endsWith('.test.ts')) {
29
30
  return;
30
31
  }
32
+ if (ignoreTestDataFiles && file.endsWith('.test-data.ts')) {
33
+ return;
34
+ }
31
35
  if (ignoreIndexFiles && file === 'index.ts') {
32
36
  return;
33
37
  }
@@ -0,0 +1,87 @@
1
+ /**
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.
4
+ */
5
+ export type IApplicationAuditLog = IApplicationAuditLogUnstructured;
6
+ /**
7
+ * This is an application audit log.
8
+ */
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
+ /**
20
+ * This contains the additional audit log Ids in order of the access in the application
21
+ * for database this would be the reference path and reference Id
22
+ * for User Financial data this would be
23
+ * [
24
+ * { referencePath: 'Administrator', referenceId: '{{ administratorId }} ' }, // These are every path downstream from the root data
25
+ * { referencePath: 'Accounts', referenceId: '{{ accountId }}' },
26
+ * ]
27
+ *
28
+ * These are available in the helper files based on the Application Audit Log Sub Types.
29
+ */
30
+ export interface IAdditionalApplicationAuditLogIds {
31
+ referencePath: string;
32
+ 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
+ }
45
+ /**
46
+ * This contains the model for the audit logs that are generated in the system.
47
+ */
48
+ export declare enum ApplicationAuditLogType {
49
+ authorizedAuthority = "authorizedAuthority",// the authorized authority audit log
50
+ global = "global"
51
+ }
52
+ /**
53
+ * This contains the enum for the audit log sub types for the multiple path classes.
54
+ */
55
+ export declare enum MultiplePathAuditLogSubType {
56
+ multiplePathALAI = "multiplePathALAI"
57
+ }
58
+ /**
59
+ * This contains the interface for keeping the query audit log and value.
60
+ */
61
+ export interface IQueryObjectAndValueForAuditLog {
62
+ queryObject: string;
63
+ 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
+ }
87
+ //# sourceMappingURL=application-audit-log-models.d.ts.map
@@ -0,0 +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":"AAEA;;;GAGG;AAIH,MAAM,MAAM,oBAAoB,GAAG,gCAAgC,CAAC;AACpE;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAC7C,qBAAqB,EAAE,iCAAiC,EAAE,CAAC;IAC3D,yBAAyB,EAAE,yBAAyB,CAAC;IACrD,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,GAAG,CAAC;IAClB,YAAY,CAAC,EAAE,GAAG,CAAC;CACtB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,iCAAiC;IAC9C,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,oBAAY,yBAAyB;IACjC,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,IAAI,SAAS;CAChB;AAED;;GAEG;AACH,oBAAY,uBAAuB;IAC/B,mBAAmB,wBAAwB,CAAE,qCAAqC;IAClF,MAAM,WAAW;CACpB;AAKD;;GAEG;AACH,oBAAY,2BAA2B;IACnC,gBAAgB,qBAAqB;CACxC;AAMD;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CACzC;AAMD;;GAEG;AAEH,MAAM,MAAM,0BAA0B,GAAG,6BAA6B,GAAG,mBAAmB,GAAG,yBAAyB,GAClH,2BAA2B,CAAC;AAIlC;;GAEG;AACH,oBAAY,6BAA6B;IACrC,aAAa,kBAAkB;CAClC;AAMD;;GAEG;AACH,oBAAY,mBAAmB;IAC3B,OAAO,YAAY;CACtB;AAMD;;GAEG;AACH,oBAAY,yBAAyB;IACjC,kBAAkB,uBAAuB;CAC5C"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /* eslint-disable @typescript-eslint/no-explicit-any */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.PublicDataAuditLogSubType = exports.UserAuditLogSubType = exports.AdministrationAuditLogSubType = exports.MultiplePathAuditLogSubType = exports.ApplicationAuditLogType = exports.ApplicationAuditLogAction = void 0;
5
+ /**
6
+ * This contains the enum for the audit log actions.
7
+ */
8
+ var ApplicationAuditLogAction;
9
+ (function (ApplicationAuditLogAction) {
10
+ ApplicationAuditLogAction["create"] = "create";
11
+ ApplicationAuditLogAction["update"] = "update";
12
+ ApplicationAuditLogAction["delete"] = "delete";
13
+ ApplicationAuditLogAction["read"] = "read";
14
+ ApplicationAuditLogAction["list"] = "list";
15
+ ApplicationAuditLogAction["file"] = "file";
16
+ })(ApplicationAuditLogAction || (exports.ApplicationAuditLogAction = ApplicationAuditLogAction = {}));
17
+ /**
18
+ * This contains the model for the audit logs that are generated in the system.
19
+ */
20
+ var ApplicationAuditLogType;
21
+ (function (ApplicationAuditLogType) {
22
+ ApplicationAuditLogType["authorizedAuthority"] = "authorizedAuthority";
23
+ ApplicationAuditLogType["global"] = "global";
24
+ })(ApplicationAuditLogType || (exports.ApplicationAuditLogType = ApplicationAuditLogType = {}));
25
+ //#region Multiple Path Audit Log Types
26
+ /**
27
+ * This contains the enum for the audit log sub types for the multiple path classes.
28
+ */
29
+ var MultiplePathAuditLogSubType;
30
+ (function (MultiplePathAuditLogSubType) {
31
+ MultiplePathAuditLogSubType["multiplePathALAI"] = "multiplePathALAI";
32
+ })(MultiplePathAuditLogSubType || (exports.MultiplePathAuditLogSubType = MultiplePathAuditLogSubType = {}));
33
+ //#region Administration Audit Log Types
34
+ /**
35
+ * This contains the enum for the audit log sub types for the administrator classes.
36
+ */
37
+ var AdministrationAuditLogSubType;
38
+ (function (AdministrationAuditLogSubType) {
39
+ AdministrationAuditLogSubType["administrator"] = "administrator";
40
+ })(AdministrationAuditLogSubType || (exports.AdministrationAuditLogSubType = AdministrationAuditLogSubType = {}));
41
+ // #endregion Administration Audit Log Types
42
+ //#region User Audit Log Types
43
+ /**
44
+ * This contains the enum for the audit log sub types for the user classes.
45
+ */
46
+ var UserAuditLogSubType;
47
+ (function (UserAuditLogSubType) {
48
+ UserAuditLogSubType["profile"] = "profile";
49
+ })(UserAuditLogSubType || (exports.UserAuditLogSubType = UserAuditLogSubType = {}));
50
+ //#endregion User Audit Log Types
51
+ //#region Public Data audit log types
52
+ /**
53
+ * This contains the enum for the audit log sub types for the public data classes.
54
+ */
55
+ var PublicDataAuditLogSubType;
56
+ (function (PublicDataAuditLogSubType) {
57
+ PublicDataAuditLogSubType["userRelatedProfile"] = "userRelatedProfile";
58
+ })(PublicDataAuditLogSubType || (exports.PublicDataAuditLogSubType = PublicDataAuditLogSubType = {}));
59
+ //#endregion Public Data audit log types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@degenerate/generic",
3
- "version": "0.0.18",
3
+ "version": "0.0.21",
4
4
  "description": "This contains the generic information needed for the ShareData Adaptive Framework Ecosystem (SAFE) network",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,7 +30,6 @@
30
30
  "homepage": "https://github.com/syncrude/safe#readme",
31
31
  "devDependencies": {
32
32
  "@eslint/js": "^9.12.0",
33
- "@jest/globals": "^29.7.0",
34
33
  "@types/elliptic": "^6.4.18",
35
34
  "@types/eslint__js": "^8.42.3",
36
35
  "@types/jest": "^29.5.13",
@@ -51,5 +50,5 @@
51
50
  "bip39": "^3.1.0",
52
51
  "elliptic": "^6.5.7"
53
52
  },
54
- "gitHead": "422633e36d3f60c773c8bf289285a78b5a75ef01"
53
+ "gitHead": "1ac7d89a03b0f9f79a5be9677eb930abba812cec"
55
54
  }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=request-response-models.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-response-models.d.ts","sourceRoot":"","sources":["../../../../src/models/generic/__tests__/request-response-models.ts"],"names":[],"mappings":""}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- describe('IGenericResponse', () => {
4
- it('should create a successful response without an error', () => {
5
- const response = {
6
- successful: true,
7
- };
8
- expect(response.successful).toBe(true);
9
- expect(response.error).toBeUndefined();
10
- });
11
- it('should create a failed response with an error message', () => {
12
- const errorMessage = 'An error occurred';
13
- const response = {
14
- successful: false,
15
- error: errorMessage,
16
- };
17
- expect(response.successful).toBe(false);
18
- expect(response.error).toBe(errorMessage);
19
- });
20
- it('should handle optional error property correctly', () => {
21
- const response = {
22
- successful: true,
23
- };
24
- expect(response.successful).toBe(true);
25
- expect(response.error).toBeUndefined();
26
- const errorResponse = {
27
- successful: false,
28
- error: 'An error occurred',
29
- };
30
- expect(errorResponse.successful).toBe(false);
31
- expect(errorResponse.error).toBe('An error occurred');
32
- });
33
- });