@powfix/core-js 0.14.5 → 0.15.0-beta-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 (322) hide show
  1. package/dist/client/constants/index.browser.d.ts +6 -0
  2. package/dist/{src → client}/constants/index.browser.js +6 -6
  3. package/dist/client/index.browser.d.ts +7 -0
  4. package/dist/{src → client}/index.browser.js +7 -7
  5. package/dist/{src → client}/interfaces/Point3.d.ts +1 -1
  6. package/dist/client/interfaces/index.browser.d.ts +4 -0
  7. package/dist/{src → client}/interfaces/index.browser.js +4 -4
  8. package/dist/{src → client}/managers/SessionManager.d.ts +2 -2
  9. package/dist/{src → client}/managers/SessionManager.type.d.ts +1 -1
  10. package/dist/client/managers/index.browser.d.ts +2 -0
  11. package/dist/{src → client}/managers/index.browser.js +2 -2
  12. package/dist/client/scripts/index.browser.d.ts +1 -0
  13. package/dist/{src → client}/scripts/index.browser.js +1 -1
  14. package/dist/client/services/index.browser.d.ts +1 -0
  15. package/dist/{src → client}/services/index.browser.js +1 -1
  16. package/dist/{src → client}/services/time/TimeService.d.ts +1 -1
  17. package/dist/client/services/time/index.d.ts +2 -0
  18. package/dist/client/services/time/index.js +18 -0
  19. package/dist/client/types/index.browser.d.ts +2 -0
  20. package/dist/{src → client}/types/index.browser.js +2 -2
  21. package/dist/{src → client}/utils/ArrayUtils.js +2 -2
  22. package/dist/{src → client}/utils/CoordinateUtils.d.ts +1 -1
  23. package/dist/{src → client}/utils/DateUtils.d.ts +1 -1
  24. package/dist/{src → client}/utils/DateUtils.js +17 -17
  25. package/dist/{src → client}/utils/JuminNumberUtils.js +2 -2
  26. package/dist/{src → client}/utils/ObjectIdUtils.js +3 -3
  27. package/dist/{src → client}/utils/Point3Utils.d.ts +1 -1
  28. package/dist/{src → client}/utils/Sequencer.js +2 -2
  29. package/dist/{src → client}/utils/UuidUtils.js +5 -2
  30. package/dist/{src → client}/utils/global/fallbackIfNull.js +2 -2
  31. package/dist/{src → client}/utils/global/fallbackIfUndefined.js +2 -2
  32. package/dist/client/utils/global/index.d.ts +11 -0
  33. package/dist/client/utils/global/index.js +27 -0
  34. package/dist/{src → client}/utils/global/processFirstNonNullish.js +2 -2
  35. package/dist/client/utils/index.browser.d.ts +17 -0
  36. package/dist/client/utils/index.browser.js +33 -0
  37. package/dist/client/utils/try-catch/index.d.ts +1 -0
  38. package/dist/{src/interfaces/nodejs/db → client/utils/try-catch}/index.js +1 -1
  39. package/dist/server/constants/COORDINATE.d.ts +7 -0
  40. package/dist/server/constants/COORDINATE.js +10 -0
  41. package/dist/server/constants/CRUD.d.ts +9 -0
  42. package/dist/server/constants/CRUD.js +22 -0
  43. package/dist/server/constants/DATE.d.ts +13 -0
  44. package/dist/server/constants/DATE.js +26 -0
  45. package/dist/server/constants/DISTANCE.d.ts +13 -0
  46. package/dist/server/constants/DISTANCE.js +18 -0
  47. package/dist/server/constants/DURATION.d.ts +16 -0
  48. package/dist/server/constants/DURATION.js +21 -0
  49. package/dist/server/constants/NOT_NULL.d.ts +1 -0
  50. package/dist/server/constants/NOT_NULL.js +4 -0
  51. package/dist/server/constants/index.browser.d.ts +6 -0
  52. package/dist/server/constants/index.browser.js +22 -0
  53. package/dist/server/constants/index.d.ts +2 -0
  54. package/dist/{src/interfaces → server/constants}/index.js +2 -2
  55. package/dist/server/constants/nodejs/index.d.ts +2 -0
  56. package/dist/{src → server}/constants/nodejs/index.js +2 -2
  57. package/dist/server/index.browser.d.ts +7 -0
  58. package/dist/server/index.browser.js +23 -0
  59. package/dist/server/index.d.ts +8 -0
  60. package/dist/{src → server}/index.js +8 -8
  61. package/dist/server/interfaces/Coordinate.d.ts +8 -0
  62. package/dist/server/interfaces/Point2.d.ts +4 -0
  63. package/dist/server/interfaces/Point3.d.ts +4 -0
  64. package/dist/server/interfaces/StorageProvider.d.ts +7 -0
  65. package/dist/server/interfaces/index.browser.d.ts +4 -0
  66. package/dist/server/interfaces/index.browser.js +20 -0
  67. package/dist/server/interfaces/index.d.ts +2 -0
  68. package/dist/server/interfaces/index.js +18 -0
  69. package/dist/server/interfaces/nodejs/db/index.d.ts +1 -0
  70. package/dist/server/interfaces/nodejs/db/index.js +17 -0
  71. package/dist/{src → server}/interfaces/nodejs/db/sequelize/Hook.d.ts +2 -2
  72. package/dist/{src → server}/interfaces/nodejs/db/sequelize/HookFn.d.ts +1 -1
  73. package/dist/server/interfaces/nodejs/db/sequelize/UpsertOptions.d.ts +4 -0
  74. package/dist/server/interfaces/nodejs/db/sequelize/UpsertOptions.js +2 -0
  75. package/dist/server/interfaces/nodejs/db/sequelize/index.d.ts +6 -0
  76. package/dist/server/interfaces/nodejs/db/sequelize/index.js +22 -0
  77. package/dist/server/interfaces/nodejs/index.d.ts +1 -0
  78. package/dist/{src/utils/try-catch → server/interfaces/nodejs}/index.js +1 -1
  79. package/dist/server/managers/SessionManager.d.ts +15 -0
  80. package/dist/server/managers/SessionManager.js +134 -0
  81. package/dist/server/managers/SessionManager.type.d.ts +9 -0
  82. package/dist/server/managers/SessionManager.type.js +2 -0
  83. package/dist/{src → server}/managers/TransactionManager.d.ts +2 -2
  84. package/dist/{src → server}/managers/TransactionManager.js +13 -13
  85. package/dist/{src → server}/managers/TransactionManager.types.d.ts +1 -1
  86. package/dist/server/managers/TransactionManager.types.js +2 -0
  87. package/dist/server/managers/index.browser.d.ts +2 -0
  88. package/dist/server/managers/index.browser.js +18 -0
  89. package/dist/server/managers/index.d.ts +2 -0
  90. package/dist/server/managers/index.js +18 -0
  91. package/dist/server/scripts/base64Polyfill.d.ts +1 -0
  92. package/dist/server/scripts/base64Polyfill.js +14 -0
  93. package/dist/server/scripts/index.browser.d.ts +1 -0
  94. package/dist/{index.browser.js → server/scripts/index.browser.js} +1 -1
  95. package/dist/server/scripts/index.d.ts +1 -0
  96. package/dist/{index.js → server/scripts/index.js} +1 -1
  97. package/dist/server/services/index.browser.d.ts +1 -0
  98. package/dist/{src/scripts/index.js → server/services/index.browser.js} +1 -1
  99. package/dist/server/services/index.d.ts +2 -0
  100. package/dist/{src/constants → server/services}/index.js +2 -2
  101. package/dist/{src → server}/services/redis/RedisPublisher.d.ts +1 -1
  102. package/dist/{src → server}/services/redis/RedisPublisher.js +2 -2
  103. package/dist/{src → server}/services/redis/RedisSubscriber.d.ts +2 -2
  104. package/dist/{src → server}/services/redis/RedisSubscriber.js +5 -5
  105. package/dist/server/services/redis/index.d.ts +3 -0
  106. package/dist/{src → server}/services/redis/index.js +3 -3
  107. package/dist/server/services/time/TimeService.d.ts +31 -0
  108. package/dist/server/services/time/TimeService.js +180 -0
  109. package/dist/server/services/time/TimeService.type.d.ts +21 -0
  110. package/dist/server/services/time/TimeService.type.js +2 -0
  111. package/dist/server/services/time/index.d.ts +2 -0
  112. package/dist/server/services/time/index.js +18 -0
  113. package/dist/server/types/IntRage.d.ts +3 -0
  114. package/dist/server/types/IntRage.js +2 -0
  115. package/dist/server/types/PartialExcept.d.ts +1 -0
  116. package/dist/server/types/PartialExcept.js +2 -0
  117. package/dist/server/types/UpsertResult.js +2 -0
  118. package/dist/server/types/index.browser.d.ts +2 -0
  119. package/dist/server/types/index.browser.js +18 -0
  120. package/dist/server/types/index.d.ts +2 -0
  121. package/dist/server/types/index.js +18 -0
  122. package/dist/server/utils/ArrayUtils.d.ts +12 -0
  123. package/dist/server/utils/ArrayUtils.js +30 -0
  124. package/dist/server/utils/AxiosUtils.d.ts +5 -0
  125. package/dist/server/utils/AxiosUtils.js +53 -0
  126. package/dist/server/utils/BooleanUtils.d.ts +1 -0
  127. package/dist/server/utils/BooleanUtils.js +8 -0
  128. package/dist/server/utils/Calc.d.ts +4 -0
  129. package/dist/server/utils/Calc.js +27 -0
  130. package/dist/server/utils/CoordinateUtils.d.ts +8 -0
  131. package/dist/server/utils/CoordinateUtils.js +42 -0
  132. package/dist/server/utils/DateUtils.d.ts +24 -0
  133. package/dist/server/utils/DateUtils.js +310 -0
  134. package/dist/server/utils/JuminNumberUtils.d.ts +4 -0
  135. package/dist/server/utils/JuminNumberUtils.js +50 -0
  136. package/dist/server/utils/NumberUtils.d.ts +4 -0
  137. package/dist/server/utils/NumberUtils.js +25 -0
  138. package/dist/server/utils/ObjectIdUtils.d.ts +4 -0
  139. package/dist/server/utils/ObjectIdUtils.js +24 -0
  140. package/dist/server/utils/Point3Utils.d.ts +4 -0
  141. package/dist/server/utils/Point3Utils.js +12 -0
  142. package/dist/server/utils/RandomUtils.d.ts +8 -0
  143. package/dist/server/utils/RandomUtils.js +64 -0
  144. package/dist/server/utils/Sequencer.d.ts +38 -0
  145. package/dist/server/utils/Sequencer.js +148 -0
  146. package/dist/server/utils/StringUtils.d.ts +5 -0
  147. package/dist/server/utils/StringUtils.js +37 -0
  148. package/dist/server/utils/UuidUtils.d.ts +14 -0
  149. package/dist/server/utils/UuidUtils.js +49 -0
  150. package/dist/server/utils/Validator.d.ts +48 -0
  151. package/dist/server/utils/Validator.js +118 -0
  152. package/dist/server/utils/global/between.d.ts +1 -0
  153. package/dist/server/utils/global/between.js +7 -0
  154. package/dist/server/utils/global/castArray.d.ts +1 -0
  155. package/dist/server/utils/global/castArray.js +6 -0
  156. package/dist/server/utils/global/circularDistance.d.ts +1 -0
  157. package/dist/server/utils/global/circularDistance.js +14 -0
  158. package/dist/server/utils/global/fallbackIfEqual.d.ts +1 -0
  159. package/dist/server/utils/global/fallbackIfEqual.js +9 -0
  160. package/dist/server/utils/global/fallbackIfNull.d.ts +1 -0
  161. package/dist/server/utils/global/fallbackIfNull.js +7 -0
  162. package/dist/server/utils/global/fallbackIfUndefined.d.ts +1 -0
  163. package/dist/server/utils/global/fallbackIfUndefined.js +7 -0
  164. package/dist/server/utils/global/firstNonNullish.d.ts +1 -0
  165. package/dist/server/utils/global/firstNonNullish.js +13 -0
  166. package/dist/server/utils/global/flat.d.ts +14 -0
  167. package/dist/server/utils/global/flat.js +117 -0
  168. package/dist/server/utils/global/index.d.ts +11 -0
  169. package/dist/server/utils/global/index.js +27 -0
  170. package/dist/server/utils/global/processFirstNonNullish.d.ts +1 -0
  171. package/dist/server/utils/global/processFirstNonNullish.js +11 -0
  172. package/dist/server/utils/global/pureEnum.d.ts +8 -0
  173. package/dist/server/utils/global/pureEnum.js +14 -0
  174. package/dist/server/utils/global/sleep.d.ts +1 -0
  175. package/dist/server/utils/global/sleep.js +5 -0
  176. package/dist/server/utils/index.browser.d.ts +17 -0
  177. package/dist/server/utils/index.browser.js +33 -0
  178. package/dist/server/utils/index.d.ts +2 -0
  179. package/dist/server/utils/index.js +18 -0
  180. package/dist/{src → server}/utils/nodejs/HookUtils.d.ts +1 -1
  181. package/dist/server/utils/nodejs/index.d.ts +2 -0
  182. package/dist/{src → server}/utils/nodejs/index.js +3 -3
  183. package/dist/{src → server}/utils/nodejs/sequelize-utils/SequelizeUtils.d.ts +1 -1
  184. package/dist/{src → server}/utils/nodejs/sequelize-utils/SequelizeUtils.js +8 -8
  185. package/dist/server/utils/nodejs/sequelize-utils/index.d.ts +1 -0
  186. package/dist/{src → server}/utils/nodejs/sequelize-utils/index.js +2 -2
  187. package/dist/server/utils/nodejs/sequelize-utils/types.js +2 -0
  188. package/dist/server/utils/try-catch/TryCatch.d.ts +24 -0
  189. package/dist/server/utils/try-catch/TryCatch.js +78 -0
  190. package/dist/server/utils/try-catch/index.d.ts +1 -0
  191. package/dist/{src/interfaces/nodejs → server/utils/try-catch}/index.js +1 -1
  192. package/package.json +56 -52
  193. package/dist/index.browser.d.ts +0 -1
  194. package/dist/index.d.ts +0 -1
  195. package/dist/src/constants/index.browser.d.ts +0 -6
  196. package/dist/src/constants/index.d.ts +0 -2
  197. package/dist/src/constants/nodejs/index.d.ts +0 -2
  198. package/dist/src/index.browser.d.ts +0 -7
  199. package/dist/src/index.d.ts +0 -8
  200. package/dist/src/interfaces/index.browser.d.ts +0 -4
  201. package/dist/src/interfaces/index.d.ts +0 -2
  202. package/dist/src/interfaces/nodejs/db/index.d.ts +0 -1
  203. package/dist/src/interfaces/nodejs/db/sequelize/UpsertOptions.d.ts +0 -4
  204. package/dist/src/interfaces/nodejs/db/sequelize/index.d.ts +0 -6
  205. package/dist/src/interfaces/nodejs/db/sequelize/index.js +0 -22
  206. package/dist/src/interfaces/nodejs/index.d.ts +0 -1
  207. package/dist/src/managers/index.browser.d.ts +0 -2
  208. package/dist/src/managers/index.d.ts +0 -2
  209. package/dist/src/managers/index.js +0 -18
  210. package/dist/src/scripts/index.browser.d.ts +0 -1
  211. package/dist/src/scripts/index.d.ts +0 -1
  212. package/dist/src/services/index.browser.d.ts +0 -1
  213. package/dist/src/services/index.d.ts +0 -2
  214. package/dist/src/services/index.js +0 -18
  215. package/dist/src/services/redis/index.d.ts +0 -3
  216. package/dist/src/services/time/index.d.ts +0 -2
  217. package/dist/src/services/time/index.js +0 -18
  218. package/dist/src/types/index.browser.d.ts +0 -2
  219. package/dist/src/types/index.d.ts +0 -2
  220. package/dist/src/types/index.js +0 -18
  221. package/dist/src/utils/global/index.d.ts +0 -11
  222. package/dist/src/utils/global/index.js +0 -27
  223. package/dist/src/utils/index.browser.d.ts +0 -17
  224. package/dist/src/utils/index.browser.js +0 -33
  225. package/dist/src/utils/index.d.ts +0 -2
  226. package/dist/src/utils/index.js +0 -18
  227. package/dist/src/utils/nodejs/index.d.ts +0 -2
  228. package/dist/src/utils/nodejs/sequelize-utils/index.d.ts +0 -1
  229. package/dist/src/utils/try-catch/index.d.ts +0 -1
  230. /package/dist/{src → client}/constants/COORDINATE.d.ts +0 -0
  231. /package/dist/{src → client}/constants/COORDINATE.js +0 -0
  232. /package/dist/{src → client}/constants/CRUD.d.ts +0 -0
  233. /package/dist/{src → client}/constants/CRUD.js +0 -0
  234. /package/dist/{src → client}/constants/DATE.d.ts +0 -0
  235. /package/dist/{src → client}/constants/DATE.js +0 -0
  236. /package/dist/{src → client}/constants/DISTANCE.d.ts +0 -0
  237. /package/dist/{src → client}/constants/DISTANCE.js +0 -0
  238. /package/dist/{src → client}/constants/DURATION.d.ts +0 -0
  239. /package/dist/{src → client}/constants/DURATION.js +0 -0
  240. /package/dist/{src → client}/constants/NOT_NULL.d.ts +0 -0
  241. /package/dist/{src → client}/constants/NOT_NULL.js +0 -0
  242. /package/dist/{src → client}/interfaces/Coordinate.d.ts +0 -0
  243. /package/dist/{src → client}/interfaces/Coordinate.js +0 -0
  244. /package/dist/{src → client}/interfaces/Point2.d.ts +0 -0
  245. /package/dist/{src → client}/interfaces/Point2.js +0 -0
  246. /package/dist/{src → client}/interfaces/Point3.js +0 -0
  247. /package/dist/{src → client}/interfaces/StorageProvider.d.ts +0 -0
  248. /package/dist/{src → client}/interfaces/StorageProvider.js +0 -0
  249. /package/dist/{src → client}/managers/SessionManager.js +0 -0
  250. /package/dist/{src → client}/managers/SessionManager.type.js +0 -0
  251. /package/dist/{src → client}/scripts/base64Polyfill.d.ts +0 -0
  252. /package/dist/{src → client}/scripts/base64Polyfill.js +0 -0
  253. /package/dist/{src → client}/services/time/TimeService.js +0 -0
  254. /package/dist/{src → client}/services/time/TimeService.type.d.ts +0 -0
  255. /package/dist/{src → client}/services/time/TimeService.type.js +0 -0
  256. /package/dist/{src → client}/types/IntRage.d.ts +0 -0
  257. /package/dist/{src → client}/types/IntRage.js +0 -0
  258. /package/dist/{src → client}/types/PartialExcept.d.ts +0 -0
  259. /package/dist/{src → client}/types/PartialExcept.js +0 -0
  260. /package/dist/{src → client}/utils/ArrayUtils.d.ts +0 -0
  261. /package/dist/{src → client}/utils/AxiosUtils.d.ts +0 -0
  262. /package/dist/{src → client}/utils/AxiosUtils.js +0 -0
  263. /package/dist/{src → client}/utils/BooleanUtils.d.ts +0 -0
  264. /package/dist/{src → client}/utils/BooleanUtils.js +0 -0
  265. /package/dist/{src → client}/utils/Calc.d.ts +0 -0
  266. /package/dist/{src → client}/utils/Calc.js +0 -0
  267. /package/dist/{src → client}/utils/CoordinateUtils.js +0 -0
  268. /package/dist/{src → client}/utils/JuminNumberUtils.d.ts +0 -0
  269. /package/dist/{src → client}/utils/NumberUtils.d.ts +0 -0
  270. /package/dist/{src → client}/utils/NumberUtils.js +0 -0
  271. /package/dist/{src → client}/utils/ObjectIdUtils.d.ts +0 -0
  272. /package/dist/{src → client}/utils/Point3Utils.js +0 -0
  273. /package/dist/{src → client}/utils/RandomUtils.d.ts +0 -0
  274. /package/dist/{src → client}/utils/RandomUtils.js +0 -0
  275. /package/dist/{src → client}/utils/Sequencer.d.ts +0 -0
  276. /package/dist/{src → client}/utils/StringUtils.d.ts +0 -0
  277. /package/dist/{src → client}/utils/StringUtils.js +0 -0
  278. /package/dist/{src → client}/utils/UuidUtils.d.ts +0 -0
  279. /package/dist/{src → client}/utils/Validator.d.ts +0 -0
  280. /package/dist/{src → client}/utils/Validator.js +0 -0
  281. /package/dist/{src → client}/utils/global/between.d.ts +0 -0
  282. /package/dist/{src → client}/utils/global/between.js +0 -0
  283. /package/dist/{src → client}/utils/global/castArray.d.ts +0 -0
  284. /package/dist/{src → client}/utils/global/castArray.js +0 -0
  285. /package/dist/{src → client}/utils/global/circularDistance.d.ts +0 -0
  286. /package/dist/{src → client}/utils/global/circularDistance.js +0 -0
  287. /package/dist/{src → client}/utils/global/fallbackIfEqual.d.ts +0 -0
  288. /package/dist/{src → client}/utils/global/fallbackIfEqual.js +0 -0
  289. /package/dist/{src → client}/utils/global/fallbackIfNull.d.ts +0 -0
  290. /package/dist/{src → client}/utils/global/fallbackIfUndefined.d.ts +0 -0
  291. /package/dist/{src → client}/utils/global/firstNonNullish.d.ts +0 -0
  292. /package/dist/{src → client}/utils/global/firstNonNullish.js +0 -0
  293. /package/dist/{src → client}/utils/global/flat.d.ts +0 -0
  294. /package/dist/{src → client}/utils/global/flat.js +0 -0
  295. /package/dist/{src → client}/utils/global/processFirstNonNullish.d.ts +0 -0
  296. /package/dist/{src → client}/utils/global/pureEnum.d.ts +0 -0
  297. /package/dist/{src → client}/utils/global/pureEnum.js +0 -0
  298. /package/dist/{src → client}/utils/global/sleep.d.ts +0 -0
  299. /package/dist/{src → client}/utils/global/sleep.js +0 -0
  300. /package/dist/{src → client}/utils/try-catch/TryCatch.d.ts +0 -0
  301. /package/dist/{src → client}/utils/try-catch/TryCatch.js +0 -0
  302. /package/dist/{src → server}/constants/nodejs/TransactionManagerLogLevel.d.ts +0 -0
  303. /package/dist/{src → server}/constants/nodejs/TransactionManagerLogLevel.js +0 -0
  304. /package/dist/{src → server}/constants/nodejs/TransactionManagerTimeoutAction.d.ts +0 -0
  305. /package/dist/{src → server}/constants/nodejs/TransactionManagerTimeoutAction.js +0 -0
  306. /package/dist/{src/interfaces/nodejs/db/sequelize/Hook.js → server/interfaces/Coordinate.js} +0 -0
  307. /package/dist/{src/interfaces/nodejs/db/sequelize/HookFn.js → server/interfaces/Point2.js} +0 -0
  308. /package/dist/{src/interfaces/nodejs/db/sequelize/HookType.js → server/interfaces/Point3.js} +0 -0
  309. /package/dist/{src/interfaces/nodejs/db/sequelize/ReloadOption.js → server/interfaces/StorageProvider.js} +0 -0
  310. /package/dist/{src/interfaces/nodejs/db/sequelize/TransactionOption.js → server/interfaces/nodejs/db/sequelize/Hook.js} +0 -0
  311. /package/dist/{src/interfaces/nodejs/db/sequelize/UpsertOptions.js → server/interfaces/nodejs/db/sequelize/HookFn.js} +0 -0
  312. /package/dist/{src → server}/interfaces/nodejs/db/sequelize/HookType.d.ts +0 -0
  313. /package/dist/{src/managers/TransactionManager.types.js → server/interfaces/nodejs/db/sequelize/HookType.js} +0 -0
  314. /package/dist/{src → server}/interfaces/nodejs/db/sequelize/ReloadOption.d.ts +0 -0
  315. /package/dist/{src/types/UpsertResult.js → server/interfaces/nodejs/db/sequelize/ReloadOption.js} +0 -0
  316. /package/dist/{src → server}/interfaces/nodejs/db/sequelize/TransactionOption.d.ts +0 -0
  317. /package/dist/{src/utils/nodejs/sequelize-utils/types.js → server/interfaces/nodejs/db/sequelize/TransactionOption.js} +0 -0
  318. /package/dist/{src → server}/services/redis/RedisClient.d.ts +0 -0
  319. /package/dist/{src → server}/services/redis/RedisClient.js +0 -0
  320. /package/dist/{src → server}/types/UpsertResult.d.ts +0 -0
  321. /package/dist/{src → server}/utils/nodejs/HookUtils.js +0 -0
  322. /package/dist/{src → server}/utils/nodejs/sequelize-utils/types.d.ts +0 -0
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DISTANCE = void 0;
4
+ class DISTANCE {
5
+ }
6
+ exports.DISTANCE = DISTANCE;
7
+ (function (DISTANCE) {
8
+ let UNIT;
9
+ (function (UNIT) {
10
+ UNIT["FEET"] = "FEET";
11
+ UNIT["KILOMETERS"] = "KILOMETERS";
12
+ UNIT["MILLIMETERS"] = "MILLIMETERS";
13
+ UNIT["CENTIMETERS"] = "CENTIMETERS";
14
+ UNIT["METERS"] = "METERS";
15
+ UNIT["MILES"] = "MILES";
16
+ UNIT["YARDS"] = "YARDS";
17
+ })(UNIT = DISTANCE.UNIT || (DISTANCE.UNIT = {}));
18
+ })(DISTANCE || (exports.DISTANCE = DISTANCE = {}));
@@ -0,0 +1,16 @@
1
+ export declare class DURATION {
2
+ }
3
+ export declare namespace DURATION {
4
+ enum UNIT {
5
+ NANOSECONDS = "NANOSECONDS",
6
+ MICROSECONDS = "MICROSECONDS",
7
+ MILLISECONDS = "MILLISECONDS",
8
+ SECONDS = "SECONDS",
9
+ MINUTES = "MINUTES",
10
+ HOURS = "HOURS",
11
+ DAYS = "DAYS",
12
+ YEARS = "YEARS",
13
+ DECADES = "DECADES",
14
+ CENTURIES = "CENTURIES"
15
+ }
16
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DURATION = void 0;
4
+ class DURATION {
5
+ }
6
+ exports.DURATION = DURATION;
7
+ (function (DURATION) {
8
+ let UNIT;
9
+ (function (UNIT) {
10
+ UNIT["NANOSECONDS"] = "NANOSECONDS";
11
+ UNIT["MICROSECONDS"] = "MICROSECONDS";
12
+ UNIT["MILLISECONDS"] = "MILLISECONDS";
13
+ UNIT["SECONDS"] = "SECONDS";
14
+ UNIT["MINUTES"] = "MINUTES";
15
+ UNIT["HOURS"] = "HOURS";
16
+ UNIT["DAYS"] = "DAYS";
17
+ UNIT["YEARS"] = "YEARS";
18
+ UNIT["DECADES"] = "DECADES";
19
+ UNIT["CENTURIES"] = "CENTURIES";
20
+ })(UNIT = DURATION.UNIT || (DURATION.UNIT = {}));
21
+ })(DURATION || (exports.DURATION = DURATION = {}));
@@ -0,0 +1 @@
1
+ export declare const NOT_NULL: unique symbol;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NOT_NULL = void 0;
4
+ exports.NOT_NULL = Symbol('!null');
@@ -0,0 +1,6 @@
1
+ export * from './COORDINATE.js';
2
+ export * from './CRUD.js';
3
+ export * from './DATE.js';
4
+ export * from './DISTANCE.js';
5
+ export * from './DURATION.js';
6
+ export * from './NOT_NULL.js';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./COORDINATE.js"), exports);
18
+ __exportStar(require("./CRUD.js"), exports);
19
+ __exportStar(require("./DATE.js"), exports);
20
+ __exportStar(require("./DISTANCE.js"), exports);
21
+ __exportStar(require("./DURATION.js"), exports);
22
+ __exportStar(require("./NOT_NULL.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './index.browser.js';
2
+ export * from './nodejs/index.js';
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./index.browser"), exports);
18
- __exportStar(require("./nodejs"), exports);
17
+ __exportStar(require("./index.browser.js"), exports);
18
+ __exportStar(require("./nodejs/index.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './TransactionManagerLogLevel.js';
2
+ export * from './TransactionManagerTimeoutAction.js';
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./TransactionManagerLogLevel"), exports);
18
- __exportStar(require("./TransactionManagerTimeoutAction"), exports);
17
+ __exportStar(require("./TransactionManagerLogLevel.js"), exports);
18
+ __exportStar(require("./TransactionManagerTimeoutAction.js"), exports);
@@ -0,0 +1,7 @@
1
+ export * from './constants/index.browser.js';
2
+ export * from './interfaces/index.browser.js';
3
+ export * from './managers/index.browser.js';
4
+ export * from './scripts/index.browser.js';
5
+ export * from './services/index.browser.js';
6
+ export * from './types/index.browser.js';
7
+ export * from './utils/index.browser.js';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants/index.browser.js"), exports);
18
+ __exportStar(require("./interfaces/index.browser.js"), exports);
19
+ __exportStar(require("./managers/index.browser.js"), exports);
20
+ __exportStar(require("./scripts/index.browser.js"), exports);
21
+ __exportStar(require("./services/index.browser.js"), exports);
22
+ __exportStar(require("./types/index.browser.js"), exports);
23
+ __exportStar(require("./utils/index.browser.js"), exports);
@@ -0,0 +1,8 @@
1
+ export * from './index.browser.js';
2
+ export * from './constants/index.js';
3
+ export * from './interfaces/index.js';
4
+ export * from './managers/index.js';
5
+ export * from './scripts/index.js';
6
+ export * from './services/index.js';
7
+ export * from './types/index.js';
8
+ export * from './utils/index.js';
@@ -14,11 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./index.browser"), exports);
18
- __exportStar(require("./constants"), exports);
19
- __exportStar(require("./interfaces"), exports);
20
- __exportStar(require("./managers"), exports);
21
- __exportStar(require("./scripts"), exports);
22
- __exportStar(require("./services"), exports);
23
- __exportStar(require("./types"), exports);
24
- __exportStar(require("./utils"), exports);
17
+ __exportStar(require("./index.browser.js"), exports);
18
+ __exportStar(require("./constants/index.js"), exports);
19
+ __exportStar(require("./interfaces/index.js"), exports);
20
+ __exportStar(require("./managers/index.js"), exports);
21
+ __exportStar(require("./scripts/index.js"), exports);
22
+ __exportStar(require("./services/index.js"), exports);
23
+ __exportStar(require("./types/index.js"), exports);
24
+ __exportStar(require("./utils/index.js"), exports);
@@ -0,0 +1,8 @@
1
+ export interface Coordinate {
2
+ latitude: number;
3
+ longitude: number;
4
+ }
5
+ export interface CoordinateM {
6
+ lat: number;
7
+ lon: number;
8
+ }
@@ -0,0 +1,4 @@
1
+ export interface Point2 {
2
+ x: number;
3
+ y: number;
4
+ }
@@ -0,0 +1,4 @@
1
+ import { Point2 } from "./Point2.js";
2
+ export interface Point3 extends Point2 {
3
+ z: number;
4
+ }
@@ -0,0 +1,7 @@
1
+ export interface StorageProvider {
2
+ key?: () => string;
3
+ set: (key: string, value: string) => Promise<void> | void;
4
+ get: (key: string) => Promise<string | null> | (string | null);
5
+ remove: (key: string) => Promise<void> | void;
6
+ clear?: () => Promise<void> | void;
7
+ }
@@ -0,0 +1,4 @@
1
+ export * from './Coordinate.js';
2
+ export * from './Point2.js';
3
+ export * from './Point3.js';
4
+ export * from './StorageProvider.js';
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Coordinate.js"), exports);
18
+ __exportStar(require("./Point2.js"), exports);
19
+ __exportStar(require("./Point3.js"), exports);
20
+ __exportStar(require("./StorageProvider.js"), exports);
@@ -0,0 +1,2 @@
1
+ export * from './index.browser.js';
2
+ export * from './nodejs/index.js';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./index.browser.js"), exports);
18
+ __exportStar(require("./nodejs/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from './sequelize/index.js';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./sequelize/index.js"), exports);
@@ -1,6 +1,6 @@
1
1
  import { ModelCtor } from "sequelize-typescript";
2
- import { HookType } from "./HookType";
3
- import { HookFn } from "./HookFn";
2
+ import { HookType } from "./HookType.js";
3
+ import { HookFn } from "./HookFn.js";
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";
3
+ import { HookType } from "./HookType.js";
4
4
  export type HookFn = SequelizeHooks<Hooks['_model'], Attributes<Hooks>, CreationAttributes<Hooks>>[HookType];
@@ -0,0 +1,4 @@
1
+ import { ReloadOption } from "./ReloadOption.js";
2
+ import { TransactionOption } from "./TransactionOption.js";
3
+ export interface UpsertOptions extends ReloadOption, TransactionOption {
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export * from './Hook.js';
2
+ export * from './HookFn.js';
3
+ export * from './HookType.js';
4
+ export * from './ReloadOption.js';
5
+ export * from './TransactionOption.js';
6
+ export * from './UpsertOptions.js';
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./Hook.js"), exports);
18
+ __exportStar(require("./HookFn.js"), exports);
19
+ __exportStar(require("./HookType.js"), exports);
20
+ __exportStar(require("./ReloadOption.js"), exports);
21
+ __exportStar(require("./TransactionOption.js"), exports);
22
+ __exportStar(require("./UpsertOptions.js"), exports);
@@ -0,0 +1 @@
1
+ export * from './db/index.js';
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./TryCatch"), exports);
17
+ __exportStar(require("./db/index.js"), exports);
@@ -0,0 +1,15 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { StorageProvider } from "../interfaces/StorageProvider.js";
3
+ import EventEmitter from 'eventemitter3';
4
+ import { SessionManagerEvent, SessionManagerOptions } from "./SessionManager.type.js";
5
+ export declare class SessionManager extends EventEmitter<SessionManagerEvent> {
6
+ private static readonly DEFAULT_AUTHORIZATION_STORAGE_KEY;
7
+ protected api: AxiosInstance;
8
+ protected storageProvider: StorageProvider;
9
+ constructor(options: SessionManagerOptions);
10
+ private get key();
11
+ hasAuthorization(): Promise<boolean>;
12
+ getAuthorization(): Promise<string | null>;
13
+ setAuthorization(authorization?: string | null): Promise<string | null>;
14
+ removeAuthorization(): Promise<void>;
15
+ }
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.SessionManager = void 0;
16
+ const jwt_decode_1 = require("jwt-decode");
17
+ const moment_1 = __importDefault(require("moment"));
18
+ const eventemitter3_1 = __importDefault(require("eventemitter3"));
19
+ class SessionManager extends eventemitter3_1.default {
20
+ constructor(options) {
21
+ super();
22
+ // Init service parameters
23
+ this.api = options.api;
24
+ this.storageProvider = options.storageProvider;
25
+ // Logging
26
+ console.log('SessionManager initialized', Date.now(), options.api);
27
+ }
28
+ get key() {
29
+ try {
30
+ if (this.storageProvider.key) {
31
+ return this.storageProvider.key();
32
+ }
33
+ }
34
+ catch (e) {
35
+ console.error(e);
36
+ }
37
+ return SessionManager.DEFAULT_AUTHORIZATION_STORAGE_KEY;
38
+ }
39
+ hasAuthorization() {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ return !!(yield this.getAuthorization());
42
+ });
43
+ }
44
+ getAuthorization() {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ return this.storageProvider.get(this.key);
47
+ });
48
+ }
49
+ setAuthorization(authorization) {
50
+ return __awaiter(this, void 0, void 0, function* () {
51
+ if (authorization === null) {
52
+ yield this.removeAuthorization();
53
+ return null;
54
+ }
55
+ let nextAuthorization = yield (() => __awaiter(this, void 0, void 0, function* () {
56
+ if (authorization === undefined) {
57
+ return yield this.getAuthorization();
58
+ }
59
+ return authorization;
60
+ }))();
61
+ if (!nextAuthorization) {
62
+ console.log('nextAuthorization is null or undefined');
63
+ return null;
64
+ }
65
+ try {
66
+ // Replace Bearer prefix
67
+ nextAuthorization = nextAuthorization.replace(/^Bearer\s+/, '');
68
+ const decoded = (0, jwt_decode_1.jwtDecode)(nextAuthorization);
69
+ if (!decoded) {
70
+ console.warn('JWT decode failed');
71
+ return null;
72
+ }
73
+ console.log('Session:JWT decoded');
74
+ (() => {
75
+ console.log(' - User', decoded.uuid);
76
+ console.log(' - IAT', ...(() => {
77
+ if (!decoded.iat) {
78
+ return [decoded.iat];
79
+ }
80
+ const iat = moment_1.default.unix(decoded.iat);
81
+ if (!iat.isValid()) {
82
+ return [decoded.iat];
83
+ }
84
+ return [decoded.iat, iat.format(), iat.diff(Date.now(), 'days'), 'days left'];
85
+ })());
86
+ console.log(' - NBF', ...(() => {
87
+ if (!decoded.nbf) {
88
+ return [decoded.nbf];
89
+ }
90
+ const nbf = moment_1.default.unix(decoded.nbf);
91
+ if (!nbf.isValid()) {
92
+ return [decoded.nbf];
93
+ }
94
+ return [decoded.nbf, nbf.format(), nbf.diff(Date.now(), 'days'), 'days left'];
95
+ })());
96
+ console.log(' - EXP', ...(() => {
97
+ if (!decoded.exp) {
98
+ return [decoded.exp];
99
+ }
100
+ const exp = moment_1.default.unix(decoded.exp);
101
+ if (!exp.isValid()) {
102
+ return [decoded.exp];
103
+ }
104
+ return [decoded.exp, exp.format(), exp.diff(Date.now(), 'days'), 'days left'];
105
+ })());
106
+ })();
107
+ // AsyncStorage 에 토큰 저장
108
+ yield this.storageProvider.set(this.key, nextAuthorization);
109
+ // API Instance header 설정
110
+ this.api.defaults.headers.common.Authorization = `Bearer ${nextAuthorization}`;
111
+ // Emit
112
+ this.emit('AUTHORIZATION_CHANGED', nextAuthorization);
113
+ // Return
114
+ return nextAuthorization;
115
+ }
116
+ catch (e) {
117
+ console.error(e);
118
+ }
119
+ return null;
120
+ });
121
+ }
122
+ removeAuthorization() {
123
+ return __awaiter(this, void 0, void 0, function* () {
124
+ // API Instance header 에서 토큰 제거
125
+ delete this.api.defaults.headers.common.Authorization;
126
+ // 스토리지에서 authorization 제거
127
+ yield this.storageProvider.remove(this.key);
128
+ // Emit
129
+ this.emit('AUTHORIZATION_CHANGED', null);
130
+ });
131
+ }
132
+ }
133
+ exports.SessionManager = SessionManager;
134
+ SessionManager.DEFAULT_AUTHORIZATION_STORAGE_KEY = 'AUTHORIZATION';
@@ -0,0 +1,9 @@
1
+ import { AxiosInstance } from "axios";
2
+ import { StorageProvider } from "../interfaces/StorageProvider.js";
3
+ export interface SessionManagerOptions {
4
+ api: AxiosInstance;
5
+ storageProvider: StorageProvider;
6
+ }
7
+ export type SessionManagerEvent = {
8
+ AUTHORIZATION_CHANGED: (authorization: string | null) => void;
9
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,7 +1,7 @@
1
1
  import { Transaction } from "sequelize";
2
2
  import EventEmitter from 'eventemitter3';
3
- import { TransactionManagerLogLevel, TransactionManagerTimeoutAction } from "../constants";
4
- import { TransactionManagerAddOption, TransactionManagerEventTypes } from "./TransactionManager.types";
3
+ import { TransactionManagerLogLevel, TransactionManagerTimeoutAction } from "../constants/index.js";
4
+ import { TransactionManagerAddOption, TransactionManagerEventTypes } from "./TransactionManager.types.js";
5
5
  export declare class TransactionManager {
6
6
  static DEFAULT_TIMEOUT: number;
7
7
  static DEFAULT_ACTION: TransactionManagerTimeoutAction;
@@ -14,16 +14,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.TransactionManager = void 0;
16
16
  const eventemitter3_1 = __importDefault(require("eventemitter3"));
17
- const constants_1 = require("../constants");
17
+ const index_js_1 = require("../constants/index.js");
18
18
  const LOG_TAG = '[TransactionManager]';
19
19
  class TransactionManager {
20
20
  constructor() {
21
21
  // Members
22
- this.logLevel = constants_1.TransactionManagerLogLevel.VERBOSE;
22
+ this.logLevel = index_js_1.TransactionManagerLogLevel.VERBOSE;
23
23
  this.transactionTimeoutMap = new Map();
24
24
  // Emitter
25
25
  this.emitter = new eventemitter3_1.default();
26
- if (this.logLevel <= constants_1.TransactionManagerLogLevel.VERBOSE) {
26
+ if (this.logLevel <= index_js_1.TransactionManagerLogLevel.VERBOSE) {
27
27
  console.log(LOG_TAG, 'TransactionManager instance initialized');
28
28
  }
29
29
  }
@@ -36,7 +36,7 @@ class TransactionManager {
36
36
  }
37
37
  setLogLevel(logLevel) {
38
38
  this.logLevel = logLevel;
39
- if (this.logLevel <= constants_1.TransactionManagerLogLevel.VERBOSE) {
39
+ if (this.logLevel <= index_js_1.TransactionManagerLogLevel.VERBOSE) {
40
40
  console.log(LOG_TAG, 'log level changed to', logLevel);
41
41
  }
42
42
  }
@@ -49,7 +49,7 @@ class TransactionManager {
49
49
  add(transaction, option) {
50
50
  var _a, _b;
51
51
  if (this.transactionTimeoutMap.has(transaction)) {
52
- if (this.logLevel <= constants_1.TransactionManagerLogLevel.ERROR) {
52
+ if (this.logLevel <= index_js_1.TransactionManagerLogLevel.ERROR) {
53
53
  console.error(LOG_TAG, 'transaction already exists');
54
54
  }
55
55
  return;
@@ -69,7 +69,7 @@ class TransactionManager {
69
69
  if (transactionTimeout != null) {
70
70
  clearTimeout(transactionTimeout.handler);
71
71
  this.transactionTimeoutMap.delete(transaction);
72
- if (this.logLevel <= constants_1.TransactionManagerLogLevel.VERBOSE) {
72
+ if (this.logLevel <= index_js_1.TransactionManagerLogLevel.VERBOSE) {
73
73
  console.log(LOG_TAG, this.getTransactionLogArg(transaction), 'removed');
74
74
  }
75
75
  }
@@ -89,7 +89,7 @@ class TransactionManager {
89
89
  let handled = false;
90
90
  const finished = transaction === null || transaction === void 0 ? void 0 : transaction.finished;
91
91
  if (finished != null) {
92
- if (this.logLevel <= constants_1.TransactionManagerLogLevel.VERBOSE) {
92
+ if (this.logLevel <= index_js_1.TransactionManagerLogLevel.VERBOSE) {
93
93
  console.log(LOG_TAG, this.getTransactionLogArg(transaction), `is already handled(${finished}) after`, reason);
94
94
  }
95
95
  this.remove(transaction);
@@ -98,18 +98,18 @@ class TransactionManager {
98
98
  try {
99
99
  let finished;
100
100
  switch (action) {
101
- case constants_1.TransactionManagerTimeoutAction.ROLLBACK: {
101
+ case index_js_1.TransactionManagerTimeoutAction.ROLLBACK: {
102
102
  yield transaction.rollback();
103
103
  finished = 'rollback';
104
104
  break;
105
105
  }
106
- case constants_1.TransactionManagerTimeoutAction.COMMIT: {
106
+ case index_js_1.TransactionManagerTimeoutAction.COMMIT: {
107
107
  yield transaction.commit();
108
108
  finished = 'commit';
109
109
  break;
110
110
  }
111
111
  default: {
112
- if (this.logLevel <= constants_1.TransactionManagerLogLevel.ERROR) {
112
+ if (this.logLevel <= index_js_1.TransactionManagerLogLevel.ERROR) {
113
113
  console.error(LOG_TAG, `unknown action`, action);
114
114
  }
115
115
  break;
@@ -117,12 +117,12 @@ class TransactionManager {
117
117
  }
118
118
  handled = finished != null;
119
119
  if (finished != null) {
120
- if (this.logLevel <= constants_1.TransactionManagerLogLevel.ERROR) {
120
+ if (this.logLevel <= index_js_1.TransactionManagerLogLevel.ERROR) {
121
121
  console.error(LOG_TAG, this.getTransactionLogArg(transaction), `handled(${finished}) after`, reason);
122
122
  }
123
123
  }
124
124
  else {
125
- if (this.logLevel <= constants_1.TransactionManagerLogLevel.ERROR) {
125
+ if (this.logLevel <= index_js_1.TransactionManagerLogLevel.ERROR) {
126
126
  console.error(LOG_TAG, this.getTransactionLogArg(transaction), `not handled 🚫`);
127
127
  }
128
128
  }
@@ -148,4 +148,4 @@ class TransactionManager {
148
148
  }
149
149
  exports.TransactionManager = TransactionManager;
150
150
  TransactionManager.DEFAULT_TIMEOUT = 60 * 1000;
151
- TransactionManager.DEFAULT_ACTION = constants_1.TransactionManagerTimeoutAction.ROLLBACK;
151
+ TransactionManager.DEFAULT_ACTION = index_js_1.TransactionManagerTimeoutAction.ROLLBACK;