@degenerate/rules 0.1.2 → 0.1.3

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 (322) hide show
  1. package/dist/generic/src/_settings/cryptography-settings.d.ts +27 -0
  2. package/dist/generic/src/_settings/cryptography-settings.d.ts.map +1 -0
  3. package/dist/generic/src/_settings/cryptography-settings.js +27 -0
  4. package/dist/generic/src/crypto/calculate-combined-hash.d.ts +13 -0
  5. package/dist/generic/src/crypto/calculate-combined-hash.d.ts.map +1 -0
  6. package/dist/generic/src/crypto/calculate-combined-hash.js +44 -0
  7. package/dist/generic/src/crypto/calculate-hash.d.ts +7 -0
  8. package/dist/generic/src/crypto/calculate-hash.d.ts.map +1 -0
  9. package/dist/generic/src/crypto/calculate-hash.js +37 -0
  10. package/dist/generic/src/crypto/index.d.ts +13 -0
  11. package/dist/generic/src/crypto/index.d.ts.map +1 -0
  12. package/dist/generic/src/crypto/index.js +34 -0
  13. package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-mnemonic.d.ts +12 -0
  14. package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-mnemonic.d.ts.map +1 -0
  15. package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-mnemonic.js +44 -0
  16. package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-private-key.d.ts +11 -0
  17. package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-private-key.d.ts.map +1 -0
  18. package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-private-key.js +40 -0
  19. package/dist/generic/src/crypto/private-public-keys/generation/create-256-private-key-from-mnemonic.d.ts +11 -0
  20. package/dist/generic/src/crypto/private-public-keys/generation/create-256-private-key-from-mnemonic.d.ts.map +1 -0
  21. package/dist/generic/src/crypto/private-public-keys/generation/create-256-private-key-from-mnemonic.js +45 -0
  22. package/dist/generic/src/crypto/private-public-keys/generation/create-entropy-for-elliptical-curve.d.ts +10 -0
  23. package/dist/generic/src/crypto/private-public-keys/generation/create-entropy-for-elliptical-curve.d.ts.map +1 -0
  24. package/dist/generic/src/crypto/private-public-keys/generation/create-entropy-for-elliptical-curve.js +40 -0
  25. package/dist/generic/src/crypto/private-public-keys/generation/create-random-256-private-key.d.ts +8 -0
  26. package/dist/generic/src/crypto/private-public-keys/generation/create-random-256-private-key.d.ts.map +1 -0
  27. package/dist/generic/src/crypto/private-public-keys/generation/create-random-256-private-key.js +41 -0
  28. package/dist/generic/src/crypto/private-public-keys/generation/generate-key-pair.d.ts +11 -0
  29. package/dist/generic/src/crypto/private-public-keys/generation/generate-key-pair.d.ts.map +1 -0
  30. package/dist/generic/src/crypto/private-public-keys/generation/generate-key-pair.js +39 -0
  31. package/dist/generic/src/crypto/private-public-keys/generation/get-private-public-key-from-keypair.d.ts +15 -0
  32. package/dist/generic/src/crypto/private-public-keys/generation/get-private-public-key-from-keypair.d.ts.map +1 -0
  33. package/dist/generic/src/crypto/private-public-keys/generation/get-private-public-key-from-keypair.js +21 -0
  34. package/dist/generic/src/crypto/signature/create-crypto-signature.d.ts +9 -0
  35. package/dist/generic/src/crypto/signature/create-crypto-signature.d.ts.map +1 -0
  36. package/dist/generic/src/crypto/signature/create-crypto-signature.js +13 -0
  37. package/dist/generic/src/crypto/signature/verify-crypto-signature-by-data.d.ts +13 -0
  38. package/dist/generic/src/crypto/signature/verify-crypto-signature-by-data.d.ts.map +1 -0
  39. package/dist/generic/src/crypto/signature/verify-crypto-signature-by-data.js +45 -0
  40. package/dist/generic/src/crypto/signature/verify-crypto-signature-by-hash.d.ts +13 -0
  41. package/dist/generic/src/crypto/signature/verify-crypto-signature-by-hash.d.ts.map +1 -0
  42. package/dist/generic/src/crypto/signature/verify-crypto-signature-by-hash.js +42 -0
  43. package/dist/generic/src/errors/audit-log/audit-log-errors.d.ts +20 -0
  44. package/dist/generic/src/errors/audit-log/audit-log-errors.d.ts.map +1 -0
  45. package/dist/generic/src/errors/audit-log/audit-log-errors.js +31 -0
  46. package/dist/generic/src/errors/base-error.d.ts +23 -0
  47. package/dist/generic/src/errors/base-error.d.ts.map +1 -0
  48. package/dist/generic/src/errors/base-error.js +34 -0
  49. package/dist/generic/src/errors/database/database-errors.d.ts +24 -0
  50. package/dist/generic/src/errors/database/database-errors.d.ts.map +1 -0
  51. package/dist/generic/src/errors/database/database-errors.js +33 -0
  52. package/dist/generic/src/errors/generic/generic-errors.d.ts +35 -0
  53. package/dist/generic/src/errors/generic/generic-errors.d.ts.map +1 -0
  54. package/dist/generic/src/errors/generic/generic-errors.js +47 -0
  55. package/dist/generic/src/errors/index.d.ts +9 -0
  56. package/dist/generic/src/errors/index.d.ts.map +1 -0
  57. package/dist/generic/src/errors/index.js +25 -0
  58. package/dist/generic/src/errors/request/request-errors.d.ts +89 -0
  59. package/dist/generic/src/errors/request/request-errors.d.ts.map +1 -0
  60. package/dist/generic/src/errors/request/request-errors.js +120 -0
  61. package/dist/generic/src/errors/safe/safe-rules-errors.d.ts +102 -0
  62. package/dist/generic/src/errors/safe/safe-rules-errors.d.ts.map +1 -0
  63. package/dist/generic/src/errors/safe/safe-rules-errors.js +152 -0
  64. package/dist/generic/src/errors/scheduler/scheduler-errors.d.ts +8 -0
  65. package/dist/generic/src/errors/scheduler/scheduler-errors.d.ts.map +1 -0
  66. package/dist/generic/src/errors/scheduler/scheduler-errors.js +14 -0
  67. package/dist/generic/src/errors/share-data/share-data-errors.d.ts +67 -0
  68. package/dist/generic/src/errors/share-data/share-data-errors.d.ts.map +1 -0
  69. package/dist/generic/src/errors/share-data/share-data-errors.js +92 -0
  70. package/dist/generic/src/helpers/array/array-helpers.d.ts +16 -0
  71. package/dist/generic/src/helpers/array/array-helpers.d.ts.map +1 -0
  72. package/dist/generic/src/helpers/array/array-helpers.js +25 -0
  73. package/dist/generic/src/helpers/data/data-helpers.d.ts +46 -0
  74. package/dist/generic/src/helpers/data/data-helpers.d.ts.map +1 -0
  75. package/dist/generic/src/helpers/data/data-helpers.js +106 -0
  76. package/dist/generic/src/helpers/file/file-helpers.d.ts +13 -0
  77. package/dist/generic/src/helpers/file/file-helpers.d.ts.map +1 -0
  78. package/dist/generic/src/helpers/file/file-helpers.js +43 -0
  79. package/dist/generic/src/helpers/id-helpers.d.ts +8 -0
  80. package/dist/generic/src/helpers/id-helpers.d.ts.map +1 -0
  81. package/dist/generic/src/helpers/id-helpers.js +19 -0
  82. package/dist/generic/src/helpers/index.d.ts +11 -0
  83. package/dist/generic/src/helpers/index.d.ts.map +1 -0
  84. package/dist/generic/src/helpers/index.js +31 -0
  85. package/dist/generic/src/helpers/lodash/lodash-helpers.d.ts +14 -0
  86. package/dist/generic/src/helpers/lodash/lodash-helpers.d.ts.map +1 -0
  87. package/dist/generic/src/helpers/lodash/lodash-helpers.js +28 -0
  88. package/dist/generic/src/helpers/object-helpers.d.ts +23 -0
  89. package/dist/generic/src/helpers/object-helpers.d.ts.map +1 -0
  90. package/dist/generic/src/helpers/object-helpers.js +54 -0
  91. package/dist/generic/src/helpers/object-validation-helpers.d.ts +59 -0
  92. package/dist/generic/src/helpers/object-validation-helpers.d.ts.map +1 -0
  93. package/dist/generic/src/helpers/object-validation-helpers.js +233 -0
  94. package/dist/generic/src/helpers/request/params-object-helpers.d.ts +38 -0
  95. package/dist/generic/src/helpers/request/params-object-helpers.d.ts.map +1 -0
  96. package/dist/generic/src/helpers/request/params-object-helpers.js +54 -0
  97. package/dist/generic/src/helpers/request/query-object-helpers.d.ts +12 -0
  98. package/dist/generic/src/helpers/request/query-object-helpers.d.ts.map +1 -0
  99. package/dist/generic/src/helpers/request/query-object-helpers.js +25 -0
  100. package/dist/generic/src/helpers/request/request-object-helpers.d.ts +19 -0
  101. package/dist/generic/src/helpers/request/request-object-helpers.d.ts.map +1 -0
  102. package/dist/generic/src/helpers/request/request-object-helpers.js +28 -0
  103. package/dist/generic/src/index.d.ts +6 -0
  104. package/dist/generic/src/index.d.ts.map +1 -0
  105. package/dist/generic/src/index.js +23 -0
  106. package/dist/generic/src/models/data/data-models.d.ts +24 -0
  107. package/dist/generic/src/models/data/data-models.d.ts.map +1 -0
  108. package/dist/generic/src/models/data/data-models.js +3 -0
  109. package/dist/generic/src/models/dynamic-execution/dynamic-execution-models.d.ts +9 -0
  110. package/dist/generic/src/models/dynamic-execution/dynamic-execution-models.d.ts.map +1 -0
  111. package/dist/generic/src/models/dynamic-execution/dynamic-execution-models.js +2 -0
  112. package/dist/generic/src/models/events/share-event-models.d.ts +65 -0
  113. package/dist/generic/src/models/events/share-event-models.d.ts.map +1 -0
  114. package/dist/generic/src/models/events/share-event-models.js +70 -0
  115. package/dist/generic/src/models/functions/share-data-function-models.d.ts +86 -0
  116. package/dist/generic/src/models/functions/share-data-function-models.d.ts.map +1 -0
  117. package/dist/generic/src/models/functions/share-data-function-models.js +17 -0
  118. package/dist/generic/src/models/generic/request-response-models.d.ts +8 -0
  119. package/dist/generic/src/models/generic/request-response-models.d.ts.map +1 -0
  120. package/dist/generic/src/models/generic/request-response-models.js +2 -0
  121. package/dist/generic/src/models/index.d.ts +8 -0
  122. package/dist/generic/src/models/index.d.ts.map +1 -0
  123. package/dist/generic/src/models/index.js +24 -0
  124. package/dist/generic/src/models/rules/share-rule-models.d.ts +303 -0
  125. package/dist/generic/src/models/rules/share-rule-models.d.ts.map +1 -0
  126. package/dist/generic/src/models/rules/share-rule-models.js +93 -0
  127. package/dist/generic/src/models/share-data/share-data.d.ts +55 -0
  128. package/dist/generic/src/models/share-data/share-data.d.ts.map +1 -0
  129. package/dist/generic/src/models/share-data/share-data.js +19 -0
  130. package/dist/rules/src/__testdata__/conditions/current-conditions.test-data.d.ts.map +1 -0
  131. package/dist/{__testdata__ → rules/src/__testdata__}/conditions/current-conditions.test-data.js +5 -5
  132. package/dist/{__testdata__ → rules/src/__testdata__}/rules/rules.test-data.d.ts +8 -5
  133. package/dist/rules/src/__testdata__/rules/rules.test-data.d.ts.map +1 -0
  134. package/dist/rules/src/__testdata__/rules/rules.test-data.js +390 -0
  135. package/dist/rules/src/create/conditions/create-boolean-conditions.d.ts.map +1 -0
  136. package/dist/rules/src/create/conditions/create-contains-conditions.d.ts.map +1 -0
  137. package/dist/rules/src/create/conditions/create-empty-conditions.d.ts.map +1 -0
  138. package/dist/rules/src/create/conditions/create-equality-conditions.d.ts.map +1 -0
  139. package/dist/rules/src/create/conditions/create-null-conditions.d.ts.map +1 -0
  140. package/dist/rules/src/create/conditions/create-range-conditions.d.ts.map +1 -0
  141. package/dist/rules/src/create/conditions/create-special-conditions.d.ts.map +1 -0
  142. package/dist/rules/src/create/conditions/create-starts-end-with-conditions.d.ts.map +1 -0
  143. package/dist/rules/src/create/conditions/create-typeof-conditions.d.ts.map +1 -0
  144. package/dist/rules/src/create/create-share-rule-applied.d.ts.map +1 -0
  145. package/dist/rules/src/create/create-share-rule-group.d.ts +11 -0
  146. package/dist/rules/src/create/create-share-rule-group.d.ts.map +1 -0
  147. package/dist/rules/src/create/create-share-rule-group.js +16 -0
  148. package/dist/rules/src/create/create-share-rule-id.d.ts.map +1 -0
  149. package/dist/rules/src/create/create-share-rule-set.d.ts +13 -0
  150. package/dist/rules/src/create/create-share-rule-set.d.ts.map +1 -0
  151. package/dist/rules/src/create/create-share-rule-set.js +37 -0
  152. package/dist/rules/src/create/create-share-rule.d.ts.map +1 -0
  153. package/dist/{create → rules/src/create}/index.d.ts +2 -0
  154. package/dist/rules/src/create/index.d.ts.map +1 -0
  155. package/dist/{create → rules/src/create}/index.js +2 -0
  156. package/dist/rules/src/evaluation/check-function-integrity.d.ts.map +1 -0
  157. package/dist/rules/src/evaluation/check-if-proposal-is-valid.d.ts.map +1 -0
  158. package/dist/rules/src/evaluation/conditions/boolean-conditions.d.ts.map +1 -0
  159. package/dist/rules/src/evaluation/conditions/contains-conditions.d.ts.map +1 -0
  160. package/dist/rules/src/evaluation/conditions/empty-conditions.d.ts.map +1 -0
  161. package/dist/rules/src/evaluation/conditions/equality-conditions.d.ts.map +1 -0
  162. package/dist/rules/src/evaluation/conditions/null-conditions.d.ts.map +1 -0
  163. package/dist/rules/src/evaluation/conditions/range-conditions.d.ts.map +1 -0
  164. package/dist/rules/src/evaluation/conditions/special-conditions.d.ts.map +1 -0
  165. package/dist/rules/src/evaluation/conditions/starts-end-with-conditions.d.ts.map +1 -0
  166. package/dist/rules/src/evaluation/conditions/typeof-conditions.d.ts.map +1 -0
  167. package/dist/rules/src/evaluation/determine-if-data-has-changed.d.ts.map +1 -0
  168. package/dist/rules/src/evaluation/evaluate-rule-conditions.d.ts.map +1 -0
  169. package/dist/rules/src/evaluation/evaluate-rule.d.ts.map +1 -0
  170. package/dist/rules/src/evaluation/evaluate-rules.d.ts.map +1 -0
  171. package/dist/rules/src/evaluation/get-data-changed-information.d.ts.map +1 -0
  172. package/dist/rules/src/evaluation/get-root-property-results.d.ts.map +1 -0
  173. package/dist/rules/src/evaluation/index.d.ts.map +1 -0
  174. package/dist/rules/src/evaluation/start-rule-evaluation.d.ts.map +1 -0
  175. package/dist/rules/src/index.d.ts.map +1 -0
  176. package/dist/rules/src/validation/conditions/validate-condition-base.d.ts +9 -0
  177. package/dist/rules/src/validation/conditions/validate-condition-base.d.ts.map +1 -0
  178. package/dist/rules/src/validation/conditions/validate-condition-base.js +29 -0
  179. package/dist/rules/src/validation/conditions/validate-condition-boolean.d.ts +10 -0
  180. package/dist/rules/src/validation/conditions/validate-condition-boolean.d.ts.map +1 -0
  181. package/dist/rules/src/validation/conditions/validate-condition-boolean.js +26 -0
  182. package/dist/rules/src/validation/conditions/validate-condition-contains.d.ts +10 -0
  183. package/dist/rules/src/validation/conditions/validate-condition-contains.d.ts.map +1 -0
  184. package/dist/rules/src/validation/conditions/validate-condition-contains.js +44 -0
  185. package/dist/rules/src/validation/conditions/validate-condition-empty.d.ts +10 -0
  186. package/dist/rules/src/validation/conditions/validate-condition-empty.d.ts.map +1 -0
  187. package/dist/rules/src/validation/conditions/validate-condition-empty.js +23 -0
  188. package/dist/rules/src/validation/conditions/validate-condition-equality.d.ts +10 -0
  189. package/dist/rules/src/validation/conditions/validate-condition-equality.d.ts.map +1 -0
  190. package/dist/rules/src/validation/conditions/validate-condition-equality.js +26 -0
  191. package/dist/rules/src/validation/conditions/validate-condition-null.d.ts +10 -0
  192. package/dist/rules/src/validation/conditions/validate-condition-null.d.ts.map +1 -0
  193. package/dist/rules/src/validation/conditions/validate-condition-null.js +23 -0
  194. package/dist/rules/src/validation/conditions/validate-condition-qualifier.d.ts +9 -0
  195. package/dist/rules/src/validation/conditions/validate-condition-qualifier.d.ts.map +1 -0
  196. package/dist/rules/src/validation/conditions/validate-condition-qualifier.js +19 -0
  197. package/dist/rules/src/validation/conditions/validate-condition-range.d.ts +9 -0
  198. package/dist/rules/src/validation/conditions/validate-condition-range.d.ts.map +1 -0
  199. package/dist/rules/src/validation/conditions/validate-condition-range.js +35 -0
  200. package/dist/rules/src/validation/conditions/validate-condition-share-rule.d.ts +10 -0
  201. package/dist/rules/src/validation/conditions/validate-condition-share-rule.d.ts.map +1 -0
  202. package/dist/rules/src/validation/conditions/validate-condition-share-rule.js +34 -0
  203. package/dist/rules/src/validation/conditions/validate-condition-special.d.ts +10 -0
  204. package/dist/rules/src/validation/conditions/validate-condition-special.d.ts.map +1 -0
  205. package/dist/rules/src/validation/conditions/validate-condition-special.js +30 -0
  206. package/dist/rules/src/validation/conditions/validate-condition-starts-ends-with.d.ts +10 -0
  207. package/dist/rules/src/validation/conditions/validate-condition-starts-ends-with.d.ts.map +1 -0
  208. package/dist/rules/src/validation/conditions/validate-condition-starts-ends-with.js +31 -0
  209. package/dist/rules/src/validation/conditions/validate-condition-type-of.d.ts +10 -0
  210. package/dist/rules/src/validation/conditions/validate-condition-type-of.d.ts.map +1 -0
  211. package/dist/rules/src/validation/conditions/validate-condition-type-of.js +30 -0
  212. package/dist/rules/src/validation/determine-condition-to-validate.d.ts +9 -0
  213. package/dist/rules/src/validation/determine-condition-to-validate.d.ts.map +1 -0
  214. package/dist/rules/src/validation/determine-condition-to-validate.js +56 -0
  215. package/dist/rules/src/validation/index.d.ts +15 -0
  216. package/dist/rules/src/validation/index.d.ts.map +1 -0
  217. package/dist/rules/src/validation/index.js +32 -0
  218. package/dist/rules/src/validation/validate-share-rule.d.ts +9 -0
  219. package/dist/rules/src/validation/validate-share-rule.d.ts.map +1 -0
  220. package/dist/rules/src/validation/validate-share-rule.js +52 -0
  221. package/package.json +3 -3
  222. package/dist/__testdata__/conditions/current-conditions.test-data.d.ts.map +0 -1
  223. package/dist/__testdata__/rules/rules.test-data.d.ts.map +0 -1
  224. package/dist/__testdata__/rules/rules.test-data.js +0 -339
  225. package/dist/create/conditions/create-boolean-conditions.d.ts.map +0 -1
  226. package/dist/create/conditions/create-contains-conditions.d.ts.map +0 -1
  227. package/dist/create/conditions/create-empty-conditions.d.ts.map +0 -1
  228. package/dist/create/conditions/create-equality-conditions.d.ts.map +0 -1
  229. package/dist/create/conditions/create-null-conditions.d.ts.map +0 -1
  230. package/dist/create/conditions/create-range-conditions.d.ts.map +0 -1
  231. package/dist/create/conditions/create-special-conditions.d.ts.map +0 -1
  232. package/dist/create/conditions/create-starts-end-with-conditions.d.ts.map +0 -1
  233. package/dist/create/conditions/create-typeof-conditions.d.ts.map +0 -1
  234. package/dist/create/create-share-rule-applied.d.ts.map +0 -1
  235. package/dist/create/create-share-rule-id.d.ts.map +0 -1
  236. package/dist/create/create-share-rule.d.ts.map +0 -1
  237. package/dist/create/index.d.ts.map +0 -1
  238. package/dist/evaluation/check-function-integrity.d.ts.map +0 -1
  239. package/dist/evaluation/check-if-proposal-is-valid.d.ts.map +0 -1
  240. package/dist/evaluation/conditions/boolean-conditions.d.ts.map +0 -1
  241. package/dist/evaluation/conditions/contains-conditions.d.ts.map +0 -1
  242. package/dist/evaluation/conditions/empty-conditions.d.ts.map +0 -1
  243. package/dist/evaluation/conditions/equality-conditions.d.ts.map +0 -1
  244. package/dist/evaluation/conditions/null-conditions.d.ts.map +0 -1
  245. package/dist/evaluation/conditions/range-conditions.d.ts.map +0 -1
  246. package/dist/evaluation/conditions/special-conditions.d.ts.map +0 -1
  247. package/dist/evaluation/conditions/starts-end-with-conditions.d.ts.map +0 -1
  248. package/dist/evaluation/conditions/typeof-conditions.d.ts.map +0 -1
  249. package/dist/evaluation/determine-if-data-has-changed.d.ts.map +0 -1
  250. package/dist/evaluation/evaluate-rule-conditions.d.ts.map +0 -1
  251. package/dist/evaluation/evaluate-rule.d.ts.map +0 -1
  252. package/dist/evaluation/evaluate-rules.d.ts.map +0 -1
  253. package/dist/evaluation/get-data-changed-information.d.ts.map +0 -1
  254. package/dist/evaluation/get-root-property-results.d.ts.map +0 -1
  255. package/dist/evaluation/index.d.ts.map +0 -1
  256. package/dist/evaluation/start-rule-evaluation.d.ts.map +0 -1
  257. package/dist/index.d.ts.map +0 -1
  258. /package/dist/{__testdata__ → rules/src/__testdata__}/conditions/current-conditions.test-data.d.ts +0 -0
  259. /package/dist/{create → rules/src/create}/conditions/create-boolean-conditions.d.ts +0 -0
  260. /package/dist/{create → rules/src/create}/conditions/create-boolean-conditions.js +0 -0
  261. /package/dist/{create → rules/src/create}/conditions/create-contains-conditions.d.ts +0 -0
  262. /package/dist/{create → rules/src/create}/conditions/create-contains-conditions.js +0 -0
  263. /package/dist/{create → rules/src/create}/conditions/create-empty-conditions.d.ts +0 -0
  264. /package/dist/{create → rules/src/create}/conditions/create-empty-conditions.js +0 -0
  265. /package/dist/{create → rules/src/create}/conditions/create-equality-conditions.d.ts +0 -0
  266. /package/dist/{create → rules/src/create}/conditions/create-equality-conditions.js +0 -0
  267. /package/dist/{create → rules/src/create}/conditions/create-null-conditions.d.ts +0 -0
  268. /package/dist/{create → rules/src/create}/conditions/create-null-conditions.js +0 -0
  269. /package/dist/{create → rules/src/create}/conditions/create-range-conditions.d.ts +0 -0
  270. /package/dist/{create → rules/src/create}/conditions/create-range-conditions.js +0 -0
  271. /package/dist/{create → rules/src/create}/conditions/create-special-conditions.d.ts +0 -0
  272. /package/dist/{create → rules/src/create}/conditions/create-special-conditions.js +0 -0
  273. /package/dist/{create → rules/src/create}/conditions/create-starts-end-with-conditions.d.ts +0 -0
  274. /package/dist/{create → rules/src/create}/conditions/create-starts-end-with-conditions.js +0 -0
  275. /package/dist/{create → rules/src/create}/conditions/create-typeof-conditions.d.ts +0 -0
  276. /package/dist/{create → rules/src/create}/conditions/create-typeof-conditions.js +0 -0
  277. /package/dist/{create → rules/src/create}/create-share-rule-applied.d.ts +0 -0
  278. /package/dist/{create → rules/src/create}/create-share-rule-applied.js +0 -0
  279. /package/dist/{create → rules/src/create}/create-share-rule-id.d.ts +0 -0
  280. /package/dist/{create → rules/src/create}/create-share-rule-id.js +0 -0
  281. /package/dist/{create → rules/src/create}/create-share-rule.d.ts +0 -0
  282. /package/dist/{create → rules/src/create}/create-share-rule.js +0 -0
  283. /package/dist/{evaluation → rules/src/evaluation}/check-function-integrity.d.ts +0 -0
  284. /package/dist/{evaluation → rules/src/evaluation}/check-function-integrity.js +0 -0
  285. /package/dist/{evaluation → rules/src/evaluation}/check-if-proposal-is-valid.d.ts +0 -0
  286. /package/dist/{evaluation → rules/src/evaluation}/check-if-proposal-is-valid.js +0 -0
  287. /package/dist/{evaluation → rules/src/evaluation}/conditions/boolean-conditions.d.ts +0 -0
  288. /package/dist/{evaluation → rules/src/evaluation}/conditions/boolean-conditions.js +0 -0
  289. /package/dist/{evaluation → rules/src/evaluation}/conditions/contains-conditions.d.ts +0 -0
  290. /package/dist/{evaluation → rules/src/evaluation}/conditions/contains-conditions.js +0 -0
  291. /package/dist/{evaluation → rules/src/evaluation}/conditions/empty-conditions.d.ts +0 -0
  292. /package/dist/{evaluation → rules/src/evaluation}/conditions/empty-conditions.js +0 -0
  293. /package/dist/{evaluation → rules/src/evaluation}/conditions/equality-conditions.d.ts +0 -0
  294. /package/dist/{evaluation → rules/src/evaluation}/conditions/equality-conditions.js +0 -0
  295. /package/dist/{evaluation → rules/src/evaluation}/conditions/null-conditions.d.ts +0 -0
  296. /package/dist/{evaluation → rules/src/evaluation}/conditions/null-conditions.js +0 -0
  297. /package/dist/{evaluation → rules/src/evaluation}/conditions/range-conditions.d.ts +0 -0
  298. /package/dist/{evaluation → rules/src/evaluation}/conditions/range-conditions.js +0 -0
  299. /package/dist/{evaluation → rules/src/evaluation}/conditions/special-conditions.d.ts +0 -0
  300. /package/dist/{evaluation → rules/src/evaluation}/conditions/special-conditions.js +0 -0
  301. /package/dist/{evaluation → rules/src/evaluation}/conditions/starts-end-with-conditions.d.ts +0 -0
  302. /package/dist/{evaluation → rules/src/evaluation}/conditions/starts-end-with-conditions.js +0 -0
  303. /package/dist/{evaluation → rules/src/evaluation}/conditions/typeof-conditions.d.ts +0 -0
  304. /package/dist/{evaluation → rules/src/evaluation}/conditions/typeof-conditions.js +0 -0
  305. /package/dist/{evaluation → rules/src/evaluation}/determine-if-data-has-changed.d.ts +0 -0
  306. /package/dist/{evaluation → rules/src/evaluation}/determine-if-data-has-changed.js +0 -0
  307. /package/dist/{evaluation → rules/src/evaluation}/evaluate-rule-conditions.d.ts +0 -0
  308. /package/dist/{evaluation → rules/src/evaluation}/evaluate-rule-conditions.js +0 -0
  309. /package/dist/{evaluation → rules/src/evaluation}/evaluate-rule.d.ts +0 -0
  310. /package/dist/{evaluation → rules/src/evaluation}/evaluate-rule.js +0 -0
  311. /package/dist/{evaluation → rules/src/evaluation}/evaluate-rules.d.ts +0 -0
  312. /package/dist/{evaluation → rules/src/evaluation}/evaluate-rules.js +0 -0
  313. /package/dist/{evaluation → rules/src/evaluation}/get-data-changed-information.d.ts +0 -0
  314. /package/dist/{evaluation → rules/src/evaluation}/get-data-changed-information.js +0 -0
  315. /package/dist/{evaluation → rules/src/evaluation}/get-root-property-results.d.ts +0 -0
  316. /package/dist/{evaluation → rules/src/evaluation}/get-root-property-results.js +0 -0
  317. /package/dist/{evaluation → rules/src/evaluation}/index.d.ts +0 -0
  318. /package/dist/{evaluation → rules/src/evaluation}/index.js +0 -0
  319. /package/dist/{evaluation → rules/src/evaluation}/start-rule-evaluation.d.ts +0 -0
  320. /package/dist/{evaluation → rules/src/evaluation}/start-rule-evaluation.js +0 -0
  321. /package/dist/{index.d.ts → rules/src/index.d.ts} +0 -0
  322. /package/dist/{index.js → rules/src/index.js} +0 -0
