@degenerate/generic 0.0.21 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application/index.d.ts.map +1 -1
- package/dist/errors/share-data/share-data-errors.d.ts +18 -0
- package/dist/errors/share-data/share-data-errors.d.ts.map +1 -1
- package/dist/errors/share-data/share-data-errors.js +27 -1
- package/dist/helpers/file/file-helpers.js +1 -1
- package/dist/models/rules/share-rule-models.d.ts +75 -72
- package/dist/models/rules/share-rule-models.d.ts.map +1 -1
- package/dist/models/rules/share-rule-models.js +25 -40
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/application/index.ts"],"names":[],"mappings":"AAKA,cAAc,uEAAuE,CAAC;AACtF,cAAc,sDAAsD,CAAC;AACrE,cAAc,4DAA4D,CAAC;AAG3E,cAAc,0CAA0C,CAAC"}
|
|
@@ -46,4 +46,22 @@ export declare class ShareDataFunctionHashNotValid extends BaseError {
|
|
|
46
46
|
*/
|
|
47
47
|
constructor(shareDataId: string, shareDataFunction: IShareDataFunction, calculatedHash: string);
|
|
48
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* This is thrown when a rule doesn't have current conditions present.
|
|
51
|
+
*/
|
|
52
|
+
export declare class ShareRuleCurrentConditionsNotPresentError extends BaseError {
|
|
53
|
+
/**
|
|
54
|
+
* This is thrown when a rule doesn't have a before or after conditions.
|
|
55
|
+
*/
|
|
56
|
+
constructor(ruleId: string);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* This is thrown when a rule doesn't have proposed conditions present.
|
|
60
|
+
*/
|
|
61
|
+
export declare class ShareRuleProposedConditionsNotPresentError extends BaseError {
|
|
62
|
+
/**
|
|
63
|
+
* This is thrown when a rule doesn't have a before or after conditions.
|
|
64
|
+
*/
|
|
65
|
+
constructor(ruleId: string);
|
|
66
|
+
}
|
|
49
67
|
//# sourceMappingURL=share-data-errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"share-data-errors.d.ts","sourceRoot":"","sources":["../../../src/errors/share-data/share-data-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAEvF;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,SAAS;IACjD;;OAEG;gBACS,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc;CAGjE;AAED;;GAEG;AACH,qBAAa,2CAA4C,SAAQ,SAAS;IACtE;;OAEG;gBACS,WAAW,EAAE,MAAM;CAGlC;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,SAAS;IAClD;;OAEG;gBACS,WAAW,EAAE,MAAM;CAGlC;AAED;;GAEG;AACH,qBAAa,yDAA0D,SAAQ,SAAS;IACpF;;OAEG;gBACS,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAI5E;AAGD;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,SAAS;IACxD;;OAEG;gBACS,WAAW,EAAE,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM;CAIjG"}
|
|
1
|
+
{"version":3,"file":"share-data-errors.d.ts","sourceRoot":"","sources":["../../../src/errors/share-data/share-data-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAC;AAEvF;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,SAAS;IACjD;;OAEG;gBACS,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc;CAGjE;AAED;;GAEG;AACH,qBAAa,2CAA4C,SAAQ,SAAS;IACtE;;OAEG;gBACS,WAAW,EAAE,MAAM;CAGlC;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,SAAS;IAClD;;OAEG;gBACS,WAAW,EAAE,MAAM;CAGlC;AAED;;GAEG;AACH,qBAAa,yDAA0D,SAAQ,SAAS;IACpF;;OAEG;gBACS,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAI5E;AAGD;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,SAAS;IACxD;;OAEG;gBACS,WAAW,EAAE,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM;CAIjG;AAKD;;GAEG;AACH,qBAAa,yCAA0C,SAAQ,SAAS;IACpE;;OAEG;gBACS,MAAM,EAAE,MAAM;CAG7B;AAED;;GAEG;AACH,qBAAa,0CAA2C,SAAQ,SAAS;IACrE;;OAEG;gBACS,MAAM,EAAE,MAAM;CAG7B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ShareDataFunctionHashNotValid = exports.ShareDataFunctionBeingAppliedDoesNotExistOnShareDataError = exports.ShareDataIntegrityError = exports.ShareDataCurrentAndProposalDataMatchesError = exports.ShareDataIsLockedError = void 0;
|
|
3
|
+
exports.ShareRuleProposedConditionsNotPresentError = exports.ShareRuleCurrentConditionsNotPresentError = exports.ShareDataFunctionHashNotValid = exports.ShareDataFunctionBeingAppliedDoesNotExistOnShareDataError = exports.ShareDataIntegrityError = exports.ShareDataCurrentAndProposalDataMatchesError = exports.ShareDataIsLockedError = void 0;
|
|
4
4
|
const base_error_1 = require("../base-error");
|
|
5
5
|
/**
|
|
6
6
|
* This error is thrown when a function is tried to be applied to the share data thats state is locked.
|
|
@@ -64,3 +64,29 @@ class ShareDataFunctionHashNotValid extends base_error_1.BaseError {
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
exports.ShareDataFunctionHashNotValid = ShareDataFunctionHashNotValid;
|
|
67
|
+
//#region Rules
|
|
68
|
+
/**
|
|
69
|
+
* This is thrown when a rule doesn't have current conditions present.
|
|
70
|
+
*/
|
|
71
|
+
class ShareRuleCurrentConditionsNotPresentError extends base_error_1.BaseError {
|
|
72
|
+
/**
|
|
73
|
+
* This is thrown when a rule doesn't have a before or after conditions.
|
|
74
|
+
*/
|
|
75
|
+
constructor(ruleId) {
|
|
76
|
+
super(`Rule with id ${ruleId} does not have any current conditions present.`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.ShareRuleCurrentConditionsNotPresentError = ShareRuleCurrentConditionsNotPresentError;
|
|
80
|
+
/**
|
|
81
|
+
* This is thrown when a rule doesn't have proposed conditions present.
|
|
82
|
+
*/
|
|
83
|
+
class ShareRuleProposedConditionsNotPresentError extends base_error_1.BaseError {
|
|
84
|
+
/**
|
|
85
|
+
* This is thrown when a rule doesn't have a before or after conditions.
|
|
86
|
+
*/
|
|
87
|
+
constructor(ruleId) {
|
|
88
|
+
super(`Rule with id ${ruleId} does not have any proposed conditions present.`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.ShareRuleProposedConditionsNotPresentError = ShareRuleProposedConditionsNotPresentError;
|
|
92
|
+
//#endregion Rules
|
|
@@ -23,7 +23,7 @@ const getAllFiles = (dirPath, arrayOfFiles = [], ignoreIndexFiles = true, ignore
|
|
|
23
23
|
files.forEach((file) => {
|
|
24
24
|
const filePath = path_1.default.join(dirPath, file);
|
|
25
25
|
if (fs_1.default.statSync(filePath).isDirectory()) {
|
|
26
|
-
getAllFiles(filePath, arrayOfFiles);
|
|
26
|
+
getAllFiles(filePath, arrayOfFiles, ignoreIndexFiles, ignoreTestFiles, ignoreTestDataFiles);
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
29
|
if (ignoreTestFiles && file.endsWith('.test.ts')) {
|
|
@@ -33,6 +33,7 @@ export interface IRuleEvaluationResults {
|
|
|
33
33
|
*/
|
|
34
34
|
export interface IRuleSet {
|
|
35
35
|
id: string;
|
|
36
|
+
version: number;
|
|
36
37
|
name: string;
|
|
37
38
|
description: string;
|
|
38
39
|
ruleGroups: IRuleGroup[];
|
|
@@ -51,7 +52,7 @@ export declare enum LogicalOperator {
|
|
|
51
52
|
*/
|
|
52
53
|
export interface IRuleGroup {
|
|
53
54
|
operator: LogicalOperator;
|
|
54
|
-
rules: (
|
|
55
|
+
rules: (IShareRuleApplied | IRuleGroup)[];
|
|
55
56
|
}
|
|
56
57
|
/**
|
|
57
58
|
* This contains the interface for a share rule in the share data object
|
|
@@ -70,20 +71,23 @@ export interface IShareRuleApplied extends IShareRule {
|
|
|
70
71
|
/**
|
|
71
72
|
* This contains the different types of conditions that can be evaluated.
|
|
72
73
|
*/
|
|
73
|
-
export type ConditionType =
|
|
74
|
+
export type ConditionType = ConditionTypeSingle | ConditionTypeRange | ConditionTypeStartsEndsWith | ConditionTypeBoolean | ConditionTypeCombinedRules | ConditionTypeSpecial;
|
|
74
75
|
/**
|
|
75
|
-
* This contains the choices for the
|
|
76
|
+
* This contains the choices for the type of qualifier.
|
|
76
77
|
*/
|
|
77
|
-
export declare enum
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
export declare enum ConditionTypeQualifier {
|
|
79
|
+
IS = "is",
|
|
80
|
+
IS_NOT = "is not"
|
|
80
81
|
}
|
|
81
82
|
/**
|
|
82
|
-
* This contains the choices for the
|
|
83
|
+
* This contains the choices for the type of condition.
|
|
83
84
|
*/
|
|
84
|
-
export declare enum
|
|
85
|
-
|
|
86
|
-
|
|
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"
|
|
87
91
|
}
|
|
88
92
|
/**
|
|
89
93
|
* This contains the choices for the range conditions.
|
|
@@ -94,13 +98,6 @@ export declare enum ConditionTypeRange {
|
|
|
94
98
|
GREATER_THAN_OR_EQUAL = "greater than or equal",
|
|
95
99
|
LESS_THAN_OR_EQUAL = "less than or equal"
|
|
96
100
|
}
|
|
97
|
-
/**
|
|
98
|
-
* This contains the choices for the contains conditions.
|
|
99
|
-
*/
|
|
100
|
-
export declare enum ConditionTypeContains {
|
|
101
|
-
CONTAINS = "contains",
|
|
102
|
-
NOT_CONTAINS = "not contains"
|
|
103
|
-
}
|
|
104
101
|
/**
|
|
105
102
|
* This contains the choices for the starts with and ends with conditions.
|
|
106
103
|
*/
|
|
@@ -108,26 +105,12 @@ export declare enum ConditionTypeStartsEndsWith {
|
|
|
108
105
|
STARTS_WITH = "starts with",
|
|
109
106
|
ENDS_WITH = "ends with"
|
|
110
107
|
}
|
|
111
|
-
/**
|
|
112
|
-
* This contains the choices for the null conditions.
|
|
113
|
-
*/
|
|
114
|
-
export declare enum ConditionTypeNull {
|
|
115
|
-
IS_NULL = "is null",
|
|
116
|
-
IS_NOT_NULL = "is not null"
|
|
117
|
-
}
|
|
118
108
|
/**
|
|
119
109
|
* This contains the choices for the boolean conditions.
|
|
120
110
|
*/
|
|
121
111
|
export declare enum ConditionTypeBoolean {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* This contains the choices for the empty conditions.
|
|
127
|
-
*/
|
|
128
|
-
export declare enum ConditionTypeEmpty {
|
|
129
|
-
IS_EMPTY = "is empty",
|
|
130
|
-
IS_NOT_EMPTY = "is not empty"
|
|
112
|
+
TRUE = "true",
|
|
113
|
+
FALSE = "false"
|
|
131
114
|
}
|
|
132
115
|
/**
|
|
133
116
|
* This contains the choices for the special conditions.
|
|
@@ -135,10 +118,24 @@ export declare enum ConditionTypeEmpty {
|
|
|
135
118
|
export declare enum ConditionTypeSpecial {
|
|
136
119
|
PATTERN = "pattern"
|
|
137
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* This contains the choices for the combined rule conditions that are a type of object
|
|
123
|
+
*/
|
|
124
|
+
export declare enum ConditionTypeCombinedRules {
|
|
125
|
+
OBJECT = "object"
|
|
126
|
+
}
|
|
138
127
|
/**
|
|
139
128
|
* This is the interface for the conditional information in the checks.
|
|
140
129
|
*/
|
|
141
|
-
export type ICondition = IConditionTypeOf | IConditionEquality | IConditionRange | IConditionContains | IConditionStartsEndsWith | IConditionNull | IConditionBoolean | IConditionEmpty | IConditionSpecial;
|
|
130
|
+
export type ICondition = IConditionTypeOf | IConditionEquality | IConditionRange | IConditionContains | IConditionStartsEndsWith | IConditionNull | IConditionBoolean | IConditionEmpty | IConditionCombinedRules | IConditionSpecial;
|
|
131
|
+
/**
|
|
132
|
+
* This is the interface for the base condition.
|
|
133
|
+
*/
|
|
134
|
+
export interface IConditionBase {
|
|
135
|
+
conditionType: ConditionType;
|
|
136
|
+
conditionTypeQualifier: ConditionTypeQualifier;
|
|
137
|
+
targettedProperty: string;
|
|
138
|
+
}
|
|
142
139
|
/**
|
|
143
140
|
* These are the different choices for the types of data in a condition.
|
|
144
141
|
*/
|
|
@@ -158,41 +155,41 @@ export declare enum ConditionTypeOf {
|
|
|
158
155
|
* This is the interface for the type of condition.
|
|
159
156
|
*
|
|
160
157
|
const exampleConditionTypeOf: IConditionTypeOf = {
|
|
158
|
+
conditionType: ConditionTypeSingle.TYPEOF,
|
|
159
|
+
ConditionTypeQualifier: ConditionTypeQualifier.IS,
|
|
160
|
+
conditionValue: ConditionTypeOf.NUMBER,
|
|
161
161
|
targettedProperty: 'address.city.total',
|
|
162
|
-
conditionType: ConditionTypeTypeOf.IS_TYPEOF,
|
|
163
|
-
conditionValue: ConditionTypeOf.NUMBER
|
|
164
162
|
};
|
|
165
163
|
*/
|
|
166
|
-
export interface IConditionTypeOf {
|
|
167
|
-
|
|
168
|
-
conditionType: ConditionTypeTypeOf;
|
|
164
|
+
export interface IConditionTypeOf extends IConditionBase {
|
|
165
|
+
conditionType: ConditionTypeSingle.TYPEOF;
|
|
169
166
|
conditionValue: ConditionTypeOf;
|
|
170
167
|
}
|
|
171
168
|
/**
|
|
172
169
|
* This is the interface for the equality condition.
|
|
173
170
|
*
|
|
174
171
|
const exampleConditionEquality: IConditionEquality = {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
172
|
+
conditionType: ConditionTypeSingle.EQUAL,
|
|
173
|
+
ConditionTypeQualifier: ConditionTypeQualifier.IS,
|
|
174
|
+
conditionValue: 100,
|
|
175
|
+
targettedProperty: 'address.city.total',
|
|
178
176
|
};
|
|
179
177
|
*/
|
|
180
|
-
export interface IConditionEquality {
|
|
181
|
-
|
|
182
|
-
conditionType: ConditionTypeEquality;
|
|
178
|
+
export interface IConditionEquality extends IConditionBase {
|
|
179
|
+
conditionType: ConditionTypeSingle.EQUAL;
|
|
183
180
|
conditionValue: number | string;
|
|
184
181
|
}
|
|
185
182
|
/**
|
|
186
183
|
* This is the interface for the range condition.
|
|
187
184
|
*
|
|
188
185
|
const exampleConditionRange: IConditionRange = {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
186
|
+
conditionType: ConditionTypeRange.GREATER_THAN,
|
|
187
|
+
ConditionTypeQualifier: ConditionTypeQualifier.IS,
|
|
188
|
+
conditionValue: 100,
|
|
189
|
+
targettedProperty: 'address.city.total',
|
|
192
190
|
};
|
|
193
191
|
*/
|
|
194
|
-
export interface IConditionRange {
|
|
195
|
-
targettedProperty: string;
|
|
192
|
+
export interface IConditionRange extends IConditionBase {
|
|
196
193
|
conditionType: ConditionTypeRange;
|
|
197
194
|
conditionValue: string | number;
|
|
198
195
|
}
|
|
@@ -200,27 +197,27 @@ export interface IConditionRange {
|
|
|
200
197
|
* This is the interface for the contains condition.
|
|
201
198
|
*
|
|
202
199
|
const exampleConditionContains: IConditionContains = {
|
|
203
|
-
|
|
204
|
-
|
|
200
|
+
conditionType: ConditionTypeSingle.CONTAINS,
|
|
201
|
+
conditionTypeQualifier: ConditionTypeQualifier.IS,
|
|
205
202
|
conditionValue: ['gar'| 'garison' | 'garage']
|
|
203
|
+
targettedProperty: 'address.city.name',
|
|
206
204
|
* };
|
|
207
205
|
*/
|
|
208
|
-
export interface IConditionContains {
|
|
209
|
-
|
|
210
|
-
conditionType: ConditionTypeContains;
|
|
206
|
+
export interface IConditionContains extends IConditionBase {
|
|
207
|
+
conditionType: ConditionTypeSingle.CONTAINS;
|
|
211
208
|
conditionValue: string | string[] | number[];
|
|
212
209
|
}
|
|
213
210
|
/**
|
|
214
211
|
* This is the interface for the starts with and ends with condition.
|
|
215
212
|
*
|
|
216
213
|
const exampleConditionStartsEndsWith: IConditionStartsEndsWith = {
|
|
217
|
-
targettedProperty: 'address.city.name',
|
|
218
214
|
conditionType: ConditionTypeStartsEndsWith.STARTS_WITH,
|
|
215
|
+
conditionTypeQualifier: ConditionTypeQualifier.IS,
|
|
219
216
|
conditionValue: 'cal'
|
|
217
|
+
targettedProperty: 'address.city.name',
|
|
220
218
|
};
|
|
221
219
|
*/
|
|
222
|
-
export interface IConditionStartsEndsWith {
|
|
223
|
-
targettedProperty: string;
|
|
220
|
+
export interface IConditionStartsEndsWith extends IConditionBase {
|
|
224
221
|
conditionType: ConditionTypeStartsEndsWith;
|
|
225
222
|
conditionValue: string;
|
|
226
223
|
}
|
|
@@ -228,50 +225,56 @@ export interface IConditionStartsEndsWith {
|
|
|
228
225
|
* This is the interface for the null condition.
|
|
229
226
|
*
|
|
230
227
|
const exampleConditionNull: IConditionNull = {
|
|
228
|
+
conditionType: ConditionTypeSingle.NULL
|
|
231
229
|
targettedProperty: 'address.city.name',
|
|
232
|
-
conditionType: ConditionTypeNull.IS_NULL
|
|
233
230
|
};
|
|
234
231
|
*/
|
|
235
|
-
export interface IConditionNull {
|
|
236
|
-
|
|
237
|
-
conditionType: ConditionTypeNull;
|
|
232
|
+
export interface IConditionNull extends IConditionBase {
|
|
233
|
+
conditionType: ConditionTypeSingle.NULL;
|
|
238
234
|
}
|
|
239
235
|
/**
|
|
240
236
|
* This is the interface for the boolean condition.
|
|
241
237
|
*
|
|
242
238
|
const exampleConditionBoolean: IConditionBoolean = {
|
|
239
|
+
conditionType: ConditionTypeBoolean.TRUE,
|
|
240
|
+
conditionTypeQualifier: ConditionTypeQualifier.IS,
|
|
243
241
|
targettedProperty: 'address.city.name',
|
|
244
|
-
conditionType: ConditionTypeBoolean.IS_TRUE
|
|
245
242
|
};
|
|
246
243
|
*/
|
|
247
|
-
export interface IConditionBoolean {
|
|
248
|
-
targettedProperty: string;
|
|
244
|
+
export interface IConditionBoolean extends IConditionBase {
|
|
249
245
|
conditionType: ConditionTypeBoolean;
|
|
250
246
|
}
|
|
251
247
|
/**
|
|
252
248
|
* This is the interface for the empty condition.
|
|
253
249
|
*
|
|
254
250
|
const exampleConditionEmpty: IConditionEmpty = {
|
|
251
|
+
conditionType: ConditionTypeEmpty.IS_EMPTY,
|
|
252
|
+
conditionTypeQualifier: ConditionTypeQualifier.IS,
|
|
255
253
|
targettedProperty: 'address.city.name',
|
|
256
|
-
conditionType: ConditionTypeEmpty.IS_EMPTY
|
|
257
254
|
};
|
|
258
255
|
*/
|
|
259
|
-
export interface IConditionEmpty {
|
|
260
|
-
|
|
261
|
-
conditionType: ConditionTypeEmpty;
|
|
256
|
+
export interface IConditionEmpty extends IConditionBase {
|
|
257
|
+
conditionType: ConditionTypeSingle.EMPTY;
|
|
262
258
|
}
|
|
263
259
|
/**
|
|
264
260
|
* This is the interface for the special condition.
|
|
265
261
|
*
|
|
266
262
|
const exampleConditionSpecial: IConditionSpecial = {
|
|
267
|
-
targettedProperty: 'address.city.name',
|
|
268
263
|
conditionType: ConditionTypeSpecial.PATTERN,
|
|
264
|
+
conditionTypeQualifier: ConditionTypeQualifier.IS,
|
|
269
265
|
conditionValue: '^[a-zA-Z0-9]*$'
|
|
266
|
+
targettedProperty: 'address.city.name',
|
|
270
267
|
};
|
|
271
268
|
*/
|
|
272
|
-
export interface IConditionSpecial {
|
|
273
|
-
targettedProperty: string;
|
|
269
|
+
export interface IConditionSpecial extends IConditionBase {
|
|
274
270
|
conditionType: ConditionTypeSpecial;
|
|
275
271
|
conditionValue: string;
|
|
276
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* This is the interface for the combined rule condition.
|
|
275
|
+
*/
|
|
276
|
+
export interface IConditionCombinedRules extends IConditionBase {
|
|
277
|
+
conditionType: ConditionTypeCombinedRules;
|
|
278
|
+
conditionValue: IRuleGroup;
|
|
279
|
+
}
|
|
277
280
|
//# sourceMappingURL=share-rule-models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;IACtC,cAAc,EAAE,OAAO,CAAC;IACxB,wBAAwB,EAAE,UAAU,EAAE,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB,EAAE,yBAAyB,EAAE,CAAC;CAC1D;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,2BAA2B,EAAE,CAAC;IAC5C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAMD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,EAAE,CAAC;CAC5B;AAMD;;GAEG;AACH,oBAAY,eAAe;IACvB,GAAG,QAAQ;IACX,EAAE,OAAO;CACZ;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACvB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,CAAC,
|
|
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;IACtC,cAAc,EAAE,OAAO,CAAC;IACxB,wBAAwB,EAAE,UAAU,EAAE,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,yBAAyB,EAAE,yBAAyB,EAAE,CAAC;CAC1D;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,2BAA2B,EAAE,CAAC;IAC5C,eAAe,EAAE,OAAO,CAAC;CAC5B;AAMD;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,UAAU,EAAE,CAAC;CAC5B;AAMD;;GAEG;AACH,oBAAY,eAAe;IACvB,GAAG,QAAQ;IACX,EAAE,OAAO;CACZ;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACvB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,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C;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACrD,aAAa,EAAE,oBAAoB,CAAC;CACvC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACnD,aAAa,EAAE,mBAAmB,CAAC,KAAK,CAAC;CAC5C;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAkB,SAAQ,cAAc;IACrD,aAAa,EAAE,oBAAoB,CAAC;IACpC,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC3D,aAAa,EAAE,0BAA0B,CAAC;IAC1C,cAAc,EAAE,UAAU,CAAC;CAC9B"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* This file contains the models for the rules used in the share data.
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ConditionTypeOf = exports.
|
|
6
|
+
exports.ConditionTypeOf = exports.ConditionTypeCombinedRules = exports.ConditionTypeSpecial = exports.ConditionTypeBoolean = exports.ConditionTypeStartsEndsWith = exports.ConditionTypeRange = exports.ConditionTypeSingle = exports.ConditionTypeQualifier = exports.LogicalOperator = void 0;
|
|
7
7
|
//#endregion RuleSet
|
|
8
8
|
//#region RuleGroup
|
|
9
9
|
/**
|
|
@@ -15,21 +15,24 @@ var LogicalOperator;
|
|
|
15
15
|
LogicalOperator["OR"] = "OR";
|
|
16
16
|
})(LogicalOperator || (exports.LogicalOperator = LogicalOperator = {}));
|
|
17
17
|
/**
|
|
18
|
-
* This contains the choices for the
|
|
18
|
+
* This contains the choices for the type of qualifier.
|
|
19
19
|
*/
|
|
20
|
-
var
|
|
21
|
-
(function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
})(
|
|
20
|
+
var ConditionTypeQualifier;
|
|
21
|
+
(function (ConditionTypeQualifier) {
|
|
22
|
+
ConditionTypeQualifier["IS"] = "is";
|
|
23
|
+
ConditionTypeQualifier["IS_NOT"] = "is not";
|
|
24
|
+
})(ConditionTypeQualifier || (exports.ConditionTypeQualifier = ConditionTypeQualifier = {}));
|
|
25
25
|
/**
|
|
26
|
-
* This contains the choices for the
|
|
26
|
+
* This contains the choices for the type of condition.
|
|
27
27
|
*/
|
|
28
|
-
var
|
|
29
|
-
(function (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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 || (exports.ConditionTypeSingle = ConditionTypeSingle = {}));
|
|
33
36
|
/**
|
|
34
37
|
* This contains the choices for the range conditions.
|
|
35
38
|
*/
|
|
@@ -40,14 +43,6 @@ var ConditionTypeRange;
|
|
|
40
43
|
ConditionTypeRange["GREATER_THAN_OR_EQUAL"] = "greater than or equal";
|
|
41
44
|
ConditionTypeRange["LESS_THAN_OR_EQUAL"] = "less than or equal";
|
|
42
45
|
})(ConditionTypeRange || (exports.ConditionTypeRange = ConditionTypeRange = {}));
|
|
43
|
-
/**
|
|
44
|
-
* This contains the choices for the contains conditions.
|
|
45
|
-
*/
|
|
46
|
-
var ConditionTypeContains;
|
|
47
|
-
(function (ConditionTypeContains) {
|
|
48
|
-
ConditionTypeContains["CONTAINS"] = "contains";
|
|
49
|
-
ConditionTypeContains["NOT_CONTAINS"] = "not contains";
|
|
50
|
-
})(ConditionTypeContains || (exports.ConditionTypeContains = ConditionTypeContains = {}));
|
|
51
46
|
/**
|
|
52
47
|
* This contains the choices for the starts with and ends with conditions.
|
|
53
48
|
*/
|
|
@@ -56,30 +51,14 @@ var ConditionTypeStartsEndsWith;
|
|
|
56
51
|
ConditionTypeStartsEndsWith["STARTS_WITH"] = "starts with";
|
|
57
52
|
ConditionTypeStartsEndsWith["ENDS_WITH"] = "ends with";
|
|
58
53
|
})(ConditionTypeStartsEndsWith || (exports.ConditionTypeStartsEndsWith = ConditionTypeStartsEndsWith = {}));
|
|
59
|
-
/**
|
|
60
|
-
* This contains the choices for the null conditions.
|
|
61
|
-
*/
|
|
62
|
-
var ConditionTypeNull;
|
|
63
|
-
(function (ConditionTypeNull) {
|
|
64
|
-
ConditionTypeNull["IS_NULL"] = "is null";
|
|
65
|
-
ConditionTypeNull["IS_NOT_NULL"] = "is not null";
|
|
66
|
-
})(ConditionTypeNull || (exports.ConditionTypeNull = ConditionTypeNull = {}));
|
|
67
54
|
/**
|
|
68
55
|
* This contains the choices for the boolean conditions.
|
|
69
56
|
*/
|
|
70
57
|
var ConditionTypeBoolean;
|
|
71
58
|
(function (ConditionTypeBoolean) {
|
|
72
|
-
ConditionTypeBoolean["
|
|
73
|
-
ConditionTypeBoolean["
|
|
59
|
+
ConditionTypeBoolean["TRUE"] = "true";
|
|
60
|
+
ConditionTypeBoolean["FALSE"] = "false";
|
|
74
61
|
})(ConditionTypeBoolean || (exports.ConditionTypeBoolean = ConditionTypeBoolean = {}));
|
|
75
|
-
/**
|
|
76
|
-
* This contains the choices for the empty conditions.
|
|
77
|
-
*/
|
|
78
|
-
var ConditionTypeEmpty;
|
|
79
|
-
(function (ConditionTypeEmpty) {
|
|
80
|
-
ConditionTypeEmpty["IS_EMPTY"] = "is empty";
|
|
81
|
-
ConditionTypeEmpty["IS_NOT_EMPTY"] = "is not empty";
|
|
82
|
-
})(ConditionTypeEmpty || (exports.ConditionTypeEmpty = ConditionTypeEmpty = {}));
|
|
83
62
|
/**
|
|
84
63
|
* This contains the choices for the special conditions.
|
|
85
64
|
*/
|
|
@@ -87,6 +66,13 @@ var ConditionTypeSpecial;
|
|
|
87
66
|
(function (ConditionTypeSpecial) {
|
|
88
67
|
ConditionTypeSpecial["PATTERN"] = "pattern";
|
|
89
68
|
})(ConditionTypeSpecial || (exports.ConditionTypeSpecial = ConditionTypeSpecial = {}));
|
|
69
|
+
/**
|
|
70
|
+
* This contains the choices for the combined rule conditions that are a type of object
|
|
71
|
+
*/
|
|
72
|
+
var ConditionTypeCombinedRules;
|
|
73
|
+
(function (ConditionTypeCombinedRules) {
|
|
74
|
+
ConditionTypeCombinedRules["OBJECT"] = "object";
|
|
75
|
+
})(ConditionTypeCombinedRules || (exports.ConditionTypeCombinedRules = ConditionTypeCombinedRules = {}));
|
|
90
76
|
/**
|
|
91
77
|
* These are the different choices for the types of data in a condition.
|
|
92
78
|
*/
|
|
@@ -101,7 +87,6 @@ var ConditionTypeOf;
|
|
|
101
87
|
ConditionTypeOf["NULL"] = "null";
|
|
102
88
|
ConditionTypeOf["UNDEFINED"] = "undefined";
|
|
103
89
|
ConditionTypeOf["FUNCTION"] = "function";
|
|
104
|
-
// SYMBOL = 'symbol',
|
|
105
90
|
ConditionTypeOf["BIGINT"] = "bigint";
|
|
106
91
|
})(ConditionTypeOf || (exports.ConditionTypeOf = ConditionTypeOf = {}));
|
|
107
92
|
//#endregion Conditions
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@degenerate/generic",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
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",
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"bip39": "^3.1.0",
|
|
51
51
|
"elliptic": "^6.5.7"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "0e8f76c14364f6d23ab66cdb9547d4e486fad9a4"
|
|
54
54
|
}
|