@raytio/core 10.1.0 → 11.1.0

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 (208) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +198 -59
  3. package/dist/{util/hash.d.ts → __tests__/docs.test.d.ts} +1 -1
  4. package/dist/__tests__/docs.test.js +24 -0
  5. package/dist/accessApplication/createAA.d.ts +17 -17
  6. package/dist/accessApplication/createAA.js +71 -71
  7. package/dist/accessApplication/index.d.ts +1 -1
  8. package/dist/accessApplication/index.js +17 -17
  9. package/dist/crypto/cognitoAttributes.d.ts +15 -15
  10. package/dist/crypto/cognitoAttributes.js +33 -33
  11. package/dist/crypto/decryptKeys.d.ts +1 -1
  12. package/dist/crypto/decryptKeys.js +33 -33
  13. package/dist/crypto/decryptSharedData.d.ts +26 -26
  14. package/dist/crypto/decryptSharedData.js +38 -38
  15. package/dist/crypto/getAADecryptor.d.ts +16 -16
  16. package/dist/crypto/getAADecryptor.js +20 -20
  17. package/dist/crypto/helpers.d.ts +18 -18
  18. package/dist/crypto/helpers.js +26 -26
  19. package/dist/crypto/index.d.ts +4 -4
  20. package/dist/crypto/index.js +21 -21
  21. package/dist/general/conditional.d.ts +17 -17
  22. package/dist/general/conditional.js +32 -32
  23. package/dist/general/date.d.ts +2 -2
  24. package/dist/general/date.js +18 -18
  25. package/dist/general/index.d.ts +4 -4
  26. package/dist/general/index.js +20 -20
  27. package/dist/general/password.d.ts +10 -10
  28. package/dist/general/password.js +31 -31
  29. package/dist/general/types.d.ts +6 -6
  30. package/dist/general/types.js +13 -13
  31. package/dist/index.d.ts +6 -6
  32. package/dist/index.js +22 -22
  33. package/dist/rules/calculateScore.d.ts +28 -23
  34. package/dist/rules/calculateScore.js +82 -76
  35. package/dist/rules/convertInstanceToRuleInput.d.ts +3 -3
  36. package/dist/rules/convertInstanceToRuleInput.js +138 -139
  37. package/dist/rules/evaluateScoreCondition.d.ts +2 -2
  38. package/dist/rules/evaluateScoreCondition.js +44 -45
  39. package/dist/{verifications/checkVerifications.d.ts → rules/helpers/__tests__/addInfiniteThresholdBoundaries.test.d.ts} +1 -1
  40. package/dist/rules/helpers/__tests__/addInfiniteThresholdBoundaries.test.js +27 -0
  41. package/dist/{verifications/checkVerificationsNew.d.ts → rules/helpers/__tests__/checkTypeofValue.test.d.ts} +1 -1
  42. package/dist/rules/helpers/__tests__/checkTypeofValue.test.js +49 -0
  43. package/dist/{verifications/verifyCheck/util/canonicalJsonify.d.ts → rules/helpers/__tests__/getValuesFromPath.test.d.ts} +1 -1
  44. package/dist/rules/helpers/__tests__/getValuesFromPath.test.js +67 -0
  45. package/dist/rules/helpers/__tests__/thresholds.test.d.ts +1 -0
  46. package/dist/rules/helpers/__tests__/thresholds.test.js +32 -0
  47. package/dist/rules/helpers/addInfiniteThresholdBoundaries.d.ts +8 -8
  48. package/dist/rules/helpers/addInfiniteThresholdBoundaries.js +11 -11
  49. package/dist/rules/helpers/checkTypeofValue.d.ts +9 -9
  50. package/dist/rules/helpers/checkTypeofValue.js +60 -55
  51. package/dist/rules/helpers/getValuesFromPath.d.ts +3 -3
  52. package/dist/rules/helpers/getValuesFromPath.js +50 -50
  53. package/dist/rules/helpers/index.d.ts +5 -5
  54. package/dist/rules/helpers/index.js +21 -21
  55. package/dist/rules/helpers/symbols.d.ts +2 -2
  56. package/dist/rules/helpers/symbols.js +5 -5
  57. package/dist/rules/helpers/thresholds.d.ts +5 -5
  58. package/dist/rules/helpers/thresholds.js +46 -47
  59. package/dist/rules/index.d.ts +7 -7
  60. package/dist/rules/index.js +25 -25
  61. package/dist/rules/operators/__tests__/bool.test.d.ts +1 -0
  62. package/dist/rules/operators/__tests__/bool.test.js +21 -0
  63. package/dist/rules/operators/__tests__/date.test.d.ts +1 -0
  64. package/dist/rules/operators/__tests__/date.test.js +81 -0
  65. package/dist/rules/operators/__tests__/hfield.test.d.ts +1 -0
  66. package/dist/rules/operators/__tests__/hfield.test.js +38 -0
  67. package/dist/rules/operators/__tests__/hschema.test.d.ts +1 -0
  68. package/dist/rules/operators/__tests__/hschema.test.js +24 -0
  69. package/dist/rules/operators/__tests__/number.test.d.ts +1 -0
  70. package/dist/rules/operators/__tests__/number.test.js +53 -0
  71. package/dist/rules/operators/__tests__/string.test.d.ts +1 -0
  72. package/dist/rules/operators/__tests__/string.test.js +74 -0
  73. package/dist/rules/operators/bool.d.ts +2 -2
  74. package/dist/rules/operators/bool.js +17 -17
  75. package/dist/rules/operators/date.d.ts +2 -2
  76. package/dist/rules/operators/date.js +91 -91
  77. package/dist/rules/operators/hfield.d.ts +2 -2
  78. package/dist/rules/operators/hfield.js +33 -33
  79. package/dist/rules/operators/hschema.d.ts +2 -2
  80. package/dist/rules/operators/hschema.js +21 -21
  81. package/dist/rules/operators/index.d.ts +3 -3
  82. package/dist/rules/operators/index.js +11 -11
  83. package/dist/rules/operators/number.d.ts +2 -2
  84. package/dist/rules/operators/number.js +41 -41
  85. package/dist/rules/operators/string.d.ts +2 -2
  86. package/dist/rules/operators/string.js +58 -58
  87. package/dist/rules/types/config.d.ts +95 -91
  88. package/dist/rules/types/config.js +2 -2
  89. package/dist/rules/types/dataValueTypes.d.ts +19 -19
  90. package/dist/rules/types/dataValueTypes.js +4 -4
  91. package/dist/rules/types/index.d.ts +3 -3
  92. package/dist/rules/types/index.js +19 -19
  93. package/dist/rules/types/internal.d.ts +20 -20
  94. package/dist/rules/types/internal.js +2 -2
  95. package/dist/rules/validate.d.ts +6 -6
  96. package/dist/rules/validate.js +14 -14
  97. package/dist/rules/version.d.ts +1 -1
  98. package/dist/rules/version.js +5 -5
  99. package/dist/schema/expandSchema/__tests__/addLoadingTimes.test.d.ts +1 -0
  100. package/dist/schema/expandSchema/__tests__/addLoadingTimes.test.js +24 -0
  101. package/dist/schema/expandSchema/__tests__/expandSchema.test.d.ts +1 -0
  102. package/dist/schema/expandSchema/__tests__/expandSchema.test.js +95 -0
  103. package/dist/schema/expandSchema/__tests__/i18n.test.d.ts +1 -0
  104. package/dist/schema/expandSchema/__tests__/i18n.test.js +32 -0
  105. package/dist/schema/expandSchema/__tests__/maybeUseI18n.test.d.ts +1 -0
  106. package/dist/schema/expandSchema/__tests__/maybeUseI18n.test.js +98 -0
  107. package/dist/schema/expandSchema/__tests__/processSchema.test.d.ts +1 -0
  108. package/dist/schema/expandSchema/__tests__/processSchema.test.js +326 -0
  109. package/dist/schema/expandSchema/__tests__/sortSchemaProperties.test.d.ts +1 -0
  110. package/dist/schema/expandSchema/__tests__/sortSchemaProperties.test.js +182 -0
  111. package/dist/schema/expandSchema/__tests__/util.test.d.ts +1 -0
  112. package/dist/schema/expandSchema/__tests__/util.test.js +19 -0
  113. package/dist/schema/expandSchema/addLoadingTimes.d.ts +2 -0
  114. package/dist/schema/expandSchema/addLoadingTimes.js +12 -0
  115. package/dist/schema/expandSchema/constants.d.ts +2 -0
  116. package/dist/schema/expandSchema/constants.js +11 -0
  117. package/dist/schema/expandSchema/expandSchema.d.ts +7 -0
  118. package/dist/schema/expandSchema/expandSchema.js +19 -0
  119. package/dist/schema/expandSchema/i18n.d.ts +5 -0
  120. package/dist/schema/expandSchema/i18n.js +20 -0
  121. package/dist/schema/expandSchema/index.d.ts +3 -0
  122. package/dist/schema/expandSchema/index.js +21 -0
  123. package/dist/schema/expandSchema/maybeUseI18n.d.ts +2 -0
  124. package/dist/schema/expandSchema/maybeUseI18n.js +40 -0
  125. package/dist/schema/expandSchema/processSchema.d.ts +4 -0
  126. package/dist/schema/expandSchema/processSchema.js +94 -0
  127. package/dist/schema/expandSchema/removePrivateFields.d.ts +119 -0
  128. package/dist/schema/expandSchema/removePrivateFields.js +15 -0
  129. package/dist/schema/expandSchema/sortSchemaProperties.d.ts +21 -0
  130. package/dist/schema/expandSchema/sortSchemaProperties.js +40 -0
  131. package/dist/schema/expandSchema/unwrapSchema.d.ts +6 -0
  132. package/dist/schema/expandSchema/unwrapSchema.js +7 -0
  133. package/dist/schema/expandSchema/util.d.ts +6 -0
  134. package/dist/schema/expandSchema/util.js +15 -0
  135. package/dist/schema/index.d.ts +2 -1
  136. package/dist/schema/index.js +18 -17
  137. package/dist/schema/labels.d.ts +2 -2
  138. package/dist/schema/labels.js +20 -20
  139. package/dist/util/canonicalJsonify.d.ts +1 -1
  140. package/dist/util/canonicalJsonify.js +50 -50
  141. package/dist/util/handleResponse.d.ts +1 -1
  142. package/dist/util/handleResponse.js +21 -21
  143. package/dist/util/index.d.ts +2 -2
  144. package/dist/util/index.js +18 -18
  145. package/dist/verifications/cleanInstance.d.ts +9 -9
  146. package/dist/verifications/cleanInstance.js +15 -15
  147. package/dist/verifications/getPOVerification.d.ts +19 -16
  148. package/dist/verifications/getPOVerification.js +105 -94
  149. package/dist/verifications/getVerifiedBy.d.ts +1 -1
  150. package/dist/verifications/getVerifiedBy.js +19 -19
  151. package/dist/verifications/index.d.ts +5 -5
  152. package/dist/verifications/index.js +21 -21
  153. package/dist/verifications/maybeRereference.d.ts +1 -1
  154. package/dist/verifications/maybeRereference.js +10 -10
  155. package/dist/verifications/safeHarbour.d.ts +20 -20
  156. package/dist/verifications/safeHarbour.js +67 -74
  157. package/dist/verifications/verifyCheck/__tests__/getOwnRealVerifications.test.d.ts +1 -0
  158. package/dist/verifications/verifyCheck/__tests__/getOwnRealVerifications.test.js +152 -0
  159. package/dist/verifications/verifyCheck/__tests__/getSomeoneElsesRealVerifications.test.d.ts +1 -0
  160. package/dist/verifications/verifyCheck/__tests__/getSomeoneElsesRealVerifications.test.js +205 -0
  161. package/dist/verifications/verifyCheck/getOwnRealVerifications.d.ts +13 -13
  162. package/dist/verifications/verifyCheck/getOwnRealVerifications.js +66 -64
  163. package/dist/verifications/verifyCheck/getSomeoneElsesRealVerifications.d.ts +19 -19
  164. package/dist/verifications/verifyCheck/getSomeoneElsesRealVerifications.js +72 -72
  165. package/dist/verifications/verifyCheck/index.d.ts +3 -3
  166. package/dist/verifications/verifyCheck/index.js +21 -21
  167. package/dist/verifications/verifyCheck/operations/__tests__/checkOwnVerification.test.d.ts +1 -0
  168. package/dist/verifications/verifyCheck/operations/__tests__/checkOwnVerification.test.js +91 -0
  169. package/dist/verifications/verifyCheck/operations/__tests__/checkSomeoneElsesVerifications.test.d.ts +1 -0
  170. package/dist/verifications/verifyCheck/operations/__tests__/checkSomeoneElsesVerifications.test.js +49 -0
  171. package/dist/verifications/verifyCheck/operations/__tests__/sampleBundle.json +43 -0
  172. package/dist/verifications/verifyCheck/operations/checkOwnVerification.d.ts +15 -15
  173. package/dist/verifications/verifyCheck/operations/checkOwnVerification.js +39 -39
  174. package/dist/verifications/verifyCheck/operations/checkSomeoneElsesVerifications.d.ts +1 -1
  175. package/dist/verifications/verifyCheck/operations/checkSomeoneElsesVerifications.js +16 -16
  176. package/dist/verifications/verifyCheck/operations/index.d.ts +2 -2
  177. package/dist/verifications/verifyCheck/operations/index.js +18 -18
  178. package/package.json +13 -10
  179. package/dist/rules/helpers/getLhsTypeofValue.d.ts +0 -0
  180. package/dist/rules/helpers/getLhsTypeofValue.js +0 -1
  181. package/dist/rules/helpers/getValueFromPath.d.ts +0 -2
  182. package/dist/rules/helpers/getValueFromPath.js +0 -35
  183. package/dist/rules/helpers/rebuildInfiniteValues.d.ts +0 -3
  184. package/dist/rules/helpers/rebuildInfiniteValues.js +0 -6
  185. package/dist/rules/isScoreResultValid.d.ts +0 -2
  186. package/dist/rules/isScoreResultValid.js +0 -9
  187. package/dist/rules/operators/array.d.ts +0 -2
  188. package/dist/rules/operators/array.js +0 -74
  189. package/dist/rules/types/operators.d.ts +0 -19
  190. package/dist/rules/types/operators.js +0 -2
  191. package/dist/rules/types/score.d.ts +0 -50
  192. package/dist/rules/types/score.js +0 -2
  193. package/dist/util/conditional.d.ts +0 -7
  194. package/dist/util/conditional.js +0 -15
  195. package/dist/util/hash.js +0 -11
  196. package/dist/verifications/checkSingleVerification.d.ts +0 -9
  197. package/dist/verifications/checkSingleVerification.js +0 -29
  198. package/dist/verifications/checkVerifications.js +0 -16
  199. package/dist/verifications/checkVerificationsNew.js +0 -16
  200. package/dist/verifications/getOwnRealVerifications.d.ts +0 -14
  201. package/dist/verifications/getOwnRealVerifications.js +0 -64
  202. package/dist/verifications/getRealVerifications.d.ts +0 -22
  203. package/dist/verifications/getRealVerifications.js +0 -71
  204. package/dist/verifications/verifyCheck/util/canonicalJsonify.js +0 -48
  205. package/dist/verifications/verifyCheck/util/getValuesForAField.d.ts +0 -2
  206. package/dist/verifications/verifyCheck/util/getValuesForAField.js +0 -9
  207. package/dist/verifications/verifyCheck/util/index.d.ts +0 -2
  208. package/dist/verifications/verifyCheck/util/index.js +0 -14
