@powfix/core-js 0.15.0-beta-2 → 0.15.0-beta-4

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 (485) hide show
  1. package/dist/{server/interfaces → browser/cjs/constants}/index.browser.js +6 -4
  2. package/dist/{server/constants → browser/cjs}/index.browser.js +7 -6
  3. package/dist/{server/managers → browser/cjs/interfaces}/index.browser.js +4 -2
  4. package/dist/{server/types → browser/cjs/managers}/index.browser.js +2 -2
  5. package/dist/browser/cjs/scripts/index.browser.js +17 -0
  6. package/dist/{server → browser/cjs}/services/index.browser.js +1 -1
  7. package/dist/browser/cjs/services/time/index.js +18 -0
  8. package/dist/{server/scripts → browser/cjs/types}/index.browser.js +2 -1
  9. package/dist/{server → browser/cjs}/utils/ArrayUtils.js +2 -2
  10. package/dist/{server → browser/cjs}/utils/DateUtils.js +17 -17
  11. package/dist/{server → browser/cjs}/utils/JuminNumberUtils.js +2 -2
  12. package/dist/{server → browser/cjs}/utils/ObjectIdUtils.js +3 -3
  13. package/dist/{server → browser/cjs}/utils/Sequencer.js +2 -2
  14. package/dist/{server → browser/cjs}/utils/global/fallbackIfNull.js +2 -2
  15. package/dist/{server → browser/cjs}/utils/global/fallbackIfUndefined.js +2 -2
  16. package/dist/{server → browser/cjs/utils/global}/index.js +11 -8
  17. package/dist/{server → browser/cjs}/utils/global/processFirstNonNullish.js +2 -2
  18. package/dist/browser/cjs/utils/index.browser.js +33 -0
  19. package/dist/{server → browser/cjs}/utils/try-catch/index.js +1 -1
  20. package/dist/browser/esm/constants/index.browser.mjs +6 -0
  21. package/dist/browser/esm/index.browser.mjs +7 -0
  22. package/dist/browser/esm/interfaces/index.browser.mjs +4 -0
  23. package/dist/browser/esm/managers/index.browser.mjs +2 -0
  24. package/dist/browser/esm/scripts/index.browser.mjs +1 -0
  25. package/dist/browser/esm/services/index.browser.mjs +1 -0
  26. package/dist/browser/esm/services/time/index.mjs +2 -0
  27. package/dist/browser/esm/types/index.browser.mjs +2 -0
  28. package/dist/{client/utils/ArrayUtils.js → browser/esm/utils/ArrayUtils.mjs} +1 -1
  29. package/dist/{client/utils/DateUtils.js → browser/esm/utils/DateUtils.mjs} +1 -1
  30. package/dist/{client/utils/JuminNumberUtils.js → browser/esm/utils/JuminNumberUtils.mjs} +1 -1
  31. package/dist/{client/utils/ObjectIdUtils.js → browser/esm/utils/ObjectIdUtils.mjs} +1 -1
  32. package/dist/{client/utils/Sequencer.js → browser/esm/utils/Sequencer.mjs} +1 -1
  33. package/dist/{client/utils/global/fallbackIfNull.js → browser/esm/utils/global/fallbackIfNull.mjs} +1 -1
  34. package/dist/{client/utils/global/fallbackIfUndefined.js → browser/esm/utils/global/fallbackIfUndefined.mjs} +1 -1
  35. package/dist/browser/esm/utils/global/index.mjs +11 -0
  36. package/dist/{client/utils/global/processFirstNonNullish.js → browser/esm/utils/global/processFirstNonNullish.mjs} +1 -1
  37. package/dist/browser/esm/utils/index.browser.mjs +17 -0
  38. package/dist/browser/esm/utils/try-catch/index.mjs +1 -0
  39. package/dist/browser/types/constants/index.browser.d.ts +6 -0
  40. package/dist/browser/types/index.browser.d.ts +7 -0
  41. package/dist/{server → browser/types}/interfaces/Point3.d.ts +1 -1
  42. package/dist/browser/types/interfaces/index.browser.d.ts +4 -0
  43. package/dist/{client → browser/types}/managers/SessionManager.d.ts +2 -2
  44. package/dist/{client → browser/types}/managers/SessionManager.type.d.ts +1 -1
  45. package/dist/browser/types/managers/index.browser.d.ts +2 -0
  46. package/dist/browser/types/scripts/index.browser.d.ts +1 -0
  47. package/dist/browser/types/services/index.browser.d.ts +1 -0
  48. package/dist/{client → browser/types}/services/time/TimeService.d.ts +1 -1
  49. package/dist/browser/types/services/time/index.d.ts +2 -0
  50. package/dist/browser/types/types/index.browser.d.ts +2 -0
  51. package/dist/{client → browser/types}/utils/CoordinateUtils.d.ts +1 -1
  52. package/dist/{server → browser/types}/utils/DateUtils.d.ts +1 -1
  53. package/dist/{server → browser/types}/utils/Point3Utils.d.ts +1 -1
  54. package/dist/browser/types/utils/global/index.d.ts +11 -0
  55. package/dist/browser/types/utils/index.browser.d.ts +17 -0
  56. package/dist/browser/types/utils/try-catch/index.d.ts +1 -0
  57. package/dist/node/cjs/constants/COORDINATE.js +10 -0
  58. package/dist/node/cjs/constants/CRUD.js +22 -0
  59. package/dist/node/cjs/constants/DATE.js +26 -0
  60. package/dist/node/cjs/constants/DISTANCE.js +18 -0
  61. package/dist/node/cjs/constants/DURATION.js +21 -0
  62. package/dist/node/cjs/constants/NOT_NULL.js +4 -0
  63. package/dist/node/cjs/constants/index.browser.js +22 -0
  64. package/dist/node/cjs/constants/index.js +18 -0
  65. package/dist/{server/interfaces → node/cjs/constants/nodejs}/index.js +2 -2
  66. package/dist/node/cjs/index.browser.js +23 -0
  67. package/dist/node/cjs/index.js +24 -0
  68. package/dist/node/cjs/interfaces/index.browser.js +20 -0
  69. package/dist/node/cjs/interfaces/index.js +18 -0
  70. package/dist/{server/interfaces/nodejs → node/cjs/interfaces/nodejs/db}/index.js +1 -1
  71. package/dist/node/cjs/interfaces/nodejs/db/sequelize/UpsertOptions.js +2 -0
  72. package/dist/{server/constants/nodejs → node/cjs/interfaces/nodejs/db/sequelize}/index.js +6 -2
  73. package/dist/{server/scripts → node/cjs/interfaces/nodejs}/index.js +1 -1
  74. package/dist/node/cjs/managers/SessionManager.js +134 -0
  75. package/dist/node/cjs/managers/SessionManager.type.js +2 -0
  76. package/dist/{server → node/cjs}/managers/TransactionManager.js +13 -13
  77. package/dist/node/cjs/managers/TransactionManager.types.js +2 -0
  78. package/dist/node/cjs/managers/index.browser.js +18 -0
  79. package/dist/{server/constants → node/cjs/managers}/index.js +2 -2
  80. package/dist/node/cjs/scripts/base64Polyfill.js +14 -0
  81. package/dist/node/cjs/scripts/index.browser.js +17 -0
  82. package/dist/node/cjs/scripts/index.js +17 -0
  83. package/dist/node/cjs/services/index.browser.js +17 -0
  84. package/dist/{server/interfaces/nodejs/db → node/cjs/services}/index.js +2 -1
  85. package/dist/{server → node/cjs}/services/redis/RedisPublisher.js +2 -2
  86. package/dist/{server → node/cjs}/services/redis/RedisSubscriber.js +5 -5
  87. package/dist/{server → node/cjs}/services/redis/index.js +3 -3
  88. package/dist/node/cjs/services/time/TimeService.js +180 -0
  89. package/dist/node/cjs/services/time/TimeService.type.js +2 -0
  90. package/dist/node/cjs/services/time/index.js +18 -0
  91. package/dist/node/cjs/types/IntRage.js +2 -0
  92. package/dist/node/cjs/types/PartialExcept.js +2 -0
  93. package/dist/node/cjs/types/UpsertResult.js +2 -0
  94. package/dist/node/cjs/types/index.browser.js +18 -0
  95. package/dist/node/cjs/types/index.js +18 -0
  96. package/dist/node/cjs/utils/ArrayUtils.js +30 -0
  97. package/dist/node/cjs/utils/AxiosUtils.js +53 -0
  98. package/dist/node/cjs/utils/BooleanUtils.js +8 -0
  99. package/dist/node/cjs/utils/Calc.js +27 -0
  100. package/dist/node/cjs/utils/CoordinateUtils.js +42 -0
  101. package/dist/node/cjs/utils/DateUtils.js +310 -0
  102. package/dist/node/cjs/utils/JuminNumberUtils.js +50 -0
  103. package/dist/node/cjs/utils/NumberUtils.js +25 -0
  104. package/dist/node/cjs/utils/ObjectIdUtils.js +24 -0
  105. package/dist/node/cjs/utils/Point3Utils.js +12 -0
  106. package/dist/node/cjs/utils/RandomUtils.js +64 -0
  107. package/dist/node/cjs/utils/Sequencer.js +148 -0
  108. package/dist/node/cjs/utils/StringUtils.js +37 -0
  109. package/dist/node/cjs/utils/UuidUtils.js +79 -0
  110. package/dist/node/cjs/utils/Validator.js +118 -0
  111. package/dist/node/cjs/utils/global/between.js +7 -0
  112. package/dist/node/cjs/utils/global/castArray.js +6 -0
  113. package/dist/node/cjs/utils/global/circularDistance.js +14 -0
  114. package/dist/node/cjs/utils/global/fallbackIfEqual.js +9 -0
  115. package/dist/node/cjs/utils/global/fallbackIfNull.js +7 -0
  116. package/dist/node/cjs/utils/global/fallbackIfUndefined.js +7 -0
  117. package/dist/node/cjs/utils/global/firstNonNullish.js +13 -0
  118. package/dist/node/cjs/utils/global/flat.js +117 -0
  119. package/dist/node/cjs/utils/global/index.js +27 -0
  120. package/dist/node/cjs/utils/global/processFirstNonNullish.js +11 -0
  121. package/dist/node/cjs/utils/global/pureEnum.js +14 -0
  122. package/dist/node/cjs/utils/global/sleep.js +5 -0
  123. package/dist/node/cjs/utils/index.browser.js +33 -0
  124. package/dist/node/cjs/utils/index.js +18 -0
  125. package/dist/{server → node/cjs}/utils/nodejs/index.js +3 -3
  126. package/dist/{server → node/cjs}/utils/nodejs/sequelize-utils/SequelizeUtils.js +8 -8
  127. package/dist/{server → node/cjs}/utils/nodejs/sequelize-utils/index.js +2 -2
  128. package/dist/node/cjs/utils/nodejs/sequelize-utils/types.js +2 -0
  129. package/dist/node/cjs/utils/try-catch/TryCatch.js +78 -0
  130. package/dist/node/cjs/utils/try-catch/index.js +17 -0
  131. package/dist/node/esm/constants/COORDINATE.mjs +6 -0
  132. package/dist/node/esm/constants/CRUD.mjs +19 -0
  133. package/dist/node/esm/constants/DATE.mjs +22 -0
  134. package/dist/node/esm/constants/DISTANCE.mjs +14 -0
  135. package/dist/node/esm/constants/DURATION.mjs +17 -0
  136. package/dist/node/esm/constants/NOT_NULL.mjs +1 -0
  137. package/dist/node/esm/constants/index.browser.mjs +6 -0
  138. package/dist/node/esm/constants/index.mjs +2 -0
  139. package/dist/node/esm/constants/nodejs/TransactionManagerLogLevel.mjs +8 -0
  140. package/dist/node/esm/constants/nodejs/TransactionManagerTimeoutAction.mjs +5 -0
  141. package/dist/node/esm/constants/nodejs/index.mjs +2 -0
  142. package/dist/node/esm/index.browser.mjs +7 -0
  143. package/dist/node/esm/index.mjs +8 -0
  144. package/dist/node/esm/interfaces/Coordinate.mjs +1 -0
  145. package/dist/node/esm/interfaces/Point2.mjs +1 -0
  146. package/dist/node/esm/interfaces/Point3.mjs +1 -0
  147. package/dist/node/esm/interfaces/StorageProvider.mjs +1 -0
  148. package/dist/node/esm/interfaces/index.browser.mjs +4 -0
  149. package/dist/node/esm/interfaces/index.mjs +2 -0
  150. package/dist/node/esm/interfaces/nodejs/db/index.mjs +1 -0
  151. package/dist/node/esm/interfaces/nodejs/db/sequelize/Hook.mjs +1 -0
  152. package/dist/node/esm/interfaces/nodejs/db/sequelize/HookFn.mjs +1 -0
  153. package/dist/node/esm/interfaces/nodejs/db/sequelize/HookType.mjs +1 -0
  154. package/dist/node/esm/interfaces/nodejs/db/sequelize/ReloadOption.mjs +1 -0
  155. package/dist/node/esm/interfaces/nodejs/db/sequelize/TransactionOption.mjs +1 -0
  156. package/dist/node/esm/interfaces/nodejs/db/sequelize/UpsertOptions.mjs +1 -0
  157. package/dist/node/esm/interfaces/nodejs/db/sequelize/index.mjs +6 -0
  158. package/dist/node/esm/interfaces/nodejs/index.mjs +1 -0
  159. package/dist/node/esm/managers/SessionManager.mjs +127 -0
  160. package/dist/node/esm/managers/SessionManager.type.mjs +1 -0
  161. package/dist/node/esm/managers/TransactionManager.mjs +144 -0
  162. package/dist/node/esm/managers/TransactionManager.types.mjs +1 -0
  163. package/dist/node/esm/managers/index.browser.mjs +2 -0
  164. package/dist/node/esm/managers/index.mjs +2 -0
  165. package/dist/node/esm/scripts/base64Polyfill.mjs +10 -0
  166. package/dist/node/esm/scripts/index.browser.mjs +1 -0
  167. package/dist/node/esm/scripts/index.mjs +1 -0
  168. package/dist/node/esm/services/index.browser.mjs +1 -0
  169. package/dist/node/esm/services/index.mjs +2 -0
  170. package/dist/node/esm/services/redis/RedisClient.mjs +71 -0
  171. package/dist/node/esm/services/redis/RedisPublisher.mjs +60 -0
  172. package/dist/node/esm/services/redis/RedisSubscriber.mjs +69 -0
  173. package/dist/node/esm/services/redis/index.mjs +4 -0
  174. package/dist/node/esm/services/time/TimeService.mjs +173 -0
  175. package/dist/node/esm/services/time/TimeService.type.mjs +1 -0
  176. package/dist/node/esm/services/time/index.mjs +2 -0
  177. package/dist/node/esm/types/IntRage.mjs +1 -0
  178. package/dist/node/esm/types/PartialExcept.mjs +1 -0
  179. package/dist/node/esm/types/UpsertResult.mjs +1 -0
  180. package/dist/node/esm/types/index.browser.mjs +2 -0
  181. package/dist/node/esm/types/index.mjs +2 -0
  182. package/dist/node/esm/utils/ArrayUtils.mjs +26 -0
  183. package/dist/node/esm/utils/AxiosUtils.mjs +49 -0
  184. package/dist/node/esm/utils/BooleanUtils.mjs +5 -0
  185. package/dist/node/esm/utils/Calc.mjs +23 -0
  186. package/dist/node/esm/utils/CoordinateUtils.mjs +38 -0
  187. package/dist/node/esm/utils/DateUtils.mjs +303 -0
  188. package/dist/node/esm/utils/JuminNumberUtils.mjs +46 -0
  189. package/dist/node/esm/utils/NumberUtils.mjs +21 -0
  190. package/dist/node/esm/utils/ObjectIdUtils.mjs +20 -0
  191. package/dist/node/esm/utils/Point3Utils.mjs +8 -0
  192. package/dist/node/esm/utils/RandomUtils.mjs +60 -0
  193. package/dist/node/esm/utils/Sequencer.mjs +141 -0
  194. package/dist/node/esm/utils/StringUtils.mjs +33 -0
  195. package/dist/node/esm/utils/UuidUtils.mjs +42 -0
  196. package/dist/node/esm/utils/Validator.mjs +114 -0
  197. package/dist/node/esm/utils/global/between.mjs +3 -0
  198. package/dist/node/esm/utils/global/castArray.mjs +3 -0
  199. package/dist/node/esm/utils/global/circularDistance.mjs +11 -0
  200. package/dist/node/esm/utils/global/fallbackIfEqual.mjs +6 -0
  201. package/dist/node/esm/utils/global/fallbackIfNull.mjs +4 -0
  202. package/dist/node/esm/utils/global/fallbackIfUndefined.mjs +4 -0
  203. package/dist/node/esm/utils/global/firstNonNullish.mjs +10 -0
  204. package/dist/node/esm/utils/global/flat.mjs +113 -0
  205. package/dist/node/esm/utils/global/index.mjs +11 -0
  206. package/dist/node/esm/utils/global/processFirstNonNullish.mjs +8 -0
  207. package/dist/node/esm/utils/global/pureEnum.mjs +9 -0
  208. package/dist/node/esm/utils/global/sleep.mjs +1 -0
  209. package/dist/node/esm/utils/index.browser.mjs +17 -0
  210. package/dist/node/esm/utils/index.mjs +2 -0
  211. package/dist/node/esm/utils/nodejs/HookUtils.mjs +26 -0
  212. package/dist/node/esm/utils/nodejs/index.mjs +2 -0
  213. package/dist/node/esm/utils/nodejs/sequelize-utils/SequelizeUtils.mjs +71 -0
  214. package/dist/node/esm/utils/nodejs/sequelize-utils/index.mjs +1 -0
  215. package/dist/node/esm/utils/nodejs/sequelize-utils/types.mjs +1 -0
  216. package/dist/node/esm/utils/try-catch/TryCatch.mjs +74 -0
  217. package/dist/node/esm/utils/try-catch/index.mjs +1 -0
  218. package/dist/node/types/constants/index.browser.d.ts +6 -0
  219. package/dist/node/types/constants/index.d.ts +2 -0
  220. package/dist/node/types/constants/nodejs/index.d.ts +2 -0
  221. package/dist/node/types/index.browser.d.ts +7 -0
  222. package/dist/node/types/index.d.ts +8 -0
  223. package/dist/{client → node/types}/interfaces/Point3.d.ts +1 -1
  224. package/dist/node/types/interfaces/index.browser.d.ts +4 -0
  225. package/dist/node/types/interfaces/index.d.ts +2 -0
  226. package/dist/node/types/interfaces/nodejs/db/index.d.ts +1 -0
  227. package/dist/{server → node/types}/interfaces/nodejs/db/sequelize/Hook.d.ts +2 -2
  228. package/dist/{server → node/types}/interfaces/nodejs/db/sequelize/HookFn.d.ts +1 -1
  229. package/dist/node/types/interfaces/nodejs/db/sequelize/UpsertOptions.d.ts +4 -0
  230. package/dist/node/types/interfaces/nodejs/db/sequelize/index.d.ts +6 -0
  231. package/dist/node/types/interfaces/nodejs/index.d.ts +1 -0
  232. package/dist/{server → node/types}/managers/SessionManager.d.ts +2 -2
  233. package/dist/{server → node/types}/managers/SessionManager.type.d.ts +1 -1
  234. package/dist/{server → node/types}/managers/TransactionManager.d.ts +2 -2
  235. package/dist/{server → node/types}/managers/TransactionManager.types.d.ts +1 -1
  236. package/dist/node/types/managers/index.browser.d.ts +2 -0
  237. package/dist/node/types/managers/index.d.ts +2 -0
  238. package/dist/node/types/scripts/index.browser.d.ts +1 -0
  239. package/dist/node/types/scripts/index.d.ts +1 -0
  240. package/dist/node/types/services/index.browser.d.ts +1 -0
  241. package/dist/node/types/services/index.d.ts +2 -0
  242. package/dist/{server → node/types}/services/redis/RedisPublisher.d.ts +1 -1
  243. package/dist/{server → node/types}/services/redis/RedisSubscriber.d.ts +2 -2
  244. package/dist/node/types/services/redis/index.d.ts +3 -0
  245. package/dist/{server → node/types}/services/time/TimeService.d.ts +1 -1
  246. package/dist/node/types/services/time/index.d.ts +2 -0
  247. package/dist/node/types/types/index.browser.d.ts +2 -0
  248. package/dist/node/types/types/index.d.ts +2 -0
  249. package/dist/{server → node/types}/utils/CoordinateUtils.d.ts +1 -1
  250. package/dist/{client → node/types}/utils/DateUtils.d.ts +1 -1
  251. package/dist/{client → node/types}/utils/Point3Utils.d.ts +1 -1
  252. package/dist/node/types/utils/global/index.d.ts +11 -0
  253. package/dist/node/types/utils/index.browser.d.ts +17 -0
  254. package/dist/node/types/utils/index.d.ts +2 -0
  255. package/dist/{server → node/types}/utils/nodejs/HookUtils.d.ts +1 -1
  256. package/dist/node/types/utils/nodejs/index.d.ts +2 -0
  257. package/dist/{server → node/types}/utils/nodejs/sequelize-utils/SequelizeUtils.d.ts +1 -1
  258. package/dist/node/types/utils/nodejs/sequelize-utils/index.d.ts +1 -0
  259. package/dist/node/types/utils/try-catch/index.d.ts +1 -0
  260. package/package.json +17 -10
  261. package/dist/client/constants/index.browser.d.ts +0 -6
  262. package/dist/client/constants/index.browser.js +0 -6
  263. package/dist/client/index.browser.d.ts +0 -7
  264. package/dist/client/index.browser.js +0 -7
  265. package/dist/client/interfaces/index.browser.d.ts +0 -4
  266. package/dist/client/interfaces/index.browser.js +0 -4
  267. package/dist/client/managers/index.browser.d.ts +0 -2
  268. package/dist/client/managers/index.browser.js +0 -2
  269. package/dist/client/scripts/index.browser.d.ts +0 -1
  270. package/dist/client/scripts/index.browser.js +0 -1
  271. package/dist/client/services/index.browser.d.ts +0 -1
  272. package/dist/client/services/index.browser.js +0 -1
  273. package/dist/client/services/time/index.d.ts +0 -2
  274. package/dist/client/services/time/index.js +0 -2
  275. package/dist/client/types/index.browser.d.ts +0 -2
  276. package/dist/client/types/index.browser.js +0 -2
  277. package/dist/client/utils/global/index.d.ts +0 -11
  278. package/dist/client/utils/global/index.js +0 -11
  279. package/dist/client/utils/index.browser.d.ts +0 -17
  280. package/dist/client/utils/index.browser.js +0 -17
  281. package/dist/client/utils/try-catch/index.d.ts +0 -1
  282. package/dist/client/utils/try-catch/index.js +0 -1
  283. package/dist/server/constants/index.browser.d.ts +0 -6
  284. package/dist/server/constants/index.d.ts +0 -2
  285. package/dist/server/constants/nodejs/index.d.ts +0 -2
  286. package/dist/server/index.browser.d.ts +0 -7
  287. package/dist/server/index.browser.js +0 -23
  288. package/dist/server/index.d.ts +0 -8
  289. package/dist/server/interfaces/index.browser.d.ts +0 -4
  290. package/dist/server/interfaces/index.d.ts +0 -2
  291. package/dist/server/interfaces/nodejs/db/index.d.ts +0 -1
  292. package/dist/server/interfaces/nodejs/db/sequelize/UpsertOptions.d.ts +0 -4
  293. package/dist/server/interfaces/nodejs/db/sequelize/index.d.ts +0 -6
  294. package/dist/server/interfaces/nodejs/db/sequelize/index.js +0 -22
  295. package/dist/server/interfaces/nodejs/index.d.ts +0 -1
  296. package/dist/server/managers/index.browser.d.ts +0 -2
  297. package/dist/server/managers/index.d.ts +0 -2
  298. package/dist/server/managers/index.js +0 -18
  299. package/dist/server/scripts/index.browser.d.ts +0 -1
  300. package/dist/server/scripts/index.d.ts +0 -1
  301. package/dist/server/services/index.browser.d.ts +0 -1
  302. package/dist/server/services/index.d.ts +0 -2
  303. package/dist/server/services/index.js +0 -18
  304. package/dist/server/services/redis/index.d.ts +0 -3
  305. package/dist/server/services/time/index.d.ts +0 -2
  306. package/dist/server/services/time/index.js +0 -18
  307. package/dist/server/types/index.browser.d.ts +0 -2
  308. package/dist/server/types/index.d.ts +0 -2
  309. package/dist/server/types/index.js +0 -18
  310. package/dist/server/utils/global/index.d.ts +0 -11
  311. package/dist/server/utils/global/index.js +0 -27
  312. package/dist/server/utils/index.browser.d.ts +0 -17
  313. package/dist/server/utils/index.browser.js +0 -33
  314. package/dist/server/utils/index.d.ts +0 -2
  315. package/dist/server/utils/index.js +0 -18
  316. package/dist/server/utils/nodejs/index.d.ts +0 -2
  317. package/dist/server/utils/nodejs/sequelize-utils/index.d.ts +0 -1
  318. package/dist/server/utils/try-catch/index.d.ts +0 -1
  319. /package/dist/{server → browser/cjs}/constants/COORDINATE.js +0 -0
  320. /package/dist/{server → browser/cjs}/constants/CRUD.js +0 -0
  321. /package/dist/{server → browser/cjs}/constants/DATE.js +0 -0
  322. /package/dist/{server → browser/cjs}/constants/DISTANCE.js +0 -0
  323. /package/dist/{server → browser/cjs}/constants/DURATION.js +0 -0
  324. /package/dist/{server → browser/cjs}/constants/NOT_NULL.js +0 -0
  325. /package/dist/{server → browser/cjs}/interfaces/Coordinate.js +0 -0
  326. /package/dist/{server → browser/cjs}/interfaces/Point2.js +0 -0
  327. /package/dist/{server → browser/cjs}/interfaces/Point3.js +0 -0
  328. /package/dist/{server → browser/cjs}/interfaces/StorageProvider.js +0 -0
  329. /package/dist/{server → browser/cjs}/managers/SessionManager.js +0 -0
  330. /package/dist/{server → browser/cjs}/managers/SessionManager.type.js +0 -0
  331. /package/dist/{server → browser/cjs}/scripts/base64Polyfill.js +0 -0
  332. /package/dist/{server → browser/cjs}/services/time/TimeService.js +0 -0
  333. /package/dist/{server → browser/cjs}/services/time/TimeService.type.js +0 -0
  334. /package/dist/{server → browser/cjs}/types/IntRage.js +0 -0
  335. /package/dist/{server → browser/cjs}/types/PartialExcept.js +0 -0
  336. /package/dist/{server → browser/cjs}/utils/AxiosUtils.js +0 -0
  337. /package/dist/{server → browser/cjs}/utils/BooleanUtils.js +0 -0
  338. /package/dist/{server → browser/cjs}/utils/Calc.js +0 -0
  339. /package/dist/{server → browser/cjs}/utils/CoordinateUtils.js +0 -0
  340. /package/dist/{server → browser/cjs}/utils/NumberUtils.js +0 -0
  341. /package/dist/{server → browser/cjs}/utils/Point3Utils.js +0 -0
  342. /package/dist/{server → browser/cjs}/utils/RandomUtils.js +0 -0
  343. /package/dist/{server → browser/cjs}/utils/StringUtils.js +0 -0
  344. /package/dist/{server → browser/cjs}/utils/UuidUtils.js +0 -0
  345. /package/dist/{server → browser/cjs}/utils/Validator.js +0 -0
  346. /package/dist/{server → browser/cjs}/utils/global/between.js +0 -0
  347. /package/dist/{server → browser/cjs}/utils/global/castArray.js +0 -0
  348. /package/dist/{server → browser/cjs}/utils/global/circularDistance.js +0 -0
  349. /package/dist/{server → browser/cjs}/utils/global/fallbackIfEqual.js +0 -0
  350. /package/dist/{server → browser/cjs}/utils/global/firstNonNullish.js +0 -0
  351. /package/dist/{server → browser/cjs}/utils/global/flat.js +0 -0
  352. /package/dist/{server → browser/cjs}/utils/global/pureEnum.js +0 -0
  353. /package/dist/{server → browser/cjs}/utils/global/sleep.js +0 -0
  354. /package/dist/{server → browser/cjs}/utils/try-catch/TryCatch.js +0 -0
  355. /package/dist/{client/constants/COORDINATE.js → browser/esm/constants/COORDINATE.mjs} +0 -0
  356. /package/dist/{client/constants/CRUD.js → browser/esm/constants/CRUD.mjs} +0 -0
  357. /package/dist/{client/constants/DATE.js → browser/esm/constants/DATE.mjs} +0 -0
  358. /package/dist/{client/constants/DISTANCE.js → browser/esm/constants/DISTANCE.mjs} +0 -0
  359. /package/dist/{client/constants/DURATION.js → browser/esm/constants/DURATION.mjs} +0 -0
  360. /package/dist/{client/constants/NOT_NULL.js → browser/esm/constants/NOT_NULL.mjs} +0 -0
  361. /package/dist/{client/interfaces/Coordinate.js → browser/esm/interfaces/Coordinate.mjs} +0 -0
  362. /package/dist/{client/interfaces/Point2.js → browser/esm/interfaces/Point2.mjs} +0 -0
  363. /package/dist/{client/interfaces/Point3.js → browser/esm/interfaces/Point3.mjs} +0 -0
  364. /package/dist/{client/interfaces/StorageProvider.js → browser/esm/interfaces/StorageProvider.mjs} +0 -0
  365. /package/dist/{client/managers/SessionManager.js → browser/esm/managers/SessionManager.mjs} +0 -0
  366. /package/dist/{client/managers/SessionManager.type.js → browser/esm/managers/SessionManager.type.mjs} +0 -0
  367. /package/dist/{client/scripts/base64Polyfill.js → browser/esm/scripts/base64Polyfill.mjs} +0 -0
  368. /package/dist/{client/services/time/TimeService.js → browser/esm/services/time/TimeService.mjs} +0 -0
  369. /package/dist/{client/services/time/TimeService.type.js → browser/esm/services/time/TimeService.type.mjs} +0 -0
  370. /package/dist/{client/types/IntRage.js → browser/esm/types/IntRage.mjs} +0 -0
  371. /package/dist/{client/types/PartialExcept.js → browser/esm/types/PartialExcept.mjs} +0 -0
  372. /package/dist/{client/utils/AxiosUtils.js → browser/esm/utils/AxiosUtils.mjs} +0 -0
  373. /package/dist/{client/utils/BooleanUtils.js → browser/esm/utils/BooleanUtils.mjs} +0 -0
  374. /package/dist/{client/utils/Calc.js → browser/esm/utils/Calc.mjs} +0 -0
  375. /package/dist/{client/utils/CoordinateUtils.js → browser/esm/utils/CoordinateUtils.mjs} +0 -0
  376. /package/dist/{client/utils/NumberUtils.js → browser/esm/utils/NumberUtils.mjs} +0 -0
  377. /package/dist/{client/utils/Point3Utils.js → browser/esm/utils/Point3Utils.mjs} +0 -0
  378. /package/dist/{client/utils/RandomUtils.js → browser/esm/utils/RandomUtils.mjs} +0 -0
  379. /package/dist/{client/utils/StringUtils.js → browser/esm/utils/StringUtils.mjs} +0 -0
  380. /package/dist/{client/utils/UuidUtils.js → browser/esm/utils/UuidUtils.mjs} +0 -0
  381. /package/dist/{client/utils/Validator.js → browser/esm/utils/Validator.mjs} +0 -0
  382. /package/dist/{client/utils/global/between.js → browser/esm/utils/global/between.mjs} +0 -0
  383. /package/dist/{client/utils/global/castArray.js → browser/esm/utils/global/castArray.mjs} +0 -0
  384. /package/dist/{client/utils/global/circularDistance.js → browser/esm/utils/global/circularDistance.mjs} +0 -0
  385. /package/dist/{client/utils/global/fallbackIfEqual.js → browser/esm/utils/global/fallbackIfEqual.mjs} +0 -0
  386. /package/dist/{client/utils/global/firstNonNullish.js → browser/esm/utils/global/firstNonNullish.mjs} +0 -0
  387. /package/dist/{client/utils/global/flat.js → browser/esm/utils/global/flat.mjs} +0 -0
  388. /package/dist/{client/utils/global/pureEnum.js → browser/esm/utils/global/pureEnum.mjs} +0 -0
  389. /package/dist/{client/utils/global/sleep.js → browser/esm/utils/global/sleep.mjs} +0 -0
  390. /package/dist/{client/utils/try-catch/TryCatch.js → browser/esm/utils/try-catch/TryCatch.mjs} +0 -0
  391. /package/dist/{client → browser/types}/constants/COORDINATE.d.ts +0 -0
  392. /package/dist/{client → browser/types}/constants/CRUD.d.ts +0 -0
  393. /package/dist/{client → browser/types}/constants/DATE.d.ts +0 -0
  394. /package/dist/{client → browser/types}/constants/DISTANCE.d.ts +0 -0
  395. /package/dist/{client → browser/types}/constants/DURATION.d.ts +0 -0
  396. /package/dist/{client → browser/types}/constants/NOT_NULL.d.ts +0 -0
  397. /package/dist/{client → browser/types}/interfaces/Coordinate.d.ts +0 -0
  398. /package/dist/{client → browser/types}/interfaces/Point2.d.ts +0 -0
  399. /package/dist/{client → browser/types}/interfaces/StorageProvider.d.ts +0 -0
  400. /package/dist/{client → browser/types}/scripts/base64Polyfill.d.ts +0 -0
  401. /package/dist/{client → browser/types}/services/time/TimeService.type.d.ts +0 -0
  402. /package/dist/{client → browser/types}/types/IntRage.d.ts +0 -0
  403. /package/dist/{client → browser/types}/types/PartialExcept.d.ts +0 -0
  404. /package/dist/{client → browser/types}/utils/ArrayUtils.d.ts +0 -0
  405. /package/dist/{client → browser/types}/utils/AxiosUtils.d.ts +0 -0
  406. /package/dist/{client → browser/types}/utils/BooleanUtils.d.ts +0 -0
  407. /package/dist/{client → browser/types}/utils/Calc.d.ts +0 -0
  408. /package/dist/{client → browser/types}/utils/JuminNumberUtils.d.ts +0 -0
  409. /package/dist/{client → browser/types}/utils/NumberUtils.d.ts +0 -0
  410. /package/dist/{client → browser/types}/utils/ObjectIdUtils.d.ts +0 -0
  411. /package/dist/{client → browser/types}/utils/RandomUtils.d.ts +0 -0
  412. /package/dist/{client → browser/types}/utils/Sequencer.d.ts +0 -0
  413. /package/dist/{client → browser/types}/utils/StringUtils.d.ts +0 -0
  414. /package/dist/{client → browser/types}/utils/UuidUtils.d.ts +0 -0
  415. /package/dist/{client → browser/types}/utils/Validator.d.ts +0 -0
  416. /package/dist/{client → browser/types}/utils/global/between.d.ts +0 -0
  417. /package/dist/{client → browser/types}/utils/global/castArray.d.ts +0 -0
  418. /package/dist/{client → browser/types}/utils/global/circularDistance.d.ts +0 -0
  419. /package/dist/{client → browser/types}/utils/global/fallbackIfEqual.d.ts +0 -0
  420. /package/dist/{client → browser/types}/utils/global/fallbackIfNull.d.ts +0 -0
  421. /package/dist/{client → browser/types}/utils/global/fallbackIfUndefined.d.ts +0 -0
  422. /package/dist/{client → browser/types}/utils/global/firstNonNullish.d.ts +0 -0
  423. /package/dist/{client → browser/types}/utils/global/flat.d.ts +0 -0
  424. /package/dist/{client → browser/types}/utils/global/processFirstNonNullish.d.ts +0 -0
  425. /package/dist/{client → browser/types}/utils/global/pureEnum.d.ts +0 -0
  426. /package/dist/{client → browser/types}/utils/global/sleep.d.ts +0 -0
  427. /package/dist/{client → browser/types}/utils/try-catch/TryCatch.d.ts +0 -0
  428. /package/dist/{server → node/cjs}/constants/nodejs/TransactionManagerLogLevel.js +0 -0
  429. /package/dist/{server → node/cjs}/constants/nodejs/TransactionManagerTimeoutAction.js +0 -0
  430. /package/dist/{server/interfaces/nodejs/db/sequelize/Hook.js → node/cjs/interfaces/Coordinate.js} +0 -0
  431. /package/dist/{server/interfaces/nodejs/db/sequelize/HookFn.js → node/cjs/interfaces/Point2.js} +0 -0
  432. /package/dist/{server/interfaces/nodejs/db/sequelize/HookType.js → node/cjs/interfaces/Point3.js} +0 -0
  433. /package/dist/{server/interfaces/nodejs/db/sequelize/ReloadOption.js → node/cjs/interfaces/StorageProvider.js} +0 -0
  434. /package/dist/{server/interfaces/nodejs/db/sequelize/TransactionOption.js → node/cjs/interfaces/nodejs/db/sequelize/Hook.js} +0 -0
  435. /package/dist/{server/interfaces/nodejs/db/sequelize/UpsertOptions.js → node/cjs/interfaces/nodejs/db/sequelize/HookFn.js} +0 -0
  436. /package/dist/{server/managers/TransactionManager.types.js → node/cjs/interfaces/nodejs/db/sequelize/HookType.js} +0 -0
  437. /package/dist/{server/types/UpsertResult.js → node/cjs/interfaces/nodejs/db/sequelize/ReloadOption.js} +0 -0
  438. /package/dist/{server/utils/nodejs/sequelize-utils/types.js → node/cjs/interfaces/nodejs/db/sequelize/TransactionOption.js} +0 -0
  439. /package/dist/{server → node/cjs}/services/redis/RedisClient.js +0 -0
  440. /package/dist/{server → node/cjs}/utils/nodejs/HookUtils.js +0 -0
  441. /package/dist/{server → node/types}/constants/COORDINATE.d.ts +0 -0
  442. /package/dist/{server → node/types}/constants/CRUD.d.ts +0 -0
  443. /package/dist/{server → node/types}/constants/DATE.d.ts +0 -0
  444. /package/dist/{server → node/types}/constants/DISTANCE.d.ts +0 -0
  445. /package/dist/{server → node/types}/constants/DURATION.d.ts +0 -0
  446. /package/dist/{server → node/types}/constants/NOT_NULL.d.ts +0 -0
  447. /package/dist/{server → node/types}/constants/nodejs/TransactionManagerLogLevel.d.ts +0 -0
  448. /package/dist/{server → node/types}/constants/nodejs/TransactionManagerTimeoutAction.d.ts +0 -0
  449. /package/dist/{server → node/types}/interfaces/Coordinate.d.ts +0 -0
  450. /package/dist/{server → node/types}/interfaces/Point2.d.ts +0 -0
  451. /package/dist/{server → node/types}/interfaces/StorageProvider.d.ts +0 -0
  452. /package/dist/{server → node/types}/interfaces/nodejs/db/sequelize/HookType.d.ts +0 -0
  453. /package/dist/{server → node/types}/interfaces/nodejs/db/sequelize/ReloadOption.d.ts +0 -0
  454. /package/dist/{server → node/types}/interfaces/nodejs/db/sequelize/TransactionOption.d.ts +0 -0
  455. /package/dist/{server → node/types}/scripts/base64Polyfill.d.ts +0 -0
  456. /package/dist/{server → node/types}/services/redis/RedisClient.d.ts +0 -0
  457. /package/dist/{server → node/types}/services/time/TimeService.type.d.ts +0 -0
  458. /package/dist/{server → node/types}/types/IntRage.d.ts +0 -0
  459. /package/dist/{server → node/types}/types/PartialExcept.d.ts +0 -0
  460. /package/dist/{server → node/types}/types/UpsertResult.d.ts +0 -0
  461. /package/dist/{server → node/types}/utils/ArrayUtils.d.ts +0 -0
  462. /package/dist/{server → node/types}/utils/AxiosUtils.d.ts +0 -0
  463. /package/dist/{server → node/types}/utils/BooleanUtils.d.ts +0 -0
  464. /package/dist/{server → node/types}/utils/Calc.d.ts +0 -0
  465. /package/dist/{server → node/types}/utils/JuminNumberUtils.d.ts +0 -0
  466. /package/dist/{server → node/types}/utils/NumberUtils.d.ts +0 -0
  467. /package/dist/{server → node/types}/utils/ObjectIdUtils.d.ts +0 -0
  468. /package/dist/{server → node/types}/utils/RandomUtils.d.ts +0 -0
  469. /package/dist/{server → node/types}/utils/Sequencer.d.ts +0 -0
  470. /package/dist/{server → node/types}/utils/StringUtils.d.ts +0 -0
  471. /package/dist/{server → node/types}/utils/UuidUtils.d.ts +0 -0
  472. /package/dist/{server → node/types}/utils/Validator.d.ts +0 -0
  473. /package/dist/{server → node/types}/utils/global/between.d.ts +0 -0
  474. /package/dist/{server → node/types}/utils/global/castArray.d.ts +0 -0
  475. /package/dist/{server → node/types}/utils/global/circularDistance.d.ts +0 -0
  476. /package/dist/{server → node/types}/utils/global/fallbackIfEqual.d.ts +0 -0
  477. /package/dist/{server → node/types}/utils/global/fallbackIfNull.d.ts +0 -0
  478. /package/dist/{server → node/types}/utils/global/fallbackIfUndefined.d.ts +0 -0
  479. /package/dist/{server → node/types}/utils/global/firstNonNullish.d.ts +0 -0
  480. /package/dist/{server → node/types}/utils/global/flat.d.ts +0 -0
  481. /package/dist/{server → node/types}/utils/global/processFirstNonNullish.d.ts +0 -0
  482. /package/dist/{server → node/types}/utils/global/pureEnum.d.ts +0 -0
  483. /package/dist/{server → node/types}/utils/global/sleep.d.ts +0 -0
  484. /package/dist/{server → node/types}/utils/nodejs/sequelize-utils/types.d.ts +0 -0
  485. /package/dist/{server → node/types}/utils/try-catch/TryCatch.d.ts +0 -0
