@powfix/core-js 0.22.2 → 0.23.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 (303) hide show
  1. package/dist/browser/index.cjs +1 -0
  2. package/dist/browser/index.d.ts +2 -0
  3. package/dist/browser/index.js +0 -0
  4. package/dist/chunk-ETV4XYOV.cjs +18 -0
  5. package/dist/chunk-PKBMQBKP.js +17 -0
  6. package/dist/index.browser.cjs +16 -1726
  7. package/dist/index.browser.d.ts +57 -484
  8. package/dist/index.browser.js +2 -1644
  9. package/dist/index.cjs +8 -1727
  10. package/dist/index.d.ts +52 -1
  11. package/dist/index.js +1 -1644
  12. package/dist/index.node.cjs +15 -2123
  13. package/dist/index.node.d.ts +77 -164
  14. package/dist/index.node.js +2 -2034
  15. package/dist/node/constants/TransactionManagerLogLevel.cjs +11 -0
  16. package/dist/node/constants/TransactionManagerLogLevel.d.ts +9 -0
  17. package/dist/node/constants/TransactionManagerLogLevel.js +10 -0
  18. package/dist/node/constants/TransactionManagerTimeoutAction.cjs +8 -0
  19. package/dist/node/constants/TransactionManagerTimeoutAction.d.ts +6 -0
  20. package/dist/node/constants/TransactionManagerTimeoutAction.js +7 -0
  21. package/dist/node/constants/index.cjs +19 -0
  22. package/dist/node/constants/index.d.ts +2 -0
  23. package/dist/node/constants/index.js +2 -0
  24. package/dist/node/index.cjs +55 -0
  25. package/dist/node/index.d.ts +25 -0
  26. package/dist/node/index.js +6 -0
  27. package/dist/node/interfaces/db/index.cjs +10 -0
  28. package/dist/node/interfaces/db/index.d.ts +10 -0
  29. package/dist/node/interfaces/db/index.js +1 -0
  30. package/dist/node/interfaces/db/sequelize/Hook.cjs +1 -0
  31. package/dist/node/interfaces/db/sequelize/Hook.d.ts +13 -0
  32. package/dist/node/interfaces/db/sequelize/Hook.js +0 -0
  33. package/dist/node/interfaces/db/sequelize/HookFn.cjs +1 -0
  34. package/dist/node/interfaces/db/sequelize/HookFn.d.ts +7 -0
  35. package/dist/node/interfaces/db/sequelize/HookFn.js +0 -0
  36. package/dist/node/interfaces/db/sequelize/HookType.cjs +1 -0
  37. package/dist/node/interfaces/db/sequelize/HookType.d.ts +6 -0
  38. package/dist/node/interfaces/db/sequelize/HookType.js +0 -0
  39. package/dist/node/interfaces/db/sequelize/ReloadOption.cjs +1 -0
  40. package/dist/node/interfaces/db/sequelize/ReloadOption.d.ts +5 -0
  41. package/dist/node/interfaces/db/sequelize/ReloadOption.js +0 -0
  42. package/dist/node/interfaces/db/sequelize/TransactionOption.cjs +1 -0
  43. package/dist/node/interfaces/db/sequelize/TransactionOption.d.ts +7 -0
  44. package/dist/node/interfaces/db/sequelize/TransactionOption.js +0 -0
  45. package/dist/node/interfaces/db/sequelize/UpsertOptions.cjs +1 -0
  46. package/dist/node/interfaces/db/sequelize/UpsertOptions.d.ts +8 -0
  47. package/dist/node/interfaces/db/sequelize/UpsertOptions.js +0 -0
  48. package/dist/node/interfaces/db/sequelize/index.cjs +55 -0
  49. package/dist/node/interfaces/db/sequelize/index.d.ts +10 -0
  50. package/dist/node/interfaces/db/sequelize/index.js +6 -0
  51. package/dist/node/interfaces/index.cjs +10 -0
  52. package/dist/node/interfaces/index.d.ts +10 -0
  53. package/dist/node/interfaces/index.js +1 -0
  54. package/dist/node/managers/TransactionManager.cjs +463 -0
  55. package/dist/node/managers/TransactionManager.d.ts +31 -0
  56. package/dist/node/managers/TransactionManager.js +457 -0
  57. package/dist/node/managers/TransactionManager.types.cjs +1 -0
  58. package/dist/node/managers/TransactionManager.types.d.ts +12 -0
  59. package/dist/node/managers/TransactionManager.types.js +0 -0
  60. package/dist/node/managers/index.cjs +19 -0
  61. package/dist/node/managers/index.d.ts +6 -0
  62. package/dist/node/managers/index.js +2 -0
  63. package/dist/node/services/index.cjs +10 -0
  64. package/dist/node/services/index.d.ts +5 -0
  65. package/dist/node/services/index.js +1 -0
  66. package/dist/node/services/redis/RedisClient.cjs +250 -0
  67. package/dist/node/services/redis/RedisClient.d.ts +24 -0
  68. package/dist/node/services/redis/RedisClient.js +250 -0
  69. package/dist/node/services/redis/RedisPublisher.cjs +323 -0
  70. package/dist/node/services/redis/RedisPublisher.d.ts +17 -0
  71. package/dist/node/services/redis/RedisPublisher.js +323 -0
  72. package/dist/node/services/redis/RedisSubscriber.cjs +502 -0
  73. package/dist/node/services/redis/RedisSubscriber.d.ts +15 -0
  74. package/dist/node/services/redis/RedisSubscriber.js +502 -0
  75. package/dist/node/services/redis/index.cjs +28 -0
  76. package/dist/node/services/redis/index.d.ts +5 -0
  77. package/dist/node/services/redis/index.js +3 -0
  78. package/dist/node/types/UpsertResult.cjs +1 -0
  79. package/dist/node/types/UpsertResult.d.ts +5 -0
  80. package/dist/node/types/UpsertResult.js +0 -0
  81. package/dist/node/types/index.cjs +19 -0
  82. package/dist/node/types/index.d.ts +9 -0
  83. package/dist/node/types/index.js +2 -0
  84. package/dist/node/types/mariaDb.cjs +1 -0
  85. package/dist/node/types/mariaDb.d.ts +15 -0
  86. package/dist/node/types/mariaDb.js +0 -0
  87. package/dist/node/utils/HookUtils.cjs +87 -0
  88. package/dist/node/utils/HookUtils.d.ts +20 -0
  89. package/dist/node/utils/HookUtils.js +87 -0
  90. package/dist/node/utils/index.cjs +19 -0
  91. package/dist/node/utils/index.d.ts +10 -0
  92. package/dist/node/utils/index.js +2 -0
  93. package/dist/node/utils/sequelize-utils/SequelizeUtils.cjs +165 -0
  94. package/dist/node/utils/sequelize-utils/SequelizeUtils.d.ts +12 -0
  95. package/dist/node/utils/sequelize-utils/SequelizeUtils.js +165 -0
  96. package/dist/node/utils/sequelize-utils/index.cjs +19 -0
  97. package/dist/node/utils/sequelize-utils/index.d.ts +3 -0
  98. package/dist/node/utils/sequelize-utils/index.js +2 -0
  99. package/dist/node/utils/sequelize-utils/types.cjs +1 -0
  100. package/dist/node/utils/sequelize-utils/types.d.ts +19 -0
  101. package/dist/node/utils/sequelize-utils/types.js +0 -0
  102. package/dist/shared/constants/COORDINATE.cjs +15 -0
  103. package/dist/shared/constants/COORDINATE.d.ts +9 -0
  104. package/dist/shared/constants/COORDINATE.js +15 -0
  105. package/dist/shared/constants/CRUD.cjs +26 -0
  106. package/dist/shared/constants/CRUD.d.ts +11 -0
  107. package/dist/shared/constants/CRUD.js +26 -0
  108. package/dist/shared/constants/DATE.cjs +34 -0
  109. package/dist/shared/constants/DATE.d.ts +15 -0
  110. package/dist/shared/constants/DATE.js +34 -0
  111. package/dist/shared/constants/DISTANCE.cjs +22 -0
  112. package/dist/shared/constants/DISTANCE.d.ts +15 -0
  113. package/dist/shared/constants/DISTANCE.js +22 -0
  114. package/dist/shared/constants/DURATION.cjs +25 -0
  115. package/dist/shared/constants/DURATION.d.ts +18 -0
  116. package/dist/shared/constants/DURATION.js +25 -0
  117. package/dist/shared/constants/NOT_NULL.cjs +4 -0
  118. package/dist/shared/constants/NOT_NULL.d.ts +3 -0
  119. package/dist/shared/constants/NOT_NULL.js +3 -0
  120. package/dist/shared/constants/index.cjs +55 -0
  121. package/dist/shared/constants/index.d.ts +6 -0
  122. package/dist/shared/constants/index.js +6 -0
  123. package/dist/shared/exports/Uint8Array.cjs +9 -0
  124. package/dist/shared/exports/Uint8Array.d.ts +6 -0
  125. package/dist/shared/exports/Uint8Array.js +8 -0
  126. package/dist/shared/exports/atob.cjs +3 -0
  127. package/dist/shared/exports/atob.d.ts +2 -0
  128. package/dist/shared/exports/atob.js +2 -0
  129. package/dist/shared/exports/btoa.cjs +3 -0
  130. package/dist/shared/exports/btoa.d.ts +2 -0
  131. package/dist/shared/exports/btoa.js +2 -0
  132. package/dist/shared/index.cjs +64 -0
  133. package/dist/shared/index.d.ts +57 -0
  134. package/dist/shared/index.js +7 -0
  135. package/dist/shared/interfaces/Coordinate.cjs +1 -0
  136. package/dist/shared/interfaces/Coordinate.d.ts +10 -0
  137. package/dist/shared/interfaces/Coordinate.js +0 -0
  138. package/dist/shared/interfaces/Point2.cjs +1 -0
  139. package/dist/shared/interfaces/Point2.d.ts +6 -0
  140. package/dist/shared/interfaces/Point2.js +0 -0
  141. package/dist/shared/interfaces/Point3.cjs +1 -0
  142. package/dist/shared/interfaces/Point3.d.ts +7 -0
  143. package/dist/shared/interfaces/Point3.js +0 -0
  144. package/dist/shared/interfaces/StorageProvider.cjs +1 -0
  145. package/dist/shared/interfaces/StorageProvider.d.ts +9 -0
  146. package/dist/shared/interfaces/StorageProvider.js +0 -0
  147. package/dist/shared/interfaces/index.cjs +37 -0
  148. package/dist/shared/interfaces/index.d.ts +4 -0
  149. package/dist/shared/interfaces/index.js +4 -0
  150. package/dist/shared/managers/SessionManager.cjs +498 -0
  151. package/dist/shared/managers/SessionManager.d.ts +18 -0
  152. package/dist/shared/managers/SessionManager.js +491 -0
  153. package/dist/shared/managers/SessionManager.type.cjs +1 -0
  154. package/dist/shared/managers/SessionManager.type.d.ts +12 -0
  155. package/dist/shared/managers/SessionManager.type.js +0 -0
  156. package/dist/shared/managers/index.cjs +19 -0
  157. package/dist/shared/managers/index.d.ts +5 -0
  158. package/dist/shared/managers/index.js +2 -0
  159. package/dist/shared/scripts/base64Polyfill.cjs +20 -0
  160. package/dist/shared/scripts/base64Polyfill.d.ts +3 -0
  161. package/dist/shared/scripts/base64Polyfill.js +13 -0
  162. package/dist/shared/scripts/index.cjs +10 -0
  163. package/dist/shared/scripts/index.d.ts +1 -0
  164. package/dist/shared/scripts/index.js +1 -0
  165. package/dist/shared/services/index.cjs +10 -0
  166. package/dist/shared/services/index.d.ts +3 -0
  167. package/dist/shared/services/index.js +1 -0
  168. package/dist/shared/services/time/TimeService.cjs +487 -0
  169. package/dist/shared/services/time/TimeService.d.ts +34 -0
  170. package/dist/shared/services/time/TimeService.js +481 -0
  171. package/dist/shared/services/time/TimeService.type.cjs +1 -0
  172. package/dist/shared/services/time/TimeService.type.d.ts +23 -0
  173. package/dist/shared/services/time/TimeService.type.js +0 -0
  174. package/dist/shared/services/time/index.cjs +19 -0
  175. package/dist/shared/services/time/index.d.ts +3 -0
  176. package/dist/shared/services/time/index.js +2 -0
  177. package/dist/shared/types/IntRage.cjs +1 -0
  178. package/dist/shared/types/IntRage.d.ts +4 -0
  179. package/dist/shared/types/IntRage.js +0 -0
  180. package/dist/shared/types/PartialExcept.cjs +1 -0
  181. package/dist/shared/types/PartialExcept.d.ts +3 -0
  182. package/dist/shared/types/PartialExcept.js +0 -0
  183. package/dist/shared/types/index.cjs +19 -0
  184. package/dist/shared/types/index.d.ts +2 -0
  185. package/dist/shared/types/index.js +2 -0
  186. package/dist/shared/utils/ArrayUtils.cjs +104 -0
  187. package/dist/shared/utils/ArrayUtils.d.ts +14 -0
  188. package/dist/shared/utils/ArrayUtils.js +104 -0
  189. package/dist/shared/utils/AxiosUtils.cjs +113 -0
  190. package/dist/shared/utils/AxiosUtils.d.ts +8 -0
  191. package/dist/shared/utils/AxiosUtils.js +113 -0
  192. package/dist/shared/utils/BooleanUtils.cjs +7 -0
  193. package/dist/shared/utils/BooleanUtils.d.ts +3 -0
  194. package/dist/shared/utils/BooleanUtils.js +6 -0
  195. package/dist/shared/utils/Calc.cjs +62 -0
  196. package/dist/shared/utils/Calc.d.ts +6 -0
  197. package/dist/shared/utils/Calc.js +62 -0
  198. package/dist/shared/utils/CoordinateUtils.cjs +85 -0
  199. package/dist/shared/utils/CoordinateUtils.d.ts +11 -0
  200. package/dist/shared/utils/CoordinateUtils.js +85 -0
  201. package/dist/shared/utils/DateUtils.cjs +656 -0
  202. package/dist/shared/utils/DateUtils.d.ts +27 -0
  203. package/dist/shared/utils/DateUtils.js +651 -0
  204. package/dist/shared/utils/Enum.cjs +142 -0
  205. package/dist/shared/utils/Enum.d.ts +19 -0
  206. package/dist/shared/utils/Enum.js +142 -0
  207. package/dist/shared/utils/Enum.types.cjs +1 -0
  208. package/dist/shared/utils/Enum.types.d.ts +7 -0
  209. package/dist/shared/utils/Enum.types.js +0 -0
  210. package/dist/shared/utils/I18nUtils.cjs +48 -0
  211. package/dist/shared/utils/I18nUtils.d.ts +7 -0
  212. package/dist/shared/utils/I18nUtils.js +42 -0
  213. package/dist/shared/utils/JuminNumberUtils.cjs +71 -0
  214. package/dist/shared/utils/JuminNumberUtils.d.ts +6 -0
  215. package/dist/shared/utils/JuminNumberUtils.js +71 -0
  216. package/dist/shared/utils/NumberUtils.cjs +80 -0
  217. package/dist/shared/utils/NumberUtils.d.ts +6 -0
  218. package/dist/shared/utils/NumberUtils.js +80 -0
  219. package/dist/shared/utils/ObjectIdUtils.cjs +65 -0
  220. package/dist/shared/utils/ObjectIdUtils.d.ts +6 -0
  221. package/dist/shared/utils/ObjectIdUtils.js +65 -0
  222. package/dist/shared/utils/Point3Utils.cjs +39 -0
  223. package/dist/shared/utils/Point3Utils.d.ts +8 -0
  224. package/dist/shared/utils/Point3Utils.js +39 -0
  225. package/dist/shared/utils/RandomUtils.cjs +103 -0
  226. package/dist/shared/utils/RandomUtils.d.ts +10 -0
  227. package/dist/shared/utils/RandomUtils.js +103 -0
  228. package/dist/shared/utils/Sequencer.cjs +476 -0
  229. package/dist/shared/utils/Sequencer.d.ts +41 -0
  230. package/dist/shared/utils/Sequencer.js +467 -0
  231. package/dist/shared/utils/StringUtils.cjs +71 -0
  232. package/dist/shared/utils/StringUtils.d.ts +7 -0
  233. package/dist/shared/utils/StringUtils.js +71 -0
  234. package/dist/shared/utils/Uint8ArrayUtils.cjs +48 -0
  235. package/dist/shared/utils/Uint8ArrayUtils.d.ts +6 -0
  236. package/dist/shared/utils/Uint8ArrayUtils.js +48 -0
  237. package/dist/shared/utils/UuidUtils.cjs +95 -0
  238. package/dist/shared/utils/UuidUtils.d.ts +16 -0
  239. package/dist/shared/utils/UuidUtils.js +75 -0
  240. package/dist/shared/utils/Validator.cjs +135 -0
  241. package/dist/shared/utils/Validator.d.ts +50 -0
  242. package/dist/shared/utils/Validator.js +135 -0
  243. package/dist/shared/utils/global/atob.cjs +12 -0
  244. package/dist/shared/utils/global/atob.d.ts +5 -0
  245. package/dist/shared/utils/global/atob.js +5 -0
  246. package/dist/shared/utils/global/base64.cjs +42 -0
  247. package/dist/shared/utils/global/base64.d.ts +4 -0
  248. package/dist/shared/utils/global/base64.js +40 -0
  249. package/dist/shared/utils/global/between.cjs +6 -0
  250. package/dist/shared/utils/global/between.d.ts +3 -0
  251. package/dist/shared/utils/global/between.js +5 -0
  252. package/dist/shared/utils/global/btoa.cjs +12 -0
  253. package/dist/shared/utils/global/btoa.d.ts +5 -0
  254. package/dist/shared/utils/global/btoa.js +5 -0
  255. package/dist/shared/utils/global/castArray.cjs +8 -0
  256. package/dist/shared/utils/global/castArray.d.ts +3 -0
  257. package/dist/shared/utils/global/castArray.js +7 -0
  258. package/dist/shared/utils/global/circularDistance.cjs +13 -0
  259. package/dist/shared/utils/global/circularDistance.d.ts +3 -0
  260. package/dist/shared/utils/global/circularDistance.js +12 -0
  261. package/dist/shared/utils/global/fallbackIfMatch.cjs +13 -0
  262. package/dist/shared/utils/global/fallbackIfMatch.d.ts +3 -0
  263. package/dist/shared/utils/global/fallbackIfMatch.js +12 -0
  264. package/dist/shared/utils/global/fallbackIfNull.cjs +7 -0
  265. package/dist/shared/utils/global/fallbackIfNull.d.ts +3 -0
  266. package/dist/shared/utils/global/fallbackIfNull.js +6 -0
  267. package/dist/shared/utils/global/fallbackIfNullish.cjs +9 -0
  268. package/dist/shared/utils/global/fallbackIfNullish.d.ts +3 -0
  269. package/dist/shared/utils/global/fallbackIfNullish.js +8 -0
  270. package/dist/shared/utils/global/fallbackIfUndefined.cjs +7 -0
  271. package/dist/shared/utils/global/fallbackIfUndefined.d.ts +3 -0
  272. package/dist/shared/utils/global/fallbackIfUndefined.js +6 -0
  273. package/dist/shared/utils/global/firstNonNullish.cjs +40 -0
  274. package/dist/shared/utils/global/firstNonNullish.d.ts +3 -0
  275. package/dist/shared/utils/global/firstNonNullish.js +39 -0
  276. package/dist/shared/utils/global/flat.cjs +102 -0
  277. package/dist/shared/utils/global/flat.d.ts +16 -0
  278. package/dist/shared/utils/global/flat.js +100 -0
  279. package/dist/shared/utils/global/index.cjs +136 -0
  280. package/dist/shared/utils/global/index.d.ts +16 -0
  281. package/dist/shared/utils/global/index.js +15 -0
  282. package/dist/shared/utils/global/processFirstNonNullish.cjs +40 -0
  283. package/dist/shared/utils/global/processFirstNonNullish.d.ts +3 -0
  284. package/dist/shared/utils/global/processFirstNonNullish.js +38 -0
  285. package/dist/shared/utils/global/pureEnum.cjs +69 -0
  286. package/dist/shared/utils/global/pureEnum.d.ts +18 -0
  287. package/dist/shared/utils/global/pureEnum.js +66 -0
  288. package/dist/shared/utils/global/sleep.cjs +8 -0
  289. package/dist/shared/utils/global/sleep.d.ts +3 -0
  290. package/dist/shared/utils/global/sleep.js +7 -0
  291. package/dist/shared/utils/index.cjs +190 -0
  292. package/dist/shared/utils/index.d.ts +44 -0
  293. package/dist/shared/utils/index.js +21 -0
  294. package/dist/shared/utils/try-catch/TryCatch.cjs +237 -0
  295. package/dist/shared/utils/try-catch/TryCatch.d.ts +26 -0
  296. package/dist/shared/utils/try-catch/TryCatch.js +237 -0
  297. package/dist/shared/utils/try-catch/index.cjs +10 -0
  298. package/dist/shared/utils/try-catch/index.d.ts +1 -0
  299. package/dist/shared/utils/try-catch/index.js +1 -0
  300. package/package.json +6 -7
  301. package/dist/index.browser.d.cts +0 -484
  302. package/dist/index.d.cts +0 -6
  303. package/dist/index.node.d.cts +0 -168
