@degenerate/generic 0.1.9 → 0.1.11

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 (95) 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/jwt/sign/create-authorization-issuer.d.ts +2 -2
  20. package/dist/authorization/jwt/sign/create-authorization-issuer.d.ts.map +1 -1
  21. package/dist/authorization/jwt/sign/create-authorization-subject.d.ts +2 -2
  22. package/dist/authorization/jwt/sign/create-authorization-subject.d.ts.map +1 -1
  23. package/dist/authorization/jwt/sign/create-jwt-options.d.ts +2 -2
  24. package/dist/authorization/jwt/sign/create-jwt-options.d.ts.map +1 -1
  25. package/dist/authorization/safe/authorization/authorized-authorities.d.ts +5 -5
  26. package/dist/authorization/safe/authorization/authorized-authorities.d.ts.map +1 -1
  27. package/dist/authorization/safe/request/determine-issuer-from-request.d.ts +2 -2
  28. package/dist/authorization/safe/request/determine-issuer-from-request.d.ts.map +1 -1
  29. package/dist/authorization/safe/request/issuer/determine-issuer-from-bearer-token.d.ts +2 -2
  30. package/dist/authorization/safe/request/issuer/determine-issuer-from-bearer-token.d.ts.map +1 -1
  31. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-issuer.d.ts +2 -2
  32. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-issuer.d.ts.map +1 -1
  33. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-subject.d.ts +2 -2
  34. package/dist/authorization/safe/validation/jwt/payload/verify-authorization-subject.d.ts.map +1 -1
  35. package/dist/helpers/request/params-object-helpers.d.ts +7 -1
  36. package/dist/helpers/request/params-object-helpers.d.ts.map +1 -1
  37. package/dist/helpers/request/params-object-helpers.js +10 -1
  38. package/dist/helpers/request/request-object-helpers.d.ts +16 -1
  39. package/dist/helpers/request/request-object-helpers.d.ts.map +1 -1
  40. package/dist/helpers/request/request-object-helpers.js +25 -2
  41. package/dist/models/application/audit-log/application-audit-log-models.d.ts +144 -60
  42. package/dist/models/application/audit-log/application-audit-log-models.d.ts.map +1 -1
  43. package/dist/models/application/audit-log/application-audit-log-models.js +87 -41
  44. package/dist/models/application/database/firestore-models.d.ts +370 -54
  45. package/dist/models/application/database/firestore-models.d.ts.map +1 -1
  46. package/dist/models/application/database/firestore-models.js +119 -1
  47. package/dist/models/authorization/authorization-models.d.ts +76 -33
  48. package/dist/models/authorization/authorization-models.d.ts.map +1 -1
  49. package/dist/models/authorization/authorization-models.js +82 -12
  50. package/dist/models/crypto/crypto-models.d.ts +10 -2
  51. package/dist/models/crypto/crypto-models.d.ts.map +1 -1
  52. package/dist/models/crypto/crypto-models.js +6 -0
  53. package/dist/models/data/data-models.d.ts +18 -5
  54. package/dist/models/data/data-models.d.ts.map +1 -1
  55. package/dist/models/data/data-models.js +24 -1
  56. package/dist/models/dynamic-execution/dynamic-execution-models.d.ts +13 -3
  57. package/dist/models/dynamic-execution/dynamic-execution-models.d.ts.map +1 -1
  58. package/dist/models/dynamic-execution/dynamic-execution-models.js +10 -0
  59. package/dist/models/events/share-event-models.d.ts +145 -24
  60. package/dist/models/events/share-event-models.d.ts.map +1 -1
  61. package/dist/models/events/share-event-models.js +53 -2
  62. package/dist/models/functions/share-data-function-models.d.ts +251 -32
  63. package/dist/models/functions/share-data-function-models.d.ts.map +1 -1
  64. package/dist/models/functions/share-data-function-models.js +100 -3
  65. package/dist/models/generic/request-response-models.d.ts +11 -3
  66. package/dist/models/generic/request-response-models.d.ts.map +1 -1
  67. package/dist/models/generic/request-response-models.js +9 -0
  68. package/dist/models/index.d.ts +2 -1
  69. package/dist/models/index.d.ts.map +1 -1
  70. package/dist/models/index.js +6 -1
  71. package/dist/models/safe/rules/share-rule-models.d.ts +931 -0
  72. package/dist/models/safe/rules/share-rule-models.d.ts.map +1 -0
  73. package/dist/models/safe/rules/share-rule-models.js +341 -0
  74. package/dist/models/safe/safe-transaction-models.d.ts +137 -20
  75. package/dist/models/safe/safe-transaction-models.d.ts.map +1 -1
  76. package/dist/models/safe/safe-transaction-models.js +88 -3
  77. package/dist/models/safe/transactions/authorities-transactions-models.d.ts +391 -0
  78. package/dist/models/safe/transactions/authorities-transactions-models.d.ts.map +1 -0
  79. package/dist/models/safe/transactions/authorities-transactions-models.js +56 -0
  80. package/dist/models/share-data/share-data.d.ts +144 -23
  81. package/dist/models/share-data/share-data.d.ts.map +1 -1
  82. package/dist/models/share-data/share-data.js +66 -1
  83. package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts +14 -0
  84. package/dist/transactions/authority/create-safe-transaction-authority-data.d.ts.map +1 -0
  85. package/dist/transactions/authority/create-safe-transaction-authority-data.js +21 -0
  86. package/dist/transactions/authority/create-safe-transaction-authority.d.ts +15 -0
  87. package/dist/transactions/authority/create-safe-transaction-authority.d.ts.map +1 -0
  88. package/dist/transactions/authority/create-safe-transaction-authority.js +29 -0
  89. package/dist/transactions/index.d.ts +3 -0
  90. package/dist/transactions/index.d.ts.map +1 -0
  91. package/dist/transactions/index.js +20 -0
  92. package/package.json +2 -2
  93. package/dist/models/rules/share-rule-models.d.ts +0 -303
  94. package/dist/models/rules/share-rule-models.d.ts.map +0 -1
  95. package/dist/models/rules/share-rule-models.js +0 -93
