@blazedpath/commons 0.2.2 → 0.3.1
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/README.md +4 -1
- package/dist/blz-base/health/index.d.ts +1 -0
- package/dist/blz-base/health/index.js +1 -0
- package/dist/blz-base/index.d.ts +108 -0
- package/dist/blz-base/index.js +1 -0
- package/dist/blz-cache/LruCache.d.ts +31 -0
- package/dist/blz-cache/LruCache.js +1 -0
- package/dist/blz-cache/index.d.ts +2 -0
- package/dist/blz-cache/index.js +1 -0
- package/dist/blz-config/index.d.ts +16 -0
- package/dist/blz-config/index.js +1 -0
- package/dist/blz-core/index.d.ts +32 -0
- package/dist/blz-core/index.js +1 -0
- package/dist/blz-cryptography/index.d.ts +2 -0
- package/dist/blz-cryptography/index.js +1 -0
- package/dist/blz-datetimes/index.d.ts +35 -0
- package/dist/blz-datetimes/index.js +1 -0
- package/dist/blz-file/fileService.d.ts +25 -0
- package/dist/blz-file/fileService.js +1 -0
- package/dist/blz-file/index.d.ts +2 -0
- package/dist/blz-file/index.js +1 -0
- package/dist/blz-file/index.test.js +1 -0
- package/dist/blz-file/lab.js +1 -0
- package/dist/blz-hazelcast/index.d.ts +25 -0
- package/dist/blz-hazelcast/index.js +1 -0
- package/dist/blz-hazelcast/lib/credentials.d.ts +10 -0
- package/dist/blz-hazelcast/lib/credentials.js +1 -0
- package/dist/blz-hazelcast/lib/credentialsFactory.d.ts +1 -0
- package/dist/blz-hazelcast/lib/credentialsFactory.js +1 -0
- package/dist/blz-hazelcast/lib/hazelcastCache.d.ts +27 -0
- package/dist/blz-hazelcast/lib/hazelcastCache.js +1 -0
- package/dist/blz-iterable/index.d.ts +49 -0
- package/dist/blz-iterable/index.js +1 -0
- package/dist/blz-json-schema/index.d.ts +1 -0
- package/dist/blz-json-schema/index.js +1 -0
- package/dist/blz-jwt/index.d.ts +12 -0
- package/dist/blz-jwt/index.js +1 -0
- package/dist/blz-kafka/index.d.ts +9 -0
- package/dist/blz-kafka/index.js +1 -0
- package/dist/blz-math/index.d.ts +22 -0
- package/dist/blz-math/index.js +1 -0
- package/dist/blz-mongodb/index.d.ts +28 -0
- package/dist/blz-mongodb/index.js +1 -0
- package/dist/blz-rds/__test__/scape.test.js +1 -0
- package/dist/blz-rds/blz-rds-executor.d.ts +4 -0
- package/dist/blz-rds/blz-rds-executor.js +1 -0
- package/dist/blz-rds/blz-rds-helper.d.ts +5 -0
- package/dist/blz-rds/blz-rds-helper.js +1 -0
- package/dist/blz-rds/commands/core/add.d.ts +2 -0
- package/dist/blz-rds/commands/core/add.js +1 -0
- package/dist/blz-rds/commands/core/and.d.ts +3 -0
- package/dist/blz-rds/commands/core/and.js +1 -0
- package/dist/blz-rds/commands/core/asc.d.ts +2 -0
- package/dist/blz-rds/commands/core/asc.js +1 -0
- package/dist/blz-rds/commands/core/avg.d.ts +2 -0
- package/dist/blz-rds/commands/core/avg.js +1 -0
- package/dist/blz-rds/commands/core/column-ref.d.ts +2 -0
- package/dist/blz-rds/commands/core/column-ref.js +1 -0
- package/dist/blz-rds/commands/core/count-distinct.d.ts +2 -0
- package/dist/blz-rds/commands/core/count-distinct.js +1 -0
- package/dist/blz-rds/commands/core/count.d.ts +2 -0
- package/dist/blz-rds/commands/core/count.js +1 -0
- package/dist/blz-rds/commands/core/decimal.d.ts +2 -0
- package/dist/blz-rds/commands/core/decimal.js +1 -0
- package/dist/blz-rds/commands/core/desc.d.ts +2 -0
- package/dist/blz-rds/commands/core/desc.js +1 -0
- package/dist/blz-rds/commands/core/distinct.d.ts +2 -0
- package/dist/blz-rds/commands/core/distinct.js +1 -0
- package/dist/blz-rds/commands/core/divide.d.ts +2 -0
- package/dist/blz-rds/commands/core/divide.js +1 -0
- package/dist/blz-rds/commands/core/embedded-exists.d.ts +3 -0
- package/dist/blz-rds/commands/core/embedded-exists.js +1 -0
- package/dist/blz-rds/commands/core/embedded-select.d.ts +2 -0
- package/dist/blz-rds/commands/core/embedded-select.js +1 -0
- package/dist/blz-rds/commands/core/equals.d.ts +3 -0
- package/dist/blz-rds/commands/core/equals.js +1 -0
- package/dist/blz-rds/commands/core/false.d.ts +2 -0
- package/dist/blz-rds/commands/core/false.js +1 -0
- package/dist/blz-rds/commands/core/greater-or-equal.d.ts +3 -0
- package/dist/blz-rds/commands/core/greater-or-equal.js +1 -0
- package/dist/blz-rds/commands/core/greater.d.ts +3 -0
- package/dist/blz-rds/commands/core/greater.js +1 -0
- package/dist/blz-rds/commands/core/in.d.ts +3 -0
- package/dist/blz-rds/commands/core/in.js +1 -0
- package/dist/blz-rds/commands/core/integer.d.ts +2 -0
- package/dist/blz-rds/commands/core/integer.js +1 -0
- package/dist/blz-rds/commands/core/is-not-null.d.ts +3 -0
- package/dist/blz-rds/commands/core/is-not-null.js +1 -0
- package/dist/blz-rds/commands/core/is-null-or-value.d.ts +3 -0
- package/dist/blz-rds/commands/core/is-null-or-value.js +1 -0
- package/dist/blz-rds/commands/core/is-null.d.ts +3 -0
- package/dist/blz-rds/commands/core/is-null.js +1 -0
- package/dist/blz-rds/commands/core/less-or-equal.d.ts +3 -0
- package/dist/blz-rds/commands/core/less-or-equal.js +1 -0
- package/dist/blz-rds/commands/core/less-unary.d.ts +2 -0
- package/dist/blz-rds/commands/core/less-unary.js +1 -0
- package/dist/blz-rds/commands/core/less.d.ts +3 -0
- package/dist/blz-rds/commands/core/less.js +1 -0
- package/dist/blz-rds/commands/core/like.d.ts +3 -0
- package/dist/blz-rds/commands/core/like.js +1 -0
- package/dist/blz-rds/commands/core/max.d.ts +2 -0
- package/dist/blz-rds/commands/core/max.js +1 -0
- package/dist/blz-rds/commands/core/min.d.ts +2 -0
- package/dist/blz-rds/commands/core/min.js +1 -0
- package/dist/blz-rds/commands/core/multiply.d.ts +2 -0
- package/dist/blz-rds/commands/core/multiply.js +1 -0
- package/dist/blz-rds/commands/core/not-equals.d.ts +3 -0
- package/dist/blz-rds/commands/core/not-equals.js +1 -0
- package/dist/blz-rds/commands/core/not-in.d.ts +3 -0
- package/dist/blz-rds/commands/core/not-in.js +1 -0
- package/dist/blz-rds/commands/core/not.d.ts +3 -0
- package/dist/blz-rds/commands/core/not.js +1 -0
- package/dist/blz-rds/commands/core/null.d.ts +2 -0
- package/dist/blz-rds/commands/core/null.js +1 -0
- package/dist/blz-rds/commands/core/nvl.d.ts +2 -0
- package/dist/blz-rds/commands/core/nvl.js +1 -0
- package/dist/blz-rds/commands/core/or.d.ts +3 -0
- package/dist/blz-rds/commands/core/or.js +1 -0
- package/dist/blz-rds/commands/core/parameter.d.ts +2 -0
- package/dist/blz-rds/commands/core/parameter.js +1 -0
- package/dist/blz-rds/commands/core/remainder.d.ts +2 -0
- package/dist/blz-rds/commands/core/remainder.js +1 -0
- package/dist/blz-rds/commands/core/string.d.ts +2 -0
- package/dist/blz-rds/commands/core/string.js +1 -0
- package/dist/blz-rds/commands/core/subtract.d.ts +2 -0
- package/dist/blz-rds/commands/core/subtract.js +1 -0
- package/dist/blz-rds/commands/core/sum.d.ts +2 -0
- package/dist/blz-rds/commands/core/sum.js +1 -0
- package/dist/blz-rds/commands/core/true.d.ts +2 -0
- package/dist/blz-rds/commands/core/true.js +1 -0
- package/dist/blz-rds/commands/core/tuple.d.ts +2 -0
- package/dist/blz-rds/commands/core/tuple.js +1 -0
- package/dist/blz-rds/commands/datetimes/add-days.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/add-days.js +1 -0
- package/dist/blz-rds/commands/datetimes/add-hours.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/add-hours.js +1 -0
- package/dist/blz-rds/commands/datetimes/add-milliseconds.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/add-milliseconds.js +1 -0
- package/dist/blz-rds/commands/datetimes/add-minutes.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/add-minutes.js +1 -0
- package/dist/blz-rds/commands/datetimes/add-months.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/add-months.js +1 -0
- package/dist/blz-rds/commands/datetimes/add-seconds.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/add-seconds.js +1 -0
- package/dist/blz-rds/commands/datetimes/add-years.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/add-years.js +1 -0
- package/dist/blz-rds/commands/datetimes/date-diff.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/date-diff.js +1 -0
- package/dist/blz-rds/commands/datetimes/date.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/date.js +1 -0
- package/dist/blz-rds/commands/datetimes/datetime-diff.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/datetime-diff.js +1 -0
- package/dist/blz-rds/commands/datetimes/datetime.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/datetime.js +1 -0
- package/dist/blz-rds/commands/datetimes/day.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/day.js +1 -0
- package/dist/blz-rds/commands/datetimes/hour.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/hour.js +1 -0
- package/dist/blz-rds/commands/datetimes/millisecond.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/millisecond.js +1 -0
- package/dist/blz-rds/commands/datetimes/minute.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/minute.js +1 -0
- package/dist/blz-rds/commands/datetimes/month-text.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/month-text.js +1 -0
- package/dist/blz-rds/commands/datetimes/month.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/month.js +1 -0
- package/dist/blz-rds/commands/datetimes/now.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/now.js +1 -0
- package/dist/blz-rds/commands/datetimes/second.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/second.js +1 -0
- package/dist/blz-rds/commands/datetimes/subtract-days.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/subtract-days.js +1 -0
- package/dist/blz-rds/commands/datetimes/subtract-hours.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/subtract-hours.js +1 -0
- package/dist/blz-rds/commands/datetimes/subtract-milliseconds.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/subtract-milliseconds.js +1 -0
- package/dist/blz-rds/commands/datetimes/subtract-minutes.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/subtract-minutes.js +1 -0
- package/dist/blz-rds/commands/datetimes/subtract-seconds.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/subtract-seconds.js +1 -0
- package/dist/blz-rds/commands/datetimes/time-diff.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/time-diff.js +1 -0
- package/dist/blz-rds/commands/datetimes/time.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/time.js +1 -0
- package/dist/blz-rds/commands/datetimes/today.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/today.js +1 -0
- package/dist/blz-rds/commands/datetimes/week-day-text.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/week-day-text.js +1 -0
- package/dist/blz-rds/commands/datetimes/week-day.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/week-day.js +1 -0
- package/dist/blz-rds/commands/datetimes/week.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/week.js +1 -0
- package/dist/blz-rds/commands/datetimes/year.d.ts +2 -0
- package/dist/blz-rds/commands/datetimes/year.js +1 -0
- package/dist/blz-rds/commands/math/abs.d.ts +2 -0
- package/dist/blz-rds/commands/math/abs.js +1 -0
- package/dist/blz-rds/commands/math/acos.d.ts +2 -0
- package/dist/blz-rds/commands/math/acos.js +1 -0
- package/dist/blz-rds/commands/math/asin.d.ts +2 -0
- package/dist/blz-rds/commands/math/asin.js +1 -0
- package/dist/blz-rds/commands/math/atan.d.ts +2 -0
- package/dist/blz-rds/commands/math/atan.js +1 -0
- package/dist/blz-rds/commands/math/atan2.d.ts +2 -0
- package/dist/blz-rds/commands/math/atan2.js +1 -0
- package/dist/blz-rds/commands/math/ceil.d.ts +2 -0
- package/dist/blz-rds/commands/math/ceil.js +1 -0
- package/dist/blz-rds/commands/math/cos.d.ts +2 -0
- package/dist/blz-rds/commands/math/cos.js +1 -0
- package/dist/blz-rds/commands/math/cosh.d.ts +2 -0
- package/dist/blz-rds/commands/math/cosh.js +1 -0
- package/dist/blz-rds/commands/math/exp.d.ts +2 -0
- package/dist/blz-rds/commands/math/exp.js +1 -0
- package/dist/blz-rds/commands/math/floor.d.ts +2 -0
- package/dist/blz-rds/commands/math/floor.js +1 -0
- package/dist/blz-rds/commands/math/log.d.ts +2 -0
- package/dist/blz-rds/commands/math/log.js +1 -0
- package/dist/blz-rds/commands/math/log10.d.ts +2 -0
- package/dist/blz-rds/commands/math/log10.js +1 -0
- package/dist/blz-rds/commands/math/pow.d.ts +2 -0
- package/dist/blz-rds/commands/math/pow.js +1 -0
- package/dist/blz-rds/commands/math/random.d.ts +2 -0
- package/dist/blz-rds/commands/math/random.js +1 -0
- package/dist/blz-rds/commands/math/round.d.ts +2 -0
- package/dist/blz-rds/commands/math/round.js +1 -0
- package/dist/blz-rds/commands/math/sign.d.ts +2 -0
- package/dist/blz-rds/commands/math/sign.js +1 -0
- package/dist/blz-rds/commands/math/sin.d.ts +2 -0
- package/dist/blz-rds/commands/math/sin.js +1 -0
- package/dist/blz-rds/commands/math/sinh.d.ts +2 -0
- package/dist/blz-rds/commands/math/sinh.js +1 -0
- package/dist/blz-rds/commands/math/sqrt.d.ts +2 -0
- package/dist/blz-rds/commands/math/sqrt.js +1 -0
- package/dist/blz-rds/commands/math/tan.d.ts +2 -0
- package/dist/blz-rds/commands/math/tan.js +1 -0
- package/dist/blz-rds/commands/math/tanh.d.ts +2 -0
- package/dist/blz-rds/commands/math/tanh.js +1 -0
- package/dist/blz-rds/commands/math/trunc.d.ts +2 -0
- package/dist/blz-rds/commands/math/trunc.js +1 -0
- package/dist/blz-rds/commands/strings/concat.d.ts +2 -0
- package/dist/blz-rds/commands/strings/concat.js +1 -0
- package/dist/blz-rds/commands/strings/contains.d.ts +3 -0
- package/dist/blz-rds/commands/strings/contains.js +1 -0
- package/dist/blz-rds/commands/strings/ends-with.d.ts +3 -0
- package/dist/blz-rds/commands/strings/ends-with.js +1 -0
- package/dist/blz-rds/commands/strings/index-of.d.ts +2 -0
- package/dist/blz-rds/commands/strings/index-of.js +1 -0
- package/dist/blz-rds/commands/strings/is-null-or-empty.d.ts +3 -0
- package/dist/blz-rds/commands/strings/is-null-or-empty.js +1 -0
- package/dist/blz-rds/commands/strings/is-null-or-white-space.d.ts +3 -0
- package/dist/blz-rds/commands/strings/is-null-or-white-space.js +1 -0
- package/dist/blz-rds/commands/strings/join.d.ts +2 -0
- package/dist/blz-rds/commands/strings/join.js +1 -0
- package/dist/blz-rds/commands/strings/last-index-of.d.ts +2 -0
- package/dist/blz-rds/commands/strings/last-index-of.js +1 -0
- package/dist/blz-rds/commands/strings/length.d.ts +2 -0
- package/dist/blz-rds/commands/strings/length.js +1 -0
- package/dist/blz-rds/commands/strings/pad-left.d.ts +2 -0
- package/dist/blz-rds/commands/strings/pad-left.js +1 -0
- package/dist/blz-rds/commands/strings/pad-right.d.ts +2 -0
- package/dist/blz-rds/commands/strings/pad-right.js +1 -0
- package/dist/blz-rds/commands/strings/replace.d.ts +2 -0
- package/dist/blz-rds/commands/strings/replace.js +1 -0
- package/dist/blz-rds/commands/strings/starts-with.d.ts +3 -0
- package/dist/blz-rds/commands/strings/starts-with.js +1 -0
- package/dist/blz-rds/commands/strings/substring.d.ts +2 -0
- package/dist/blz-rds/commands/strings/substring.js +1 -0
- package/dist/blz-rds/commands/strings/to-lower.d.ts +2 -0
- package/dist/blz-rds/commands/strings/to-lower.js +1 -0
- package/dist/blz-rds/commands/strings/to-upper.d.ts +2 -0
- package/dist/blz-rds/commands/strings/to-upper.js +1 -0
- package/dist/blz-rds/commands/strings/trim-end.d.ts +2 -0
- package/dist/blz-rds/commands/strings/trim-end.js +1 -0
- package/dist/blz-rds/commands/strings/trim-start.d.ts +2 -0
- package/dist/blz-rds/commands/strings/trim-start.js +1 -0
- package/dist/blz-rds/commands/strings/trim.d.ts +2 -0
- package/dist/blz-rds/commands/strings/trim.js +1 -0
- package/dist/blz-rds/index.d.ts +53 -0
- package/dist/blz-rds/index.js +1 -0
- package/dist/blz-rds-mysql/base.d.ts +83 -0
- package/dist/blz-rds-mysql/base.js +1 -0
- package/dist/blz-rds-mysql/connection-manager.d.ts +8 -0
- package/dist/blz-rds-mysql/connection-manager.js +1 -0
- package/dist/blz-rds-mysql/execute-bulk-insert.d.ts +2 -0
- package/dist/blz-rds-mysql/execute-bulk-insert.js +1 -0
- package/dist/blz-rds-mysql/execute-bulk-merge.d.ts +2 -0
- package/dist/blz-rds-mysql/execute-bulk-merge.js +1 -0
- package/dist/blz-rds-mysql/execute-non-query.d.ts +14 -0
- package/dist/blz-rds-mysql/execute-non-query.js +1 -0
- package/dist/blz-rds-mysql/execute-query.d.ts +11 -0
- package/dist/blz-rds-mysql/execute-query.js +1 -0
- package/dist/blz-rds-mysql/index.d.ts +9 -0
- package/dist/blz-rds-mysql/index.js +1 -0
- package/dist/blz-rds-mysql/stored-procedure.d.ts +19 -0
- package/dist/blz-rds-mysql/stored-procedure.js +1 -0
- package/dist/blz-rds-mysqlx/base.d.ts +83 -0
- package/dist/blz-rds-mysqlx/base.js +1 -0
- package/dist/blz-rds-mysqlx/connection-manager.d.ts +6 -0
- package/dist/blz-rds-mysqlx/connection-manager.js +1 -0
- package/dist/blz-rds-mysqlx/execute-bulk-insert.d.ts +2 -0
- package/dist/blz-rds-mysqlx/execute-bulk-insert.js +1 -0
- package/dist/blz-rds-mysqlx/execute-bulk-merge.d.ts +2 -0
- package/dist/blz-rds-mysqlx/execute-bulk-merge.js +1 -0
- package/dist/blz-rds-mysqlx/execute-non-query.d.ts +4 -0
- package/dist/blz-rds-mysqlx/execute-non-query.js +1 -0
- package/dist/blz-rds-mysqlx/execute-query.d.ts +7 -0
- package/dist/blz-rds-mysqlx/execute-query.js +1 -0
- package/dist/blz-rds-mysqlx/index.d.ts +9 -0
- package/dist/blz-rds-mysqlx/index.js +1 -0
- package/dist/blz-rds-mysqlx/stored-procedure.d.ts +20 -0
- package/dist/blz-rds-mysqlx/stored-procedure.js +1 -0
- package/dist/blz-rds-oracle/index.d.ts +25 -0
- package/dist/blz-rds-oracle/index.js +1 -0
- package/dist/blz-rds-postgres/base.d.ts +94 -0
- package/dist/blz-rds-postgres/base.js +1 -0
- package/dist/blz-rds-postgres/connection-manager.d.ts +6 -0
- package/dist/blz-rds-postgres/connection-manager.js +1 -0
- package/dist/blz-rds-postgres/execute-bulk-insert.d.ts +5 -0
- package/dist/blz-rds-postgres/execute-bulk-insert.js +1 -0
- package/dist/blz-rds-postgres/execute-bulk-merge.d.ts +4 -0
- package/dist/blz-rds-postgres/execute-bulk-merge.js +1 -0
- package/dist/blz-rds-postgres/execute-non-query.d.ts +12 -0
- package/dist/blz-rds-postgres/execute-non-query.js +1 -0
- package/dist/blz-rds-postgres/execute-query.d.ts +4 -0
- package/dist/blz-rds-postgres/execute-query.js +1 -0
- package/dist/blz-rds-postgres/index.d.ts +9 -0
- package/dist/blz-rds-postgres/index.js +1 -0
- package/dist/blz-rds-postgres/result-set.js +1 -0
- package/dist/blz-rds-postgres/stored-procedure.d.ts +19 -0
- package/dist/blz-rds-postgres/stored-procedure.js +1 -0
- package/dist/blz-redis/index.d.ts +31 -0
- package/dist/blz-redis/index.js +1 -0
- package/dist/blz-redis/lib/redisCache.d.ts +33 -0
- package/dist/blz-redis/lib/redisCache.js +1 -0
- package/dist/blz-regex/index.d.ts +3 -0
- package/dist/blz-regex/index.js +1 -0
- package/dist/blz-security/__test__/autorization.test.js +1 -0
- package/dist/blz-security/__test__/autorizationKpn.test.js +1 -0
- package/dist/blz-security/__test__/orderManagement.test.js +1 -0
- package/dist/blz-security/__test__/secureUrl.test.js +1 -0
- package/dist/blz-security/__test__/solveMergeRule.test.js +1 -0
- package/dist/blz-security/__test__/sqlInjectionGuard.test.js +1 -0
- package/dist/blz-security/__test__/xssGuard.test.js +1 -0
- package/dist/blz-security/authorizationService.d.ts +42 -0
- package/dist/blz-security/authorizationService.js +2 -0
- package/dist/blz-security/config/global.js +1 -0
- package/dist/blz-security/filescanner/index.d.ts +24 -0
- package/dist/blz-security/filescanner/index.js +1 -0
- package/dist/blz-security/helpers/consts.d.ts +28 -0
- package/dist/blz-security/helpers/consts.js +1 -0
- package/dist/blz-security/helpers/utils.d.ts +82 -0
- package/dist/blz-security/helpers/utils.js +1 -0
- package/dist/blz-security/implementations/cache.d.ts +58 -0
- package/dist/blz-security/implementations/cache.js +1 -0
- package/dist/blz-security/implementations/oidc.d.ts +100 -0
- package/dist/blz-security/implementations/oidc.js +1 -0
- package/dist/blz-security/implementations/pkceCacheStore.d.ts +2 -0
- package/dist/blz-security/implementations/pkceCacheStore.js +1 -0
- package/dist/blz-security/implementations/saml.js +1 -0
- package/dist/blz-security/implementations/uma.d.ts +31 -0
- package/dist/blz-security/implementations/uma.js +1 -0
- package/dist/blz-security/implementations/webAuthn.js +1 -0
- package/dist/blz-security/implementations/wstg.js +1 -0
- package/dist/blz-security/index.d.ts +4 -0
- package/dist/blz-security/index.js +2 -0
- package/dist/blz-security/lab/index.js +1 -0
- package/dist/blz-security/middleware/HapiServerAzureAd.d.ts +26 -0
- package/dist/blz-security/middleware/HapiServerAzureAd.js +1 -0
- package/dist/blz-security/middleware/HapiServerKeycloak.d.ts +47 -0
- package/dist/blz-security/middleware/HapiServerKeycloak.js +1 -0
- package/dist/blz-security/middleware/HapiServerSimToken.d.ts +13 -0
- package/dist/blz-security/middleware/HapiServerSimToken.js +1 -0
- package/dist/blz-security/middleware/hapi.d.ts +14 -0
- package/dist/blz-security/middleware/hapi.js +1 -0
- package/dist/blz-security/middleware/hapiServer.js +1 -0
- package/dist/blz-security/navigationMemoryRepository.d.ts +6 -0
- package/dist/blz-security/navigationMemoryRepository.js +1 -0
- package/dist/blz-security/navigationMongoDbRepository.d.ts +15 -0
- package/dist/blz-security/navigationMongoDbRepository.js +1 -0
- package/dist/blz-security/secureUrlService.d.ts +7 -0
- package/dist/blz-security/secureUrlService.js +1 -0
- package/dist/blz-security/securityService.d.ts +72 -0
- package/dist/blz-security/securityService.js +1 -0
- package/dist/blz-security/sqlInjectionGuard.d.ts +37 -0
- package/dist/blz-security/sqlInjectionGuard.js +1 -0
- package/dist/blz-security/xssGuard.d.ts +14 -0
- package/dist/blz-security/xssGuard.js +1 -0
- package/dist/blz-strings/index.d.ts +42 -0
- package/dist/blz-strings/index.js +1 -0
- package/dist/blz-uuid/index.d.ts +1 -0
- package/dist/blz-uuid/index.js +1 -0
- package/dist/blz-yaml/index.d.ts +2 -0
- package/dist/blz-yaml/index.js +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.js +1 -0
- package/dist/process-managers/index.d.ts +25 -0
- package/dist/process-managers/index.js +1 -0
- package/package.json +52 -41
- package/blz-base/health/index.js +0 -215
- package/blz-base/index.js +0 -1466
- package/blz-cache/LruCache.js +0 -44
- package/blz-cache/index.js +0 -29
- package/blz-config/index.js +0 -434
- package/blz-core/index.js +0 -364
- package/blz-cryptography/index.js +0 -54
- package/blz-datetimes/index.js +0 -356
- package/blz-file/example.dat +0 -2545
- package/blz-file/fileService.js +0 -205
- package/blz-file/index.js +0 -94
- package/blz-file/index.test.js +0 -31
- package/blz-file/lab.js +0 -33
- package/blz-hazelcast/index.js +0 -189
- package/blz-hazelcast/lib/credentials.js +0 -25
- package/blz-hazelcast/lib/credentialsFactory.js +0 -12
- package/blz-hazelcast/lib/hazelcastCache.js +0 -234
- package/blz-iterable/index.js +0 -446
- package/blz-json-schema/index.js +0 -11
- package/blz-jwt/index.js +0 -121
- package/blz-kafka/index.js +0 -522
- package/blz-math/index.js +0 -131
- package/blz-mongodb/index.js +0 -326
- package/blz-rds/__test__/scape.test.js +0 -58
- package/blz-rds/blz-rds-executor.js +0 -578
- package/blz-rds/blz-rds-helper.js +0 -310
- package/blz-rds/commands/core/add.js +0 -13
- package/blz-rds/commands/core/and.js +0 -18
- package/blz-rds/commands/core/asc.js +0 -10
- package/blz-rds/commands/core/avg.js +0 -10
- package/blz-rds/commands/core/column-ref.js +0 -8
- package/blz-rds/commands/core/count-distinct.js +0 -10
- package/blz-rds/commands/core/count.js +0 -10
- package/blz-rds/commands/core/decimal.js +0 -8
- package/blz-rds/commands/core/desc.js +0 -10
- package/blz-rds/commands/core/distinct.js +0 -10
- package/blz-rds/commands/core/divide.js +0 -11
- package/blz-rds/commands/core/embedded-exists.js +0 -17
- package/blz-rds/commands/core/embedded-select.js +0 -17
- package/blz-rds/commands/core/equals.js +0 -9
- package/blz-rds/commands/core/false.js +0 -8
- package/blz-rds/commands/core/greater-or-equal.js +0 -9
- package/blz-rds/commands/core/greater.js +0 -9
- package/blz-rds/commands/core/in.js +0 -9
- package/blz-rds/commands/core/integer.js +0 -8
- package/blz-rds/commands/core/is-not-null.js +0 -11
- package/blz-rds/commands/core/is-null-or-value.js +0 -10
- package/blz-rds/commands/core/is-null.js +0 -11
- package/blz-rds/commands/core/less-or-equal.js +0 -9
- package/blz-rds/commands/core/less-unary.js +0 -12
- package/blz-rds/commands/core/less.js +0 -9
- package/blz-rds/commands/core/like.js +0 -12
- package/blz-rds/commands/core/max.js +0 -10
- package/blz-rds/commands/core/min.js +0 -10
- package/blz-rds/commands/core/multiply.js +0 -13
- package/blz-rds/commands/core/not-equals.js +0 -9
- package/blz-rds/commands/core/not-in.js +0 -9
- package/blz-rds/commands/core/not.js +0 -13
- package/blz-rds/commands/core/null.js +0 -8
- package/blz-rds/commands/core/nvl.js +0 -11
- package/blz-rds/commands/core/or.js +0 -13
- package/blz-rds/commands/core/parameter.js +0 -34
- package/blz-rds/commands/core/remainder.js +0 -16
- package/blz-rds/commands/core/string.js +0 -8
- package/blz-rds/commands/core/subtract.js +0 -13
- package/blz-rds/commands/core/sum.js +0 -10
- package/blz-rds/commands/core/true.js +0 -8
- package/blz-rds/commands/core/tuple.js +0 -13
- package/blz-rds/commands/datetimes/add-days.js +0 -11
- package/blz-rds/commands/datetimes/add-hours.js +0 -11
- package/blz-rds/commands/datetimes/add-milliseconds.js +0 -11
- package/blz-rds/commands/datetimes/add-minutes.js +0 -11
- package/blz-rds/commands/datetimes/add-months.js +0 -11
- package/blz-rds/commands/datetimes/add-seconds.js +0 -11
- package/blz-rds/commands/datetimes/add-years.js +0 -11
- package/blz-rds/commands/datetimes/date-diff.js +0 -11
- package/blz-rds/commands/datetimes/date.js +0 -12
- package/blz-rds/commands/datetimes/datetime-diff.js +0 -11
- package/blz-rds/commands/datetimes/datetime.js +0 -15
- package/blz-rds/commands/datetimes/day.js +0 -10
- package/blz-rds/commands/datetimes/hour.js +0 -10
- package/blz-rds/commands/datetimes/millisecond.js +0 -10
- package/blz-rds/commands/datetimes/minute.js +0 -10
- package/blz-rds/commands/datetimes/month-text.js +0 -10
- package/blz-rds/commands/datetimes/month.js +0 -10
- package/blz-rds/commands/datetimes/now.js +0 -9
- package/blz-rds/commands/datetimes/second.js +0 -10
- package/blz-rds/commands/datetimes/subtract-days.js +0 -11
- package/blz-rds/commands/datetimes/subtract-hours.js +0 -11
- package/blz-rds/commands/datetimes/subtract-milliseconds.js +0 -11
- package/blz-rds/commands/datetimes/subtract-minutes.js +0 -11
- package/blz-rds/commands/datetimes/subtract-seconds.js +0 -11
- package/blz-rds/commands/datetimes/time-diff.js +0 -11
- package/blz-rds/commands/datetimes/time.js +0 -13
- package/blz-rds/commands/datetimes/today.js +0 -9
- package/blz-rds/commands/datetimes/week-day-text.js +0 -10
- package/blz-rds/commands/datetimes/week-day.js +0 -10
- package/blz-rds/commands/datetimes/week.js +0 -10
- package/blz-rds/commands/datetimes/year.js +0 -10
- package/blz-rds/commands/math/abs.js +0 -10
- package/blz-rds/commands/math/acos.js +0 -10
- package/blz-rds/commands/math/asin.js +0 -10
- package/blz-rds/commands/math/atan.js +0 -10
- package/blz-rds/commands/math/atan2.js +0 -11
- package/blz-rds/commands/math/ceil.js +0 -10
- package/blz-rds/commands/math/cos.js +0 -10
- package/blz-rds/commands/math/cosh.js +0 -10
- package/blz-rds/commands/math/exp.js +0 -10
- package/blz-rds/commands/math/floor.js +0 -10
- package/blz-rds/commands/math/log.js +0 -18
- package/blz-rds/commands/math/log10.js +0 -10
- package/blz-rds/commands/math/pow.js +0 -11
- package/blz-rds/commands/math/random.js +0 -9
- package/blz-rds/commands/math/round.js +0 -18
- package/blz-rds/commands/math/sign.js +0 -10
- package/blz-rds/commands/math/sin.js +0 -10
- package/blz-rds/commands/math/sinh.js +0 -10
- package/blz-rds/commands/math/sqrt.js +0 -10
- package/blz-rds/commands/math/tan.js +0 -10
- package/blz-rds/commands/math/tanh.js +0 -10
- package/blz-rds/commands/math/trunc.js +0 -18
- package/blz-rds/commands/strings/concat.js +0 -20
- package/blz-rds/commands/strings/contains.js +0 -12
- package/blz-rds/commands/strings/ends-with.js +0 -12
- package/blz-rds/commands/strings/index-of.js +0 -11
- package/blz-rds/commands/strings/is-null-or-empty.js +0 -11
- package/blz-rds/commands/strings/is-null-or-white-space.js +0 -11
- package/blz-rds/commands/strings/join.js +0 -22
- package/blz-rds/commands/strings/last-index-of.js +0 -11
- package/blz-rds/commands/strings/length.js +0 -10
- package/blz-rds/commands/strings/pad-left.js +0 -20
- package/blz-rds/commands/strings/pad-right.js +0 -20
- package/blz-rds/commands/strings/replace.js +0 -12
- package/blz-rds/commands/strings/starts-with.js +0 -12
- package/blz-rds/commands/strings/substring.js +0 -12
- package/blz-rds/commands/strings/to-lower.js +0 -10
- package/blz-rds/commands/strings/to-upper.js +0 -10
- package/blz-rds/commands/strings/trim-end.js +0 -10
- package/blz-rds/commands/strings/trim-start.js +0 -10
- package/blz-rds/commands/strings/trim.js +0 -10
- package/blz-rds/index.js +0 -744
- package/blz-rds-mysql/base.js +0 -857
- package/blz-rds-mysql/connection-manager.js +0 -129
- package/blz-rds-mysql/execute-bulk-insert.js +0 -35
- package/blz-rds-mysql/execute-bulk-merge.js +0 -45
- package/blz-rds-mysql/execute-non-query.js +0 -34
- package/blz-rds-mysql/execute-query.js +0 -50
- package/blz-rds-mysql/index.js +0 -41
- package/blz-rds-mysql/stored-procedure.js +0 -207
- package/blz-rds-mysqlx/base.js +0 -846
- package/blz-rds-mysqlx/connection-manager.js +0 -141
- package/blz-rds-mysqlx/execute-bulk-insert.js +0 -35
- package/blz-rds-mysqlx/execute-bulk-merge.js +0 -45
- package/blz-rds-mysqlx/execute-non-query.js +0 -29
- package/blz-rds-mysqlx/execute-query.js +0 -39
- package/blz-rds-mysqlx/index.js +0 -41
- package/blz-rds-mysqlx/stored-procedure.js +0 -179
- package/blz-rds-oracle/index.js +0 -539
- package/blz-rds-postgres/base.js +0 -861
- package/blz-rds-postgres/connection-manager.js +0 -225
- package/blz-rds-postgres/execute-bulk-insert.js +0 -81
- package/blz-rds-postgres/execute-bulk-merge.js +0 -93
- package/blz-rds-postgres/execute-non-query.js +0 -23
- package/blz-rds-postgres/execute-query.js +0 -37
- package/blz-rds-postgres/index.js +0 -41
- package/blz-rds-postgres/result-set.js +0 -51
- package/blz-rds-postgres/stored-procedure.js +0 -116
- package/blz-redis/index.js +0 -217
- package/blz-redis/lib/redisCache.js +0 -265
- package/blz-regex/index.js +0 -25
- package/blz-security/.eslintrc.js +0 -15
- package/blz-security/__test__/AuthorizationKpn.yaml +0 -1149
- package/blz-security/__test__/FinancingSetting.yaml +0 -177
- package/blz-security/__test__/KpnConfigPortal.yaml +0 -330
- package/blz-security/__test__/OrderManagement.yaml +0 -5190
- package/blz-security/__test__/Security.yaml +0 -128
- package/blz-security/__test__/autorization.test.js +0 -105
- package/blz-security/__test__/autorizationKpn.test.js +0 -42
- package/blz-security/__test__/orderManagement.test.js +0 -26
- package/blz-security/__test__/secureUrl.test.js +0 -79
- package/blz-security/__test__/solveMergeRule.test.js +0 -109
- package/blz-security/__test__/sqlInjectionGuard.test.js +0 -203
- package/blz-security/__test__/xssGuard.test.js +0 -204
- package/blz-security/authorizationService.js +0 -537
- package/blz-security/config/global.js +0 -8
- package/blz-security/config/welcome +0 -8
- package/blz-security/doc/README.md +0 -75
- package/blz-security/filescanner/index.js +0 -46
- package/blz-security/helpers/consts.js +0 -229
- package/blz-security/helpers/utils.js +0 -267
- package/blz-security/implementations/cache.js +0 -90
- package/blz-security/implementations/oidc.js +0 -404
- package/blz-security/implementations/pkceCacheStore.js +0 -23
- package/blz-security/implementations/saml.js +0 -10
- package/blz-security/implementations/uma.js +0 -63
- package/blz-security/implementations/webAuthn.js +0 -9
- package/blz-security/implementations/wstg.js +0 -72
- package/blz-security/index.js +0 -77
- package/blz-security/lab/index.js +0 -43
- package/blz-security/middleware/HapiServerAzureAd.js +0 -681
- package/blz-security/middleware/HapiServerKeycloak.js +0 -876
- package/blz-security/middleware/HapiServerSimToken.js +0 -286
- package/blz-security/middleware/hapi.js +0 -555
- package/blz-security/middleware/hapiServer.js +0 -1008
- package/blz-security/navigationMemoryRepository.js +0 -15
- package/blz-security/navigationMongoDbRepository.js +0 -73
- package/blz-security/secureUrlService.js +0 -47
- package/blz-security/securityService.js +0 -413
- package/blz-security/sqlInjectionGuard.js +0 -162
- package/blz-security/templates/forbidden.html +0 -0
- package/blz-security/templates/session-iframe-azure-ad.html +0 -7
- package/blz-security/templates/session-iframe.html +0 -73
- package/blz-security/templates/unauthorized.html +0 -1
- package/blz-security/xssGuard.js +0 -87
- package/blz-strings/index.js +0 -167
- package/blz-uuid/index.js +0 -7
- package/blz-yaml/index.js +0 -19
- package/index.js +0 -84
- package/process-managers/index.js +0 -422
- /package/{blz-rds-mysql → dist/blz-rds-mysql}/syntaxis.json +0 -0
- /package/{blz-rds-mysqlx → dist/blz-rds-mysqlx}/syntaxis.json +0 -0
- /package/{blz-rds-oracle → dist/blz-rds-oracle}/syntaxis.json +0 -0
- /package/{blz-rds-postgres → dist/blz-rds-postgres}/syntaxis.json +0 -0
- /package/{blz-security → dist/blz-security}/lab/ConfigurationAdmin.agent.json +0 -0
- /package/{blz-security → dist/blz-security}/lab/frontend.json +0 -0
- /package/{blz-security → dist/blz-security}/lab/result.json +0 -0
- /package/{blz-security → dist/blz-security}/lab/resultOnWeb.json +0 -0
- /package/{blz-security → dist/blz-security}/lab/rules.json +0 -0
- /package/{blz-security → dist/blz-security}/lab/securityRules.json +0 -0
package/blz-file/fileService.js
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path')
|
|
3
|
-
const readline = require('readline');
|
|
4
|
-
class FileService {
|
|
5
|
-
|
|
6
|
-
join(paths) {
|
|
7
|
-
if (!paths) {
|
|
8
|
-
throw new Error("paths is required");
|
|
9
|
-
}
|
|
10
|
-
return path.join(...paths)
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async append(filePath,content) {
|
|
14
|
-
if (!filePath) {
|
|
15
|
-
throw new Error("filePath is required");
|
|
16
|
-
}
|
|
17
|
-
if (!content) {
|
|
18
|
-
throw new Error("content is required");
|
|
19
|
-
}
|
|
20
|
-
const fullPath = this.resolvePath(filePath)
|
|
21
|
-
await this.createDirIfNotExists(fullPath)
|
|
22
|
-
await fs.promises.appendFile(fullPath, content);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async read(filePath) {
|
|
26
|
-
if (!filePath) {
|
|
27
|
-
throw new Error("filePath is required");
|
|
28
|
-
}
|
|
29
|
-
const fullPath = this.resolvePath(filePath)
|
|
30
|
-
return fs.promises.readFile(fullPath, "utf-8");
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async appendLines(filePath, lines, start) {
|
|
34
|
-
if (!filePath) {
|
|
35
|
-
throw new Error("filePath is required");
|
|
36
|
-
}
|
|
37
|
-
if (!lines) {
|
|
38
|
-
throw new Error("lines is required");
|
|
39
|
-
}
|
|
40
|
-
const fullPath = this.resolvePath(filePath)
|
|
41
|
-
await this.createDirIfNotExists(fullPath)
|
|
42
|
-
if (start !== undefined && start !== null) {
|
|
43
|
-
const currentContent = await fs.promises.readFile(fullPath, "utf-8");
|
|
44
|
-
const currentLines = currentContent.split('\n');
|
|
45
|
-
currentLines.splice(start, 0, ...lines);
|
|
46
|
-
await fs.promises.writeFile(fullPath, currentLines.join('\n')+'\n');
|
|
47
|
-
} else {
|
|
48
|
-
await fs.promises.appendFile(fullPath, lines.join('\n')+'\n');
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async readLines(filePath, start, count) {
|
|
53
|
-
if (!filePath) {
|
|
54
|
-
throw new Error("filePath is required");
|
|
55
|
-
}
|
|
56
|
-
const fullPath = this.resolvePath(filePath)
|
|
57
|
-
let lines = []
|
|
58
|
-
if (start !== undefined && start !== null) {
|
|
59
|
-
lines = await this._read(fullPath, start, count );
|
|
60
|
-
} else {
|
|
61
|
-
lines = (await fs.promises.readFile(fullPath, "utf-8")).split('\n')
|
|
62
|
-
}
|
|
63
|
-
return lines.filter(l => l === undefined || l === null || l.trim() !== '')
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
createLineIterable(filePath) {
|
|
67
|
-
if (!filePath) {
|
|
68
|
-
throw new Error("filePath is required");
|
|
69
|
-
}
|
|
70
|
-
const fullPath = this.resolvePath(filePath)
|
|
71
|
-
const fileStream = fs.createReadStream(fullPath);
|
|
72
|
-
const rl = readline.createInterface({
|
|
73
|
-
input: fileStream,
|
|
74
|
-
crlfDelay: Infinity,
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
return {
|
|
78
|
-
[Symbol.iterator]() {
|
|
79
|
-
return {
|
|
80
|
-
next() {
|
|
81
|
-
const line = rl[Symbol.iterator]().next().value;
|
|
82
|
-
return { value: line, done: line === undefined };
|
|
83
|
-
},
|
|
84
|
-
};
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
async remove(filePath) {
|
|
90
|
-
if (!filePath) {
|
|
91
|
-
throw new Error("filePath is required");
|
|
92
|
-
}
|
|
93
|
-
const fullPath = this.resolvePath(filePath)
|
|
94
|
-
await fs.promises.unlink(fullPath);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
async exists(sourcePath) {
|
|
98
|
-
if (!sourcePath) {
|
|
99
|
-
throw new Error("sourcePath is required");
|
|
100
|
-
}
|
|
101
|
-
try {
|
|
102
|
-
await fs.promises.access(sourcePath);
|
|
103
|
-
return true;
|
|
104
|
-
} catch (error) {
|
|
105
|
-
if (error.code === "ENOENT") {
|
|
106
|
-
return false;
|
|
107
|
-
} else {
|
|
108
|
-
throw error;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
async lines(filePath) {
|
|
114
|
-
if (!filePath) {
|
|
115
|
-
throw new Error("path is required");
|
|
116
|
-
}
|
|
117
|
-
const fullPath = this.resolvePath(filePath)
|
|
118
|
-
return this._lines(fullPath);
|
|
119
|
-
}
|
|
120
|
-
async size(filePath) {
|
|
121
|
-
if (!filePath) {
|
|
122
|
-
throw new Error("filePath is required");
|
|
123
|
-
}
|
|
124
|
-
const fullPath = this.resolvePath(filePath)
|
|
125
|
-
const statistics = await fs.promises.stat(fullPath)
|
|
126
|
-
return statistics.size
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
async _read(filePath, start, count) {
|
|
130
|
-
return new Promise((resolve, reject) => {
|
|
131
|
-
const reader = readline.createInterface({
|
|
132
|
-
input: fs.createReadStream(filePath),
|
|
133
|
-
crlfDelay: Infinity,
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
let lines = [];
|
|
137
|
-
let lineCount = 0;
|
|
138
|
-
|
|
139
|
-
reader.on("line", (line) => {
|
|
140
|
-
if (lineCount >= start && (!count || lines.length < count)) {
|
|
141
|
-
lines.push(line);
|
|
142
|
-
}
|
|
143
|
-
lineCount++;
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
reader.on("close", () => {
|
|
147
|
-
resolve(lines);
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
reader.on("error", (error) => {
|
|
151
|
-
reject(error);
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
async _lines(filePath) {
|
|
161
|
-
return new Promise((resolve, reject) => {
|
|
162
|
-
const stream = fs.createReadStream(filePath, { encoding: 'utf-8' });
|
|
163
|
-
let lineCount = 0;
|
|
164
|
-
|
|
165
|
-
stream.on('data', (chunk) => {
|
|
166
|
-
lineCount += (chunk.match(/\n/g) || []).length;
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
stream.on('end', () => {
|
|
170
|
-
resolve(lineCount + 1)
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
stream.on('error', (error) => {
|
|
174
|
-
reject(error);
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
async createDirIfNotExists (sourcePath) {
|
|
180
|
-
const fullPath = this.resolvePath(sourcePath)
|
|
181
|
-
const dirPath = path.dirname(fullPath);
|
|
182
|
-
const exists = await this.exists(dirPath)
|
|
183
|
-
if (exists) { return }
|
|
184
|
-
return new Promise((resolve, reject) => {
|
|
185
|
-
fs.mkdir(dirPath, { recursive: true }, err => err ? reject(err) : resolve())
|
|
186
|
-
})
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
resolvePath (sourcePath) {
|
|
190
|
-
if (!sourcePath) {
|
|
191
|
-
throw new Error("sourcePath is required");
|
|
192
|
-
}
|
|
193
|
-
const _source = sourcePath.trim()
|
|
194
|
-
if (_source.startsWith('.')) {
|
|
195
|
-
return path.join(process.cwd(), sourcePath)
|
|
196
|
-
}
|
|
197
|
-
if (_source.startsWith('~')) {
|
|
198
|
-
return _source.replace('~', process.env.HOME)
|
|
199
|
-
}
|
|
200
|
-
return sourcePath
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
const fileService = new FileService()
|
|
204
|
-
exports = module.exports = fileService
|
|
205
|
-
exports.default = fileService
|
package/blz-file/index.js
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
const fileService = require('./fileService.js')
|
|
2
|
-
const path = require('path')
|
|
3
|
-
module.exports = typeof module.exports === "undefined" ? {} : module.exports;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Join parts of path
|
|
7
|
-
* @param {list(string)} paths - parts of path
|
|
8
|
-
* @return {string} - Path joined
|
|
9
|
-
*/
|
|
10
|
-
module.exports.pathJoin = async function( paths ) {
|
|
11
|
-
if (!paths) {
|
|
12
|
-
throw new Error("paths is required");
|
|
13
|
-
}
|
|
14
|
-
return path.join(...paths)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Append data to File
|
|
19
|
-
* @param {string} path - path of file
|
|
20
|
-
* @param {string} content - content of file
|
|
21
|
-
* @return {any}
|
|
22
|
-
*/
|
|
23
|
-
module.exports.fileAppend = async function( path, content ) {
|
|
24
|
-
await fileService.append(path,content)
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Read file request
|
|
28
|
-
* @param {string} path - Path of file
|
|
29
|
-
* @return {FileReadResponse}
|
|
30
|
-
*/
|
|
31
|
-
module.exports.fileRead = async function( path ) {
|
|
32
|
-
return fileService.read(path)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Append lines to file
|
|
37
|
-
* @param {string} path - Path of file
|
|
38
|
-
* @param {list(string)} lines - lines to append
|
|
39
|
-
* @param {integer} [start] - position to start append
|
|
40
|
-
* @return {any}
|
|
41
|
-
*/
|
|
42
|
-
module.exports.fileAppendLines = async function( path, lines, start ) {
|
|
43
|
-
await fileService.appendLines(path,lines, start)
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Read lines form file
|
|
47
|
-
* @param {string} path - Path of file
|
|
48
|
-
* @param {integer} [start] - Start position to read
|
|
49
|
-
* @param {integer} [count] - Count lines to read
|
|
50
|
-
* @return {any}
|
|
51
|
-
*/
|
|
52
|
-
module.exports.fileReadLines = async function( path, start, count ) {
|
|
53
|
-
return fileService.readLines(path,start, count)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Create iterable to read lines from file
|
|
58
|
-
* @param {string} path - Path of file
|
|
59
|
-
* @return {any}
|
|
60
|
-
*/
|
|
61
|
-
module.exports.fileCreateLineIterable = async function( path ) {
|
|
62
|
-
return fileService.createLineIterable(path)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* File exists
|
|
68
|
-
* @param {string} path - path of file
|
|
69
|
-
* @return {boolean}
|
|
70
|
-
*/
|
|
71
|
-
module.exports.fileExists = async function( path ) {
|
|
72
|
-
return fileService.exists(path)
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Lines of file
|
|
76
|
-
* @param {string} path - path of file
|
|
77
|
-
* @return {integer}
|
|
78
|
-
*/
|
|
79
|
-
module.exports.fileLines = async function( path ) {
|
|
80
|
-
return fileService.lines(path)
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* File Size
|
|
84
|
-
* @param {string} path - path of file
|
|
85
|
-
* @return {integer}
|
|
86
|
-
*/
|
|
87
|
-
module.exports.fileSize = async function( path ) {
|
|
88
|
-
return fileService.size(path)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
module.exports.fileRemove = async function( path ) {
|
|
92
|
-
return fileService.remove(path)
|
|
93
|
-
}
|
|
94
|
-
|
package/blz-file/index.test.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const app = require('./index')
|
|
2
|
-
const path = require('path')
|
|
3
|
-
const examplePath = path.join(__dirname, 'example.dat')
|
|
4
|
-
const { v4: uuidv4 } = require('uuid');
|
|
5
|
-
|
|
6
|
-
describe("FileService", () => {
|
|
7
|
-
test('Size',async() => {
|
|
8
|
-
const result = await app.fileSize(examplePath)
|
|
9
|
-
expect(2841450).toStrictEqual(result)
|
|
10
|
-
})
|
|
11
|
-
test('Lines',async () => {
|
|
12
|
-
const result = await app.fileLines(examplePath)
|
|
13
|
-
expect(2546).toStrictEqual(result)
|
|
14
|
-
})
|
|
15
|
-
test('Read and append lines',async () => {
|
|
16
|
-
const content= await app.fileRead(examplePath)
|
|
17
|
-
const targetFilePath = path.join(__dirname, 'example_'+uuidv4()+'.dat')
|
|
18
|
-
await app.fileAppend(targetFilePath,content)
|
|
19
|
-
const chunk1 = await app.fileReadLines(examplePath,0,2)
|
|
20
|
-
const chunk2 = await app.fileReadLines(examplePath,2,1)
|
|
21
|
-
const targetFile2Path = path.join(__dirname, 'example2_'+uuidv4()+'.dat')
|
|
22
|
-
await app.fileAppendLines(targetFile2Path,chunk2)
|
|
23
|
-
await app.fileAppendLines(targetFile2Path,chunk1,0)
|
|
24
|
-
const chunk3 = JSON.stringify(await app.fileReadLines(examplePath,0,3))
|
|
25
|
-
const content2 = JSON.stringify(await app.fileReadLines(targetFile2Path))
|
|
26
|
-
await app.fileRemove(targetFilePath)
|
|
27
|
-
await app.fileRemove(targetFile2Path)
|
|
28
|
-
expect(true).toStrictEqual(chunk3 === content2)
|
|
29
|
-
})
|
|
30
|
-
})
|
|
31
|
-
|
package/blz-file/lab.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const fileService = require('./fileService.js')
|
|
2
|
-
const { v4: uuidv4 } = require('uuid');
|
|
3
|
-
const path = require('path')
|
|
4
|
-
|
|
5
|
-
const lab = async () => {
|
|
6
|
-
const pathFile = path.join(__dirname, 'example.dat')
|
|
7
|
-
console.log('size: ' + await fileService.size(pathFile))
|
|
8
|
-
console.log('lines: ' + await fileService.lines(pathFile))
|
|
9
|
-
|
|
10
|
-
const content= await fileService.read(pathFile)
|
|
11
|
-
const targetFilePath = path.join(__dirname, 'example_'+uuidv4()+'.dat')
|
|
12
|
-
await fileService.append(targetFilePath,content)
|
|
13
|
-
|
|
14
|
-
const chunk1 = await fileService.readLines(pathFile,0,2)
|
|
15
|
-
const chunk2 = await fileService.readLines(pathFile,2,1)
|
|
16
|
-
const targetFile2Path = path.join(__dirname, 'example2_'+uuidv4()+'.dat')
|
|
17
|
-
await fileService.appendLines(targetFile2Path,chunk2)
|
|
18
|
-
await fileService.appendLines(targetFile2Path,chunk1,0)
|
|
19
|
-
|
|
20
|
-
const chunk3 = JSON.stringify(await fileService.readLines(pathFile,0,3))
|
|
21
|
-
const content2 = JSON.stringify(await fileService.readLines(targetFile2Path))
|
|
22
|
-
if (chunk3 === content2) {
|
|
23
|
-
console.log('content is equal')
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
console.log('content is not equal')
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
await fileService.remove(targetFilePath)
|
|
30
|
-
await fileService.remove(targetFile2Path)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
lab()
|
package/blz-hazelcast/index.js
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
const hazelcastCache = require('./lib/hazelcastCache.js');
|
|
2
|
-
const { UsernamePasswordCredentials } = require('./lib/credentials.js');
|
|
3
|
-
const { usernamePasswordCredentialsFactory } = require('./lib/credentialsFactory.js');
|
|
4
|
-
const fs = require('fs-extra');
|
|
5
|
-
|
|
6
|
-
// Hazelcast Client cache
|
|
7
|
-
let hazelcastClients = {};
|
|
8
|
-
|
|
9
|
-
// Gets a Hazelcast Client by connection name
|
|
10
|
-
function getOrCreateHazelcastClient(connection) {
|
|
11
|
-
let hazelcastClient = hazelcastClients[connection.name];
|
|
12
|
-
if (hazelcastClient) {
|
|
13
|
-
return hazelcastClient;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
let options = {
|
|
17
|
-
connectionName: connection.name,
|
|
18
|
-
connectionOptions: {
|
|
19
|
-
properties: {
|
|
20
|
-
'hazelcast.logging.level': 'OFF',
|
|
21
|
-
'hazelcast.client.heartbeat.interval': connection.poolKeepAlive || 10000
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
pool: true,
|
|
25
|
-
poolMin: connection.poolMin,
|
|
26
|
-
poolMax: connection.poolMax,
|
|
27
|
-
poolKeepAlive: connection.poolKeepAlive,
|
|
28
|
-
poolAcquireTimeout: connection.poolAcquireTimeout,
|
|
29
|
-
poolRetryDelay: connection.poolRetryDelay
|
|
30
|
-
};
|
|
31
|
-
if (connection.clusterName != null) {
|
|
32
|
-
options.connectionOptions.clusterName = connection.clusterName;
|
|
33
|
-
}
|
|
34
|
-
if (connection.members != null || connection.discoveryToken != null || connection.tls) {
|
|
35
|
-
options.connectionOptions.network = {};
|
|
36
|
-
}
|
|
37
|
-
if (connection.members != null) {
|
|
38
|
-
options.connectionOptions.network.clusterMembers = ensureMembers(connection.members);
|
|
39
|
-
}
|
|
40
|
-
if (connection.discoveryToken != null) {
|
|
41
|
-
options.connectionOptions.network.hazelcastCloud = { discoveryToken: connection.discoveryToken };
|
|
42
|
-
}
|
|
43
|
-
if (connection.tls) {
|
|
44
|
-
options.connectionOptions.network.ssl = { enabled: true };
|
|
45
|
-
if (connection.key || connection.cert || connection.ca || connection.servername || connection.rejectUnauthorized) {
|
|
46
|
-
options.connectionOptions.network.ssl.sslOptionsFactoryProperties = {};
|
|
47
|
-
}
|
|
48
|
-
if (connection.key) {
|
|
49
|
-
options.connectionOptions.network.ssl.sslOptionsFactoryProperties.keyPath = fs.readFileSync(connection.key);
|
|
50
|
-
}
|
|
51
|
-
if (connection.cert) {
|
|
52
|
-
options.connectionOptions.network.ssl.sslOptionsFactoryProperties.certPath = fs.readFileSync(connection.cert);
|
|
53
|
-
}
|
|
54
|
-
if (connection.ca) {
|
|
55
|
-
options.connectionOptions.network.ssl.sslOptionsFactoryProperties.caPath = fs.readFileSync(connection.ca);
|
|
56
|
-
}
|
|
57
|
-
if (connection.servername) {
|
|
58
|
-
options.connectionOptions.network.ssl.sslOptionsFactoryProperties.servername = connection.servername;
|
|
59
|
-
}
|
|
60
|
-
if (!connection.rejectUnauthorized) {
|
|
61
|
-
options.connectionOptions.network.ssl.sslOptionsFactoryProperties.rejectUnauthorized = false;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (connection.user != null) {
|
|
65
|
-
options.connectionOptions.serialization = {
|
|
66
|
-
portableFactories: {
|
|
67
|
-
1: usernamePasswordCredentialsFactory
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
options.connectionOptions.customCredentials = new UsernamePasswordCredentials(connection.user, connection.password, connection.endpoint);
|
|
71
|
-
}
|
|
72
|
-
hazelcastClient = hazelcastCache.createHazelcastClient(options);
|
|
73
|
-
hazelcastClients[connection.name] = hazelcastClient;
|
|
74
|
-
return hazelcastClient;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function ensureMembers(members) {
|
|
78
|
-
if (members) {
|
|
79
|
-
if (!Array.isArray(members)) {
|
|
80
|
-
if (typeof (members) === 'string') {
|
|
81
|
-
return members.split(',')
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return members;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
module.exports = {
|
|
89
|
-
hazelcastMapGet: function (connection, name, key) {
|
|
90
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
91
|
-
return hazelcastClient.mapGet(name, key);
|
|
92
|
-
},
|
|
93
|
-
hazelcastMapGetAll:function (connection, name, keys) {
|
|
94
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
95
|
-
return hazelcastClient.mapGetAll(name, keys);
|
|
96
|
-
},
|
|
97
|
-
hazelcastMapSet: function (connection, name, key, value, ttl) {
|
|
98
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
99
|
-
return hazelcastClient.mapSet(name, key, value, ttl);
|
|
100
|
-
},
|
|
101
|
-
hazelcastMapSetAll: function (connection, name, data) {
|
|
102
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
103
|
-
return hazelcastClient.mapSetAll(name, data);
|
|
104
|
-
},
|
|
105
|
-
hazelcastMapDelete: function (connection, name, key) {
|
|
106
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
107
|
-
return hazelcastClient.mapDelete(name, key);
|
|
108
|
-
},
|
|
109
|
-
hazelcastMapSetTtl: function (connection, name, key, ttl) {
|
|
110
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
111
|
-
return hazelcastClient.mapSetTtl(name, key, ttl);
|
|
112
|
-
},
|
|
113
|
-
hazelcastMapGetEntryView: function (connection, name, key) {
|
|
114
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
115
|
-
return hazelcastClient.mapGetEntryView(name, key);
|
|
116
|
-
},
|
|
117
|
-
hazelcastMapContainsKey: function (connection, name, key) {
|
|
118
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
119
|
-
return hazelcastClient.mapContainsKey(name, key);
|
|
120
|
-
},
|
|
121
|
-
hazelcastMapKeySet: function (connection, name) {
|
|
122
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
123
|
-
return hazelcastClient.mapKeySet(name);
|
|
124
|
-
},
|
|
125
|
-
hazelcastMapValues: function (connection, name) {
|
|
126
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
127
|
-
return hazelcastClient.mapValues(name);
|
|
128
|
-
},
|
|
129
|
-
hazelcastMapEntrySet: function (connection, name) {
|
|
130
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
131
|
-
return hazelcastClient.mapEntrySet(name);
|
|
132
|
-
},
|
|
133
|
-
hazelcastMapSize: function (connection, name) {
|
|
134
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
135
|
-
return hazelcastClient.mapSize(name);
|
|
136
|
-
},
|
|
137
|
-
hazelcastMapClear: function (connection, name) {
|
|
138
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
139
|
-
return hazelcastClient.mapClear(name);
|
|
140
|
-
},
|
|
141
|
-
hazelcastMapDestroy: function (connection, name) {
|
|
142
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
143
|
-
return hazelcastClient.mapDestroy(name);
|
|
144
|
-
},
|
|
145
|
-
hazelcastListGet: function (connection, name, index) {
|
|
146
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
147
|
-
return hazelcastClient.listGet(name, index);
|
|
148
|
-
},
|
|
149
|
-
hazelcastListAdd: function (connection, name, element) {
|
|
150
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
151
|
-
return hazelcastClient.listAdd(name, element);
|
|
152
|
-
},
|
|
153
|
-
hazelcastListAddAt: function (connection, name, index, element) {
|
|
154
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
155
|
-
return hazelcastClient.listAddAt(name, index, element);
|
|
156
|
-
},
|
|
157
|
-
hazelcastListAddAll: function (connection, name, elements) {
|
|
158
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
159
|
-
return hazelcastClient.listAddAll(name, elements);
|
|
160
|
-
},
|
|
161
|
-
hazelcastListRemove: function (connection, name, element) {
|
|
162
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
163
|
-
return hazelcastClient.listRemove(name, element);
|
|
164
|
-
},
|
|
165
|
-
hazelcastListRemoveAt: function (connection, name, index) {
|
|
166
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
167
|
-
return hazelcastClient.listRemoveAt(name, index);
|
|
168
|
-
},
|
|
169
|
-
hazelcastListContains: function (connection, name, element) {
|
|
170
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
171
|
-
return hazelcastClient.listContains(name, element);
|
|
172
|
-
},
|
|
173
|
-
hazelcastListIndexOf: function (connection, name, element) {
|
|
174
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
175
|
-
return hazelcastClient.listIndexOf(name, element);
|
|
176
|
-
},
|
|
177
|
-
hazelcastListSize: function (connection, name) {
|
|
178
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
179
|
-
return hazelcastClient.listSize(name);
|
|
180
|
-
},
|
|
181
|
-
hazelcastListClear: function (connection, name) {
|
|
182
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
183
|
-
return hazelcastClient.listClear(name);
|
|
184
|
-
},
|
|
185
|
-
hazelcastListDestroy: function (connection, name) {
|
|
186
|
-
let hazelcastClient = getOrCreateHazelcastClient(connection);
|
|
187
|
-
return hazelcastClient.listDestroy(name);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
class UsernamePasswordCredentials {
|
|
4
|
-
constructor(username, password, endpoint) {
|
|
5
|
-
this.username = username;
|
|
6
|
-
this.password = password;
|
|
7
|
-
this.endpoint = endpoint;
|
|
8
|
-
this.factoryId = 1;
|
|
9
|
-
this.classId = 1;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
readPortable(reader) {
|
|
13
|
-
this.username = reader.readString('username');
|
|
14
|
-
this.endpoint = reader.readString('password');
|
|
15
|
-
this.password = reader.readString('endpoint');
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
writePortable(writer) {
|
|
19
|
-
writer.writeString('username', this.username);
|
|
20
|
-
writer.writeString('password', this.password);
|
|
21
|
-
writer.writeString('endpoint', this.endpoint);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
exports.UsernamePasswordCredentials = UsernamePasswordCredentials;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const UsernamePasswordCredentials = require('./credentials');
|
|
4
|
-
|
|
5
|
-
function usernamePasswordCredentialsFactory(classId) {
|
|
6
|
-
if (classId === 1) {
|
|
7
|
-
return new UsernamePasswordCredentials();
|
|
8
|
-
}
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
exports.usernamePasswordCredentialsFactory = usernamePasswordCredentialsFactory;
|