@dpuse/dpuse-shared 1.0.208 → 1.0.210

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.
@@ -6,6 +6,7 @@ export interface DataViewConfig extends ComponentInstanceConfig {
6
6
  connectionId: string;
7
7
  connectionNodeConfig: ConnectionNodeConfig | undefined;
8
8
  readingConfig: ReadingConfig | undefined;
9
+ readingChoiceConfig?: ReadingChoiceConfig | undefined;
9
10
  sampleConfig: SampleConfig | undefined;
10
11
  contentAuditConfig: ContentAuditConfig | undefined;
11
12
  columnChoiceConfigs: ColumnChoiceConfigs | undefined;
@@ -22,19 +23,32 @@ export interface ReadingConfig {
22
23
  isDeclared?: boolean | undefined;
23
24
  parserId: string | undefined;
24
25
  recordDelimiterId: RecordDelimiterId | undefined;
25
- replacementCharacterCount?: number | undefined;
26
26
  valueDelimiterId: ValueDelimiterId | undefined;
27
27
  }
28
28
  export type DataFormatId = (typeof DATA_FORMAT_CONFIGS)[number]['id'];
29
- export type DataFormatSourceId = 'choice' | 'fileContent' | 'jsonSyntax' | 'mimeType' | 'extension' | 'default';
30
- export type EncodingSourceId = 'choice' | 'byteOrderMark' | 'xmlDeclaration' | 'xmlDefault' | 'utf8Validation' | 'detection' | 'asciiAssumption' | 'fallback';
29
+ export interface ReadingChoiceConfig {
30
+ dataFormatId: DataFormatId | undefined;
31
+ encodingId: string | undefined;
32
+ hasHeaders: boolean | undefined;
33
+ parserId: string | undefined;
34
+ valueDelimiterId: ValueDelimiterId | undefined;
35
+ }
36
+ export type DataFormatSourceId = 'fileContent' | 'jsonSyntax' | 'mimeType' | 'extension' | 'default';
37
+ export type EncodingSourceId = 'byteOrderMark' | 'xmlDeclaration' | 'xmlDefault' | 'utf8Validation' | 'detection' | 'asciiAssumption' | 'fallback';
31
38
  export type RecordDelimiterId = '\n' | '\r' | '\r\n';
32
39
  export type ValueDelimiterId = (typeof VALUE_DELIMITER_CONFIGS)[number]['id'] | '';
33
40
  export interface SampleConfig {
41
+ dataFormatId?: DataFormatId | undefined;
42
+ decodedEncodingId?: string | undefined;
43
+ hasHeaders?: boolean | undefined;
34
44
  issues: SampleIssue[];
35
45
  parsedRecords: ParsedRecord[];
46
+ parserId?: string | undefined;
47
+ recordDelimiterId?: RecordDelimiterId | undefined;
48
+ replacementCharacterCount?: number | undefined;
36
49
  size: number | undefined;
37
50
  text: string | undefined;
51
+ valueDelimiterId?: ValueDelimiterId | undefined;
38
52
  }
39
53
  export interface SampleIssue {
40
54
  endLineNumber: number | undefined;
@@ -1,5 +1,5 @@
1
1
  import { AuditObjectContentOptions, AuditObjectContentResult, ConnectorUtilities, PreviewObjectResult, RecordRetrievalTypeId, RetrieveRecordsOptions, RetrieveRecordsSummary } from '.';
2
- import { DeclaredColumnConfig, DeclaredReadingConfig, ParsedRecord, ValueDelimiterId } from '../../dataView';
2
+ import { DeclaredColumnConfig, DeclaredReadingConfig, ParsedRecord, ReadingChoiceConfig } from '../../dataView';
3
3
  import { FilePreviewResult, ToolConfig } from '../tool';
4
4
  export declare function buildPreviewObjectResult(input: {
5
5
  asAt: number;
@@ -7,10 +7,9 @@ export declare function buildPreviewObjectResult(input: {
7
7
  declaredReadingConfig?: DeclaredReadingConfig | undefined;
8
8
  filePreview: FilePreviewResult;
9
9
  inferDataTypes: ConnectorUtilities['inferDataTypes'];
10
- parserId: string | undefined;
10
+ readingChoiceConfig: ReadingChoiceConfig | undefined;
11
11
  startedAt: number;
12
12
  toolConfigs: ToolConfig[];
13
- valueDelimiterId: ValueDelimiterId | undefined;
14
13
  }): Promise<PreviewObjectResult>;
15
14
  export declare function retrieveRecordsWithParser(input: {
16
15
  chunk: (typeId: RecordRetrievalTypeId, records: ParsedRecord[]) => void | Promise<void>;
@@ -2,16 +2,13 @@ import { FileTypeResult } from 'file-type';
2
2
  import { EncodingDetectionConfig } from '../../../encoding';
3
3
  import { DataFormatId, DataFormatSourceId, EncodingSourceId } from '../../dataView';
4
4
  export interface FilePreviewerInterface {
5
- previewFile: (url: string, signal: AbortSignal, chunkSize?: number, mimeType?: string, choices?: PreviewChoices) => Promise<FilePreviewResult>;
6
- }
7
- export interface PreviewChoices {
8
- dataFormatId: DataFormatId | undefined;
9
- encodingId: string | undefined;
5
+ previewFile: (url: string, signal: AbortSignal, chunkSize?: number, mimeType?: string, encodingId?: string) => Promise<FilePreviewResult>;
10
6
  }
11
7
  export interface FilePreviewResult {
12
8
  bytes: Uint8Array;
13
9
  dataFormatId: DataFormatId | undefined;
14
10
  dataFormatSourceId: DataFormatSourceId | undefined;
11
+ decodedEncodingId: string | undefined;
15
12
  encodingId: string | undefined;
16
13
  encodingConfidenceLevel: number | undefined;
17
14
  encodingSourceId: EncodingSourceId | undefined;
@@ -4,7 +4,7 @@ import { parserConfigSchema, toolConfigSchema } from './toolConfig.schema';
4
4
  export { toolConfigSchema } from './toolConfig.schema';
5
5
  export type ToolConfig = InferOutput<typeof toolConfigSchema>;
6
6
  export type ParserConfig = InferOutput<typeof parserConfigSchema>;
7
- export type { FilePreviewerInterface, FilePreviewResult, PreviewChoices } from './filePreviewer';
7
+ export type { FilePreviewerInterface, FilePreviewResult } from './filePreviewer';
8
8
  export type { ParserInterface, ParseStreamOptions, ParseTextOptions, ParseTextResult } from './parser';
9
9
  export { parseDelimitedText, type ParseTextWithDelimiter } from './delimitedText';
10
10
  export declare const TOOL_NAME_PREFIX = "dpuse-tool-";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpuse/dpuse-shared",
3
- "version": "1.0.208",
3
+ "version": "1.0.210",
4
4
  "private": false,
5
5
  "description": "Common constants, types and utilities used across DPUse projects.",
6
6
  "license": "MIT",
@@ -73,7 +73,7 @@
73
73
  "fast-check": "^4.10.2",
74
74
  "iconv-lite": "^0.7.3",
75
75
  "jschardet": "^4.1.0",
76
- "prettier": "^3.9.10",
76
+ "prettier": "^3.10.0",
77
77
  "sonda": "^0.14.0",
78
78
  "typescript": "^6.0.3",
79
79
  "vite": "^8.3.8",