@@ -1,33 +1,33 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.fieldOperators = void 0;
4
- exports.fieldOperators = {
5
- field_verifiedBy: {
6
- operands: ["HField", "Verifier"],
7
- implementation(field, verifiedBy) {
8
- return field.verifiedBy.includes(verifiedBy);
9
- },
10
- },
11
- field_shared: {
12
- operands: ["HField"],
13
- implementation: () => true, // we can return true, because if the field didn't exist, this would never be called
14
- },
15
- field_hasVerStatus: {
16
- operands: ["HField", "FieldVerification"],
17
- implementation(field, status) {
18
- return field.verification === status;
19
- },
20
- },
21
- field_cameFromSchema: {
22
- operands: ["HField", "String"],
23
- implementation(field, schemaName) {
24
- return field.cameFromSchema === schemaName;
25
- },
26
- },
27
- field_ncameFromSchema: {
28
- operands: ["HField", "String"],
29
- implementation(field, schemaName) {
30
- return field.cameFromSchema !== schemaName;
31
- },
32
- },
33
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fieldOperators = void 0;
4
+ exports.fieldOperators = {
5
+ field_verifiedBy: {
6
+ operands: ["HField", "Verifier"],
7
+ implementation(field, verifiedBy) {
8
+ return field.verifiedBy.includes(verifiedBy);
9
+ },
10
+ },
11
+ field_shared: {
12
+ operands: ["HField"],
13
+ implementation: () => true, // we can return true, because if the field didn't exist, this would never be called
14
+ },
15
+ field_hasVerStatus: {
16
+ operands: ["HField", "FieldVerification"],
17
+ implementation(field, status) {
18
+ return field.verification === status;
19
+ },
20
+ },
21
+ field_cameFromSchema: {
22
+ operands: ["HField", "String"],
23
+ implementation(field, schemaName) {
24
+ return field.cameFromSchema === schemaName;
25
+ },
26
+ },
27
+ field_ncameFromSchema: {
28
+ operands: ["HField", "String"],
29
+ implementation(field, schemaName) {
30
+ return field.cameFromSchema !== schemaName;
31
+ },
32
+ },
33
+ };
@@ -1,2 +1,2 @@
1
- import { OperatorID, OperatorDef } from "../types";
2
- export declare const schemaOperators: Partial<Record<OperatorID, OperatorDef>>;
1
+ import { OperatorID, OperatorDef } from "../types";
2
+ export declare const schemaOperators: Partial<Record<OperatorID, OperatorDef>>;
@@ -1,21 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.schemaOperators = void 0;
4
- exports.schemaOperators = {
5
- schema_verifiedBy: {
6
- operands: ["HSchema", "Verifier"],
7
- implementation(schema, verifiedBy) {
8
- return schema === null || schema === void 0 ? void 0 : schema.verifiedBy.includes(verifiedBy);
9
- },
10
- },
11
- schema_shared: {
12
- operands: ["HSchema"],
13
- implementation: () => true, // we can return true, because if the schema didn't exist, this would never be called
14
- },
15
- schema_hasVerStatus: {
16
- operands: ["HSchema", "POVerification"],
17
- implementation(schema, status) {
18
- return (schema === null || schema === void 0 ? void 0 : schema.verification) === status;
19
- },
20
- },
21
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.schemaOperators = void 0;
4
+ exports.schemaOperators = {
5
+ schema_verifiedBy: {
6
+ operands: ["HSchema", "Verifier"],
7
+ implementation(schema, verifiedBy) {
8
+ return schema === null || schema === void 0 ? void 0 : schema.verifiedBy.includes(verifiedBy);
9
+ },
10
+ },
11
+ schema_shared: {
12
+ operands: ["HSchema"],
13
+ implementation: () => true, // we can return true, because if the schema didn't exist, this would never be called
14
+ },
15
+ schema_hasVerStatus: {
16
+ operands: ["HSchema", "POVerification"],
17
+ implementation(schema, status) {
18
+ return (schema === null || schema === void 0 ? void 0 : schema.verification) === status;
19
+ },
20
+ },
21
+ };
@@ -1,3 +1,3 @@
1
- import { OperatorID, OperatorDef } from "../types";
2
- /** @ignore */
3
- export declare const operators: Record<OperatorID, OperatorDef>;
1
+ import { OperatorID, OperatorDef } from "../types";
2
+ /** @ignore */
3
+ export declare const operators: Record<OperatorID, OperatorDef>;
@@ -1,11 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.operators = void 0;
4
- const bool_1 = require("./bool");
5
- const date_1 = require("./date");
6
- const hfield_1 = require("./hfield");
7
- const hschema_1 = require("./hschema");
8
- const number_1 = require("./number");
9
- const string_1 = require("./string");
10
- /** @ignore */
11
- exports.operators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, bool_1.boolOperators), date_1.dateOperators), hfield_1.fieldOperators), hschema_1.schemaOperators), number_1.numberOperators), string_1.stringOperators);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.operators = void 0;
4
+ const bool_1 = require("./bool");
5
+ const date_1 = require("./date");
6
+ const hfield_1 = require("./hfield");
7
+ const hschema_1 = require("./hschema");
8
+ const number_1 = require("./number");
9
+ const string_1 = require("./string");
10
+ /** @ignore */
11
+ exports.operators = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, bool_1.boolOperators), date_1.dateOperators), hfield_1.fieldOperators), hschema_1.schemaOperators), number_1.numberOperators), string_1.stringOperators);
@@ -1,2 +1,2 @@
1
- import { OperatorID, OperatorDef } from "../types";
2
- export declare const numberOperators: Partial<Record<OperatorID, OperatorDef>>;
1
+ import { OperatorID, OperatorDef } from "../types";
2
+ export declare const numberOperators: Partial<Record<OperatorID, OperatorDef>>;
@@ -1,41 +1,41 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.numberOperators = void 0;
4
- exports.numberOperators = {
5
- num_eq: {
6
- operands: ["Number", "Number"],
7
- implementation(n1, n2) {
8
- return n1 === n2;
9
- },
10
- },
11
- num_neq: {
12
- operands: ["Number", "Number"],
13
- implementation(n1, n2) {
14
- return n1 !== n2;
15
- },
16
- },
17
- num_gt_eq: {
18
- operands: ["Number", "Number"],
19
- implementation(n1, n2) {
20
- return n1 >= n2;
21
- },
22
- },
23
- num_lt_eq: {
24
- operands: ["Number", "Number"],
25
- implementation(n1, n2) {
26
- return n1 <= n2;
27
- },
28
- },
29
- num_gt: {
30
- operands: ["Number", "Number"],
31
- implementation(n1, n2) {
32
- return n1 > n2;
33
- },
34
- },
35
- num_lt: {
36
- operands: ["Number", "Number"],
37
- implementation(n1, n2) {
38
- return n1 < n2;
39
- },
40
- },
41
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.numberOperators = void 0;
4
+ exports.numberOperators = {
5
+ num_eq: {
6
+ operands: ["Number", "Number"],
7
+ implementation(n1, n2) {
8
+ return n1 === n2;
9
+ },
10
+ },
11
+ num_neq: {
12
+ operands: ["Number", "Number"],
13
+ implementation(n1, n2) {
14
+ return n1 !== n2;
15
+ },
16
+ },
17
+ num_gt_eq: {
18
+ operands: ["Number", "Number"],
19
+ implementation(n1, n2) {
20
+ return n1 >= n2;
21
+ },
22
+ },
23
+ num_lt_eq: {
24
+ operands: ["Number", "Number"],
25
+ implementation(n1, n2) {
26
+ return n1 <= n2;
27
+ },
28
+ },
29
+ num_gt: {
30
+ operands: ["Number", "Number"],
31
+ implementation(n1, n2) {
32
+ return n1 > n2;
33
+ },
34
+ },
35
+ num_lt: {
36
+ operands: ["Number", "Number"],
37
+ implementation(n1, n2) {
38
+ return n1 < n2;
39
+ },
40
+ },
41
+ };
@@ -1,2 +1,2 @@
1
- import { OperatorID, OperatorDef } from "../types";
2
- export declare const stringOperators: Partial<Record<OperatorID, OperatorDef>>;
1
+ import { OperatorID, OperatorDef } from "../types";
2
+ export declare const stringOperators: Partial<Record<OperatorID, OperatorDef>>;
@@ -1,58 +1,58 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stringOperators = void 0;
4
- // also string operators are case-insensitive
5
- exports.stringOperators = {
6
- string_eq: {
7
- operands: ["String", "String"],
8
- implementation(s1, s2) {
9
- return s1.toLowerCase() === s2.toLowerCase();
10
- },
11
- },
12
- string_neq: {
13
- operands: ["String", "String"],
14
- implementation(s1, s2) {
15
- return s1.toLowerCase() !== s2.toLowerCase();
16
- },
17
- },
18
- string_contains: {
19
- operands: ["String", "String"],
20
- implementation(s1, s2) {
21
- return s1.toLowerCase().includes(s2.toLowerCase());
22
- },
23
- },
24
- string_ncontains: {
25
- operands: ["String", "String"],
26
- implementation(s1, s2) {
27
- return !s1.toLowerCase().includes(s2.toLowerCase());
28
- },
29
- },
30
- string_startsWith: {
31
- operands: ["String", "String"],
32
- implementation(s1, s2) {
33
- return s1.toLowerCase().startsWith(s2.toLowerCase());
34
- },
35
- },
36
- string_nstartsWith: {
37
- operands: ["String", "String"],
38
- implementation(s1, s2) {
39
- return !s1.toLowerCase().startsWith(s2.toLowerCase());
40
- },
41
- },
42
- string_endsWith: {
43
- operands: ["String", "String"],
44
- implementation(s1, s2) {
45
- return s1.toLowerCase().endsWith(s2.toLowerCase());
46
- },
47
- },
48
- string_nendsWith: {
49
- operands: ["String", "String"],
50
- implementation(s1, s2) {
51
- return !s1.toLowerCase().endsWith(s2.toLowerCase());
52
- },
53
- },
54
- string_regex: {
55
- operands: ["String", "RegEx"],
56
- implementation: (str, regEx) => !!str.match(regEx),
57
- },
58
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stringOperators = void 0;
4
+ // also string operators are case-insensitive
5
+ exports.stringOperators = {
6
+ string_eq: {
7
+ operands: ["String", "String"],
8
+ implementation(s1, s2) {
9
+ return s1.toLowerCase() === s2.toLowerCase();
10
+ },
11
+ },
12
+ string_neq: {
13
+ operands: ["String", "String"],
14
+ implementation(s1, s2) {
15
+ return s1.toLowerCase() !== s2.toLowerCase();
16
+ },
17
+ },
18
+ string_contains: {
19
+ operands: ["String", "String"],
20
+ implementation(s1, s2) {
21
+ return s1.toLowerCase().includes(s2.toLowerCase());
22
+ },
23
+ },
24
+ string_ncontains: {
25
+ operands: ["String", "String"],
26
+ implementation(s1, s2) {
27
+ return !s1.toLowerCase().includes(s2.toLowerCase());
28
+ },
29
+ },
30
+ string_startsWith: {
31
+ operands: ["String", "String"],
32
+ implementation(s1, s2) {
33
+ return s1.toLowerCase().startsWith(s2.toLowerCase());
34
+ },
35
+ },
36
+ string_nstartsWith: {
37
+ operands: ["String", "String"],
38
+ implementation(s1, s2) {
39
+ return !s1.toLowerCase().startsWith(s2.toLowerCase());
40
+ },
41
+ },
42
+ string_endsWith: {
43
+ operands: ["String", "String"],
44
+ implementation(s1, s2) {
45
+ return s1.toLowerCase().endsWith(s2.toLowerCase());
46
+ },
47
+ },
48
+ string_nendsWith: {
49
+ operands: ["String", "String"],
50
+ implementation(s1, s2) {
51
+ return !s1.toLowerCase().endsWith(s2.toLowerCase());
52
+ },
53
+ },
54
+ string_regex: {
55
+ operands: ["String", "RegEx"],
56
+ implementation: (str, regEx) => !!str.match(regEx),
57
+ },
58
+ };
@@ -1,91 +1,95 @@
1
- import { GetTSType } from "./dataValueTypes";
2
- /**
3
- * @ignore
4
- * these are just IDs, the string is never parsed by anything.
5
- *
6
- * However, since they're saved into the WizardConfig schema,
7
- * we can't just rename or remove any, since that would break
8
- * existing rules.
9
- */
10
- export declare type OperatorID = "bool_eq" | "bool_neq" | "num_eq" | "num_neq" | "num_lt_eq" | "num_gt_eq" | "num_lt" | "num_gt" | "date_valid" | "date_invalid" | "date_before" | "date_after" | "date_eq" | "date_neq" | "date_older_than" | "date_newer_than" | "date_between" | "string_eq" | "string_neq" | "string_contains" | "string_ncontains" | "string_startsWith" | "string_nstartsWith" | "string_endsWith" | "string_nendsWith" | "string_regex" | "field_verifiedBy" | "field_shared" | "field_hasVerStatus" | "field_cameFromSchema" | "field_ncameFromSchema" | "schema_verifiedBy" | "schema_shared" | "schema_hasVerStatus";
11
- /** @ignore */
12
- export declare type ValuePathFieldProp = "meta" | "value" | "valueLength" | `subField|${string}`;
13
- /** @ignore */
14
- export declare type ValuePath = [type: "schema", schemaName: string, prop: "meta"] | [
15
- type: "field",
16
- schemaName: string,
17
- fieldName: string,
18
- prop: ValuePathFieldProp
19
- ];
20
- /** @ignore */
21
- export declare type ValueRefConst<T> = {
22
- type: "constant";
23
- value: T;
24
- };
25
- /** @ignore */
26
- export declare type ValueRefVar = {
27
- type: "variable";
28
- path: ValuePath;
29
- };
30
- /** @ignore */
31
- export declare type ValueRef<T> = ValueRefConst<T> | ValueRefVar;
32
- /** @ignore these are the LHS & RHS operands which come from variables (or constants) */
33
- export declare type FieldValueTypes = "Bool" | "Number" | "String" | "Date" | "Array" | "HField" | "HSchema";
34
- /** @ignore these are the RHS-only operands which come from constants ONLY */
35
- export declare type ConstValueTypes = "DateUnit" | "RegEx" | "Verifier" | "FieldVerification" | "POVerification";
36
- /** @ignore full list of operands which come from variables OR constants */
37
- export declare type ValueType = ConstValueTypes | FieldValueTypes;
38
- /** @ignore */
39
- export declare type ValueDef<T = ValueType> = {
40
- type: T;
41
- value: ValueRef<GetTSType<T>>;
42
- };
43
- /** @ignore */
44
- export declare type ASTScoreConditionNode = {
45
- type: "ScoreCondition";
46
- operator: OperatorID;
47
- values: ValueDef<ValueType>[];
48
- };
49
- /** @ignore */
50
- export declare type ASTLanguageOperatorNode = {
51
- type: "LanguageOperator";
52
- operator: "OR" | "AND";
53
- children: ASTNode[];
54
- };
55
- /** @ignore */
56
- export declare type ASTNode = ASTLanguageOperatorNode | ASTScoreConditionNode;
57
- /** @ignore */
58
- export declare type ScoreRule = {
59
- /** user defined */
60
- name: string;
61
- /** user defined */
62
- description?: string;
63
- /** must be an integer */
64
- trueWeight: number;
65
- /** must be an integer */
66
- falseWeight: number;
67
- /** must have a single root node */
68
- tree: [ASTNode];
69
- };
70
- /** @ignore e.g. 0-10 is "red". We only work with integers. Comparisons use >= and <= */
71
- export declare type ScoreThreshold = {
72
- from: number;
73
- to: number;
74
- name: string;
75
- /**
76
- * A hex code, including the hash.
77
- * For compatibility reasons we must assume it could be missing
78
- */
79
- colour: string | undefined;
80
- };
81
- /** @ignore */
82
- export declare type Combinator = "+" | "*";
83
- /**
84
- * @ignore
85
- * the big object for configuring score rules
86
- */
87
- export declare type ScoreConfig = {
88
- combinator: Combinator;
89
- scoreThresholds: ScoreThreshold[];
90
- rules: ScoreRule[];
91
- };
1
+ import { GetTSType } from "./dataValueTypes";
2
+ /**
3
+ * @ignore
4
+ * these are just IDs, the string is never parsed by anything.
5
+ *
6
+ * However, since they're saved into the WizardConfig schema,
7
+ * we can't just rename or remove any, since that would break
8
+ * existing rules.
9
+ */
10
+ export type OperatorID = "bool_eq" | "bool_neq" | "num_eq" | "num_neq" | "num_lt_eq" | "num_gt_eq" | "num_lt" | "num_gt" | "date_valid" | "date_invalid" | "date_before" | "date_after" | "date_eq" | "date_neq" | "date_older_than" | "date_newer_than" | "date_between" | "string_eq" | "string_neq" | "string_contains" | "string_ncontains" | "string_startsWith" | "string_nstartsWith" | "string_endsWith" | "string_nendsWith" | "string_regex" | "field_verifiedBy" | "field_shared" | "field_hasVerStatus" | "field_cameFromSchema" | "field_ncameFromSchema" | "schema_verifiedBy" | "schema_shared" | "schema_hasVerStatus";
11
+ /** @ignore */
12
+ export type ValuePathFieldProp = "meta" | "value" | "valueLength" | `subField|${string}`;
13
+ /** @ignore */
14
+ export type ValuePath = [type: "schema", schemaName: string, prop: "meta"] | [
15
+ type: "field",
16
+ schemaName: string,
17
+ fieldName: string,
18
+ prop: ValuePathFieldProp
19
+ ];
20
+ /** @ignore */
21
+ export type ValueRefConst<T> = {
22
+ type: "constant";
23
+ value: T;
24
+ };
25
+ /** @ignore */
26
+ export type ValueRefVar = {
27
+ type: "variable";
28
+ path: ValuePath;
29
+ };
30
+ /** @ignore */
31
+ export type ValueRef<T> = ValueRefConst<T> | ValueRefVar;
32
+ /** @ignore these are the LHS & RHS operands which come from variables (or constants) */
33
+ export type FieldValueTypes = "Bool" | "Number" | "String" | "Date" | "Array" | "HField" | "HSchema";
34
+ /** @ignore these are the RHS-only operands which come from constants ONLY */
35
+ export type ConstValueTypes = "DateUnit" | "RegEx" | "Verifier" | "FieldVerification" | "POVerification";
36
+ /** @ignore full list of operands which come from variables OR constants */
37
+ export type ValueType = ConstValueTypes | FieldValueTypes;
38
+ /** @ignore */
39
+ export type ValueDef<T = ValueType> = {
40
+ type: T;
41
+ value: ValueRef<GetTSType<T>>;
42
+ };
43
+ /** @ignore */
44
+ export type ASTScoreConditionNode = {
45
+ type: "ScoreCondition";
46
+ operator: OperatorID;
47
+ values: ValueDef<ValueType>[];
48
+ };
49
+ /** @ignore */
50
+ export type ASTLanguageOperatorNode = {
51
+ type: "LanguageOperator";
52
+ operator: "OR" | "AND";
53
+ children: ASTNode[];
54
+ };
55
+ /** @ignore */
56
+ export type ASTNode = ASTLanguageOperatorNode | ASTScoreConditionNode;
57
+ /** @ignore */
58
+ export type ScoreRule = {
59
+ /** UUID for the rule. Configs created before Feb 2023 won't have this field */
60
+ id: string | undefined;
61
+ /** user defined */
62
+ name: string;
63
+ /** user defined */
64
+ description?: string;
65
+ /** must be an integer */
66
+ trueWeight: number;
67
+ /** must be an integer */
68
+ falseWeight: number;
69
+ /** must have a single root node */
70
+ tree: [ASTNode];
71
+ /** if undefined, assume true. Configs created before Feb 2023 won't have this field */
72
+ enabled: boolean | undefined;
73
+ };
74
+ /** @ignore e.g. 0-10 is "red". We only work with integers. Comparisons use >= and <= */
75
+ export type ScoreThreshold = {
76
+ from: number;
77
+ to: number;
78
+ name: string;
79
+ /**
80
+ * A hex code, including the hash.
81
+ * For compatibility reasons we must assume it could be missing
82
+ */
83
+ colour: string | undefined;
84
+ };
85
+ /** @ignore */
86
+ export type Combinator = "+" | "*";
87
+ /**
88
+ * @ignore
89
+ * the big object for configuring score rules
90
+ */
91
+ export type ScoreConfig = {
92
+ combinator: Combinator;
93
+ scoreThresholds: ScoreThreshold[];
94
+ rules: ScoreRule[];
95
+ };
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,19 +1,19 @@
1
- import { FieldVerification, NId, POVerification } from "@raytio/types";
2
- import type { HFieldSymbol, HSchemaSymbol } from "../helpers";
3
- /** undefined if not shared */
4
- export declare type HField = {
5
- __typeof__: typeof HFieldSymbol;
6
- verification: FieldVerification;
7
- verifiedBy: readonly NId[];
8
- /** schemaName */
9
- cameFromSchema: string;
10
- };
11
- /** undefined if not shared */
12
- export declare type HSchema = {
13
- __typeof__: typeof HSchemaSymbol;
14
- verification?: POVerification;
15
- verifiedBy: readonly NId[];
16
- };
17
- export declare const DATE_UNITS: readonly ["ms", "s", "m", "h", "D", "M", "W", "Y"];
18
- export declare type DateUnit = typeof DATE_UNITS[number];
19
- export declare type GetTSType<T> = T extends "Bool" ? boolean : T extends "Number" ? number : T extends "String" ? string : T extends "Date" ? Date : T extends "Array" ? unknown[] : T extends "HField" ? HField : T extends "HSchema" ? HSchema : T extends "DateUnit" ? DateUnit : T extends "RegEx" ? RegExp : T extends "Verifier" ? NId : T extends "FieldVerification" ? FieldVerification : T extends "POVerification" ? POVerification : never;
1
+ import { FieldVerification, NId, POVerification } from "@raytio/types";
2
+ import type { HFieldSymbol, HSchemaSymbol } from "../helpers";
3
+ /** undefined if not shared */
4
+ export type HField = {
5
+ __typeof__: typeof HFieldSymbol;
6
+ verification: FieldVerification;
7
+ verifiedBy: readonly NId[];
8
+ /** schemaName */
9
+ cameFromSchema: string;
10
+ };
11
+ /** undefined if not shared */
12
+ export type HSchema = {
13
+ __typeof__: typeof HSchemaSymbol;
14
+ verification?: POVerification;
15
+ verifiedBy: readonly NId[];
16
+ };
17
+ export declare const DATE_UNITS: readonly ["ms", "s", "m", "h", "D", "M", "W", "Y"];
18
+ export type DateUnit = (typeof DATE_UNITS)[number];
19
+ export type GetTSType<T> = T extends "Bool" ? boolean : T extends "Number" ? number : T extends "String" ? string : T extends "Date" ? Date : T extends "Array" ? unknown[] : T extends "HField" ? HField : T extends "HSchema" ? HSchema : T extends "DateUnit" ? DateUnit : T extends "RegEx" ? RegExp : T extends "Verifier" ? NId : T extends "FieldVerification" ? FieldVerification : T extends "POVerification" ? POVerification : never;
@@ -1,4 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DATE_UNITS = void 0;
4
- exports.DATE_UNITS = ["ms", "s", "m", "h", "D", "M", "W", "Y"];
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DATE_UNITS = void 0;
4
+ exports.DATE_UNITS = ["ms", "s", "m", "h", "D", "M", "W", "Y"];
@@ -1,3 +1,3 @@
1
- export * from "./dataValueTypes";
2
- export * from "./config";
3
- export * from "./internal";
1
+ export * from "./dataValueTypes";
2
+ export * from "./config";
3
+ export * from "./internal";