@@ -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
@@ -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":"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"}
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"}
@@ -1,59 +1,105 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.PublicDataAuditLogSubType = exports.UserAuditLogSubType = exports.AdministrationAuditLogSubType = exports.MultiplePathAuditLogSubType = exports.ApplicationAuditLogType = exports.ApplicationAuditLogAction = void 0;
3
+ exports.QueryObjectAndValueForAuditLogSchema = exports.IApplicationAuditLogSchema = exports.IApplicationAuditLogUnstructuredSchema = exports.AdditionalApplicationAuditLogIdsSchema = exports.ApplicationAuditLogSubTypeSchema = exports.UserAuditLogSubTypeSchema = exports.PublicDataAuditLogSubTypeSchema = exports.MultiplePathAuditLogSubTypeSchema = exports.ApplicationAuditLogTypeSchema = exports.ApplicationAuditLogActionSchema = exports.AdministrationAuditLogSubTypeSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ //#region Enums
6
+ /**
7
+ * This contains the enum for the audit log sub types for the administrator classes.
8
+ */
9
+ exports.AdministrationAuditLogSubTypeSchema = zod_1.z.enum([
10
+ 'administrator',
11
+ ]);
5
12
  /**
6
13
  * This contains the enum for the audit log actions.
7
14
  */
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 = {}));
15
+ exports.ApplicationAuditLogActionSchema = zod_1.z.enum([
16
+ 'create',
17
+ 'update',
18
+ 'delete',
19
+ 'read',
20
+ 'list',
21
+ 'file',
22
+ ]);
23
+ //#region ApplicationAuditLogSubType
17
24
  /**
18
25
  * This contains the model for the audit logs that are generated in the system.
19
26
  */
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
27
+ exports.ApplicationAuditLogTypeSchema = zod_1.z.enum([
28
+ 'authorizedAuthority', // the authorized authority audit log
29
+ 'global', // the global audit log for the application
30
+ ]);
26
31
  /**
27
32
  * This contains the enum for the audit log sub types for the multiple path classes.
28
33
  */
