@powfix/core-js 0.15.0-beta-2 → 0.15.0-beta-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{server/interfaces → browser/cjs/constants}/index.browser.js +6 -4
- package/dist/{server/constants → browser/cjs}/index.browser.js +7 -6
- package/dist/{server/managers → browser/cjs/interfaces}/index.browser.js +4 -2
- package/dist/{server/types → browser/cjs/managers}/index.browser.js +2 -2
- package/dist/browser/cjs/scripts/index.browser.js +17 -0
- package/dist/{server → browser/cjs}/services/index.browser.js +1 -1
- package/dist/browser/cjs/services/time/index.js +18 -0
- package/dist/{server/scripts → browser/cjs/types}/index.browser.js +2 -1
- package/dist/{server → browser/cjs}/utils/ArrayUtils.js +2 -2
- package/dist/{server → browser/cjs}/utils/DateUtils.js +17 -17
- package/dist/{server → browser/cjs}/utils/JuminNumberUtils.js +2 -2
- package/dist/{server → browser/cjs}/utils/ObjectIdUtils.js +3 -3
- package/dist/{server → browser/cjs}/utils/Sequencer.js +2 -2
- package/dist/{server → browser/cjs}/utils/global/fallbackIfNull.js +2 -2
- package/dist/{server → browser/cjs}/utils/global/fallbackIfUndefined.js +2 -2
- package/dist/{server → browser/cjs/utils/global}/index.js +11 -8
- package/dist/{server → browser/cjs}/utils/global/processFirstNonNullish.js +2 -2
- package/dist/browser/cjs/utils/index.browser.js +33 -0
- package/dist/{server → browser/cjs}/utils/try-catch/index.js +1 -1
- package/dist/browser/esm/constants/index.browser.mjs +6 -0
- package/dist/browser/esm/index.browser.mjs +7 -0
- package/dist/browser/esm/interfaces/index.browser.mjs +4 -0
- package/dist/browser/esm/managers/index.browser.mjs +2 -0
- package/dist/browser/esm/scripts/index.browser.mjs +1 -0
- package/dist/browser/esm/services/index.browser.mjs +1 -0
- package/dist/browser/esm/services/time/index.mjs +2 -0
- package/dist/browser/esm/types/index.browser.mjs +2 -0
- package/dist/{client/utils/ArrayUtils.js → browser/esm/utils/ArrayUtils.mjs} +1 -1
- package/dist/{client/utils/DateUtils.js → browser/esm/utils/DateUtils.mjs} +1 -1
- package/dist/{client/utils/JuminNumberUtils.js → browser/esm/utils/JuminNumberUtils.mjs} +1 -1
- package/dist/{client/utils/ObjectIdUtils.js → browser/esm/utils/ObjectIdUtils.mjs} +1 -1
- package/dist/{client/utils/Sequencer.js → browser/esm/utils/Sequencer.mjs} +1 -1
- package/dist/{client/utils/global/fallbackIfNull.js → browser/esm/utils/global/fallbackIfNull.mjs} +1 -1
- package/dist/{client/utils/global/fallbackIfUndefined.js → browser/esm/utils/global/fallbackIfUndefined.mjs} +1 -1
- package/dist/browser/esm/utils/global/index.mjs +11 -0
- package/dist/{client/utils/global/processFirstNonNullish.js → browser/esm/utils/global/processFirstNonNullish.mjs} +1 -1
- package/dist/browser/esm/utils/index.browser.mjs +17 -0
- package/dist/browser/esm/utils/try-catch/index.mjs +1 -0
- package/dist/browser/types/constants/index.browser.d.ts +6 -0
- package/dist/browser/types/index.browser.d.ts +7 -0
- package/dist/{server → browser/types}/interfaces/Point3.d.ts +1 -1
- package/dist/browser/types/interfaces/index.browser.d.ts +4 -0
- package/dist/{client → browser/types}/managers/SessionManager.d.ts +2 -2
- package/dist/{client → browser/types}/managers/SessionManager.type.d.ts +1 -1
- package/dist/browser/types/managers/index.browser.d.ts +2 -0
- package/dist/browser/types/scripts/index.browser.d.ts +1 -0
- package/dist/browser/types/services/index.browser.d.ts +1 -0
- package/dist/{client → browser/types}/services/time/TimeService.d.ts +1 -1
- package/dist/browser/types/services/time/index.d.ts +2 -0
- package/dist/browser/types/types/index.browser.d.ts +2 -0
- package/dist/{client → browser/types}/utils/CoordinateUtils.d.ts +1 -1
- package/dist/{server → browser/types}/utils/DateUtils.d.ts +1 -1
- package/dist/{server → browser/types}/utils/Point3Utils.d.ts +1 -1
- package/dist/browser/types/utils/global/index.d.ts +11 -0
- package/dist/browser/types/utils/index.browser.d.ts +17 -0
- package/dist/browser/types/utils/try-catch/index.d.ts +1 -0
- package/dist/node/cjs/constants/COORDINATE.js +10 -0
- package/dist/node/cjs/constants/CRUD.js +22 -0
- package/dist/node/cjs/constants/DATE.js +26 -0
- package/dist/node/cjs/constants/DISTANCE.js +18 -0
- package/dist/node/cjs/constants/DURATION.js +21 -0
- package/dist/node/cjs/constants/NOT_NULL.js +4 -0
- package/dist/node/cjs/constants/index.browser.js +22 -0
- package/dist/node/cjs/constants/index.js +18 -0
- package/dist/{server/interfaces → node/cjs/constants/nodejs}/index.js +2 -2
- package/dist/node/cjs/index.browser.js +23 -0
- package/dist/node/cjs/index.js +24 -0
- package/dist/node/cjs/interfaces/index.browser.js +20 -0
- package/dist/node/cjs/interfaces/index.js +18 -0
- package/dist/{server/interfaces/nodejs → node/cjs/interfaces/nodejs/db}/index.js +1 -1
- package/dist/node/cjs/interfaces/nodejs/db/sequelize/UpsertOptions.js +2 -0
- package/dist/{server/constants/nodejs → node/cjs/interfaces/nodejs/db/sequelize}/index.js +6 -2
- package/dist/{server/scripts → node/cjs/interfaces/nodejs}/index.js +1 -1
- package/dist/node/cjs/managers/SessionManager.js +134 -0
- package/dist/node/cjs/managers/SessionManager.type.js +2 -0
- package/dist/{server → node/cjs}/managers/TransactionManager.js +13 -13
- package/dist/node/cjs/managers/TransactionManager.types.js +2 -0
- package/dist/node/cjs/managers/index.browser.js +18 -0
- package/dist/{server/constants → node/cjs/managers}/index.js +2 -2
- package/dist/node/cjs/scripts/base64Polyfill.js +14 -0
- package/dist/node/cjs/scripts/index.browser.js +17 -0
- package/dist/node/cjs/scripts/index.js +17 -0
- package/dist/node/cjs/services/index.browser.js +17 -0
- package/dist/{server/interfaces/nodejs/db → node/cjs/services}/index.js +2 -1
- package/dist/{server → node/cjs}/services/redis/RedisPublisher.js +2 -2
- package/dist/{server → node/cjs}/services/redis/RedisSubscriber.js +5 -5
- package/dist/{server → node/cjs}/services/redis/index.js +3 -3
- package/dist/node/cjs/services/time/TimeService.js +180 -0
- package/dist/node/cjs/services/time/TimeService.type.js +2 -0
- package/dist/node/cjs/services/time/index.js +18 -0
- package/dist/node/cjs/types/IntRage.js +2 -0
- package/dist/node/cjs/types/PartialExcept.js +2 -0
- package/dist/node/cjs/types/UpsertResult.js +2 -0
- package/dist/node/cjs/types/index.browser.js +18 -0
- package/dist/node/cjs/types/index.js +18 -0
- package/dist/node/cjs/utils/ArrayUtils.js +30 -0
- package/dist/node/cjs/utils/AxiosUtils.js +53 -0
- package/dist/node/cjs/utils/BooleanUtils.js +8 -0
- package/dist/node/cjs/utils/Calc.js +27 -0
- package/dist/node/cjs/utils/CoordinateUtils.js +42 -0
- package/dist/node/cjs/utils/DateUtils.js +310 -0
- package/dist/node/cjs/utils/JuminNumberUtils.js +50 -0
- package/dist/node/cjs/utils/NumberUtils.js +25 -0
- package/dist/node/cjs/utils/ObjectIdUtils.js +24 -0
- package/dist/node/cjs/utils/Point3Utils.js +12 -0
- package/dist/node/cjs/utils/RandomUtils.js +64 -0
- package/dist/node/cjs/utils/Sequencer.js +148 -0
- package/dist/node/cjs/utils/StringUtils.js +37 -0
- package/dist/node/cjs/utils/UuidUtils.js +79 -0
- package/dist/node/cjs/utils/Validator.js +118 -0
- package/dist/node/cjs/utils/global/between.js +7 -0
- package/dist/node/cjs/utils/global/castArray.js +6 -0
- package/dist/node/cjs/utils/global/circularDistance.js +14 -0
- package/dist/node/cjs/utils/global/fallbackIfEqual.js +9 -0
- package/dist/node/cjs/utils/global/fallbackIfNull.js +7 -0
- package/dist/node/cjs/utils/global/fallbackIfUndefined.js +7 -0
- package/dist/node/cjs/utils/global/firstNonNullish.js +13 -0
- package/dist/node/cjs/utils/global/flat.js +117 -0
- package/dist/node/cjs/utils/global/index.js +27 -0
- package/dist/node/cjs/utils/global/processFirstNonNullish.js +11 -0
- package/dist/node/cjs/utils/global/pureEnum.js +14 -0
- package/dist/node/cjs/utils/global/sleep.js +5 -0
- package/dist/node/cjs/utils/index.browser.js +33 -0
- package/dist/node/cjs/utils/index.js +18 -0
- package/dist/{server → node/cjs}/utils/nodejs/index.js +3 -3
- package/dist/{server → node/cjs}/utils/nodejs/sequelize-utils/SequelizeUtils.js +8 -8
- package/dist/{server → node/cjs}/utils/nodejs/sequelize-utils/index.js +2 -2
- package/dist/node/cjs/utils/nodejs/sequelize-utils/types.js +2 -0
- package/dist/node/cjs/utils/try-catch/TryCatch.js +78 -0
- package/dist/node/cjs/utils/try-catch/index.js +17 -0
- package/dist/node/esm/constants/COORDINATE.mjs +6 -0
- package/dist/node/esm/constants/CRUD.mjs +19 -0
- package/dist/node/esm/constants/DATE.mjs +22 -0
- package/dist/node/esm/constants/DISTANCE.mjs +14 -0
- package/dist/node/esm/constants/DURATION.mjs +17 -0
- package/dist/node/esm/constants/NOT_NULL.mjs +1 -0
- package/dist/node/esm/constants/index.browser.mjs +6 -0
- package/dist/node/esm/constants/index.mjs +2 -0
- package/dist/node/esm/constants/nodejs/TransactionManagerLogLevel.mjs +8 -0
- package/dist/node/esm/constants/nodejs/TransactionManagerTimeoutAction.mjs +5 -0
- package/dist/node/esm/constants/nodejs/index.mjs +2 -0
- package/dist/node/esm/index.browser.mjs +7 -0
- package/dist/node/esm/index.mjs +8 -0
- package/dist/node/esm/interfaces/Coordinate.mjs +1 -0
- package/dist/node/esm/interfaces/Point2.mjs +1 -0
- package/dist/node/esm/interfaces/Point3.mjs +1 -0
- package/dist/node/esm/interfaces/StorageProvider.mjs +1 -0
- package/dist/node/esm/interfaces/index.browser.mjs +4 -0
- package/dist/node/esm/interfaces/index.mjs +2 -0
- package/dist/node/esm/interfaces/nodejs/db/index.mjs +1 -0
- package/dist/node/esm/interfaces/nodejs/db/sequelize/Hook.mjs +1 -0
- package/dist/node/esm/interfaces/nodejs/db/sequelize/HookFn.mjs +1 -0
- package/dist/node/esm/interfaces/nodejs/db/sequelize/HookType.mjs +1 -0
- package/dist/node/esm/interfaces/nodejs/db/sequelize/ReloadOption.mjs +1 -0
- package/dist/node/esm/interfaces/nodejs/db/sequelize/TransactionOption.mjs +1 -0
- package/dist/node/esm/interfaces/nodejs/db/sequelize/UpsertOptions.mjs +1 -0
- package/dist/node/esm/interfaces/nodejs/db/sequelize/index.mjs +6 -0
- package/dist/node/esm/interfaces/nodejs/index.mjs +1 -0
- package/dist/node/esm/managers/SessionManager.mjs +127 -0
- package/dist/node/esm/managers/SessionManager.type.mjs +1 -0
- package/dist/node/esm/managers/TransactionManager.mjs +144 -0
- package/dist/node/esm/managers/TransactionManager.types.mjs +1 -0
- package/dist/node/esm/managers/index.browser.mjs +2 -0
- package/dist/node/esm/managers/index.mjs +2 -0
- package/dist/node/esm/scripts/base64Polyfill.mjs +10 -0
- package/dist/node/esm/scripts/index.browser.mjs +1 -0
- package/dist/node/esm/scripts/index.mjs +1 -0
- package/dist/node/esm/services/index.browser.mjs +1 -0
- package/dist/node/esm/services/index.mjs +2 -0
- package/dist/node/esm/services/redis/RedisClient.mjs +71 -0
- package/dist/node/esm/services/redis/RedisPublisher.mjs +60 -0
- package/dist/node/esm/services/redis/RedisSubscriber.mjs +69 -0
- package/dist/node/esm/services/redis/index.mjs +4 -0
- package/dist/node/esm/services/time/TimeService.mjs +173 -0
- package/dist/node/esm/services/time/TimeService.type.mjs +1 -0
- package/dist/node/esm/services/time/index.mjs +2 -0
- package/dist/node/esm/types/IntRage.mjs +1 -0
- package/dist/node/esm/types/PartialExcept.mjs +1 -0
- package/dist/node/esm/types/UpsertResult.mjs +1 -0
- package/dist/node/esm/types/index.browser.mjs +2 -0
- package/dist/node/esm/types/index.mjs +2 -0
- package/dist/node/esm/utils/ArrayUtils.mjs +26 -0
- package/dist/node/esm/utils/AxiosUtils.mjs +49 -0
- package/dist/node/esm/utils/BooleanUtils.mjs +5 -0
- package/dist/node/esm/utils/Calc.mjs +23 -0
- package/dist/node/esm/utils/CoordinateUtils.mjs +38 -0
- package/dist/node/esm/utils/DateUtils.mjs +303 -0
- package/dist/node/esm/utils/JuminNumberUtils.mjs +46 -0
- package/dist/node/esm/utils/NumberUtils.mjs +21 -0
- package/dist/node/esm/utils/ObjectIdUtils.mjs +20 -0
- package/dist/node/esm/utils/Point3Utils.mjs +8 -0
- package/dist/node/esm/utils/RandomUtils.mjs +60 -0
- package/dist/node/esm/utils/Sequencer.mjs +141 -0
- package/dist/node/esm/utils/StringUtils.mjs +33 -0
- package/dist/node/esm/utils/UuidUtils.mjs +42 -0
- package/dist/node/esm/utils/Validator.mjs +114 -0
- package/dist/node/esm/utils/global/between.mjs +3 -0
- package/dist/node/esm/utils/global/castArray.mjs +3 -0
- package/dist/node/esm/utils/global/circularDistance.mjs +11 -0
- package/dist/node/esm/utils/global/fallbackIfEqual.mjs +6 -0
- package/dist/node/esm/utils/global/fallbackIfNull.mjs +4 -0
- package/dist/node/esm/utils/global/fallbackIfUndefined.mjs +4 -0
- package/dist/node/esm/utils/global/firstNonNullish.mjs +10 -0
- package/dist/node/esm/utils/global/flat.mjs +113 -0
- package/dist/node/esm/utils/global/index.mjs +11 -0
- package/dist/node/esm/utils/global/processFirstNonNullish.mjs +8 -0
- package/dist/node/esm/utils/global/pureEnum.mjs +9 -0
- package/dist/node/esm/utils/global/sleep.mjs +1 -0
- package/dist/node/esm/utils/index.browser.mjs +17 -0
- package/dist/node/esm/utils/index.mjs +2 -0
- package/dist/node/esm/utils/nodejs/HookUtils.mjs +26 -0
- package/dist/node/esm/utils/nodejs/index.mjs +2 -0
- package/dist/node/esm/utils/nodejs/sequelize-utils/SequelizeUtils.mjs +71 -0
- package/dist/node/esm/utils/nodejs/sequelize-utils/index.mjs +1 -0
- package/dist/node/esm/utils/nodejs/sequelize-utils/types.mjs +1 -0
- package/dist/node/esm/utils/try-catch/TryCatch.mjs +74 -0
- package/dist/node/esm/utils/try-catch/index.mjs +1 -0
- package/dist/node/types/constants/index.browser.d.ts +6 -0
- package/dist/node/types/constants/index.d.ts +2 -0
- package/dist/node/types/constants/nodejs/index.d.ts +2 -0
- package/dist/node/types/index.browser.d.ts +7 -0
- package/dist/node/types/index.d.ts +8 -0
- package/dist/{client → node/types}/interfaces/Point3.d.ts +1 -1
- package/dist/node/types/interfaces/index.browser.d.ts +4 -0
- package/dist/node/types/interfaces/index.d.ts +2 -0
- package/dist/node/types/interfaces/nodejs/db/index.d.ts +1 -0
- package/dist/{server → node/types}/interfaces/nodejs/db/sequelize/Hook.d.ts +2 -2
- package/dist/{server → node/types}/interfaces/nodejs/db/sequelize/HookFn.d.ts +1 -1
- package/dist/node/types/interfaces/nodejs/db/sequelize/UpsertOptions.d.ts +4 -0
- package/dist/node/types/interfaces/nodejs/db/sequelize/index.d.ts +6 -0
- package/dist/node/types/interfaces/nodejs/index.d.ts +1 -0
- package/dist/{server → node/types}/managers/SessionManager.d.ts +2 -2
- package/dist/{server → node/types}/managers/SessionManager.type.d.ts +1 -1
- package/dist/{server → node/types}/managers/TransactionManager.d.ts +2 -2
- package/dist/{server → node/types}/managers/TransactionManager.types.d.ts +1 -1
- package/dist/node/types/managers/index.browser.d.ts +2 -0
- package/dist/node/types/managers/index.d.ts +2 -0
- package/dist/node/types/scripts/index.browser.d.ts +1 -0
- package/dist/node/types/scripts/index.d.ts +1 -0
- package/dist/node/types/services/index.browser.d.ts +1 -0
- package/dist/node/types/services/index.d.ts +2 -0
- package/dist/{server → node/types}/services/redis/RedisPublisher.d.ts +1 -1
- package/dist/{server → node/types}/services/redis/RedisSubscriber.d.ts +2 -2
- package/dist/node/types/services/redis/index.d.ts +3 -0
- package/dist/{server → node/types}/services/time/TimeService.d.ts +1 -1
- package/dist/node/types/services/time/index.d.ts +2 -0
- package/dist/node/types/types/index.browser.d.ts +2 -0
- package/dist/node/types/types/index.d.ts +2 -0
- package/dist/{server → node/types}/utils/CoordinateUtils.d.ts +1 -1
- package/dist/{client → node/types}/utils/DateUtils.d.ts +1 -1
- package/dist/{client → node/types}/utils/Point3Utils.d.ts +1 -1
- package/dist/node/types/utils/global/index.d.ts +11 -0
- package/dist/node/types/utils/index.browser.d.ts +17 -0
- package/dist/node/types/utils/index.d.ts +2 -0
- package/dist/{server → node/types}/utils/nodejs/HookUtils.d.ts +1 -1
- package/dist/node/types/utils/nodejs/index.d.ts +2 -0
- package/dist/{server → node/types}/utils/nodejs/sequelize-utils/SequelizeUtils.d.ts +1 -1
- package/dist/node/types/utils/nodejs/sequelize-utils/index.d.ts +1 -0
- package/dist/node/types/utils/try-catch/index.d.ts +1 -0
- package/package.json +17 -10
- package/dist/client/constants/index.browser.d.ts +0 -6
- package/dist/client/constants/index.browser.js +0 -6
- package/dist/client/index.browser.d.ts +0 -7
- package/dist/client/index.browser.js +0 -7
- package/dist/client/interfaces/index.browser.d.ts +0 -4
- package/dist/client/interfaces/index.browser.js +0 -4
- package/dist/client/managers/index.browser.d.ts +0 -2
- package/dist/client/managers/index.browser.js +0 -2
- package/dist/client/scripts/index.browser.d.ts +0 -1
- package/dist/client/scripts/index.browser.js +0 -1
- package/dist/client/services/index.browser.d.ts +0 -1
- package/dist/client/services/index.browser.js +0 -1
- package/dist/client/services/time/index.d.ts +0 -2
- package/dist/client/services/time/index.js +0 -2
- package/dist/client/types/index.browser.d.ts +0 -2
- package/dist/client/types/index.browser.js +0 -2
- package/dist/client/utils/global/index.d.ts +0 -11
- package/dist/client/utils/global/index.js +0 -11
- package/dist/client/utils/index.browser.d.ts +0 -17
- package/dist/client/utils/index.browser.js +0 -17
- package/dist/client/utils/try-catch/index.d.ts +0 -1
- package/dist/client/utils/try-catch/index.js +0 -1
- package/dist/server/constants/index.browser.d.ts +0 -6
- package/dist/server/constants/index.d.ts +0 -2
- package/dist/server/constants/nodejs/index.d.ts +0 -2
- package/dist/server/index.browser.d.ts +0 -7
- package/dist/server/index.browser.js +0 -23
- package/dist/server/index.d.ts +0 -8
- package/dist/server/interfaces/index.browser.d.ts +0 -4
- package/dist/server/interfaces/index.d.ts +0 -2
- package/dist/server/interfaces/nodejs/db/index.d.ts +0 -1
- package/dist/server/interfaces/nodejs/db/sequelize/UpsertOptions.d.ts +0 -4
- package/dist/server/interfaces/nodejs/db/sequelize/index.d.ts +0 -6
- package/dist/server/interfaces/nodejs/db/sequelize/index.js +0 -22
- package/dist/server/interfaces/nodejs/index.d.ts +0 -1
- package/dist/server/managers/index.browser.d.ts +0 -2
- package/dist/server/managers/index.d.ts +0 -2
- package/dist/server/managers/index.js +0 -18
- package/dist/server/scripts/index.browser.d.ts +0 -1
- package/dist/server/scripts/index.d.ts +0 -1
- package/dist/server/services/index.browser.d.ts +0 -1
- package/dist/server/services/index.d.ts +0 -2
- package/dist/server/services/index.js +0 -18
- package/dist/server/services/redis/index.d.ts +0 -3
- package/dist/server/services/time/index.d.ts +0 -2
- package/dist/server/services/time/index.js +0 -18
- package/dist/server/types/index.browser.d.ts +0 -2
- package/dist/server/types/index.d.ts +0 -2
- package/dist/server/types/index.js +0 -18
- package/dist/server/utils/global/index.d.ts +0 -11
- package/dist/server/utils/global/index.js +0 -27
- package/dist/server/utils/index.browser.d.ts +0 -17
- package/dist/server/utils/index.browser.js +0 -33
- package/dist/server/utils/index.d.ts +0 -2
- package/dist/server/utils/index.js +0 -18
- package/dist/server/utils/nodejs/index.d.ts +0 -2
- package/dist/server/utils/nodejs/sequelize-utils/index.d.ts +0 -1
- package/dist/server/utils/try-catch/index.d.ts +0 -1
- /package/dist/{server → browser/cjs}/constants/COORDINATE.js +0 -0
- /package/dist/{server → browser/cjs}/constants/CRUD.js +0 -0
- /package/dist/{server → browser/cjs}/constants/DATE.js +0 -0
- /package/dist/{server → browser/cjs}/constants/DISTANCE.js +0 -0
- /package/dist/{server → browser/cjs}/constants/DURATION.js +0 -0
- /package/dist/{server → browser/cjs}/constants/NOT_NULL.js +0 -0
- /package/dist/{server → browser/cjs}/interfaces/Coordinate.js +0 -0
- /package/dist/{server → browser/cjs}/interfaces/Point2.js +0 -0
- /package/dist/{server → browser/cjs}/interfaces/Point3.js +0 -0
- /package/dist/{server → browser/cjs}/interfaces/StorageProvider.js +0 -0
- /package/dist/{server → browser/cjs}/managers/SessionManager.js +0 -0
- /package/dist/{server → browser/cjs}/managers/SessionManager.type.js +0 -0
- /package/dist/{server → browser/cjs}/scripts/base64Polyfill.js +0 -0
- /package/dist/{server → browser/cjs}/services/time/TimeService.js +0 -0
- /package/dist/{server → browser/cjs}/services/time/TimeService.type.js +0 -0
- /package/dist/{server → browser/cjs}/types/IntRage.js +0 -0
- /package/dist/{server → browser/cjs}/types/PartialExcept.js +0 -0
- /package/dist/{server → browser/cjs}/utils/AxiosUtils.js +0 -0
- /package/dist/{server → browser/cjs}/utils/BooleanUtils.js +0 -0
- /package/dist/{server → browser/cjs}/utils/Calc.js +0 -0
- /package/dist/{server → browser/cjs}/utils/CoordinateUtils.js +0 -0
- /package/dist/{server → browser/cjs}/utils/NumberUtils.js +0 -0
- /package/dist/{server → browser/cjs}/utils/Point3Utils.js +0 -0
- /package/dist/{server → browser/cjs}/utils/RandomUtils.js +0 -0
- /package/dist/{server → browser/cjs}/utils/StringUtils.js +0 -0
- /package/dist/{server → browser/cjs}/utils/UuidUtils.js +0 -0
- /package/dist/{server → browser/cjs}/utils/Validator.js +0 -0
- /package/dist/{server → browser/cjs}/utils/global/between.js +0 -0
- /package/dist/{server → browser/cjs}/utils/global/castArray.js +0 -0
- /package/dist/{server → browser/cjs}/utils/global/circularDistance.js +0 -0
- /package/dist/{server → browser/cjs}/utils/global/fallbackIfEqual.js +0 -0
- /package/dist/{server → browser/cjs}/utils/global/firstNonNullish.js +0 -0
- /package/dist/{server → browser/cjs}/utils/global/flat.js +0 -0
- /package/dist/{server → browser/cjs}/utils/global/pureEnum.js +0 -0
- /package/dist/{server → browser/cjs}/utils/global/sleep.js +0 -0
- /package/dist/{server → browser/cjs}/utils/try-catch/TryCatch.js +0 -0
- /package/dist/{client/constants/COORDINATE.js → browser/esm/constants/COORDINATE.mjs} +0 -0
- /package/dist/{client/constants/CRUD.js → browser/esm/constants/CRUD.mjs} +0 -0
- /package/dist/{client/constants/DATE.js → browser/esm/constants/DATE.mjs} +0 -0
- /package/dist/{client/constants/DISTANCE.js → browser/esm/constants/DISTANCE.mjs} +0 -0
- /package/dist/{client/constants/DURATION.js → browser/esm/constants/DURATION.mjs} +0 -0
- /package/dist/{client/constants/NOT_NULL.js → browser/esm/constants/NOT_NULL.mjs} +0 -0
- /package/dist/{client/interfaces/Coordinate.js → browser/esm/interfaces/Coordinate.mjs} +0 -0
- /package/dist/{client/interfaces/Point2.js → browser/esm/interfaces/Point2.mjs} +0 -0
- /package/dist/{client/interfaces/Point3.js → browser/esm/interfaces/Point3.mjs} +0 -0
- /package/dist/{client/interfaces/StorageProvider.js → browser/esm/interfaces/StorageProvider.mjs} +0 -0
- /package/dist/{client/managers/SessionManager.js → browser/esm/managers/SessionManager.mjs} +0 -0
- /package/dist/{client/managers/SessionManager.type.js → browser/esm/managers/SessionManager.type.mjs} +0 -0
- /package/dist/{client/scripts/base64Polyfill.js → browser/esm/scripts/base64Polyfill.mjs} +0 -0
- /package/dist/{client/services/time/TimeService.js → browser/esm/services/time/TimeService.mjs} +0 -0
- /package/dist/{client/services/time/TimeService.type.js → browser/esm/services/time/TimeService.type.mjs} +0 -0
- /package/dist/{client/types/IntRage.js → browser/esm/types/IntRage.mjs} +0 -0
- /package/dist/{client/types/PartialExcept.js → browser/esm/types/PartialExcept.mjs} +0 -0
- /package/dist/{client/utils/AxiosUtils.js → browser/esm/utils/AxiosUtils.mjs} +0 -0
- /package/dist/{client/utils/BooleanUtils.js → browser/esm/utils/BooleanUtils.mjs} +0 -0
- /package/dist/{client/utils/Calc.js → browser/esm/utils/Calc.mjs} +0 -0
- /package/dist/{client/utils/CoordinateUtils.js → browser/esm/utils/CoordinateUtils.mjs} +0 -0
- /package/dist/{client/utils/NumberUtils.js → browser/esm/utils/NumberUtils.mjs} +0 -0
- /package/dist/{client/utils/Point3Utils.js → browser/esm/utils/Point3Utils.mjs} +0 -0
- /package/dist/{client/utils/RandomUtils.js → browser/esm/utils/RandomUtils.mjs} +0 -0
- /package/dist/{client/utils/StringUtils.js → browser/esm/utils/StringUtils.mjs} +0 -0
- /package/dist/{client/utils/UuidUtils.js → browser/esm/utils/UuidUtils.mjs} +0 -0
- /package/dist/{client/utils/Validator.js → browser/esm/utils/Validator.mjs} +0 -0
- /package/dist/{client/utils/global/between.js → browser/esm/utils/global/between.mjs} +0 -0
- /package/dist/{client/utils/global/castArray.js → browser/esm/utils/global/castArray.mjs} +0 -0
- /package/dist/{client/utils/global/circularDistance.js → browser/esm/utils/global/circularDistance.mjs} +0 -0
- /package/dist/{client/utils/global/fallbackIfEqual.js → browser/esm/utils/global/fallbackIfEqual.mjs} +0 -0
- /package/dist/{client/utils/global/firstNonNullish.js → browser/esm/utils/global/firstNonNullish.mjs} +0 -0
- /package/dist/{client/utils/global/flat.js → browser/esm/utils/global/flat.mjs} +0 -0
- /package/dist/{client/utils/global/pureEnum.js → browser/esm/utils/global/pureEnum.mjs} +0 -0
- /package/dist/{client/utils/global/sleep.js → browser/esm/utils/global/sleep.mjs} +0 -0
- /package/dist/{client/utils/try-catch/TryCatch.js → browser/esm/utils/try-catch/TryCatch.mjs} +0 -0
- /package/dist/{client → browser/types}/constants/COORDINATE.d.ts +0 -0
- /package/dist/{client → browser/types}/constants/CRUD.d.ts +0 -0
- /package/dist/{client → browser/types}/constants/DATE.d.ts +0 -0
- /package/dist/{client → browser/types}/constants/DISTANCE.d.ts +0 -0
- /package/dist/{client → browser/types}/constants/DURATION.d.ts +0 -0
- /package/dist/{client → browser/types}/constants/NOT_NULL.d.ts +0 -0
- /package/dist/{client → browser/types}/interfaces/Coordinate.d.ts +0 -0
- /package/dist/{client → browser/types}/interfaces/Point2.d.ts +0 -0
- /package/dist/{client → browser/types}/interfaces/StorageProvider.d.ts +0 -0
- /package/dist/{client → browser/types}/scripts/base64Polyfill.d.ts +0 -0
- /package/dist/{client → browser/types}/services/time/TimeService.type.d.ts +0 -0
- /package/dist/{client → browser/types}/types/IntRage.d.ts +0 -0
- /package/dist/{client → browser/types}/types/PartialExcept.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/ArrayUtils.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/AxiosUtils.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/BooleanUtils.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/Calc.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/JuminNumberUtils.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/NumberUtils.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/ObjectIdUtils.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/RandomUtils.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/Sequencer.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/StringUtils.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/UuidUtils.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/Validator.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/global/between.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/global/castArray.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/global/circularDistance.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/global/fallbackIfEqual.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/global/fallbackIfNull.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/global/fallbackIfUndefined.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/global/firstNonNullish.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/global/flat.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/global/processFirstNonNullish.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/global/pureEnum.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/global/sleep.d.ts +0 -0
- /package/dist/{client → browser/types}/utils/try-catch/TryCatch.d.ts +0 -0
- /package/dist/{server → node/cjs}/constants/nodejs/TransactionManagerLogLevel.js +0 -0
- /package/dist/{server → node/cjs}/constants/nodejs/TransactionManagerTimeoutAction.js +0 -0
- /package/dist/{server/interfaces/nodejs/db/sequelize/Hook.js → node/cjs/interfaces/Coordinate.js} +0 -0
- /package/dist/{server/interfaces/nodejs/db/sequelize/HookFn.js → node/cjs/interfaces/Point2.js} +0 -0
- /package/dist/{server/interfaces/nodejs/db/sequelize/HookType.js → node/cjs/interfaces/Point3.js} +0 -0
- /package/dist/{server/interfaces/nodejs/db/sequelize/ReloadOption.js → node/cjs/interfaces/StorageProvider.js} +0 -0
- /package/dist/{server/interfaces/nodejs/db/sequelize/TransactionOption.js → node/cjs/interfaces/nodejs/db/sequelize/Hook.js} +0 -0
- /package/dist/{server/interfaces/nodejs/db/sequelize/UpsertOptions.js → node/cjs/interfaces/nodejs/db/sequelize/HookFn.js} +0 -0
- /package/dist/{server/managers/TransactionManager.types.js → node/cjs/interfaces/nodejs/db/sequelize/HookType.js} +0 -0
- /package/dist/{server/types/UpsertResult.js → node/cjs/interfaces/nodejs/db/sequelize/ReloadOption.js} +0 -0
- /package/dist/{server/utils/nodejs/sequelize-utils/types.js → node/cjs/interfaces/nodejs/db/sequelize/TransactionOption.js} +0 -0
- /package/dist/{server → node/cjs}/services/redis/RedisClient.js +0 -0
- /package/dist/{server → node/cjs}/utils/nodejs/HookUtils.js +0 -0
- /package/dist/{server → node/types}/constants/COORDINATE.d.ts +0 -0
- /package/dist/{server → node/types}/constants/CRUD.d.ts +0 -0
- /package/dist/{server → node/types}/constants/DATE.d.ts +0 -0
- /package/dist/{server → node/types}/constants/DISTANCE.d.ts +0 -0
- /package/dist/{server → node/types}/constants/DURATION.d.ts +0 -0
- /package/dist/{server → node/types}/constants/NOT_NULL.d.ts +0 -0
- /package/dist/{server → node/types}/constants/nodejs/TransactionManagerLogLevel.d.ts +0 -0
- /package/dist/{server → node/types}/constants/nodejs/TransactionManagerTimeoutAction.d.ts +0 -0
- /package/dist/{server → node/types}/interfaces/Coordinate.d.ts +0 -0
- /package/dist/{server → node/types}/interfaces/Point2.d.ts +0 -0
- /package/dist/{server → node/types}/interfaces/StorageProvider.d.ts +0 -0
- /package/dist/{server → node/types}/interfaces/nodejs/db/sequelize/HookType.d.ts +0 -0
- /package/dist/{server → node/types}/interfaces/nodejs/db/sequelize/ReloadOption.d.ts +0 -0
- /package/dist/{server → node/types}/interfaces/nodejs/db/sequelize/TransactionOption.d.ts +0 -0
- /package/dist/{server → node/types}/scripts/base64Polyfill.d.ts +0 -0
- /package/dist/{server → node/types}/services/redis/RedisClient.d.ts +0 -0
- /package/dist/{server → node/types}/services/time/TimeService.type.d.ts +0 -0
- /package/dist/{server → node/types}/types/IntRage.d.ts +0 -0
- /package/dist/{server → node/types}/types/PartialExcept.d.ts +0 -0
- /package/dist/{server → node/types}/types/UpsertResult.d.ts +0 -0
- /package/dist/{server → node/types}/utils/ArrayUtils.d.ts +0 -0
- /package/dist/{server → node/types}/utils/AxiosUtils.d.ts +0 -0
- /package/dist/{server → node/types}/utils/BooleanUtils.d.ts +0 -0
- /package/dist/{server → node/types}/utils/Calc.d.ts +0 -0
- /package/dist/{server → node/types}/utils/JuminNumberUtils.d.ts +0 -0
- /package/dist/{server → node/types}/utils/NumberUtils.d.ts +0 -0
- /package/dist/{server → node/types}/utils/ObjectIdUtils.d.ts +0 -0
- /package/dist/{server → node/types}/utils/RandomUtils.d.ts +0 -0
- /package/dist/{server → node/types}/utils/Sequencer.d.ts +0 -0
- /package/dist/{server → node/types}/utils/StringUtils.d.ts +0 -0
- /package/dist/{server → node/types}/utils/UuidUtils.d.ts +0 -0
- /package/dist/{server → node/types}/utils/Validator.d.ts +0 -0
- /package/dist/{server → node/types}/utils/global/between.d.ts +0 -0
- /package/dist/{server → node/types}/utils/global/castArray.d.ts +0 -0
- /package/dist/{server → node/types}/utils/global/circularDistance.d.ts +0 -0
- /package/dist/{server → node/types}/utils/global/fallbackIfEqual.d.ts +0 -0
- /package/dist/{server → node/types}/utils/global/fallbackIfNull.d.ts +0 -0
- /package/dist/{server → node/types}/utils/global/fallbackIfUndefined.d.ts +0 -0
- /package/dist/{server → node/types}/utils/global/firstNonNullish.d.ts +0 -0
- /package/dist/{server → node/types}/utils/global/flat.d.ts +0 -0
- /package/dist/{server → node/types}/utils/global/processFirstNonNullish.d.ts +0 -0
- /package/dist/{server → node/types}/utils/global/pureEnum.d.ts +0 -0
- /package/dist/{server → node/types}/utils/global/sleep.d.ts +0 -0
- /package/dist/{server → node/types}/utils/nodejs/sequelize-utils/types.d.ts +0 -0
- /package/dist/{server → node/types}/utils/try-catch/TryCatch.d.ts +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.UuidUtils = void 0;
|
|
37
|
+
const uuid = __importStar(require("uuid"));
|
|
38
|
+
function binaryToString(binary) {
|
|
39
|
+
return Buffer.from(binary).toString('hex');
|
|
40
|
+
}
|
|
41
|
+
class UuidUtils {
|
|
42
|
+
static v4() {
|
|
43
|
+
return uuid.v4();
|
|
44
|
+
}
|
|
45
|
+
static format(uuid) {
|
|
46
|
+
if (uuid.length === 32) {
|
|
47
|
+
// Without dash: ca23c587d7f84c76be59f53bbc9f91f8
|
|
48
|
+
return `${uuid.substring(0, 8)}-${uuid.substring(8, 12)}-${uuid.substring(12, 16)}-${uuid.substring(16, 20)}-${uuid.substring(20, 32)}`.toUpperCase();
|
|
49
|
+
}
|
|
50
|
+
else if (uuid.length === 36) {
|
|
51
|
+
// With dash: ca23c587-d7f8-4c76-be59-f53bbc9f91f8
|
|
52
|
+
return uuid.toUpperCase();
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// Unexpected uuid
|
|
56
|
+
console.warn('Unexpected uuid length', uuid);
|
|
57
|
+
return uuid;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
static toString(binary) {
|
|
61
|
+
if (!binary)
|
|
62
|
+
return null;
|
|
63
|
+
return UuidUtils.format(binaryToString(binary));
|
|
64
|
+
}
|
|
65
|
+
static toBuffer(uuid) {
|
|
66
|
+
if (!uuid) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return Buffer.from(uuid.replace(/-/g, ''), 'hex');
|
|
70
|
+
}
|
|
71
|
+
static isValidUUID(uuid) {
|
|
72
|
+
if (!uuid)
|
|
73
|
+
return false;
|
|
74
|
+
if (typeof uuid !== 'string')
|
|
75
|
+
return false;
|
|
76
|
+
return RegExp(/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/i).test(uuid);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.UuidUtils = UuidUtils;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Validator = void 0;
|
|
4
|
+
class Validator {
|
|
5
|
+
static validate(value, options) {
|
|
6
|
+
value = value || '';
|
|
7
|
+
const validations = [];
|
|
8
|
+
const errors = [];
|
|
9
|
+
const { length } = value;
|
|
10
|
+
const spaceCount = (value.match(/\s/g) || []).length;
|
|
11
|
+
const numberCount = (value.match(/\d/g) || []).length;
|
|
12
|
+
const alphabetCount = (value.match(/[A-Za-z]/g) || []).length;
|
|
13
|
+
const alphabetLowerCaseCount = (value.match(/[a-z]/g) || []).length;
|
|
14
|
+
const alphabetUpperCaseCount = (value.match(/[A-Z]/g) || []).length;
|
|
15
|
+
const specialCount = (value.match(/[~`!@#$%^&*()\-+={[}\]|\\:;"'<,>.?/]/g) || []).length;
|
|
16
|
+
const startsWithNumber = /^\d/.test(value);
|
|
17
|
+
const startsWithAlphabet = /^[A-Za-z]/.test(value);
|
|
18
|
+
const startsWithSpecialCharacter = /^[~`!@#$%^&*()\-+={[}\]|\\:;"'<,>.?/]/.test(value);
|
|
19
|
+
// 최소 길이
|
|
20
|
+
if (options.minLength !== undefined && options.minLength > -1) {
|
|
21
|
+
validations.push(Validator.VALIDATION.MIN_LENGTH);
|
|
22
|
+
if (length < options.minLength) {
|
|
23
|
+
errors.push(Validator.VALIDATION.MIN_LENGTH);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// 최대 길이
|
|
27
|
+
if (options.maxLength !== undefined && options.maxLength > -1) {
|
|
28
|
+
validations.push(Validator.VALIDATION.MAX_LENGTH);
|
|
29
|
+
if (length > options.maxLength) {
|
|
30
|
+
errors.push(Validator.VALIDATION.MAX_LENGTH);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const validateMin = (option, value, validation) => {
|
|
34
|
+
if (option !== undefined && option > -1) {
|
|
35
|
+
validations.push(validation);
|
|
36
|
+
if (value < option) {
|
|
37
|
+
errors.push(validation);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const validateMax = (option, value, validation) => {
|
|
42
|
+
if (option !== undefined && option > -1) {
|
|
43
|
+
validations.push(validation);
|
|
44
|
+
if (value > option) {
|
|
45
|
+
errors.push(validation);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
// 공백 개수
|
|
50
|
+
validateMin(options.spaceMinCount, spaceCount, Validator.VALIDATION.SPACE_MIN_COUNT);
|
|
51
|
+
validateMax(options.spaceMaxCount, spaceCount, Validator.VALIDATION.SPACE_MAX_COUNT);
|
|
52
|
+
// 숫자 개수
|
|
53
|
+
validateMin(options.numberMinCount, numberCount, Validator.VALIDATION.NUMBER_MIN_COUNT);
|
|
54
|
+
validateMax(options.numberMaxCount, numberCount, Validator.VALIDATION.NUMBER_MAX_COUNT);
|
|
55
|
+
// 알파벳 개수
|
|
56
|
+
validateMin(options.alphabetMinCount, alphabetCount, Validator.VALIDATION.ALPHABET_MIN_COUNT);
|
|
57
|
+
validateMax(options.alphabetMaxCount, alphabetCount, Validator.VALIDATION.ALPHABET_MAX_COUNT);
|
|
58
|
+
// 알파벳(소문자) 개수
|
|
59
|
+
validateMin(options.alphabetLowerCaseMinCount, alphabetLowerCaseCount, Validator.VALIDATION.ALPHABET_LOWER_CASE_MIN_COUNT);
|
|
60
|
+
validateMax(options.alphabetLowerCaseMaxCount, alphabetLowerCaseCount, Validator.VALIDATION.ALPHABET_LOWER_CASE_MAX_COUNT);
|
|
61
|
+
// 알파벳(대문자) 개수
|
|
62
|
+
validateMin(options.alphabetUpperCaseMinCount, alphabetUpperCaseCount, Validator.VALIDATION.ALPHABET_UPPER_CASE_MIN_COUNT);
|
|
63
|
+
validateMax(options.alphabetUpperCaseMaxCount, alphabetUpperCaseCount, Validator.VALIDATION.ALPHABET_UPPER_CASE_MAX_COUNT);
|
|
64
|
+
// 특수문자 개수
|
|
65
|
+
validateMin(options.specialCharacterMinCount, specialCount, Validator.VALIDATION.SPECIAL_CHARACTER_MIN_COUNT);
|
|
66
|
+
validateMax(options.specialCharacterMaxCount, specialCount, Validator.VALIDATION.SPECIAL_CHARACTER_MAX_COUNT);
|
|
67
|
+
// 숫자로 시작
|
|
68
|
+
if (options.startsWithNumber) {
|
|
69
|
+
validations.push(Validator.VALIDATION.STARTS_WITH_NUMBER);
|
|
70
|
+
if (!startsWithNumber) {
|
|
71
|
+
errors.push(Validator.VALIDATION.STARTS_WITH_NUMBER);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// 영문으로 시작
|
|
75
|
+
if (options.startsWithAlphabet) {
|
|
76
|
+
validations.push(Validator.VALIDATION.STARTS_WITH_ALPHABET);
|
|
77
|
+
if (!startsWithAlphabet) {
|
|
78
|
+
errors.push(Validator.VALIDATION.STARTS_WITH_ALPHABET);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// 특수문자로 시작
|
|
82
|
+
if (options.startsWithSpecialCharacter) {
|
|
83
|
+
validations.push(Validator.VALIDATION.STARTS_WITH_SPECIAL_CHARACTER);
|
|
84
|
+
if (!startsWithSpecialCharacter) {
|
|
85
|
+
errors.push(Validator.VALIDATION.STARTS_WITH_SPECIAL_CHARACTER);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return {
|
|
89
|
+
result: errors.length === 0,
|
|
90
|
+
validations,
|
|
91
|
+
passes: validations.filter(e => !errors.includes(e)),
|
|
92
|
+
errors,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.Validator = Validator;
|
|
97
|
+
(function (Validator) {
|
|
98
|
+
let VALIDATION;
|
|
99
|
+
(function (VALIDATION) {
|
|
100
|
+
VALIDATION["MIN_LENGTH"] = "MIN_LENGTH";
|
|
101
|
+
VALIDATION["MAX_LENGTH"] = "MAX_LENGTH";
|
|
102
|
+
VALIDATION["SPACE_MIN_COUNT"] = "SPACE_MIN_COUNT";
|
|
103
|
+
VALIDATION["SPACE_MAX_COUNT"] = "SPACE_MAX_COUNT";
|
|
104
|
+
VALIDATION["NUMBER_MIN_COUNT"] = "NUMBER_MIN_COUNT";
|
|
105
|
+
VALIDATION["NUMBER_MAX_COUNT"] = "NUMBER_MAX_COUNT";
|
|
106
|
+
VALIDATION["ALPHABET_MIN_COUNT"] = "ALPHABET_MIN_COUNT";
|
|
107
|
+
VALIDATION["ALPHABET_MAX_COUNT"] = "ALPHABET_MAX_COUNT";
|
|
108
|
+
VALIDATION["ALPHABET_LOWER_CASE_MIN_COUNT"] = "ALPHABET_LOWER_CASE_MIN_COUNT";
|
|
109
|
+
VALIDATION["ALPHABET_LOWER_CASE_MAX_COUNT"] = "ALPHABET_LOWER_CASE_MAX_COUNT";
|
|
110
|
+
VALIDATION["ALPHABET_UPPER_CASE_MIN_COUNT"] = "ALPHABET_UPPER_CASE_MIN_COUNT";
|
|
111
|
+
VALIDATION["ALPHABET_UPPER_CASE_MAX_COUNT"] = "ALPHABET_UPPER_CASE_MAX_COUNT";
|
|
112
|
+
VALIDATION["SPECIAL_CHARACTER_MIN_COUNT"] = "SPECIAL_CHARACTER_MIN_COUNT";
|
|
113
|
+
VALIDATION["SPECIAL_CHARACTER_MAX_COUNT"] = "SPECIAL_CHARACTER_MAX_COUNT";
|
|
114
|
+
VALIDATION["STARTS_WITH_ALPHABET"] = "STARTS_WITH_ALPHABET";
|
|
115
|
+
VALIDATION["STARTS_WITH_NUMBER"] = "STARTS_WITH_NUMBER";
|
|
116
|
+
VALIDATION["STARTS_WITH_SPECIAL_CHARACTER"] = "STARTS_WITH_SPECIAL_CHARACTER";
|
|
117
|
+
})(VALIDATION = Validator.VALIDATION || (Validator.VALIDATION = {}));
|
|
118
|
+
})(Validator || (exports.Validator = Validator = {}));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.circularDistance = circularDistance;
|
|
4
|
+
function circularDistance(value, target, min, max) {
|
|
5
|
+
const range = max - min;
|
|
6
|
+
const from = value - min;
|
|
7
|
+
const to = target - min;
|
|
8
|
+
if (to >= from) {
|
|
9
|
+
return to - from;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
return range - from + to;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fallbackIfEqual = fallbackIfEqual;
|
|
4
|
+
function fallbackIfEqual(value, condition, fallback) {
|
|
5
|
+
if (typeof value === typeof condition && value === condition) {
|
|
6
|
+
return fallback;
|
|
7
|
+
}
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fallbackIfNull = fallbackIfNull;
|
|
4
|
+
const fallbackIfEqual_1 = require("./fallbackIfEqual");
|
|
5
|
+
function fallbackIfNull(value, fallback) {
|
|
6
|
+
return (0, fallbackIfEqual_1.fallbackIfEqual)(value, null, fallback);
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fallbackIfUndefined = fallbackIfUndefined;
|
|
4
|
+
const fallbackIfEqual_1 = require("./fallbackIfEqual");
|
|
5
|
+
function fallbackIfUndefined(value, fallback) {
|
|
6
|
+
return (0, fallbackIfEqual_1.fallbackIfEqual)(value, undefined, fallback);
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.firstNonNullish = firstNonNullish;
|
|
4
|
+
function firstNonNullish(...args) {
|
|
5
|
+
if (args == null || !Array.isArray(args) || args.length === 0) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
if (args[0] != null) {
|
|
9
|
+
// Not Nullish
|
|
10
|
+
return args[0];
|
|
11
|
+
}
|
|
12
|
+
return firstNonNullish(...args.slice(1));
|
|
13
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// flat.ts
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.flatten = flatten;
|
|
5
|
+
exports.unflatten = unflatten;
|
|
6
|
+
function isBuffer(obj) {
|
|
7
|
+
return !!(obj &&
|
|
8
|
+
obj.constructor &&
|
|
9
|
+
typeof obj.constructor.isBuffer === 'function' &&
|
|
10
|
+
obj.constructor.isBuffer(obj));
|
|
11
|
+
}
|
|
12
|
+
function keyIdentity(key) {
|
|
13
|
+
return key;
|
|
14
|
+
}
|
|
15
|
+
function flatten(target, opts = {}) {
|
|
16
|
+
const delimiter = opts.delimiter || '.';
|
|
17
|
+
const maxDepth = opts.maxDepth;
|
|
18
|
+
const transformKey = opts.transformKey || keyIdentity;
|
|
19
|
+
const output = {};
|
|
20
|
+
function step(object, prev, currentDepth = 1) {
|
|
21
|
+
Object.keys(object).forEach((key) => {
|
|
22
|
+
const value = object[key];
|
|
23
|
+
const isarray = opts.safe && Array.isArray(value);
|
|
24
|
+
const type = Object.prototype.toString.call(value);
|
|
25
|
+
const isbuffer = isBuffer(value);
|
|
26
|
+
const isobject = type === '[object Object]' || type === '[object Array]';
|
|
27
|
+
const newKey = prev
|
|
28
|
+
? `${prev}${delimiter}${transformKey(key)}`
|
|
29
|
+
: transformKey(key);
|
|
30
|
+
if (!isarray &&
|
|
31
|
+
!isbuffer &&
|
|
32
|
+
isobject &&
|
|
33
|
+
Object.keys(value).length &&
|
|
34
|
+
(!maxDepth || currentDepth < maxDepth)) {
|
|
35
|
+
return step(value, newKey, currentDepth + 1);
|
|
36
|
+
}
|
|
37
|
+
output[newKey] = value;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
step(target);
|
|
41
|
+
return output;
|
|
42
|
+
}
|
|
43
|
+
function unflatten(target, opts = {}) {
|
|
44
|
+
const delimiter = opts.delimiter || '.';
|
|
45
|
+
const overwrite = opts.overwrite || false;
|
|
46
|
+
const transformKey = opts.transformKey || keyIdentity;
|
|
47
|
+
const result = {};
|
|
48
|
+
if (isBuffer(target) ||
|
|
49
|
+
Object.prototype.toString.call(target) !== '[object Object]') {
|
|
50
|
+
return target;
|
|
51
|
+
}
|
|
52
|
+
function getkey(key) {
|
|
53
|
+
const parsedKey = Number(key);
|
|
54
|
+
return isNaN(parsedKey) || key.indexOf('.') !== -1 || opts.object
|
|
55
|
+
? key
|
|
56
|
+
: parsedKey;
|
|
57
|
+
}
|
|
58
|
+
function addKeys(keyPrefix, recipient, target) {
|
|
59
|
+
return Object.keys(target).reduce((res, key) => {
|
|
60
|
+
res[`${keyPrefix}${delimiter}${key}`] = target[key];
|
|
61
|
+
return res;
|
|
62
|
+
}, recipient);
|
|
63
|
+
}
|
|
64
|
+
function isEmpty(val) {
|
|
65
|
+
const type = Object.prototype.toString.call(val);
|
|
66
|
+
const isArray = type === '[object Array]';
|
|
67
|
+
const isObject = type === '[object Object]';
|
|
68
|
+
if (!val) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
else if (isArray) {
|
|
72
|
+
return !val.length;
|
|
73
|
+
}
|
|
74
|
+
else if (isObject) {
|
|
75
|
+
return !Object.keys(val).length;
|
|
76
|
+
}
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
const target2 = Object.keys(target).reduce((res, key) => {
|
|
80
|
+
const value = target[key];
|
|
81
|
+
const type = Object.prototype.toString.call(value);
|
|
82
|
+
const isObject = type === '[object Object]' || type === '[object Array]';
|
|
83
|
+
if (!isObject || isEmpty(value)) {
|
|
84
|
+
res[key] = value;
|
|
85
|
+
return res;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return addKeys(key, res, flatten(value, opts));
|
|
89
|
+
}
|
|
90
|
+
}, {});
|
|
91
|
+
Object.keys(target2).forEach((key) => {
|
|
92
|
+
const split = key.split(delimiter).map(transformKey);
|
|
93
|
+
let key1 = getkey(split.shift());
|
|
94
|
+
let key2 = getkey(split[0]);
|
|
95
|
+
let recipient = result;
|
|
96
|
+
while (key2 !== undefined) {
|
|
97
|
+
if (key1 === '__proto__')
|
|
98
|
+
return;
|
|
99
|
+
const type = Object.prototype.toString.call(recipient[key1]);
|
|
100
|
+
const isobject = type === '[object Object]' || type === '[object Array]';
|
|
101
|
+
if (!overwrite && !isobject && typeof recipient[key1] !== 'undefined') {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if ((overwrite && !isobject) || (!overwrite && recipient[key1] == null)) {
|
|
105
|
+
recipient[key1] =
|
|
106
|
+
typeof key2 === 'number' && !opts.object ? [] : {};
|
|
107
|
+
}
|
|
108
|
+
recipient = recipient[key1];
|
|
109
|
+
if (split.length > 0) {
|
|
110
|
+
key1 = getkey(split.shift());
|
|
111
|
+
key2 = getkey(split[0]);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
recipient[key1] = unflatten(target2[key], opts);
|
|
115
|
+
});
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./between"), exports);
|
|
18
|
+
__exportStar(require("./castArray"), exports);
|
|
19
|
+
__exportStar(require("./circularDistance"), exports);
|
|
20
|
+
__exportStar(require("./sleep"), exports);
|
|
21
|
+
__exportStar(require("./fallbackIfEqual"), exports);
|
|
22
|
+
__exportStar(require("./fallbackIfNull"), exports);
|
|
23
|
+
__exportStar(require("./fallbackIfUndefined"), exports);
|
|
24
|
+
__exportStar(require("./firstNonNullish"), exports);
|
|
25
|
+
__exportStar(require("./flat"), exports);
|
|
26
|
+
__exportStar(require("./processFirstNonNullish"), exports);
|
|
27
|
+
__exportStar(require("./pureEnum"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processFirstNonNullish = processFirstNonNullish;
|
|
4
|
+
const firstNonNullish_1 = require("./firstNonNullish");
|
|
5
|
+
function processFirstNonNullish(processor, ...args) {
|
|
6
|
+
const fallback = (0, firstNonNullish_1.firstNonNullish)(...args);
|
|
7
|
+
if (fallback == null) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
return processor(fallback);
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.pureEnum = pureEnum;
|
|
4
|
+
exports.pureEnumKeys = pureEnumKeys;
|
|
5
|
+
exports.pureEnumValues = pureEnumValues;
|
|
6
|
+
function pureEnum(e) {
|
|
7
|
+
return Object.entries(e).filter(([key, value]) => !/^-?\d+$/g.test(key) && typeof value !== 'function');
|
|
8
|
+
}
|
|
9
|
+
function pureEnumKeys(e) {
|
|
10
|
+
return pureEnum(e).map(([key]) => key);
|
|
11
|
+
}
|
|
12
|
+
function pureEnumValues(e) {
|
|
13
|
+
return pureEnum(e).map(([, value]) => value);
|
|
14
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./global"), exports);
|
|
18
|
+
__exportStar(require("./ArrayUtils"), exports);
|
|
19
|
+
__exportStar(require("./AxiosUtils"), exports);
|
|
20
|
+
__exportStar(require("./StringUtils"), exports);
|
|
21
|
+
__exportStar(require("./UuidUtils"), exports);
|
|
22
|
+
__exportStar(require("./BooleanUtils"), exports);
|
|
23
|
+
__exportStar(require("./Calc"), exports);
|
|
24
|
+
__exportStar(require("./CoordinateUtils"), exports);
|
|
25
|
+
__exportStar(require("./DateUtils"), exports);
|
|
26
|
+
__exportStar(require("./NumberUtils"), exports);
|
|
27
|
+
__exportStar(require("./ObjectIdUtils"), exports);
|
|
28
|
+
__exportStar(require("./Point3Utils"), exports);
|
|
29
|
+
__exportStar(require("./RandomUtils"), exports);
|
|
30
|
+
__exportStar(require("./Validator"), exports);
|
|
31
|
+
__exportStar(require("./JuminNumberUtils"), exports);
|
|
32
|
+
__exportStar(require("./Sequencer"), exports);
|
|
33
|
+
__exportStar(require("./try-catch"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./index.browser"), exports);
|
|
18
|
+
__exportStar(require("./nodejs"), exports);
|
|
@@ -15,6 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.SequelizeUtils = void 0;
|
|
18
|
-
__exportStar(require("./HookUtils
|
|
19
|
-
var
|
|
20
|
-
Object.defineProperty(exports, "SequelizeUtils", { enumerable: true, get: function () { return
|
|
18
|
+
__exportStar(require("./HookUtils"), exports);
|
|
19
|
+
var sequelize_utils_1 = require("./sequelize-utils");
|
|
20
|
+
Object.defineProperty(exports, "SequelizeUtils", { enumerable: true, get: function () { return sequelize_utils_1.SequelizeUtils; } });
|
|
@@ -13,8 +13,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.SequelizeUtils = void 0;
|
|
15
15
|
const sequelize_1 = require("sequelize");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const UuidUtils_1 = require("../../UuidUtils");
|
|
17
|
+
const constants_1 = require("../../../constants");
|
|
18
18
|
class SequelizeUtils {
|
|
19
19
|
static decimal2Number(value) {
|
|
20
20
|
if (value === null || value === undefined) {
|
|
@@ -34,18 +34,18 @@ class SequelizeUtils {
|
|
|
34
34
|
if (value === null) {
|
|
35
35
|
return value;
|
|
36
36
|
}
|
|
37
|
-
return
|
|
37
|
+
return UuidUtils_1.UuidUtils.toString(this.getDataValue(columnName));
|
|
38
38
|
},
|
|
39
39
|
set(uuid) {
|
|
40
|
-
this.setDataValue(columnName, uuid === null ? null :
|
|
40
|
+
this.setDataValue(columnName, uuid === null ? null : UuidUtils_1.UuidUtils.toBuffer(uuid));
|
|
41
41
|
} }, overrideOptions);
|
|
42
42
|
}
|
|
43
43
|
else {
|
|
44
44
|
return Object.assign({ type: "binary(16)", get() {
|
|
45
|
-
return
|
|
45
|
+
return UuidUtils_1.UuidUtils.toString(this.getDataValue(columnName));
|
|
46
46
|
},
|
|
47
47
|
set(uuid) {
|
|
48
|
-
this.setDataValue(columnName,
|
|
48
|
+
this.setDataValue(columnName, UuidUtils_1.UuidUtils.toBuffer(uuid));
|
|
49
49
|
} }, overrideOptions);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -55,7 +55,7 @@ class SequelizeUtils {
|
|
|
55
55
|
if (value === null) {
|
|
56
56
|
return { [sequelize_1.Op.is]: value };
|
|
57
57
|
}
|
|
58
|
-
else if (value ===
|
|
58
|
+
else if (value === constants_1.NOT_NULL) {
|
|
59
59
|
return { [sequelize_1.Op.not]: null };
|
|
60
60
|
}
|
|
61
61
|
else {
|
|
@@ -71,5 +71,5 @@ SequelizeUtils.buildPrimaryUuidColumn = () => (Object.assign({}, SequelizeUtils.
|
|
|
71
71
|
allowNull: false,
|
|
72
72
|
primaryKey: true,
|
|
73
73
|
unique: true,
|
|
74
|
-
defaultValue: () =>
|
|
74
|
+
defaultValue: () => UuidUtils_1.UuidUtils.toBuffer(UuidUtils_1.UuidUtils.v4()),
|
|
75
75
|
})));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SequelizeUtils = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "SequelizeUtils", { enumerable: true, get: function () { return
|
|
4
|
+
var SequelizeUtils_1 = require("./SequelizeUtils");
|
|
5
|
+
Object.defineProperty(exports, "SequelizeUtils", { enumerable: true, get: function () { return SequelizeUtils_1.SequelizeUtils; } });
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TryCatch = void 0;
|
|
13
|
+
/**
|
|
14
|
+
* Provides a utility class for handling synchronous and asynchronous operations with a consistent try-catch pattern.
|
|
15
|
+
* It returns a tuple where the first element is the error (or null on success) and the second element is the result (or undefined on error).
|
|
16
|
+
*/
|
|
17
|
+
class TryCatch {
|
|
18
|
+
/**
|
|
19
|
+
* Executes a synchronous function within a try-catch block.
|
|
20
|
+
* @template T The return type of the function.
|
|
21
|
+
* @template E The type of the error that might be thrown (defaults to Error).
|
|
22
|
+
* @param fn The synchronous function to execute.
|
|
23
|
+
*@param disableLogging console.error is default way of logging on error. You can disable it by setting it true
|
|
24
|
+
* @returns A tuple containing the result of the function and an error (null if successful).
|
|
25
|
+
*/
|
|
26
|
+
static function(fn, disableLogging) {
|
|
27
|
+
try {
|
|
28
|
+
return [
|
|
29
|
+
null,
|
|
30
|
+
fn(),
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
if (!disableLogging) {
|
|
35
|
+
console.error("ERROR in TryCatch: ", e);
|
|
36
|
+
}
|
|
37
|
+
if (e == null) {
|
|
38
|
+
e = new Error("Unknown error");
|
|
39
|
+
}
|
|
40
|
+
return [
|
|
41
|
+
e,
|
|
42
|
+
undefined,
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Executes an asynchronous function (Promise) within a try-catch block.
|
|
48
|
+
* @template T The resolved value type of the Promise.
|
|
49
|
+
* @template E The type of the error that might be rejected (defaults to Error).
|
|
50
|
+
* @param fn The Promise to await.
|
|
51
|
+
* @param disableLogging console.error is default way of logging on error. You can disable it by setting it true
|
|
52
|
+
* @returns A tuple containing the resolved value of the Promise and an error (null if successful).
|
|
53
|
+
*/
|
|
54
|
+
static asyncFunction(fn, disableLogging) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
try {
|
|
57
|
+
const data = yield fn;
|
|
58
|
+
return [
|
|
59
|
+
null,
|
|
60
|
+
data,
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
catch (e) {
|
|
64
|
+
if (!disableLogging) {
|
|
65
|
+
console.error("ERROR in TryCatch: ", e);
|
|
66
|
+
}
|
|
67
|
+
if (e == null) {
|
|
68
|
+
e = new Error("Unknown error");
|
|
69
|
+
}
|
|
70
|
+
return [
|
|
71
|
+
e,
|
|
72
|
+
undefined,
|
|
73
|
+
];
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.TryCatch = TryCatch;
|