@@ -0,0 +1,114 @@
1
+ export class Validator {
2
+ static validate(value, options) {
3
+ value = value || '';
4
+ const validations = [];
5
+ const errors = [];
6
+ const { length } = value;
7
+ const spaceCount = (value.match(/\s/g) || []).length;
8
+ const numberCount = (value.match(/\d/g) || []).length;
9
+ const alphabetCount = (value.match(/[A-Za-z]/g) || []).length;
10
+ const alphabetLowerCaseCount = (value.match(/[a-z]/g) || []).length;
11
+ const alphabetUpperCaseCount = (value.match(/[A-Z]/g) || []).length;
12
+ const specialCount = (value.match(/[~`!@#$%^&*()\-+={[}\]|\\:;"'<,>.?/]/g) || []).length;
13
+ const startsWithNumber = /^\d/.test(value);
14
+ const startsWithAlphabet = /^[A-Za-z]/.test(value);
15
+ const startsWithSpecialCharacter = /^[~`!@#$%^&*()\-+={[}\]|\\:;"'<,>.?/]/.test(value);
16
+ // 최소 길이
17
+ if (options.minLength !== undefined && options.minLength > -1) {
18
+ validations.push(Validator.VALIDATION.MIN_LENGTH);
19
+ if (length < options.minLength) {
20
+ errors.push(Validator.VALIDATION.MIN_LENGTH);
21
+ }
22
+ }
23
+ // 최대 길이
24
+ if (options.maxLength !== undefined && options.maxLength > -1) {
25
+ validations.push(Validator.VALIDATION.MAX_LENGTH);
26
+ if (length > options.maxLength) {
27
+ errors.push(Validator.VALIDATION.MAX_LENGTH);
28
+ }
29
+ }
30
+ const validateMin = (option, value, validation) => {
31
+ if (option !== undefined && option > -1) {
32
+ validations.push(validation);
33
+ if (value < option) {
34
+ errors.push(validation);
35
+ }
36
+ }
37
+ };
38
+ const validateMax = (option, value, validation) => {
39
+ if (option !== undefined && option > -1) {
40
+ validations.push(validation);
41
+ if (value > option) {
42
+ errors.push(validation);
43
+ }
44
+ }
45
+ };
46
+ // 공백 개수
47
+ validateMin(options.spaceMinCount, spaceCount, Validator.VALIDATION.SPACE_MIN_COUNT);
48
+ validateMax(options.spaceMaxCount, spaceCount, Validator.VALIDATION.SPACE_MAX_COUNT);
49
+ // 숫자 개수
50
+ validateMin(options.numberMinCount, numberCount, Validator.VALIDATION.NUMBER_MIN_COUNT);
51
+ validateMax(options.numberMaxCount, numberCount, Validator.VALIDATION.NUMBER_MAX_COUNT);
52
+ // 알파벳 개수
53
+ validateMin(options.alphabetMinCount, alphabetCount, Validator.VALIDATION.ALPHABET_MIN_COUNT);
54
+ validateMax(options.alphabetMaxCount, alphabetCount, Validator.VALIDATION.ALPHABET_MAX_COUNT);
55
+ // 알파벳(소문자) 개수
56
+ validateMin(options.alphabetLowerCaseMinCount, alphabetLowerCaseCount, Validator.VALIDATION.ALPHABET_LOWER_CASE_MIN_COUNT);
57
+ validateMax(options.alphabetLowerCaseMaxCount, alphabetLowerCaseCount, Validator.VALIDATION.ALPHABET_LOWER_CASE_MAX_COUNT);
58
+ // 알파벳(대문자) 개수
59
+ validateMin(options.alphabetUpperCaseMinCount, alphabetUpperCaseCount, Validator.VALIDATION.ALPHABET_UPPER_CASE_MIN_COUNT);
60
+ validateMax(options.alphabetUpperCaseMaxCount, alphabetUpperCaseCount, Validator.VALIDATION.ALPHABET_UPPER_CASE_MAX_COUNT);
61
+ // 특수문자 개수
62
+ validateMin(options.specialCharacterMinCount, specialCount, Validator.VALIDATION.SPECIAL_CHARACTER_MIN_COUNT);
63
+ validateMax(options.specialCharacterMaxCount, specialCount, Validator.VALIDATION.SPECIAL_CHARACTER_MAX_COUNT);
64
+ // 숫자로 시작
65
+ if (options.startsWithNumber) {
66
+ validations.push(Validator.VALIDATION.STARTS_WITH_NUMBER);
67
+ if (!startsWithNumber) {
68
+ errors.push(Validator.VALIDATION.STARTS_WITH_NUMBER);
69
+ }
70
+ }
71
+ // 영문으로 시작
72
+ if (options.startsWithAlphabet) {
73
+ validations.push(Validator.VALIDATION.STARTS_WITH_ALPHABET);
74
+ if (!startsWithAlphabet) {
75
+ errors.push(Validator.VALIDATION.STARTS_WITH_ALPHABET);
76
+ }
77
+ }
78
+ // 특수문자로 시작
79
+ if (options.startsWithSpecialCharacter) {
80
+ validations.push(Validator.VALIDATION.STARTS_WITH_SPECIAL_CHARACTER);
81
+ if (!startsWithSpecialCharacter) {
82
+ errors.push(Validator.VALIDATION.STARTS_WITH_SPECIAL_CHARACTER);
83
+ }
84
+ }
85
+ return {
86
+ result: errors.length === 0,
87
+ validations,
88
+ passes: validations.filter(e => !errors.includes(e)),
89
+ errors,
90
+ };
91
+ }
92
+ }
93
+ (function (Validator) {
94
+ let VALIDATION;
95
+ (function (VALIDATION) {
96
+ VALIDATION["MIN_LENGTH"] = "MIN_LENGTH";
97
+ VALIDATION["MAX_LENGTH"] = "MAX_LENGTH";
98
+ VALIDATION["SPACE_MIN_COUNT"] = "SPACE_MIN_COUNT";
99
+ VALIDATION["SPACE_MAX_COUNT"] = "SPACE_MAX_COUNT";
100
+ VALIDATION["NUMBER_MIN_COUNT"] = "NUMBER_MIN_COUNT";
101
+ VALIDATION["NUMBER_MAX_COUNT"] = "NUMBER_MAX_COUNT";
102
+ VALIDATION["ALPHABET_MIN_COUNT"] = "ALPHABET_MIN_COUNT";
103
+ VALIDATION["ALPHABET_MAX_COUNT"] = "ALPHABET_MAX_COUNT";
104
+ VALIDATION["ALPHABET_LOWER_CASE_MIN_COUNT"] = "ALPHABET_LOWER_CASE_MIN_COUNT";
105
+ VALIDATION["ALPHABET_LOWER_CASE_MAX_COUNT"] = "ALPHABET_LOWER_CASE_MAX_COUNT";
106
+ VALIDATION["ALPHABET_UPPER_CASE_MIN_COUNT"] = "ALPHABET_UPPER_CASE_MIN_COUNT";
107
+ VALIDATION["ALPHABET_UPPER_CASE_MAX_COUNT"] = "ALPHABET_UPPER_CASE_MAX_COUNT";
108
+ VALIDATION["SPECIAL_CHARACTER_MIN_COUNT"] = "SPECIAL_CHARACTER_MIN_COUNT";
109
+ VALIDATION["SPECIAL_CHARACTER_MAX_COUNT"] = "SPECIAL_CHARACTER_MAX_COUNT";
110
+ VALIDATION["STARTS_WITH_ALPHABET"] = "STARTS_WITH_ALPHABET";
111
+ VALIDATION["STARTS_WITH_NUMBER"] = "STARTS_WITH_NUMBER";
112
+ VALIDATION["STARTS_WITH_SPECIAL_CHARACTER"] = "STARTS_WITH_SPECIAL_CHARACTER";
113
+ })(VALIDATION = Validator.VALIDATION || (Validator.VALIDATION = {}));
114
+ })(Validator || (Validator = {}));
@@ -0,0 +1,3 @@
1
+ export const between = (value, from, to) => {
2
+ return value >= from && value <= to;
3
+ };
@@ -0,0 +1,3 @@
1
+ export function castArray(value) {
2
+ return Array.isArray(value) ? value : [value];
3
+ }
@@ -0,0 +1,11 @@
1
+ export function circularDistance(value, target, min, max) {
2
+ const range = max - min;
3
+ const from = value - min;
4
+ const to = target - min;
5
+ if (to >= from) {
6
+ return to - from;
7
+ }
8
+ else {
9
+ return range - from + to;
10
+ }
11
+ }
@@ -0,0 +1,6 @@
1
+ export function fallbackIfEqual(value, condition, fallback) {
2
+ if (typeof value === typeof condition && value === condition) {
3
+ return fallback;
4
+ }
5
+ return value;
6
+ }
@@ -0,0 +1,4 @@
1
+ import { fallbackIfEqual } from "./fallbackIfEqual.mjs";
2
+ export function fallbackIfNull(value, fallback) {
3
+ return fallbackIfEqual(value, null, fallback);
4
+ }
@@ -0,0 +1,4 @@
1
+ import { fallbackIfEqual } from "./fallbackIfEqual.mjs";
2
+ export function fallbackIfUndefined(value, fallback) {
3
+ return fallbackIfEqual(value, undefined, fallback);
4
+ }
@@ -0,0 +1,10 @@
1
+ export function firstNonNullish(...args) {
2
+ if (args == null || !Array.isArray(args) || args.length === 0) {
3
+ return undefined;
4
+ }
5
+ if (args[0] != null) {
6
+ // Not Nullish
7
+ return args[0];
8
+ }
9
+ return firstNonNullish(...args.slice(1));
10
+ }
@@ -0,0 +1,113 @@
1
+ // flat.ts
2
+ function isBuffer(obj) {
3
+ return !!(obj &&
4
+ obj.constructor &&
5
+ typeof obj.constructor.isBuffer === 'function' &&
6
+ obj.constructor.isBuffer(obj));
7
+ }
8
+ function keyIdentity(key) {
9
+ return key;
10
+ }
11
+ export function flatten(target, opts = {}) {
12
+ const delimiter = opts.delimiter || '.';
13
+ const maxDepth = opts.maxDepth;
14
+ const transformKey = opts.transformKey || keyIdentity;
15
+ const output = {};
16
+ function step(object, prev, currentDepth = 1) {
17
+ Object.keys(object).forEach((key) => {
18
+ const value = object[key];
19
+ const isarray = opts.safe && Array.isArray(value);
20
+ const type = Object.prototype.toString.call(value);
21
+ const isbuffer = isBuffer(value);
22
+ const isobject = type === '[object Object]' || type === '[object Array]';
23
+ const newKey = prev
24
+ ? `${prev}${delimiter}${transformKey(key)}`
25
+ : transformKey(key);
26
+ if (!isarray &&
27
+ !isbuffer &&
28
+ isobject &&
29
+ Object.keys(value).length &&
30
+ (!maxDepth || currentDepth < maxDepth)) {
31
+ return step(value, newKey, currentDepth + 1);
32
+ }
33
+ output[newKey] = value;
34
+ });
35
+ }
36
+ step(target);
37
+ return output;
38
+ }
39
+ export function unflatten(target, opts = {}) {
40
+ const delimiter = opts.delimiter || '.';
41
+ const overwrite = opts.overwrite || false;
42
+ const transformKey = opts.transformKey || keyIdentity;
43
+ const result = {};
44
+ if (isBuffer(target) ||
45
+ Object.prototype.toString.call(target) !== '[object Object]') {
46
+ return target;
47
+ }
48
+ function getkey(key) {
49
+ const parsedKey = Number(key);
50
+ return isNaN(parsedKey) || key.indexOf('.') !== -1 || opts.object
51
+ ? key
52
+ : parsedKey;
53
+ }
54
+ function addKeys(keyPrefix, recipient, target) {
55
+ return Object.keys(target).reduce((res, key) => {
56
+ res[`${keyPrefix}${delimiter}${key}`] = target[key];
57
+ return res;
58
+ }, recipient);
59
+ }
60
+ function isEmpty(val) {
61
+ const type = Object.prototype.toString.call(val);
62
+ const isArray = type === '[object Array]';
63
+ const isObject = type === '[object Object]';
64
+ if (!val) {
65
+ return true;
66
+ }
67
+ else if (isArray) {
68
+ return !val.length;
69
+ }
70
+ else if (isObject) {
71
+ return !Object.keys(val).length;
72
+ }
73
+ return false;
74
+ }
75
+ const target2 = Object.keys(target).reduce((res, key) => {
76
+ const value = target[key];
77
+ const type = Object.prototype.toString.call(value);
78
+ const isObject = type === '[object Object]' || type === '[object Array]';
79
+ if (!isObject || isEmpty(value)) {
80
+ res[key] = value;
81
+ return res;
82
+ }
83
+ else {
84
+ return addKeys(key, res, flatten(value, opts));
85
+ }
86
+ }, {});
87
+ Object.keys(target2).forEach((key) => {
88
+ const split = key.split(delimiter).map(transformKey);
89
+ let key1 = getkey(split.shift());
90
+ let key2 = getkey(split[0]);
91
+ let recipient = result;
92
+ while (key2 !== undefined) {
93
+ if (key1 === '__proto__')
94
+ return;
95
+ const type = Object.prototype.toString.call(recipient[key1]);
96
+ const isobject = type === '[object Object]' || type === '[object Array]';
97
+ if (!overwrite && !isobject && typeof recipient[key1] !== 'undefined') {
98
+ return;
99
+ }
100
+ if ((overwrite && !isobject) || (!overwrite && recipient[key1] == null)) {
101
+ recipient[key1] =
102
+ typeof key2 === 'number' && !opts.object ? [] : {};
103
+ }
104
+ recipient = recipient[key1];
105
+ if (split.length > 0) {
106
+ key1 = getkey(split.shift());
107
+ key2 = getkey(split[0]);
108
+ }
109
+ }
110
+ recipient[key1] = unflatten(target2[key], opts);
111
+ });
112
+ return result;
113
+ }
@@ -0,0 +1,11 @@
1
+ export * from './between.mjs';
2
+ export * from './castArray.mjs';
3
+ export * from './circularDistance.mjs';
4
+ export * from './sleep.mjs';
5
+ export * from './fallbackIfEqual.mjs';
6
+ export * from './fallbackIfNull.mjs';
7
+ export * from './fallbackIfUndefined.mjs';
8
+ export * from './firstNonNullish.mjs';
9
+ export * from './flat.mjs';
10
+ export * from './processFirstNonNullish.mjs';
11
+ export * from './pureEnum.mjs';
@@ -0,0 +1,8 @@
1
+ import { firstNonNullish } from "./firstNonNullish.mjs";
2
+ export function processFirstNonNullish(processor, ...args) {
3
+ const fallback = firstNonNullish(...args);
4
+ if (fallback == null) {
5
+ return undefined;
6
+ }
7
+ return processor(fallback);
8
+ }
@@ -0,0 +1,9 @@
1
+ export function pureEnum(e) {
2
+ return Object.entries(e).filter(([key, value]) => !/^-?\d+$/g.test(key) && typeof value !== 'function');
3
+ }
4
+ export function pureEnumKeys(e) {
5
+ return pureEnum(e).map(([key]) => key);
6
+ }
7
+ export function pureEnumValues(e) {
8
+ return pureEnum(e).map(([, value]) => value);
9
+ }
@@ -0,0 +1 @@
1
+ export const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
@@ -0,0 +1,17 @@
1
+ export * from './global/index.mjs';
2
+ export * from './ArrayUtils.mjs';
3
+ export * from './AxiosUtils.mjs';
4
+ export * from './StringUtils.mjs';
5
+ export * from './UuidUtils.mjs';
6
+ export * from './BooleanUtils.mjs';
7
+ export * from './Calc.mjs';
8
+ export * from './CoordinateUtils.mjs';
9
+ export * from './DateUtils.mjs';
10
+ export * from './NumberUtils.mjs';
11
+ export * from './ObjectIdUtils.mjs';
12
+ export * from './Point3Utils.mjs';
13
+ export * from './RandomUtils.mjs';
14
+ export * from './Validator.mjs';
15
+ export * from './JuminNumberUtils.mjs';
16
+ export * from './Sequencer.mjs';
17
+ export * from './try-catch/index.mjs';
@@ -0,0 +1,2 @@
1
+ export * from './index.browser.mjs';
2
+ export * from './nodejs/index.mjs';
@@ -0,0 +1,26 @@
1
+ export class HookUtils {
2
+ static getFkChanges(pFkValue, cFkValue) {
3
+ const results = { pFkValue: null, cFkValue: null };
4
+ if (pFkValue !== undefined && cFkValue !== undefined) {
5
+ if (pFkValue !== cFkValue) {
6
+ if (pFkValue !== null) {
7
+ results.pFkValue = pFkValue;
8
+ }
9
+ }
10
+ }
11
+ if (cFkValue !== null && cFkValue !== undefined) {
12
+ results.cFkValue = cFkValue;
13
+ }
14
+ return results;
15
+ }
16
+ static makeModelHooks(model, fns) {
17
+ return [
18
+ { model, hookType: 'afterCreate', fn: fns.create },
19
+ { model, hookType: 'afterBulkCreate', fn: fns.create },
20
+ { model, hookType: 'afterUpdate', fn: fns.update },
21
+ { model, hookType: 'afterBulkUpdate', fn: fns.update },
22
+ { model, hookType: 'afterDestroy', fn: fns.destroy },
23
+ { model, hookType: 'afterBulkDestroy', fn: fns.destroy },
24
+ ];
25
+ }
26
+ }
@@ -0,0 +1,2 @@
1
+ export * from './HookUtils.mjs';
2
+ export { SequelizeUtils } from './sequelize-utils/index.mjs';
@@ -0,0 +1,71 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { Op } from "sequelize";
13
+ import { UuidUtils } from "../../UuidUtils.mjs";
14
+ import { NOT_NULL } from "../../../constants/index.mjs";
15
+ export class SequelizeUtils {
16
+ static decimal2Number(value) {
17
+ if (value === null || value === undefined) {
18
+ return value;
19
+ }
20
+ const parsed = Number(value);
21
+ if (isNaN(parsed)) {
22
+ throw new Error(`value(typeof=${typeof value}, value=${value}) iNaN(is not number)`);
23
+ }
24
+ return parsed;
25
+ }
26
+ static buildUuidColumn(options) {
27
+ const { columnName } = options, overrideOptions = __rest(options, ["columnName"]);
28
+ if (overrideOptions.allowNull) {
29
+ return Object.assign({ type: "binary(16)", get() {
30
+ const value = this.getDataValue(columnName);
31
+ if (value === null) {
32
+ return value;
33
+ }
34
+ return UuidUtils.toString(this.getDataValue(columnName));
35
+ },
36
+ set(uuid) {
37
+ this.setDataValue(columnName, uuid === null ? null : UuidUtils.toBuffer(uuid));
38
+ } }, overrideOptions);
39
+ }
40
+ else {
41
+ return Object.assign({ type: "binary(16)", get() {
42
+ return UuidUtils.toString(this.getDataValue(columnName));
43
+ },
44
+ set(uuid) {
45
+ this.setDataValue(columnName, UuidUtils.toBuffer(uuid));
46
+ } }, overrideOptions);
47
+ }
48
+ }
49
+ static getNullableArrayFilter(arr) {
50
+ return {
51
+ [Op.or]: arr.map(value => {
52
+ if (value === null) {
53
+ return { [Op.is]: value };
54
+ }
55
+ else if (value === NOT_NULL) {
56
+ return { [Op.not]: null };
57
+ }
58
+ else {
59
+ return { [Op.eq]: value };
60
+ }
61
+ })
62
+ };
63
+ }
64
+ }
65
+ SequelizeUtils.buildPrimaryUuidColumn = () => (Object.assign({}, SequelizeUtils.buildUuidColumn({
66
+ columnName: "uuid",
67
+ allowNull: false,
68
+ primaryKey: true,
69
+ unique: true,
70
+ defaultValue: () => UuidUtils.toBuffer(UuidUtils.v4()),
71
+ })));
@@ -0,0 +1 @@
1
+ export { SequelizeUtils } from './SequelizeUtils.mjs';
@@ -0,0 +1,74 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ /**
11
+ * Provides a utility class for handling synchronous and asynchronous operations with a consistent try-catch pattern.
12
+ * It returns a tuple where the first element is the error (or null on success) and the second element is the result (or undefined on error).
13
+ */
14
+ export class TryCatch {
15
+ /**
16
+ * Executes a synchronous function within a try-catch block.
17
+ * @template T The return type of the function.
18
+ * @template E The type of the error that might be thrown (defaults to Error).
19
+ * @param fn The synchronous function to execute.
20
+ *@param disableLogging console.error is default way of logging on error. You can disable it by setting it true
21
+ * @returns A tuple containing the result of the function and an error (null if successful).
22
+ */
23
+ static function(fn, disableLogging) {
24
+ try {
25
+ return [
26
+ null,
27
+ fn(),
28
+ ];
29
+ }
30
+ catch (e) {
31
+ if (!disableLogging) {
32
+ console.error("ERROR in TryCatch: ", e);
33
+ }
34
+ if (e == null) {
35
+ e = new Error("Unknown error");
36
+ }
37
+ return [
38
+ e,
39
+ undefined,
40
+ ];
41
+ }
42
+ }
43
+ /**
44
+ * Executes an asynchronous function (Promise) within a try-catch block.
45
+ * @template T The resolved value type of the Promise.
46
+ * @template E The type of the error that might be rejected (defaults to Error).
47
+ * @param fn The Promise to await.
48
+ * @param disableLogging console.error is default way of logging on error. You can disable it by setting it true
49
+ * @returns A tuple containing the resolved value of the Promise and an error (null if successful).
50
+ */
51
+ static asyncFunction(fn, disableLogging) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ try {
54
+ const data = yield fn;
55
+ return [
56
+ null,
57
+ data,
58
+ ];
59
+ }
60
+ catch (e) {
61
+ if (!disableLogging) {
62
+ console.error("ERROR in TryCatch: ", e);
63
+ }
64
+ if (e == null) {
65
+ e = new Error("Unknown error");
66
+ }
67
+ return [
68
+ e,
69
+ undefined,
70
+ ];
71
+ }
72
+ });
73
+ }
74
+ }
@@ -0,0 +1 @@
1
+ export * from "./TryCatch.mjs";
@@ -0,0 +1,6 @@
1
+ export * from './COORDINATE';
2
+ export * from './CRUD';
3
+ export * from './DATE';
4
+ export * from './DISTANCE';
5
+ export * from './DURATION';
6
+ export * from './NOT_NULL';
@@ -0,0 +1,2 @@
1
+ export * from './index.browser';
2
+ export * from './nodejs';
@@ -0,0 +1,2 @@
1
+ export * from './TransactionManagerLogLevel';
2
+ export * from './TransactionManagerTimeoutAction';
@@ -0,0 +1,7 @@
1
+ export * from './constants/index.browser';
2
+ export * from './interfaces/index.browser';
3
+ export * from './managers/index.browser';
4
+ export * from './scripts/index.browser';
5
+ export * from './services/index.browser';
6
+ export * from './types/index.browser';
7
+ export * from './utils/index.browser';
@@ -0,0 +1,8 @@
1
+ export * from './index.browser';
2
+ export * from './constants';
3
+ export * from './interfaces';
4
+ export * from './managers';
5
+ export * from './scripts';
6
+ export * from './services';
7
+ export * from './types';
8
+ export * from './utils';
@@ -1,4 +1,4 @@
1
- import { Point2 } from "./Point2.js";
1
+ import { Point2 } from "./Point2";
2
2
  export interface Point3 extends Point2 {
3
3
  z: number;
4
4
  }