29
- var MultiplePathAuditLogSubType;
30
- (function (MultiplePathAuditLogSubType) {
31
- MultiplePathAuditLogSubType["multiplePathALAI"] = "multiplePathALAI";
32
- })(MultiplePathAuditLogSubType || (exports.MultiplePathAuditLogSubType = MultiplePathAuditLogSubType = {}));
33
- //#region Administration Audit Log Types
34
+ exports.MultiplePathAuditLogSubTypeSchema = zod_1.z.enum([
35
+ 'multiplePathALAI',
36
+ ]);
34
37
  /**
35
- * This contains the enum for the audit log sub types for the administrator classes.
38
+ * This contains the enum for the audit log sub types for the public data classes.
36
39
  */
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
40
+ exports.PublicDataAuditLogSubTypeSchema = zod_1.z.enum([
41
+ 'userRelatedProfile',
42
+ ]);
43
43
  /**
44
44
  * This contains the enum for the audit log sub types for the user classes.
45
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
46
+ exports.UserAuditLogSubTypeSchema = zod_1.z.enum([
47
+ 'profile', // the details of the user profile
48
+ ]);
52
49
  /**
53
- * This contains the enum for the audit log sub types for the public data classes.
50
+ * This contains the enum for the audit log sub types.
51
+ */
52
+ exports.ApplicationAuditLogSubTypeSchema = zod_1.z.union([
53
+ exports.AdministrationAuditLogSubTypeSchema,
54
+ exports.MultiplePathAuditLogSubTypeSchema,
55
+ exports.PublicDataAuditLogSubTypeSchema,
56
+ exports.UserAuditLogSubTypeSchema,
57
+ ]);
58
+ //#endregion ApplicationAuditLogSubType
59
+ //#end region Enums
60
+ /**
61
+ * This contains interfaces for the audit logs that are generated in the system.
62
+ * This type of audit log is used to create and log application functions within a non structured database.
63
+ */
64
+ //#region Application Audit Log Models
65
+ /**
66
+ * This contains the additional audit log Ids in order of the access in the application
67
+ * for database this would be the reference path and reference Id
68
+ * for User Financial data this would be
69
+ * [
70
+ * { referencePath: 'Administrator', referenceId: '{{ administratorId }} ' }, // These are every path downstream from the root data
71
+ * { referencePath: 'Accounts', referenceId: '{{ accountId }}' },
72
+ * ]
73
+ *
74
+ * These are available in the helper files based on the Application Audit Log Sub Types.
75
+ */
76
+ exports.AdditionalApplicationAuditLogIdsSchema = zod_1.z.object({
77
+ referencePath: zod_1.z.string(), // the reference path (User, FinancialInstitution, etc.)
78
+ referenceId: zod_1.z.string(), // the reference Id (The Id of the item accessed)
79
+ });
80
+ /**
81
+ * Application Audit Log Unstructured Schema
82
+ */
83
+ exports.IApplicationAuditLogUnstructuredSchema = zod_1.z.object({
84
+ additionalAuditLogIds: zod_1.z.array(exports.AdditionalApplicationAuditLogIdsSchema), // additional audit log Ids
85
+ applicationAuditLogAction: exports.ApplicationAuditLogActionSchema, // the action of the audit log
86
+ applicationAuditLogType: exports.ApplicationAuditLogTypeSchema, // the type of audit log
87
+ applicationAuditLogSubType: exports.ApplicationAuditLogSubTypeSchema, // the sub type of audit log
88
+ createdAt: zod_1.z.number(), // the date that the audit log was created
89
+ createdBy: zod_1.z.string(), // the user Id of the user that created the audit log
90
+ currentData: zod_1.z.any().optional(), // the current data
91
+ previousData: zod_1.z.any().optional(), // the previous data
92
+ });
93
+ /**
94
+ * This contains the interface for the application audit log.
95
+ */
96
+ exports.IApplicationAuditLogSchema = exports.IApplicationAuditLogUnstructuredSchema;
97
+ //#region AuditLog Helpers
98
+ /**
99
+ * This contains the interface for keeping the query audit log and value.
54
100
  */
55
- var PublicDataAuditLogSubType;
56
- (function (PublicDataAuditLogSubType) {
57
- PublicDataAuditLogSubType["userRelatedProfile"] = "userRelatedProfile";
58
- })(PublicDataAuditLogSubType || (exports.PublicDataAuditLogSubType = PublicDataAuditLogSubType = {}));
59
- //#endregion Public Data audit log types
101
+ exports.QueryObjectAndValueForAuditLogSchema = zod_1.z.object({
102
+ queryObject: zod_1.z.string(),
103
+ queryValue: zod_1.z.union([zod_1.z.string(), zod_1.z.number(), zod_1.z.boolean()]),
104
+ });
105
+ //#endregion AuditLog Helpers