@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.
Files changed (626) hide show
  1. package/README.md +4 -1
  2. package/dist/blz-base/health/index.d.ts +1 -0
  3. package/dist/blz-base/health/index.js +1 -0
  4. package/dist/blz-base/index.d.ts +108 -0
  5. package/dist/blz-base/index.js +1 -0
  6. package/dist/blz-cache/LruCache.d.ts +31 -0
  7. package/dist/blz-cache/LruCache.js +1 -0
  8. package/dist/blz-cache/index.d.ts +2 -0
  9. package/dist/blz-cache/index.js +1 -0
  10. package/dist/blz-config/index.d.ts +16 -0
  11. package/dist/blz-config/index.js +1 -0
  12. package/dist/blz-core/index.d.ts +32 -0
  13. package/dist/blz-core/index.js +1 -0
  14. package/dist/blz-cryptography/index.d.ts +2 -0
  15. package/dist/blz-cryptography/index.js +1 -0
  16. package/dist/blz-datetimes/index.d.ts +35 -0
  17. package/dist/blz-datetimes/index.js +1 -0
  18. package/dist/blz-file/fileService.d.ts +25 -0
  19. package/dist/blz-file/fileService.js +1 -0
  20. package/dist/blz-file/index.d.ts +2 -0
  21. package/dist/blz-file/index.js +1 -0
  22. package/dist/blz-file/index.test.js +1 -0
  23. package/dist/blz-file/lab.js +1 -0
  24. package/dist/blz-hazelcast/index.d.ts +25 -0
  25. package/dist/blz-hazelcast/index.js +1 -0
  26. package/dist/blz-hazelcast/lib/credentials.d.ts +10 -0
  27. package/dist/blz-hazelcast/lib/credentials.js +1 -0
  28. package/dist/blz-hazelcast/lib/credentialsFactory.d.ts +1 -0
  29. package/dist/blz-hazelcast/lib/credentialsFactory.js +1 -0
  30. package/dist/blz-hazelcast/lib/hazelcastCache.d.ts +27 -0
  31. package/dist/blz-hazelcast/lib/hazelcastCache.js +1 -0
  32. package/dist/blz-iterable/index.d.ts +49 -0
  33. package/dist/blz-iterable/index.js +1 -0
  34. package/dist/blz-json-schema/index.d.ts +1 -0
  35. package/dist/blz-json-schema/index.js +1 -0
  36. package/dist/blz-jwt/index.d.ts +12 -0
  37. package/dist/blz-jwt/index.js +1 -0
  38. package/dist/blz-kafka/index.d.ts +9 -0
  39. package/dist/blz-kafka/index.js +1 -0
  40. package/dist/blz-math/index.d.ts +22 -0
  41. package/dist/blz-math/index.js +1 -0
  42. package/dist/blz-mongodb/index.d.ts +28 -0
  43. package/dist/blz-mongodb/index.js +1 -0
  44. package/dist/blz-rds/__test__/scape.test.js +1 -0
  45. package/dist/blz-rds/blz-rds-executor.d.ts +4 -0
  46. package/dist/blz-rds/blz-rds-executor.js +1 -0
  47. package/dist/blz-rds/blz-rds-helper.d.ts +5 -0
  48. package/dist/blz-rds/blz-rds-helper.js +1 -0
  49. package/dist/blz-rds/commands/core/add.d.ts +2 -0
  50. package/dist/blz-rds/commands/core/add.js +1 -0
  51. package/dist/blz-rds/commands/core/and.d.ts +3 -0
  52. package/dist/blz-rds/commands/core/and.js +1 -0
  53. package/dist/blz-rds/commands/core/asc.d.ts +2 -0
  54. package/dist/blz-rds/commands/core/asc.js +1 -0
  55. package/dist/blz-rds/commands/core/avg.d.ts +2 -0
  56. package/dist/blz-rds/commands/core/avg.js +1 -0
  57. package/dist/blz-rds/commands/core/column-ref.d.ts +2 -0
  58. package/dist/blz-rds/commands/core/column-ref.js +1 -0
  59. package/dist/blz-rds/commands/core/count-distinct.d.ts +2 -0
  60. package/dist/blz-rds/commands/core/count-distinct.js +1 -0
  61. package/dist/blz-rds/commands/core/count.d.ts +2 -0
  62. package/dist/blz-rds/commands/core/count.js +1 -0
  63. package/dist/blz-rds/commands/core/decimal.d.ts +2 -0
  64. package/dist/blz-rds/commands/core/decimal.js +1 -0
  65. package/dist/blz-rds/commands/core/desc.d.ts +2 -0
  66. package/dist/blz-rds/commands/core/desc.js +1 -0
  67. package/dist/blz-rds/commands/core/distinct.d.ts +2 -0
  68. package/dist/blz-rds/commands/core/distinct.js +1 -0
  69. package/dist/blz-rds/commands/core/divide.d.ts +2 -0
  70. package/dist/blz-rds/commands/core/divide.js +1 -0
  71. package/dist/blz-rds/commands/core/embedded-exists.d.ts +3 -0
  72. package/dist/blz-rds/commands/core/embedded-exists.js +1 -0
  73. package/dist/blz-rds/commands/core/embedded-select.d.ts +2 -0
  74. package/dist/blz-rds/commands/core/embedded-select.js +1 -0
  75. package/dist/blz-rds/commands/core/equals.d.ts +3 -0
  76. package/dist/blz-rds/commands/core/equals.js +1 -0
  77. package/dist/blz-rds/commands/core/false.d.ts +2 -0
  78. package/dist/blz-rds/commands/core/false.js +1 -0
  79. package/dist/blz-rds/commands/core/greater-or-equal.d.ts +3 -0
  80. package/dist/blz-rds/commands/core/greater-or-equal.js +1 -0
  81. package/dist/blz-rds/commands/core/greater.d.ts +3 -0
  82. package/dist/blz-rds/commands/core/greater.js +1 -0
  83. package/dist/blz-rds/commands/core/in.d.ts +3 -0
  84. package/dist/blz-rds/commands/core/in.js +1 -0
  85. package/dist/blz-rds/commands/core/integer.d.ts +2 -0
  86. package/dist/blz-rds/commands/core/integer.js +1 -0
  87. package/dist/blz-rds/commands/core/is-not-null.d.ts +3 -0
  88. package/dist/blz-rds/commands/core/is-not-null.js +1 -0
  89. package/dist/blz-rds/commands/core/is-null-or-value.d.ts +3 -0
  90. package/dist/blz-rds/commands/core/is-null-or-value.js +1 -0
  91. package/dist/blz-rds/commands/core/is-null.d.ts +3 -0
  92. package/dist/blz-rds/commands/core/is-null.js +1 -0
  93. package/dist/blz-rds/commands/core/less-or-equal.d.ts +3 -0
  94. package/dist/blz-rds/commands/core/less-or-equal.js +1 -0
  95. package/dist/blz-rds/commands/core/less-unary.d.ts +2 -0
  96. package/dist/blz-rds/commands/core/less-unary.js +1 -0
  97. package/dist/blz-rds/commands/core/less.d.ts +3 -0
  98. package/dist/blz-rds/commands/core/less.js +1 -0
  99. package/dist/blz-rds/commands/core/like.d.ts +3 -0
  100. package/dist/blz-rds/commands/core/like.js +1 -0
  101. package/dist/blz-rds/commands/core/max.d.ts +2 -0
  102. package/dist/blz-rds/commands/core/max.js +1 -0
  103. package/dist/blz-rds/commands/core/min.d.ts +2 -0
  104. package/dist/blz-rds/commands/core/min.js +1 -0
  105. package/dist/blz-rds/commands/core/multiply.d.ts +2 -0
  106. package/dist/blz-rds/commands/core/multiply.js +1 -0
  107. package/dist/blz-rds/commands/core/not-equals.d.ts +3 -0
  108. package/dist/blz-rds/commands/core/not-equals.js +1 -0
  109. package/dist/blz-rds/commands/core/not-in.d.ts +3 -0
  110. package/dist/blz-rds/commands/core/not-in.js +1 -0
  111. package/dist/blz-rds/commands/core/not.d.ts +3 -0
  112. package/dist/blz-rds/commands/core/not.js +1 -0
  113. package/dist/blz-rds/commands/core/null.d.ts +2 -0
  114. package/dist/blz-rds/commands/core/null.js +1 -0
  115. package/dist/blz-rds/commands/core/nvl.d.ts +2 -0
  116. package/dist/blz-rds/commands/core/nvl.js +1 -0
  117. package/dist/blz-rds/commands/core/or.d.ts +3 -0
  118. package/dist/blz-rds/commands/core/or.js +1 -0
  119. package/dist/blz-rds/commands/core/parameter.d.ts +2 -0
  120. package/dist/blz-rds/commands/core/parameter.js +1 -0
  121. package/dist/blz-rds/commands/core/remainder.d.ts +2 -0
  122. package/dist/blz-rds/commands/core/remainder.js +1 -0
  123. package/dist/blz-rds/commands/core/string.d.ts +2 -0
  124. package/dist/blz-rds/commands/core/string.js +1 -0
  125. package/dist/blz-rds/commands/core/subtract.d.ts +2 -0
  126. package/dist/blz-rds/commands/core/subtract.js +1 -0
  127. package/dist/blz-rds/commands/core/sum.d.ts +2 -0
  128. package/dist/blz-rds/commands/core/sum.js +1 -0
  129. package/dist/blz-rds/commands/core/true.d.ts +2 -0
  130. package/dist/blz-rds/commands/core/true.js +1 -0
  131. package/dist/blz-rds/commands/core/tuple.d.ts +2 -0
  132. package/dist/blz-rds/commands/core/tuple.js +1 -0
  133. package/dist/blz-rds/commands/datetimes/add-days.d.ts +2 -0
  134. package/dist/blz-rds/commands/datetimes/add-days.js +1 -0
  135. package/dist/blz-rds/commands/datetimes/add-hours.d.ts +2 -0
  136. package/dist/blz-rds/commands/datetimes/add-hours.js +1 -0
  137. package/dist/blz-rds/commands/datetimes/add-milliseconds.d.ts +2 -0
  138. package/dist/blz-rds/commands/datetimes/add-milliseconds.js +1 -0
  139. package/dist/blz-rds/commands/datetimes/add-minutes.d.ts +2 -0
  140. package/dist/blz-rds/commands/datetimes/add-minutes.js +1 -0
  141. package/dist/blz-rds/commands/datetimes/add-months.d.ts +2 -0
  142. package/dist/blz-rds/commands/datetimes/add-months.js +1 -0
  143. package/dist/blz-rds/commands/datetimes/add-seconds.d.ts +2 -0
  144. package/dist/blz-rds/commands/datetimes/add-seconds.js +1 -0
  145. package/dist/blz-rds/commands/datetimes/add-years.d.ts +2 -0
  146. package/dist/blz-rds/commands/datetimes/add-years.js +1 -0
  147. package/dist/blz-rds/commands/datetimes/date-diff.d.ts +2 -0
  148. package/dist/blz-rds/commands/datetimes/date-diff.js +1 -0
  149. package/dist/blz-rds/commands/datetimes/date.d.ts +2 -0
  150. package/dist/blz-rds/commands/datetimes/date.js +1 -0
  151. package/dist/blz-rds/commands/datetimes/datetime-diff.d.ts +2 -0
  152. package/dist/blz-rds/commands/datetimes/datetime-diff.js +1 -0
  153. package/dist/blz-rds/commands/datetimes/datetime.d.ts +2 -0
  154. package/dist/blz-rds/commands/datetimes/datetime.js +1 -0
  155. package/dist/blz-rds/commands/datetimes/day.d.ts +2 -0
  156. package/dist/blz-rds/commands/datetimes/day.js +1 -0
  157. package/dist/blz-rds/commands/datetimes/hour.d.ts +2 -0
  158. package/dist/blz-rds/commands/datetimes/hour.js +1 -0
  159. package/dist/blz-rds/commands/datetimes/millisecond.d.ts +2 -0
  160. package/dist/blz-rds/commands/datetimes/millisecond.js +1 -0
  161. package/dist/blz-rds/commands/datetimes/minute.d.ts +2 -0
  162. package/dist/blz-rds/commands/datetimes/minute.js +1 -0
  163. package/dist/blz-rds/commands/datetimes/month-text.d.ts +2 -0
  164. package/dist/blz-rds/commands/datetimes/month-text.js +1 -0
  165. package/dist/blz-rds/commands/datetimes/month.d.ts +2 -0
  166. package/dist/blz-rds/commands/datetimes/month.js +1 -0
  167. package/dist/blz-rds/commands/datetimes/now.d.ts +2 -0
  168. package/dist/blz-rds/commands/datetimes/now.js +1 -0
  169. package/dist/blz-rds/commands/datetimes/second.d.ts +2 -0
  170. package/dist/blz-rds/commands/datetimes/second.js +1 -0
  171. package/dist/blz-rds/commands/datetimes/subtract-days.d.ts +2 -0
  172. package/dist/blz-rds/commands/datetimes/subtract-days.js +1 -0
  173. package/dist/blz-rds/commands/datetimes/subtract-hours.d.ts +2 -0
  174. package/dist/blz-rds/commands/datetimes/subtract-hours.js +1 -0
  175. package/dist/blz-rds/commands/datetimes/subtract-milliseconds.d.ts +2 -0
  176. package/dist/blz-rds/commands/datetimes/subtract-milliseconds.js +1 -0
  177. package/dist/blz-rds/commands/datetimes/subtract-minutes.d.ts +2 -0
  178. package/dist/blz-rds/commands/datetimes/subtract-minutes.js +1 -0
  179. package/dist/blz-rds/commands/datetimes/subtract-seconds.d.ts +2 -0
  180. package/dist/blz-rds/commands/datetimes/subtract-seconds.js +1 -0
  181. package/dist/blz-rds/commands/datetimes/time-diff.d.ts +2 -0
  182. package/dist/blz-rds/commands/datetimes/time-diff.js +1 -0
  183. package/dist/blz-rds/commands/datetimes/time.d.ts +2 -0
  184. package/dist/blz-rds/commands/datetimes/time.js +1 -0
  185. package/dist/blz-rds/commands/datetimes/today.d.ts +2 -0
  186. package/dist/blz-rds/commands/datetimes/today.js +1 -0
  187. package/dist/blz-rds/commands/datetimes/week-day-text.d.ts +2 -0
  188. package/dist/blz-rds/commands/datetimes/week-day-text.js +1 -0
  189. package/dist/blz-rds/commands/datetimes/week-day.d.ts +2 -0
  190. package/dist/blz-rds/commands/datetimes/week-day.js +1 -0
  191. package/dist/blz-rds/commands/datetimes/week.d.ts +2 -0
  192. package/dist/blz-rds/commands/datetimes/week.js +1 -0
  193. package/dist/blz-rds/commands/datetimes/year.d.ts +2 -0
  194. package/dist/blz-rds/commands/datetimes/year.js +1 -0
  195. package/dist/blz-rds/commands/math/abs.d.ts +2 -0
  196. package/dist/blz-rds/commands/math/abs.js +1 -0
  197. package/dist/blz-rds/commands/math/acos.d.ts +2 -0
  198. package/dist/blz-rds/commands/math/acos.js +1 -0
  199. package/dist/blz-rds/commands/math/asin.d.ts +2 -0
  200. package/dist/blz-rds/commands/math/asin.js +1 -0
  201. package/dist/blz-rds/commands/math/atan.d.ts +2 -0
  202. package/dist/blz-rds/commands/math/atan.js +1 -0
  203. package/dist/blz-rds/commands/math/atan2.d.ts +2 -0
  204. package/dist/blz-rds/commands/math/atan2.js +1 -0
  205. package/dist/blz-rds/commands/math/ceil.d.ts +2 -0
  206. package/dist/blz-rds/commands/math/ceil.js +1 -0
  207. package/dist/blz-rds/commands/math/cos.d.ts +2 -0
  208. package/dist/blz-rds/commands/math/cos.js +1 -0
  209. package/dist/blz-rds/commands/math/cosh.d.ts +2 -0
  210. package/dist/blz-rds/commands/math/cosh.js +1 -0
  211. package/dist/blz-rds/commands/math/exp.d.ts +2 -0
  212. package/dist/blz-rds/commands/math/exp.js +1 -0
  213. package/dist/blz-rds/commands/math/floor.d.ts +2 -0
  214. package/dist/blz-rds/commands/math/floor.js +1 -0
  215. package/dist/blz-rds/commands/math/log.d.ts +2 -0
  216. package/dist/blz-rds/commands/math/log.js +1 -0
  217. package/dist/blz-rds/commands/math/log10.d.ts +2 -0
  218. package/dist/blz-rds/commands/math/log10.js +1 -0
  219. package/dist/blz-rds/commands/math/pow.d.ts +2 -0
  220. package/dist/blz-rds/commands/math/pow.js +1 -0
  221. package/dist/blz-rds/commands/math/random.d.ts +2 -0
  222. package/dist/blz-rds/commands/math/random.js +1 -0
  223. package/dist/blz-rds/commands/math/round.d.ts +2 -0
  224. package/dist/blz-rds/commands/math/round.js +1 -0
  225. package/dist/blz-rds/commands/math/sign.d.ts +2 -0
  226. package/dist/blz-rds/commands/math/sign.js +1 -0
  227. package/dist/blz-rds/commands/math/sin.d.ts +2 -0
  228. package/dist/blz-rds/commands/math/sin.js +1 -0
  229. package/dist/blz-rds/commands/math/sinh.d.ts +2 -0
  230. package/dist/blz-rds/commands/math/sinh.js +1 -0
  231. package/dist/blz-rds/commands/math/sqrt.d.ts +2 -0
  232. package/dist/blz-rds/commands/math/sqrt.js +1 -0
  233. package/dist/blz-rds/commands/math/tan.d.ts +2 -0
  234. package/dist/blz-rds/commands/math/tan.js +1 -0
  235. package/dist/blz-rds/commands/math/tanh.d.ts +2 -0
  236. package/dist/blz-rds/commands/math/tanh.js +1 -0
  237. package/dist/blz-rds/commands/math/trunc.d.ts +2 -0
  238. package/dist/blz-rds/commands/math/trunc.js +1 -0
  239. package/dist/blz-rds/commands/strings/concat.d.ts +2 -0
  240. package/dist/blz-rds/commands/strings/concat.js +1 -0
  241. package/dist/blz-rds/commands/strings/contains.d.ts +3 -0
  242. package/dist/blz-rds/commands/strings/contains.js +1 -0
  243. package/dist/blz-rds/commands/strings/ends-with.d.ts +3 -0
  244. package/dist/blz-rds/commands/strings/ends-with.js +1 -0
  245. package/dist/blz-rds/commands/strings/index-of.d.ts +2 -0
  246. package/dist/blz-rds/commands/strings/index-of.js +1 -0
  247. package/dist/blz-rds/commands/strings/is-null-or-empty.d.ts +3 -0
  248. package/dist/blz-rds/commands/strings/is-null-or-empty.js +1 -0
  249. package/dist/blz-rds/commands/strings/is-null-or-white-space.d.ts +3 -0
  250. package/dist/blz-rds/commands/strings/is-null-or-white-space.js +1 -0
  251. package/dist/blz-rds/commands/strings/join.d.ts +2 -0
  252. package/dist/blz-rds/commands/strings/join.js +1 -0
  253. package/dist/blz-rds/commands/strings/last-index-of.d.ts +2 -0
  254. package/dist/blz-rds/commands/strings/last-index-of.js +1 -0
  255. package/dist/blz-rds/commands/strings/length.d.ts +2 -0
  256. package/dist/blz-rds/commands/strings/length.js +1 -0
  257. package/dist/blz-rds/commands/strings/pad-left.d.ts +2 -0
  258. package/dist/blz-rds/commands/strings/pad-left.js +1 -0
  259. package/dist/blz-rds/commands/strings/pad-right.d.ts +2 -0
  260. package/dist/blz-rds/commands/strings/pad-right.js +1 -0
  261. package/dist/blz-rds/commands/strings/replace.d.ts +2 -0
  262. package/dist/blz-rds/commands/strings/replace.js +1 -0
  263. package/dist/blz-rds/commands/strings/starts-with.d.ts +3 -0
  264. package/dist/blz-rds/commands/strings/starts-with.js +1 -0
  265. package/dist/blz-rds/commands/strings/substring.d.ts +2 -0
  266. package/dist/blz-rds/commands/strings/substring.js +1 -0
  267. package/dist/blz-rds/commands/strings/to-lower.d.ts +2 -0
  268. package/dist/blz-rds/commands/strings/to-lower.js +1 -0
  269. package/dist/blz-rds/commands/strings/to-upper.d.ts +2 -0
  270. package/dist/blz-rds/commands/strings/to-upper.js +1 -0
  271. package/dist/blz-rds/commands/strings/trim-end.d.ts +2 -0
  272. package/dist/blz-rds/commands/strings/trim-end.js +1 -0
  273. package/dist/blz-rds/commands/strings/trim-start.d.ts +2 -0
  274. package/dist/blz-rds/commands/strings/trim-start.js +1 -0
  275. package/dist/blz-rds/commands/strings/trim.d.ts +2 -0
  276. package/dist/blz-rds/commands/strings/trim.js +1 -0
  277. package/dist/blz-rds/index.d.ts +53 -0
  278. package/dist/blz-rds/index.js +1 -0
  279. package/dist/blz-rds-mysql/base.d.ts +83 -0
  280. package/dist/blz-rds-mysql/base.js +1 -0
  281. package/dist/blz-rds-mysql/connection-manager.d.ts +8 -0
  282. package/dist/blz-rds-mysql/connection-manager.js +1 -0
  283. package/dist/blz-rds-mysql/execute-bulk-insert.d.ts +2 -0
  284. package/dist/blz-rds-mysql/execute-bulk-insert.js +1 -0
  285. package/dist/blz-rds-mysql/execute-bulk-merge.d.ts +2 -0
  286. package/dist/blz-rds-mysql/execute-bulk-merge.js +1 -0
  287. package/dist/blz-rds-mysql/execute-non-query.d.ts +14 -0
  288. package/dist/blz-rds-mysql/execute-non-query.js +1 -0
  289. package/dist/blz-rds-mysql/execute-query.d.ts +11 -0
  290. package/dist/blz-rds-mysql/execute-query.js +1 -0
  291. package/dist/blz-rds-mysql/index.d.ts +9 -0
  292. package/dist/blz-rds-mysql/index.js +1 -0
  293. package/dist/blz-rds-mysql/stored-procedure.d.ts +19 -0
  294. package/dist/blz-rds-mysql/stored-procedure.js +1 -0
  295. package/dist/blz-rds-mysqlx/base.d.ts +83 -0
  296. package/dist/blz-rds-mysqlx/base.js +1 -0
  297. package/dist/blz-rds-mysqlx/connection-manager.d.ts +6 -0
  298. package/dist/blz-rds-mysqlx/connection-manager.js +1 -0
  299. package/dist/blz-rds-mysqlx/execute-bulk-insert.d.ts +2 -0
  300. package/dist/blz-rds-mysqlx/execute-bulk-insert.js +1 -0
  301. package/dist/blz-rds-mysqlx/execute-bulk-merge.d.ts +2 -0
  302. package/dist/blz-rds-mysqlx/execute-bulk-merge.js +1 -0
  303. package/dist/blz-rds-mysqlx/execute-non-query.d.ts +4 -0
  304. package/dist/blz-rds-mysqlx/execute-non-query.js +1 -0
  305. package/dist/blz-rds-mysqlx/execute-query.d.ts +7 -0
  306. package/dist/blz-rds-mysqlx/execute-query.js +1 -0
  307. package/dist/blz-rds-mysqlx/index.d.ts +9 -0
  308. package/dist/blz-rds-mysqlx/index.js +1 -0
  309. package/dist/blz-rds-mysqlx/stored-procedure.d.ts +20 -0
  310. package/dist/blz-rds-mysqlx/stored-procedure.js +1 -0
  311. package/dist/blz-rds-oracle/index.d.ts +25 -0
  312. package/dist/blz-rds-oracle/index.js +1 -0
  313. package/dist/blz-rds-postgres/base.d.ts +94 -0
  314. package/dist/blz-rds-postgres/base.js +1 -0
  315. package/dist/blz-rds-postgres/connection-manager.d.ts +6 -0
  316. package/dist/blz-rds-postgres/connection-manager.js +1 -0
  317. package/dist/blz-rds-postgres/execute-bulk-insert.d.ts +5 -0
  318. package/dist/blz-rds-postgres/execute-bulk-insert.js +1 -0
  319. package/dist/blz-rds-postgres/execute-bulk-merge.d.ts +4 -0
  320. package/dist/blz-rds-postgres/execute-bulk-merge.js +1 -0
  321. package/dist/blz-rds-postgres/execute-non-query.d.ts +12 -0
  322. package/dist/blz-rds-postgres/execute-non-query.js +1 -0
  323. package/dist/blz-rds-postgres/execute-query.d.ts +4 -0
  324. package/dist/blz-rds-postgres/execute-query.js +1 -0
  325. package/dist/blz-rds-postgres/index.d.ts +9 -0
  326. package/dist/blz-rds-postgres/index.js +1 -0
  327. package/dist/blz-rds-postgres/result-set.js +1 -0
  328. package/dist/blz-rds-postgres/stored-procedure.d.ts +19 -0
  329. package/dist/blz-rds-postgres/stored-procedure.js +1 -0
  330. package/dist/blz-redis/index.d.ts +31 -0
  331. package/dist/blz-redis/index.js +1 -0
  332. package/dist/blz-redis/lib/redisCache.d.ts +33 -0
  333. package/dist/blz-redis/lib/redisCache.js +1 -0
  334. package/dist/blz-regex/index.d.ts +3 -0
  335. package/dist/blz-regex/index.js +1 -0
  336. package/dist/blz-security/__test__/autorization.test.js +1 -0
  337. package/dist/blz-security/__test__/autorizationKpn.test.js +1 -0
  338. package/dist/blz-security/__test__/orderManagement.test.js +1 -0
  339. package/dist/blz-security/__test__/secureUrl.test.js +1 -0
  340. package/dist/blz-security/__test__/solveMergeRule.test.js +1 -0
  341. package/dist/blz-security/__test__/sqlInjectionGuard.test.js +1 -0
  342. package/dist/blz-security/__test__/xssGuard.test.js +1 -0
  343. package/dist/blz-security/authorizationService.d.ts +42 -0
  344. package/dist/blz-security/authorizationService.js +2 -0
  345. package/dist/blz-security/config/global.js +1 -0
  346. package/dist/blz-security/filescanner/index.d.ts +24 -0
  347. package/dist/blz-security/filescanner/index.js +1 -0
  348. package/dist/blz-security/helpers/consts.d.ts +28 -0
  349. package/dist/blz-security/helpers/consts.js +1 -0
  350. package/dist/blz-security/helpers/utils.d.ts +82 -0
  351. package/dist/blz-security/helpers/utils.js +1 -0
  352. package/dist/blz-security/implementations/cache.d.ts +58 -0
  353. package/dist/blz-security/implementations/cache.js +1 -0
  354. package/dist/blz-security/implementations/oidc.d.ts +100 -0
  355. package/dist/blz-security/implementations/oidc.js +1 -0
  356. package/dist/blz-security/implementations/pkceCacheStore.d.ts +2 -0
  357. package/dist/blz-security/implementations/pkceCacheStore.js +1 -0
  358. package/dist/blz-security/implementations/saml.js +1 -0
  359. package/dist/blz-security/implementations/uma.d.ts +31 -0
  360. package/dist/blz-security/implementations/uma.js +1 -0
  361. package/dist/blz-security/implementations/webAuthn.js +1 -0
  362. package/dist/blz-security/implementations/wstg.js +1 -0
  363. package/dist/blz-security/index.d.ts +4 -0
  364. package/dist/blz-security/index.js +2 -0
  365. package/dist/blz-security/lab/index.js +1 -0
  366. package/dist/blz-security/middleware/HapiServerAzureAd.d.ts +26 -0
  367. package/dist/blz-security/middleware/HapiServerAzureAd.js +1 -0
  368. package/dist/blz-security/middleware/HapiServerKeycloak.d.ts +47 -0
  369. package/dist/blz-security/middleware/HapiServerKeycloak.js +1 -0
  370. package/dist/blz-security/middleware/HapiServerSimToken.d.ts +13 -0
  371. package/dist/blz-security/middleware/HapiServerSimToken.js +1 -0
  372. package/dist/blz-security/middleware/hapi.d.ts +14 -0
  373. package/dist/blz-security/middleware/hapi.js +1 -0
  374. package/dist/blz-security/middleware/hapiServer.js +1 -0
  375. package/dist/blz-security/navigationMemoryRepository.d.ts +6 -0
  376. package/dist/blz-security/navigationMemoryRepository.js +1 -0
  377. package/dist/blz-security/navigationMongoDbRepository.d.ts +15 -0
  378. package/dist/blz-security/navigationMongoDbRepository.js +1 -0
  379. package/dist/blz-security/secureUrlService.d.ts +7 -0
  380. package/dist/blz-security/secureUrlService.js +1 -0
  381. package/dist/blz-security/securityService.d.ts +72 -0
  382. package/dist/blz-security/securityService.js +1 -0
  383. package/dist/blz-security/sqlInjectionGuard.d.ts +37 -0
  384. package/dist/blz-security/sqlInjectionGuard.js +1 -0
  385. package/dist/blz-security/xssGuard.d.ts +14 -0
  386. package/dist/blz-security/xssGuard.js +1 -0
  387. package/dist/blz-strings/index.d.ts +42 -0
  388. package/dist/blz-strings/index.js +1 -0
  389. package/dist/blz-uuid/index.d.ts +1 -0
  390. package/dist/blz-uuid/index.js +1 -0
  391. package/dist/blz-yaml/index.d.ts +2 -0
  392. package/dist/blz-yaml/index.js +1 -0
  393. package/dist/index.d.ts +34 -0
  394. package/dist/index.js +1 -0
  395. package/dist/process-managers/index.d.ts +25 -0
  396. package/dist/process-managers/index.js +1 -0
  397. package/package.json +52 -41
  398. package/blz-base/health/index.js +0 -215
  399. package/blz-base/index.js +0 -1466
  400. package/blz-cache/LruCache.js +0 -44
  401. package/blz-cache/index.js +0 -29
  402. package/blz-config/index.js +0 -434
  403. package/blz-core/index.js +0 -364
  404. package/blz-cryptography/index.js +0 -54
  405. package/blz-datetimes/index.js +0 -356
  406. package/blz-file/example.dat +0 -2545
  407. package/blz-file/fileService.js +0 -205
  408. package/blz-file/index.js +0 -94
  409. package/blz-file/index.test.js +0 -31
  410. package/blz-file/lab.js +0 -33
  411. package/blz-hazelcast/index.js +0 -189
  412. package/blz-hazelcast/lib/credentials.js +0 -25
  413. package/blz-hazelcast/lib/credentialsFactory.js +0 -12
  414. package/blz-hazelcast/lib/hazelcastCache.js +0 -234
  415. package/blz-iterable/index.js +0 -446
  416. package/blz-json-schema/index.js +0 -11
  417. package/blz-jwt/index.js +0 -121
  418. package/blz-kafka/index.js +0 -522
  419. package/blz-math/index.js +0 -131
  420. package/blz-mongodb/index.js +0 -326
  421. package/blz-rds/__test__/scape.test.js +0 -58
  422. package/blz-rds/blz-rds-executor.js +0 -578
  423. package/blz-rds/blz-rds-helper.js +0 -310
  424. package/blz-rds/commands/core/add.js +0 -13
  425. package/blz-rds/commands/core/and.js +0 -18
  426. package/blz-rds/commands/core/asc.js +0 -10
  427. package/blz-rds/commands/core/avg.js +0 -10
  428. package/blz-rds/commands/core/column-ref.js +0 -8
  429. package/blz-rds/commands/core/count-distinct.js +0 -10
  430. package/blz-rds/commands/core/count.js +0 -10
  431. package/blz-rds/commands/core/decimal.js +0 -8
  432. package/blz-rds/commands/core/desc.js +0 -10
  433. package/blz-rds/commands/core/distinct.js +0 -10
  434. package/blz-rds/commands/core/divide.js +0 -11
  435. package/blz-rds/commands/core/embedded-exists.js +0 -17
  436. package/blz-rds/commands/core/embedded-select.js +0 -17
  437. package/blz-rds/commands/core/equals.js +0 -9
  438. package/blz-rds/commands/core/false.js +0 -8
  439. package/blz-rds/commands/core/greater-or-equal.js +0 -9
  440. package/blz-rds/commands/core/greater.js +0 -9
  441. package/blz-rds/commands/core/in.js +0 -9
  442. package/blz-rds/commands/core/integer.js +0 -8
  443. package/blz-rds/commands/core/is-not-null.js +0 -11
  444. package/blz-rds/commands/core/is-null-or-value.js +0 -10
  445. package/blz-rds/commands/core/is-null.js +0 -11
  446. package/blz-rds/commands/core/less-or-equal.js +0 -9
  447. package/blz-rds/commands/core/less-unary.js +0 -12
  448. package/blz-rds/commands/core/less.js +0 -9
  449. package/blz-rds/commands/core/like.js +0 -12
  450. package/blz-rds/commands/core/max.js +0 -10
  451. package/blz-rds/commands/core/min.js +0 -10
  452. package/blz-rds/commands/core/multiply.js +0 -13
  453. package/blz-rds/commands/core/not-equals.js +0 -9
  454. package/blz-rds/commands/core/not-in.js +0 -9
  455. package/blz-rds/commands/core/not.js +0 -13
  456. package/blz-rds/commands/core/null.js +0 -8
  457. package/blz-rds/commands/core/nvl.js +0 -11
  458. package/blz-rds/commands/core/or.js +0 -13
  459. package/blz-rds/commands/core/parameter.js +0 -34
  460. package/blz-rds/commands/core/remainder.js +0 -16
  461. package/blz-rds/commands/core/string.js +0 -8
  462. package/blz-rds/commands/core/subtract.js +0 -13
  463. package/blz-rds/commands/core/sum.js +0 -10
  464. package/blz-rds/commands/core/true.js +0 -8
  465. package/blz-rds/commands/core/tuple.js +0 -13
  466. package/blz-rds/commands/datetimes/add-days.js +0 -11
  467. package/blz-rds/commands/datetimes/add-hours.js +0 -11
  468. package/blz-rds/commands/datetimes/add-milliseconds.js +0 -11
  469. package/blz-rds/commands/datetimes/add-minutes.js +0 -11
  470. package/blz-rds/commands/datetimes/add-months.js +0 -11
  471. package/blz-rds/commands/datetimes/add-seconds.js +0 -11
  472. package/blz-rds/commands/datetimes/add-years.js +0 -11
  473. package/blz-rds/commands/datetimes/date-diff.js +0 -11
  474. package/blz-rds/commands/datetimes/date.js +0 -12
  475. package/blz-rds/commands/datetimes/datetime-diff.js +0 -11
  476. package/blz-rds/commands/datetimes/datetime.js +0 -15
  477. package/blz-rds/commands/datetimes/day.js +0 -10
  478. package/blz-rds/commands/datetimes/hour.js +0 -10
  479. package/blz-rds/commands/datetimes/millisecond.js +0 -10
  480. package/blz-rds/commands/datetimes/minute.js +0 -10
  481. package/blz-rds/commands/datetimes/month-text.js +0 -10
  482. package/blz-rds/commands/datetimes/month.js +0 -10
  483. package/blz-rds/commands/datetimes/now.js +0 -9
  484. package/blz-rds/commands/datetimes/second.js +0 -10
  485. package/blz-rds/commands/datetimes/subtract-days.js +0 -11
  486. package/blz-rds/commands/datetimes/subtract-hours.js +0 -11
  487. package/blz-rds/commands/datetimes/subtract-milliseconds.js +0 -11
  488. package/blz-rds/commands/datetimes/subtract-minutes.js +0 -11
  489. package/blz-rds/commands/datetimes/subtract-seconds.js +0 -11
  490. package/blz-rds/commands/datetimes/time-diff.js +0 -11
  491. package/blz-rds/commands/datetimes/time.js +0 -13
  492. package/blz-rds/commands/datetimes/today.js +0 -9
  493. package/blz-rds/commands/datetimes/week-day-text.js +0 -10
  494. package/blz-rds/commands/datetimes/week-day.js +0 -10
  495. package/blz-rds/commands/datetimes/week.js +0 -10
  496. package/blz-rds/commands/datetimes/year.js +0 -10
  497. package/blz-rds/commands/math/abs.js +0 -10
  498. package/blz-rds/commands/math/acos.js +0 -10
  499. package/blz-rds/commands/math/asin.js +0 -10
  500. package/blz-rds/commands/math/atan.js +0 -10
  501. package/blz-rds/commands/math/atan2.js +0 -11
  502. package/blz-rds/commands/math/ceil.js +0 -10
  503. package/blz-rds/commands/math/cos.js +0 -10
  504. package/blz-rds/commands/math/cosh.js +0 -10
  505. package/blz-rds/commands/math/exp.js +0 -10
  506. package/blz-rds/commands/math/floor.js +0 -10
  507. package/blz-rds/commands/math/log.js +0 -18
  508. package/blz-rds/commands/math/log10.js +0 -10
  509. package/blz-rds/commands/math/pow.js +0 -11
  510. package/blz-rds/commands/math/random.js +0 -9
  511. package/blz-rds/commands/math/round.js +0 -18
  512. package/blz-rds/commands/math/sign.js +0 -10
  513. package/blz-rds/commands/math/sin.js +0 -10
  514. package/blz-rds/commands/math/sinh.js +0 -10
  515. package/blz-rds/commands/math/sqrt.js +0 -10
  516. package/blz-rds/commands/math/tan.js +0 -10
  517. package/blz-rds/commands/math/tanh.js +0 -10
  518. package/blz-rds/commands/math/trunc.js +0 -18
  519. package/blz-rds/commands/strings/concat.js +0 -20
  520. package/blz-rds/commands/strings/contains.js +0 -12
  521. package/blz-rds/commands/strings/ends-with.js +0 -12
  522. package/blz-rds/commands/strings/index-of.js +0 -11
  523. package/blz-rds/commands/strings/is-null-or-empty.js +0 -11
  524. package/blz-rds/commands/strings/is-null-or-white-space.js +0 -11
  525. package/blz-rds/commands/strings/join.js +0 -22
  526. package/blz-rds/commands/strings/last-index-of.js +0 -11
  527. package/blz-rds/commands/strings/length.js +0 -10
  528. package/blz-rds/commands/strings/pad-left.js +0 -20
  529. package/blz-rds/commands/strings/pad-right.js +0 -20
  530. package/blz-rds/commands/strings/replace.js +0 -12
  531. package/blz-rds/commands/strings/starts-with.js +0 -12
  532. package/blz-rds/commands/strings/substring.js +0 -12
  533. package/blz-rds/commands/strings/to-lower.js +0 -10
  534. package/blz-rds/commands/strings/to-upper.js +0 -10
  535. package/blz-rds/commands/strings/trim-end.js +0 -10
  536. package/blz-rds/commands/strings/trim-start.js +0 -10
  537. package/blz-rds/commands/strings/trim.js +0 -10
  538. package/blz-rds/index.js +0 -744
  539. package/blz-rds-mysql/base.js +0 -857
  540. package/blz-rds-mysql/connection-manager.js +0 -129
  541. package/blz-rds-mysql/execute-bulk-insert.js +0 -35
  542. package/blz-rds-mysql/execute-bulk-merge.js +0 -45
  543. package/blz-rds-mysql/execute-non-query.js +0 -34
  544. package/blz-rds-mysql/execute-query.js +0 -50
  545. package/blz-rds-mysql/index.js +0 -41
  546. package/blz-rds-mysql/stored-procedure.js +0 -207
  547. package/blz-rds-mysqlx/base.js +0 -846
  548. package/blz-rds-mysqlx/connection-manager.js +0 -141
  549. package/blz-rds-mysqlx/execute-bulk-insert.js +0 -35
  550. package/blz-rds-mysqlx/execute-bulk-merge.js +0 -45
  551. package/blz-rds-mysqlx/execute-non-query.js +0 -29
  552. package/blz-rds-mysqlx/execute-query.js +0 -39
  553. package/blz-rds-mysqlx/index.js +0 -41
  554. package/blz-rds-mysqlx/stored-procedure.js +0 -179
  555. package/blz-rds-oracle/index.js +0 -539
  556. package/blz-rds-postgres/base.js +0 -861
  557. package/blz-rds-postgres/connection-manager.js +0 -225
  558. package/blz-rds-postgres/execute-bulk-insert.js +0 -81
  559. package/blz-rds-postgres/execute-bulk-merge.js +0 -93
  560. package/blz-rds-postgres/execute-non-query.js +0 -23
  561. package/blz-rds-postgres/execute-query.js +0 -37
  562. package/blz-rds-postgres/index.js +0 -41
  563. package/blz-rds-postgres/result-set.js +0 -51
  564. package/blz-rds-postgres/stored-procedure.js +0 -116
  565. package/blz-redis/index.js +0 -217
  566. package/blz-redis/lib/redisCache.js +0 -265
  567. package/blz-regex/index.js +0 -25
  568. package/blz-security/.eslintrc.js +0 -15
  569. package/blz-security/__test__/AuthorizationKpn.yaml +0 -1149
  570. package/blz-security/__test__/FinancingSetting.yaml +0 -177
  571. package/blz-security/__test__/KpnConfigPortal.yaml +0 -330
  572. package/blz-security/__test__/OrderManagement.yaml +0 -5190
  573. package/blz-security/__test__/Security.yaml +0 -128
  574. package/blz-security/__test__/autorization.test.js +0 -105
  575. package/blz-security/__test__/autorizationKpn.test.js +0 -42
  576. package/blz-security/__test__/orderManagement.test.js +0 -26
  577. package/blz-security/__test__/secureUrl.test.js +0 -79
  578. package/blz-security/__test__/solveMergeRule.test.js +0 -109
  579. package/blz-security/__test__/sqlInjectionGuard.test.js +0 -203
  580. package/blz-security/__test__/xssGuard.test.js +0 -204
  581. package/blz-security/authorizationService.js +0 -537
  582. package/blz-security/config/global.js +0 -8
  583. package/blz-security/config/welcome +0 -8
  584. package/blz-security/doc/README.md +0 -75
  585. package/blz-security/filescanner/index.js +0 -46
  586. package/blz-security/helpers/consts.js +0 -229
  587. package/blz-security/helpers/utils.js +0 -267
  588. package/blz-security/implementations/cache.js +0 -90
  589. package/blz-security/implementations/oidc.js +0 -404
  590. package/blz-security/implementations/pkceCacheStore.js +0 -23
  591. package/blz-security/implementations/saml.js +0 -10
  592. package/blz-security/implementations/uma.js +0 -63
  593. package/blz-security/implementations/webAuthn.js +0 -9
  594. package/blz-security/implementations/wstg.js +0 -72
  595. package/blz-security/index.js +0 -77
  596. package/blz-security/lab/index.js +0 -43
  597. package/blz-security/middleware/HapiServerAzureAd.js +0 -681
  598. package/blz-security/middleware/HapiServerKeycloak.js +0 -876
  599. package/blz-security/middleware/HapiServerSimToken.js +0 -286
  600. package/blz-security/middleware/hapi.js +0 -555
  601. package/blz-security/middleware/hapiServer.js +0 -1008
  602. package/blz-security/navigationMemoryRepository.js +0 -15
  603. package/blz-security/navigationMongoDbRepository.js +0 -73
  604. package/blz-security/secureUrlService.js +0 -47
  605. package/blz-security/securityService.js +0 -413
  606. package/blz-security/sqlInjectionGuard.js +0 -162
  607. package/blz-security/templates/forbidden.html +0 -0
  608. package/blz-security/templates/session-iframe-azure-ad.html +0 -7
  609. package/blz-security/templates/session-iframe.html +0 -73
  610. package/blz-security/templates/unauthorized.html +0 -1
  611. package/blz-security/xssGuard.js +0 -87
  612. package/blz-strings/index.js +0 -167
  613. package/blz-uuid/index.js +0 -7
  614. package/blz-yaml/index.js +0 -19
  615. package/index.js +0 -84
  616. package/process-managers/index.js +0 -422
  617. /package/{blz-rds-mysql → dist/blz-rds-mysql}/syntaxis.json +0 -0
  618. /package/{blz-rds-mysqlx → dist/blz-rds-mysqlx}/syntaxis.json +0 -0
  619. /package/{blz-rds-oracle → dist/blz-rds-oracle}/syntaxis.json +0 -0
  620. /package/{blz-rds-postgres → dist/blz-rds-postgres}/syntaxis.json +0 -0
  621. /package/{blz-security → dist/blz-security}/lab/ConfigurationAdmin.agent.json +0 -0
  622. /package/{blz-security → dist/blz-security}/lab/frontend.json +0 -0
  623. /package/{blz-security → dist/blz-security}/lab/result.json +0 -0
  624. /package/{blz-security → dist/blz-security}/lab/resultOnWeb.json +0 -0
  625. /package/{blz-security → dist/blz-security}/lab/rules.json +0 -0
  626. /package/{blz-security → dist/blz-security}/lab/securityRules.json +0 -0
