@degenerate/rules 0.0.9 → 0.0.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.
- package/dist/evaluation/evaluate-rule-conditions.js +1 -1
- package/dist/evaluation/evaluate-rules.js +3 -5
- package/dist/evaluation/testdata/rules/rules.test-data.d.ts +312 -0
- package/dist/evaluation/testdata/rules/rules.test-data.d.ts.map +1 -0
- package/dist/evaluation/testdata/rules/rules.test-data.js +212 -0
- package/dist/evaluation/testdata/rules/share-data.test-data.d.ts +1 -0
- package/dist/evaluation/testdata/rules/share-data.test-data.d.ts.map +1 -0
- package/dist/evaluation/testdata/rules/share-data.test-data.js +1 -0
- package/package.json +3 -3
|
@@ -48,7 +48,7 @@ const evaluateRuleConditions = (targetObject, condition) => {
|
|
|
48
48
|
case generic_1.ConditionTypeEmpty.IS_NOT_EMPTY:
|
|
49
49
|
return (0, empty_conditions_1.isValidEmptyValue)(targetValue, condition.conditionType);
|
|
50
50
|
case generic_1.ConditionTypeSpecial.PATTERN:
|
|
51
|
-
return (0, special_conditions_1.isValidSpecialValue)(
|
|
51
|
+
return (0, special_conditions_1.isValidSpecialValue)(targetValue, condition.conditionValue, condition.conditionType);
|
|
52
52
|
}
|
|
53
53
|
// return false;
|
|
54
54
|
};
|
|
@@ -24,17 +24,15 @@ const evaluateRules = (rootParam, appliedRules, shareDataCurrent, shareDataPropo
|
|
|
24
24
|
const ruleEvaluationResult = (0, evaluate_rule_1.evaluateRule)(rule, shareDataCurrent, shareDataProposed, logInfo);
|
|
25
25
|
// check if the rule passed
|
|
26
26
|
const passedRuleCheck = checkIfPassedRules(ruleEvaluationResult);
|
|
27
|
+
if (logInfo) { // add in the logging information if it's been requested
|
|
28
|
+
shareRulesEvaluationResults.shareRuleEvalutionResults.push(ruleEvaluationResult);
|
|
29
|
+
}
|
|
27
30
|
if (passedRuleCheck) {
|
|
28
31
|
shareRulesEvaluationResults.passedRuleCheck = true;
|
|
29
32
|
shareRulesEvaluationResults.passedRuleId = rule.ruleId;
|
|
30
33
|
if (!logInfo)
|
|
31
34
|
break;
|
|
32
35
|
}
|
|
33
|
-
else {
|
|
34
|
-
if (logInfo) {
|
|
35
|
-
shareRulesEvaluationResults.shareRuleEvalutionResults.push(ruleEvaluationResult);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
36
|
}
|
|
39
37
|
return shareRulesEvaluationResults;
|
|
40
38
|
};
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { ConditionTypeEquality, ConditionTypeOf, ConditionTypeRange, ConditionTypeTypeOf } from '@degenerate/generic';
|
|
2
|
+
export declare const loanAmountCreate: {
|
|
3
|
+
ruleId: string;
|
|
4
|
+
currentDataConditions: {
|
|
5
|
+
targettedProperty: string;
|
|
6
|
+
conditionType: ConditionTypeTypeOf;
|
|
7
|
+
conditionValue: ConditionTypeOf;
|
|
8
|
+
}[];
|
|
9
|
+
proposedDataConditions: ({
|
|
10
|
+
targettedProperty: string;
|
|
11
|
+
conditionType: ConditionTypeTypeOf;
|
|
12
|
+
conditionValue: ConditionTypeOf;
|
|
13
|
+
} | {
|
|
14
|
+
targettedProperty: string;
|
|
15
|
+
conditionType: ConditionTypeRange;
|
|
16
|
+
conditionValue: number;
|
|
17
|
+
})[];
|
|
18
|
+
targettedProperty: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const loanAmountCreateWithPink_A: {
|
|
21
|
+
ruleId: string;
|
|
22
|
+
currentDataConditions: {
|
|
23
|
+
targettedProperty: string;
|
|
24
|
+
conditionType: ConditionTypeTypeOf;
|
|
25
|
+
conditionValue: ConditionTypeOf;
|
|
26
|
+
}[];
|
|
27
|
+
proposedDataConditions: ({
|
|
28
|
+
targettedProperty: string;
|
|
29
|
+
conditionType: ConditionTypeTypeOf;
|
|
30
|
+
conditionValue: ConditionTypeOf;
|
|
31
|
+
} | {
|
|
32
|
+
targettedProperty: string;
|
|
33
|
+
conditionType: ConditionTypeRange;
|
|
34
|
+
conditionValue: number;
|
|
35
|
+
} | {
|
|
36
|
+
targettedProperty: string;
|
|
37
|
+
conditionType: ConditionTypeEquality;
|
|
38
|
+
conditionValue: string;
|
|
39
|
+
})[];
|
|
40
|
+
targettedProperty: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const loanAmountUpdate: {
|
|
43
|
+
ruleId: string;
|
|
44
|
+
currentDataConditions: ({
|
|
45
|
+
targettedProperty: string;
|
|
46
|
+
conditionType: ConditionTypeTypeOf;
|
|
47
|
+
conditionValue: ConditionTypeOf;
|
|
48
|
+
} | {
|
|
49
|
+
targettedProperty: string;
|
|
50
|
+
conditionType: ConditionTypeRange;
|
|
51
|
+
conditionValue: number;
|
|
52
|
+
})[];
|
|
53
|
+
proposedDataConditions: ({
|
|
54
|
+
targettedProperty: string;
|
|
55
|
+
conditionType: ConditionTypeTypeOf;
|
|
56
|
+
conditionValue: ConditionTypeOf;
|
|
57
|
+
} | {
|
|
58
|
+
targettedProperty: string;
|
|
59
|
+
conditionType: ConditionTypeRange;
|
|
60
|
+
conditionValue: number;
|
|
61
|
+
})[];
|
|
62
|
+
targettedProperty: string;
|
|
63
|
+
};
|
|
64
|
+
export declare const loanAmountUpdateWithPink_BA: {
|
|
65
|
+
ruleId: string;
|
|
66
|
+
currentDataConditions: ({
|
|
67
|
+
targettedProperty: string;
|
|
68
|
+
conditionType: ConditionTypeTypeOf;
|
|
69
|
+
conditionValue: ConditionTypeOf;
|
|
70
|
+
} | {
|
|
71
|
+
targettedProperty: string;
|
|
72
|
+
conditionType: ConditionTypeRange;
|
|
73
|
+
conditionValue: number;
|
|
74
|
+
} | {
|
|
75
|
+
targettedProperty: string;
|
|
76
|
+
conditionType: ConditionTypeEquality;
|
|
77
|
+
conditionValue: string;
|
|
78
|
+
})[];
|
|
79
|
+
proposedDataConditions: ({
|
|
80
|
+
targettedProperty: string;
|
|
81
|
+
conditionType: ConditionTypeTypeOf;
|
|
82
|
+
conditionValue: ConditionTypeOf;
|
|
83
|
+
} | {
|
|
84
|
+
targettedProperty: string;
|
|
85
|
+
conditionType: ConditionTypeRange;
|
|
86
|
+
conditionValue: number;
|
|
87
|
+
} | {
|
|
88
|
+
targettedProperty: string;
|
|
89
|
+
conditionType: ConditionTypeEquality;
|
|
90
|
+
conditionValue: string;
|
|
91
|
+
})[];
|
|
92
|
+
targettedProperty: string;
|
|
93
|
+
};
|
|
94
|
+
export declare const loanAmountDelete: {
|
|
95
|
+
ruleId: string;
|
|
96
|
+
currentDataConditions: ({
|
|
97
|
+
targettedProperty: string;
|
|
98
|
+
conditionType: ConditionTypeTypeOf;
|
|
99
|
+
conditionValue: ConditionTypeOf;
|
|
100
|
+
} | {
|
|
101
|
+
targettedProperty: string;
|
|
102
|
+
conditionType: ConditionTypeRange;
|
|
103
|
+
conditionValue: number;
|
|
104
|
+
})[];
|
|
105
|
+
proposedDataConditions: {
|
|
106
|
+
targettedProperty: string;
|
|
107
|
+
conditionType: ConditionTypeTypeOf;
|
|
108
|
+
conditionValue: ConditionTypeOf;
|
|
109
|
+
}[];
|
|
110
|
+
targettedProperty: string;
|
|
111
|
+
};
|
|
112
|
+
export declare const userAgeCreate: {
|
|
113
|
+
ruleId: string;
|
|
114
|
+
currentDataConditions: {
|
|
115
|
+
targettedProperty: string;
|
|
116
|
+
conditionType: ConditionTypeTypeOf;
|
|
117
|
+
conditionValue: ConditionTypeOf;
|
|
118
|
+
}[];
|
|
119
|
+
proposedDataConditions: ({
|
|
120
|
+
targettedProperty: string;
|
|
121
|
+
conditionType: ConditionTypeTypeOf;
|
|
122
|
+
conditionValue: ConditionTypeOf;
|
|
123
|
+
} | {
|
|
124
|
+
targettedProperty: string;
|
|
125
|
+
conditionType: ConditionTypeRange;
|
|
126
|
+
conditionValue: number;
|
|
127
|
+
})[];
|
|
128
|
+
targettedProperty: string;
|
|
129
|
+
};
|
|
130
|
+
export declare const userAgeUpdate: {
|
|
131
|
+
ruleId: string;
|
|
132
|
+
currentDataConditions: ({
|
|
133
|
+
targettedProperty: string;
|
|
134
|
+
conditionType: ConditionTypeTypeOf;
|
|
135
|
+
conditionValue: ConditionTypeOf;
|
|
136
|
+
} | {
|
|
137
|
+
targettedProperty: string;
|
|
138
|
+
conditionType: ConditionTypeRange;
|
|
139
|
+
conditionValue: number;
|
|
140
|
+
})[];
|
|
141
|
+
proposedDataConditions: ({
|
|
142
|
+
targettedProperty: string;
|
|
143
|
+
conditionType: ConditionTypeTypeOf;
|
|
144
|
+
conditionValue: ConditionTypeOf;
|
|
145
|
+
} | {
|
|
146
|
+
targettedProperty: string;
|
|
147
|
+
conditionType: ConditionTypeRange;
|
|
148
|
+
conditionValue: number;
|
|
149
|
+
})[];
|
|
150
|
+
targettedProperty: string;
|
|
151
|
+
};
|
|
152
|
+
export declare const userAgeDelete: {
|
|
153
|
+
ruleId: string;
|
|
154
|
+
currentDataConditions: ({
|
|
155
|
+
targettedProperty: string;
|
|
156
|
+
conditionType: ConditionTypeTypeOf;
|
|
157
|
+
conditionValue: ConditionTypeOf;
|
|
158
|
+
} | {
|
|
159
|
+
targettedProperty: string;
|
|
160
|
+
conditionType: ConditionTypeRange;
|
|
161
|
+
conditionValue: number;
|
|
162
|
+
})[];
|
|
163
|
+
proposedDataConditions: {
|
|
164
|
+
targettedProperty: string;
|
|
165
|
+
conditionType: ConditionTypeTypeOf;
|
|
166
|
+
conditionValue: ConditionTypeOf;
|
|
167
|
+
}[];
|
|
168
|
+
targettedProperty: string;
|
|
169
|
+
};
|
|
170
|
+
export declare const userFirstNameCreate: {
|
|
171
|
+
ruleId: string;
|
|
172
|
+
currentDataConditions: {
|
|
173
|
+
targettedProperty: string;
|
|
174
|
+
conditionType: ConditionTypeTypeOf;
|
|
175
|
+
conditionValue: ConditionTypeOf;
|
|
176
|
+
}[];
|
|
177
|
+
proposedDataConditions: {
|
|
178
|
+
targettedProperty: string;
|
|
179
|
+
conditionType: ConditionTypeTypeOf;
|
|
180
|
+
conditionValue: ConditionTypeOf;
|
|
181
|
+
}[];
|
|
182
|
+
targettedProperty: string;
|
|
183
|
+
};
|
|
184
|
+
export declare const userLastNameCreate: {
|
|
185
|
+
ruleId: string;
|
|
186
|
+
currentDataConditions: {
|
|
187
|
+
targettedProperty: string;
|
|
188
|
+
conditionType: ConditionTypeTypeOf;
|
|
189
|
+
conditionValue: ConditionTypeOf;
|
|
190
|
+
}[];
|
|
191
|
+
proposedDataConditions: {
|
|
192
|
+
targettedProperty: string;
|
|
193
|
+
conditionType: ConditionTypeTypeOf;
|
|
194
|
+
conditionValue: ConditionTypeOf;
|
|
195
|
+
}[];
|
|
196
|
+
targettedProperty: string;
|
|
197
|
+
};
|
|
198
|
+
export declare const userFirstNameUpdate: {
|
|
199
|
+
ruleId: string;
|
|
200
|
+
currentDataConditions: {
|
|
201
|
+
targettedProperty: string;
|
|
202
|
+
conditionType: ConditionTypeTypeOf;
|
|
203
|
+
conditionValue: ConditionTypeOf;
|
|
204
|
+
}[];
|
|
205
|
+
proposedDataConditions: {
|
|
206
|
+
targettedProperty: string;
|
|
207
|
+
conditionType: ConditionTypeTypeOf;
|
|
208
|
+
conditionValue: ConditionTypeOf;
|
|
209
|
+
}[];
|
|
210
|
+
targettedProperty: string;
|
|
211
|
+
};
|
|
212
|
+
export declare const userLastNameUpdate: {
|
|
213
|
+
ruleId: string;
|
|
214
|
+
currentDataConditions: {
|
|
215
|
+
targettedProperty: string;
|
|
216
|
+
conditionType: ConditionTypeTypeOf;
|
|
217
|
+
conditionValue: ConditionTypeOf;
|
|
218
|
+
}[];
|
|
219
|
+
proposedDataConditions: {
|
|
220
|
+
targettedProperty: string;
|
|
221
|
+
conditionType: ConditionTypeTypeOf;
|
|
222
|
+
conditionValue: ConditionTypeOf;
|
|
223
|
+
}[];
|
|
224
|
+
targettedProperty: string;
|
|
225
|
+
};
|
|
226
|
+
export declare const userFirstNameDelete: {
|
|
227
|
+
ruleId: string;
|
|
228
|
+
currentDataConditions: {
|
|
229
|
+
targettedProperty: string;
|
|
230
|
+
conditionType: ConditionTypeTypeOf;
|
|
231
|
+
conditionValue: ConditionTypeOf;
|
|
232
|
+
}[];
|
|
233
|
+
proposedDataConditions: {
|
|
234
|
+
targettedProperty: string;
|
|
235
|
+
conditionType: ConditionTypeTypeOf;
|
|
236
|
+
conditionValue: ConditionTypeOf;
|
|
237
|
+
}[];
|
|
238
|
+
targettedProperty: string;
|
|
239
|
+
};
|
|
240
|
+
export declare const userLastNameDelete: {
|
|
241
|
+
ruleId: string;
|
|
242
|
+
currentDataConditions: {
|
|
243
|
+
targettedProperty: string;
|
|
244
|
+
conditionType: ConditionTypeTypeOf;
|
|
245
|
+
conditionValue: ConditionTypeOf;
|
|
246
|
+
}[];
|
|
247
|
+
proposedDataConditions: {
|
|
248
|
+
targettedProperty: string;
|
|
249
|
+
conditionType: ConditionTypeTypeOf;
|
|
250
|
+
conditionValue: ConditionTypeOf;
|
|
251
|
+
}[];
|
|
252
|
+
targettedProperty: string;
|
|
253
|
+
};
|
|
254
|
+
export declare const userCombinedCreate: {
|
|
255
|
+
ruleId: string;
|
|
256
|
+
currentDataConditions: {
|
|
257
|
+
targettedProperty: string;
|
|
258
|
+
conditionType: ConditionTypeTypeOf;
|
|
259
|
+
conditionValue: ConditionTypeOf;
|
|
260
|
+
}[];
|
|
261
|
+
proposedDataConditions: ({
|
|
262
|
+
targettedProperty: string;
|
|
263
|
+
conditionType: ConditionTypeTypeOf;
|
|
264
|
+
conditionValue: ConditionTypeOf;
|
|
265
|
+
} | {
|
|
266
|
+
targettedProperty: string;
|
|
267
|
+
conditionType: ConditionTypeRange;
|
|
268
|
+
conditionValue: number;
|
|
269
|
+
})[];
|
|
270
|
+
targettedProperty: string;
|
|
271
|
+
};
|
|
272
|
+
export declare const userCombinedUpdate: {
|
|
273
|
+
ruleId: string;
|
|
274
|
+
currentDataConditions: ({
|
|
275
|
+
targettedProperty: string;
|
|
276
|
+
conditionType: ConditionTypeTypeOf;
|
|
277
|
+
conditionValue: ConditionTypeOf;
|
|
278
|
+
} | {
|
|
279
|
+
targettedProperty: string;
|
|
280
|
+
conditionType: ConditionTypeRange;
|
|
281
|
+
conditionValue: number;
|
|
282
|
+
})[];
|
|
283
|
+
proposedDataConditions: ({
|
|
284
|
+
targettedProperty: string;
|
|
285
|
+
conditionType: ConditionTypeTypeOf;
|
|
286
|
+
conditionValue: ConditionTypeOf;
|
|
287
|
+
} | {
|
|
288
|
+
targettedProperty: string;
|
|
289
|
+
conditionType: ConditionTypeRange;
|
|
290
|
+
conditionValue: number;
|
|
291
|
+
})[];
|
|
292
|
+
targettedProperty: string;
|
|
293
|
+
};
|
|
294
|
+
export declare const userCombinedDelete: {
|
|
295
|
+
ruleId: string;
|
|
296
|
+
currentDataConditions: ({
|
|
297
|
+
targettedProperty: string;
|
|
298
|
+
conditionType: ConditionTypeTypeOf;
|
|
299
|
+
conditionValue: ConditionTypeOf;
|
|
300
|
+
} | {
|
|
301
|
+
targettedProperty: string;
|
|
302
|
+
conditionType: ConditionTypeRange;
|
|
303
|
+
conditionValue: number;
|
|
304
|
+
})[];
|
|
305
|
+
proposedDataConditions: {
|
|
306
|
+
targettedProperty: string;
|
|
307
|
+
conditionType: ConditionTypeTypeOf;
|
|
308
|
+
conditionValue: ConditionTypeOf;
|
|
309
|
+
}[];
|
|
310
|
+
targettedProperty: string;
|
|
311
|
+
};
|
|
312
|
+
//# sourceMappingURL=rules.test-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.test-data.d.ts","sourceRoot":"","sources":["../../../../src/evaluation/testdata/rules/rules.test-data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAItH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;CAU5B,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;CAWtC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;CAW5B,CAAC;AAEF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAavC,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;CAU5B,CAAC;AAQF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;CAUzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;CAWzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;CAUzB,CAAC;AAMF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;CAS/B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;CAS9B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;CAS/B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;CAS9B,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;CAS/B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;CAS9B,CAAC;AAIF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;CAc9B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;CAe9B,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;CAc9B,CAAC"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.userCombinedDelete = exports.userCombinedUpdate = exports.userCombinedCreate = exports.userLastNameDelete = exports.userFirstNameDelete = exports.userLastNameUpdate = exports.userFirstNameUpdate = exports.userLastNameCreate = exports.userFirstNameCreate = exports.userAgeDelete = exports.userAgeUpdate = exports.userAgeCreate = exports.loanAmountDelete = exports.loanAmountUpdateWithPink_BA = exports.loanAmountUpdate = exports.loanAmountCreateWithPink_A = exports.loanAmountCreate = void 0;
|
|
4
|
+
const generic_1 = require("@degenerate/generic");
|
|
5
|
+
//#region property loanAmount
|
|
6
|
+
exports.loanAmountCreate = {
|
|
7
|
+
ruleId: 'loanAmountCreate',
|
|
8
|
+
currentDataConditions: [
|
|
9
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED, }
|
|
10
|
+
],
|
|
11
|
+
proposedDataConditions: [
|
|
12
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
13
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 },
|
|
14
|
+
],
|
|
15
|
+
targettedProperty: 'loanAmount'
|
|
16
|
+
};
|
|
17
|
+
exports.loanAmountCreateWithPink_A = {
|
|
18
|
+
ruleId: 'loanAmountCreate',
|
|
19
|
+
currentDataConditions: [
|
|
20
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED, }
|
|
21
|
+
],
|
|
22
|
+
proposedDataConditions: [
|
|
23
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
24
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 },
|
|
25
|
+
{ targettedProperty: 'house.color.window', conditionType: generic_1.ConditionTypeEquality.EQUAL, conditionValue: 'pink' }
|
|
26
|
+
],
|
|
27
|
+
targettedProperty: 'loanAmount'
|
|
28
|
+
};
|
|
29
|
+
exports.loanAmountUpdate = {
|
|
30
|
+
ruleId: 'loanAmountUpdate',
|
|
31
|
+
currentDataConditions: [
|
|
32
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
33
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 },
|
|
34
|
+
],
|
|
35
|
+
proposedDataConditions: [
|
|
36
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
37
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 },
|
|
38
|
+
],
|
|
39
|
+
targettedProperty: 'loanAmount'
|
|
40
|
+
};
|
|
41
|
+
exports.loanAmountUpdateWithPink_BA = {
|
|
42
|
+
ruleId: 'loanAmountUpdate',
|
|
43
|
+
currentDataConditions: [
|
|
44
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
45
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 },
|
|
46
|
+
{ targettedProperty: 'house.color.window', conditionType: generic_1.ConditionTypeEquality.EQUAL, conditionValue: 'pink' }
|
|
47
|
+
],
|
|
48
|
+
proposedDataConditions: [
|
|
49
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
50
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 },
|
|
51
|
+
{ targettedProperty: 'house.color.window', conditionType: generic_1.ConditionTypeEquality.EQUAL, conditionValue: 'pink' }
|
|
52
|
+
],
|
|
53
|
+
targettedProperty: 'loanAmount'
|
|
54
|
+
};
|
|
55
|
+
exports.loanAmountDelete = {
|
|
56
|
+
ruleId: 'loanAmountUpdate',
|
|
57
|
+
currentDataConditions: [
|
|
58
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
59
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 }
|
|
60
|
+
],
|
|
61
|
+
proposedDataConditions: [
|
|
62
|
+
{ targettedProperty: 'loanAmount', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED }
|
|
63
|
+
],
|
|
64
|
+
targettedProperty: 'loanAmount'
|
|
65
|
+
};
|
|
66
|
+
//#endregion property loanAmount
|
|
67
|
+
//#region User
|
|
68
|
+
//#region User.age
|
|
69
|
+
exports.userAgeCreate = {
|
|
70
|
+
ruleId: 'user.ageCreate',
|
|
71
|
+
currentDataConditions: [
|
|
72
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED, }
|
|
73
|
+
],
|
|
74
|
+
proposedDataConditions: [
|
|
75
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
76
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 },
|
|
77
|
+
],
|
|
78
|
+
targettedProperty: 'user'
|
|
79
|
+
};
|
|
80
|
+
exports.userAgeUpdate = {
|
|
81
|
+
ruleId: 'user.ageUpdate',
|
|
82
|
+
currentDataConditions: [
|
|
83
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
84
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 },
|
|
85
|
+
],
|
|
86
|
+
proposedDataConditions: [
|
|
87
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
88
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 18 },
|
|
89
|
+
],
|
|
90
|
+
targettedProperty: 'user'
|
|
91
|
+
};
|
|
92
|
+
exports.userAgeDelete = {
|
|
93
|
+
ruleId: 'user.ageDelete',
|
|
94
|
+
currentDataConditions: [
|
|
95
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
96
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 }
|
|
97
|
+
],
|
|
98
|
+
proposedDataConditions: [
|
|
99
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED }
|
|
100
|
+
],
|
|
101
|
+
targettedProperty: 'user'
|
|
102
|
+
};
|
|
103
|
+
//#endregion User.age
|
|
104
|
+
//#region User.name
|
|
105
|
+
exports.userFirstNameCreate = {
|
|
106
|
+
ruleId: 'user.firstNameCreate',
|
|
107
|
+
currentDataConditions: [
|
|
108
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED, }
|
|
109
|
+
],
|
|
110
|
+
proposedDataConditions: [
|
|
111
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
112
|
+
],
|
|
113
|
+
targettedProperty: 'user'
|
|
114
|
+
};
|
|
115
|
+
exports.userLastNameCreate = {
|
|
116
|
+
ruleId: 'user.lastNameCreate',
|
|
117
|
+
currentDataConditions: [
|
|
118
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED, }
|
|
119
|
+
],
|
|
120
|
+
proposedDataConditions: [
|
|
121
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
122
|
+
],
|
|
123
|
+
targettedProperty: 'user'
|
|
124
|
+
};
|
|
125
|
+
exports.userFirstNameUpdate = {
|
|
126
|
+
ruleId: 'user.firstNameUpdate',
|
|
127
|
+
currentDataConditions: [
|
|
128
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, }
|
|
129
|
+
],
|
|
130
|
+
proposedDataConditions: [
|
|
131
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
132
|
+
],
|
|
133
|
+
targettedProperty: 'user'
|
|
134
|
+
};
|
|
135
|
+
exports.userLastNameUpdate = {
|
|
136
|
+
ruleId: 'user.lastNameUpdate',
|
|
137
|
+
currentDataConditions: [
|
|
138
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, }
|
|
139
|
+
],
|
|
140
|
+
proposedDataConditions: [
|
|
141
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
142
|
+
],
|
|
143
|
+
targettedProperty: 'user'
|
|
144
|
+
};
|
|
145
|
+
exports.userFirstNameDelete = {
|
|
146
|
+
ruleId: 'user.firstNameDelete',
|
|
147
|
+
currentDataConditions: [
|
|
148
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, }
|
|
149
|
+
],
|
|
150
|
+
proposedDataConditions: [
|
|
151
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED }
|
|
152
|
+
],
|
|
153
|
+
targettedProperty: 'user'
|
|
154
|
+
};
|
|
155
|
+
exports.userLastNameDelete = {
|
|
156
|
+
ruleId: 'user.lastNameDelete',
|
|
157
|
+
currentDataConditions: [
|
|
158
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, }
|
|
159
|
+
],
|
|
160
|
+
proposedDataConditions: [
|
|
161
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED }
|
|
162
|
+
],
|
|
163
|
+
targettedProperty: 'user'
|
|
164
|
+
};
|
|
165
|
+
//#endregion User.name
|
|
166
|
+
exports.userCombinedCreate = {
|
|
167
|
+
ruleId: 'user.combinedCreate',
|
|
168
|
+
currentDataConditions: [
|
|
169
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED, },
|
|
170
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED, },
|
|
171
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED, }
|
|
172
|
+
],
|
|
173
|
+
proposedDataConditions: [
|
|
174
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
175
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
176
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
177
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 },
|
|
178
|
+
],
|
|
179
|
+
targettedProperty: 'user'
|
|
180
|
+
};
|
|
181
|
+
exports.userCombinedUpdate = {
|
|
182
|
+
ruleId: 'user.combinedUpdate',
|
|
183
|
+
currentDataConditions: [
|
|
184
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
185
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
186
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
187
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 },
|
|
188
|
+
],
|
|
189
|
+
proposedDataConditions: [
|
|
190
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
191
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
192
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
193
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 18 },
|
|
194
|
+
],
|
|
195
|
+
targettedProperty: 'user'
|
|
196
|
+
};
|
|
197
|
+
exports.userCombinedDelete = {
|
|
198
|
+
ruleId: 'user.combinedDelete',
|
|
199
|
+
currentDataConditions: [
|
|
200
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
201
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.STRING, },
|
|
202
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.NUMBER, },
|
|
203
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeRange.GREATER_THAN_OR_EQUAL, conditionValue: 0 },
|
|
204
|
+
],
|
|
205
|
+
proposedDataConditions: [
|
|
206
|
+
{ targettedProperty: 'user.firstName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED },
|
|
207
|
+
{ targettedProperty: 'user.lastName', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED },
|
|
208
|
+
{ targettedProperty: 'user.age', conditionType: generic_1.ConditionTypeTypeOf.IS_TYPEOF, conditionValue: generic_1.ConditionTypeOf.UNDEFINED },
|
|
209
|
+
],
|
|
210
|
+
targettedProperty: 'user'
|
|
211
|
+
};
|
|
212
|
+
//#endregion User
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=share-data.test-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"share-data.test-data.d.ts","sourceRoot":"","sources":["../../../../src/evaluation/testdata/rules/share-data.test-data.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@degenerate/rules",
|
|
3
3
|
"description": "This contains the rules information needed for the ShareData Adaptive Framework Ecosystem (SAFE) network.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.11",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"devDependencies": {
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"author": "Degenerate Inc.",
|
|
37
37
|
"license": "ISC",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@degenerate/generic": "^0.0.
|
|
39
|
+
"@degenerate/generic": "^0.0.19"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "1ac7d89a03b0f9f79a5be9677eb930abba812cec"
|
|
42
42
|
}
|