@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,6 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ShareDataTypes = void 0;
6
+ exports.IShareDataTransactionHistorySchema = exports.IShareDataTransactionBaseSchema = exports.IShareDataRuleFailuresSchema = exports.IShareFunctionSchema = exports.IShareFunctionRecordSchema = exports.IShareDataSchema = exports.ShareDataTypesSchema = exports.ShareDataTypes = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ //#region Enums
4
9
  /**
5
10
  * This contains the data for the share data object
6
11
  */
@@ -12,6 +17,66 @@ var ShareDataTypes;
12
17
  ShareDataTypes["TRANSACTION_HISTORY"] = "TRANSACTION_HISTORY";
13
18
  ShareDataTypes["DATA"] = "DATA";
14
19
  })(ShareDataTypes || (exports.ShareDataTypes = ShareDataTypes = {}));
20
+ exports.ShareDataTypesSchema = zod_1.default.enum([
21
+ 'AUTHORIZATION',
22
+ 'RULE',
23
+ 'FUNCTION',
24
+ 'TRANSACTION_HISTORY',
25
+ 'DATA',
26
+ ]);
27
+ //#endregion Enums
28
+ //#region Share Data shapes
29
+ /**
30
+ * This contains the interface for a data in a share data object
31
+ */
32
+ exports.IShareDataSchema = zod_1.default.record(zod_1.default.any());
33
+ /**
34
+ * This contains the interface for a share function record in the share data object
35
+ */
36
+ exports.IShareFunctionRecordSchema = zod_1.default.object({
37
+ id: zod_1.default.string(), // the id of the function
38
+ groupingId: zod_1.default.string(), // the grouping id of the function
39
+ groupingName: zod_1.default.string(), // the grouping name of the function
40
+ name: zod_1.default.string(), // the name of the function
41
+ description: zod_1.default.string(), // the description of the function
42
+ hash: zod_1.default.string(), // the hash of the function
43
+ stringifiedFunction: zod_1.default.string(), // the stringified function
44
+ });
45
+ /**
46
+ * This contains the interface for a share function in the share data object
47
+ */
48
+ exports.IShareFunctionSchema = zod_1.default.object({
49
+ input: zod_1.default.any(), // The input parameter type
50
+ func: zod_1.default.function(), // The function type
51
+ output: zod_1.default.any(), // The output parameter type
52
+ });
53
+ // export interface IShareFunction<TInput, TFunction extends (...args: any[]) => any, TOutput> {
54
+ // input: TInput; // The input parameter type
55
+ // func: TFunction; // The function type
56
+ // output: TOutput; // The output parameter type
57
+ // }
58
+ /**
59
+ * This contains the interface for the rule failures in the share data object
60
+ */
61
+ exports.IShareDataRuleFailuresSchema = zod_1.default.object({
62
+ ruleId: zod_1.default.string(), // the rule id
63
+ });
64
+ /**
65
+ * This contains the interface for the share transaction history in the share data object
66
+ */
67
+ exports.IShareDataTransactionBaseSchema = zod_1.default.object({
68
+ ruleOutcome: zod_1.default.boolean(), // the outcome of the rules
69
+ ruleFailures: zod_1.default.array(exports.IShareDataRuleFailuresSchema), // the failures of the rules
70
+ transactionFunction: exports.IShareFunctionSchema, // the transaction function
71
+ });
72
+ /**
73
+ * This contains the interface for the share transaction history in the share data object
74
+ * This is done for storage
75
+ */
76
+ exports.IShareDataTransactionHistorySchema = exports.IShareDataTransactionBaseSchema.extend({
77
+ transactionId: zod_1.default.string(), // the transaction id
78
+ transactionTime: zod_1.default.number(), // the transaction time
79
+ });
15
80
  // export interface IShareData {
16
81
  // rules: IShareRule[]; // the rules for the share data
17
82
  // functions: IShareFunction[]; // the functions for the share data
