@powfix/core-js 0.22.1 → 0.23.0

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 +15 -1831
  7. package/dist/index.browser.d.ts +57 -484
  8. package/dist/index.browser.js +2 -1773
  9. package/dist/index.cjs +7 -1832
  10. package/dist/index.d.ts +52 -1
  11. package/dist/index.js +1 -1773
  12. package/dist/index.node.cjs +13 -76631
  13. package/dist/index.node.d.ts +77 -164
  14. package/dist/index.node.js +2 -76578
  15. package/dist/nodejs/constants/TransactionManagerLogLevel.cjs +11 -0
  16. package/dist/nodejs/constants/TransactionManagerLogLevel.d.ts +9 -0
  17. package/dist/nodejs/constants/TransactionManagerLogLevel.js +10 -0
  18. package/dist/nodejs/constants/TransactionManagerTimeoutAction.cjs +8 -0
  19. package/dist/nodejs/constants/TransactionManagerTimeoutAction.d.ts +6 -0
  20. package/dist/nodejs/constants/TransactionManagerTimeoutAction.js +7 -0
  21. package/dist/nodejs/constants/index.cjs +19 -0
  22. package/dist/nodejs/constants/index.d.ts +2 -0
  23. package/dist/nodejs/constants/index.js +2 -0
  24. package/dist/nodejs/index.cjs +55 -0
  25. package/dist/nodejs/index.d.ts +25 -0
  26. package/dist/nodejs/index.js +6 -0
  27. package/dist/nodejs/interfaces/db/index.cjs +10 -0
  28. package/dist/nodejs/interfaces/db/index.d.ts +10 -0
  29. package/dist/nodejs/interfaces/db/index.js +1 -0
  30. package/dist/nodejs/interfaces/db/sequelize/Hook.cjs +1 -0
  31. package/dist/nodejs/interfaces/db/sequelize/Hook.d.ts +13 -0
  32. package/dist/nodejs/interfaces/db/sequelize/Hook.js +0 -0
  33. package/dist/nodejs/interfaces/db/sequelize/HookFn.cjs +1 -0
  34. package/dist/nodejs/interfaces/db/sequelize/HookFn.d.ts +7 -0
  35. package/dist/nodejs/interfaces/db/sequelize/HookFn.js +0 -0
  36. package/dist/nodejs/interfaces/db/sequelize/HookType.cjs +1 -0
  37. package/dist/nodejs/interfaces/db/sequelize/HookType.d.ts +6 -0
  38. package/dist/nodejs/interfaces/db/sequelize/HookType.js +0 -0
  39. package/dist/nodejs/interfaces/db/sequelize/ReloadOption.cjs +1 -0
  40. package/dist/nodejs/interfaces/db/sequelize/ReloadOption.d.ts +5 -0
  41. package/dist/nodejs/interfaces/db/sequelize/ReloadOption.js +0 -0
  42. package/dist/nodejs/interfaces/db/sequelize/TransactionOption.cjs +1 -0
  43. package/dist/nodejs/interfaces/db/sequelize/TransactionOption.d.ts +7 -0
  44. package/dist/nodejs/interfaces/db/sequelize/TransactionOption.js +0 -0
  45. package/dist/nodejs/interfaces/db/sequelize/UpsertOptions.cjs +1 -0
  46. package/dist/nodejs/interfaces/db/sequelize/UpsertOptions.d.ts +8 -0
  47. package/dist/nodejs/interfaces/db/sequelize/UpsertOptions.js +0 -0
  48. package/dist/nodejs/interfaces/db/sequelize/index.cjs +55 -0
  49. package/dist/nodejs/interfaces/db/sequelize/index.d.ts +10 -0
  50. package/dist/nodejs/interfaces/db/sequelize/index.js +6 -0
  51. package/dist/nodejs/interfaces/index.cjs +10 -0
  52. package/dist/nodejs/interfaces/index.d.ts +10 -0
  53. package/dist/nodejs/interfaces/index.js +1 -0
  54. package/dist/nodejs/managers/TransactionManager.cjs +463 -0
  55. package/dist/nodejs/managers/TransactionManager.d.ts +31 -0
  56. package/dist/nodejs/managers/TransactionManager.js +457 -0
  57. package/dist/nodejs/managers/TransactionManager.types.cjs +1 -0
  58. package/dist/nodejs/managers/TransactionManager.types.d.ts +12 -0
  59. package/dist/nodejs/managers/TransactionManager.types.js +0 -0
  60. package/dist/nodejs/managers/index.cjs +19 -0
  61. package/dist/nodejs/managers/index.d.ts +6 -0
  62. package/dist/nodejs/managers/index.js +2 -0
  63. package/dist/nodejs/services/index.cjs +10 -0
  64. package/dist/nodejs/services/index.d.ts +5 -0
  65. package/dist/nodejs/services/index.js +1 -0
  66. package/dist/nodejs/services/redis/RedisClient.cjs +250 -0
  67. package/dist/nodejs/services/redis/RedisClient.d.ts +24 -0
  68. package/dist/nodejs/services/redis/RedisClient.js +250 -0
  69. package/dist/nodejs/services/redis/RedisPublisher.cjs +323 -0
  70. package/dist/nodejs/services/redis/RedisPublisher.d.ts +17 -0
  71. package/dist/nodejs/services/redis/RedisPublisher.js +323 -0
  72. package/dist/nodejs/services/redis/RedisSubscriber.cjs +502 -0
  73. package/dist/nodejs/services/redis/RedisSubscriber.d.ts +15 -0
  74. package/dist/nodejs/services/redis/RedisSubscriber.js +502 -0
  75. package/dist/nodejs/services/redis/index.cjs +28 -0
  76. package/dist/nodejs/services/redis/index.d.ts +5 -0
  77. package/dist/nodejs/services/redis/index.js +3 -0
  78. package/dist/nodejs/types/UpsertResult.cjs +1 -0
  79. package/dist/nodejs/types/UpsertResult.d.ts +5 -0
  80. package/dist/nodejs/types/UpsertResult.js +0 -0
  81. package/dist/nodejs/types/index.cjs +19 -0
  82. package/dist/nodejs/types/index.d.ts +9 -0
  83. package/dist/nodejs/types/index.js +2 -0
  84. package/dist/nodejs/types/mariaDb.cjs +1 -0
  85. package/dist/nodejs/types/mariaDb.d.ts +15 -0
  86. package/dist/nodejs/types/mariaDb.js +0 -0
  87. package/dist/nodejs/utils/HookUtils.cjs +87 -0
  88. package/dist/nodejs/utils/HookUtils.d.ts +20 -0
  89. package/dist/nodejs/utils/HookUtils.js +87 -0
  90. package/dist/nodejs/utils/index.cjs +19 -0
  91. package/dist/nodejs/utils/index.d.ts +10 -0
  92. package/dist/nodejs/utils/index.js +2 -0
  93. package/dist/nodejs/utils/sequelize-utils/SequelizeUtils.cjs +165 -0
  94. package/dist/nodejs/utils/sequelize-utils/SequelizeUtils.d.ts +12 -0
  95. package/dist/nodejs/utils/sequelize-utils/SequelizeUtils.js +165 -0
  96. package/dist/nodejs/utils/sequelize-utils/index.cjs +19 -0
  97. package/dist/nodejs/utils/sequelize-utils/index.d.ts +3 -0
  98. package/dist/nodejs/utils/sequelize-utils/index.js +2 -0
  99. package/dist/nodejs/utils/sequelize-utils/types.cjs +1 -0
  100. package/dist/nodejs/utils/sequelize-utils/types.d.ts +19 -0
  101. package/dist/nodejs/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 -10
  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,323 @@
