@dpuse/dpuse-shared 1.0.155 → 1.0.159
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 +6 -6
- package/dist/dpuse-shared.es.js +25 -16
- package/dist/dpuse-shared.es.js.map +1 -1
- package/dist/types/src/component/module/connector/connectorConfig.schema.d.ts +2 -2
- package/dist/types/src/component/module/connector/index.d.ts +49 -8
- package/dist/types/src/component/module/connector/objectParsing.d.ts +1 -2
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Defines the configuration metadata for a connector. Used for validation
|
|
3
3
|
* of connector manifests and capability discovery at runtime.
|
|
4
4
|
*/
|
|
5
|
-
export declare const connectorActionNameSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"auditObjectContent", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObject", undefined>, import('valibot').LiteralSchema<"getInfo", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>;
|
|
5
|
+
export declare const connectorActionNameSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"auditObjectContent", undefined>, import('valibot').LiteralSchema<"closeStore", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObject", undefined>, import('valibot').LiteralSchema<"getInfo", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"loadObjectRecords", undefined>, import('valibot').LiteralSchema<"openStore", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"queryRecords", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>;
|
|
6
6
|
export declare const connectorCategoryConfigSchema: import('valibot').StrictObjectSchema<{
|
|
7
7
|
readonly label: import('valibot').StrictObjectSchema<{
|
|
8
8
|
readonly en: import('valibot').StringSchema<undefined>;
|
|
@@ -25,7 +25,7 @@ export declare const connectorUsageConfigSchema: import('valibot').StrictObjectS
|
|
|
25
25
|
}, undefined>;
|
|
26
26
|
export declare const connectorConfigSchema: import('valibot').StrictObjectSchema<{
|
|
27
27
|
readonly typeId: import('valibot').LiteralSchema<"connector", undefined>;
|
|
28
|
-
readonly actionNames: import('valibot').ArraySchema<import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"auditObjectContent", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObject", undefined>, import('valibot').LiteralSchema<"getInfo", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>, undefined>;
|
|
28
|
+
readonly actionNames: import('valibot').ArraySchema<import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"auditObjectContent", undefined>, import('valibot').LiteralSchema<"closeStore", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObject", undefined>, import('valibot').LiteralSchema<"getInfo", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"loadObjectRecords", undefined>, import('valibot').LiteralSchema<"openStore", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"queryRecords", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>, undefined>;
|
|
29
29
|
readonly category: import('valibot').NullableSchema<import('valibot').StrictObjectSchema<{
|
|
30
30
|
readonly label: import('valibot').StrictObjectSchema<{
|
|
31
31
|
readonly en: import('valibot').StringSchema<undefined>;
|
|
@@ -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 {
|
|
6
|
+
import { 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,8 @@ 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
|
|
16
|
+
auditObjectContent?(options: AuditObjectContentOptions, chunk: (rowCount: number) => void): Promise<AuditObjectContentResult>;
|
|
17
|
+
closeStore?(options: CloseStoreOptions): Promise<void>;
|
|
17
18
|
createObject?(options: CreateObjectOptions): Promise<void>;
|
|
18
19
|
describeConnection?(options: DescribeConnectionOptions): Promise<DescribeConnectionResult>;
|
|
19
20
|
dropObject?(options: DropObjectOptions): Promise<void>;
|
|
@@ -22,7 +23,10 @@ export interface ConnectorInterface extends Component {
|
|
|
22
23
|
getReadableStream?(options: GetReadableStreamOptions): Promise<ReadableStream<Uint8Array>>;
|
|
23
24
|
getRecord?(options: GetRecordOptions): Promise<GetRecordResult>;
|
|
24
25
|
listNodes?(options: ListNodesOptions): Promise<ListNodesResult>;
|
|
26
|
+
loadObjectRecords?(options: LoadObjectRecordsOptions, chunks: AsyncIterable<StoreRecord[]>): Promise<LoadObjectRecordsResult>;
|
|
27
|
+
openStore?(options: OpenStoreOptions): Promise<OpenStoreResult>;
|
|
25
28
|
previewObject?(options: PreviewObjectOptions): Promise<PreviewConfig>;
|
|
29
|
+
queryRecords?(options: QueryRecordsOptions): Promise<QueryRecordsResult>;
|
|
26
30
|
removeRecords?(options: RemoveRecordsOptions): Promise<void>;
|
|
27
31
|
retrieveChunks?(options: RetrieveChunksOptions, chunk: (data: Uint8Array) => void, complete: () => void): Promise<void>;
|
|
28
32
|
retrieveRecords?(options: RetrieveRecordsOptions, chunk: (typeId: RecordRetrievalTypeId, records: Record<string, unknown>[] | ParsingRecord[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void>;
|
|
@@ -52,18 +56,13 @@ export interface AuditObjectContentOptions extends EngineConnectorActionOptions
|
|
|
52
56
|
hasHeaders: boolean;
|
|
53
57
|
parserId: string | undefined;
|
|
54
58
|
path: string;
|
|
55
|
-
recordStore?: RecordStoreConfig | undefined;
|
|
56
59
|
supportsTransferableStreams: boolean;
|
|
57
60
|
valueDelimiterId: ValueDelimiterId;
|
|
58
61
|
}
|
|
59
62
|
export interface AuditObjectContentResult {
|
|
60
63
|
contentAuditConfig: ContentAuditConfig;
|
|
61
64
|
}
|
|
62
|
-
export
|
|
63
|
-
connectionConfig: ConnectionConfig;
|
|
64
|
-
nodeId: string;
|
|
65
|
-
storeId: string;
|
|
66
|
-
}
|
|
65
|
+
export type CloseStoreOptions = EngineConnectorActionOptions;
|
|
67
66
|
export interface CreateObjectOptions extends EngineConnectorActionOptions {
|
|
68
67
|
path: string;
|
|
69
68
|
structure: string;
|
|
@@ -111,6 +110,20 @@ export interface ListNodesResult {
|
|
|
111
110
|
isMore: boolean;
|
|
112
111
|
totalCount: number;
|
|
113
112
|
}
|
|
113
|
+
export interface LoadObjectRecordsOptions extends EngineConnectorActionOptions {
|
|
114
|
+
columnConfigs: ObjectColumnConfig[];
|
|
115
|
+
path: string;
|
|
116
|
+
}
|
|
117
|
+
export interface LoadObjectRecordsResult {
|
|
118
|
+
recordCount: number;
|
|
119
|
+
}
|
|
120
|
+
export type StoreRecord = StoreValue[];
|
|
121
|
+
export type StoreValue = bigint | boolean | Date | number | string | null;
|
|
122
|
+
export type OpenStoreOptions = EngineConnectorActionOptions;
|
|
123
|
+
export interface OpenStoreResult {
|
|
124
|
+
storeStateId: StoreStateId;
|
|
125
|
+
}
|
|
126
|
+
export type StoreStateId = 'heldElsewhere' | 'ready' | 'unavailable';
|
|
114
127
|
export interface PreviewObjectOptions extends EngineConnectorActionOptions {
|
|
115
128
|
chunkSize: number | undefined;
|
|
116
129
|
dataFormatId: DataFormatId | undefined;
|
|
@@ -120,6 +133,34 @@ export interface PreviewObjectOptions extends EngineConnectorActionOptions {
|
|
|
120
133
|
parserId: string | undefined;
|
|
121
134
|
path: string;
|
|
122
135
|
}
|
|
136
|
+
export interface QueryRecordsOptions extends EngineConnectorActionOptions {
|
|
137
|
+
aggregates: QueryAggregate[];
|
|
138
|
+
filters: QueryFilter[];
|
|
139
|
+
groupColumnIndexes: number[];
|
|
140
|
+
limit: number;
|
|
141
|
+
offset: number;
|
|
142
|
+
path: string;
|
|
143
|
+
sorts: QuerySort[];
|
|
144
|
+
}
|
|
145
|
+
export interface QueryAggregate {
|
|
146
|
+
columnIndex: number | undefined;
|
|
147
|
+
functionId: QueryAggregateFunctionId;
|
|
148
|
+
}
|
|
149
|
+
export type QueryAggregateFunctionId = 'average' | 'count' | 'countDistinct' | 'maximum' | 'minimum' | 'sum';
|
|
150
|
+
export interface QueryFilter {
|
|
151
|
+
columnIndex: number;
|
|
152
|
+
operatorId: QueryFilterOperatorId;
|
|
153
|
+
value: StoreValue;
|
|
154
|
+
}
|
|
155
|
+
export type QueryFilterOperatorId = 'contains' | 'endsWith' | 'equals' | 'greaterThan' | 'greaterThanOrEquals' | 'isEmpty' | 'isNotEmpty' | 'lessThan' | 'lessThanOrEquals' | 'notEquals' | 'startsWith';
|
|
156
|
+
export interface QuerySort {
|
|
157
|
+
columnIndex: number;
|
|
158
|
+
directionId: 'ascending' | 'descending';
|
|
159
|
+
}
|
|
160
|
+
export interface QueryRecordsResult {
|
|
161
|
+
records: StoreRecord[];
|
|
162
|
+
totalCount: number;
|
|
163
|
+
}
|
|
123
164
|
export interface RemoveRecordsOptions extends EngineConnectorActionOptions {
|
|
124
165
|
keys: string[];
|
|
125
166
|
path: string;
|
|
@@ -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,
|
|
3
|
+
import { ContentAuditConfig, DataFormatId, ParsingRecord, PreviewConfig } from '../../dataView';
|
|
4
4
|
import { ToolConfig } from '../tool';
|
|
5
5
|
export interface ObjectFilePreview {
|
|
6
6
|
bytes: Uint8Array;
|
|
@@ -29,7 +29,6 @@ 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;
|
|
33
32
|
options: AuditObjectContentOptions;
|
|
34
33
|
signal: AbortSignal;
|
|
35
34
|
stream: ReadableStream<Uint8Array>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dpuse/dpuse-shared",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.159",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Common constants, types and utilities used across DPUse projects.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"valibot": "^1.5.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@dpuse/dpuse-development": "^1.0.
|
|
67
|
+
"@dpuse/dpuse-development": "^1.0.140",
|
|
68
68
|
"@dpuse/eslint-config-dpuse": "^1.0.145",
|
|
69
69
|
"@types/node": "^26.6.5",
|
|
70
70
|
"@vitest/coverage-v8": "^5.0.5",
|