@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.
- package/dist/browser/index.cjs +1 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.js +0 -0
- package/dist/chunk-ETV4XYOV.cjs +18 -0
- package/dist/chunk-PKBMQBKP.js +17 -0
- package/dist/index.browser.cjs +16 -1726
- package/dist/index.browser.d.ts +57 -484
- package/dist/index.browser.js +2 -1644
- package/dist/index.cjs +8 -1727
- package/dist/index.d.ts +52 -1
- package/dist/index.js +1 -1644
- package/dist/index.node.cjs +15 -2123
- package/dist/index.node.d.ts +77 -164
- package/dist/index.node.js +2 -2034
- package/dist/node/constants/TransactionManagerLogLevel.cjs +11 -0
- package/dist/node/constants/TransactionManagerLogLevel.d.ts +9 -0
- package/dist/node/constants/TransactionManagerLogLevel.js +10 -0
- package/dist/node/constants/TransactionManagerTimeoutAction.cjs +8 -0
- package/dist/node/constants/TransactionManagerTimeoutAction.d.ts +6 -0
- package/dist/node/constants/TransactionManagerTimeoutAction.js +7 -0
- package/dist/node/constants/index.cjs +19 -0
- package/dist/node/constants/index.d.ts +2 -0
- package/dist/node/constants/index.js +2 -0
- package/dist/node/index.cjs +55 -0
- package/dist/node/index.d.ts +25 -0
- package/dist/node/index.js +6 -0
- package/dist/node/interfaces/db/index.cjs +10 -0
- package/dist/node/interfaces/db/index.d.ts +10 -0
- package/dist/node/interfaces/db/index.js +1 -0
- package/dist/node/interfaces/db/sequelize/Hook.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/Hook.d.ts +13 -0
- package/dist/node/interfaces/db/sequelize/Hook.js +0 -0
- package/dist/node/interfaces/db/sequelize/HookFn.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/HookFn.d.ts +7 -0
- package/dist/node/interfaces/db/sequelize/HookFn.js +0 -0
- package/dist/node/interfaces/db/sequelize/HookType.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/HookType.d.ts +6 -0
- package/dist/node/interfaces/db/sequelize/HookType.js +0 -0
- package/dist/node/interfaces/db/sequelize/ReloadOption.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/ReloadOption.d.ts +5 -0
- package/dist/node/interfaces/db/sequelize/ReloadOption.js +0 -0
- package/dist/node/interfaces/db/sequelize/TransactionOption.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/TransactionOption.d.ts +7 -0
- package/dist/node/interfaces/db/sequelize/TransactionOption.js +0 -0
- package/dist/node/interfaces/db/sequelize/UpsertOptions.cjs +1 -0
- package/dist/node/interfaces/db/sequelize/UpsertOptions.d.ts +8 -0
- package/dist/node/interfaces/db/sequelize/UpsertOptions.js +0 -0
- package/dist/node/interfaces/db/sequelize/index.cjs +55 -0
- package/dist/node/interfaces/db/sequelize/index.d.ts +10 -0
- package/dist/node/interfaces/db/sequelize/index.js +6 -0
- package/dist/node/interfaces/index.cjs +10 -0
- package/dist/node/interfaces/index.d.ts +10 -0
- package/dist/node/interfaces/index.js +1 -0
- package/dist/node/managers/TransactionManager.cjs +463 -0
- package/dist/node/managers/TransactionManager.d.ts +31 -0
- package/dist/node/managers/TransactionManager.js +457 -0
- package/dist/node/managers/TransactionManager.types.cjs +1 -0
- package/dist/node/managers/TransactionManager.types.d.ts +12 -0
- package/dist/node/managers/TransactionManager.types.js +0 -0
- package/dist/node/managers/index.cjs +19 -0
- package/dist/node/managers/index.d.ts +6 -0
- package/dist/node/managers/index.js +2 -0
- package/dist/node/services/index.cjs +10 -0
- package/dist/node/services/index.d.ts +5 -0
- package/dist/node/services/index.js +1 -0
- package/dist/node/services/redis/RedisClient.cjs +250 -0
- package/dist/node/services/redis/RedisClient.d.ts +24 -0
- package/dist/node/services/redis/RedisClient.js +250 -0
- package/dist/node/services/redis/RedisPublisher.cjs +323 -0
- package/dist/node/services/redis/RedisPublisher.d.ts +17 -0
- package/dist/node/services/redis/RedisPublisher.js +323 -0
- package/dist/node/services/redis/RedisSubscriber.cjs +502 -0
- package/dist/node/services/redis/RedisSubscriber.d.ts +15 -0
- package/dist/node/services/redis/RedisSubscriber.js +502 -0
- package/dist/node/services/redis/index.cjs +28 -0
- package/dist/node/services/redis/index.d.ts +5 -0
- package/dist/node/services/redis/index.js +3 -0
- package/dist/node/types/UpsertResult.cjs +1 -0
- package/dist/node/types/UpsertResult.d.ts +5 -0
- package/dist/node/types/UpsertResult.js +0 -0
- package/dist/node/types/index.cjs +19 -0
- package/dist/node/types/index.d.ts +9 -0
- package/dist/node/types/index.js +2 -0
- package/dist/node/types/mariaDb.cjs +1 -0
- package/dist/node/types/mariaDb.d.ts +15 -0
- package/dist/node/types/mariaDb.js +0 -0
- package/dist/node/utils/HookUtils.cjs +87 -0
- package/dist/node/utils/HookUtils.d.ts +20 -0
- package/dist/node/utils/HookUtils.js +87 -0
- package/dist/node/utils/index.cjs +19 -0
- package/dist/node/utils/index.d.ts +10 -0
- package/dist/node/utils/index.js +2 -0
- package/dist/node/utils/sequelize-utils/SequelizeUtils.cjs +165 -0
- package/dist/node/utils/sequelize-utils/SequelizeUtils.d.ts +12 -0
- package/dist/node/utils/sequelize-utils/SequelizeUtils.js +165 -0
- package/dist/node/utils/sequelize-utils/index.cjs +19 -0
- package/dist/node/utils/sequelize-utils/index.d.ts +3 -0
- package/dist/node/utils/sequelize-utils/index.js +2 -0
- package/dist/node/utils/sequelize-utils/types.cjs +1 -0
- package/dist/node/utils/sequelize-utils/types.d.ts +19 -0
- package/dist/node/utils/sequelize-utils/types.js +0 -0
- package/dist/shared/constants/COORDINATE.cjs +15 -0
- package/dist/shared/constants/COORDINATE.d.ts +9 -0
- package/dist/shared/constants/COORDINATE.js +15 -0
- package/dist/shared/constants/CRUD.cjs +26 -0
- package/dist/shared/constants/CRUD.d.ts +11 -0
- package/dist/shared/constants/CRUD.js +26 -0
- package/dist/shared/constants/DATE.cjs +34 -0
- package/dist/shared/constants/DATE.d.ts +15 -0
- package/dist/shared/constants/DATE.js +34 -0
- package/dist/shared/constants/DISTANCE.cjs +22 -0
- package/dist/shared/constants/DISTANCE.d.ts +15 -0
- package/dist/shared/constants/DISTANCE.js +22 -0
- package/dist/shared/constants/DURATION.cjs +25 -0
- package/dist/shared/constants/DURATION.d.ts +18 -0
- package/dist/shared/constants/DURATION.js +25 -0
- package/dist/shared/constants/NOT_NULL.cjs +4 -0
- package/dist/shared/constants/NOT_NULL.d.ts +3 -0
- package/dist/shared/constants/NOT_NULL.js +3 -0
- package/dist/shared/constants/index.cjs +55 -0
- package/dist/shared/constants/index.d.ts +6 -0
- package/dist/shared/constants/index.js +6 -0
- package/dist/shared/exports/Uint8Array.cjs +9 -0
- package/dist/shared/exports/Uint8Array.d.ts +6 -0
- package/dist/shared/exports/Uint8Array.js +8 -0
- package/dist/shared/exports/atob.cjs +3 -0
- package/dist/shared/exports/atob.d.ts +2 -0
- package/dist/shared/exports/atob.js +2 -0
- package/dist/shared/exports/btoa.cjs +3 -0
- package/dist/shared/exports/btoa.d.ts +2 -0
- package/dist/shared/exports/btoa.js +2 -0
- package/dist/shared/index.cjs +64 -0
- package/dist/shared/index.d.ts +57 -0
- package/dist/shared/index.js +7 -0
- package/dist/shared/interfaces/Coordinate.cjs +1 -0
- package/dist/shared/interfaces/Coordinate.d.ts +10 -0
- package/dist/shared/interfaces/Coordinate.js +0 -0
- package/dist/shared/interfaces/Point2.cjs +1 -0
- package/dist/shared/interfaces/Point2.d.ts +6 -0
- package/dist/shared/interfaces/Point2.js +0 -0
- package/dist/shared/interfaces/Point3.cjs +1 -0
- package/dist/shared/interfaces/Point3.d.ts +7 -0
- package/dist/shared/interfaces/Point3.js +0 -0
- package/dist/shared/interfaces/StorageProvider.cjs +1 -0
- package/dist/shared/interfaces/StorageProvider.d.ts +9 -0
- package/dist/shared/interfaces/StorageProvider.js +0 -0
- package/dist/shared/interfaces/index.cjs +37 -0
- package/dist/shared/interfaces/index.d.ts +4 -0
- package/dist/shared/interfaces/index.js +4 -0
- package/dist/shared/managers/SessionManager.cjs +498 -0
- package/dist/shared/managers/SessionManager.d.ts +18 -0
- package/dist/shared/managers/SessionManager.js +491 -0
- package/dist/shared/managers/SessionManager.type.cjs +1 -0
- package/dist/shared/managers/SessionManager.type.d.ts +12 -0
- package/dist/shared/managers/SessionManager.type.js +0 -0
- package/dist/shared/managers/index.cjs +19 -0
- package/dist/shared/managers/index.d.ts +5 -0
- package/dist/shared/managers/index.js +2 -0
- package/dist/shared/scripts/base64Polyfill.cjs +20 -0
- package/dist/shared/scripts/base64Polyfill.d.ts +3 -0
- package/dist/shared/scripts/base64Polyfill.js +13 -0
- package/dist/shared/scripts/index.cjs +10 -0
- package/dist/shared/scripts/index.d.ts +1 -0
- package/dist/shared/scripts/index.js +1 -0
- package/dist/shared/services/index.cjs +10 -0
- package/dist/shared/services/index.d.ts +3 -0
- package/dist/shared/services/index.js +1 -0
- package/dist/shared/services/time/TimeService.cjs +487 -0
- package/dist/shared/services/time/TimeService.d.ts +34 -0
- package/dist/shared/services/time/TimeService.js +481 -0
- package/dist/shared/services/time/TimeService.type.cjs +1 -0
- package/dist/shared/services/time/TimeService.type.d.ts +23 -0
- package/dist/shared/services/time/TimeService.type.js +0 -0
- package/dist/shared/services/time/index.cjs +19 -0
- package/dist/shared/services/time/index.d.ts +3 -0
- package/dist/shared/services/time/index.js +2 -0
- package/dist/shared/types/IntRage.cjs +1 -0
- package/dist/shared/types/IntRage.d.ts +4 -0
- package/dist/shared/types/IntRage.js +0 -0
- package/dist/shared/types/PartialExcept.cjs +1 -0
- package/dist/shared/types/PartialExcept.d.ts +3 -0
- package/dist/shared/types/PartialExcept.js +0 -0
- package/dist/shared/types/index.cjs +19 -0
- package/dist/shared/types/index.d.ts +2 -0
- package/dist/shared/types/index.js +2 -0
- package/dist/shared/utils/ArrayUtils.cjs +104 -0
- package/dist/shared/utils/ArrayUtils.d.ts +14 -0
- package/dist/shared/utils/ArrayUtils.js +104 -0
- package/dist/shared/utils/AxiosUtils.cjs +113 -0
- package/dist/shared/utils/AxiosUtils.d.ts +8 -0
- package/dist/shared/utils/AxiosUtils.js +113 -0
- package/dist/shared/utils/BooleanUtils.cjs +7 -0
- package/dist/shared/utils/BooleanUtils.d.ts +3 -0
- package/dist/shared/utils/BooleanUtils.js +6 -0
- package/dist/shared/utils/Calc.cjs +62 -0
- package/dist/shared/utils/Calc.d.ts +6 -0
- package/dist/shared/utils/Calc.js +62 -0
- package/dist/shared/utils/CoordinateUtils.cjs +85 -0
- package/dist/shared/utils/CoordinateUtils.d.ts +11 -0
- package/dist/shared/utils/CoordinateUtils.js +85 -0
- package/dist/shared/utils/DateUtils.cjs +656 -0
- package/dist/shared/utils/DateUtils.d.ts +27 -0
- package/dist/shared/utils/DateUtils.js +651 -0
- package/dist/shared/utils/Enum.cjs +142 -0
- package/dist/shared/utils/Enum.d.ts +19 -0
- package/dist/shared/utils/Enum.js +142 -0
- package/dist/shared/utils/Enum.types.cjs +1 -0
- package/dist/shared/utils/Enum.types.d.ts +7 -0
- package/dist/shared/utils/Enum.types.js +0 -0
- package/dist/shared/utils/I18nUtils.cjs +48 -0
- package/dist/shared/utils/I18nUtils.d.ts +7 -0
- package/dist/shared/utils/I18nUtils.js +42 -0
- package/dist/shared/utils/JuminNumberUtils.cjs +71 -0
- package/dist/shared/utils/JuminNumberUtils.d.ts +6 -0
- package/dist/shared/utils/JuminNumberUtils.js +71 -0
- package/dist/shared/utils/NumberUtils.cjs +80 -0
- package/dist/shared/utils/NumberUtils.d.ts +6 -0
- package/dist/shared/utils/NumberUtils.js +80 -0
- package/dist/shared/utils/ObjectIdUtils.cjs +65 -0
- package/dist/shared/utils/ObjectIdUtils.d.ts +6 -0
- package/dist/shared/utils/ObjectIdUtils.js +65 -0
- package/dist/shared/utils/Point3Utils.cjs +39 -0
- package/dist/shared/utils/Point3Utils.d.ts +8 -0
- package/dist/shared/utils/Point3Utils.js +39 -0
- package/dist/shared/utils/RandomUtils.cjs +103 -0
- package/dist/shared/utils/RandomUtils.d.ts +10 -0
- package/dist/shared/utils/RandomUtils.js +103 -0
- package/dist/shared/utils/Sequencer.cjs +476 -0
- package/dist/shared/utils/Sequencer.d.ts +41 -0
- package/dist/shared/utils/Sequencer.js +467 -0
- package/dist/shared/utils/StringUtils.cjs +71 -0
- package/dist/shared/utils/StringUtils.d.ts +7 -0
- package/dist/shared/utils/StringUtils.js +71 -0
- package/dist/shared/utils/Uint8ArrayUtils.cjs +48 -0
- package/dist/shared/utils/Uint8ArrayUtils.d.ts +6 -0
- package/dist/shared/utils/Uint8ArrayUtils.js +48 -0
- package/dist/shared/utils/UuidUtils.cjs +95 -0
- package/dist/shared/utils/UuidUtils.d.ts +16 -0
- package/dist/shared/utils/UuidUtils.js +75 -0
- package/dist/shared/utils/Validator.cjs +135 -0
- package/dist/shared/utils/Validator.d.ts +50 -0
- package/dist/shared/utils/Validator.js +135 -0
- package/dist/shared/utils/global/atob.cjs +12 -0
- package/dist/shared/utils/global/atob.d.ts +5 -0
- package/dist/shared/utils/global/atob.js +5 -0
- package/dist/shared/utils/global/base64.cjs +42 -0
- package/dist/shared/utils/global/base64.d.ts +4 -0
- package/dist/shared/utils/global/base64.js +40 -0
- package/dist/shared/utils/global/between.cjs +6 -0
- package/dist/shared/utils/global/between.d.ts +3 -0
- package/dist/shared/utils/global/between.js +5 -0
- package/dist/shared/utils/global/btoa.cjs +12 -0
- package/dist/shared/utils/global/btoa.d.ts +5 -0
- package/dist/shared/utils/global/btoa.js +5 -0
- package/dist/shared/utils/global/castArray.cjs +8 -0
- package/dist/shared/utils/global/castArray.d.ts +3 -0
- package/dist/shared/utils/global/castArray.js +7 -0
- package/dist/shared/utils/global/circularDistance.cjs +13 -0
- package/dist/shared/utils/global/circularDistance.d.ts +3 -0
- package/dist/shared/utils/global/circularDistance.js +12 -0
- package/dist/shared/utils/global/fallbackIfMatch.cjs +13 -0
- package/dist/shared/utils/global/fallbackIfMatch.d.ts +3 -0
- package/dist/shared/utils/global/fallbackIfMatch.js +12 -0
- package/dist/shared/utils/global/fallbackIfNull.cjs +7 -0
- package/dist/shared/utils/global/fallbackIfNull.d.ts +3 -0
- package/dist/shared/utils/global/fallbackIfNull.js +6 -0
- package/dist/shared/utils/global/fallbackIfNullish.cjs +9 -0
- package/dist/shared/utils/global/fallbackIfNullish.d.ts +3 -0
- package/dist/shared/utils/global/fallbackIfNullish.js +8 -0
- package/dist/shared/utils/global/fallbackIfUndefined.cjs +7 -0
- package/dist/shared/utils/global/fallbackIfUndefined.d.ts +3 -0
- package/dist/shared/utils/global/fallbackIfUndefined.js +6 -0
- package/dist/shared/utils/global/firstNonNullish.cjs +40 -0
- package/dist/shared/utils/global/firstNonNullish.d.ts +3 -0
- package/dist/shared/utils/global/firstNonNullish.js +39 -0
- package/dist/shared/utils/global/flat.cjs +102 -0
- package/dist/shared/utils/global/flat.d.ts +16 -0
- package/dist/shared/utils/global/flat.js +100 -0
- package/dist/shared/utils/global/index.cjs +136 -0
- package/dist/shared/utils/global/index.d.ts +16 -0
- package/dist/shared/utils/global/index.js +15 -0
- package/dist/shared/utils/global/processFirstNonNullish.cjs +40 -0
- package/dist/shared/utils/global/processFirstNonNullish.d.ts +3 -0
- package/dist/shared/utils/global/processFirstNonNullish.js +38 -0
- package/dist/shared/utils/global/pureEnum.cjs +69 -0
- package/dist/shared/utils/global/pureEnum.d.ts +18 -0
- package/dist/shared/utils/global/pureEnum.js +66 -0
- package/dist/shared/utils/global/sleep.cjs +8 -0
- package/dist/shared/utils/global/sleep.d.ts +3 -0
- package/dist/shared/utils/global/sleep.js +7 -0
- package/dist/shared/utils/index.cjs +190 -0
- package/dist/shared/utils/index.d.ts +44 -0
- package/dist/shared/utils/index.js +21 -0
- package/dist/shared/utils/try-catch/TryCatch.cjs +237 -0
- package/dist/shared/utils/try-catch/TryCatch.d.ts +26 -0
- package/dist/shared/utils/try-catch/TryCatch.js +237 -0
- package/dist/shared/utils/try-catch/index.cjs +10 -0
- package/dist/shared/utils/try-catch/index.d.ts +1 -0
- package/dist/shared/utils/try-catch/index.js +1 -0
- package/package.json +6 -7
- package/dist/index.browser.d.cts +0 -484
- package/dist/index.d.cts +0 -6
- package/dist/index.node.d.cts +0 -168
|
@@ -0,0 +1,502 @@
|
|
|
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
|
+
require('../../../chunk-ETV4XYOV.cjs');
|
|
219
|
+
var RedisClient = require('./RedisClient');
|
|
220
|
+
var utils = require('../../../shared/utils');
|
|
221
|
+
var RedisSubscriber = /*#__PURE__*/ function(_RedisClient_RedisClient) {
|
|
222
|
+
_inherits(RedisSubscriber, _RedisClient_RedisClient);
|
|
223
|
+
function RedisSubscriber(options) {
|
|
224
|
+
_class_call_check(this, RedisSubscriber);
|
|
225
|
+
var _this;
|
|
226
|
+
_this = _call_super(this, RedisSubscriber, [
|
|
227
|
+
options
|
|
228
|
+
]);
|
|
229
|
+
console.log(Date.now(), "Subscriber", "initialized");
|
|
230
|
+
return _this;
|
|
231
|
+
}
|
|
232
|
+
_create_class(RedisSubscriber, [
|
|
233
|
+
{
|
|
234
|
+
key: "subscribe",
|
|
235
|
+
value: function subscribe(channels, listener, bufferMode) {
|
|
236
|
+
return _async_to_generator(function() {
|
|
237
|
+
var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, channel, err;
|
|
238
|
+
return _ts_generator(this, function(_state) {
|
|
239
|
+
switch(_state.label){
|
|
240
|
+
case 0:
|
|
241
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
242
|
+
_state.label = 1;
|
|
243
|
+
case 1:
|
|
244
|
+
_state.trys.push([
|
|
245
|
+
1,
|
|
246
|
+
8,
|
|
247
|
+
9,
|
|
248
|
+
10
|
|
249
|
+
]);
|
|
250
|
+
_iterator = utils.castArray(channels)[Symbol.iterator]();
|
|
251
|
+
_state.label = 2;
|
|
252
|
+
case 2:
|
|
253
|
+
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
|
254
|
+
3,
|
|
255
|
+
7
|
|
256
|
+
];
|
|
257
|
+
channel = _step.value;
|
|
258
|
+
if (!/\*/g.test(channel)) return [
|
|
259
|
+
3,
|
|
260
|
+
4
|
|
261
|
+
];
|
|
262
|
+
return [
|
|
263
|
+
4,
|
|
264
|
+
this.client.pSubscribe(channel, listener, bufferMode)
|
|
265
|
+
];
|
|
266
|
+
case 3:
|
|
267
|
+
_state.sent();
|
|
268
|
+
return [
|
|
269
|
+
3,
|
|
270
|
+
6
|
|
271
|
+
];
|
|
272
|
+
case 4:
|
|
273
|
+
return [
|
|
274
|
+
4,
|
|
275
|
+
this.client.subscribe(channel, listener, bufferMode)
|
|
276
|
+
];
|
|
277
|
+
case 5:
|
|
278
|
+
_state.sent();
|
|
279
|
+
_state.label = 6;
|
|
280
|
+
case 6:
|
|
281
|
+
_iteratorNormalCompletion = true;
|
|
282
|
+
return [
|
|
283
|
+
3,
|
|
284
|
+
2
|
|
285
|
+
];
|
|
286
|
+
case 7:
|
|
287
|
+
return [
|
|
288
|
+
3,
|
|
289
|
+
10
|
|
290
|
+
];
|
|
291
|
+
case 8:
|
|
292
|
+
err = _state.sent();
|
|
293
|
+
_didIteratorError = true;
|
|
294
|
+
_iteratorError = err;
|
|
295
|
+
return [
|
|
296
|
+
3,
|
|
297
|
+
10
|
|
298
|
+
];
|
|
299
|
+
case 9:
|
|
300
|
+
try {
|
|
301
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
302
|
+
_iterator.return();
|
|
303
|
+
}
|
|
304
|
+
} finally{
|
|
305
|
+
if (_didIteratorError) {
|
|
306
|
+
throw _iteratorError;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return [
|
|
310
|
+
7
|
|
311
|
+
];
|
|
312
|
+
case 10:
|
|
313
|
+
return [
|
|
314
|
+
2
|
|
315
|
+
];
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
}).call(this);
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
key: "unsubscribe",
|
|
323
|
+
value: function unsubscribe(channels, listener, bufferMode) {
|
|
324
|
+
return _async_to_generator(function() {
|
|
325
|
+
var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, channel, err;
|
|
326
|
+
return _ts_generator(this, function(_state) {
|
|
327
|
+
switch(_state.label){
|
|
328
|
+
case 0:
|
|
329
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
330
|
+
_state.label = 1;
|
|
331
|
+
case 1:
|
|
332
|
+
_state.trys.push([
|
|
333
|
+
1,
|
|
334
|
+
8,
|
|
335
|
+
9,
|
|
336
|
+
10
|
|
337
|
+
]);
|
|
338
|
+
_iterator = utils.castArray(channels)[Symbol.iterator]();
|
|
339
|
+
_state.label = 2;
|
|
340
|
+
case 2:
|
|
341
|
+
if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
|
|
342
|
+
3,
|
|
343
|
+
7
|
|
344
|
+
];
|
|
345
|
+
channel = _step.value;
|
|
346
|
+
if (!/\*/g.test(channel)) return [
|
|
347
|
+
3,
|
|
348
|
+
4
|
|
349
|
+
];
|
|
350
|
+
return [
|
|
351
|
+
4,
|
|
352
|
+
this.client.pUnsubscribe(channel, listener, bufferMode)
|
|
353
|
+
];
|
|
354
|
+
case 3:
|
|
355
|
+
_state.sent();
|
|
356
|
+
return [
|
|
357
|
+
3,
|
|
358
|
+
6
|
|
359
|
+
];
|
|
360
|
+
case 4:
|
|
361
|
+
return [
|
|
362
|
+
4,
|
|
363
|
+
this.client.unsubscribe(channel, listener, bufferMode)
|
|
364
|
+
];
|
|
365
|
+
case 5:
|
|
366
|
+
_state.sent();
|
|
367
|
+
_state.label = 6;
|
|
368
|
+
case 6:
|
|
369
|
+
_iteratorNormalCompletion = true;
|
|
370
|
+
return [
|
|
371
|
+
3,
|
|
372
|
+
2
|
|
373
|
+
];
|
|
374
|
+
case 7:
|
|
375
|
+
return [
|
|
376
|
+
3,
|
|
377
|
+
10
|
|
378
|
+
];
|
|
379
|
+
case 8:
|
|
380
|
+
err = _state.sent();
|
|
381
|
+
_didIteratorError = true;
|
|
382
|
+
_iteratorError = err;
|
|
383
|
+
return [
|
|
384
|
+
3,
|
|
385
|
+
10
|
|
386
|
+
];
|
|
387
|
+
case 9:
|
|
388
|
+
try {
|
|
389
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
390
|
+
_iterator.return();
|
|
391
|
+
}
|
|
392
|
+
} finally{
|
|
393
|
+
if (_didIteratorError) {
|
|
394
|
+
throw _iteratorError;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return [
|
|
398
|
+
7
|
|
399
|
+
];
|
|
400
|
+
case 10:
|
|
401
|
+
return [
|
|
402
|
+
2
|
|
403
|
+
];
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
}).call(this);
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
key: "start",
|
|
411
|
+
value: function start() {
|
|
412
|
+
var _this = this;
|
|
413
|
+
var _this1 = this, _superprop_get_start = function() {
|
|
414
|
+
return _get(_get_prototype_of(RedisSubscriber.prototype), "start", _this);
|
|
415
|
+
};
|
|
416
|
+
return _async_to_generator(function() {
|
|
417
|
+
var status;
|
|
418
|
+
return _ts_generator(this, function(_state) {
|
|
419
|
+
switch(_state.label){
|
|
420
|
+
case 0:
|
|
421
|
+
return [
|
|
422
|
+
4,
|
|
423
|
+
_superprop_get_start().call(_this1)
|
|
424
|
+
];
|
|
425
|
+
case 1:
|
|
426
|
+
status = _state.sent();
|
|
427
|
+
return [
|
|
428
|
+
4,
|
|
429
|
+
this.registerListeners()
|
|
430
|
+
];
|
|
431
|
+
case 2:
|
|
432
|
+
_state.sent();
|
|
433
|
+
return [
|
|
434
|
+
2,
|
|
435
|
+
status
|
|
436
|
+
];
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
}).call(this);
|
|
440
|
+
}
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
key: "stop",
|
|
444
|
+
value: function stop() {
|
|
445
|
+
var _this = this;
|
|
446
|
+
var _this1 = this, _superprop_get_stop = function() {
|
|
447
|
+
return _get(_get_prototype_of(RedisSubscriber.prototype), "stop", _this);
|
|
448
|
+
};
|
|
449
|
+
return _async_to_generator(function() {
|
|
450
|
+
var status;
|
|
451
|
+
return _ts_generator(this, function(_state) {
|
|
452
|
+
switch(_state.label){
|
|
453
|
+
case 0:
|
|
454
|
+
return [
|
|
455
|
+
4,
|
|
456
|
+
_superprop_get_stop().call(_this1)
|
|
457
|
+
];
|
|
458
|
+
case 1:
|
|
459
|
+
status = _state.sent();
|
|
460
|
+
return [
|
|
461
|
+
4,
|
|
462
|
+
this.unregisterListeners()
|
|
463
|
+
];
|
|
464
|
+
case 2:
|
|
465
|
+
_state.sent();
|
|
466
|
+
return [
|
|
467
|
+
2,
|
|
468
|
+
status
|
|
469
|
+
];
|
|
470
|
+
}
|
|
471
|
+
});
|
|
472
|
+
}).call(this);
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
key: "registerListeners",
|
|
477
|
+
value: function registerListeners() {
|
|
478
|
+
return _async_to_generator(function() {
|
|
479
|
+
return _ts_generator(this, function(_state) {
|
|
480
|
+
return [
|
|
481
|
+
2
|
|
482
|
+
];
|
|
483
|
+
});
|
|
484
|
+
})();
|
|
485
|
+
}
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
key: "unregisterListeners",
|
|
489
|
+
value: function unregisterListeners() {
|
|
490
|
+
return _async_to_generator(function() {
|
|
491
|
+
return _ts_generator(this, function(_state) {
|
|
492
|
+
return [
|
|
493
|
+
2
|
|
494
|
+
];
|
|
495
|
+
});
|
|
496
|
+
})();
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
]);
|
|
500
|
+
return RedisSubscriber;
|
|
501
|
+
}(RedisClient.RedisClient);
|
|
502
|
+
exports.RedisSubscriber = RedisSubscriber;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RedisClient } from './RedisClient.js';
|
|
2
|
+
import { PubSubListener } from '@redis/client/dist/lib/client/pub-sub';
|
|
3
|
+
import 'redis';
|
|
4
|
+
|
|
5
|
+
declare class RedisSubscriber extends RedisClient {
|
|
6
|
+
constructor(options?: RedisClient.RedisClientOptions);
|
|
7
|
+
subscribe<T extends boolean = false>(channels: string | string[], listener: PubSubListener<T>, bufferMode?: T | undefined): Promise<void>;
|
|
8
|
+
unsubscribe<T extends boolean = false>(channels: string | string[], listener?: PubSubListener<T> | undefined, bufferMode?: T | undefined): Promise<void>;
|
|
9
|
+
start(): Promise<RedisClient.Status>;
|
|
10
|
+
stop(): Promise<RedisClient.Status>;
|
|
11
|
+
protected registerListeners(): Promise<void>;
|
|
12
|
+
protected unregisterListeners(): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { RedisSubscriber };
|