@@ -0,0 +1,14 @@
1
+ import { AuthorityValidationType, AuthorizationIssuer } from '../../models/authorization/authorization-models';
2
+ import { ISAFETransactionAuthorityData, SAFETransactionType } from '../../models/safe/safe-transaction-models';
3
+ /**
4
+ * This function creates the SAFE transaction authority data object
5
+ *
6
+ * @param authorizationIssuer the authorization issuer that is being targeted by the transaction
7
+ * @param authorizationPublicKey the public key of the authority that is being targeted by the transaction
8
+ * @param authorityValidationType the authority validation type thaat is being added
9
+ * @param authorityOver what the public key will have authority over.
10
+ * @returns
11
+ */
12
+ declare const createSafeTransactionAuthorityData: (authorizationIssuer: AuthorizationIssuer, authorizationPublicKey: string, authorityValidationType: AuthorityValidationType, authorityOver: SAFETransactionType[]) => ISAFETransactionAuthorityData;
13
+ export { createSafeTransactionAuthorityData };
14
+ //# sourceMappingURL=create-safe-transaction-authority-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-safe-transaction-authority-data.d.ts","sourceRoot":"","sources":["../../../src/transactions/authority/create-safe-transaction-authority-data.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,uBAAuB,EACvB,mBAAmB,EACtB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACH,6BAA6B,EAC7B,mBAAmB,EAEtB,MAAM,2CAA2C,CAAC;AAEnD;;;;;;;;GAQG;AACH,QAAA,MAAM,kCAAkC,wBACf,mBAAmB,0BAChB,MAAM,2BACL,uBAAuB,iBACjC,mBAAmB,EAAE,KACrC,6BAOF,CAAC;AAEF,OAAO,EAAE,kCAAkC,EAAE,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSafeTransactionAuthorityData = void 0;
4
+ /**
5
+ * This function creates the SAFE transaction authority data object
6
+ *
7
+ * @param authorizationIssuer the authorization issuer that is being targeted by the transaction
8
+ * @param authorizationPublicKey the public key of the authority that is being targeted by the transaction
9
+ * @param authorityValidationType the authority validation type thaat is being added
10
+ * @param authorityOver what the public key will have authority over.
11
+ * @returns
12
+ */
13
+ const createSafeTransactionAuthorityData = (authorizationIssuer, authorizationPublicKey, authorityValidationType, authorityOver) => {
14
+ return {
15
+ authorizationIssuer,
16
+ authorizationPublicKey,
17
+ authorityValidationType,
18
+ authorityOver,
19
+ };
20
+ };
21
+ exports.createSafeTransactionAuthorityData = createSafeTransactionAuthorityData;
@@ -0,0 +1,15 @@
1
+ import { ISAFETransactionAuthority, ISAFETransactionAuthorityData, SAFETransactionActionType } from '../../models/safe/safe-transaction-models';
2
+ /**
3
+ * This function creates the SAFE transaction authority object transaction
4
+ *
5
+ * @param authorityPublicKey the public key of the authority that created the transaction
6
+ * @param authoritySignature the signature of the authority that created the transaction
7
+ * @param transactionAction the action to perform on the transaction
8
+ * @param data the data for the authority transaction
9
+ * @param version the version of the transaction (default to 1)
10
+ * @param createdAt the time the transaction was created (in milliseconds) (default to now)
11
+ * @returns
12
+ */
13
+ declare const createSafeTransactionAuthority: (authorityPublicKey: string, authoritySignature: string, transactionAction: SAFETransactionActionType, data: ISAFETransactionAuthorityData, version?: number, createdAt?: number) => ISAFETransactionAuthority;
14
+ export { createSafeTransactionAuthority };
15
+ //# sourceMappingURL=create-safe-transaction-authority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-safe-transaction-authority.d.ts","sourceRoot":"","sources":["../../../src/transactions/authority/create-safe-transaction-authority.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,yBAAyB,EACzB,6BAA6B,EAC7B,yBAAyB,EAE5B,MAAM,2CAA2C,CAAC;AAEnD;;;;;;;;;;GAUG;AACH,QAAA,MAAM,8BAA8B,uBACZ,MAAM,sBACN,MAAM,qBACP,yBAAyB,QACtC,6BAA6B,2CAGpC,yBAYF,CAAC;AAEF,OAAO,EAAE,8BAA8B,EAAE,CAAC"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createSafeTransactionAuthority = void 0;
4
+ const safe_transaction_models_1 = require("../../models/safe/safe-transaction-models");
5
+ /**
6
+ * This function creates the SAFE transaction authority object transaction
7
+ *
8
+ * @param authorityPublicKey the public key of the authority that created the transaction
9
+ * @param authoritySignature the signature of the authority that created the transaction
10
+ * @param transactionAction the action to perform on the transaction
11
+ * @param data the data for the authority transaction
12
+ * @param version the version of the transaction (default to 1)
13
+ * @param createdAt the time the transaction was created (in milliseconds) (default to now)
14
+ * @returns
15
+ */
16
+ const createSafeTransactionAuthority = (authorityPublicKey, authoritySignature, transactionAction, data, version = 1, createdAt = Date.now()) => {
17
+ return {
18
+ authority: authorityPublicKey,
19
+ authoritySignature,
20
+ createdAt,
21
+ transaction: {
22
+ action: transactionAction,
23
+ data,
24
+ type: safe_transaction_models_1.SAFETransactionType.AUTHORITY,
25
+ },
26
+ version,
27
+ };
28
+ };
29
+ exports.createSafeTransactionAuthority = createSafeTransactionAuthority;
@@ -0,0 +1,3 @@
1
+ export * from './authority/create-safe-transaction-authority';
2
+ export * from './authority/create-safe-transaction-authority-data';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/transactions/index.ts"],"names":[],"mappings":"AACA,cAAc,+CAA+C,CAAC;AAC9D,cAAc,oDAAoD,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ //#region Authority
18
+ __exportStar(require("./authority/create-safe-transaction-authority"), exports);
19
+ __exportStar(require("./authority/create-safe-transaction-authority-data"), exports);
20
+ //#endregion Authority
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@degenerate/generic",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
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",
@@ -53,5 +53,5 @@
53
53
  "firebase-functions": "^6.1.0",