1
+ 'use strict';
2
+ function _assert_this_initialized(self) {
3
+ if (self === void 0) {
4
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5
+ }
6
+ return self;
7
+ }
8
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
9
+ try {
10
+ var info = gen[key](arg);
11
+ var value = info.value;
12
+ } catch (error) {
13
+ reject(error);
14
+ return;
15
+ }
16
+ if (info.done) {
17
+ resolve(value);
18
+ } else {
19
+ Promise.resolve(value).then(_next, _throw);
20
+ }
21
+ }
22
+ function _async_to_generator(fn) {
23
+ return function() {
24
+ var self = this, args = arguments;
25
+ return new Promise(function(resolve, reject) {
26
+ var gen = fn.apply(self, args);
27
+ function _next(value) {
28
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
29
+ }
30
+ function _throw(err) {
31
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
32
+ }
33
+ _next(undefined);
34
+ });
35
+ };
36
+ }
37
+ function _call_super(_this, derived, args) {
38
+ derived = _get_prototype_of(derived);
39
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
40
+ }
41
+ function _class_call_check(instance, Constructor) {
42
+ if (!(instance instanceof Constructor)) {
43
+ throw new TypeError("Cannot call a class as a function");
44
+ }
45
+ }
46
+ function _defineProperties(target, props) {
47
+ for(var i = 0; i < props.length; i++){
48
+ var descriptor = props[i];
49
+ descriptor.enumerable = descriptor.enumerable || false;
50
+ descriptor.configurable = true;
51
+ if ("value" in descriptor) descriptor.writable = true;
52
+ Object.defineProperty(target, descriptor.key, descriptor);
53
+ }
54
+ }
55
+ function _create_class(Constructor, protoProps, staticProps) {
56
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
57
+ if (staticProps) _defineProperties(Constructor, staticProps);
58
+ return Constructor;
59
+ }
60
+ function _get(target, property, receiver) {
61
+ if (typeof Reflect !== "undefined" && Reflect.get) {
62
+ _get = Reflect.get;
63
+ } else {
64
+ _get = function get(target, property, receiver) {
65
+ var base = _super_prop_base(target, property);
66
+ if (!base) return;
67
+ var desc = Object.getOwnPropertyDescriptor(base, property);
68
+ if (desc.get) {
69
+ return desc.get.call(receiver || target);
70
+ }
71
+ return desc.value;
72
+ };
73
+ }
74
+ return _get(target, property, receiver || target);
75
+ }
76
+ function _get_prototype_of(o) {
77
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
78
+ return o.__proto__ || Object.getPrototypeOf(o);
79
+ };
80
+ return _get_prototype_of(o);
81
+ }
82
+ function _inherits(subClass, superClass) {
83
+ if (typeof superClass !== "function" && superClass !== null) {
84
+ throw new TypeError("Super expression must either be null or a function");
85
+ }
86
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
87
+ constructor: {
88
+ value: subClass,
89
+ writable: true,
90
+ configurable: true
91
+ }
92
+ });
93
+ if (superClass) _set_prototype_of(subClass, superClass);
94
+ }
95
+ function _possible_constructor_return(self, call) {
96
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
97
+ return call;
98
+ }
99
+ return _assert_this_initialized(self);
100
+ }
101
+ function _set_prototype_of(o, p) {
102
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
103
+ o.__proto__ = p;
104
+ return o;
105
+ };
106
+ return _set_prototype_of(o, p);
107
+ }
108
+ function _super_prop_base(object, property) {
109
+ while(!Object.prototype.hasOwnProperty.call(object, property)){
110
+ object = _get_prototype_of(object);
111
+ if (object === null) break;
112
+ }
113
+ return object;
114
+ }
115
+ function _type_of(obj) {
116
+ "@swc/helpers - typeof";
117
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
118
+ }
119
+ function _is_native_reflect_construct() {
120
+ try {
121
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
122
+ } catch (_) {}
123
+ return (_is_native_reflect_construct = function() {
124
+ return !!result;
125
+ })();
126
+ }
127
+ function _ts_generator(thisArg, body) {
128
+ var f, y, t, _ = {
129
+ label: 0,
130
+ sent: function() {
131
+ if (t[0] & 1) throw t[1];
132
+ return t[1];
133
+ },
134
+ trys: [],
135
+ ops: []
136
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
137
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
138
+ return this;
139
+ }), g;
140
+ function verb(n) {
141
+ return function(v) {
142
+ return step([
143
+ n,
144
+ v
145
+ ]);
146
+ };
147
+ }
148
+ function step(op) {
149
+ if (f) throw new TypeError("Generator is already executing.");
150
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
151
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
152
+ if (y = 0, t) op = [
153
+ op[0] & 2,
154
+ t.value
155
+ ];
156
+ switch(op[0]){
157
+ case 0:
158
+ case 1:
159
+ t = op;
160
+ break;
161
+ case 4:
162
+ _.label++;
163
+ return {
164
+ value: op[1],
165
+ done: false
166
+ };
167
+ case 5:
168
+ _.label++;
169
+ y = op[1];
170
+ op = [
171
+ 0
172
+ ];
173
+ continue;
174
+ case 7:
175
+ op = _.ops.pop();
176
+ _.trys.pop();
177
+ continue;
178
+ default:
179
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
180
+ _ = 0;
181
+ continue;
182
+ }
183
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
184
+ _.label = op[1];
185
+ break;
186
+ }
187
+ if (op[0] === 6 && _.label < t[1]) {
188
+ _.label = t[1];
189
+ t = op;
190
+ break;
191
+ }
192
+ if (t && _.label < t[2]) {
193
+ _.label = t[2];
194
+ _.ops.push(op);
195
+ break;
196
+ }
197
+ if (t[2]) _.ops.pop();
198
+ _.trys.pop();
199
+ continue;
200
+ }
201
+ op = body.call(thisArg, _);
202
+ } catch (e) {
203
+ op = [
204
+ 6,
205
+ e
206
+ ];
207
+ y = 0;
208
+ } finally{
209
+ f = t = 0;
210
+ }
211
+ if (op[0] & 5) throw op[1];
212
+ return {
213
+ value: op[0] ? op[1] : void 0,
214
+ done: true
215
+ };
216
+ }
217
+ }
218
+ var chunkETV4XYOV_cjs = require('../../../chunk-ETV4XYOV.cjs');
219
+ var RedisClient = require('./RedisClient');
220
+ var LOG_TAG = "[REDIS-PUB]";
221
+ var RedisPublisher = /*#__PURE__*/ function(_RedisClient_RedisClient) {
222
+ _inherits(RedisPublisher, _RedisClient_RedisClient);
223
+ function RedisPublisher(options) {
224
+ _class_call_check(this, RedisPublisher);
225
+ var _this;
226
+ _this = _call_super(this, RedisPublisher, [
227
+ options
228
+ ]);
229
+ chunkETV4XYOV_cjs.__publicField(_this, "logging", "length");
230
+ console.log(Date.now(), "RedisPublisher", "initialized");
231
+ return _this;
232
+ }
233
+ _create_class(RedisPublisher, [
234
+ {
235
+ key: "start",
236
+ value: function start() {
237
+ var _this = this;
238
+ var _this1 = this, _superprop_get_start = function() {
239
+ return _get(_get_prototype_of(RedisPublisher.prototype), "start", _this);
240
+ };
241
+ return _async_to_generator(function() {
242
+ return _ts_generator(this, function(_state) {
243
+ return [
244
+ 2,
245
+ _superprop_get_start().call(_this1)
246
+ ];
247
+ });
248
+ })();
249
+ }
250
+ },
251
+ {
252
+ key: "stop",
253
+ value: function stop() {
254
+ var _this = this;
255
+ var _this1 = this, _superprop_get_stop = function() {
256
+ return _get(_get_prototype_of(RedisPublisher.prototype), "stop", _this);
257
+ };
258
+ return _async_to_generator(function() {
259
+ return _ts_generator(this, function(_state) {
260
+ return [
261
+ 2,
262
+ _superprop_get_stop().call(_this1)
263
+ ];
264
+ });
265
+ })();
266
+ }
267
+ },
268
+ {
269
+ key: "setLogging",
270
+ value: function setLogging(logging) {
271
+ this.logging = logging;
272
+ }
273
+ },
274
+ {
275
+ key: "getLogging",
276
+ value: function getLogging() {
277
+ return this.logging;
278
+ }
279
+ },
280
+ {
281
+ key: "publish",
282
+ value: // Make public method
283
+ function publish(channel, data) {
284
+ return _async_to_generator(function() {
285
+ var stringifyData;
286
+ return _ts_generator(this, function(_state) {
287
+ switch(_state.label){
288
+ case 0:
289
+ stringifyData = typeof data !== "string" ? JSON.stringify(data) : data;
290
+ switch(this.logging){
291
+ case "none":
292
+ {
293
+ break;
294
+ }
295
+ case "length":
296
+ {
297
+ console.log(/* @__PURE__ */ new Date().toISOString(), LOG_TAG, channel, "[len=".concat(stringifyData.length, "]"));
298
+ break;
299
+ }
300
+ case "data":
301
+ {
302
+ console.log(/* @__PURE__ */ new Date().toISOString(), LOG_TAG, channel, stringifyData);
303
+ break;
304
+ }
305
+ }
306
+ return [
307
+ 4,
308
+ this.client.publish(channel, stringifyData)
309
+ ];
310
+ case 1:
311
+ _state.sent();
312
+ return [
313
+ 2
314
+ ];
315
+ }
316
+ });
317
+ }).call(this);
318
+ }
319
+ }
320
+ ]);
321
+ return RedisPublisher;
322
+ }(RedisClient.RedisClient);
323
+ exports.RedisPublisher = RedisPublisher;
@@ -0,0 +1,17 @@
1
+ import { RedisClient } from './RedisClient.js';
2
+ import 'redis';
3
+
4
+ declare class RedisPublisher extends RedisClient {
5
+ private logging;
6
+ constructor(options?: RedisClient.RedisClientOptions);
7
+ start(): Promise<RedisClient.Status>;
8
+ stop(): Promise<RedisClient.Status>;
9
+ setLogging(logging: RedisPublisher.LOGGING): void;
10
+ getLogging(): RedisPublisher.LOGGING;
11
+ publish(channel: string, data: string | object): Promise<void>;
12
+ }
13
+ declare namespace RedisPublisher {
14
+ type LOGGING = 'none' | 'length' | 'data';
15
+ }
16
+
17
+ export { RedisPublisher };
@@ -0,0 +1,323 @@
1
+ function _assert_this_initialized(self) {
2
+ if (self === void 0) {
3
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
+ }
5
+ return self;
6
+ }
7
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
8
+ try {
9
+ var info = gen[key](arg);
10
+ var value = info.value;
11
+ } catch (error) {
12
+ reject(error);
13
+ return;
14
+ }
15
+ if (info.done) {
16
+ resolve(value);
17
+ } else {
18
+ Promise.resolve(value).then(_next, _throw);
19
+ }
20
+ }
21
+ function _async_to_generator(fn) {
22
+ return function() {
23
+ var self = this, args = arguments;
24
+ return new Promise(function(resolve, reject) {
25
+ var gen = fn.apply(self, args);
26
+ function _next(value) {
27
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
28
+ }
29
+ function _throw(err) {
30
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
31
+ }
32
+ _next(undefined);
33
+ });
34
+ };
35
+ }
36
+ function _call_super(_this, derived, args) {
37
+ derived = _get_prototype_of(derived);
38
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
39
+ }
40
+ function _class_call_check(instance, Constructor) {
41
+ if (!(instance instanceof Constructor)) {
42
+ throw new TypeError("Cannot call a class as a function");
43
+ }
44
+ }
45
+ function _defineProperties(target, props) {
46
+ for(var i = 0; i < props.length; i++){
47
+ var descriptor = props[i];
48
+ descriptor.enumerable = descriptor.enumerable || false;
49
+ descriptor.configurable = true;
50
+ if ("value" in descriptor) descriptor.writable = true;
51
+ Object.defineProperty(target, descriptor.key, descriptor);
52
+ }
53
+ }
54
+ function _create_class(Constructor, protoProps, staticProps) {
55
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
56
+ if (staticProps) _defineProperties(Constructor, staticProps);
57
+ return Constructor;
58
+ }
59
+ function _get(target, property, receiver) {
60
+ if (typeof Reflect !== "undefined" && Reflect.get) {
61
+ _get = Reflect.get;
62
+ } else {
63
+ _get = function get(target, property, receiver) {
64
+ var base = _super_prop_base(target, property);
65
+ if (!base) return;
66
+ var desc = Object.getOwnPropertyDescriptor(base, property);
67
+ if (desc.get) {
68
+ return desc.get.call(receiver || target);
69
+ }
70
+ return desc.value;
71
+ };
72
+ }
73
+ return _get(target, property, receiver || target);
74
+ }
75
+ function _get_prototype_of(o) {
76
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
77
+ return o.__proto__ || Object.getPrototypeOf(o);
78
+ };
79
+ return _get_prototype_of(o);
80
+ }
81
+ function _inherits(subClass, superClass) {
82
+ if (typeof superClass !== "function" && superClass !== null) {
83
+ throw new TypeError("Super expression must either be null or a function");
84
+ }
85
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
86
+ constructor: {
87
+ value: subClass,
88
+ writable: true,
89
+ configurable: true
90
+ }
91
+ });
92
+ if (superClass) _set_prototype_of(subClass, superClass);
93
+ }
94
+ function _possible_constructor_return(self, call) {
95
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
96
+ return call;
97
+ }
98
+ return _assert_this_initialized(self);
99
+ }
100
+ function _set_prototype_of(o, p) {
101
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
102
+ o.__proto__ = p;
103
+ return o;
104
+ };
105
+ return _set_prototype_of(o, p);
106
+ }
107
+ function _super_prop_base(object, property) {
108
+ while(!Object.prototype.hasOwnProperty.call(object, property)){
109
+ object = _get_prototype_of(object);
110
+ if (object === null) break;
111
+ }
112
+ return object;
113
+ }
114
+ function _type_of(obj) {
115
+ "@swc/helpers - typeof";
116
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
117
+ }
118
+ function _is_native_reflect_construct() {
119
+ try {
120
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
121
+ } catch (_) {}
122
+ return (_is_native_reflect_construct = function() {
123
+ return !!result;
124
+ })();
125
+ }
126
+ function _ts_generator(thisArg, body) {
127
+ var f, y, t, _ = {
128
+ label: 0,
129
+ sent: function() {
130
+ if (t[0] & 1) throw t[1];
131
+ return t[1];
132
+ },
133
+ trys: [],
134
+ ops: []
135
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
136
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
137
+ return this;
138
+ }), g;
139
+ function verb(n) {
140
+ return function(v) {
141
+ return step([
142
+ n,
143
+ v
144
+ ]);
145
+ };
146
+ }
147
+ function step(op) {
148
+ if (f) throw new TypeError("Generator is already executing.");
149
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
150
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
151
+ if (y = 0, t) op = [
152
+ op[0] & 2,
153
+ t.value
154
+ ];
155
+ switch(op[0]){
156
+ case 0:
157
+ case 1:
158
+ t = op;
159
+ break;
160
+ case 4:
161
+ _.label++;
162
+ return {
163
+ value: op[1],
164
+ done: false
165
+ };
166
+ case 5:
167
+ _.label++;
168
+ y = op[1];
169
+ op = [
170
+ 0
171
+ ];
172
+ continue;
173
+ case 7:
174
+ op = _.ops.pop();
175
+ _.trys.pop();
176
+ continue;
177
+ default:
178
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
179
+ _ = 0;
180
+ continue;
181
+ }
182
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
183
+ _.label = op[1];
184
+ break;
185
+ }
186
+ if (op[0] === 6 && _.label < t[1]) {
187
+ _.label = t[1];
188
+ t = op;
189
+ break;
190
+ }
191
+ if (t && _.label < t[2]) {
192
+ _.label = t[2];
193
+ _.ops.push(op);
194
+ break;
195
+ }
196
+ if (t[2]) _.ops.pop();
197
+ _.trys.pop();
198
+ continue;
199
+ }
200
+ op = body.call(thisArg, _);
201
+ } catch (e) {
202
+ op = [
203
+ 6,
204
+ e
205
+ ];
206
+ y = 0;
207
+ } finally{
208
+ f = t = 0;
209
+ }
210
+ if (op[0] & 5) throw op[1];
211
+ return {
212
+ value: op[0] ? op[1] : void 0,
213
+ done: true
214
+ };
215
+ }
216
+ }
217
+ import { __publicField } from '../../../chunk-PKBMQBKP.js';
218
+ import { RedisClient } from './RedisClient';
219
+ var LOG_TAG = "[REDIS-PUB]";
220
+ var RedisPublisher = /*#__PURE__*/ function(RedisClient) {
221
+ "use strict";
222
+ _inherits(RedisPublisher, RedisClient);
223
+ function RedisPublisher(options) {
224
+ _class_call_check(this, RedisPublisher);
225
+ var _this;
226
+ _this = _call_super(this, RedisPublisher, [
227
+ options
228
+ ]);
229
+ __publicField(_this, "logging", "length");
230
+ console.log(Date.now(), "RedisPublisher", "initialized");
231
+ return _this;
232
+ }
233
+ _create_class(RedisPublisher, [
234
+ {
235
+ key: "start",
236
+ value: function start() {
237
+ var _this = this;
238
+ var _this1 = this, _superprop_get_start = function() {
239
+ return _get(_get_prototype_of(RedisPublisher.prototype), "start", _this);
240
+ };
241
+ return _async_to_generator(function() {
242
+ return _ts_generator(this, function(_state) {
243
+ return [
244
+ 2,
245
+ _superprop_get_start().call(_this1)
246
+ ];
247
+ });
248
+ })();
249
+ }
250
+ },
251
+ {
252
+ key: "stop",
253
+ value: function stop() {
254
+ var _this = this;
255
+ var _this1 = this, _superprop_get_stop = function() {
256
+ return _get(_get_prototype_of(RedisPublisher.prototype), "stop", _this);
257
+ };
258
+ return _async_to_generator(function() {
259
+ return _ts_generator(this, function(_state) {
260
+ return [
261
+ 2,
262
+ _superprop_get_stop().call(_this1)
263
+ ];
264
+ });
265
+ })();
266
+ }
267
+ },
268
+ {
269
+ key: "setLogging",
270
+ value: function setLogging(logging) {
271
+ this.logging = logging;
272
+ }
273
+ },
274
+ {
275
+ key: "getLogging",
276
+ value: function getLogging() {
277
+ return this.logging;
278
+ }
279
+ },
280
+ {
281
+ key: "publish",
282
+ value: // Make public method
283
+ function publish(channel, data) {
284
+ return _async_to_generator(function() {
285
+ var stringifyData;
286
+ return _ts_generator(this, function(_state) {
287
+ switch(_state.label){
288
+ case 0:
289
+ stringifyData = typeof data !== "string" ? JSON.stringify(data) : data;
290
+ switch(this.logging){
291
+ case "none":
292
+ {
293
+ break;
294
+ }
295
+ case "length":
296
+ {
297
+ console.log(/* @__PURE__ */ new Date().toISOString(), LOG_TAG, channel, "[len=".concat(stringifyData.length, "]"));
298
+ break;
299
+ }
300
+ case "data":
301
+ {
302
+ console.log(/* @__PURE__ */ new Date().toISOString(), LOG_TAG, channel, stringifyData);
303
+ break;
304
+ }
305
+ }
306
+ return [
307
+ 4,
308
+ this.client.publish(channel, stringifyData)
309
+ ];
310
+ case 1:
311
+ _state.sent();
312
+ return [
313
+ 2
314
+ ];
315
+ }
316
+ });
317
+ }).call(this);
318
+ }
319
+ }
320
+ ]);
321
+ return RedisPublisher;
322
+ }(RedisClient);
323
+ export { RedisPublisher };