@@ -0,0 +1,120 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RequestParamNotValidError = exports.RequestQueryNotValidError = exports.RequestObjectPropertyNotMatchingParamProperty = exports.RequestObjectShouldOnlyHaveXPropertiesError = exports.RequestObjectTooFewPropertiesError = exports.RequestObjectTooManyPropertiesError = exports.RequestObjectValidationFailedError = void 0;
4
+ /* eslint-disable @typescript-eslint/no-explicit-any */
5
+ // This file contains the errors that are thrown when the request object is not valid.
6
+ const base_error_1 = require("../base-error");
7
+ //#region Request Body Errors
8
+ /**
9
+ * This is thrown when the request object is not valid.
10
+ */
11
+ class RequestObjectValidationFailedError extends base_error_1.BaseError {
12
+ /**
13
+ * This is thrown when the request object is not valid.
14
+ * @param objectToValidate the object that is not valid
15
+ * @param validationType the type of validation that failed
16
+ */
17
+ constructor(objectToValidate, validationObject, validationType) {
18
+ super(`The object ${objectToValidate} in the node ${validationObject} is not a valid ${validationType}`);
19
+ }
20
+ }
21
+ exports.RequestObjectValidationFailedError = RequestObjectValidationFailedError;
22
+ /**
23
+ * This is throw when the request object has too many properties.
24
+ */
25
+ class RequestObjectTooManyPropertiesError extends base_error_1.BaseError {
26
+ /**
27
+ * This is throw when the request object has too many properties.
28
+ * @param objectToValidate the object that is not valid
29
+ * @param validationOject the object property text that is being validated
30
+ * @param totalProperties the total properties on the object
31
+ * @param maxProperties the max properties allowed on the object
32
+ */
33
+ constructor(objectToValidate, validationOject, totalProperties, maxProperties) {
34
+ super(`The object ${objectToValidate} which is property ${validationOject} has too many properties. It has ${totalProperties} and the max is ${maxProperties}`);
35
+ }
36
+ }
37
+ exports.RequestObjectTooManyPropertiesError = RequestObjectTooManyPropertiesError;
38
+ /**
39
+ * This is thrown when the request object has too few properties.
40
+ */
41
+ class RequestObjectTooFewPropertiesError extends base_error_1.BaseError {
42
+ /**
43
+ * This is thrown when the request object has too few properties.
44
+ * @param objectToValidate the object that is not valid
45
+ * @param validationOject the object property text that is being validated
46
+ * @param totalProperties the total properties on the object
47
+ * @param minProperties the min properties allowed on the object
48
+ */
49
+ constructor(objectToValidate, validationOject, totalProperties, minProperties) {
50
+ super(`The object ${objectToValidate} which is property ${validationOject} has too few properties. It has ${totalProperties} and the min is ${minProperties}`);
51
+ }
52
+ }
53
+ exports.RequestObjectTooFewPropertiesError = RequestObjectTooFewPropertiesError;
54
+ /**
55
+ * This is thrown when the request object should only have a certain number of properties.
56
+ */
57
+ class RequestObjectShouldOnlyHaveXPropertiesError extends base_error_1.BaseError {
58
+ /**
59
+ * This is thrown when the request object should only have a certain number of properties.
60
+ * @param objectToValidate the object that is not valid
61
+ * @param validationOject the object property text that is being validated
62
+ * @param totalProperties the total properties on the object
63
+ * @param expectedProperties the expected properties on the object
64
+ */
65
+ constructor(objectToValidate, validationOject, totalProperties, expectedProperties) {
66
+ super(`The object ${objectToValidate} which is property ${validationOject} should only have ${expectedProperties} properties. It has ${totalProperties}`);
67
+ }
68
+ }
69
+ exports.RequestObjectShouldOnlyHaveXPropertiesError = RequestObjectShouldOnlyHaveXPropertiesError;
70
+ /**
71
+ * This is throw when the request object has a property that does not match the param property.
72
+ */
73
+ class RequestObjectPropertyNotMatchingParamProperty extends base_error_1.BaseError {
74
+ /**
75
+ * This is thrown when the request object doesnot match the param property.
76
+ * @param requestPropertyName the property in the request object
77
+ * @param requestPropertyValue the value of the property in the request object
78
+ * @param paramPropertyName the property in the param object
79
+ * @param paramPropertyValue the value of the property in the param object
80
+ */
81
+ constructor(requestPropertyName, requestPropertyValue, paramPropertyName, paramPropertyValue) {
82
+ super(`The request object property ${requestPropertyName} with value ${requestPropertyValue} does not match the param property ${paramPropertyName} with value ${paramPropertyValue}`);
83
+ }
84
+ }
85
+ exports.RequestObjectPropertyNotMatchingParamProperty = RequestObjectPropertyNotMatchingParamProperty;
86
+ //#endregion Request Body Errors
87
+ //#region Request Query Errors
88
+ /**
89
+ * This is thrown when the query object is not valid.
90
+ */
91
+ class RequestQueryNotValidError extends base_error_1.BaseError {
92
+ /**
93
+ * This is thrown when the query object is not valid.
94
+ * @param queryObjectName the name of the query object
95
+ * @param queryValue the value of the query object
96
+ * @param expectedType the expected type of the query object
97
+ */
98
+ constructor(queryObjectName, queryValue, expectedType) {
99
+ super(`The query object ${queryObjectName} with value ${queryValue} is not a valid ${expectedType}`);
100
+ }
101
+ }
102
+ exports.RequestQueryNotValidError = RequestQueryNotValidError;
103
+ //#endregion Request Query Errors
104
+ //#region Request Param Errors
105
+ /**
106
+ * This is thrown when the param object is not valid.
107
+ */
108
+ class RequestParamNotValidError extends base_error_1.BaseError {
109
+ /**
110
+ * This is thrown when the param object is not valid.
111
+ * @param paramName the name of the param object
112
+ * @param paramValue the value of the param object
113
+ * @param expectedType the expected type of the param object
114
+ */
115
+ constructor(paramName, paramValue, expectedType, allParams) {
116
+ super(`The param object ${paramName} with value ${paramValue} is not a valid ${expectedType}. All params: ${JSON.stringify(allParams)}`);
117
+ }
118
+ }
119
+ exports.RequestParamNotValidError = RequestParamNotValidError;
120
+ //#endregion Request Param Errors
@@ -0,0 +1,102 @@
1
+ import { ConditionType } from '../../models';
2
+ import { BaseError } from '../base-error';
3
+ /**
4
+ * This error is thrown when a evaluation condition data value is not valid
5
+ */
6
+ export declare class SafeRuleEvaluationConditionDataValueError extends BaseError {
7
+ /**
8
+ * This error is thrown when a evaluation condition data value is not valid
9
+ */
10
+ constructor(dataValue: unknown, conditionValue: unknown, conditionType: ConditionType);
11
+ }
12
+ /**
13
+ * This error is thrown when a evaluation condition value is not valid
14
+ */
15
+ export declare class SafeRuleEvaluationConditionValueError extends BaseError {
16
+ /**
17
+ * This error is thrown when a evaluation condition value is not valid
18
+ */
19
+ constructor(dataValue: unknown, conditionValue: unknown, conditionType: ConditionType);
20
+ }
21
+ /**
22
+ * This error is thrown when a speical condition pattern is not valid
23
+ */
24
+ export declare class SafeRuleEvaluationSpecialConditionPatternError extends BaseError {
25
+ /**
26
+ * This error is thrown when a speical condition pattern is not valid
27
+ */
28
+ constructor(dataValue: unknown, conditionValue: unknown);
29
+ }
30
+ /**
31
+ * This error is thrown when a rule set has no rule groups
32
+ */
33
+ export declare class SafeRuleRuleSetNoRuleGroupsError extends BaseError {
34
+ /**
35
+ * This error is thrown when a rule set has no rule groups
36
+ */
37
+ constructor(name: string, description?: string);
38
+ }
39
+ export declare class SafeRuleConditionNotTypeOfError extends BaseError {
40
+ constructor(conditionType: ConditionType, expectedType: string);
41
+ }
42
+ /**
43
+ * This error is thrown when a rule condition is not an object
44
+ */
45
+ export declare class SafeRuleConditionNotObjectError extends BaseError {
46
+ constructor(incomingObject: unknown);
47
+ }
48
+ /**
49
+ * This error is thrown when a rule condition is missing or has an extra property
50
+ */
51
+ export declare class SafeRuleConditionHasMismatchingProperties extends BaseError {
52
+ constructor(incomingObject: unknown, expectedPropertyCount: number, actualPropertyCount: number);
53
+ }
54
+ /**
55
+ * This error is thrown when the safe condition qualifier is not valid
56
+ */
57
+ export declare class SafeRuleConditionQualifierError extends BaseError {
58
+ constructor(conditionQualifier: unknown);
59
+ }
60
+ /**
61
+ * This error is thrown when a rule condition property is missing
62
+ */
63
+ export declare class SafeRuleConditionPropertyMissingError extends BaseError {
64
+ constructor(missingProperty: string);
65
+ }
66
+ /**
67
+ * This error is thrown when a rule condition value is not valid
68
+ */
69
+ export declare class SafeRuleConditionValueWrongType extends BaseError {
70
+ constructor(conditionValue: unknown, expectedType: string);
71
+ }
72
+ /**
73
+ * This error is thrown when a rule condition type is not valid
74
+ */
75
+ export declare class SafeRuleConditionTypeNotValidError extends BaseError {
76
+ constructor(conditionType: unknown);
77
+ }
78
+ /**
79
+ * This error is thrown when a safe rule is not an object
80
+ */
81
+ export declare class SafeRuleNotObjectError extends BaseError {
82
+ constructor(incomingObject: unknown);
83
+ }
84
+ /**
85
+ * This error is thrown when a safe rule is missing or has an extra property
86
+ */
87
+ export declare class SafeRuleHasMismatchingProperties extends BaseError {
88
+ constructor(incomingObject: unknown, expectedPropertyCount: number, actualPropertyCount: number);
89
+ }
90
+ /**
91
+ * This error is thrown when a safe rule is missing property
92
+ */
93
+ export declare class SafeRuleHasMissingProperty extends BaseError {
94
+ constructor(incomingObject: unknown, expectedProperty: string);
95
+ }
96
+ /**
97
+ * This error is thrown when a safe rule property is not valid
98
+ */
99
+ export declare class SafeRulePropertyValueWrongType extends BaseError {
100
+ constructor(propertyName: string, propertyValue: unknown, expectedType: string);
101
+ }
102
+ //# sourceMappingURL=safe-rules-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"safe-rules-errors.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/errors/safe/safe-rules-errors.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,qBAAa,yCAA0C,SAAQ,SAAS;IACpE;;OAEG;gBACS,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa;CAGxF;AAED;;GAEG;AACH,qBAAa,qCAAsC,SAAQ,SAAS;IAChE;;OAEG;gBACS,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa;CAGxF;AAED;;GAEG;AACH,qBAAa,8CAA+C,SAAQ,SAAS;IACzE;;OAEG;gBACS,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO;CAG1D;AAED;;GAEG;AACH,qBAAa,gCAAiC,SAAQ,SAAS;IAC3D;;OAEG;gBACS,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;CAGjD;AAKD,qBAAa,+BAAgC,SAAQ,SAAS;gBAC9C,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM;CAGjE;AAGD;;GAEG;AACH,qBAAa,+BAAgC,SAAQ,SAAS;gBAC9C,cAAc,EAAE,OAAO;CAGtC;AAED;;GAEG;AACH,qBAAa,yCAA0C,SAAQ,SAAS;gBACxD,cAAc,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM;CAGlG;AAED;;GAEG;AACH,qBAAa,+BAAgC,SAAQ,SAAS;gBAC9C,kBAAkB,EAAE,OAAO;CAG1C;AAGD;;GAEG;AACH,qBAAa,qCAAsC,SAAQ,SAAS;gBACpD,eAAe,EAAE,MAAM;CAGtC;AAED;;GAEG;AACH,qBAAa,+BAAgC,SAAQ,SAAS;gBAC9C,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM;CAG5D;AAED;;GAEG;AACH,qBAAa,kCAAmC,SAAQ,SAAS;gBACjD,aAAa,EAAE,OAAO;CAGrC;AAMD;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,SAAS;gBACrC,cAAc,EAAE,OAAO;CAGtC;AAED;;GAEG;AACH,qBAAa,gCAAiC,SAAQ,SAAS;gBAC/C,cAAc,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM;CAGlG;AAED;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,SAAS;gBACzC,cAAc,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM;CAGhE;AAED;;GAEG;AACH,qBAAa,8BAA+B,SAAQ,SAAS;gBAC7C,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM;CAGjF"}
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SafeRulePropertyValueWrongType = exports.SafeRuleHasMissingProperty = exports.SafeRuleHasMismatchingProperties = exports.SafeRuleNotObjectError = exports.SafeRuleConditionTypeNotValidError = exports.SafeRuleConditionValueWrongType = exports.SafeRuleConditionPropertyMissingError = exports.SafeRuleConditionQualifierError = exports.SafeRuleConditionHasMismatchingProperties = exports.SafeRuleConditionNotObjectError = exports.SafeRuleConditionNotTypeOfError = exports.SafeRuleRuleSetNoRuleGroupsError = exports.SafeRuleEvaluationSpecialConditionPatternError = exports.SafeRuleEvaluationConditionValueError = exports.SafeRuleEvaluationConditionDataValueError = void 0;
4
+ const base_error_1 = require("../base-error");
5
+ /**
6
+ * This error is thrown when a evaluation condition data value is not valid
7
+ */
8
+ class SafeRuleEvaluationConditionDataValueError extends base_error_1.BaseError {
9
+ /**
10
+ * This error is thrown when a evaluation condition data value is not valid
11
+ */
12
+ constructor(dataValue, conditionValue, conditionType) {
13
+ super(`Share Rule condition evaluation for type ${conditionType} failed to execute. dataValue: ${dataValue} is incorrect for conditionValue: ${conditionValue}`);
14
+ }
15
+ }
16
+ exports.SafeRuleEvaluationConditionDataValueError = SafeRuleEvaluationConditionDataValueError;
17
+ /**
18
+ * This error is thrown when a evaluation condition value is not valid
19
+ */
20
+ class SafeRuleEvaluationConditionValueError extends base_error_1.BaseError {
21
+ /**
22
+ * This error is thrown when a evaluation condition value is not valid
23
+ */
24
+ constructor(dataValue, conditionValue, conditionType) {
25
+ super(`Share Rule condition evaluation for type ${conditionType} failed to execute. conditionValue: ${conditionValue} is incorrect for dataValue: ${dataValue}`);
26
+ }
27
+ }
28
+ exports.SafeRuleEvaluationConditionValueError = SafeRuleEvaluationConditionValueError;
29
+ /**
30
+ * This error is thrown when a speical condition pattern is not valid
31
+ */
32
+ class SafeRuleEvaluationSpecialConditionPatternError extends base_error_1.BaseError {
33
+ /**
34
+ * This error is thrown when a speical condition pattern is not valid
35
+ */
36
+ constructor(dataValue, conditionValue) {
37
+ super(`Share Rule special condition pattern evaluation failed to execute. dataValue ${dataValue} and conditionValue: ${conditionValue}`);
38
+ }
39
+ }
40
+ exports.SafeRuleEvaluationSpecialConditionPatternError = SafeRuleEvaluationSpecialConditionPatternError;
41
+ /**
42
+ * This error is thrown when a rule set has no rule groups
43
+ */
44
+ class SafeRuleRuleSetNoRuleGroupsError extends base_error_1.BaseError {
45
+ /**
46
+ * This error is thrown when a rule set has no rule groups
47
+ */
48
+ constructor(name, description) {
49
+ super(`Share Rule set ${name} with description ${description} has no rule groups`);
50
+ }
51
+ }
52
+ exports.SafeRuleRuleSetNoRuleGroupsError = SafeRuleRuleSetNoRuleGroupsError;
53
+ //#region Condition Validation Errors
54
+ class SafeRuleConditionNotTypeOfError extends base_error_1.BaseError {
55
+ constructor(conditionType, expectedType) {
56
+ super(`Share Rule condition type ${conditionType} is not of type ${expectedType}`);
57
+ }
58
+ }
59
+ exports.SafeRuleConditionNotTypeOfError = SafeRuleConditionNotTypeOfError;
60
+ /**
61
+ * This error is thrown when a rule condition is not an object
62
+ */
63
+ class SafeRuleConditionNotObjectError extends base_error_1.BaseError {
64
+ constructor(incomingObject) {
65
+ super(`Share Rule condition object ${incomingObject} is not an object`);
66
+ }
67
+ }
68
+ exports.SafeRuleConditionNotObjectError = SafeRuleConditionNotObjectError;
69
+ /**
70
+ * This error is thrown when a rule condition is missing or has an extra property
71
+ */
72
+ class SafeRuleConditionHasMismatchingProperties extends base_error_1.BaseError {
73
+ constructor(incomingObject, expectedPropertyCount, actualPropertyCount) {
74
+ super(`Share Rule condition object ${incomingObject} has mismatching properties, expected ${expectedPropertyCount} but got ${actualPropertyCount}`);
75
+ }
76
+ }
77
+ exports.SafeRuleConditionHasMismatchingProperties = SafeRuleConditionHasMismatchingProperties;
78
+ /**
79
+ * This error is thrown when the safe condition qualifier is not valid
80
+ */
81
+ class SafeRuleConditionQualifierError extends base_error_1.BaseError {
82
+ constructor(conditionQualifier) {
83
+ super(`Share Rule condition qualifier ${conditionQualifier} is not valid`);
84
+ }
85
+ }
86
+ exports.SafeRuleConditionQualifierError = SafeRuleConditionQualifierError;
87
+ /**
88
+ * This error is thrown when a rule condition property is missing
89
+ */
90
+ class SafeRuleConditionPropertyMissingError extends base_error_1.BaseError {
91
+ constructor(missingProperty) {
92
+ super(`Share Rule condition property ${missingProperty} is missing`);
93
+ }
94
+ }
95
+ exports.SafeRuleConditionPropertyMissingError = SafeRuleConditionPropertyMissingError;
96
+ /**
97
+ * This error is thrown when a rule condition value is not valid
98
+ */
99
+ class SafeRuleConditionValueWrongType extends base_error_1.BaseError {
100
+ constructor(conditionValue, expectedType) {
101
+ super(`Share Rule condition value ${conditionValue} is not of type ${expectedType}`);
102
+ }
103
+ }
104
+ exports.SafeRuleConditionValueWrongType = SafeRuleConditionValueWrongType;
105
+ /**
106
+ * This error is thrown when a rule condition type is not valid
107
+ */
108
+ class SafeRuleConditionTypeNotValidError extends base_error_1.BaseError {
109
+ constructor(conditionType) {
110
+ super(`Share Rule condition type ${conditionType} is not valid`);
111
+ }
112
+ }
113
+ exports.SafeRuleConditionTypeNotValidError = SafeRuleConditionTypeNotValidError;
114
+ //#endregion Condition Validation Errors
115
+ //#region Rule Validation Errors
116
+ /**
117
+ * This error is thrown when a safe rule is not an object
118
+ */
119
+ class SafeRuleNotObjectError extends base_error_1.BaseError {
120
+ constructor(incomingObject) {
121
+ super(`Share Rule object ${incomingObject} is not an object`);
122
+ }
123
+ }
124
+ exports.SafeRuleNotObjectError = SafeRuleNotObjectError;
125
+ /**
126
+ * This error is thrown when a safe rule is missing or has an extra property
127
+ */
128
+ class SafeRuleHasMismatchingProperties extends base_error_1.BaseError {
129
+ constructor(incomingObject, expectedPropertyCount, actualPropertyCount) {
130
+ super(`Share Rule object ${incomingObject} has mismatching properties, expected ${expectedPropertyCount} but got ${actualPropertyCount}`);
131
+ }
132
+ }
133
+ exports.SafeRuleHasMismatchingProperties = SafeRuleHasMismatchingProperties;
134
+ /**
135
+ * This error is thrown when a safe rule is missing property
136
+ */
137
+ class SafeRuleHasMissingProperty extends base_error_1.BaseError {
138
+ constructor(incomingObject, expectedProperty) {
139
+ super(`Share Rule object ${incomingObject} is missing property ${expectedProperty}`);
140
+ }
141
+ }
142
+ exports.SafeRuleHasMissingProperty = SafeRuleHasMissingProperty;
143
+ /**
144
+ * This error is thrown when a safe rule property is not valid
145
+ */
146
+ class SafeRulePropertyValueWrongType extends base_error_1.BaseError {
147
+ constructor(propertyName, propertyValue, expectedType) {
148
+ super(`Share Rule property ${propertyName} with value ${propertyValue} is not of type ${expectedType}`);
149
+ }
150
+ }
151
+ exports.SafeRulePropertyValueWrongType = SafeRulePropertyValueWrongType;
152
+ //#endregion Rule Validation Errors
@@ -0,0 +1,8 @@
1
+ import { BaseError } from '../base-error';
2
+ /**
3
+ * This error is thrown when a task is not found in the scheduler
4
+ */
5
+ export declare class TaskNotFoundError extends BaseError {
6
+ constructor(taskId: string);
7
+ }
8
+ //# sourceMappingURL=scheduler-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scheduler-errors.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/errors/scheduler/scheduler-errors.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,SAAS;gBAChC,MAAM,EAAE,MAAM;CAG7B"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // this file contains all the errors that can be thrown by the scheduler
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.TaskNotFoundError = void 0;
5
+ const base_error_1 = require("../base-error");
6
+ /**
7
+ * This error is thrown when a task is not found in the scheduler
8
+ */
9
+ class TaskNotFoundError extends base_error_1.BaseError {
10
+ constructor(taskId) {
11
+ super(`An error occurred while trying to remove task ${taskId}.`);
12
+ }
13
+ }
14
+ exports.TaskNotFoundError = TaskNotFoundError;
@@ -0,0 +1,67 @@
1
+ import { BaseError } from '../base-error';
2
+ import { ShareDataTypes } from '../../models/share-data/share-data';
3
+ import { IShareDataFunction } from '../../models/functions/share-data-function-models';
4
+ /**
5
+ * This error is thrown when a function is tried to be applied to the share data thats state is locked.
6
+ */
7
+ export declare class ShareDataIsLockedError extends BaseError {
8
+ /**
9
+ * This error is thrown when a function is tried to be applied to the share data thats state is locked.
10
+ */
11
+ constructor(shareDataId: string, shareDataType: ShareDataTypes);
12
+ }
13
+ /**
14
+ * This error is thrown when a data proposal matches the current data in the rules evaluation service.
15
+ */
16
+ export declare class ShareDataCurrentAndProposalDataMatchesError extends BaseError {
17
+ /**
18
+ * This error is thrown when a data proposal matches the current data in the rules evaluation service.
19
+ */
20
+ constructor(shareDataId: string);
21
+ }
22
+ /**
23
+ * This error is thrown when the share data integrity check fails.
24
+ */
25
+ export declare class ShareDataIntegrityError extends BaseError {
26
+ /**
27
+ * This error is thrown when the share data integrity check fails.
28
+ */
29
+ constructor(shareDataId: string);
30
+ }
31
+ /**
32
+ * This error is thrown when the attemping to be applied function does not exist on the share data.
33
+ */
34
+ export declare class ShareDataFunctionBeingAppliedDoesNotExistOnShareDataError extends BaseError {
35
+ /**
36
+ * This error is thrown when the attemping to be applied function does not exist on the share data.
37
+ */
38
+ constructor(shareDataId: string, functionName: string, functionId: string);
39
+ }
40
+ /**
41
+ * This error is thrown when the function hash is not valid.
42
+ */
43
+ export declare class ShareDataFunctionHashNotValid extends BaseError {
44
+ /**
45
+ * This error is thrown when the function hash is not valid.
46
+ */
47
+ constructor(shareDataId: string, shareDataFunction: IShareDataFunction, calculatedHash: string);
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
+ }
67
+ //# sourceMappingURL=share-data-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"share-data-errors.d.ts","sourceRoot":"","sources":["../../../../../../generic/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"}
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ShareRuleProposedConditionsNotPresentError = exports.ShareRuleCurrentConditionsNotPresentError = exports.ShareDataFunctionHashNotValid = exports.ShareDataFunctionBeingAppliedDoesNotExistOnShareDataError = exports.ShareDataIntegrityError = exports.ShareDataCurrentAndProposalDataMatchesError = exports.ShareDataIsLockedError = void 0;
4
+ const base_error_1 = require("../base-error");
5
+ /**
6
+ * This error is thrown when a function is tried to be applied to the share data thats state is locked.
7
+ */
8
+ class ShareDataIsLockedError extends base_error_1.BaseError {
9
+ /**
10
+ * This error is thrown when a function is tried to be applied to the share data thats state is locked.
11
+ */
12
+ constructor(shareDataId, shareDataType) {
13
+ super(`Share data with id ${shareDataId} and type ${shareDataType} is locked and cannot be modified.`);
14
+ }
15
+ }
16
+ exports.ShareDataIsLockedError = ShareDataIsLockedError;
17
+ /**
18
+ * This error is thrown when a data proposal matches the current data in the rules evaluation service.
19
+ */
20
+ class ShareDataCurrentAndProposalDataMatchesError extends base_error_1.BaseError {
21
+ /**
22
+ * This error is thrown when a data proposal matches the current data in the rules evaluation service.
23
+ */
24
+ constructor(shareDataId) {
25
+ super(`Share data with id ${shareDataId} current and proposal data matches.`);
26
+ }
27
+ }
28
+ exports.ShareDataCurrentAndProposalDataMatchesError = ShareDataCurrentAndProposalDataMatchesError;
29
+ /**
30
+ * This error is thrown when the share data integrity check fails.
31
+ */
32
+ class ShareDataIntegrityError extends base_error_1.BaseError {
33
+ /**
34
+ * This error is thrown when the share data integrity check fails.
35
+ */
36
+ constructor(shareDataId) {
37
+ super(`Share data with id ${shareDataId} failed the integrity check.`);
38
+ }
39
+ }
40
+ exports.ShareDataIntegrityError = ShareDataIntegrityError;
41
+ /**
42
+ * This error is thrown when the attemping to be applied function does not exist on the share data.
43
+ */
44
+ class ShareDataFunctionBeingAppliedDoesNotExistOnShareDataError extends base_error_1.BaseError {
45
+ /**
46
+ * This error is thrown when the attemping to be applied function does not exist on the share data.
47
+ */
48
+ constructor(shareDataId, functionName, functionId) {
49
+ super(`On share data with id ${shareDataId} the function with id: ${functionId} & name: ${functionName} that is trying to be executed, ` +
50
+ 'but does not exist in the authorized functions for the share data.');
51
+ }
52
+ }
53
+ exports.ShareDataFunctionBeingAppliedDoesNotExistOnShareDataError = ShareDataFunctionBeingAppliedDoesNotExistOnShareDataError;
54
+ /**
55
+ * This error is thrown when the function hash is not valid.
56
+ */
57
+ class ShareDataFunctionHashNotValid extends base_error_1.BaseError {
58
+ /**
59
+ * This error is thrown when the function hash is not valid.
60
+ */
61
+ constructor(shareDataId, shareDataFunction, calculatedHash) {
62
+ super(`On share data with id ${shareDataId} the function with current hash: ${shareDataFunction.currentHash} & previous hase: ${shareDataFunction.previousHash}` +
63
+ ` that is trying to be executed does not meet the generated hash ${calculatedHash}. This makes it an authorized function execution.`);
64
+ }
65
+ }
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
@@ -0,0 +1,16 @@
1
+ /**
2
+ * this gets a random item from an array.
3
+ *
4
+ * @param incomingArray the incoming array to get a random item from.
5
+ */
6
+ declare const getRandomItemFromArray: <T>(incomingArray: T[]) => T;
7
+ /**
8
+ * This ensures that all items in an array are of the same type.
9
+ *
10
+ * @param array the array to check
11
+ * @param type the type to check against
12
+ * @returns
13
+ */
14
+ declare const checkIfAllItemsInAnArrayAreSameType: (array: unknown[], type: string) => boolean;
15
+ export { getRandomItemFromArray, checkIfAllItemsInAnArrayAreSameType, };
16
+ //# sourceMappingURL=array-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-helpers.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/helpers/array/array-helpers.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,GAAI,CAAC,iBAAiB,CAAC,EAAE,KAAG,CAGvD,CAAC;AAEF;;;;;;GAMG;AACH,QAAA,MAAM,mCAAmC,UAAW,OAAO,EAAE,QAAQ,MAAM,KAAG,OAE7E,CAAC;AAEF,OAAO,EACH,sBAAsB,EACtB,mCAAmC,GACtC,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // This file contains the helper functions for arrays.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.checkIfAllItemsInAnArrayAreSameType = exports.getRandomItemFromArray = void 0;
5
+ /**
6
+ * this gets a random item from an array.
7
+ *
8
+ * @param incomingArray the incoming array to get a random item from.
9
+ */
10
+ const getRandomItemFromArray = (incomingArray) => {
11
+ const randomIndex = Math.floor(Math.random() * incomingArray.length);
12
+ return incomingArray[randomIndex];
13
+ };
14
+ exports.getRandomItemFromArray = getRandomItemFromArray;
15
+ /**
16
+ * This ensures that all items in an array are of the same type.
17
+ *
18
+ * @param array the array to check
19
+ * @param type the type to check against
20
+ * @returns
21
+ */
22
+ const checkIfAllItemsInAnArrayAreSameType = (array, type) => {
23
+ return array.every(item => typeof item === type);
24
+ };
25
+ exports.checkIfAllItemsInAnArrayAreSameType = checkIfAllItemsInAnArrayAreSameType;
@@ -0,0 +1,46 @@
1
+ import { IGenericData, ISearchableIndex } from '../../models/data/data-models';
2
+ /**
3
+ * This adds the generic data to the object.
4
+ *
5
+ * @param incomingObject the object to add the generic data to.
6
+ * @param userId the user ID to add the generic data to.
7
+ * @param versionNumber the version number to add to the generic data.
8
+ * @returns
9
+ */
10
+ declare const addGenericDataToObject: <T>(incomingObject: any, userId: string, versionNumber?: number) => T;
11
+ /**
12
+ * This creates the generic data record for the database
13
+ *
14
+ * @param userId the user ID to create the generic data for.
15
+ * @param versionNumber the version number to create the generic data for.
16
+ * @returns
17
+ */
18
+ declare const createGenericData: (userId: string, versionNumber?: number) => IGenericData;
19
+ /**
20
+ * This takes an incoming string and creates a searchable index object.
21
+ * @param itemForSearchableIndex the item for a searchable index to be created on
22
+ */
23
+ declare const createSearchableIndex: (itemForSearchableIndex: string) => ISearchableIndex;
24
+ /**
25
+ * This removed all the generic data from an object.
26
+ *
27
+ * @param data
28
+ */
29
+ declare const deleteGenericDataOnObject: (data: any) => any;
30
+ /**
31
+ * This function removes all whitespace from a string
32
+ *
33
+ * @param str the string to remove whitespace from
34
+ * @returns
35
+ */
36
+ declare const removeWhitespaceFromObject: (str: string) => string;
37
+ /**
38
+ * This function updates the generic data on an object.
39
+ * @param data the data to update the generic data on
40
+ * @param userId the user Id to update the object with
41
+ *
42
+ * @returns
43
+ */
44
+ declare const updateGenericDataOnObject: <T>(data: T, userId: string) => any;
45
+ export { addGenericDataToObject, createGenericData, createSearchableIndex, deleteGenericDataOnObject, removeWhitespaceFromObject, updateGenericDataOnObject, };
46
+ //# sourceMappingURL=data-helpers.d.ts.map