@@ -0,0 +1,87 @@
1
+ 'use strict';
2
+ function _class_call_check(instance, Constructor) {
3
+ if (!(instance instanceof Constructor)) {
4
+ throw new TypeError("Cannot call a class as a function");
5
+ }
6
+ }
7
+ function _defineProperties(target, props) {
8
+ for(var i = 0; i < props.length; i++){
9
+ var descriptor = props[i];
10
+ descriptor.enumerable = descriptor.enumerable || false;
11
+ descriptor.configurable = true;
12
+ if ("value" in descriptor) descriptor.writable = true;
13
+ Object.defineProperty(target, descriptor.key, descriptor);
14
+ }
15
+ }
16
+ function _create_class(Constructor, protoProps, staticProps) {
17
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
18
+ if (staticProps) _defineProperties(Constructor, staticProps);
19
+ return Constructor;
20
+ }
21
+ require('../../chunk-ETV4XYOV.cjs');
22
+ var HookUtils = /*#__PURE__*/ function() {
23
+ function HookUtils() {
24
+ _class_call_check(this, HookUtils);
25
+ }
26
+ _create_class(HookUtils, null, [
27
+ {
28
+ key: "getFkChanges",
29
+ value: function getFkChanges(pFkValue, cFkValue) {
30
+ var results = {
31
+ pFkValue: null,
32
+ cFkValue: null
33
+ };
34
+ if (pFkValue !== void 0 && cFkValue !== void 0) {
35
+ if (pFkValue !== cFkValue) {
36
+ if (pFkValue !== null) {
37
+ results.pFkValue = pFkValue;
38
+ }
39
+ }
40
+ }
41
+ if (cFkValue !== null && cFkValue !== void 0) {
42
+ results.cFkValue = cFkValue;
43
+ }
44
+ return results;
45
+ }
46
+ },
47
+ {
48
+ key: "makeModelHooks",
49
+ value: function makeModelHooks(model, fns) {
50
+ return [
51
+ {
52
+ model: model,
53
+ hookType: "afterCreate",
54
+ fn: fns.create
55
+ },
56
+ {
57
+ model: model,
58
+ hookType: "afterBulkCreate",
59
+ fn: fns.create
60
+ },
61
+ {
62
+ model: model,
63
+ hookType: "afterUpdate",
64
+ fn: fns.update
65
+ },
66
+ {
67
+ model: model,
68
+ hookType: "afterBulkUpdate",
69
+ fn: fns.update
70
+ },
71
+ {
72
+ model: model,
73
+ hookType: "afterDestroy",
74
+ fn: fns.destroy
75
+ },
76
+ {
77
+ model: model,
78
+ hookType: "afterBulkDestroy",
79
+ fn: fns.destroy
80
+ }
81
+ ];
82
+ }
83
+ }
84
+ ]);
85
+ return HookUtils;
86
+ }();
87
+ exports.HookUtils = HookUtils;
@@ -0,0 +1,20 @@
1
+ import { Hook } from '../interfaces/db/sequelize/Hook.js';
2
+ import { HookFn } from '../interfaces/db/sequelize/HookFn.js';
3
+ import { ModelCtor } from 'sequelize-typescript';
4
+ import '../interfaces/db/sequelize/HookType.js';
5
+ import 'sequelize/types/hooks';
6
+ import 'sequelize/types/model';
7
+
8
+ declare class HookUtils {
9
+ static getFkChanges<T>(pFkValue: T | null | undefined, cFkValue: T | null | undefined): {
10
+ pFkValue: T | null;
11
+ cFkValue: T | null;
12
+ };
13
+ static makeModelHooks(model: ModelCtor, fns: {
14
+ create: HookFn;
15
+ update: HookFn;
16
+ destroy: HookFn;
17
+ }): Hook[];
18
+ }
19
+
20
+ export { HookUtils };
@@ -0,0 +1,87 @@
1
+ function _class_call_check(instance, Constructor) {
2
+ if (!(instance instanceof Constructor)) {
3
+ throw new TypeError("Cannot call a class as a function");
4
+ }
5
+ }
6
+ function _defineProperties(target, props) {
7
+ for(var i = 0; i < props.length; i++){
8
+ var descriptor = props[i];
9
+ descriptor.enumerable = descriptor.enumerable || false;
10
+ descriptor.configurable = true;
11
+ if ("value" in descriptor) descriptor.writable = true;
12
+ Object.defineProperty(target, descriptor.key, descriptor);
13
+ }
14
+ }
15
+ function _create_class(Constructor, protoProps, staticProps) {
16
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
17
+ if (staticProps) _defineProperties(Constructor, staticProps);
18
+ return Constructor;
19
+ }
20
+ import '../../chunk-PKBMQBKP.js';
21
+ var HookUtils = /*#__PURE__*/ function() {
22
+ "use strict";
23
+ function HookUtils() {
24
+ _class_call_check(this, HookUtils);
25
+ }
26
+ _create_class(HookUtils, null, [
27
+ {
28
+ key: "getFkChanges",
29
+ value: function getFkChanges(pFkValue, cFkValue) {
30
+ var results = {
31
+ pFkValue: null,
32
+ cFkValue: null
33
+ };
34
+ if (pFkValue !== void 0 && cFkValue !== void 0) {
35
+ if (pFkValue !== cFkValue) {
36
+ if (pFkValue !== null) {
37
+ results.pFkValue = pFkValue;
38
+ }
39
+ }
40
+ }
41
+ if (cFkValue !== null && cFkValue !== void 0) {
42
+ results.cFkValue = cFkValue;
43
+ }
44
+ return results;
45
+ }
46
+ },
47
+ {
48
+ key: "makeModelHooks",
49
+ value: function makeModelHooks(model, fns) {
50
+ return [
51
+ {
52
+ model: model,
53
+ hookType: "afterCreate",
54
+ fn: fns.create
55
+ },
56
+ {
57
+ model: model,
58
+ hookType: "afterBulkCreate",
59
+ fn: fns.create
60
+ },
61
+ {
62
+ model: model,
63
+ hookType: "afterUpdate",
64
+ fn: fns.update
65
+ },
66
+ {
67
+ model: model,
68
+ hookType: "afterBulkUpdate",
69
+ fn: fns.update
70
+ },
71
+ {
72
+ model: model,
73
+ hookType: "afterDestroy",
74
+ fn: fns.destroy
75
+ },
76
+ {
77
+ model: model,
78
+ hookType: "afterBulkDestroy",
79
+ fn: fns.destroy
80
+ }
81
+ ];
82
+ }
83
+ }
84
+ ]);
85
+ return HookUtils;
86
+ }();
87
+ export { HookUtils };
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+ var sequelizeUtils = require('./sequelize-utils');
3
+ var HookUtils = require('./HookUtils');
4
+ Object.keys(sequelizeUtils).forEach(function(k) {
5
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
6
+ enumerable: true,
7
+ get: function get() {
8
+ return sequelizeUtils[k];
9
+ }
10
+ });
11
+ });
12
+ Object.keys(HookUtils).forEach(function(k) {
13
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return HookUtils[k];
17
+ }
18
+ });
19
+ });
@@ -0,0 +1,10 @@
1
+ export { SequelizeUtils } from './sequelize-utils/SequelizeUtils.js';
2
+ export { ConcreteUuidKeys, ExtractStringKeys, ExtractUuidKeys, Model, NonKnownUuidStringKeys, UuidColumnOptionsBase, UuidColumnOptionsForModel } from './sequelize-utils/types.js';
3
+ export { HookUtils } from './HookUtils.js';
4
+ import 'sequelize';
5
+ import '../interfaces/db/sequelize/Hook.js';
6
+ import 'sequelize-typescript';
7
+ import '../interfaces/db/sequelize/HookType.js';
8
+ import 'sequelize/types/hooks';
9
+ import 'sequelize/types/model';
10
+ import '../interfaces/db/sequelize/HookFn.js';
@@ -0,0 +1,2 @@
1
+ export * from './sequelize-utils';
2
+ export * from './HookUtils';
@@ -0,0 +1,165 @@
1
+ 'use strict';
2
+ function _class_call_check(instance, Constructor) {
3
+ if (!(instance instanceof Constructor)) {
4
+ throw new TypeError("Cannot call a class as a function");
5
+ }
6
+ }
7
+ function _defineProperties(target, props) {
8
+ for(var i = 0; i < props.length; i++){
9
+ var descriptor = props[i];
10
+ descriptor.enumerable = descriptor.enumerable || false;
11
+ descriptor.configurable = true;
12
+ if ("value" in descriptor) descriptor.writable = true;
13
+ Object.defineProperty(target, descriptor.key, descriptor);
14
+ }
15
+ }
16
+ function _create_class(Constructor, protoProps, staticProps) {
17
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
18
+ if (staticProps) _defineProperties(Constructor, staticProps);
19
+ return Constructor;
20
+ }
21
+ function _define_property(obj, key, value) {
22
+ if (key in obj) {
23
+ Object.defineProperty(obj, key, {
24
+ value: value,
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true
28
+ });
29
+ } else {
30
+ obj[key] = value;
31
+ }
32
+ return obj;
33
+ }
34
+ function _object_spread(target) {
35
+ for(var i = 1; i < arguments.length; i++){
36
+ var source = arguments[i] != null ? arguments[i] : {};
37
+ var ownKeys = Object.keys(source);
38
+ if (typeof Object.getOwnPropertySymbols === "function") {
39
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
40
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
41
+ }));
42
+ }
43
+ ownKeys.forEach(function(key) {
44
+ _define_property(target, key, source[key]);
45
+ });
46
+ }
47
+ return target;
48
+ }
49
+ function _object_without_properties(source, excluded) {
50
+ if (source == null) return {};
51
+ var target = _object_without_properties_loose(source, excluded);
52
+ var key, i;
53
+ if (Object.getOwnPropertySymbols) {
54
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
55
+ for(i = 0; i < sourceSymbolKeys.length; i++){
56
+ key = sourceSymbolKeys[i];
57
+ if (excluded.indexOf(key) >= 0) continue;
58
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
59
+ target[key] = source[key];
60
+ }
61
+ }
62
+ return target;
63
+ }
64
+ function _object_without_properties_loose(source, excluded) {
65
+ if (source == null) return {};
66
+ var target = {};
67
+ var sourceKeys = Object.keys(source);
68
+ var key, i;
69
+ for(i = 0; i < sourceKeys.length; i++){
70
+ key = sourceKeys[i];
71
+ if (excluded.indexOf(key) >= 0) continue;
72
+ target[key] = source[key];
73
+ }
74
+ return target;
75
+ }
76
+ function _type_of(obj) {
77
+ "@swc/helpers - typeof";
78
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
79
+ }
80
+ var chunkETV4XYOV_cjs = require('../../../chunk-ETV4XYOV.cjs');
81
+ var sequelize = require('sequelize');
82
+ var UuidUtils = require('../../../shared/utils/UuidUtils');
83
+ var constants = require('../../../shared/constants');
84
+ var node = require('@powfix/uuid/node');
85
+ var _SequelizeUtils = /*#__PURE__*/ function() {
86
+ function _SequelizeUtils() {
87
+ _class_call_check(this, _SequelizeUtils);
88
+ }
89
+ _create_class(_SequelizeUtils, null, [
90
+ {
91
+ key: "decimal2Number",
92
+ value: function decimal2Number(value) {
93
+ if (value === null || value === void 0) {
94
+ return value;
95
+ }
96
+ var parsed = Number(value);
97
+ if (isNaN(parsed)) {
98
+ throw new Error("value(typeof=".concat(typeof value === "undefined" ? "undefined" : _type_of(value), ", value=").concat(value, ") iNaN(is not number)"));
99
+ }
100
+ return parsed;
101
+ }
102
+ },
103
+ {
104
+ key: "buildUuidColumn",
105
+ value: function buildUuidColumn(options) {
106
+ var columnName = options.columnName, overrideOptions = _object_without_properties(options, [
107
+ "columnName"
108
+ ]);
109
+ if (overrideOptions.allowNull) {
110
+ return _object_spread({
111
+ type: "binary(16)",
112
+ get: function get() {
113
+ var value = this.getDataValue(columnName);
114
+ return value != null ? node.UUID.from(value) : value;
115
+ },
116
+ set: function set(input) {
117
+ var value = input != null ? node.UUID.from(input).toBuffer() : input;
118
+ this.setDataValue(columnName, value);
119
+ }
120
+ }, overrideOptions);
121
+ } else {
122
+ return _object_spread({
123
+ type: "binary(16)",
124
+ get: function get() {
125
+ var value = this.getDataValue(columnName);
126
+ return node.UUID.from(value);
127
+ },
128
+ set: function set(input) {
129
+ var value = node.UUID.from(input).toBuffer();
130
+ this.setDataValue(columnName, value);
131
+ }
132
+ }, overrideOptions);
133
+ }
134
+ }
135
+ },
136
+ {
137
+ key: "getNullableArrayFilter",
138
+ value: function getNullableArrayFilter(arr) {
139
+ return _define_property({}, sequelize.Op.or, arr.map(function(value) {
140
+ if (value === null) {
141
+ return _define_property({}, sequelize.Op.is, value);
142
+ } else if (value === constants.NOT_NULL) {
143
+ return _define_property({}, sequelize.Op.not, null);
144
+ } else {
145
+ return _define_property({}, sequelize.Op.eq, value);
146
+ }
147
+ }));
148
+ }
149
+ }
150
+ ]);
151
+ return _SequelizeUtils;
152
+ }();
153
+ chunkETV4XYOV_cjs.__publicField(_SequelizeUtils, "buildPrimaryUuidColumn", function() {
154
+ return _object_spread({}, _SequelizeUtils.buildUuidColumn({
155
+ columnName: "uuid",
156
+ allowNull: false,
157
+ primaryKey: true,
158
+ unique: true,
159
+ defaultValue: function() {
160
+ return node.UUID.from(UuidUtils.UuidUtils.v4()).toBuffer();
161
+ }
162
+ }));
163
+ });
164
+ var SequelizeUtils = _SequelizeUtils;
165
+ exports.SequelizeUtils = SequelizeUtils;
@@ -0,0 +1,12 @@
1
+ import { ModelAttributeColumnOptions, WhereOptions } from 'sequelize';
2
+ import { Model, NonKnownUuidStringKeys, UuidColumnOptionsForModel, UuidColumnOptionsBase } from './types.js';
3
+
4
+ declare class SequelizeUtils {
5
+ static decimal2Number(value: any): number | null | undefined;
6
+ static buildPrimaryUuidColumn: () => Partial<ModelAttributeColumnOptions>;
7
+ static buildUuidColumn<T extends Model, AdditionalKeys extends NonKnownUuidStringKeys<T> = never>(options: UuidColumnOptionsForModel<T, AdditionalKeys>): Partial<ModelAttributeColumnOptions>;
8
+ static buildUuidColumn(options: UuidColumnOptionsBase): Partial<ModelAttributeColumnOptions>;
9
+ static getNullableArrayFilter<T = undefined>(arr: (null | any)[]): WhereOptions<T>;
10
+ }
11
+
12
+ export { SequelizeUtils };
@@ -0,0 +1,165 @@
1
+ function _class_call_check(instance, Constructor) {
2
+ if (!(instance instanceof Constructor)) {
3
+ throw new TypeError("Cannot call a class as a function");
4
+ }
5
+ }
6
+ function _defineProperties(target, props) {
7
+ for(var i = 0; i < props.length; i++){
8
+ var descriptor = props[i];
9
+ descriptor.enumerable = descriptor.enumerable || false;
10
+ descriptor.configurable = true;
11
+ if ("value" in descriptor) descriptor.writable = true;
12
+ Object.defineProperty(target, descriptor.key, descriptor);
13
+ }
14
+ }
15
+ function _create_class(Constructor, protoProps, staticProps) {
16
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
17
+ if (staticProps) _defineProperties(Constructor, staticProps);
18
+ return Constructor;
19
+ }
20
+ function _define_property(obj, key, value) {
21
+ if (key in obj) {
22
+ Object.defineProperty(obj, key, {
23
+ value: value,
24
+ enumerable: true,
25
+ configurable: true,
26
+ writable: true
27
+ });
28
+ } else {
29
+ obj[key] = value;
30
+ }
31
+ return obj;
32
+ }
33
+ function _object_spread(target) {
34
+ for(var i = 1; i < arguments.length; i++){
35
+ var source = arguments[i] != null ? arguments[i] : {};
36
+ var ownKeys = Object.keys(source);
37
+ if (typeof Object.getOwnPropertySymbols === "function") {
38
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
39
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
40
+ }));
41
+ }
42
+ ownKeys.forEach(function(key) {
43
+ _define_property(target, key, source[key]);
44
+ });
45
+ }
46
+ return target;
47
+ }
48
+ function _object_without_properties(source, excluded) {
49
+ if (source == null) return {};
50
+ var target = _object_without_properties_loose(source, excluded);
51
+ var key, i;
52
+ if (Object.getOwnPropertySymbols) {
53
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
54
+ for(i = 0; i < sourceSymbolKeys.length; i++){
55
+ key = sourceSymbolKeys[i];
56
+ if (excluded.indexOf(key) >= 0) continue;
57
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
58
+ target[key] = source[key];
59
+ }
60
+ }
61
+ return target;
62
+ }
63
+ function _object_without_properties_loose(source, excluded) {
64
+ if (source == null) return {};
65
+ var target = {};
66
+ var sourceKeys = Object.keys(source);
67
+ var key, i;
68
+ for(i = 0; i < sourceKeys.length; i++){
69
+ key = sourceKeys[i];
70
+ if (excluded.indexOf(key) >= 0) continue;
71
+ target[key] = source[key];
72
+ }
73
+ return target;
74
+ }
75
+ function _type_of(obj) {
76
+ "@swc/helpers - typeof";
77
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
78
+ }
79
+ import { __publicField } from '../../../chunk-PKBMQBKP.js';
80
+ import { Op } from 'sequelize';
81
+ import { UuidUtils } from '../../../shared/utils/UuidUtils';
82
+ import { NOT_NULL } from '../../../shared/constants';
83
+ import { UUID } from '@powfix/uuid/node';
84
+ var _SequelizeUtils = /*#__PURE__*/ function() {
85
+ "use strict";
86
+ function _SequelizeUtils() {
87
+ _class_call_check(this, _SequelizeUtils);
88
+ }
89
+ _create_class(_SequelizeUtils, null, [
90
+ {
91
+ key: "decimal2Number",
92
+ value: function decimal2Number(value) {
93
+ if (value === null || value === void 0) {
94
+ return value;
95
+ }
96
+ var parsed = Number(value);
97
+ if (isNaN(parsed)) {
98
+ throw new Error("value(typeof=".concat(typeof value === "undefined" ? "undefined" : _type_of(value), ", value=").concat(value, ") iNaN(is not number)"));
99
+ }
100
+ return parsed;
101
+ }
102
+ },
103
+ {
104
+ key: "buildUuidColumn",
105
+ value: function buildUuidColumn(options) {
106
+ var columnName = options.columnName, overrideOptions = _object_without_properties(options, [
107
+ "columnName"
108
+ ]);
109
+ if (overrideOptions.allowNull) {
110
+ return _object_spread({
111
+ type: "binary(16)",
112
+ get: function get() {
113
+ var value = this.getDataValue(columnName);
114
+ return value != null ? UUID.from(value) : value;
115
+ },
116
+ set: function set(input) {
117
+ var value = input != null ? UUID.from(input).toBuffer() : input;
118
+ this.setDataValue(columnName, value);
119
+ }
120
+ }, overrideOptions);
121
+ } else {
122
+ return _object_spread({
123
+ type: "binary(16)",
124
+ get: function get() {
125
+ var value = this.getDataValue(columnName);
126
+ return UUID.from(value);
127
+ },
128
+ set: function set(input) {
129
+ var value = UUID.from(input).toBuffer();
130
+ this.setDataValue(columnName, value);
131
+ }
132
+ }, overrideOptions);
133
+ }
134
+ }
135
+ },
136
+ {
137
+ key: "getNullableArrayFilter",
138
+ value: function getNullableArrayFilter(arr) {
139
+ return _define_property({}, Op.or, arr.map(function(value) {
140
+ if (value === null) {
141
+ return _define_property({}, Op.is, value);
142
+ } else if (value === NOT_NULL) {
143
+ return _define_property({}, Op.not, null);
144
+ } else {
145
+ return _define_property({}, Op.eq, value);
146
+ }
147
+ }));
148
+ }
149
+ }
150
+ ]);
151
+ return _SequelizeUtils;
152
+ }();
153
+ __publicField(_SequelizeUtils, "buildPrimaryUuidColumn", function() {
154
+ return _object_spread({}, _SequelizeUtils.buildUuidColumn({
155
+ columnName: "uuid",
156
+ allowNull: false,
157
+ primaryKey: true,
158
+ unique: true,
159
+ defaultValue: function() {
160
+ return UUID.from(UuidUtils.v4()).toBuffer();
161
+ }
162
+ }));
163
+ });
164
+ var SequelizeUtils = _SequelizeUtils;
165
+ export { SequelizeUtils };
@@ -0,0 +1,19 @@
1
+ 'use strict';
2
+ var SequelizeUtils = require('./SequelizeUtils');
3
+ var types = require('./types');
4
+ Object.keys(SequelizeUtils).forEach(function(k) {
5
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
6
+ enumerable: true,
7
+ get: function get() {
8
+ return SequelizeUtils[k];
9
+ }
10
+ });
11
+ });
12
+ Object.keys(types).forEach(function(k) {
13
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
14
+ enumerable: true,
15
+ get: function get() {
16
+ return types[k];
17
+ }
18
+ });
19
+ });
@@ -0,0 +1,3 @@
1
+ export { SequelizeUtils } from './SequelizeUtils.js';
2
+ export { ConcreteUuidKeys, ExtractStringKeys, ExtractUuidKeys, Model, NonKnownUuidStringKeys, UuidColumnOptionsBase, UuidColumnOptionsForModel } from './types.js';
3
+ import 'sequelize';
@@ -0,0 +1,2 @@
1
+ export * from './SequelizeUtils';
2
+ export * from './types';
@@ -0,0 +1 @@
1
+ 'use strict';
@@ -0,0 +1,19 @@
1
+ import { ModelAttributeColumnOptions } from 'sequelize';
2
+
3
+ type Model = Record<string, any> | undefined;
4
+ type ExtractUuidKeys<T extends Model> = {
5
+ [Property in keyof T]: Property extends `${string}Uuid` | 'uuid' ? Property : never;
6
+ }[keyof T];
7
+ type ExtractStringKeys<T extends Model> = {
8
+ [Property in keyof T]: string extends T[Property] ? Property : never;
9
+ }[keyof T];
10
+ type ConcreteUuidKeys<T extends Model> = ExtractUuidKeys<T>;
11
+ type NonKnownUuidStringKeys<T extends Model> = Exclude<ExtractStringKeys<T>, ConcreteUuidKeys<T>> & string;
12
+ interface UuidColumnOptionsBase extends Omit<ModelAttributeColumnOptions, 'type'> {
13
+ columnName: string;
14
+ }
15
+ interface UuidColumnOptionsForModel<T extends Model, AdditionalKeys extends string> extends Omit<ModelAttributeColumnOptions, 'type'> {
16
+ columnName: ConcreteUuidKeys<T> | AdditionalKeys;
17
+ }
18
+
19
+ export type { ConcreteUuidKeys, ExtractStringKeys, ExtractUuidKeys, Model, NonKnownUuidStringKeys, UuidColumnOptionsBase, UuidColumnOptionsForModel };
File without changes
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+ function _class_call_check(instance, Constructor) {
3
+ if (!(instance instanceof Constructor)) {
4
+ throw new TypeError("Cannot call a class as a function");
5
+ }
6
+ }
7
+ var chunkETV4XYOV_cjs = require('../../chunk-ETV4XYOV.cjs');
8
+ var COORDINATE = function COORDINATE() {
9
+ _class_call_check(this, COORDINATE);
10
+ };
11
+ chunkETV4XYOV_cjs.__publicField(COORDINATE, "LATITUDE_MIN_LENGTH", 1);
12
+ chunkETV4XYOV_cjs.__publicField(COORDINATE, "LATITUDE_MAX_LENGTH", 10);
13
+ chunkETV4XYOV_cjs.__publicField(COORDINATE, "LONGITUDE_MIN_LENGTH", 1);
14
+ chunkETV4XYOV_cjs.__publicField(COORDINATE, "LONGITUDE_MAX_LENGTH", 11);
15
+ exports.COORDINATE = COORDINATE;
@@ -0,0 +1,9 @@
1
+ declare class COORDINATE {
2
+ static LATITUDE_MIN_LENGTH: number;
3
+ static LATITUDE_MAX_LENGTH: number;
4
+ static LONGITUDE_MIN_LENGTH: number;
5
+ static LONGITUDE_MAX_LENGTH: number;
6
+ }
7
+ declare namespace COORDINATE { }
8
+
9
+ export { COORDINATE };
@@ -0,0 +1,15 @@
1
+ function _class_call_check(instance, Constructor) {
2
+ if (!(instance instanceof Constructor)) {
3
+ throw new TypeError("Cannot call a class as a function");
4
+ }
5
+ }
6
+ import { __publicField } from '../../chunk-PKBMQBKP.js';
7
+ var COORDINATE = function COORDINATE() {
8
+ "use strict";
9
+ _class_call_check(this, COORDINATE);
10
+ };
11
+ __publicField(COORDINATE, "LATITUDE_MIN_LENGTH", 1);
12
+ __publicField(COORDINATE, "LATITUDE_MAX_LENGTH", 10);
13
+ __publicField(COORDINATE, "LONGITUDE_MIN_LENGTH", 1);
14
+ __publicField(COORDINATE, "LONGITUDE_MAX_LENGTH", 11);
15
+ export { COORDINATE };