@powfix/core-js 0.23.2 → 0.23.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/browser/index.d.ts +1 -2
- package/dist/index.browser.d.ts +2 -57
- package/dist/index.d.ts +1 -57
- package/dist/index.node.d.ts +2 -81
- package/dist/node/constants/TransactionManagerLogLevel.d.ts +1 -3
- package/dist/node/constants/TransactionManagerTimeoutAction.d.ts +1 -3
- package/dist/node/constants/index.d.ts +2 -2
- package/dist/node/index.d.ts +6 -25
- package/dist/node/interfaces/db/index.d.ts +1 -10
- package/dist/node/interfaces/db/sequelize/Hook.d.ts +4 -9
- package/dist/node/interfaces/db/sequelize/HookFn.d.ts +4 -7
- package/dist/node/interfaces/db/sequelize/HookType.d.ts +3 -6
- package/dist/node/interfaces/db/sequelize/ReloadOption.d.ts +1 -3
- package/dist/node/interfaces/db/sequelize/TransactionOption.d.ts +2 -5
- package/dist/node/interfaces/db/sequelize/UpsertOptions.d.ts +3 -7
- package/dist/node/interfaces/db/sequelize/index.d.ts +6 -10
- package/dist/node/interfaces/index.d.ts +1 -10
- package/dist/node/managers/TransactionManager.d.ts +4 -8
- package/dist/node/managers/TransactionManager.types.d.ts +4 -7
- package/dist/node/managers/index.d.ts +2 -6
- package/dist/node/services/index.d.ts +1 -5
- package/dist/node/services/redis/RedisClient.d.ts +2 -5
- package/dist/node/services/redis/RedisPublisher.d.ts +3 -7
- package/dist/node/services/redis/RedisSubscriber.d.ts +3 -7
- package/dist/node/services/redis/index.d.ts +3 -5
- package/dist/node/types/UpsertResult.d.ts +2 -5
- package/dist/node/types/index.d.ts +2 -9
- package/dist/node/types/mariaDb.d.ts +4 -11
- package/dist/node/utils/HookUtils.d.ts +3 -10
- package/dist/node/utils/index.d.ts +2 -10
- package/dist/node/utils/sequelize-utils/SequelizeUtils.cjs +1 -2
- package/dist/node/utils/sequelize-utils/SequelizeUtils.d.ts +3 -6
- package/dist/node/utils/sequelize-utils/SequelizeUtils.js +1 -2
- package/dist/node/utils/sequelize-utils/index.d.ts +2 -3
- package/dist/node/utils/sequelize-utils/types.d.ts +8 -11
- package/dist/shared/constants/COORDINATE.d.ts +2 -4
- package/dist/shared/constants/CRUD.d.ts +2 -4
- package/dist/shared/constants/DATE.d.ts +2 -4
- package/dist/shared/constants/DISTANCE.d.ts +2 -4
- package/dist/shared/constants/DURATION.d.ts +2 -4
- package/dist/shared/constants/NOT_NULL.d.ts +1 -3
- package/dist/shared/constants/index.d.ts +6 -6
- package/dist/shared/exports/Uint8Array.d.ts +1 -0
- package/dist/shared/exports/atob.d.ts +1 -2
- package/dist/shared/exports/btoa.d.ts +1 -2
- package/dist/shared/index.d.ts +7 -57
- package/dist/shared/interfaces/Coordinate.d.ts +2 -4
- package/dist/shared/interfaces/Point2.d.ts +1 -3
- package/dist/shared/interfaces/Point3.d.ts +2 -5
- package/dist/shared/interfaces/StorageProvider.d.ts +1 -3
- package/dist/shared/interfaces/index.d.ts +4 -4
- package/dist/shared/managers/SessionManager.d.ts +4 -7
- package/dist/shared/managers/SessionManager.type.d.ts +4 -7
- package/dist/shared/managers/index.d.ts +2 -5
- package/dist/shared/scripts/base64Polyfill.d.ts +1 -3
- package/dist/shared/scripts/index.d.ts +1 -1
- package/dist/shared/services/index.d.ts +1 -3
- package/dist/shared/services/time/TimeService.d.ts +2 -5
- package/dist/shared/services/time/TimeService.type.d.ts +8 -10
- package/dist/shared/services/time/index.d.ts +2 -3
- package/dist/shared/types/IntRage.d.ts +2 -3
- package/dist/shared/types/PartialExcept.d.ts +1 -3
- package/dist/shared/types/index.d.ts +2 -2
- package/dist/shared/utils/ArrayUtils.d.ts +1 -3
- package/dist/shared/utils/AxiosUtils.d.ts +2 -5
- package/dist/shared/utils/BooleanUtils.d.ts +1 -3
- package/dist/shared/utils/Calc.d.ts +1 -3
- package/dist/shared/utils/CoordinateUtils.d.ts +2 -5
- package/dist/shared/utils/DateUtils.d.ts +4 -7
- package/dist/shared/utils/Enum.d.ts +2 -5
- package/dist/shared/utils/Enum.types.d.ts +3 -4
- package/dist/shared/utils/I18nUtils.d.ts +2 -5
- package/dist/shared/utils/JuminNumberUtils.d.ts +1 -3
- package/dist/shared/utils/NumberUtils.d.ts +1 -3
- package/dist/shared/utils/ObjectIdUtils.cjs +3 -3
- package/dist/shared/utils/ObjectIdUtils.d.ts +3 -4
- package/dist/shared/utils/ObjectIdUtils.js +3 -3
- package/dist/shared/utils/Point3Utils.d.ts +2 -6
- package/dist/shared/utils/RandomUtils.d.ts +1 -3
- package/dist/shared/utils/Sequencer.d.ts +7 -10
- package/dist/shared/utils/StringUtils.d.ts +1 -3
- package/dist/shared/utils/Uint8ArrayUtils.d.ts +1 -3
- package/dist/shared/utils/UuidUtils.d.ts +1 -3
- package/dist/shared/utils/Validator.d.ts +2 -4
- package/dist/shared/utils/global/atob.d.ts +2 -5
- package/dist/shared/utils/global/base64.d.ts +2 -4
- package/dist/shared/utils/global/between.d.ts +1 -3
- package/dist/shared/utils/global/btoa.d.ts +2 -5
- package/dist/shared/utils/global/castArray.d.ts +1 -3
- package/dist/shared/utils/global/circularDistance.d.ts +1 -3
- package/dist/shared/utils/global/fallbackIfMatch.d.ts +1 -3
- package/dist/shared/utils/global/fallbackIfNull.d.ts +1 -3
- package/dist/shared/utils/global/fallbackIfNullish.d.ts +1 -3
- package/dist/shared/utils/global/fallbackIfUndefined.d.ts +1 -3
- package/dist/shared/utils/global/firstNonNullish.d.ts +1 -3
- package/dist/shared/utils/global/flat.d.ts +4 -6
- package/dist/shared/utils/global/index.d.ts +15 -16
- package/dist/shared/utils/global/processFirstNonNullish.d.ts +1 -3
- package/dist/shared/utils/global/pureEnum.d.ts +4 -5
- package/dist/shared/utils/global/sleep.d.ts +1 -3
- package/dist/shared/utils/index.d.ts +21 -44
- package/dist/shared/utils/try-catch/TryCatch.d.ts +1 -3
- package/dist/shared/utils/try-catch/index.d.ts +1 -1
- package/package.json +5 -4
|
@@ -18,8 +18,8 @@ function _create_class(Constructor, protoProps, staticProps) {
|
|
|
18
18
|
return Constructor;
|
|
19
19
|
}
|
|
20
20
|
import '../../chunk-PKBMQBKP.js';
|
|
21
|
-
import { UuidUtils } from './UuidUtils';
|
|
22
21
|
import { Uint8ArrayUtils } from './Uint8ArrayUtils';
|
|
22
|
+
import { UUID } from '@powfix/uuid/node';
|
|
23
23
|
var ObjectIdUtils = /*#__PURE__*/ function() {
|
|
24
24
|
"use strict";
|
|
25
25
|
function ObjectIdUtils() {
|
|
@@ -37,13 +37,13 @@ var ObjectIdUtils = /*#__PURE__*/ function() {
|
|
|
37
37
|
var result = new Uint8Array(16);
|
|
38
38
|
var offset = pad === "start" ? 4 : 0;
|
|
39
39
|
result.set(src, offset);
|
|
40
|
-
return
|
|
40
|
+
return UUID.from(result).toString();
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
key: "fromUuid",
|
|
45
45
|
value: function fromUuid(uuid, pad) {
|
|
46
|
-
var buffer =
|
|
46
|
+
var buffer = UUID.from(uuid).toBuffer();
|
|
47
47
|
var isPadEnd = buffer.subarray(buffer.length - 4).every(function(byte) {
|
|
48
48
|
return byte === 0;
|
|
49
49
|
});
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { Point3 } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare class Point3Utils {
|
|
1
|
+
import { Point3 } from "../interfaces/Point3";
|
|
2
|
+
export declare class Point3Utils {
|
|
5
3
|
static distance(p1: Point3, p2: Point3): number;
|
|
6
4
|
}
|
|
7
|
-
|
|
8
|
-
export { Point3Utils };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare class RandomUtils {
|
|
1
|
+
export declare class RandomUtils {
|
|
2
2
|
static randomNumber(min: number, max: number): number;
|
|
3
3
|
static randomLatinStrings(length: number): string;
|
|
4
4
|
static randomLatinLowercaseStrings(length: number): string;
|
|
@@ -6,5 +6,3 @@ declare class RandomUtils {
|
|
|
6
6
|
static randomNumberStrings(length: number): string;
|
|
7
7
|
static randomStrings(length: number): string;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
export { RandomUtils };
|
|
@@ -1,41 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
interface Sequence {
|
|
1
|
+
import EventEmitter3 from 'eventemitter3';
|
|
2
|
+
export interface Sequence {
|
|
4
3
|
key: string;
|
|
5
4
|
required?: boolean;
|
|
6
5
|
minimumExecutionTime?: number;
|
|
7
6
|
task: Function;
|
|
8
7
|
description?: string;
|
|
9
8
|
}
|
|
10
|
-
declare enum SequencerStatus {
|
|
9
|
+
export declare enum SequencerStatus {
|
|
11
10
|
IDLE = 0,
|
|
12
11
|
RUNNING = 1,
|
|
13
12
|
ERROR = 2,
|
|
14
13
|
DONE = 3
|
|
15
14
|
}
|
|
16
|
-
interface SequencerOption {
|
|
15
|
+
export interface SequencerOption {
|
|
17
16
|
sequences?: Sequence[];
|
|
18
17
|
minimumExecutionTime?: number;
|
|
19
18
|
}
|
|
20
|
-
declare enum SequencerEvent {
|
|
19
|
+
export declare enum SequencerEvent {
|
|
21
20
|
START = "START",
|
|
22
21
|
END = "END",
|
|
23
22
|
SEQUENCE_START = "SEQUENCE_START",
|
|
24
23
|
SEQUENCE_END = "SEQUENCE_END"
|
|
25
24
|
}
|
|
26
|
-
declare class Sequencer {
|
|
25
|
+
export declare class Sequencer {
|
|
27
26
|
protected readonly sequences: Sequence[];
|
|
28
27
|
protected status: SequencerStatus;
|
|
29
28
|
protected minimumExecutionTime: number;
|
|
30
29
|
currentSequence: Sequence | null;
|
|
31
30
|
startTimestamp: number | null;
|
|
32
31
|
endTimestamp: number | null;
|
|
33
|
-
eventEmitter:
|
|
32
|
+
eventEmitter: EventEmitter3<string | symbol, any>;
|
|
34
33
|
constructor(option?: SequencerOption);
|
|
35
34
|
get getCurrentTimeStamp(): number;
|
|
36
35
|
get executionTime(): number | null;
|
|
37
36
|
pushSequence: (sequence: Sequence) => void;
|
|
38
37
|
start: () => Promise<undefined>;
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
export { type Sequence, Sequencer, SequencerEvent, type SequencerOption, SequencerStatus };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare class Validator {
|
|
1
|
+
export declare class Validator {
|
|
2
2
|
static validate(value: string | null | undefined, options: Validator.Options): {
|
|
3
3
|
result: boolean;
|
|
4
4
|
validations: Validator.VALIDATION[];
|
|
@@ -6,7 +6,7 @@ declare class Validator {
|
|
|
6
6
|
errors: Validator.VALIDATION[];
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
declare namespace Validator {
|
|
9
|
+
export declare namespace Validator {
|
|
10
10
|
enum VALIDATION {
|
|
11
11
|
MIN_LENGTH = "MIN_LENGTH",
|
|
12
12
|
MAX_LENGTH = "MAX_LENGTH",
|
|
@@ -46,5 +46,3 @@ declare namespace Validator {
|
|
|
46
46
|
startsWithSpecialCharacter?: boolean;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
|
|
50
|
-
export { Validator };
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare function encodeBase64(str: string): string;
|
|
2
|
-
declare function decodeBase64(base64: string): string;
|
|
3
|
-
|
|
4
|
-
export { decodeBase64, encodeBase64 };
|
|
1
|
+
export declare function encodeBase64(str: string): string;
|
|
2
|
+
export declare function decodeBase64(base64: string): string;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
interface FlattenOptions {
|
|
1
|
+
export interface FlattenOptions {
|
|
2
2
|
delimiter?: string;
|
|
3
3
|
maxDepth?: number;
|
|
4
4
|
safe?: boolean;
|
|
5
5
|
transformKey?: (key: string) => string;
|
|
6
6
|
}
|
|
7
|
-
interface UnflattenOptions {
|
|
7
|
+
export interface UnflattenOptions {
|
|
8
8
|
delimiter?: string;
|
|
9
9
|
object?: boolean;
|
|
10
10
|
overwrite?: boolean;
|
|
11
11
|
transformKey?: (key: string) => string;
|
|
12
12
|
}
|
|
13
|
-
declare function flatten<T extends object>(target: T, opts?: FlattenOptions): Record<string, any>;
|
|
14
|
-
declare function unflatten<T extends object>(target: T, opts?: UnflattenOptions): any;
|
|
15
|
-
|
|
16
|
-
export { type FlattenOptions, type UnflattenOptions, flatten, unflatten };
|
|
13
|
+
export declare function flatten<T extends object>(target: T, opts?: FlattenOptions): Record<string, any>;
|
|
14
|
+
export declare function unflatten<T extends object>(target: T, opts?: UnflattenOptions): any;
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
import 'base-64';
|
|
1
|
+
export * from './atob';
|
|
2
|
+
export * from './base64';
|
|
3
|
+
export * from './between';
|
|
4
|
+
export * from './btoa';
|
|
5
|
+
export * from './castArray';
|
|
6
|
+
export * from './circularDistance';
|
|
7
|
+
export * from './sleep';
|
|
8
|
+
export * from './fallbackIfMatch';
|
|
9
|
+
export * from './fallbackIfNull';
|
|
10
|
+
export * from './fallbackIfNullish';
|
|
11
|
+
export * from './fallbackIfUndefined';
|
|
12
|
+
export * from './firstNonNullish';
|
|
13
|
+
export * from './flat';
|
|
14
|
+
export * from './processFirstNonNullish';
|
|
15
|
+
export * from './pureEnum';
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
declare function processFirstNonNullish<T, R>(processor: (nonNullish: NonNullable<T>) => R, ...args: T[]): R | undefined;
|
|
2
|
-
|
|
3
|
-
export { processFirstNonNullish };
|
|
1
|
+
export declare function processFirstNonNullish<T, R>(processor: (nonNullish: NonNullable<T>) => R, ...args: T[]): R | undefined;
|
|
@@ -5,14 +5,13 @@ type PureEnumReturnType<E extends object> = [NonFunction<E, "keys">, NonFunction
|
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated Use Enum instead.
|
|
7
7
|
*/
|
|
8
|
-
declare function pureEnum<E extends object>(e: E): PureEnumReturnType<E>;
|
|
8
|
+
export declare function pureEnum<E extends object>(e: E): PureEnumReturnType<E>;
|
|
9
9
|
/**
|
|
10
10
|
* @deprecated Use Enum instead.
|
|
11
11
|
*/
|
|
12
|
-
declare function pureEnumKeys<E extends object>(e: E): NonFunction<E, "keys">[];
|
|
12
|
+
export declare function pureEnumKeys<E extends object>(e: E): NonFunction<E, "keys">[];
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated Use Enum instead.
|
|
15
15
|
*/
|
|
16
|
-
declare function pureEnumValues<E extends object>(e: E): NonFunction<E, "values">[];
|
|
17
|
-
|
|
18
|
-
export { pureEnum, pureEnumKeys, pureEnumValues };
|
|
16
|
+
export declare function pureEnumValues<E extends object>(e: E): NonFunction<E, "values">[];
|
|
17
|
+
export {};
|
|
@@ -1,44 +1,21 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export { Calc } from './Calc.js';
|
|
23
|
-
export { CoordinateUtils } from './CoordinateUtils.js';
|
|
24
|
-
export { DateUtils } from './DateUtils.js';
|
|
25
|
-
export { Enum } from './Enum.js';
|
|
26
|
-
export { EnumEntries, EnumEntry } from './Enum.types.js';
|
|
27
|
-
export { I18nUtils } from './I18nUtils.js';
|
|
28
|
-
export { NumberUtils } from './NumberUtils.js';
|
|
29
|
-
export { ObjectIdUtils } from './ObjectIdUtils.js';
|
|
30
|
-
export { Point3Utils } from './Point3Utils.js';
|
|
31
|
-
export { RandomUtils } from './RandomUtils.js';
|
|
32
|
-
export { Validator } from './Validator.js';
|
|
33
|
-
export { JuminNumberUtils } from './JuminNumberUtils.js';
|
|
34
|
-
export { Sequence, Sequencer, SequencerEvent, SequencerOption, SequencerStatus } from './Sequencer.js';
|
|
35
|
-
export { TryCatch } from './try-catch/TryCatch.js';
|
|
36
|
-
import 'base-64';
|
|
37
|
-
import 'axios';
|
|
38
|
-
import '../interfaces/Coordinate.js';
|
|
39
|
-
import 'moment';
|
|
40
|
-
import '../constants/DATE.js';
|
|
41
|
-
import 'i18next';
|
|
42
|
-
import '../interfaces/Point3.js';
|
|
43
|
-
import '../interfaces/Point2.js';
|
|
44
|
-
import 'eventemitter3';
|
|
1
|
+
export * from './global';
|
|
2
|
+
export * from './ArrayUtils';
|
|
3
|
+
export * from './AxiosUtils';
|
|
4
|
+
export * from './StringUtils';
|
|
5
|
+
export * from './Uint8ArrayUtils';
|
|
6
|
+
export * from './UuidUtils';
|
|
7
|
+
export * from './BooleanUtils';
|
|
8
|
+
export * from './Calc';
|
|
9
|
+
export * from './CoordinateUtils';
|
|
10
|
+
export * from './DateUtils';
|
|
11
|
+
export * from './Enum';
|
|
12
|
+
export * from './Enum.types';
|
|
13
|
+
export * from './I18nUtils';
|
|
14
|
+
export * from './NumberUtils';
|
|
15
|
+
export * from './ObjectIdUtils';
|
|
16
|
+
export * from './Point3Utils';
|
|
17
|
+
export * from './RandomUtils';
|
|
18
|
+
export * from './Validator';
|
|
19
|
+
export * from './JuminNumberUtils';
|
|
20
|
+
export * from './Sequencer';
|
|
21
|
+
export * from './try-catch';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Provides a utility class for handling synchronous and asynchronous operations with a consistent try-catch pattern.
|
|
3
3
|
* 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).
|
|
4
4
|
*/
|
|
5
|
-
declare class TryCatch {
|
|
5
|
+
export declare class TryCatch {
|
|
6
6
|
/**
|
|
7
7
|
* Executes a synchronous function within a try-catch block.
|
|
8
8
|
* @template T The return type of the function.
|
|
@@ -22,5 +22,3 @@ declare class TryCatch {
|
|
|
22
22
|
*/
|
|
23
23
|
static asyncFunction<T, E = Error>(fn: Promise<T>, disableLogging?: boolean): Promise<readonly [null, Awaited<T>] | readonly [E, undefined]>;
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
export { TryCatch };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./TryCatch";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powfix/core-js",
|
|
3
|
-
"version": "0.23.
|
|
3
|
+
"version": "0.23.4",
|
|
4
4
|
"description": "core package",
|
|
5
5
|
"author": "Kwon Kyung-Min <powfix@gmail.com>",
|
|
6
6
|
"private": false,
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
"clean": "rm -rf dist | wc -l",
|
|
24
24
|
"esmfix": "tsc-esm-fix --ext='.mjs'",
|
|
25
25
|
"compile": "tsc",
|
|
26
|
-
"prebuild": "yarn
|
|
27
|
-
"build": "yarn run build:cjs && yarn run build:esm",
|
|
26
|
+
"prebuild": "yarn clean",
|
|
27
|
+
"build": "yarn run build:cjs && yarn run build:esm && yarn run build:dts",
|
|
28
|
+
"build:dts": "tsc -p tsconfig.declaration.json",
|
|
28
29
|
"build:cjs": "tsup --config tsup.cjs.config.ts",
|
|
29
30
|
"build:esm": "tsup --config tsup.esm.config.ts"
|
|
30
31
|
},
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
"uuid": "9.0.1"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
|
-
"@powfix/uuid": "^0.2.
|
|
62
|
+
"@powfix/uuid": "^0.2.4",
|
|
62
63
|
"@swc/core": "^1.13.5",
|
|
63
64
|
"@types/base-64": "1.0.2",
|
|
64
65
|
"@types/node": "^24.5.1",
|