@@ -0,0 +1,4 @@
1
+ export * from './Coordinate';
2
+ export * from './Point2';
3
+ export * from './Point3';
4
+ export * from './StorageProvider';
@@ -0,0 +1,2 @@
1
+ export * from './index.browser';
2
+ export * from './nodejs';
@@ -0,0 +1 @@
1
+ export * from './sequelize';
@@ -1,6 +1,6 @@
1
1
  import { ModelCtor } from "sequelize-typescript";
2
- import { HookType } from "./HookType.js";
3
- import { HookFn } from "./HookFn.js";
2
+ import { HookType } from "./HookType";
3
+ import { HookFn } from "./HookFn";
4
4
  export interface Hook {
5
5
  model: ModelCtor;
6
6
  hookType: HookType;
@@ -1,4 +1,4 @@
1
1
  import { Hooks, SequelizeHooks } from "sequelize/types/hooks";
2
2
  import { Attributes, CreationAttributes } from "sequelize/types/model";
3
- import { HookType } from "./HookType.js";
3
+ import { HookType } from "./HookType";
4
4
  export type HookFn = SequelizeHooks<Hooks['_model'], Attributes<Hooks>, CreationAttributes<Hooks>>[HookType];
@@ -0,0 +1,4 @@
1
+ import { ReloadOption } from "./ReloadOption";
2
+ import { TransactionOption } from "./TransactionOption";
3
+ export interface UpsertOptions extends ReloadOption, TransactionOption {
4
+ }
@@ -0,0 +1,6 @@
1
+ export * from './Hook';
2
+ export * from './HookFn';
3
+ export * from './HookType';
4
+ export * from './ReloadOption';
5
+ export * from './TransactionOption';
6
+ export * from './UpsertOptions';
@@ -0,0 +1 @@
1
+ export * from './db';
@@ -1,7 +1,7 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { StorageProvider } from "../interfaces/StorageProvider.js";
2
+ import { StorageProvider } from "../interfaces/StorageProvider";
3
3
  import EventEmitter from 'eventemitter3';
4
- import { SessionManagerEvent, SessionManagerOptions } from "./SessionManager.type.js";
4
+ import { SessionManagerEvent, SessionManagerOptions } from "./SessionManager.type";
5
5
  export declare class SessionManager extends EventEmitter<SessionManagerEvent> {
6
6
  private static readonly DEFAULT_AUTHORIZATION_STORAGE_KEY;
7
7
  protected api: AxiosInstance;
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { StorageProvider } from "../interfaces/StorageProvider.js";
2
+ import { StorageProvider } from "../interfaces/StorageProvider";
3
3
  export interface SessionManagerOptions {
4
4
  api: AxiosInstance;
5
5
  storageProvider: StorageProvider;
@@ -1,7 +1,7 @@
1
1
  import { Transaction } from "sequelize";
2
2
  import EventEmitter from 'eventemitter3';
3
- import { TransactionManagerLogLevel, TransactionManagerTimeoutAction } from "../constants/index.js";
4
- import { TransactionManagerAddOption, TransactionManagerEventTypes } from "./TransactionManager.types.js";
3
+ import { TransactionManagerLogLevel, TransactionManagerTimeoutAction } from "../constants";
4
+ import { TransactionManagerAddOption, TransactionManagerEventTypes } from "./TransactionManager.types";
5
5
  export declare class TransactionManager {
6
6
  static DEFAULT_TIMEOUT: number;
7
7
  static DEFAULT_ACTION: TransactionManagerTimeoutAction;