@dpuse/dpuse-shared 1.0.151 → 1.0.153

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.
@@ -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[]) => void;
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;
@@ -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.151",
3
+ "version": "1.0.153",
4
4
  "private": false,
5
5
  "description": "Common constants, types and utilities used across DPUse projects.",
6
6
  "license": "MIT",