54
54
  "jsonwebtoken": "^9.0.2"
55
55
  },
56
- "gitHead": "97a0ffd55ceb8dfb323efdd4b9de181511261902"
56
+ "gitHead": "737d8d07f08124b2f4c05bd9e4a41c96bd571791"
57
57
  }
@@ -1,303 +0,0 @@
1
- /**
2
- * This file contains the models for the rules used in the share data.
3
- */
4
- /**
5
- * This contains the interface for the rule evaluation.
6
- */
7
- export interface IShareRuleEvalutionResult {
8
- ruleId: string;
9
- currentResult: boolean;
10
- currentConditionFailure: ICondition[];
11
- proposedResult: boolean;
12
- proposedConditionFailure: ICondition[];
13
- }
14
- /**
15
- * This contains the interface for the rule evaluation.
16
- */
17
- export interface IShareRulesEvaluationResult {
18
- rootParam: string;
19
- passedRuleCheck: boolean;
20
- passedRuleId: string;
21
- shareRuleEvalutionResults: IShareRuleEvalutionResult[];
22
- }
23
- /**
24
- * This contains the interface for the rule evaluation results.
25
- */
26
- export interface IRuleEvaluationResults {
27
- shareDataId: string;
28
- rulesResults: IShareRulesEvaluationResult[];
29
- isValidProposal: boolean;
30
- }
31
- /**
32
- * This contains the interface for the rule set in the share data object
33
- */
34
- export interface IShareRuleSet {
35
- description?: string;
36
- id: string;
37
- name: string;
38
- ruleGroups: IShareRuleGroup[];
39
- version: number;
40
- }
41
- /**
42
- * This contains the logical operators for combining rules.
43
- */
44
- export declare enum LogicalOperator {
45
- AND = "AND",
46
- OR = "OR"
47
- }
48
- /**
49
- * This contains the interface for a rule group.
50
- *
51
- * A rule group can contain individual rules or nested rule groups.
52
- */
53
- export interface IShareRuleGroup {
54
- operator: LogicalOperator;
55
- rules: (IShareRuleApplied | IShareRuleGroup)[];
56
- }
57
- /**
58
- * This contains the interface for a share rule in the share data object
59
- */
60
- export interface IShareRule {
61
- ruleId: string;
62
- currentDataConditions: ICondition[];
63
- proposedDataConditions: ICondition[];
64
- }
65
- /**
66
- * This contains the applied rule informaiton in the share data object.
67
- */
68
- export interface IShareRuleApplied extends IShareRule {
69
- targettedProperty: string;
70
- }
71
- /**
72
- * This contains the different types of conditions that can be evaluated.
73
- */
74
- export type ConditionType = ConditionTypeSingle | ConditionTypeRange | ConditionTypeStartsEndsWith | ConditionTypeBoolean | ConditionTypeSpecial;
75
- /**
76
- * This contains the choices for the type of qualifier.
77
- */
78
- export declare enum ConditionTypeQualifier {
79
- IS = "is",
80
- IS_NOT = "is not"
81
- }
82
- /**
83
- * This contains the choices for the type of condition.
84
- */
85
- export declare enum ConditionTypeSingle {
86
- TYPEOF = "typeof",// the type of the property
87
- EQUAL = "equal",// the value is equal to the condition value
88
- CONTAINS = "contains",// the value contains the condition value
89
- NULL = "null",// the value is null
90
- EMPTY = "empty",// the value is empty
91
- SHARE_RULE = "share-rule"
92
- }
93
- /**
94
- * This contains the choices for the range conditions.
95
- */
96
- export declare enum ConditionTypeRange {
97
- GREATER_THAN = "greater than",
98
- LESS_THAN = "less than",
99
- GREATER_THAN_OR_EQUAL = "greater than or equal",
100
- LESS_THAN_OR_EQUAL = "less than or equal"
101
- }
102
- /**
103
- * This contains the choices for the starts with and ends with conditions.
104
- */
105
- export declare enum ConditionTypeStartsEndsWith {
106
- STARTS_WITH = "starts with",
107
- ENDS_WITH = "ends with"
108
- }
109
- /**
110
- * This contains the choices for the boolean conditions.
111
- */
112
- export declare enum ConditionTypeBoolean {
113
- TRUE = "true",
114
- FALSE = "false"
115
- }
116
- /**
117
- * This contains the choices for the special conditions.
118
- */
119
- export declare enum ConditionTypeSpecial {
120
- PATTERN = "pattern"
121
- }
122
- /**
123
- * This is the interface for the conditional information in the checks.
124
- */
125
- export type ICondition = IConditionTypeOf | IConditionEquality | IConditionRange | IConditionContains | IConditionStartsEndsWith | IConditionNull | IConditionBoolean | IConditionEmpty | IConditionShareRule | IConditionSpecial;
126
- /**
127
- * This is the interface for the base condition.
128
- */
129
- export interface IConditionBase {
130
- conditionType: ConditionType;
131
- conditionTypeQualifier: ConditionTypeQualifier;
132
- targettedProperty: string;
133
- }
134
- /**
135
- * These are the different choices for the types of data in a condition.
136
- */
137
- export declare enum ConditionTypeOf {
138
- STRING = "string",
139
- NUMBER = "number",
140
- INTEGER = "integer",
141
- BOOLEAN = "boolean",
142
- OBJECT = "object",
143
- ARRAY = "array",
144
- NULL = "null",
145
- UNDEFINED = "undefined",
146
- FUNCTION = "function",
147
- BIGINT = "bigint"
148
- }
149
- /**
150
- * This is the interface for the type of condition.
151
- *
152
- const exampleConditionTypeOf: IConditionTypeOf = {
153
- conditionType: ConditionTypeSingle.TYPEOF,
154
- ConditionTypeQualifier: ConditionTypeQualifier.IS,
155
- conditionValue: ConditionTypeOf.NUMBER,
156
- targettedProperty: 'address.city.total',
157
- };
158
- */
159
- export interface IConditionTypeOf extends IConditionBase {
160
- conditionType: ConditionTypeSingle.TYPEOF;
161
- conditionValue: ConditionTypeOf;
162
- }
163
- /**
164
- * This is the interface for the equality condition.
165
- *
166
- const exampleConditionEquality: IConditionEquality = {
167
- conditionType: ConditionTypeSingle.EQUAL,
168
- ConditionTypeQualifier: ConditionTypeQualifier.IS,
169
- conditionValue: 100,
170
- targettedProperty: 'address.city.total',
171
- };
172
- */
173
- export interface IConditionEquality extends IConditionBase {
174
- conditionType: ConditionTypeSingle.EQUAL;
175
- conditionValue: number | string;
176
- }
177
- /**
178
- * This is the interface for the range condition.
179
- *
180
- const exampleConditionRange: IConditionRange = {
181
- conditionType: ConditionTypeRange.GREATER_THAN,
182
- ConditionTypeQualifier: ConditionTypeQualifier.IS,
183
- conditionValue: 100,
184
- targettedProperty: 'address.city.total',
185
- };
186
- */
187
- export interface IConditionRange extends IConditionBase {
188
- conditionType: ConditionTypeRange;
189
- conditionValue: string | number;
190
- }
191
- /**
192
- * This is the interface for the contains condition.
193
- *
194
- const exampleConditionContains: IConditionContains = {
195
- conditionType: ConditionTypeSingle.CONTAINS,
196
- conditionTypeQualifier: ConditionTypeQualifier.IS,
197
- conditionValue: ['gar'| 'garison' | 'garage']
198
- targettedProperty: 'address.city.name',
199
- * };
200
- */
201
- export interface IConditionContains extends IConditionBase {
202
- conditionType: ConditionTypeSingle.CONTAINS;
203
- conditionValue: string | string[] | number[];
204
- }
205
- /**
206
- * This is the interface for the starts with and ends with condition.
207
- *
208
- const exampleConditionStartsEndsWith: IConditionStartsEndsWith = {
209
- conditionType: ConditionTypeStartsEndsWith.STARTS_WITH,
210
- conditionTypeQualifier: ConditionTypeQualifier.IS,
211
- conditionValue: 'cal'
212
- targettedProperty: 'address.city.name',
213
- };
214
- */
215
- export interface IConditionStartsEndsWith extends IConditionBase {
216
- conditionType: ConditionTypeStartsEndsWith;
217
- conditionValue: string;
218
- }
219
- /**
220
- * This is the interface for the null condition.
221
- *
222
- const exampleConditionNull: IConditionNull = {
223
- conditionType: ConditionTypeSingle.NULL
224
- targettedProperty: 'address.city.name',
225
- };
226
- */
227
- export interface IConditionNull extends IConditionBase {
228
- conditionType: ConditionTypeSingle.NULL;
229
- }
230
- /**
231
- * This is the interface for the boolean condition.
232
- *
233
- const exampleConditionBoolean: IConditionBoolean = {
234
- conditionType: ConditionTypeBoolean.TRUE,
235
- conditionTypeQualifier: ConditionTypeQualifier.IS,
236
- targettedProperty: 'address.city.name',
237
- };
238
- */
239
- export interface IConditionBoolean extends IConditionBase {
240
- conditionType: ConditionTypeBoolean;
241
- }
242
- /**
243
- * This is the interface for the empty condition.
244
- *
245
- const exampleConditionEmpty: IConditionEmpty = {
246
- conditionType: ConditionTypeEmpty.IS_EMPTY,
247
- conditionTypeQualifier: ConditionTypeQualifier.IS,
248
- targettedProperty: 'address.city.name',
249
- };
250
- */
251
- export interface IConditionEmpty extends IConditionBase {
252
- conditionType: ConditionTypeSingle.EMPTY;
253
- }
254
- /**
255
- * This is the interface for the special condition.
256
- *
257
- const exampleConditionSpecial: IConditionSpecial = {
258
- conditionType: ConditionTypeSpecial.PATTERN,
259
- conditionTypeQualifier: ConditionTypeQualifier.IS,
260
- conditionValue: '^[a-zA-Z0-9]*$'
261
- targettedProperty: 'address.city.name',
262
- };
263
- */
264
- export interface IConditionSpecial extends IConditionBase {
265
- conditionType: ConditionTypeSpecial;
266
- conditionValue: string;
267
- }
268
- /**
269
- * This is the interface for the share rule condition.
270
- *
271
-
272
- const nestedShareRule: IShareRule = {
273
- ruleId: 'nestedRule',
274
- currentDataConditions: [
275
- {
276
- targettedProperty: 'nestedProperty',
277
- conditionType: 'equal',
278
- conditionValue: 'expectedValue',
279
- conditionTypeQualifier: ConditionTypeQualifier.IS,
280
- },
281
- ],
282
- proposedDataConditions: [
283
- {
284
- targettedProperty: 'nestedProperty',
285
- conditionType: 'equal',
286
- conditionValue: 'newValue',
287
- conditionTypeQualifier: ConditionTypeQualifier.IS,
288
- },
289
- ],
290
- };
291
-
292
- const conditionWithShareRule: IConditionShareRule = {
293
- conditionType: ConditionTypeSingle.SHARE_RULE,
294
- conditionTypeQualifier: ConditionTypeQualifier.IS,
295
- targettedProperty: 'parentProperty',
296
- rule: nestedShareRule,
297
- };
298
- */
299
- export interface IConditionShareRule extends IConditionBase {
300
- conditionType: ConditionTypeSingle.SHARE_RULE;
301
- conditionValue: IShareRule;
302
- }
303
- //# sourceMappingURL=share-rule-models.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"share-rule-models.d.ts","sourceRoot":"","sources":["../../../src/models/rules/share-rule-models.ts"],"names":[],"mappings":"AACA;;GAEG;AAIH;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,uBAAuB,EAAE,UAAU,EAAE,CAAC;I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0,0 @@
1
- "use strict";
2
- /**
3
- * This file contains the models for the rules used in the share data.
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ConditionTypeOf = exports.ConditionTypeSpecial = exports.ConditionTypeBoolean = exports.ConditionTypeStartsEndsWith = exports.ConditionTypeRange = exports.ConditionTypeSingle = exports.ConditionTypeQualifier = exports.LogicalOperator = void 0;
7
- //#endregion RuleSet
8
- //#region RuleGroup
9
- /**
10
- * This contains the logical operators for combining rules.
11
- */
12
- var LogicalOperator;
13
- (function (LogicalOperator) {
14
- LogicalOperator["AND"] = "AND";
15
- LogicalOperator["OR"] = "OR";
16
- })(LogicalOperator || (exports.LogicalOperator = LogicalOperator = {}));
17
- /**
18
- * This contains the choices for the type of qualifier.
19
- */
20
- var ConditionTypeQualifier;
21
- (function (ConditionTypeQualifier) {
22
- ConditionTypeQualifier["IS"] = "is";
23
- ConditionTypeQualifier["IS_NOT"] = "is not";
24
- })(ConditionTypeQualifier || (exports.ConditionTypeQualifier = ConditionTypeQualifier = {}));
25
- /**
26
- * This contains the choices for the type of condition.
27
- */
28
- var ConditionTypeSingle;
29
- (function (ConditionTypeSingle) {
30
- ConditionTypeSingle["TYPEOF"] = "typeof";
31
- ConditionTypeSingle["EQUAL"] = "equal";
32
- ConditionTypeSingle["CONTAINS"] = "contains";
33
- ConditionTypeSingle["NULL"] = "null";
34
- ConditionTypeSingle["EMPTY"] = "empty";
35
- ConditionTypeSingle["SHARE_RULE"] = "share-rule";
36
- })(ConditionTypeSingle || (exports.ConditionTypeSingle = ConditionTypeSingle = {}));
37
- /**
38
- * This contains the choices for the range conditions.
39
- */
40
- var ConditionTypeRange;
41
- (function (ConditionTypeRange) {
42
- ConditionTypeRange["GREATER_THAN"] = "greater than";
43
- ConditionTypeRange["LESS_THAN"] = "less than";
44
- ConditionTypeRange["GREATER_THAN_OR_EQUAL"] = "greater than or equal";
45
- ConditionTypeRange["LESS_THAN_OR_EQUAL"] = "less than or equal";
46
- })(ConditionTypeRange || (exports.ConditionTypeRange = ConditionTypeRange = {}));
47
- /**
48
- * This contains the choices for the starts with and ends with conditions.
49
- */
50
- var ConditionTypeStartsEndsWith;
51
- (function (ConditionTypeStartsEndsWith) {
52
- ConditionTypeStartsEndsWith["STARTS_WITH"] = "starts with";
53
- ConditionTypeStartsEndsWith["ENDS_WITH"] = "ends with";
54
- })(ConditionTypeStartsEndsWith || (exports.ConditionTypeStartsEndsWith = ConditionTypeStartsEndsWith = {}));
55
- /**
56
- * This contains the choices for the boolean conditions.
57
- */
58
- var ConditionTypeBoolean;
59
- (function (ConditionTypeBoolean) {
60
- ConditionTypeBoolean["TRUE"] = "true";
61
- ConditionTypeBoolean["FALSE"] = "false";
62
- })(ConditionTypeBoolean || (exports.ConditionTypeBoolean = ConditionTypeBoolean = {}));
63
- /**
64
- * This contains the choices for the special conditions.
65
- */
66
- var ConditionTypeSpecial;
67
- (function (ConditionTypeSpecial) {
68
- ConditionTypeSpecial["PATTERN"] = "pattern";
69
- })(ConditionTypeSpecial || (exports.ConditionTypeSpecial = ConditionTypeSpecial = {}));
70
- /**
71
- * These are the different choices for the types of data in a condition.
72
- */
73
- var ConditionTypeOf;
74
- (function (ConditionTypeOf) {
75
- ConditionTypeOf["STRING"] = "string";
76
- ConditionTypeOf["NUMBER"] = "number";
77
- ConditionTypeOf["INTEGER"] = "integer";
78
- ConditionTypeOf["BOOLEAN"] = "boolean";
79
- ConditionTypeOf["OBJECT"] = "object";
80
- ConditionTypeOf["ARRAY"] = "array";
81
- ConditionTypeOf["NULL"] = "null";
82
- ConditionTypeOf["UNDEFINED"] = "undefined";
83
- ConditionTypeOf["FUNCTION"] = "function";
84
- ConditionTypeOf["BIGINT"] = "bigint";
85
- })(ConditionTypeOf || (exports.ConditionTypeOf = ConditionTypeOf = {}));
86
- // /**
87
- // * This is the interface for the combined rule condition.
88
- // */
89
- // export interface IConditionCombinedRules extends IConditionBase {
90
- // conditionType: ConditionTypeCombinedRules; // the type of condition to evaluate
91
- // conditionValue: IShareRuleGroup; // the value to evaluate the condition against
92
- // }
93
- //#endregion Conditions