@@ -1,129 +0,0 @@
1
- "use strict";
2
- const BlzBase = require("./base");
3
- const mysql = require("mysql");
4
- const poolsByName = new Map();
5
- const _ = require("underscore");
6
- const dayjs = require("dayjs");
7
-
8
- async function getPool(config = {}){
9
- let key = config.name;
10
- let pool = poolsByName.get(key);
11
- if(pool) {
12
- return pool;
13
- }
14
- try {
15
- config.typeCast = function typeCast(field, next) {
16
- if (field.type === 'TINY' && field.length === 1) {
17
- return (next() === 1); // 1 = true, 0 = false
18
- } else if(field.type === 'DATETIME' || field.type === 'DATE') {
19
- let value = next();
20
- if (isUtcOffset(value)) {
21
- value = dayjs(value).format("YYYY-MM-DDTHH:mm:ss");
22
- }
23
- return value;
24
- } else {
25
- return next();
26
- }
27
- };
28
- config.waitForConnections = config.waitForConnections || true;
29
- config.connectionLimit = config.connectionLimit || 100;
30
- config.queueLimit = config.queueLimit || 100;
31
- pool = mysql.createPool(config);
32
- poolsByName.set(key, pool);
33
- } catch(error) {
34
- throw BlzBase.error('MySqlCannotCreateConnection', { config }, error);
35
- }
36
- return pool;
37
- };
38
-
39
- function getConnection(pool) {
40
- return new Promise(function(resolve, reject) {
41
- pool.getConnection(function (error, connection) {
42
- if(error) {
43
- console.error(error);
44
- reject(BlzBase.error('MySqlCannotCreateConnection', { connection }, error));
45
- return;
46
- }
47
- connection.name = pool.name;
48
- resolve(connection);
49
- });
50
- });
51
- }
52
-
53
- const createConnection = async (config) => await getConnection(await getPool(config));
54
-
55
- function beginTransaction(connection) {
56
- return new Promise(function(resolve, reject) {
57
- connection.beginTransaction(function(err){
58
- if(err) {
59
- reject(BlzBase.error('MySqlCannotBeginTransaction', { connection }, err));
60
- return;
61
- }
62
- resolve();
63
- });
64
- });
65
- };
66
-
67
- function commitTransaction(connection) {
68
- return new Promise(function(resolve, reject) {
69
- connection.commit(function(err){
70
- if(err) {
71
- reject(BlzBase.error('MySqlCannotCommitTransaction', { connection }, err));
72
- return;
73
- }
74
- resolve();
75
- });
76
- });
77
- };
78
-
79
- function rollbackTransaction(connection) {
80
- return new Promise(function(resolve, reject) {
81
- connection.rollback(function(err){
82
- if(err) {
83
- reject(BlzBase.error('MySqlCannotRollBackTransaction', { connection }, err));
84
- return;
85
- }
86
- resolve();
87
- });
88
- });
89
- };
90
-
91
- async function close(connection) {
92
- connection.release();
93
- connection.destroy();
94
- }
95
-
96
- async function terminate() {
97
- let reject = [];
98
- for (const [, pool] of poolsByName) {
99
- try {
100
- await pool.end();
101
- } catch(error) {
102
- reject.push(error);
103
- }
104
- }
105
- poolsByName.clear();
106
- if(_.isEmpty(reject)) {
107
- return true;
108
- }
109
- throw new Error(reject);
110
- }
111
-
112
- function isUtcOffset(date) {
113
- if (_.isNull(date) || _.isUndefined(date) || !_.isString(date)) {
114
- return false;
115
- }
116
- const match = date.match(/^(.*)([+-])(\d{2})?:?(\d{2})$/);
117
- return (!_.isNull(match)) && ((!_.isUndefined(match[3]) && (match[3] !== '00')) || (!_.isUndefined(match[4]) && (match[4] !== '00')));
118
- }
119
-
120
- module.exports = {
121
- beginTransaction,
122
- close,
123
- commitTransaction,
124
- createConnection,
125
- getConnection,
126
- getPool,
127
- rollbackTransaction,
128
- terminate
129
- };
@@ -1,35 +0,0 @@
1
- "use strict";
2
- const {convertValueToDb } = require("./execute-non-query");
3
- const BlzBase = require("./base");
4
-
5
- async function executeBulkInsert(connection, sql, rows, options) {
6
- const query = sql + ' ?'
7
- const list = []
8
- for(let i = 0; i < rows.length; i++) {
9
- const row = rows[i]
10
- const values = []
11
- for(let j = 0; j < row.length; j++) {
12
- const value = convertValueToDb(row[j])
13
- values.push(value)
14
- }
15
- list.push(values)
16
- }
17
- return new Promise(function(resolve, reject){
18
- connection.query(query, [list], function(error, result, fields) {
19
- if(error) {
20
- reject(BlzBase.error('RdsMySqlExecuteError', { name: connection.name, query, rows }, error));
21
- return;
22
- }
23
- if (options.autoincrementalData) {
24
- const start = result.insertId
25
- const end = result.insertId + (result.affectedRows - 1)
26
- const ids= []
27
- for (let i = start; i <= end; i++)ids.push(i)
28
- resolve({ ids, affectedRows: result.affectedRows });
29
- } else {
30
- resolve({affectedRows: result.affectedRows});
31
- }
32
- })
33
- })
34
- }
35
- module.exports = executeBulkInsert;
@@ -1,45 +0,0 @@
1
- "use strict";
2
- const {convertValueToDb } = require("./execute-non-query");
3
- const BlzBase = require("./base");
4
- const SqlString = require('sqlstring')
5
-
6
- async function executeBulkMerge(connection, sql, rows, options) {
7
- const list = []
8
- for(let i = 0; i < rows.length; i++) {
9
- const row = rows[i]
10
- const values = []
11
- for(let j = 0; j < row.length; j++) {
12
- const column = options.columns[j]
13
- let value = convertValueToDb(row[j])
14
- if ( ['string','date','datetime','time'].includes(column.type)) {
15
- value = SqlString.escape(value)
16
- }
17
- values.push(value)
18
- }
19
- list.push(`(${values.join(',')})`)
20
- }
21
- const _sql = []
22
- _sql.push('INSERT INTO ' + options.rdsTable.tableName + ' (')
23
- _sql.push(options.setsFields.map(p=> '`'+p+'`').join(', '))
24
- _sql.push(')\n\rVALUES\n\r')
25
- _sql.push(list.join(','))
26
- _sql.push('\n\rON DUPLICATE KEY UPDATE\n\r')
27
- let first = true
28
- for( const field of options.setsFields.map(p=> '`'+p+'`')) {
29
- _sql.push((first? ' ': ',\n\r ') + field + ' = VALUES(' + field + ')')
30
- first = false
31
- }
32
- _sql.push(';')
33
- const query = _sql.join('')
34
-
35
- return new Promise(function(resolve, reject){
36
- connection.query(query, null, function(error, result, fields) {
37
- if(error) {
38
- reject(BlzBase.error('RdsMySqlExecuteError', { name: connection.name, query, rows }, error));
39
- return;
40
- }
41
- resolve({affectedRows: result.affectedRows});
42
- })
43
- })
44
- }
45
- module.exports = executeBulkMerge;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- const _ = require('underscore');
3
- const BlzBase = require("./base");
4
- const toUnnamed = require('named-placeholders')();
5
- /**
6
- * @param {*} connection
7
- * @param {string} sql
8
- * @param {[{name: string, value: *}]} [rdsParameters = []]
9
- * @returns {Promise<{row: number, id: number}>}
10
- * @public
11
- */
12
- async function executeNonQuery(connection, sql, rdsParameters, options) {
13
- let query = sql, parameters = [], rs = null;
14
- try {
15
- if(!_.isEmpty(rdsParameters)) {
16
- [query, parameters] = toUnnamed(sql, BlzBase.reduceParameters(rdsParameters, options));
17
- }
18
- } catch(error) {
19
- throw BlzBase.error('RdsAuroraExecuteError', { name: connection.name, sql, parameters }, error);
20
- }
21
- return new Promise(function(resolve, reject) {
22
- connection.query(query, parameters, function(err, result, fields) {
23
- if(err) {
24
- reject(BlzBase.error('RdsAuroraExecuteError', { name: connection.name, sql, parameters }, err));
25
- return;
26
- }
27
- resolve({
28
- rowsAffected : result.affectedRows,
29
- id : result.insertId
30
- });
31
- });
32
- })
33
- }
34
- module.exports = { executeNonQuery }
@@ -1,50 +0,0 @@
1
- "use strict";
2
- const _ = require('underscore');
3
- const toUnnamed = require('named-placeholders')();
4
- const BlzBase = require("./base");
5
-
6
- /**
7
- * @param {*} connection
8
- * @param {string} sql
9
- * @param {[{name: string, value: *}]} [rdsParameters = []]
10
- * @public
11
- */
12
- async function executeQuery(connection, sql, rdsParameters = [], options) {
13
- let query = sql, parameters = [];
14
- try {
15
- if(!_.isEmpty(rdsParameters)) {
16
- [query, parameters] = toUnnamed(sql, BlzBase.reduceParameters(rdsParameters, options));
17
- }
18
- } catch(error) {
19
- throw BlzBase.error('RdsMySqlExecuteError', { name: connection.name, sql, parameters }, error);
20
- }
21
- return new Promise(function(resolve, reject){
22
- connection.query(query, parameters, function(error, results, fields) {
23
- if(error) {
24
- reject(BlzBase.error('RdsMySqlExecuteError', { name: connection.name, sql, parameters }, error));
25
- return;
26
- }
27
- resolve({resultSet: new ResultSet(results, fields)});
28
- });
29
- });
30
- }
31
-
32
- function ResultSet(results, fields) {
33
- return {
34
- getRow: async function() {
35
- let data = results.shift();
36
- if(!data) {
37
- return null;
38
- }
39
- return _.map(fields, field =>
40
- data[field.name]
41
- );
42
- },
43
- close: async function() {
44
- results = null;
45
- fields = null;
46
- return true;
47
- }
48
- }
49
- }
50
- module.exports = executeQuery;
@@ -1,41 +0,0 @@
1
- const _ = require("underscore");
2
- const {executeNonQuery } = require("./execute-non-query");
3
- const executeQuery = require("./execute-query");
4
- const executeBulkInsert = require("./execute-bulk-insert");
5
- const executeBulkMerge = require("./execute-bulk-merge");
6
- const executeProcedure = require("./stored-procedure");
7
- const {
8
- beginTransaction,
9
- close,
10
- commitTransaction,
11
- createConnection: createRdsConnection,
12
- rollbackTransaction,
13
- terminate
14
- } = require("./connection-manager");
15
-
16
- process.on('exit', async function () {
17
- await terminate();
18
- });
19
-
20
- module.exports = {
21
- syntaxis: require("./syntaxis.json"),
22
- executeProcedure,
23
- executeSql: async function (connection, sql, parameters, options = {}) {
24
- if(sql.indexOf("call") != -1 ) {
25
- return await executeProcedure(connection, sql, parameters);
26
- } else if(_.has(options, "bulkInsert")) {
27
- return await executeBulkInsert(connection, sql, parameters, options);
28
- } else if(_.has(options, "bulkMerge")) {
29
- return await executeBulkMerge(connection, sql, parameters, options);
30
- } else if(_.has(options, "queryOne") || _.has(options, "query")) {
31
- return await executeQuery(connection, sql, parameters, options);
32
- } else {
33
- return await executeNonQuery(connection, sql, parameters, options);
34
- }
35
- },
36
- beginTransaction,
37
- close,
38
- createRdsConnection,
39
- commitTransaction,
40
- rollbackTransaction,
41
- }
@@ -1,207 +0,0 @@
1
- "use strict";
2
- const mysql = require("mysql");
3
- const _ = require('underscore');
4
- const BlzBase = require("./base");
5
- const toString = Object.prototype.toString;
6
- //https://dev.mysql.com/doc/dev/connector-nodejs/8.0/tutorial-Getting_Started.html
7
- //https://dev.mysql.com/doc/x-devapi-userguide/en/using-sql.html
8
- //https://dev.mysql.com/doc/refman/8.0/en/faqs-stored-procs.html#faq-mysql-can-pass-cursor-in
9
-
10
- function tryDatetime(value) {
11
- let convertMilliseconds = function(strMilliseconds) {
12
- if (strMilliseconds) {
13
- if (strMilliseconds.length < 3)
14
- strMilliseconds = strMilliseconds.padEnd(3, '0');
15
- if (strMilliseconds.length > 3)
16
- strMilliseconds = strMilliseconds.substr(0, 3);
17
- return Number(strMilliseconds);
18
- }
19
- else
20
- return 0;
21
- };
22
- let strType = toString.call(value);
23
- if (strType === '[object Date]') {
24
- return value;
25
- }
26
- else if (strType === '[object String]') {
27
- let match = /^(\d{4})-(\d{1,2})-(\d{1,2})[T,\s](\d{1,2})\:(\d{1,2})\:(\d{1,2})\.?(\d+)?Z?$/.exec(value);
28
- if (match)
29
- return new Date(Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]), Number(match[4]), Number(match[5]), Number(match[6] || 0), convertMilliseconds(match[7])));
30
- }
31
- return null;
32
- }
33
-
34
- function convertValueToDb (value) {
35
- if (_.isUndefined(value)) {
36
- return null;
37
- }
38
- if(_.isNull(value)) {
39
- return null;
40
- }
41
- if (value === true) {
42
- return 1;
43
- }
44
- if (value === false) {
45
- return 0;
46
- }
47
- let datetime = tryDatetime(value);
48
- if (datetime) {
49
- let result = datetime.toJSON();
50
- if (result.length === 24) {
51
- result = result.substring(0, 19);
52
- }
53
- return result;
54
- }
55
- return value;
56
- }
57
-
58
- /**
59
- * @typedef {Object} Parameter
60
- * @property {boolean} isResultSet
61
- * @property {string} name
62
- * @property {*} value
63
- * @property { 'in' | 'out' | 'in/out' } direction
64
- * @property {'string' | 'integer' | 'decimal' | 'boolean' | 'datetime' | 'date' | 'time' | 'binary'} type
65
- */
66
-
67
- /**
68
- *
69
- * @param {mysqlx.Session} session
70
- * @param {Parameter} parameter
71
- * @param {*} result
72
- */
73
- async function parseOutputParameters(session, parameter, result, time_stamp) {
74
- let resultSet = null, value = null;
75
- try {
76
- resultSet = await (new Promise(function(resolve, reject) {
77
- let sqlSelect = `SELECT @${parameter.name}_${time_stamp};`;
78
- session.query(sqlSelect,(err, result, field) => {
79
- if(err) {
80
- return reject(err);
81
- }
82
- resolve(result);
83
- })
84
- }));
85
- } catch(error) {
86
- throw BlzBase.error('RdsMysqlCannotConvertParameters', { parameter, result, time_stamp }, error);
87
- }
88
- let property = _.property(`@${parameter.name}_${time_stamp}`);
89
- value = property(_.first(resultSet));
90
- if(parameter.isResultSet) {
91
- result[parameter.name] = JSON.parse(value);
92
- return;
93
- }
94
- switch (parameter.type) {
95
- case 'string':
96
- result[parameter.name] = BlzBase.convertToString(value);
97
- break;
98
- case 'integer':
99
- result[parameter.name] = BlzBase.convertToInteger(value);
100
- break;
101
- case 'decimal':
102
- result[parameter.name] = BlzBase.convertToDecimal(value);
103
- break;
104
- case 'boolean':
105
- result[parameter.name] = BlzBase.convertToBoolean(value);
106
- break;
107
- case 'datetime':
108
- result[parameter.name] = BlzBase.convertToDatetime(value);
109
- break;
110
- case 'date':
111
- result[parameter.name] = BlzBase.convertToDate(value);
112
- break;
113
- case 'time':
114
- result[parameter.name] = BlzBase.convertToTime(value);
115
- break;
116
- case 'binary':
117
- result[parameter.name] = BlzBase.convertToBinary(value);
118
- break;
119
- default:
120
- throw BlzBase.error('RdsMySqlUnexpectedType', { parameter, result, value });
121
- }
122
-
123
- }
124
-
125
- /**
126
- * @param {mysqlx.Session} session
127
- * @param {string} procedure
128
- * @param {[Parameter]} [parameters=[]]
129
- * @param {number} time_stamp
130
- * @returns {string}
131
- */
132
- async function parseInputParameters(session, procedure, parameters, time_stamp) {
133
- for(const parameter of parameters) {
134
- switch(parameter.direction) {
135
- case "in":
136
- case "in/out":
137
- try {
138
- await (new Promise(function(resolve, reject) {
139
- let sqlSet = `SET @${parameter.name}_${time_stamp} = ?;`;
140
- session.query(sqlSet, [convertValueToDb(parameter.value)], (err, result, field) => {
141
- if(err) {
142
- return reject(err);
143
- }
144
- resolve();
145
- })
146
- }));
147
- } catch (error) {
148
- throw BlzBase.error('RdsMySqlInputParameterType', { parameters, time_stamp });
149
- }
150
- procedure = procedure
151
- .replace(`:${parameter.name}`, `@${parameter.name}_${time_stamp}`);
152
- break;
153
- case "out":
154
- try {
155
- await (new Promise(function(resolve, reject) {
156
- let sqlSet = `SET @${parameter.name}_${time_stamp} = NULL;`;
157
- session.query(sqlSet, (err, result, field) => {
158
- if(err) {
159
- return reject(err);
160
- }
161
- resolve();
162
- });
163
- }));
164
- } catch(error) {
165
- throw BlzBase.error('RdsMySqlInputParameterType', { parameters, time_stamp });
166
- }
167
- procedure = procedure
168
- .replace(`:${parameter.name}`, `@${parameter.name}_${time_stamp}`);
169
- break;
170
- }
171
- }
172
- return procedure;
173
- }
174
-
175
- /**
176
- * @param {mysqlx.Session} session
177
- * @param {string} procedure
178
- * @param {[Parameter]} [parameters=[]]
179
- */
180
- async function executeProcedure(session, procedure, parameters) {
181
- const time_stamp = Date.now();
182
- if(_.isArray(parameters)) {
183
- procedure = await parseInputParameters(session, procedure, parameters, time_stamp);
184
- }
185
- try {
186
- await (new Promise(function(resolve, reject) {
187
- session.query(procedure, (err, result, field) => {
188
- if(err) {
189
- return reject(err);
190
- }
191
- resolve(result);
192
- })
193
- }));
194
- } catch (error) {
195
- throw BlzBase.error('RdsMysqlCannotExecuteProcedure', { session, procedure, parameters }, error);
196
- }
197
- let outParameters = {};
198
- for(const parameter of parameters) {
199
- if(parameter.direction == "in") {
200
- continue;
201
- }
202
- await parseOutputParameters(session, parameter, outParameters, time_stamp);
203
- }
204
- return { outParameters };
205
- }
206
-
207
- module.exports = executeProcedure;