@atmaticai/agent-tools-core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +742 -0
- package/dist/archive/index.d.mts +1 -0
- package/dist/archive/index.d.ts +1 -0
- package/dist/archive/index.js +90 -0
- package/dist/archive/index.js.map +1 -0
- package/dist/archive/index.mjs +80 -0
- package/dist/archive/index.mjs.map +1 -0
- package/dist/color/index.d.mts +1 -0
- package/dist/color/index.d.ts +1 -0
- package/dist/color/index.js +347 -0
- package/dist/color/index.js.map +1 -0
- package/dist/color/index.mjs +336 -0
- package/dist/color/index.mjs.map +1 -0
- package/dist/crypto/index.d.mts +1 -0
- package/dist/crypto/index.d.ts +1 -0
- package/dist/crypto/index.js +116 -0
- package/dist/crypto/index.js.map +1 -0
- package/dist/crypto/index.mjs +108 -0
- package/dist/crypto/index.mjs.map +1 -0
- package/dist/csv/index.d.mts +1 -0
- package/dist/csv/index.d.ts +1 -0
- package/dist/csv/index.js +371 -0
- package/dist/csv/index.js.map +1 -0
- package/dist/csv/index.mjs +348 -0
- package/dist/csv/index.mjs.map +1 -0
- package/dist/datetime/index.d.mts +1 -0
- package/dist/datetime/index.d.ts +1 -0
- package/dist/datetime/index.js +234 -0
- package/dist/datetime/index.js.map +1 -0
- package/dist/datetime/index.mjs +224 -0
- package/dist/datetime/index.mjs.map +1 -0
- package/dist/diff/index.d.mts +2 -0
- package/dist/diff/index.d.ts +2 -0
- package/dist/diff/index.js +84 -0
- package/dist/diff/index.js.map +1 -0
- package/dist/diff/index.mjs +78 -0
- package/dist/diff/index.mjs.map +1 -0
- package/dist/excel/index.d.mts +1 -0
- package/dist/excel/index.d.ts +1 -0
- package/dist/excel/index.js +163 -0
- package/dist/excel/index.js.map +1 -0
- package/dist/excel/index.mjs +153 -0
- package/dist/excel/index.mjs.map +1 -0
- package/dist/image/index.d.mts +1 -0
- package/dist/image/index.d.ts +1 -0
- package/dist/image/index.js +123 -0
- package/dist/image/index.js.map +1 -0
- package/dist/image/index.mjs +107 -0
- package/dist/image/index.mjs.map +1 -0
- package/dist/index--vbnYfdE.d.mts +142 -0
- package/dist/index--vbnYfdE.d.ts +142 -0
- package/dist/index-7FZQloN-.d.mts +62 -0
- package/dist/index-7FZQloN-.d.ts +62 -0
- package/dist/index-7XgaTVH5.d.mts +93 -0
- package/dist/index-7XgaTVH5.d.ts +93 -0
- package/dist/index-7bvFmh45.d.mts +87 -0
- package/dist/index-7bvFmh45.d.ts +87 -0
- package/dist/index-BDZcIVCU.d.mts +53 -0
- package/dist/index-BDZcIVCU.d.ts +53 -0
- package/dist/index-BN00EnUU.d.mts +55 -0
- package/dist/index-BN00EnUU.d.ts +55 -0
- package/dist/index-CQ1EukC4.d.mts +59 -0
- package/dist/index-CQ1EukC4.d.ts +59 -0
- package/dist/index-CgRVnFOt.d.mts +91 -0
- package/dist/index-CgRVnFOt.d.ts +91 -0
- package/dist/index-DjBDZzuj.d.mts +54 -0
- package/dist/index-DjBDZzuj.d.ts +54 -0
- package/dist/index-FFrvmr-n.d.mts +50 -0
- package/dist/index-FFrvmr-n.d.ts +50 -0
- package/dist/index-QWC8yIgW.d.mts +106 -0
- package/dist/index-QWC8yIgW.d.ts +106 -0
- package/dist/index-RVqNunxE.d.mts +193 -0
- package/dist/index-RVqNunxE.d.ts +193 -0
- package/dist/index-fJD8SORm.d.mts +61 -0
- package/dist/index-fJD8SORm.d.ts +61 -0
- package/dist/index-pPy_XDQU.d.mts +56 -0
- package/dist/index-pPy_XDQU.d.ts +56 -0
- package/dist/index-rwh9hdD9.d.mts +68 -0
- package/dist/index-rwh9hdD9.d.ts +68 -0
- package/dist/index-uXdkAfea.d.mts +93 -0
- package/dist/index-uXdkAfea.d.ts +93 -0
- package/dist/index.d.mts +17 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +3744 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +3694 -0
- package/dist/index.mjs.map +1 -0
- package/dist/json/index.d.mts +1 -0
- package/dist/json/index.d.ts +1 -0
- package/dist/json/index.js +599 -0
- package/dist/json/index.js.map +1 -0
- package/dist/json/index.mjs +552 -0
- package/dist/json/index.mjs.map +1 -0
- package/dist/markdown/index.d.mts +1 -0
- package/dist/markdown/index.d.ts +1 -0
- package/dist/markdown/index.js +151 -0
- package/dist/markdown/index.js.map +1 -0
- package/dist/markdown/index.mjs +139 -0
- package/dist/markdown/index.mjs.map +1 -0
- package/dist/math/index.d.mts +1 -0
- package/dist/math/index.d.ts +1 -0
- package/dist/math/index.js +247 -0
- package/dist/math/index.js.map +1 -0
- package/dist/math/index.mjs +240 -0
- package/dist/math/index.mjs.map +1 -0
- package/dist/pdf/index.d.mts +1 -0
- package/dist/pdf/index.d.ts +1 -0
- package/dist/pdf/index.js +546 -0
- package/dist/pdf/index.js.map +1 -0
- package/dist/pdf/index.mjs +518 -0
- package/dist/pdf/index.mjs.map +1 -0
- package/dist/regex/index.d.mts +1 -0
- package/dist/regex/index.d.ts +1 -0
- package/dist/regex/index.js +93 -0
- package/dist/regex/index.js.map +1 -0
- package/dist/regex/index.mjs +88 -0
- package/dist/regex/index.mjs.map +1 -0
- package/dist/settings/index.d.mts +41 -0
- package/dist/settings/index.d.ts +41 -0
- package/dist/settings/index.js +146 -0
- package/dist/settings/index.js.map +1 -0
- package/dist/settings/index.mjs +139 -0
- package/dist/settings/index.mjs.map +1 -0
- package/dist/sql/index.d.mts +1 -0
- package/dist/sql/index.d.ts +1 -0
- package/dist/sql/index.js +146 -0
- package/dist/sql/index.js.map +1 -0
- package/dist/sql/index.mjs +139 -0
- package/dist/sql/index.mjs.map +1 -0
- package/dist/text/index.d.mts +1 -0
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.js +250 -0
- package/dist/text/index.js.map +1 -0
- package/dist/text/index.mjs +242 -0
- package/dist/text/index.mjs.map +1 -0
- package/dist/xml/index.d.mts +1 -0
- package/dist/xml/index.d.ts +1 -0
- package/dist/xml/index.js +188 -0
- package/dist/xml/index.js.map +1 -0
- package/dist/xml/index.mjs +180 -0
- package/dist/xml/index.mjs.map +1 -0
- package/package.json +150 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
type CaseType = 'camel' | 'snake' | 'kebab' | 'pascal' | 'title' | 'sentence' | 'upper' | 'lower' | 'constant';
|
|
2
|
+
interface TextStats {
|
|
3
|
+
characters: number;
|
|
4
|
+
words: number;
|
|
5
|
+
sentences: number;
|
|
6
|
+
paragraphs: number;
|
|
7
|
+
lines: number;
|
|
8
|
+
readingTimeMs: number;
|
|
9
|
+
}
|
|
10
|
+
interface TruncateOptions {
|
|
11
|
+
length: number;
|
|
12
|
+
boundary?: 'character' | 'word';
|
|
13
|
+
suffix?: string;
|
|
14
|
+
}
|
|
15
|
+
interface SimilarityResult {
|
|
16
|
+
distance: number;
|
|
17
|
+
similarity: number;
|
|
18
|
+
}
|
|
19
|
+
interface TemplateResult {
|
|
20
|
+
result: string;
|
|
21
|
+
missingKeys: string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare function convertCase(input: string, to: CaseType): string;
|
|
25
|
+
|
|
26
|
+
declare function slugify(input: string, separator?: string): string;
|
|
27
|
+
|
|
28
|
+
declare function getTextStats(input: string): TextStats;
|
|
29
|
+
|
|
30
|
+
declare function truncate(input: string, options: TruncateOptions): string;
|
|
31
|
+
|
|
32
|
+
declare function generateLorem(count: number, unit?: 'words' | 'sentences' | 'paragraphs'): string;
|
|
33
|
+
|
|
34
|
+
declare function similarity(a: string, b: string): SimilarityResult;
|
|
35
|
+
|
|
36
|
+
declare function interpolate(template: string, variables: Record<string, string>): TemplateResult;
|
|
37
|
+
|
|
38
|
+
type index_CaseType = CaseType;
|
|
39
|
+
type index_SimilarityResult = SimilarityResult;
|
|
40
|
+
type index_TemplateResult = TemplateResult;
|
|
41
|
+
type index_TextStats = TextStats;
|
|
42
|
+
type index_TruncateOptions = TruncateOptions;
|
|
43
|
+
declare const index_convertCase: typeof convertCase;
|
|
44
|
+
declare const index_generateLorem: typeof generateLorem;
|
|
45
|
+
declare const index_getTextStats: typeof getTextStats;
|
|
46
|
+
declare const index_interpolate: typeof interpolate;
|
|
47
|
+
declare const index_similarity: typeof similarity;
|
|
48
|
+
declare const index_slugify: typeof slugify;
|
|
49
|
+
declare const index_truncate: typeof truncate;
|
|
50
|
+
declare namespace index {
|
|
51
|
+
export { type index_CaseType as CaseType, type index_SimilarityResult as SimilarityResult, type index_TemplateResult as TemplateResult, type index_TextStats as TextStats, type index_TruncateOptions as TruncateOptions, index_convertCase as convertCase, index_generateLorem as generateLorem, index_getTextStats as getTextStats, index_interpolate as interpolate, index_similarity as similarity, index_slugify as slugify, index_truncate as truncate };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { type CaseType as C, type SimilarityResult as S, type TemplateResult as T, type TextStats as a, type TruncateOptions as b, convertCase as c, getTextStats as d, interpolate as e, slugify as f, generateLorem as g, index as i, similarity as s, truncate as t };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
type ArchiveFormat = 'zip' | 'tar' | 'tar.gz';
|
|
2
|
+
interface ArchiveEntry {
|
|
3
|
+
path: string;
|
|
4
|
+
size: number;
|
|
5
|
+
compressedSize?: number;
|
|
6
|
+
isDirectory: boolean;
|
|
7
|
+
modified?: string;
|
|
8
|
+
}
|
|
9
|
+
interface ArchiveCreateOptions {
|
|
10
|
+
format?: ArchiveFormat;
|
|
11
|
+
compressionLevel?: number;
|
|
12
|
+
}
|
|
13
|
+
interface ArchiveExtractOptions {
|
|
14
|
+
files?: string[];
|
|
15
|
+
}
|
|
16
|
+
interface ArchiveStats {
|
|
17
|
+
format: string;
|
|
18
|
+
fileCount: number;
|
|
19
|
+
directoryCount: number;
|
|
20
|
+
totalSize: number;
|
|
21
|
+
compressedSize: number;
|
|
22
|
+
entries: ArchiveEntry[];
|
|
23
|
+
}
|
|
24
|
+
interface ArchiveFile {
|
|
25
|
+
path: string;
|
|
26
|
+
content: Buffer;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare function create(files: ArchiveFile[], options?: ArchiveCreateOptions): Promise<Uint8Array>;
|
|
30
|
+
|
|
31
|
+
declare function extract(file: Buffer | Uint8Array, options?: ArchiveExtractOptions): Promise<ArchiveFile[]>;
|
|
32
|
+
|
|
33
|
+
declare function list(file: Buffer | Uint8Array): Promise<ArchiveEntry[]>;
|
|
34
|
+
declare function getStats(file: Buffer | Uint8Array): Promise<ArchiveStats>;
|
|
35
|
+
|
|
36
|
+
type index_ArchiveCreateOptions = ArchiveCreateOptions;
|
|
37
|
+
type index_ArchiveEntry = ArchiveEntry;
|
|
38
|
+
type index_ArchiveExtractOptions = ArchiveExtractOptions;
|
|
39
|
+
type index_ArchiveFile = ArchiveFile;
|
|
40
|
+
type index_ArchiveFormat = ArchiveFormat;
|
|
41
|
+
type index_ArchiveStats = ArchiveStats;
|
|
42
|
+
declare const index_create: typeof create;
|
|
43
|
+
declare const index_extract: typeof extract;
|
|
44
|
+
declare const index_getStats: typeof getStats;
|
|
45
|
+
declare const index_list: typeof list;
|
|
46
|
+
declare namespace index {
|
|
47
|
+
export { type index_ArchiveCreateOptions as ArchiveCreateOptions, type index_ArchiveEntry as ArchiveEntry, type index_ArchiveExtractOptions as ArchiveExtractOptions, type index_ArchiveFile as ArchiveFile, type index_ArchiveFormat as ArchiveFormat, type index_ArchiveStats as ArchiveStats, index_create as create, index_extract as extract, index_getStats as getStats, index_list as list };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { type ArchiveCreateOptions as A, type ArchiveEntry as a, type ArchiveExtractOptions as b, type ArchiveFile as c, type ArchiveFormat as d, type ArchiveStats as e, create as f, extract as g, getStats as h, index as i, list as l };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
type ArchiveFormat = 'zip' | 'tar' | 'tar.gz';
|
|
2
|
+
interface ArchiveEntry {
|
|
3
|
+
path: string;
|
|
4
|
+
size: number;
|
|
5
|
+
compressedSize?: number;
|
|
6
|
+
isDirectory: boolean;
|
|
7
|
+
modified?: string;
|
|
8
|
+
}
|
|
9
|
+
interface ArchiveCreateOptions {
|
|
10
|
+
format?: ArchiveFormat;
|
|
11
|
+
compressionLevel?: number;
|
|
12
|
+
}
|
|
13
|
+
interface ArchiveExtractOptions {
|
|
14
|
+
files?: string[];
|
|
15
|
+
}
|
|
16
|
+
interface ArchiveStats {
|
|
17
|
+
format: string;
|
|
18
|
+
fileCount: number;
|
|
19
|
+
directoryCount: number;
|
|
20
|
+
totalSize: number;
|
|
21
|
+
compressedSize: number;
|
|
22
|
+
entries: ArchiveEntry[];
|
|
23
|
+
}
|
|
24
|
+
interface ArchiveFile {
|
|
25
|
+
path: string;
|
|
26
|
+
content: Buffer;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare function create(files: ArchiveFile[], options?: ArchiveCreateOptions): Promise<Uint8Array>;
|
|
30
|
+
|
|
31
|
+
declare function extract(file: Buffer | Uint8Array, options?: ArchiveExtractOptions): Promise<ArchiveFile[]>;
|
|
32
|
+
|
|
33
|
+
declare function list(file: Buffer | Uint8Array): Promise<ArchiveEntry[]>;
|
|
34
|
+
declare function getStats(file: Buffer | Uint8Array): Promise<ArchiveStats>;
|
|
35
|
+
|
|
36
|
+
type index_ArchiveCreateOptions = ArchiveCreateOptions;
|
|
37
|
+
type index_ArchiveEntry = ArchiveEntry;
|
|
38
|
+
type index_ArchiveExtractOptions = ArchiveExtractOptions;
|
|
39
|
+
type index_ArchiveFile = ArchiveFile;
|
|
40
|
+
type index_ArchiveFormat = ArchiveFormat;
|
|
41
|
+
type index_ArchiveStats = ArchiveStats;
|
|
42
|
+
declare const index_create: typeof create;
|
|
43
|
+
declare const index_extract: typeof extract;
|
|
44
|
+
declare const index_getStats: typeof getStats;
|
|
45
|
+
declare const index_list: typeof list;
|
|
46
|
+
declare namespace index {
|
|
47
|
+
export { type index_ArchiveCreateOptions as ArchiveCreateOptions, type index_ArchiveEntry as ArchiveEntry, type index_ArchiveExtractOptions as ArchiveExtractOptions, type index_ArchiveFile as ArchiveFile, type index_ArchiveFormat as ArchiveFormat, type index_ArchiveStats as ArchiveStats, index_create as create, index_extract as extract, index_getStats as getStats, index_list as list };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { type ArchiveCreateOptions as A, type ArchiveEntry as a, type ArchiveExtractOptions as b, type ArchiveFile as c, type ArchiveFormat as d, type ArchiveStats as e, create as f, extract as g, getStats as h, index as i, list as l };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
interface ParseOptions {
|
|
2
|
+
delimiter?: string;
|
|
3
|
+
header?: boolean;
|
|
4
|
+
skipRows?: number;
|
|
5
|
+
trimFields?: boolean;
|
|
6
|
+
dynamicTyping?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface ParseResult {
|
|
9
|
+
data: Record<string, unknown>[];
|
|
10
|
+
headers: string[];
|
|
11
|
+
rowCount: number;
|
|
12
|
+
errors: ParseError[];
|
|
13
|
+
}
|
|
14
|
+
interface ParseError {
|
|
15
|
+
row: number;
|
|
16
|
+
message: string;
|
|
17
|
+
}
|
|
18
|
+
type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'startsWith' | 'endsWith' | 'matches' | 'isNull' | 'isNotNull';
|
|
19
|
+
interface Filter {
|
|
20
|
+
column: string;
|
|
21
|
+
operator: FilterOperator;
|
|
22
|
+
value?: unknown;
|
|
23
|
+
}
|
|
24
|
+
interface ColumnStats {
|
|
25
|
+
name: string;
|
|
26
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'mixed' | 'empty';
|
|
27
|
+
count: number;
|
|
28
|
+
nullCount: number;
|
|
29
|
+
uniqueCount: number;
|
|
30
|
+
min?: number | string;
|
|
31
|
+
max?: number | string;
|
|
32
|
+
mean?: number;
|
|
33
|
+
sum?: number;
|
|
34
|
+
topValues?: {
|
|
35
|
+
value: unknown;
|
|
36
|
+
count: number;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
interface TransformOptions {
|
|
40
|
+
rename?: Record<string, string>;
|
|
41
|
+
select?: string[];
|
|
42
|
+
exclude?: string[];
|
|
43
|
+
derive?: Record<string, (row: Record<string, unknown>) => unknown>;
|
|
44
|
+
}
|
|
45
|
+
type ExportFormat = 'csv' | 'json' | 'jsonl' | 'tsv';
|
|
46
|
+
interface ExportOptions {
|
|
47
|
+
format: ExportFormat;
|
|
48
|
+
headers?: boolean;
|
|
49
|
+
delimiter?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare function parse(input: string, options?: ParseOptions): ParseResult;
|
|
53
|
+
declare function parseToArray(input: string, options?: ParseOptions): unknown[][];
|
|
54
|
+
declare function detectDelimiter(input: string): string;
|
|
55
|
+
declare function getHeaders(input: string, delimiter?: string): string[];
|
|
56
|
+
|
|
57
|
+
declare function filter(input: string, filters: Filter[]): string;
|
|
58
|
+
declare function filterData(data: Record<string, unknown>[], filters: Filter[]): Record<string, unknown>[];
|
|
59
|
+
declare function filterByColumn(input: string, column: string, operator: FilterOperator, value?: unknown): string;
|
|
60
|
+
|
|
61
|
+
declare function getStats(input: string): ColumnStats[];
|
|
62
|
+
declare function getStatsFromData(result: ParseResult): ColumnStats[];
|
|
63
|
+
declare function getColumnStats(input: string, column: string): ColumnStats | null;
|
|
64
|
+
|
|
65
|
+
declare function transform(input: string, options: TransformOptions): string;
|
|
66
|
+
declare function transformData(result: ParseResult, options: TransformOptions): ParseResult;
|
|
67
|
+
declare function sortData(data: Record<string, unknown>[], column: string, direction?: 'asc' | 'desc'): Record<string, unknown>[];
|
|
68
|
+
|
|
69
|
+
declare function exportData(input: string, options: ExportOptions): string;
|
|
70
|
+
declare function exportFromData(result: ParseResult, options: ExportOptions): string;
|
|
71
|
+
declare function toJson(input: string, pretty?: boolean): string;
|
|
72
|
+
declare function toJsonLines(input: string): string;
|
|
73
|
+
declare function toArray(input: string): Record<string, unknown>[];
|
|
74
|
+
|
|
75
|
+
type index_ColumnStats = ColumnStats;
|
|
76
|
+
type index_ExportFormat = ExportFormat;
|
|
77
|
+
type index_ExportOptions = ExportOptions;
|
|
78
|
+
type index_Filter = Filter;
|
|
79
|
+
type index_FilterOperator = FilterOperator;
|
|
80
|
+
type index_ParseError = ParseError;
|
|
81
|
+
type index_ParseOptions = ParseOptions;
|
|
82
|
+
type index_ParseResult = ParseResult;
|
|
83
|
+
type index_TransformOptions = TransformOptions;
|
|
84
|
+
declare const index_detectDelimiter: typeof detectDelimiter;
|
|
85
|
+
declare const index_exportData: typeof exportData;
|
|
86
|
+
declare const index_exportFromData: typeof exportFromData;
|
|
87
|
+
declare const index_filter: typeof filter;
|
|
88
|
+
declare const index_filterByColumn: typeof filterByColumn;
|
|
89
|
+
declare const index_filterData: typeof filterData;
|
|
90
|
+
declare const index_getColumnStats: typeof getColumnStats;
|
|
91
|
+
declare const index_getHeaders: typeof getHeaders;
|
|
92
|
+
declare const index_getStats: typeof getStats;
|
|
93
|
+
declare const index_getStatsFromData: typeof getStatsFromData;
|
|
94
|
+
declare const index_parse: typeof parse;
|
|
95
|
+
declare const index_parseToArray: typeof parseToArray;
|
|
96
|
+
declare const index_sortData: typeof sortData;
|
|
97
|
+
declare const index_toArray: typeof toArray;
|
|
98
|
+
declare const index_toJson: typeof toJson;
|
|
99
|
+
declare const index_toJsonLines: typeof toJsonLines;
|
|
100
|
+
declare const index_transform: typeof transform;
|
|
101
|
+
declare const index_transformData: typeof transformData;
|
|
102
|
+
declare namespace index {
|
|
103
|
+
export { type index_ColumnStats as ColumnStats, type index_ExportFormat as ExportFormat, type index_ExportOptions as ExportOptions, type index_Filter as Filter, type index_FilterOperator as FilterOperator, type index_ParseError as ParseError, type index_ParseOptions as ParseOptions, type index_ParseResult as ParseResult, type index_TransformOptions as TransformOptions, index_detectDelimiter as detectDelimiter, index_exportData as exportData, index_exportFromData as exportFromData, index_filter as filter, index_filterByColumn as filterByColumn, index_filterData as filterData, index_getColumnStats as getColumnStats, index_getHeaders as getHeaders, index_getStats as getStats, index_getStatsFromData as getStatsFromData, index_parse as parse, index_parseToArray as parseToArray, index_sortData as sortData, index_toArray as toArray, index_toJson as toJson, index_toJsonLines as toJsonLines, index_transform as transform, index_transformData as transformData };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { type ColumnStats as C, type ExportFormat as E, type Filter as F, type ParseError as P, type TransformOptions as T, type ExportOptions as a, type FilterOperator as b, type ParseOptions as c, type ParseResult as d, detectDelimiter as e, exportData as f, exportFromData as g, filter as h, index as i, filterByColumn as j, filterData as k, getColumnStats as l, getHeaders as m, getStats as n, getStatsFromData as o, parse as p, parseToArray as q, toJson as r, sortData as s, toArray as t, toJsonLines as u, transform as v, transformData as w };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
interface ParseOptions {
|
|
2
|
+
delimiter?: string;
|
|
3
|
+
header?: boolean;
|
|
4
|
+
skipRows?: number;
|
|
5
|
+
trimFields?: boolean;
|
|
6
|
+
dynamicTyping?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface ParseResult {
|
|
9
|
+
data: Record<string, unknown>[];
|
|
10
|
+
headers: string[];
|
|
11
|
+
rowCount: number;
|
|
12
|
+
errors: ParseError[];
|
|
13
|
+
}
|
|
14
|
+
interface ParseError {
|
|
15
|
+
row: number;
|
|
16
|
+
message: string;
|
|
17
|
+
}
|
|
18
|
+
type FilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'startsWith' | 'endsWith' | 'matches' | 'isNull' | 'isNotNull';
|
|
19
|
+
interface Filter {
|
|
20
|
+
column: string;
|
|
21
|
+
operator: FilterOperator;
|
|
22
|
+
value?: unknown;
|
|
23
|
+
}
|
|
24
|
+
interface ColumnStats {
|
|
25
|
+
name: string;
|
|
26
|
+
type: 'string' | 'number' | 'boolean' | 'date' | 'mixed' | 'empty';
|
|
27
|
+
count: number;
|
|
28
|
+
nullCount: number;
|
|
29
|
+
uniqueCount: number;
|
|
30
|
+
min?: number | string;
|
|
31
|
+
max?: number | string;
|
|
32
|
+
mean?: number;
|
|
33
|
+
sum?: number;
|
|
34
|
+
topValues?: {
|
|
35
|
+
value: unknown;
|
|
36
|
+
count: number;
|
|
37
|
+
}[];
|
|
38
|
+
}
|
|
39
|
+
interface TransformOptions {
|
|
40
|
+
rename?: Record<string, string>;
|
|
41
|
+
select?: string[];
|
|
42
|
+
exclude?: string[];
|
|
43
|
+
derive?: Record<string, (row: Record<string, unknown>) => unknown>;
|
|
44
|
+
}
|
|
45
|
+
type ExportFormat = 'csv' | 'json' | 'jsonl' | 'tsv';
|
|
46
|
+
interface ExportOptions {
|
|
47
|
+
format: ExportFormat;
|
|
48
|
+
headers?: boolean;
|
|
49
|
+
delimiter?: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare function parse(input: string, options?: ParseOptions): ParseResult;
|
|
53
|
+
declare function parseToArray(input: string, options?: ParseOptions): unknown[][];
|
|
54
|
+
declare function detectDelimiter(input: string): string;
|
|
55
|
+
declare function getHeaders(input: string, delimiter?: string): string[];
|
|
56
|
+
|
|
57
|
+
declare function filter(input: string, filters: Filter[]): string;
|
|
58
|
+
declare function filterData(data: Record<string, unknown>[], filters: Filter[]): Record<string, unknown>[];
|
|
59
|
+
declare function filterByColumn(input: string, column: string, operator: FilterOperator, value?: unknown): string;
|
|
60
|
+
|
|
61
|
+
declare function getStats(input: string): ColumnStats[];
|
|
62
|
+
declare function getStatsFromData(result: ParseResult): ColumnStats[];
|
|
63
|
+
declare function getColumnStats(input: string, column: string): ColumnStats | null;
|
|
64
|
+
|
|
65
|
+
declare function transform(input: string, options: TransformOptions): string;
|
|
66
|
+
declare function transformData(result: ParseResult, options: TransformOptions): ParseResult;
|
|
67
|
+
declare function sortData(data: Record<string, unknown>[], column: string, direction?: 'asc' | 'desc'): Record<string, unknown>[];
|
|
68
|
+
|
|
69
|
+
declare function exportData(input: string, options: ExportOptions): string;
|
|
70
|
+
declare function exportFromData(result: ParseResult, options: ExportOptions): string;
|
|
71
|
+
declare function toJson(input: string, pretty?: boolean): string;
|
|
72
|
+
declare function toJsonLines(input: string): string;
|
|
73
|
+
declare function toArray(input: string): Record<string, unknown>[];
|
|
74
|
+
|
|
75
|
+
type index_ColumnStats = ColumnStats;
|
|
76
|
+
type index_ExportFormat = ExportFormat;
|
|
77
|
+
type index_ExportOptions = ExportOptions;
|
|
78
|
+
type index_Filter = Filter;
|
|
79
|
+
type index_FilterOperator = FilterOperator;
|
|
80
|
+
type index_ParseError = ParseError;
|
|
81
|
+
type index_ParseOptions = ParseOptions;
|
|
82
|
+
type index_ParseResult = ParseResult;
|
|
83
|
+
type index_TransformOptions = TransformOptions;
|
|
84
|
+
declare const index_detectDelimiter: typeof detectDelimiter;
|
|
85
|
+
declare const index_exportData: typeof exportData;
|
|
86
|
+
declare const index_exportFromData: typeof exportFromData;
|
|
87
|
+
declare const index_filter: typeof filter;
|
|
88
|
+
declare const index_filterByColumn: typeof filterByColumn;
|
|
89
|
+
declare const index_filterData: typeof filterData;
|
|
90
|
+
declare const index_getColumnStats: typeof getColumnStats;
|
|
91
|
+
declare const index_getHeaders: typeof getHeaders;
|
|
92
|
+
declare const index_getStats: typeof getStats;
|
|
93
|
+
declare const index_getStatsFromData: typeof getStatsFromData;
|
|
94
|
+
declare const index_parse: typeof parse;
|
|
95
|
+
declare const index_parseToArray: typeof parseToArray;
|
|
96
|
+
declare const index_sortData: typeof sortData;
|
|
97
|
+
declare const index_toArray: typeof toArray;
|
|
98
|
+
declare const index_toJson: typeof toJson;
|
|
99
|
+
declare const index_toJsonLines: typeof toJsonLines;
|
|
100
|
+
declare const index_transform: typeof transform;
|
|
101
|
+
declare const index_transformData: typeof transformData;
|
|
102
|
+
declare namespace index {
|
|
103
|
+
export { type index_ColumnStats as ColumnStats, type index_ExportFormat as ExportFormat, type index_ExportOptions as ExportOptions, type index_Filter as Filter, type index_FilterOperator as FilterOperator, type index_ParseError as ParseError, type index_ParseOptions as ParseOptions, type index_ParseResult as ParseResult, type index_TransformOptions as TransformOptions, index_detectDelimiter as detectDelimiter, index_exportData as exportData, index_exportFromData as exportFromData, index_filter as filter, index_filterByColumn as filterByColumn, index_filterData as filterData, index_getColumnStats as getColumnStats, index_getHeaders as getHeaders, index_getStats as getStats, index_getStatsFromData as getStatsFromData, index_parse as parse, index_parseToArray as parseToArray, index_sortData as sortData, index_toArray as toArray, index_toJson as toJson, index_toJsonLines as toJsonLines, index_transform as transform, index_transformData as transformData };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { type ColumnStats as C, type ExportFormat as E, type Filter as F, type ParseError as P, type TransformOptions as T, type ExportOptions as a, type FilterOperator as b, type ParseOptions as c, type ParseResult as d, detectDelimiter as e, exportData as f, exportFromData as g, filter as h, index as i, filterByColumn as j, filterData as k, getColumnStats as l, getHeaders as m, getStats as n, getStatsFromData as o, parse as p, parseToArray as q, toJson as r, sortData as s, toArray as t, toJsonLines as u, transform as v, transformData as w };
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
interface MergeOptions {
|
|
2
|
+
pageRanges?: string[];
|
|
3
|
+
}
|
|
4
|
+
interface SplitOptions {
|
|
5
|
+
ranges: string;
|
|
6
|
+
}
|
|
7
|
+
interface PageRange {
|
|
8
|
+
start: number;
|
|
9
|
+
end: number;
|
|
10
|
+
}
|
|
11
|
+
interface PDFMetadata {
|
|
12
|
+
title?: string;
|
|
13
|
+
author?: string;
|
|
14
|
+
subject?: string;
|
|
15
|
+
keywords?: string[];
|
|
16
|
+
creator?: string;
|
|
17
|
+
producer?: string;
|
|
18
|
+
creationDate?: Date;
|
|
19
|
+
modificationDate?: Date;
|
|
20
|
+
}
|
|
21
|
+
interface PDFInfo {
|
|
22
|
+
pageCount: number;
|
|
23
|
+
metadata: PDFMetadata;
|
|
24
|
+
encrypted: boolean;
|
|
25
|
+
version: string;
|
|
26
|
+
}
|
|
27
|
+
interface CompressOptions {
|
|
28
|
+
quality: 'low' | 'medium' | 'high';
|
|
29
|
+
}
|
|
30
|
+
interface ExtractTextOptions {
|
|
31
|
+
pages?: number[];
|
|
32
|
+
preserveLayout?: boolean;
|
|
33
|
+
}
|
|
34
|
+
interface PageInfo {
|
|
35
|
+
index: number;
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
rotation: number;
|
|
39
|
+
}
|
|
40
|
+
interface RotateOptions {
|
|
41
|
+
pages?: number[];
|
|
42
|
+
degrees: 0 | 90 | 180 | 270;
|
|
43
|
+
}
|
|
44
|
+
interface WatermarkOptions {
|
|
45
|
+
text?: string;
|
|
46
|
+
opacity?: number;
|
|
47
|
+
rotation?: number;
|
|
48
|
+
position?: 'center' | 'top' | 'bottom';
|
|
49
|
+
fontSize?: number;
|
|
50
|
+
color?: {
|
|
51
|
+
r: number;
|
|
52
|
+
g: number;
|
|
53
|
+
b: number;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
interface TemplateColor {
|
|
57
|
+
r: number;
|
|
58
|
+
g: number;
|
|
59
|
+
b: number;
|
|
60
|
+
}
|
|
61
|
+
interface TemplateFont {
|
|
62
|
+
name: string;
|
|
63
|
+
size: number;
|
|
64
|
+
weight?: 'normal' | 'bold';
|
|
65
|
+
}
|
|
66
|
+
interface TemplateElement {
|
|
67
|
+
type: 'text' | 'placeholder';
|
|
68
|
+
content: string;
|
|
69
|
+
fieldName?: string;
|
|
70
|
+
x: number;
|
|
71
|
+
y: number;
|
|
72
|
+
font?: TemplateFont;
|
|
73
|
+
color?: TemplateColor;
|
|
74
|
+
}
|
|
75
|
+
interface TemplatePage {
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
78
|
+
elements: TemplateElement[];
|
|
79
|
+
}
|
|
80
|
+
interface TemplateField {
|
|
81
|
+
name: string;
|
|
82
|
+
defaultValue: string;
|
|
83
|
+
pages: number[];
|
|
84
|
+
}
|
|
85
|
+
interface PDFTemplate {
|
|
86
|
+
version: '1.0';
|
|
87
|
+
metadata: {
|
|
88
|
+
name?: string;
|
|
89
|
+
description?: string;
|
|
90
|
+
createdAt: string;
|
|
91
|
+
sourcePageCount: number;
|
|
92
|
+
};
|
|
93
|
+
pages: TemplatePage[];
|
|
94
|
+
fields: TemplateField[];
|
|
95
|
+
fonts: Record<string, TemplateFont>;
|
|
96
|
+
defaults?: {
|
|
97
|
+
font?: TemplateFont;
|
|
98
|
+
color?: TemplateColor;
|
|
99
|
+
missingFieldBehavior?: 'leave_placeholder' | 'use_default' | 'empty_string';
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
interface PdfToTemplateOptions {
|
|
103
|
+
name?: string;
|
|
104
|
+
description?: string;
|
|
105
|
+
}
|
|
106
|
+
interface TemplateToPdfOptions {
|
|
107
|
+
missingFieldBehavior?: 'leave_placeholder' | 'use_default' | 'empty_string';
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare function parsePageRanges(rangeStr: string, totalPages: number): number[];
|
|
111
|
+
declare function parseRangesToGroups(rangeStr: string, totalPages: number): PageRange[];
|
|
112
|
+
declare function formatBytes(bytes: number): string;
|
|
113
|
+
declare function toUint8Array(data: Buffer | Uint8Array | ArrayBuffer): Uint8Array;
|
|
114
|
+
|
|
115
|
+
declare function merge(files: (Buffer | Uint8Array)[], options?: MergeOptions): Promise<Uint8Array>;
|
|
116
|
+
declare function mergeAll(files: (Buffer | Uint8Array)[]): Promise<Uint8Array>;
|
|
117
|
+
declare function appendPages(target: Buffer | Uint8Array, source: Buffer | Uint8Array, pageRange?: string): Promise<Uint8Array>;
|
|
118
|
+
|
|
119
|
+
declare function split(file: Buffer | Uint8Array, options: SplitOptions): Promise<Uint8Array[]>;
|
|
120
|
+
declare function extractPages(file: Buffer | Uint8Array, pageRange: string): Promise<Uint8Array>;
|
|
121
|
+
declare function splitEveryN(file: Buffer | Uint8Array, n: number): Promise<Uint8Array[]>;
|
|
122
|
+
declare function splitIntoSingle(file: Buffer | Uint8Array): Promise<Uint8Array[]>;
|
|
123
|
+
|
|
124
|
+
declare function getInfo(file: Buffer | Uint8Array): Promise<PDFInfo>;
|
|
125
|
+
declare function getMetadata(file: Buffer | Uint8Array): Promise<PDFMetadata>;
|
|
126
|
+
declare function setMetadata(file: Buffer | Uint8Array, metadata: Partial<PDFMetadata>): Promise<Uint8Array>;
|
|
127
|
+
declare function getPageInfo(file: Buffer | Uint8Array): Promise<PageInfo[]>;
|
|
128
|
+
declare function getPageCount(file: Buffer | Uint8Array): Promise<number>;
|
|
129
|
+
|
|
130
|
+
declare function rotate(file: Buffer | Uint8Array, options: RotateOptions): Promise<Uint8Array>;
|
|
131
|
+
declare function addWatermark(file: Buffer | Uint8Array, options: WatermarkOptions): Promise<Uint8Array>;
|
|
132
|
+
declare function reorderPages(file: Buffer | Uint8Array, newOrder: number[]): Promise<Uint8Array>;
|
|
133
|
+
declare function deletePage(file: Buffer | Uint8Array, pageNumbers: number[]): Promise<Uint8Array>;
|
|
134
|
+
declare function compress(file: Buffer | Uint8Array, _options?: CompressOptions): Promise<Uint8Array>;
|
|
135
|
+
|
|
136
|
+
declare function extractText(file: Buffer | Uint8Array, options?: ExtractTextOptions): Promise<string>;
|
|
137
|
+
declare function extractTextFromPages(file: Buffer | Uint8Array, pageRange: string): Promise<Record<number, string>>;
|
|
138
|
+
declare function hasText(file: Buffer | Uint8Array): Promise<boolean>;
|
|
139
|
+
|
|
140
|
+
declare function pdfToTemplate(file: Buffer | Uint8Array, options?: PdfToTemplateOptions): Promise<PDFTemplate>;
|
|
141
|
+
declare function templateToPdf(template: PDFTemplate, data?: Record<string, string>, options?: TemplateToPdfOptions): Promise<Uint8Array>;
|
|
142
|
+
declare function validateTemplate(template: PDFTemplate): void;
|
|
143
|
+
|
|
144
|
+
type index_CompressOptions = CompressOptions;
|
|
145
|
+
type index_ExtractTextOptions = ExtractTextOptions;
|
|
146
|
+
type index_MergeOptions = MergeOptions;
|
|
147
|
+
type index_PDFInfo = PDFInfo;
|
|
148
|
+
type index_PDFMetadata = PDFMetadata;
|
|
149
|
+
type index_PDFTemplate = PDFTemplate;
|
|
150
|
+
type index_PageInfo = PageInfo;
|
|
151
|
+
type index_PageRange = PageRange;
|
|
152
|
+
type index_PdfToTemplateOptions = PdfToTemplateOptions;
|
|
153
|
+
type index_RotateOptions = RotateOptions;
|
|
154
|
+
type index_SplitOptions = SplitOptions;
|
|
155
|
+
type index_TemplateColor = TemplateColor;
|
|
156
|
+
type index_TemplateElement = TemplateElement;
|
|
157
|
+
type index_TemplateField = TemplateField;
|
|
158
|
+
type index_TemplateFont = TemplateFont;
|
|
159
|
+
type index_TemplatePage = TemplatePage;
|
|
160
|
+
type index_TemplateToPdfOptions = TemplateToPdfOptions;
|
|
161
|
+
type index_WatermarkOptions = WatermarkOptions;
|
|
162
|
+
declare const index_addWatermark: typeof addWatermark;
|
|
163
|
+
declare const index_appendPages: typeof appendPages;
|
|
164
|
+
declare const index_compress: typeof compress;
|
|
165
|
+
declare const index_deletePage: typeof deletePage;
|
|
166
|
+
declare const index_extractPages: typeof extractPages;
|
|
167
|
+
declare const index_extractText: typeof extractText;
|
|
168
|
+
declare const index_extractTextFromPages: typeof extractTextFromPages;
|
|
169
|
+
declare const index_formatBytes: typeof formatBytes;
|
|
170
|
+
declare const index_getInfo: typeof getInfo;
|
|
171
|
+
declare const index_getMetadata: typeof getMetadata;
|
|
172
|
+
declare const index_getPageCount: typeof getPageCount;
|
|
173
|
+
declare const index_getPageInfo: typeof getPageInfo;
|
|
174
|
+
declare const index_hasText: typeof hasText;
|
|
175
|
+
declare const index_merge: typeof merge;
|
|
176
|
+
declare const index_mergeAll: typeof mergeAll;
|
|
177
|
+
declare const index_parsePageRanges: typeof parsePageRanges;
|
|
178
|
+
declare const index_parseRangesToGroups: typeof parseRangesToGroups;
|
|
179
|
+
declare const index_pdfToTemplate: typeof pdfToTemplate;
|
|
180
|
+
declare const index_reorderPages: typeof reorderPages;
|
|
181
|
+
declare const index_rotate: typeof rotate;
|
|
182
|
+
declare const index_setMetadata: typeof setMetadata;
|
|
183
|
+
declare const index_split: typeof split;
|
|
184
|
+
declare const index_splitEveryN: typeof splitEveryN;
|
|
185
|
+
declare const index_splitIntoSingle: typeof splitIntoSingle;
|
|
186
|
+
declare const index_templateToPdf: typeof templateToPdf;
|
|
187
|
+
declare const index_toUint8Array: typeof toUint8Array;
|
|
188
|
+
declare const index_validateTemplate: typeof validateTemplate;
|
|
189
|
+
declare namespace index {
|
|
190
|
+
export { type index_CompressOptions as CompressOptions, type index_ExtractTextOptions as ExtractTextOptions, type index_MergeOptions as MergeOptions, type index_PDFInfo as PDFInfo, type index_PDFMetadata as PDFMetadata, type index_PDFTemplate as PDFTemplate, type index_PageInfo as PageInfo, type index_PageRange as PageRange, type index_PdfToTemplateOptions as PdfToTemplateOptions, type index_RotateOptions as RotateOptions, type index_SplitOptions as SplitOptions, type index_TemplateColor as TemplateColor, type index_TemplateElement as TemplateElement, type index_TemplateField as TemplateField, type index_TemplateFont as TemplateFont, type index_TemplatePage as TemplatePage, type index_TemplateToPdfOptions as TemplateToPdfOptions, type index_WatermarkOptions as WatermarkOptions, index_addWatermark as addWatermark, index_appendPages as appendPages, index_compress as compress, index_deletePage as deletePage, index_extractPages as extractPages, index_extractText as extractText, index_extractTextFromPages as extractTextFromPages, index_formatBytes as formatBytes, index_getInfo as getInfo, index_getMetadata as getMetadata, index_getPageCount as getPageCount, index_getPageInfo as getPageInfo, index_hasText as hasText, index_merge as merge, index_mergeAll as mergeAll, index_parsePageRanges as parsePageRanges, index_parseRangesToGroups as parseRangesToGroups, index_pdfToTemplate as pdfToTemplate, index_reorderPages as reorderPages, index_rotate as rotate, index_setMetadata as setMetadata, index_split as split, index_splitEveryN as splitEveryN, index_splitIntoSingle as splitIntoSingle, index_templateToPdf as templateToPdf, index_toUint8Array as toUint8Array, index_validateTemplate as validateTemplate };
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export { parsePageRanges as A, parseRangesToGroups as B, type CompressOptions as C, pdfToTemplate as D, type ExtractTextOptions as E, reorderPages as F, rotate as G, setMetadata as H, split as I, splitEveryN as J, splitIntoSingle as K, templateToPdf as L, type MergeOptions as M, toUint8Array as N, validateTemplate as O, type PDFInfo as P, type RotateOptions as R, type SplitOptions as S, type TemplateColor as T, type WatermarkOptions as W, type PDFMetadata as a, type PDFTemplate as b, type PageInfo as c, type PageRange as d, type PdfToTemplateOptions as e, type TemplateElement as f, type TemplateField as g, type TemplateFont as h, index as i, type TemplatePage as j, type TemplateToPdfOptions as k, addWatermark as l, appendPages as m, compress as n, deletePage as o, extractPages as p, extractText as q, extractTextFromPages as r, formatBytes as s, getInfo as t, getMetadata as u, getPageCount as v, getPageInfo as w, hasText as x, merge as y, mergeAll as z };
|