@dpuse/dpuse-shared 1.0.152 → 1.0.154
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 +2 -2
- package/dist/dpuse-shared.es.js +16 -15
- package/dist/dpuse-shared.es.js.map +1 -1
- package/dist/types/src/component/module/connector/index.d.ts +15 -3
- package/dist/types/src/component/module/connector/objectParsing.d.ts +2 -1
- package/dist/types/src/component/module/tool/parser.d.ts +1 -1
- package/package.json +2 -2
|
@@ -3,7 +3,7 @@ import { Component } from '../..';
|
|
|
3
3
|
import { EngineConnectorActionOptions } from '../engine';
|
|
4
4
|
import { LocalisedConfig } from '../../../locale';
|
|
5
5
|
import { ToolConfig } from '../tool';
|
|
6
|
-
import { ConnectionDescriptionConfig, ConnectionNodeConfig, ObjectColumnConfig } from '../../connection';
|
|
6
|
+
import { ConnectionConfig, ConnectionDescriptionConfig, ConnectionNodeConfig, ObjectColumnConfig } from '../../connection';
|
|
7
7
|
import { connectorActionNameSchema, connectorCategoryConfigSchema, connectorConfigSchema, connectorItemTypeConfigSchema, connectorItemTypeIdSchema, connectorUsageConfigSchema, connectorUsageIdSchema } from './connectorConfig.schema';
|
|
8
8
|
import { ContentAuditConfig, DataFormatId, InferenceRecord, InferenceSummary, ParsingRecord, PreviewConfig, ValueDelimiterId } from '../../dataView';
|
|
9
9
|
export { connectorConfigSchema } from './connectorConfig.schema';
|
|
@@ -13,7 +13,7 @@ export interface ConnectorInterface extends Component {
|
|
|
13
13
|
readonly config: ConnectorConfig;
|
|
14
14
|
readonly toolConfigs: ToolConfig[];
|
|
15
15
|
abortOperation?(): void;
|
|
16
|
-
auditObjectContent?(options: AuditObjectContentOptions, chunk: (rowCount: number) => void): Promise<AuditObjectContentResult>;
|
|
16
|
+
auditObjectContent?(options: AuditObjectContentOptions, chunk: (rowCount: number) => void, records?: (inferenceRecords: InferenceRecord[]) => Promise<void>): Promise<AuditObjectContentResult>;
|
|
17
17
|
createObject?(options: CreateObjectOptions): Promise<void>;
|
|
18
18
|
describeConnection?(options: DescribeConnectionOptions): Promise<DescribeConnectionResult>;
|
|
19
19
|
dropObject?(options: DropObjectOptions): Promise<void>;
|
|
@@ -37,7 +37,7 @@ export interface ConnectorUtilities {
|
|
|
37
37
|
inferDataTypes: (parsedRecords: ParsingRecord[]) => InferenceSummary;
|
|
38
38
|
}
|
|
39
39
|
export interface ColumnAuditor {
|
|
40
|
-
auditRecords: (parsedRecords: ParsingRecord[]) =>
|
|
40
|
+
auditRecords: (parsedRecords: ParsingRecord[]) => InferenceRecord[];
|
|
41
41
|
completeAudit: () => ObjectColumnConfig[];
|
|
42
42
|
}
|
|
43
43
|
export type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;
|
|
@@ -52,12 +52,18 @@ export interface AuditObjectContentOptions extends EngineConnectorActionOptions
|
|
|
52
52
|
hasHeaders: boolean;
|
|
53
53
|
parserId: string | undefined;
|
|
54
54
|
path: string;
|
|
55
|
+
recordStore?: RecordStoreConfig | undefined;
|
|
55
56
|
supportsTransferableStreams: boolean;
|
|
56
57
|
valueDelimiterId: ValueDelimiterId;
|
|
57
58
|
}
|
|
58
59
|
export interface AuditObjectContentResult {
|
|
59
60
|
contentAuditConfig: ContentAuditConfig;
|
|
60
61
|
}
|
|
62
|
+
export interface RecordStoreConfig {
|
|
63
|
+
connectionConfig: ConnectionConfig;
|
|
64
|
+
nodeId: string;
|
|
65
|
+
storeId: string;
|
|
66
|
+
}
|
|
61
67
|
export interface CreateObjectOptions extends EngineConnectorActionOptions {
|
|
62
68
|
path: string;
|
|
63
69
|
structure: string;
|
|
@@ -130,8 +136,13 @@ export interface RetrieveRecordsOptions extends EngineConnectorActionOptions {
|
|
|
130
136
|
encodingId: string;
|
|
131
137
|
parserId: string | undefined;
|
|
132
138
|
path: string;
|
|
139
|
+
range?: RecordRange | undefined;
|
|
133
140
|
valueDelimiterId: ValueDelimiterId;
|
|
134
141
|
}
|
|
142
|
+
export interface RecordRange {
|
|
143
|
+
limit: number;
|
|
144
|
+
offset: number;
|
|
145
|
+
}
|
|
135
146
|
export interface RetrieveRecordsSummary {
|
|
136
147
|
byteCount: number;
|
|
137
148
|
commentLineCount: number;
|
|
@@ -139,6 +150,7 @@ export interface RetrieveRecordsSummary {
|
|
|
139
150
|
lineCount: number;
|
|
140
151
|
nonUniformRecordCount: number;
|
|
141
152
|
recordCount: number;
|
|
153
|
+
totalCount?: number | undefined;
|
|
142
154
|
}
|
|
143
155
|
export type RecordRetrievalTypeId = 'jsonRecordArray' | 'parsingRecordArray';
|
|
144
156
|
export interface UpsertRecordsOptions extends EngineConnectorActionOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FileTypeResult } from 'file-type';
|
|
2
2
|
import { AuditObjectContentOptions, ColumnAuditor, ConnectorUtilities, RecordRetrievalTypeId, RetrieveRecordsOptions, RetrieveRecordsSummary } from '.';
|
|
3
|
-
import { ContentAuditConfig, DataFormatId, ParsingRecord, PreviewConfig } from '../../dataView';
|
|
3
|
+
import { ContentAuditConfig, DataFormatId, InferenceRecord, ParsingRecord, PreviewConfig } from '../../dataView';
|
|
4
4
|
import { ToolConfig } from '../tool';
|
|
5
5
|
export interface ObjectFilePreview {
|
|
6
6
|
bytes: Uint8Array;
|
|
@@ -29,6 +29,7 @@ export declare function retrieveRecordsWithParser(input: {
|
|
|
29
29
|
export declare function auditObjectContentWithParser(input: {
|
|
30
30
|
constructColumnAuditor: (hasHeaders: boolean) => ColumnAuditor;
|
|
31
31
|
onProgress: (recordCount: number) => void;
|
|
32
|
+
onRecords?: ((inferenceRecords: InferenceRecord[]) => Promise<void>) | undefined;
|
|
32
33
|
options: AuditObjectContentOptions;
|
|
33
34
|
signal: AbortSignal;
|
|
34
35
|
stream: ReadableStream<Uint8Array>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DataFormatId, ParsingRecord, PreviewIssue, RecordDelimiterId, ValueDelimiterId } from '../../dataView';
|
|
2
2
|
import { RecordRetrievalTypeId, RetrieveRecordsSummary } from '../connector';
|
|
3
3
|
export interface ParserInterface {
|
|
4
|
-
parseStream: (stream: ReadableStream<Uint8Array>, options: ParseStreamOptions, chunk: (typeId: RecordRetrievalTypeId, records: ParsingRecord[]) => void) => Promise<RetrieveRecordsSummary>;
|
|
4
|
+
parseStream: (stream: ReadableStream<Uint8Array>, options: ParseStreamOptions, chunk: (typeId: RecordRetrievalTypeId, records: ParsingRecord[]) => void | Promise<void>) => Promise<RetrieveRecordsSummary>;
|
|
5
5
|
parseText: (text: string, options: ParseTextOptions) => Promise<ParseTextResult>;
|
|
6
6
|
}
|
|
7
7
|
export interface ParseTextOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dpuse/dpuse-shared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.154",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Common constants, types and utilities used across DPUse projects.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"@types/node": "^26.6.5",
|
|
70
70
|
"@vitest/coverage-v8": "^5.0.5",
|
|
71
71
|
"eslint": "^10.13.0",
|
|
72
|
-
"fallow": "^3.
|
|
72
|
+
"fallow": "^3.37.0",
|
|
73
73
|
"fast-check": "^4.10.2",
|
|
74
74
|
"jschardet": "^4.1.0",
|
|
75
75
|
"prettier": "^3.9.10",
|