@degenerate/rules 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__testdata__/conditions/current-conditions.test-data.d.ts.map +1 -0
- package/dist/{rules/src/__testdata__ → __testdata__}/rules/rules.test-data.d.ts +1 -1
- package/dist/__testdata__/rules/rules.test-data.d.ts.map +1 -0
- package/dist/__testdata__/rules/rules.test-data.js +390 -0
- package/dist/create/conditions/create-boolean-conditions.d.ts.map +1 -0
- package/dist/create/conditions/create-contains-conditions.d.ts.map +1 -0
- package/dist/create/conditions/create-empty-conditions.d.ts.map +1 -0
- package/dist/create/conditions/create-equality-conditions.d.ts.map +1 -0
- package/dist/create/conditions/create-null-conditions.d.ts.map +1 -0
- package/dist/create/conditions/create-range-conditions.d.ts.map +1 -0
- package/dist/create/conditions/create-special-conditions.d.ts.map +1 -0
- package/dist/create/conditions/create-starts-end-with-conditions.d.ts.map +1 -0
- package/dist/create/conditions/create-typeof-conditions.d.ts.map +1 -0
- package/dist/create/create-share-rule-applied.d.ts.map +1 -0
- package/dist/{rules/src/create → create}/create-share-rule-group.d.ts +1 -1
- package/dist/create/create-share-rule-group.d.ts.map +1 -0
- package/dist/create/create-share-rule-id.d.ts.map +1 -0
- package/dist/{rules/src/create → create}/create-share-rule-set.d.ts +1 -1
- package/dist/create/create-share-rule-set.d.ts.map +1 -0
- package/dist/{rules/src/create → create}/create-share-rule-set.js +1 -2
- package/dist/create/create-share-rule.d.ts.map +1 -0
- package/dist/create/index.d.ts.map +1 -0
- package/dist/evaluation/check-function-integrity.d.ts.map +1 -0
- package/dist/evaluation/check-if-proposal-is-valid.d.ts.map +1 -0
- package/dist/evaluation/conditions/boolean-conditions.d.ts.map +1 -0
- package/dist/evaluation/conditions/contains-conditions.d.ts.map +1 -0
- package/dist/evaluation/conditions/empty-conditions.d.ts.map +1 -0
- package/dist/evaluation/conditions/equality-conditions.d.ts.map +1 -0
- package/dist/evaluation/conditions/null-conditions.d.ts.map +1 -0
- package/dist/evaluation/conditions/range-conditions.d.ts.map +1 -0
- package/dist/evaluation/conditions/special-conditions.d.ts.map +1 -0
- package/dist/evaluation/conditions/starts-end-with-conditions.d.ts.map +1 -0
- package/dist/evaluation/conditions/typeof-conditions.d.ts.map +1 -0
- package/dist/evaluation/determine-if-data-has-changed.d.ts.map +1 -0
- package/dist/evaluation/evaluate-rule-conditions.d.ts.map +1 -0
- package/dist/evaluation/evaluate-rule.d.ts.map +1 -0
- package/dist/evaluation/evaluate-rules.d.ts.map +1 -0
- package/dist/evaluation/get-data-changed-information.d.ts.map +1 -0
- package/dist/evaluation/get-root-property-results.d.ts.map +1 -0
- package/dist/evaluation/index.d.ts.map +1 -0
- package/dist/evaluation/start-rule-evaluation.d.ts.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/{rules/src/index.js → index.js} +2 -0
- package/dist/validation/conditions/validate-condition-base.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/conditions/validate-condition-base.js +5 -5
- package/dist/validation/conditions/validate-condition-boolean.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/conditions/validate-condition-boolean.js +3 -3
- package/dist/validation/conditions/validate-condition-contains.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/conditions/validate-condition-contains.js +6 -7
- package/dist/validation/conditions/validate-condition-empty.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/conditions/validate-condition-empty.js +3 -3
- package/dist/validation/conditions/validate-condition-equality.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/conditions/validate-condition-equality.js +4 -4
- package/dist/validation/conditions/validate-condition-null.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/conditions/validate-condition-null.js +3 -3
- package/dist/validation/conditions/validate-condition-qualifier.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/conditions/validate-condition-qualifier.js +2 -2
- package/dist/validation/conditions/validate-condition-range.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/conditions/validate-condition-range.js +5 -5
- package/dist/validation/conditions/validate-condition-share-rule.d.ts.map +1 -0
- package/dist/validation/conditions/validate-condition-special.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/conditions/validate-condition-special.js +5 -5
- package/dist/validation/conditions/validate-condition-starts-ends-with.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/conditions/validate-condition-starts-ends-with.js +5 -5
- package/dist/validation/conditions/validate-condition-type-of.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/conditions/validate-condition-type-of.js +5 -5
- package/dist/validation/determine-condition-to-validate.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/determine-condition-to-validate.js +2 -2
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/validate-share-rule.d.ts.map +1 -0
- package/dist/{rules/src/validation → validation}/validate-share-rule.js +7 -7
- package/package.json +3 -3
- package/dist/generic/src/_settings/cryptography-settings.d.ts +0 -27
- package/dist/generic/src/_settings/cryptography-settings.d.ts.map +0 -1
- package/dist/generic/src/_settings/cryptography-settings.js +0 -27
- package/dist/generic/src/crypto/calculate-combined-hash.d.ts +0 -13
- package/dist/generic/src/crypto/calculate-combined-hash.d.ts.map +0 -1
- package/dist/generic/src/crypto/calculate-combined-hash.js +0 -44
- package/dist/generic/src/crypto/calculate-hash.d.ts +0 -7
- package/dist/generic/src/crypto/calculate-hash.d.ts.map +0 -1
- package/dist/generic/src/crypto/calculate-hash.js +0 -37
- package/dist/generic/src/crypto/index.d.ts +0 -13
- package/dist/generic/src/crypto/index.d.ts.map +0 -1
- package/dist/generic/src/crypto/index.js +0 -34
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-mnemonic.d.ts +0 -12
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-mnemonic.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-mnemonic.js +0 -44
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-private-key.d.ts +0 -11
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-private-key.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/create-key-pair-from-private-key.js +0 -40
- package/dist/generic/src/crypto/private-public-keys/generation/create-256-private-key-from-mnemonic.d.ts +0 -11
- package/dist/generic/src/crypto/private-public-keys/generation/create-256-private-key-from-mnemonic.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/generation/create-256-private-key-from-mnemonic.js +0 -45
- package/dist/generic/src/crypto/private-public-keys/generation/create-entropy-for-elliptical-curve.d.ts +0 -10
- package/dist/generic/src/crypto/private-public-keys/generation/create-entropy-for-elliptical-curve.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/generation/create-entropy-for-elliptical-curve.js +0 -40
- package/dist/generic/src/crypto/private-public-keys/generation/create-random-256-private-key.d.ts +0 -8
- package/dist/generic/src/crypto/private-public-keys/generation/create-random-256-private-key.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/generation/create-random-256-private-key.js +0 -41
- package/dist/generic/src/crypto/private-public-keys/generation/generate-key-pair.d.ts +0 -11
- package/dist/generic/src/crypto/private-public-keys/generation/generate-key-pair.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/generation/generate-key-pair.js +0 -39
- package/dist/generic/src/crypto/private-public-keys/generation/get-private-public-key-from-keypair.d.ts +0 -15
- package/dist/generic/src/crypto/private-public-keys/generation/get-private-public-key-from-keypair.d.ts.map +0 -1
- package/dist/generic/src/crypto/private-public-keys/generation/get-private-public-key-from-keypair.js +0 -21
- package/dist/generic/src/crypto/signature/create-crypto-signature.d.ts +0 -9
- package/dist/generic/src/crypto/signature/create-crypto-signature.d.ts.map +0 -1
- package/dist/generic/src/crypto/signature/create-crypto-signature.js +0 -13
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-data.d.ts +0 -13
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-data.d.ts.map +0 -1
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-data.js +0 -45
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-hash.d.ts +0 -13
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-hash.d.ts.map +0 -1
- package/dist/generic/src/crypto/signature/verify-crypto-signature-by-hash.js +0 -42
- package/dist/generic/src/errors/audit-log/audit-log-errors.d.ts +0 -20
- package/dist/generic/src/errors/audit-log/audit-log-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/audit-log/audit-log-errors.js +0 -31
- package/dist/generic/src/errors/base-error.d.ts +0 -23
- package/dist/generic/src/errors/base-error.d.ts.map +0 -1
- package/dist/generic/src/errors/base-error.js +0 -34
- package/dist/generic/src/errors/database/database-errors.d.ts +0 -24
- package/dist/generic/src/errors/database/database-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/database/database-errors.js +0 -33
- package/dist/generic/src/errors/generic/generic-errors.d.ts +0 -35
- package/dist/generic/src/errors/generic/generic-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/generic/generic-errors.js +0 -47
- package/dist/generic/src/errors/index.d.ts +0 -9
- package/dist/generic/src/errors/index.d.ts.map +0 -1
- package/dist/generic/src/errors/index.js +0 -25
- package/dist/generic/src/errors/request/request-errors.d.ts +0 -89
- package/dist/generic/src/errors/request/request-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/request/request-errors.js +0 -120
- package/dist/generic/src/errors/safe/safe-rules-errors.d.ts +0 -102
- package/dist/generic/src/errors/safe/safe-rules-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/safe/safe-rules-errors.js +0 -152
- package/dist/generic/src/errors/scheduler/scheduler-errors.d.ts +0 -8
- package/dist/generic/src/errors/scheduler/scheduler-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/scheduler/scheduler-errors.js +0 -14
- package/dist/generic/src/errors/share-data/share-data-errors.d.ts +0 -67
- package/dist/generic/src/errors/share-data/share-data-errors.d.ts.map +0 -1
- package/dist/generic/src/errors/share-data/share-data-errors.js +0 -92
- package/dist/generic/src/helpers/array/array-helpers.d.ts +0 -16
- package/dist/generic/src/helpers/array/array-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/array/array-helpers.js +0 -25
- package/dist/generic/src/helpers/data/data-helpers.d.ts +0 -46
- package/dist/generic/src/helpers/data/data-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/data/data-helpers.js +0 -106
- package/dist/generic/src/helpers/file/file-helpers.d.ts +0 -13
- package/dist/generic/src/helpers/file/file-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/file/file-helpers.js +0 -43
- package/dist/generic/src/helpers/id-helpers.d.ts +0 -8
- package/dist/generic/src/helpers/id-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/id-helpers.js +0 -19
- package/dist/generic/src/helpers/index.d.ts +0 -11
- package/dist/generic/src/helpers/index.d.ts.map +0 -1
- package/dist/generic/src/helpers/index.js +0 -31
- package/dist/generic/src/helpers/lodash/lodash-helpers.d.ts +0 -14
- package/dist/generic/src/helpers/lodash/lodash-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/lodash/lodash-helpers.js +0 -28
- package/dist/generic/src/helpers/object-helpers.d.ts +0 -23
- package/dist/generic/src/helpers/object-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/object-helpers.js +0 -54
- package/dist/generic/src/helpers/object-validation-helpers.d.ts +0 -59
- package/dist/generic/src/helpers/object-validation-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/object-validation-helpers.js +0 -233
- package/dist/generic/src/helpers/request/params-object-helpers.d.ts +0 -38
- package/dist/generic/src/helpers/request/params-object-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/request/params-object-helpers.js +0 -54
- package/dist/generic/src/helpers/request/query-object-helpers.d.ts +0 -12
- package/dist/generic/src/helpers/request/query-object-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/request/query-object-helpers.js +0 -25
- package/dist/generic/src/helpers/request/request-object-helpers.d.ts +0 -19
- package/dist/generic/src/helpers/request/request-object-helpers.d.ts.map +0 -1
- package/dist/generic/src/helpers/request/request-object-helpers.js +0 -28
- package/dist/generic/src/index.d.ts +0 -6
- package/dist/generic/src/index.d.ts.map +0 -1
- package/dist/generic/src/index.js +0 -23
- package/dist/generic/src/models/data/data-models.d.ts +0 -24
- package/dist/generic/src/models/data/data-models.d.ts.map +0 -1
- package/dist/generic/src/models/data/data-models.js +0 -3
- package/dist/generic/src/models/dynamic-execution/dynamic-execution-models.d.ts +0 -9
- package/dist/generic/src/models/dynamic-execution/dynamic-execution-models.d.ts.map +0 -1
- package/dist/generic/src/models/dynamic-execution/dynamic-execution-models.js +0 -2
- package/dist/generic/src/models/events/share-event-models.d.ts +0 -65
- package/dist/generic/src/models/events/share-event-models.d.ts.map +0 -1
- package/dist/generic/src/models/events/share-event-models.js +0 -70
- package/dist/generic/src/models/functions/share-data-function-models.d.ts +0 -86
- package/dist/generic/src/models/functions/share-data-function-models.d.ts.map +0 -1
- package/dist/generic/src/models/functions/share-data-function-models.js +0 -17
- package/dist/generic/src/models/generic/request-response-models.d.ts +0 -8
- package/dist/generic/src/models/generic/request-response-models.d.ts.map +0 -1
- package/dist/generic/src/models/generic/request-response-models.js +0 -2
- package/dist/generic/src/models/index.d.ts +0 -8
- package/dist/generic/src/models/index.d.ts.map +0 -1
- package/dist/generic/src/models/index.js +0 -24
- package/dist/generic/src/models/rules/share-rule-models.d.ts +0 -303
- package/dist/generic/src/models/rules/share-rule-models.d.ts.map +0 -1
- package/dist/generic/src/models/rules/share-rule-models.js +0 -93
- package/dist/generic/src/models/share-data/share-data.d.ts +0 -55
- package/dist/generic/src/models/share-data/share-data.d.ts.map +0 -1
- package/dist/generic/src/models/share-data/share-data.js +0 -19
- package/dist/rules/src/__testdata__/conditions/current-conditions.test-data.d.ts.map +0 -1
- package/dist/rules/src/__testdata__/rules/rules.test-data.d.ts.map +0 -1
- package/dist/rules/src/__testdata__/rules/rules.test-data.js +0 -390
- package/dist/rules/src/create/conditions/create-boolean-conditions.d.ts.map +0 -1
- package/dist/rules/src/create/conditions/create-contains-conditions.d.ts.map +0 -1
- package/dist/rules/src/create/conditions/create-empty-conditions.d.ts.map +0 -1
- package/dist/rules/src/create/conditions/create-equality-conditions.d.ts.map +0 -1
- package/dist/rules/src/create/conditions/create-null-conditions.d.ts.map +0 -1
- package/dist/rules/src/create/conditions/create-range-conditions.d.ts.map +0 -1
- package/dist/rules/src/create/conditions/create-special-conditions.d.ts.map +0 -1
- package/dist/rules/src/create/conditions/create-starts-end-with-conditions.d.ts.map +0 -1
- package/dist/rules/src/create/conditions/create-typeof-conditions.d.ts.map +0 -1
- package/dist/rules/src/create/create-share-rule-applied.d.ts.map +0 -1
- package/dist/rules/src/create/create-share-rule-group.d.ts.map +0 -1
- package/dist/rules/src/create/create-share-rule-id.d.ts.map +0 -1
- package/dist/rules/src/create/create-share-rule-set.d.ts.map +0 -1
- package/dist/rules/src/create/create-share-rule.d.ts.map +0 -1
- package/dist/rules/src/create/index.d.ts.map +0 -1
- package/dist/rules/src/evaluation/check-function-integrity.d.ts.map +0 -1
- package/dist/rules/src/evaluation/check-if-proposal-is-valid.d.ts.map +0 -1
- package/dist/rules/src/evaluation/conditions/boolean-conditions.d.ts.map +0 -1
- package/dist/rules/src/evaluation/conditions/contains-conditions.d.ts.map +0 -1
- package/dist/rules/src/evaluation/conditions/empty-conditions.d.ts.map +0 -1
- package/dist/rules/src/evaluation/conditions/equality-conditions.d.ts.map +0 -1
- package/dist/rules/src/evaluation/conditions/null-conditions.d.ts.map +0 -1
- package/dist/rules/src/evaluation/conditions/range-conditions.d.ts.map +0 -1
- package/dist/rules/src/evaluation/conditions/special-conditions.d.ts.map +0 -1
- package/dist/rules/src/evaluation/conditions/starts-end-with-conditions.d.ts.map +0 -1
- package/dist/rules/src/evaluation/conditions/typeof-conditions.d.ts.map +0 -1
- package/dist/rules/src/evaluation/determine-if-data-has-changed.d.ts.map +0 -1
- package/dist/rules/src/evaluation/evaluate-rule-conditions.d.ts.map +0 -1
- package/dist/rules/src/evaluation/evaluate-rule.d.ts.map +0 -1
- package/dist/rules/src/evaluation/evaluate-rules.d.ts.map +0 -1
- package/dist/rules/src/evaluation/get-data-changed-information.d.ts.map +0 -1
- package/dist/rules/src/evaluation/get-root-property-results.d.ts.map +0 -1
- package/dist/rules/src/evaluation/index.d.ts.map +0 -1
- package/dist/rules/src/evaluation/start-rule-evaluation.d.ts.map +0 -1
- package/dist/rules/src/index.d.ts +0 -2
- package/dist/rules/src/index.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-base.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-boolean.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-contains.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-empty.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-equality.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-null.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-qualifier.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-range.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-share-rule.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-special.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-starts-ends-with.d.ts.map +0 -1
- package/dist/rules/src/validation/conditions/validate-condition-type-of.d.ts.map +0 -1
- package/dist/rules/src/validation/determine-condition-to-validate.d.ts.map +0 -1
- package/dist/rules/src/validation/index.d.ts.map +0 -1
- package/dist/rules/src/validation/validate-share-rule.d.ts.map +0 -1
- /package/dist/{rules/src/__testdata__ → __testdata__}/conditions/current-conditions.test-data.d.ts +0 -0
- /package/dist/{rules/src/__testdata__ → __testdata__}/conditions/current-conditions.test-data.js +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-boolean-conditions.d.ts +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-boolean-conditions.js +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-contains-conditions.d.ts +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-contains-conditions.js +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-empty-conditions.d.ts +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-empty-conditions.js +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-equality-conditions.d.ts +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-equality-conditions.js +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-null-conditions.d.ts +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-null-conditions.js +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-range-conditions.d.ts +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-range-conditions.js +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-special-conditions.d.ts +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-special-conditions.js +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-starts-end-with-conditions.d.ts +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-starts-end-with-conditions.js +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-typeof-conditions.d.ts +0 -0
- /package/dist/{rules/src/create → create}/conditions/create-typeof-conditions.js +0 -0
- /package/dist/{rules/src/create → create}/create-share-rule-applied.d.ts +0 -0
- /package/dist/{rules/src/create → create}/create-share-rule-applied.js +0 -0
- /package/dist/{rules/src/create → create}/create-share-rule-group.js +0 -0
- /package/dist/{rules/src/create → create}/create-share-rule-id.d.ts +0 -0
- /package/dist/{rules/src/create → create}/create-share-rule-id.js +0 -0
- /package/dist/{rules/src/create → create}/create-share-rule.d.ts +0 -0
- /package/dist/{rules/src/create → create}/create-share-rule.js +0 -0
- /package/dist/{rules/src/create → create}/index.d.ts +0 -0
- /package/dist/{rules/src/create → create}/index.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/check-function-integrity.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/check-function-integrity.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/check-if-proposal-is-valid.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/check-if-proposal-is-valid.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/boolean-conditions.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/boolean-conditions.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/contains-conditions.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/contains-conditions.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/empty-conditions.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/empty-conditions.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/equality-conditions.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/equality-conditions.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/null-conditions.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/null-conditions.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/range-conditions.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/range-conditions.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/special-conditions.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/special-conditions.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/starts-end-with-conditions.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/starts-end-with-conditions.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/typeof-conditions.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/conditions/typeof-conditions.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/determine-if-data-has-changed.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/determine-if-data-has-changed.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/evaluate-rule-conditions.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/evaluate-rule-conditions.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/evaluate-rule.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/evaluate-rule.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/evaluate-rules.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/evaluate-rules.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/get-data-changed-information.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/get-data-changed-information.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/get-root-property-results.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/get-root-property-results.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/index.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/index.js +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/start-rule-evaluation.d.ts +0 -0
- /package/dist/{rules/src/evaluation → evaluation}/start-rule-evaluation.js +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-base.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-boolean.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-contains.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-empty.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-equality.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-null.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-qualifier.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-range.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-share-rule.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-share-rule.js +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-special.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-starts-ends-with.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/conditions/validate-condition-type-of.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/determine-condition-to-validate.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/index.d.ts +0 -0
- /package/dist/{rules/src/validation → validation}/index.js +0 -0
- /package/dist/{rules/src/validation → validation}/validate-share-rule.d.ts +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-helpers.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/helpers/file/file-helpers.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,QAAA,MAAM,WAAW,YACN,MAAM,iBACD,MAAM,EAAE,2FAIrB,MAAM,EAsBR,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getAllFiles = void 0;
|
|
7
|
-
const fs_1 = __importDefault(require("fs"));
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
|
-
// This contains all the functions for helping with files in the degenerate packages.
|
|
10
|
-
/**
|
|
11
|
-
* This gets all the files in a directory recursively.
|
|
12
|
-
*
|
|
13
|
-
* @param dirPath the directory path to get the files from.
|
|
14
|
-
* @param arrayOfFiles the array of files to add to.
|
|
15
|
-
* @param ignoreIndexFiles the flag to ignore index files.
|
|
16
|
-
* @param ignoreTestFiles the flag to ignore test files.
|
|
17
|
-
* @param ignoreTestDataFiles the flag to ignore test data files.
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
const getAllFiles = (dirPath, arrayOfFiles = [], ignoreIndexFiles = true, ignoreTestFiles = true, ignoreTestDataFiles = true) => {
|
|
21
|
-
const files = fs_1.default.readdirSync(dirPath);
|
|
22
|
-
// loop through all the files in the directory.
|
|
23
|
-
files.forEach((file) => {
|
|
24
|
-
const filePath = path_1.default.join(dirPath, file);
|
|
25
|
-
if (fs_1.default.statSync(filePath).isDirectory()) {
|
|
26
|
-
getAllFiles(filePath, arrayOfFiles, ignoreIndexFiles, ignoreTestFiles, ignoreTestDataFiles);
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
if (ignoreTestFiles && file.endsWith('.test.ts')) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (ignoreTestDataFiles && file.endsWith('.test-data.ts')) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (ignoreIndexFiles && file === 'index.ts') {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
arrayOfFiles.push(filePath);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return arrayOfFiles;
|
|
42
|
-
};
|
|
43
|
-
exports.getAllFiles = getAllFiles;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"id-helpers.d.ts","sourceRoot":"","sources":["../../../../../generic/src/helpers/id-helpers.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,QAAA,MAAM,QAAQ,uBAAkB,MAS/B,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// This file contains the helper functions for generating ids.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.createId = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* This creates a random Id.
|
|
7
|
-
* @param length the length of the id to generate.
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
const createId = (length = 18) => {
|
|
11
|
-
let result = '';
|
|
12
|
-
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
|
13
|
-
const charactersLength = characters.length;
|
|
14
|
-
for (let i = 0; i < length; i++) {
|
|
15
|
-
result += characters.charAt(Math.floor(Math.random() * charactersLength));
|
|
16
|
-
}
|
|
17
|
-
return result;
|
|
18
|
-
};
|
|
19
|
-
exports.createId = createId;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from './id-helpers';
|
|
2
|
-
export * from './object-helpers';
|
|
3
|
-
export * from './object-validation-helpers';
|
|
4
|
-
export * from './request/params-object-helpers';
|
|
5
|
-
export * from './request/query-object-helpers';
|
|
6
|
-
export * from './request/request-object-helpers';
|
|
7
|
-
export * from './array/array-helpers';
|
|
8
|
-
export * from './data/data-helpers';
|
|
9
|
-
export * from './file/file-helpers';
|
|
10
|
-
export * from './lodash/lodash-helpers';
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../generic/src/helpers/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,6BAA6B,CAAC;AAM5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AAKjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
//#region main exports
|
|
18
|
-
__exportStar(require("./id-helpers"), exports);
|
|
19
|
-
__exportStar(require("./object-helpers"), exports);
|
|
20
|
-
__exportStar(require("./object-validation-helpers"), exports);
|
|
21
|
-
// #endregion main exports
|
|
22
|
-
// #region request exports
|
|
23
|
-
__exportStar(require("./request/params-object-helpers"), exports);
|
|
24
|
-
__exportStar(require("./request/query-object-helpers"), exports);
|
|
25
|
-
__exportStar(require("./request/request-object-helpers"), exports);
|
|
26
|
-
//#endregion request exports
|
|
27
|
-
// additional
|
|
28
|
-
__exportStar(require("./array/array-helpers"), exports);
|
|
29
|
-
__exportStar(require("./data/data-helpers"), exports);
|
|
30
|
-
__exportStar(require("./file/file-helpers"), exports);
|
|
31
|
-
__exportStar(require("./lodash/lodash-helpers"), exports);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/***************************************************
|
|
2
|
-
* This contains a list of the lodash equivalent functions without the lodash bloat and vulnerabilites.
|
|
3
|
-
****************************************************/
|
|
4
|
-
/**
|
|
5
|
-
* This function is used to break an array into smaller arrays.
|
|
6
|
-
*
|
|
7
|
-
* @param arr the array to be broken into smaller arrays.
|
|
8
|
-
* @param amount the amount of items to be in each array.
|
|
9
|
-
* @param startAt start at a specific index of this array
|
|
10
|
-
* @returns
|
|
11
|
-
*/
|
|
12
|
-
declare const chunk: <T>(arr: Array<T>, amount?: number, startAt?: number) => T[][];
|
|
13
|
-
export { chunk };
|
|
14
|
-
//# sourceMappingURL=lodash-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lodash-helpers.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/helpers/lodash/lodash-helpers.ts"],"names":[],"mappings":"AACA;;sDAEsD;AAEtD;;;;;;;GAOG;AACH,QAAA,MAAM,KAAK,GAAI,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,wCAA8B,CAAC,EAAE,EAW/D,CAAC;AAEF,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
/***************************************************
|
|
4
|
-
* This contains a list of the lodash equivalent functions without the lodash bloat and vulnerabilites.
|
|
5
|
-
****************************************************/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.chunk = void 0;
|
|
8
|
-
/**
|
|
9
|
-
* This function is used to break an array into smaller arrays.
|
|
10
|
-
*
|
|
11
|
-
* @param arr the array to be broken into smaller arrays.
|
|
12
|
-
* @param amount the amount of items to be in each array.
|
|
13
|
-
* @param startAt start at a specific index of this array
|
|
14
|
-
* @returns
|
|
15
|
-
*/
|
|
16
|
-
const chunk = (arr, amount = 300, startAt = 0) => {
|
|
17
|
-
const result = []; // setup the result.
|
|
18
|
-
const len = arr.length; // get the length
|
|
19
|
-
let startAtInside = startAt;
|
|
20
|
-
while (startAtInside < len) {
|
|
21
|
-
const totalLength = startAtInside + amount;
|
|
22
|
-
const newArray = arr.slice(startAtInside, totalLength);
|
|
23
|
-
result.push(newArray);
|
|
24
|
-
startAtInside += amount;
|
|
25
|
-
}
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
exports.chunk = chunk;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This takes a string and converts it to a string with spaces between each word and the first letter of each word capitalized.
|
|
3
|
-
* @param str the string to convert (e.g. "thisIsAString" or "This is a string")
|
|
4
|
-
* @returns the converted string (e.g. "This Is A String")
|
|
5
|
-
*/
|
|
6
|
-
declare const toCapitalizedWithSpaces: (str: string) => string;
|
|
7
|
-
/**
|
|
8
|
-
* This takes an object and removes any undefined items off it and then returns a new object.
|
|
9
|
-
* if the type passed in is a primitive type other than the object, it returns the original object.
|
|
10
|
-
*
|
|
11
|
-
* @param item the incoming item.
|
|
12
|
-
* @returns a clean version of the object.
|
|
13
|
-
*/
|
|
14
|
-
declare const removeUndefined: <T>(item: T, recurseObject?: boolean) => T;
|
|
15
|
-
/**
|
|
16
|
-
* This function removes all whitespace from a string
|
|
17
|
-
*
|
|
18
|
-
* @param str the string to remove whitespace from
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
declare const removeWhitespace: (str: string) => string;
|
|
22
|
-
export { toCapitalizedWithSpaces, removeUndefined, removeWhitespace, };
|
|
23
|
-
//# sourceMappingURL=object-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-helpers.d.ts","sourceRoot":"","sources":["../../../../../generic/src/helpers/object-helpers.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,QAAS,MAAM,KAAG,MAK9C,CAAC;AAEF;;;;;;GAMG;AACH,QAAA,MAAM,eAAe,GAAI,CAAC,QAAQ,CAAC,8BAA0B,CAiB5D,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,gBAAgB,QAAS,MAAM,KAAG,MAEvC,CAAC;AAEF,OAAO,EACH,uBAAuB,EACvB,eAAe,EACf,gBAAgB,GACnB,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// This file contains helper functions for working with objects.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.removeWhitespace = exports.removeUndefined = exports.toCapitalizedWithSpaces = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* This takes a string and converts it to a string with spaces between each word and the first letter of each word capitalized.
|
|
7
|
-
* @param str the string to convert (e.g. "thisIsAString" or "This is a string")
|
|
8
|
-
* @returns the converted string (e.g. "This Is A String")
|
|
9
|
-
*/
|
|
10
|
-
const toCapitalizedWithSpaces = (str) => {
|
|
11
|
-
// Add a space before all uppercase letters (except the first one), then trim any leading/trailing spaces
|
|
12
|
-
const result = str.replace(/(?!^)([A-Z])/g, ' $1').trim();
|
|
13
|
-
// Capitalize the first letter of each word
|
|
14
|
-
return result.replace(/\b\w/g, (char) => char.toUpperCase());
|
|
15
|
-
};
|
|
16
|
-
exports.toCapitalizedWithSpaces = toCapitalizedWithSpaces;
|
|
17
|
-
/**
|
|
18
|
-
* This takes an object and removes any undefined items off it and then returns a new object.
|
|
19
|
-
* if the type passed in is a primitive type other than the object, it returns the original object.
|
|
20
|
-
*
|
|
21
|
-
* @param item the incoming item.
|
|
22
|
-
* @returns a clean version of the object.
|
|
23
|
-
*/
|
|
24
|
-
const removeUndefined = (item, recurseObject = false) => {
|
|
25
|
-
if (Array.isArray(item)) {
|
|
26
|
-
return item
|
|
27
|
-
.filter((element) => element !== undefined)
|
|
28
|
-
.map((element) => (recurseObject && Array.isArray(element) ? removeUndefined(element, true) : element));
|
|
29
|
-
}
|
|
30
|
-
else if (typeof item === 'object' && item !== null) {
|
|
31
|
-
const returnObject = { ...item };
|
|
32
|
-
Object.keys(returnObject).forEach((key) => {
|
|
33
|
-
if (returnObject[key] === undefined) {
|
|
34
|
-
delete returnObject[key];
|
|
35
|
-
}
|
|
36
|
-
else if (recurseObject && (typeof returnObject[key] === 'object' || Array.isArray(returnObject[key]))) {
|
|
37
|
-
returnObject[key] = removeUndefined(returnObject[key], true);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
return returnObject;
|
|
41
|
-
}
|
|
42
|
-
return item;
|
|
43
|
-
};
|
|
44
|
-
exports.removeUndefined = removeUndefined;
|
|
45
|
-
/**
|
|
46
|
-
* This function removes all whitespace from a string
|
|
47
|
-
*
|
|
48
|
-
* @param str the string to remove whitespace from
|
|
49
|
-
* @returns
|
|
50
|
-
*/
|
|
51
|
-
const removeWhitespace = (str) => {
|
|
52
|
-
return str.replace(/\s/g, '');
|
|
53
|
-
};
|
|
54
|
-
exports.removeWhitespace = removeWhitespace;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks that an object is an array and that it has the minimum number of items.
|
|
3
|
-
*
|
|
4
|
-
* @param incomingObject the object to check
|
|
5
|
-
* @param minimumLength the minimum number of objects to match (zero by default)
|
|
6
|
-
* @param maximumLength the maximum number of objects to match will default to the array length if not provided
|
|
7
|
-
*
|
|
8
|
-
* @returns whether the criteria matches.
|
|
9
|
-
*/
|
|
10
|
-
declare const validateArray: (incomingObject: unknown, minimumLength?: number, maximumLength?: number) => boolean;
|
|
11
|
-
/**
|
|
12
|
-
* This validates an incoming shape of a boolean type data.
|
|
13
|
-
*
|
|
14
|
-
* @param incomingObject an object to validate as a boolean.
|
|
15
|
-
* @param undefinedValid whether the item can be undefined or not (false by default)
|
|
16
|
-
*
|
|
17
|
-
* @returns whether the shape is valid.
|
|
18
|
-
*/
|
|
19
|
-
declare const validateBoolean: (incomingObject: unknown, undefinedValid?: boolean) => boolean;
|
|
20
|
-
/**
|
|
21
|
-
* This validates a date object or a string that can be converted to a date object.
|
|
22
|
-
* @param dateToValidate the date to validate
|
|
23
|
-
* @param undefinedValid whether the item can be undefined or not (false by default)
|
|
24
|
-
* @param allowFutureDated the date can be in the future (false by default)
|
|
25
|
-
* @param ensureAtLeast18YearsAgo whether the date is at least 18 years ago (true by default)
|
|
26
|
-
*
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
declare const validateDate: (dateToValidate: unknown, undefinedValid?: boolean, allowFutureDated?: boolean, ensureAtLeast18YearsAgo?: boolean) => boolean;
|
|
30
|
-
/**
|
|
31
|
-
* This validates that the incoming Object is a number and that it is in the range (if provided)
|
|
32
|
-
*
|
|
33
|
-
* @param incomingObject object to validate to a number
|
|
34
|
-
* @param min (optional) minimum number
|
|
35
|
-
* @param max (optional) maximum number
|
|
36
|
-
* @returns
|
|
37
|
-
*/
|
|
38
|
-
declare const validateNumber: (incomingObject: unknown, min?: number, max?: number) => boolean;
|
|
39
|
-
/**
|
|
40
|
-
* This validates an incoming shape of a set of files links to the data.
|
|
41
|
-
*
|
|
42
|
-
* @param incomingObject an object to validate as a string.
|
|
43
|
-
* @param hasNoSpaces whether the item should have no spaces in it (false by default)
|
|
44
|
-
* @param undefinedValid whether the item can be undefined or not (false by default)
|
|
45
|
-
* @param emptyStringValid whether the item can be an empty string or not (false by default)
|
|
46
|
-
*
|
|
47
|
-
* @returns whether the shape is valid.
|
|
48
|
-
*/
|
|
49
|
-
declare const validateString: (incomingObject: unknown, hasNoSpaces?: boolean, undefinedValid?: boolean, emptyStringValid?: boolean) => boolean;
|
|
50
|
-
/**
|
|
51
|
-
* This validates that an incoming object is a valid URL.
|
|
52
|
-
*
|
|
53
|
-
* @param incomingUrl the URL to check
|
|
54
|
-
* @param undefinedValid whether the item can be undefined or not (false by default)
|
|
55
|
-
* @returns wether it is a valid URL or not
|
|
56
|
-
*/
|
|
57
|
-
declare const validateUrl: (incomingUrl: unknown, undefinedValid?: boolean) => boolean;
|
|
58
|
-
export { validateArray, validateBoolean, validateDate, validateNumber, validateString, validateUrl, };
|
|
59
|
-
//# sourceMappingURL=object-validation-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"object-validation-helpers.d.ts","sourceRoot":"","sources":["../../../../../generic/src/helpers/object-validation-helpers.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,mBAAoB,OAAO,0CAAqC,MAAM,KAAG,OAc3F,CAAC;AAEF;;;;;;;GAOG;AACH,QAAA,MAAM,eAAe,mBAAoB,OAAO,+BAA2B,OAS1E,CAAC;AAEF;;;;;;;;GAQG;AACH,QAAA,MAAM,YAAY,mBAAoB,OAAO,8FACP,OAoCrC,CAAC;AAEF;;;;;;;GAOG;AACH,QAAA,MAAM,cAAc,mBAAoB,OAAO,QAAQ,MAAM,QAAQ,MAAM,KAAG,OAU7E,CAAC;AAEF;;;;;;;;;GASG;AACH,QAAA,MAAM,cAAc,mBAAoB,OAAO,kFAA0E,OAiCxH,CAAC;AAEF;;;;;;GAMG;AACH,QAAA,MAAM,WAAW,gBAAiB,OAAO,+BAA2B,OAqBnE,CAAC;AA+CF,OAAO,EACH,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,cAAc,EACd,WAAW,GACd,CAAC"}
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// This file contains the validation functions for objects.
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.validateUrl = exports.validateString = exports.validateNumber = exports.validateDate = exports.validateBoolean = exports.validateArray = void 0;
|
|
5
|
-
/**
|
|
6
|
-
* Checks that an object is an array and that it has the minimum number of items.
|
|
7
|
-
*
|
|
8
|
-
* @param incomingObject the object to check
|
|
9
|
-
* @param minimumLength the minimum number of objects to match (zero by default)
|
|
10
|
-
* @param maximumLength the maximum number of objects to match will default to the array length if not provided
|
|
11
|
-
*
|
|
12
|
-
* @returns whether the criteria matches.
|
|
13
|
-
*/
|
|
14
|
-
const validateArray = (incomingObject, minimumLength = 0, maximumLength) => {
|
|
15
|
-
if (incomingObject && Array.isArray(incomingObject) && incomingObject.length >= minimumLength) {
|
|
16
|
-
if (!maximumLength) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
if (incomingObject.length <= maximumLength) {
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
exports.validateArray = validateArray;
|
|
33
|
-
/**
|
|
34
|
-
* This validates an incoming shape of a boolean type data.
|
|
35
|
-
*
|
|
36
|
-
* @param incomingObject an object to validate as a boolean.
|
|
37
|
-
* @param undefinedValid whether the item can be undefined or not (false by default)
|
|
38
|
-
*
|
|
39
|
-
* @returns whether the shape is valid.
|
|
40
|
-
*/
|
|
41
|
-
const validateBoolean = (incomingObject, undefinedValid = false) => {
|
|
42
|
-
if (undefinedValid && typeof incomingObject === 'undefined') { // if undefined is valid and it"s undefined
|
|
43
|
-
return true;
|
|
44
|
-
}
|
|
45
|
-
if (typeof incomingObject === 'boolean') {
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
exports.validateBoolean = validateBoolean;
|
|
53
|
-
/**
|
|
54
|
-
* This validates a date object or a string that can be converted to a date object.
|
|
55
|
-
* @param dateToValidate the date to validate
|
|
56
|
-
* @param undefinedValid whether the item can be undefined or not (false by default)
|
|
57
|
-
* @param allowFutureDated the date can be in the future (false by default)
|
|
58
|
-
* @param ensureAtLeast18YearsAgo whether the date is at least 18 years ago (true by default)
|
|
59
|
-
*
|
|
60
|
-
* @returns
|
|
61
|
-
*/
|
|
62
|
-
const validateDate = (dateToValidate, undefinedValid = false, allowFutureDated = false, ensureAtLeast18YearsAgo = false) => {
|
|
63
|
-
if (undefinedValid && (typeof dateToValidate === 'undefined' || dateToValidate === '' || dateToValidate === null)) {
|
|
64
|
-
return true;
|
|
65
|
-
}
|
|
66
|
-
let date; // a placeholder for the date object
|
|
67
|
-
if (typeof dateToValidate === 'string') {
|
|
68
|
-
date = new Date(dateToValidate); // try to parse the date
|
|
69
|
-
if (isNaN(date.getTime())) { // if it's not a valid date
|
|
70
|
-
return false; // return false
|
|
71
|
-
}
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
if (!(typeof dateToValidate === 'object' && dateToValidate !== null)) {
|
|
76
|
-
return false; // the date isn't an object
|
|
77
|
-
}
|
|
78
|
-
if (Object.prototype.toString.call(dateToValidate) !== '[object Date]') {
|
|
79
|
-
return false; // the date isn't a date object
|
|
80
|
-
}
|
|
81
|
-
// Check if the date is in the future and this is not allowed
|
|
82
|
-
if (!allowFutureDated && dateToValidate > new Date()) {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
// determine if the date is newer than 18 years in the past
|
|
86
|
-
if (ensureAtLeast18YearsAgo) {
|
|
87
|
-
const today = new Date();
|
|
88
|
-
const eighteenYearsAgo = new Date(today.getFullYear() - 18, today.getMonth(), today.getDate());
|
|
89
|
-
return dateToValidate <= eighteenYearsAgo;
|
|
90
|
-
}
|
|
91
|
-
// otherwise the date is valid.
|
|
92
|
-
return true;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
exports.validateDate = validateDate;
|
|
96
|
-
/**
|
|
97
|
-
* This validates that the incoming Object is a number and that it is in the range (if provided)
|
|
98
|
-
*
|
|
99
|
-
* @param incomingObject object to validate to a number
|
|
100
|
-
* @param min (optional) minimum number
|
|
101
|
-
* @param max (optional) maximum number
|
|
102
|
-
* @returns
|
|
103
|
-
*/
|
|
104
|
-
const validateNumber = (incomingObject, min, max) => {
|
|
105
|
-
if (typeof incomingObject === 'number') {
|
|
106
|
-
if (validateMin(incomingObject, min) && validateMax(incomingObject, max)) {
|
|
107
|
-
return true;
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
return false;
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
exports.validateNumber = validateNumber;
|
|
118
|
-
/**
|
|
119
|
-
* This validates an incoming shape of a set of files links to the data.
|
|
120
|
-
*
|
|
121
|
-
* @param incomingObject an object to validate as a string.
|
|
122
|
-
* @param hasNoSpaces whether the item should have no spaces in it (false by default)
|
|
123
|
-
* @param undefinedValid whether the item can be undefined or not (false by default)
|
|
124
|
-
* @param emptyStringValid whether the item can be an empty string or not (false by default)
|
|
125
|
-
*
|
|
126
|
-
* @returns whether the shape is valid.
|
|
127
|
-
*/
|
|
128
|
-
const validateString = (incomingObject, hasNoSpaces = false, undefinedValid = false, emptyStringValid = false) => {
|
|
129
|
-
// if undefined is valid and check if it's undefined and if so, return true
|
|
130
|
-
if (undefinedValid) {
|
|
131
|
-
if (typeof incomingObject === 'undefined') { // if undefined is valid and it"s undefined
|
|
132
|
-
return true;
|
|
133
|
-
}
|
|
134
|
-
if (incomingObject === null) { // include null values.
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
// Check if the string is empty and if it's valid to be empty
|
|
139
|
-
if (emptyStringValid) {
|
|
140
|
-
if (typeof incomingObject === 'string' && incomingObject.length === 0) {
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
// if it's a string and it's not empty
|
|
145
|
-
if (typeof incomingObject === 'string') {
|
|
146
|
-
// check that it is a string and that it is not empty
|
|
147
|
-
if (incomingObject.length === 0) {
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
150
|
-
// check if it has no spaces
|
|
151
|
-
if (hasNoSpaces) {
|
|
152
|
-
return incomingObject.indexOf(' ') === -1;
|
|
153
|
-
}
|
|
154
|
-
// otherwise it's a valid string
|
|
155
|
-
return true;
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
return false;
|
|
159
|
-
}
|
|
160
|
-
};
|
|
161
|
-
exports.validateString = validateString;
|
|
162
|
-
/**
|
|
163
|
-
* This validates that an incoming object is a valid URL.
|
|
164
|
-
*
|
|
165
|
-
* @param incomingUrl the URL to check
|
|
166
|
-
* @param undefinedValid whether the item can be undefined or not (false by default)
|
|
167
|
-
* @returns wether it is a valid URL or not
|
|
168
|
-
*/
|
|
169
|
-
const validateUrl = (incomingUrl, undefinedValid = false) => {
|
|
170
|
-
if (undefinedValid && (typeof incomingUrl === 'undefined' || incomingUrl === '')) { // if undefined is valid and it"s undefined
|
|
171
|
-
return true;
|
|
172
|
-
}
|
|
173
|
-
if (typeof incomingUrl !== 'string') {
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
|
-
if (incomingUrl.indexOf(' ') !== -1) {
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
//Is it recognized as a valid URL?
|
|
180
|
-
let givenURL;
|
|
181
|
-
try {
|
|
182
|
-
givenURL = new URL(incomingUrl);
|
|
183
|
-
//Is the domain name a valid one with TLD and using HTTP or HTTPS?
|
|
184
|
-
const validDomainRegexp = /^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/im;
|
|
185
|
-
return validDomainRegexp.test(givenURL.host) && (givenURL.protocol === 'http:' || givenURL.protocol === 'https:');
|
|
186
|
-
}
|
|
187
|
-
catch (error) {
|
|
188
|
-
return false;
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
exports.validateUrl = validateUrl;
|
|
192
|
-
//#endregion Public Functions
|
|
193
|
-
//#region Internal Functions
|
|
194
|
-
/**
|
|
195
|
-
* validates that an incoming number is greater than the minimum if it was provided.
|
|
196
|
-
*
|
|
197
|
-
* @param incomingNumber the number to check
|
|
198
|
-
* @param min the minimum value.
|
|
199
|
-
* @returns
|
|
200
|
-
*/
|
|
201
|
-
const validateMin = (incomingNumber, min) => {
|
|
202
|
-
if (typeof min === 'number') {
|
|
203
|
-
if (incomingNumber >= min) {
|
|
204
|
-
return true;
|
|
205
|
-
}
|
|
206
|
-
else {
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
else {
|
|
211
|
-
return true;
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
/**
|
|
215
|
-
* validates that an incoming number is less than or equal to the mamimum if it was provided.
|
|
216
|
-
*
|
|
217
|
-
* @param incomingNumber the number to check
|
|
218
|
-
* @param max the maximum value.
|
|
219
|
-
* @returns
|
|
220
|
-
*/
|
|
221
|
-
const validateMax = (incomingNumber, max) => {
|
|
222
|
-
if (typeof max === 'number') {
|
|
223
|
-
if (incomingNumber <= max) {
|
|
224
|
-
return true;
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
return false;
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
return true;
|
|
232
|
-
}
|
|
233
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The pattern for this is:
|
|
3
|
-
* Parameters are always in the request object and lowercase.
|
|
4
|
-
*
|
|
5
|
-
* const getExampleParamId = (req: any): string => {
|
|
6
|
-
* return req.params.exampleid;
|
|
7
|
-
* };
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* The function gets the share data id from the restful parameter object
|
|
11
|
-
*
|
|
12
|
-
* @param req the incoming request
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
declare const getParamShareDataId: (req: any) => string;
|
|
16
|
-
/**
|
|
17
|
-
* The function gets the function id from the restful parameter object
|
|
18
|
-
*
|
|
19
|
-
* @param req the incoming request
|
|
20
|
-
* @returns
|
|
21
|
-
*/
|
|
22
|
-
declare const getParamFunctionId: (req: any) => string;
|
|
23
|
-
/**
|
|
24
|
-
* The function gets the rule id from the restful parameter object
|
|
25
|
-
*
|
|
26
|
-
* @param req the incoming request
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
declare const getParamRulesId: (req: any) => string;
|
|
30
|
-
/**
|
|
31
|
-
* The function gets the event id from the restful parameter object
|
|
32
|
-
*
|
|
33
|
-
* @param req the incoming request
|
|
34
|
-
* @returns
|
|
35
|
-
*/
|
|
36
|
-
declare const getParamEventId: (req: any) => string;
|
|
37
|
-
export { getParamShareDataId, getParamFunctionId, getParamRulesId, getParamEventId };
|
|
38
|
-
//# sourceMappingURL=params-object-helpers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"params-object-helpers.d.ts","sourceRoot":"","sources":["../../../../../../generic/src/helpers/request/params-object-helpers.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AAIH;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,QAAS,GAAG,KAAG,MAEvC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,kBAAkB,QAAS,GAAG,KAAG,MAEtC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,eAAe,QAAS,GAAG,KAAG,MAEnC,CAAA;AAED;;;;;GAKG;AACH,QAAA,MAAM,eAAe,QAAS,GAAG,KAAG,MAEnC,CAAA;AAID,OAAO,EACH,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,EACf,eAAe,EAClB,CAAA"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
// This file contains the functions to get the incoming params in the request object.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.getParamEventId = exports.getParamRulesId = exports.getParamFunctionId = exports.getParamShareDataId = void 0;
|
|
6
|
-
/**
|
|
7
|
-
* The pattern for this is:
|
|
8
|
-
* Parameters are always in the request object and lowercase.
|
|
9
|
-
*
|
|
10
|
-
* const getExampleParamId = (req: any): string => {
|
|
11
|
-
* return req.params.exampleid;
|
|
12
|
-
* };
|
|
13
|
-
*/
|
|
14
|
-
// #region Network Requests
|
|
15
|
-
/**
|
|
16
|
-
* The function gets the share data id from the restful parameter object
|
|
17
|
-
*
|
|
18
|
-
* @param req the incoming request
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
const getParamShareDataId = (req) => {
|
|
22
|
-
return req.params.sharedataid;
|
|
23
|
-
};
|
|
24
|
-
exports.getParamShareDataId = getParamShareDataId;
|
|
25
|
-
/**
|
|
26
|
-
* The function gets the function id from the restful parameter object
|
|
27
|
-
*
|
|
28
|
-
* @param req the incoming request
|
|
29
|
-
* @returns
|
|
30
|
-
*/
|
|
31
|
-
const getParamFunctionId = (req) => {
|
|
32
|
-
return req.params.functionid;
|
|
33
|
-
};
|
|
34
|
-
exports.getParamFunctionId = getParamFunctionId;
|
|
35
|
-
/**
|
|
36
|
-
* The function gets the rule id from the restful parameter object
|
|
37
|
-
*
|
|
38
|
-
* @param req the incoming request
|
|
39
|
-
* @returns
|
|
40
|
-
*/
|
|
41
|
-
const getParamRulesId = (req) => {
|
|
42
|
-
return req.params.rulesid;
|
|
43
|
-
};
|
|
44
|
-
exports.getParamRulesId = getParamRulesId;
|
|
45
|
-
/**
|
|
46
|
-
* The function gets the event id from the restful parameter object
|
|
47
|
-
*
|
|
48
|
-
* @param req the incoming request
|
|
49
|
-
* @returns
|
|
50
|
-
*/
|
|
51
|
-
const getParamEventId = (req) => {
|
|
52
|
-
return req.params.eventid;
|
|
53
|
-
};
|
|
54
|
-
exports.getParamEventId = getParamEventId;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file contains the functions to get the incoming query in the request object.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Get the lastId from the query object and throw an error if it is not a string or not present.
|
|
6
|
-
*
|
|
7
|
-
* @param req the incoming request object
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
declare const getQueryLastId: (req: any) => string;
|
|
11
|
-
export { getQueryLastId };
|
|
12
|
-
//# sourceMappingURL=query-object-helpers.d.ts.map
|