@datapos/datapos-shared 0.3.477 → 0.3.479

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.
@@ -28,7 +28,7 @@ interface ConnectionAuthorisationConfig {
28
28
  */
29
29
  interface ConnectionNodeConfig {
30
30
  childCount?: number;
31
- columnsConfigs?: ConnectionColumnConfig[];
31
+ columnsConfigs?: ObjectColumnConfig[];
32
32
  extension: string | undefined;
33
33
  folderPath: string;
34
34
  handle?: DPAFileSystemFileHandle;
@@ -40,7 +40,7 @@ interface ConnectionNodeConfig {
40
40
  mimeType?: string;
41
41
  name: string;
42
42
  size?: number;
43
- typeId: ConnectionNodeTypeId;
43
+ typeId: NodeTypeId;
44
44
  }
45
45
  interface DPAFileSystemFileHandle {
46
46
  readonly kind: 'file';
@@ -49,7 +49,7 @@ interface DPAFileSystemFileHandle {
49
49
  /**
50
50
  * Connection node type identifier.
51
51
  */
52
- type ConnectionNodeTypeId = 'folder' | 'object';
52
+ type NodeTypeId = 'folder' | 'object';
53
53
  /**
54
54
  * Connection description configuration.
55
55
  */
@@ -57,13 +57,13 @@ interface ConnectionDescriptionConfig {
57
57
  objects: {
58
58
  id: string;
59
59
  label: Record<string, string>;
60
- columns: ConnectionColumnConfig[];
60
+ columns: ObjectColumnConfig[];
61
61
  }[];
62
62
  }
63
63
  /**
64
- * Connection column configuration.
64
+ * Object column configuration.
65
65
  */
66
- interface ConnectionColumnConfig {
66
+ interface ObjectColumnConfig {
67
67
  invalidValueCount?: number;
68
68
  invalidValues?: string[];
69
69
  isIgnored?: boolean;
@@ -77,11 +77,11 @@ interface ConnectionColumnConfig {
77
77
  minSize?: number;
78
78
  minValue?: string;
79
79
  patterns?: Record<string, string>;
80
- storageTypeId?: StorageDataTypeId;
81
- DataTypeId?: DataTypeId;
80
+ storageTypeId?: StorageTypeId;
81
+ dataTypeId?: DataTypeId;
82
82
  validValueCount?: number;
83
83
  validValues?: Record<string, string>;
84
84
  voidValueCount?: number;
85
85
  }
86
- type StorageDataTypeId = 'binary' | 'boolean' | 'byte' | 'date' | 'dateTime' | 'dateTimeOffset' | 'decimal' | 'double' | 'int8' | 'int16' | 'int32' | 'int64' | 'object' | 'single' | 'string' | 'time' | 'unknown';
87
- export type { ConnectionColumnConfig, ConnectionConfig, ConnectionDescriptionConfig, ConnectionNodeConfig };
86
+ type StorageTypeId = 'binary' | 'boolean' | 'byte' | 'date' | 'dateTime' | 'dateTimeOffset' | 'decimal' | 'double' | 'int8' | 'int16' | 'int32' | 'int64' | 'object' | 'single' | 'string' | 'time' | 'unknown';
87
+ export type { ConnectionConfig, ConnectionDescriptionConfig, ConnectionNodeConfig, ObjectColumnConfig };
@@ -4,7 +4,7 @@ import { EngineUtilities } from '../../engine';
4
4
  import { ToolConfig } from '../tool';
5
5
  import { ConnectionDescriptionConfig, ConnectionNodeConfig } from './connection';
6
6
  import { connectorCategoryConfigSchema, connectorConfigSchema, connectorOperationNameSchema, connectorUsageIdSchema } from './connectorConfig.schema';
7
- import { DataViewPreviewConfig, ParsingRecord, ValueDelimiterId } from '../dataView';
7
+ import { ParsingRecord, PreviewConfig, ValueDelimiterId } from '../dataView';
8
8
  /**
9
9
  * Connector interface and constructor.
10
10
  */
@@ -51,7 +51,7 @@ interface ConnectorInterface extends Component {
51
51
  /**
52
52
  * Preview an object for a specified connection.
53
53
  */
54
- previewObject?(options: PreviewObjectOptions): Promise<DataViewPreviewConfig>;
54
+ previewObject?(options: PreviewObjectOptions): Promise<PreviewConfig>;
55
55
  /**
56
56
  * Remove one or more records from an object for a specified connection.
57
57
  */
@@ -236,5 +236,5 @@ type ConnectorCategoryLocalisedConfig = Omit<ConnectorCategoryConfig, 'label'> &
236
236
  declare const constructConnectorCategoryConfig: (id: string, localeId?: import('../../locale').LocaleCode) => ConnectorCategoryLocalisedConfig;
237
237
  export { connectorConfigSchema } from './connectorConfig.schema';
238
238
  export { constructConnectorCategoryConfig };
239
- export type { ConnectionColumnConfig, ConnectionConfig, ConnectionNodeConfig } from './connection';
239
+ export type { ConnectionConfig, ConnectionNodeConfig, ObjectColumnConfig } from './connection';
240
240
  export type { ConnectorConfig, ConnectorConstructor, ConnectorInterface, ConnectorLocalisedConfig, ConnectorOperationName, ConnectorOperationOptions, ConnectorUsageId, CreateObjectOptions, DropObjectOptions, FindObjectFolderPathOptions, GetReadableStreamOptions, GetRecordResult, GetRecordOptions, ListNodesResult, ListNodesOptions, PreviewObjectOptions, RemoveRecordsOptions, RetrieveChunksOptions, RetrieveRecordsOptions, RetrieveRecordsSummary, UpsertRecordsOptions };
@@ -1,6 +1,6 @@
1
1
  import { FileTypeResult } from 'file-type';
2
2
  import { Component, ComponentConfig } from '..';
3
- import { ConnectionColumnConfig, ConnectionNodeConfig } from '../connector/connection';
3
+ import { ConnectionNodeConfig, ObjectColumnConfig } from '../connector/connection';
4
4
  /**
5
5
  * Data view interface.
6
6
  */
@@ -9,11 +9,11 @@ type DataViewInterface = Component;
9
9
  * Data view configuration.
10
10
  */
11
11
  interface DataViewConfig extends ComponentConfig {
12
- connectionId?: string;
13
- connectionNodeConfig?: ConnectionNodeConfig;
14
- previewConfig?: DataViewPreviewConfig;
15
- contentAuditConfig?: DataViewContentAuditConfig;
16
- relationshipsAuditConfig?: DataViewRelationshipsAuditConfig;
12
+ connectionId: string | undefined;
13
+ connectionNodeConfig: ConnectionNodeConfig | undefined;
14
+ previewConfig: PreviewConfig | undefined;
15
+ contentAuditConfig: ContentAuditConfig | undefined;
16
+ relationshipsAuditConfig: RelationshipsAuditConfig | undefined;
17
17
  }
18
18
  /**
19
19
  * Data view localised configuration.
@@ -25,29 +25,37 @@ type DataViewLocalisedConfig = Omit<DataViewConfig, 'label' | 'description'> & {
25
25
  /**
26
26
  * Data view preview configuration.
27
27
  */
28
- interface DataViewPreviewConfig {
28
+ interface PreviewConfig {
29
29
  asAt: number;
30
- columnConfigs: ConnectionColumnConfig[];
30
+ commentMarkCharSeq: string | undefined;
31
+ columnConfigs: ObjectColumnConfig[];
31
32
  dataFormatId: DataFormatId | undefined;
32
33
  duration: number;
33
34
  encodingConfidenceLevel: number | undefined;
34
35
  encodingId: string | undefined;
35
- errorMessage?: string;
36
+ errorMessage: string | undefined;
36
37
  fileType: FileTypeResult | undefined;
37
- hasHeaders: boolean | undefined;
38
- recordDelimiterId?: RecordDelimiterId;
38
+ hasHeaders: boolean;
39
+ linesToSkipAtStart: number;
40
+ quoteEscapeChar: string;
41
+ quoteMarkCharSeq: string;
42
+ recordDelimiterCharSeq: RecordDelimiterId;
39
43
  parsingRecords: ParsingRecord[];
40
44
  inferenceRecords: InferenceRecord[];
41
45
  size: number;
46
+ skipEmptyLines: boolean;
47
+ skipLinesWithEmptyValues: boolean;
48
+ skipLinesWithErrors: boolean;
42
49
  text: string;
43
- valueDelimiterId?: ValueDelimiterId;
50
+ valueDelimiterCharSeq: ValueDelimiterId;
51
+ valueTrimMethodId: string;
44
52
  }
45
53
  /**
46
54
  * Data view content audit configuration.
47
55
  */
48
- interface DataViewContentAuditConfig {
56
+ interface ContentAuditConfig {
49
57
  asAt: number;
50
- columns: ConnectionColumnConfig[];
58
+ columns: ObjectColumnConfig[];
51
59
  commentLineCount: number;
52
60
  emptyLineCount: number;
53
61
  invalidFieldLengthCount: number;
@@ -58,7 +66,7 @@ interface DataViewContentAuditConfig {
58
66
  /**
59
67
  * Data view relationships audit configuration.
60
68
  */
61
- interface DataViewRelationshipsAuditConfig {
69
+ interface RelationshipsAuditConfig {
62
70
  placeholder?: string;
63
71
  }
64
72
  type ObjectRecord = (NamedValueRecord | StringValueRecord | ValueRecord)[];
@@ -142,7 +150,7 @@ type ValueDelimiterId = '' | ':' | ',' | '!' | '0x1E' | ';' | ' ' | '\t' | '_' |
142
150
  */
143
151
  declare const ORDERED_VALUE_DELIMITER_IDS: ValueDelimiterId[];
144
152
  export { ORDERED_VALUE_DELIMITER_IDS };
145
- export type { DataViewInterface, DataViewConfig, DataViewContentAuditConfig, DataViewLocalisedConfig, DataViewPreviewConfig, DataFormatId, // Data format.
153
+ export type { DataViewInterface, DataViewConfig, DataViewLocalisedConfig, PreviewConfig, ContentAuditConfig, RelationshipsAuditConfig, DataFormatId, // Data format.
146
154
  DataTypeId, // Data type.
147
155
  NumericSubtypeId, // Numeric subtype and characteristics.
148
156
  NumericSignId, NumericUnitsId, StringSubtypeId, // String subtype.
@@ -2,9 +2,9 @@ import { ConnectionConfig } from '../component/connector/connection';
2
2
  import { EncodingTypeConfig } from '../encoding';
3
3
  import { ModuleConfig } from '../component/module';
4
4
  import { ToolConfig } from '../component/tool';
5
- import { ConnectionColumnConfig, ConnectorOperationOptions } from '../component/connector';
5
+ import { ConnectorOperationOptions, ObjectColumnConfig } from '../component/connector';
6
+ import { ContentAuditConfig, InferenceRecord, ParsingRecord, ValueDelimiterId } from '../component/dataView';
6
7
  import { ContextConfig, ContextOperationOptions } from '../component/context';
7
- import { DataViewContentAuditConfig, InferenceResult, ParsingResult, ValueDelimiterId } from '../component/dataView';
8
8
  /**
9
9
  * Engine runtime interface.
10
10
  */
@@ -43,7 +43,7 @@ interface EngineCallbackData {
43
43
  * Engine utilities.
44
44
  */
45
45
  interface EngineUtilities {
46
- parseRecord: (columnConfigs: ConnectionColumnConfig[], record: ParsingResult[], isPreview: boolean) => InferenceResult[];
46
+ inferValues: (columnConfigs: ObjectColumnConfig[], parsingRecord: ParsingRecord) => InferenceRecord;
47
47
  }
48
48
  /**
49
49
  * Audit object content options and result.
@@ -55,7 +55,7 @@ interface AuditObjectContentOptions extends ConnectorOperationOptions {
55
55
  valueDelimiterId: ValueDelimiterId;
56
56
  }
57
57
  interface AuditObjectContentResult {
58
- contentAuditConfig: DataViewContentAuditConfig;
58
+ contentAuditConfig: ContentAuditConfig;
59
59
  }
60
60
  interface TestSettings {
61
61
  action?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.477",
3
+ "version": "0.3.479",
4
4
  "description": "A library containing common constants, types and utilities used across all Data Positioning projects.",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Terrell <terrell.jm@gmail.com>",