@dpuse/dpuse-shared 1.0.147 → 1.0.149
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 +9 -8
- package/dist/dpuse-shared.es.js +269 -221
- package/dist/dpuse-shared.es.js.map +1 -1
- package/dist/types/src/component/module/tool/index.d.ts +6 -4
- package/dist/types/src/component/module/tool/parser.d.ts +24 -0
- package/dist/types/src/component/module/tool/toolConfig.schema.d.ts +36 -0
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { InferOutput } from 'valibot';
|
|
2
|
+
import { parserConfigSchema, toolConfigSchema } from './toolConfig.schema';
|
|
3
|
+
export { toolConfigSchema } from './toolConfig.schema';
|
|
4
|
+
export type ToolConfig = InferOutput<typeof toolConfigSchema>;
|
|
5
|
+
export type ParserConfig = InferOutput<typeof parserConfigSchema>;
|
|
6
|
+
export type { ParserInterface, ParseStreamOptions, ParseTextOptions, ParseTextResult } from './parser';
|
|
5
7
|
export declare function loadTool<T>(toolConfigs: ToolConfig[], toolId: string): Promise<T>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DataFormatId, ParsingRecord, PreviewIssue, RecordDelimiterId, ValueDelimiterId } from '../../dataView';
|
|
2
|
+
import { RecordRetrievalTypeId, RetrieveRecordsSummary } from '../connector';
|
|
3
|
+
export interface ParserInterface {
|
|
4
|
+
parseStream: (stream: ReadableStream<Uint8Array>, options: ParseStreamOptions, chunk: (typeId: RecordRetrievalTypeId, records: ParsingRecord[]) => void) => Promise<RetrieveRecordsSummary>;
|
|
5
|
+
parseText: (text: string, options: ParseTextOptions) => Promise<ParseTextResult>;
|
|
6
|
+
}
|
|
7
|
+
export interface ParseTextOptions {
|
|
8
|
+
dataFormatId: DataFormatId;
|
|
9
|
+
isComplete: boolean;
|
|
10
|
+
valueDelimiterIds: ValueDelimiterId[];
|
|
11
|
+
}
|
|
12
|
+
export interface ParseTextResult {
|
|
13
|
+
issues: PreviewIssue[];
|
|
14
|
+
parsedRecords: ParsingRecord[];
|
|
15
|
+
recordDelimiterId: RecordDelimiterId;
|
|
16
|
+
valueDelimiterId: ValueDelimiterId | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface ParseStreamOptions {
|
|
19
|
+
abortSignal: AbortSignal;
|
|
20
|
+
chunkSize: number | undefined;
|
|
21
|
+
dataFormatId: DataFormatId;
|
|
22
|
+
encodingId: string;
|
|
23
|
+
valueDelimiterId: ValueDelimiterId;
|
|
24
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the configuration metadata for a tool. Used for validation of tool manifests.
|
|
3
|
+
*/
|
|
4
|
+
export declare const parserDataFormatIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"arrow", undefined>, import('valibot').LiteralSchema<"avro", undefined>, import('valibot').LiteralSchema<"dtv", undefined>, import('valibot').LiteralSchema<"json", undefined>, import('valibot').LiteralSchema<"jsonl", undefined>, import('valibot').LiteralSchema<"markdown", undefined>, import('valibot').LiteralSchema<"ods", undefined>, import('valibot').LiteralSchema<"parquet", undefined>, import('valibot').LiteralSchema<"sav", undefined>, import('valibot').LiteralSchema<"sqlite", undefined>, import('valibot').LiteralSchema<"xlsx", undefined>, import('valibot').LiteralSchema<"xml", undefined>], undefined>;
|
|
5
|
+
export declare const parserConfigSchema: import('valibot').StrictObjectSchema<{
|
|
6
|
+
readonly dataFormatIds: import('valibot').SchemaWithPipe<readonly [import('valibot').ArraySchema<import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"arrow", undefined>, import('valibot').LiteralSchema<"avro", undefined>, import('valibot').LiteralSchema<"dtv", undefined>, import('valibot').LiteralSchema<"json", undefined>, import('valibot').LiteralSchema<"jsonl", undefined>, import('valibot').LiteralSchema<"markdown", undefined>, import('valibot').LiteralSchema<"ods", undefined>, import('valibot').LiteralSchema<"parquet", undefined>, import('valibot').LiteralSchema<"sav", undefined>, import('valibot').LiteralSchema<"sqlite", undefined>, import('valibot').LiteralSchema<"xlsx", undefined>, import('valibot').LiteralSchema<"xml", undefined>], undefined>, undefined>, import('valibot').MinLengthAction<("arrow" | "avro" | "dtv" | "json" | "jsonl" | "markdown" | "ods" | "parquet" | "sav" | "sqlite" | "xlsx" | "xml")[], 1, undefined>]>;
|
|
7
|
+
}, undefined>;
|
|
8
|
+
export declare const toolConfigSchema: import('valibot').StrictObjectSchema<{
|
|
9
|
+
readonly typeId: import('valibot').LiteralSchema<"tool", undefined>;
|
|
10
|
+
readonly actionNames: import('valibot').OptionalSchema<import('valibot').ArraySchema<import('valibot').StringSchema<undefined>, undefined>, undefined>;
|
|
11
|
+
readonly parser: import('valibot').OptionalSchema<import('valibot').StrictObjectSchema<{
|
|
12
|
+
readonly dataFormatIds: import('valibot').SchemaWithPipe<readonly [import('valibot').ArraySchema<import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"arrow", undefined>, import('valibot').LiteralSchema<"avro", undefined>, import('valibot').LiteralSchema<"dtv", undefined>, import('valibot').LiteralSchema<"json", undefined>, import('valibot').LiteralSchema<"jsonl", undefined>, import('valibot').LiteralSchema<"markdown", undefined>, import('valibot').LiteralSchema<"ods", undefined>, import('valibot').LiteralSchema<"parquet", undefined>, import('valibot').LiteralSchema<"sav", undefined>, import('valibot').LiteralSchema<"sqlite", undefined>, import('valibot').LiteralSchema<"xlsx", undefined>, import('valibot').LiteralSchema<"xml", undefined>], undefined>, undefined>, import('valibot').MinLengthAction<("arrow" | "avro" | "dtv" | "json" | "jsonl" | "markdown" | "ods" | "parquet" | "sav" | "sqlite" | "xlsx" | "xml")[], 1, undefined>]>;
|
|
13
|
+
}, undefined>, undefined>;
|
|
14
|
+
readonly vendorAccountURL: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
15
|
+
readonly vendorDocumentationURL: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
16
|
+
readonly vendorHomeURL: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
17
|
+
readonly version: import('valibot').StringSchema<undefined>;
|
|
18
|
+
readonly firstCreatedAt: import('valibot').NullableSchema<import('valibot').NumberSchema<undefined>, undefined>;
|
|
19
|
+
readonly lastUpdatedAt: import('valibot').NullableSchema<import('valibot').NumberSchema<undefined>, undefined>;
|
|
20
|
+
readonly status: import('valibot').NullableSchema<import('valibot').StrictObjectSchema<{
|
|
21
|
+
readonly color: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"danger", undefined>, import('valibot').LiteralSchema<"success", undefined>, import('valibot').LiteralSchema<"warning", undefined>], undefined>;
|
|
22
|
+
readonly label: import('valibot').StringSchema<undefined>;
|
|
23
|
+
}, undefined>, undefined>;
|
|
24
|
+
readonly statusId: import('valibot').NullableSchema<import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"alpha", undefined>, import('valibot').LiteralSchema<"beta", undefined>, import('valibot').LiteralSchema<"releaseCandidate", undefined>, import('valibot').LiteralSchema<"generalAvailability", undefined>], undefined>, undefined>;
|
|
25
|
+
readonly id: import('valibot').StringSchema<undefined>;
|
|
26
|
+
readonly label: import('valibot').StrictObjectSchema<{
|
|
27
|
+
readonly en: import('valibot').OptionalSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
28
|
+
readonly es: import('valibot').OptionalSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
29
|
+
}, undefined>;
|
|
30
|
+
readonly description: import('valibot').StrictObjectSchema<{
|
|
31
|
+
readonly en: import('valibot').OptionalSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
32
|
+
readonly es: import('valibot').OptionalSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
33
|
+
}, undefined>;
|
|
34
|
+
readonly icon: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
35
|
+
readonly iconDark: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
36
|
+
}, undefined>;
|