@punks/backend-core 0.0.29 → 0.0.31
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/cjs/index.js +29 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/abstractions/logging.d.ts +4 -0
- package/dist/cjs/types/logging/service.d.ts +3 -1
- package/dist/cjs/types/utils/trees.d.ts +1 -1
- package/dist/esm/index.js +30 -10
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/abstractions/logging.d.ts +4 -0
- package/dist/esm/types/logging/service.d.ts +3 -1
- package/dist/esm/types/utils/trees.d.ts +1 -1
- package/dist/index.d.ts +8 -2
- package/package.json +1 -1
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { ILogger, LogLevel } from "../abstractions";
|
|
1
|
+
import { ILogger, LogLevel, MetaSerializationType } from "../abstractions";
|
|
2
2
|
export declare class Log {
|
|
3
3
|
private static enabled;
|
|
4
4
|
private static level;
|
|
5
|
+
private static metaSerialization;
|
|
6
|
+
static setSerializationType(type: MetaSerializationType): void;
|
|
5
7
|
static setLevel(level: LogLevel): void;
|
|
6
8
|
static enable(): void;
|
|
7
9
|
static disable(): void;
|
|
@@ -4,4 +4,4 @@ export type TreeNodeBuilder<TKey, TRecord, TTreeNode extends ITreeNode<TKey, TRe
|
|
|
4
4
|
parentIdSelector: (record: TRecord) => TKey | undefined;
|
|
5
5
|
additionalPropsBuilder?: (record: TRecord, ancestors: TRecord[], children: TRecord[]) => Promise<Omit<TTreeNode, "id" | "children" | "value">>;
|
|
6
6
|
};
|
|
7
|
-
export declare const buildTree: <TKey, TRecord, TTreeNode extends ITreeNode<TKey, TRecord>>(data: TRecord[], nodeBuilder: TreeNodeBuilder<TKey, TRecord, TTreeNode>) => Promise<
|
|
7
|
+
export declare const buildTree: <TKey, TRecord, TTreeNode extends ITreeNode<TKey, TRecord>, TTree extends ITree<TKey, TRecord>>(data: TRecord[], nodeBuilder: TreeNodeBuilder<TKey, TRecord, TTreeNode>) => Promise<TTree>;
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ declare enum LogLevel {
|
|
|
16
16
|
Error = 3,
|
|
17
17
|
Fatal = 4
|
|
18
18
|
}
|
|
19
|
+
declare enum MetaSerializationType {
|
|
20
|
+
None = 0,
|
|
21
|
+
JSON = 1
|
|
22
|
+
}
|
|
19
23
|
interface ILoggerProvider {
|
|
20
24
|
debug(message: string, meta?: any): void;
|
|
21
25
|
info(message: string, meta?: any): void;
|
|
@@ -36,6 +40,8 @@ interface ILogger {
|
|
|
36
40
|
declare class Log {
|
|
37
41
|
private static enabled;
|
|
38
42
|
private static level;
|
|
43
|
+
private static metaSerialization;
|
|
44
|
+
static setSerializationType(type: MetaSerializationType): void;
|
|
39
45
|
static setLevel(level: LogLevel): void;
|
|
40
46
|
static enable(): void;
|
|
41
47
|
static disable(): void;
|
|
@@ -125,7 +131,7 @@ type TreeNodeBuilder<TKey, TRecord, TTreeNode extends ITreeNode<TKey, TRecord>>
|
|
|
125
131
|
parentIdSelector: (record: TRecord) => TKey | undefined;
|
|
126
132
|
additionalPropsBuilder?: (record: TRecord, ancestors: TRecord[], children: TRecord[]) => Promise<Omit<TTreeNode, "id" | "children" | "value">>;
|
|
127
133
|
};
|
|
128
|
-
declare const buildTree: <TKey, TRecord, TTreeNode extends ITreeNode<TKey, TRecord>>(data: TRecord[], nodeBuilder: TreeNodeBuilder<TKey, TRecord, TTreeNode>) => Promise<
|
|
134
|
+
declare const buildTree: <TKey, TRecord, TTreeNode extends ITreeNode<TKey, TRecord>, TTree extends ITree<TKey, TRecord>>(data: TRecord[], nodeBuilder: TreeNodeBuilder<TKey, TRecord, TTreeNode>) => Promise<TTree>;
|
|
129
135
|
|
|
130
136
|
declare const mapOrThrow: <T>({ mapper, throw: throwFn, }: {
|
|
131
137
|
mapper: () => T | undefined;
|
|
@@ -155,4 +161,4 @@ type ExcelParseOptions = {
|
|
|
155
161
|
};
|
|
156
162
|
declare const excelParse: (file: string | ArrayBuffer, options?: ExcelParseOptions) => any[];
|
|
157
163
|
|
|
158
|
-
export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, Dict, ExcelKeyTransform, ExcelParseOptions, ExcelColumnDefinition as ExcelRowBuilder, ExcelSheetDefinition, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, ITree, ITreeNode, Log, LogLevel, RichText, TreeNodeBuilder, buildObject, buildTree, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, csvBuild, csvParse, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, last, mapOrThrow, newUuid, notNull, notUndefined, pluralize, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart };
|
|
164
|
+
export { CsvColumnDefinition as ColumnDefinition, CsvBuildOptions, Dict, ExcelKeyTransform, ExcelParseOptions, ExcelColumnDefinition as ExcelRowBuilder, ExcelSheetDefinition, ILogger, ILoggerProvider, IResolveServiceOptions, IServiceLocator, ITree, ITreeNode, Log, LogLevel, MetaSerializationType, RichText, TreeNodeBuilder, buildObject, buildTree, byField, byFieldDesc, camelToKebabCase, camelToSnakeCase, csvBuild, csvParse, distinct, distinctElements, ensureDirectory, ensureStartSlash, ensureTailingSlash, excelBuild, excelParse, first, flatten, getDirectoryFilePaths, getDirectoryPath, groupBy, indexes, isNullOrUndefined, iterate, joinPath, jsonDistinct, last, mapOrThrow, newUuid, notNull, notUndefined, pluralize, range, removeUndefinedProps, selectMany, sleep, sort, splitPath, toCamelCase, toDict, toItemsDict, toItemsMap, toMap, toTitleCase, trim, trimEnd, trimStart };
|