@dpuse/dpuse-shared 1.0.146 → 1.0.147

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.
@@ -62,11 +62,11 @@ type ValueTrimMethodId = 'both' | 'left' | 'right' | 'none';
62
62
  export interface ContentAuditConfig {
63
63
  asAt: number;
64
64
  columns: ObjectColumnConfig[];
65
- commentLineCount: number;
66
- emptyLineCount: number;
67
- invalidFieldLengthCount: number;
65
+ commentLineCount: number | undefined;
66
+ emptyLineCount: number | undefined;
67
+ invalidFieldLengthCount: number | undefined;
68
68
  duration: number;
69
- lineCount: number;
69
+ lineCount: number | undefined;
70
70
  recordCount: number;
71
71
  }
72
72
  interface RelationshipsAuditConfig {
@@ -5,7 +5,7 @@ import { LocalisedConfig } from '../../../locale';
5
5
  import { ToolConfig } from '../tool';
6
6
  import { ConnectionDescriptionConfig, ConnectionNodeConfig, ObjectColumnConfig } from '../../connection';
7
7
  import { connectorActionNameSchema, connectorCategoryConfigSchema, connectorConfigSchema, connectorItemTypeConfigSchema, connectorItemTypeIdSchema, connectorUsageConfigSchema, connectorUsageIdSchema } from './connectorConfig.schema';
8
- import { DataFormatId, InferenceRecord, InferenceSummary, ParsingRecord, PreviewConfig, ValueDelimiterId } from '../../dataView';
8
+ import { ContentAuditConfig, DataFormatId, InferenceRecord, InferenceSummary, ParsingRecord, PreviewConfig, ValueDelimiterId } from '../../dataView';
9
9
  export { connectorConfigSchema } from './connectorConfig.schema';
10
10
  export interface ConnectorInterface extends Component {
11
11
  abortController: AbortController | undefined;
@@ -30,10 +30,15 @@ export interface ConnectorInterface extends Component {
30
30
  export type ConnectorActionName = InferOutput<typeof connectorActionNameSchema>;
31
31
  export type ConnectorConstructor = new (connectorUtilities: ConnectorUtilities, toolConfigs: ToolConfig[]) => ConnectorInterface;
32
32
  export interface ConnectorUtilities {
33
+ constructColumnAuditor: (hasHeaders: boolean) => ColumnAuditor;
33
34
  hasReadableStreamTransferSupport(): boolean;
34
35
  inferValues: (parsedRecord: ParsingRecord, columnConfigs: ObjectColumnConfig[], hasLeadingRecord: boolean) => InferenceRecord;
35
36
  inferDataTypes: (parsedRecords: ParsingRecord[]) => InferenceSummary;
36
37
  }
38
+ export interface ColumnAuditor {
39
+ auditRecords: (parsedRecords: ParsingRecord[]) => void;
40
+ completeAudit: () => ObjectColumnConfig[];
41
+ }
37
42
  export type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;
38
43
  type ConnectorCategoryConfig = InferOutput<typeof connectorCategoryConfigSchema>;
39
44
  type ConnectorItemTypeConfig = InferOutput<typeof connectorItemTypeConfigSchema>;
@@ -42,14 +47,14 @@ type ConnectorUsageConfig = InferOutput<typeof connectorUsageConfigSchema>;
42
47
  export interface AuditObjectContentOptions extends EngineConnectorActionOptions {
43
48
  chunkSize: number | undefined;
44
49
  encodingId: string;
50
+ hasHeaders: boolean;
45
51
  parsingToolName: string | undefined;
46
52
  path: string;
47
53
  supportsTransferableStreams: boolean;
48
54
  valueDelimiterId: ValueDelimiterId;
49
55
  }
50
56
  export interface AuditObjectContentResult {
51
- processedRowCount: number;
52
- durationMs: number;
57
+ contentAuditConfig: ContentAuditConfig;
53
58
  }
54
59
  export interface CreateObjectOptions extends EngineConnectorActionOptions {
55
60
  path: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpuse/dpuse-shared",
3
- "version": "1.0.146",
3
+ "version": "1.0.147",
4
4
  "private": false,
5
5
  "description": "Common constants, types and utilities used across DPUse projects.",
6
6
  "license": "MIT",