@datapos/datapos-shared 0.3.506 → 0.3.508

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.
@@ -29,7 +29,7 @@ interface PreviewConfig {
29
29
  asAt: number;
30
30
  commentMarkId?: string | undefined;
31
31
  commentMarkOtherCharSeq?: string | undefined;
32
- columnConfigs: ObjectColumnConfig[] | undefined;
32
+ columnConfigs: ObjectColumnConfig[];
33
33
  dataFormatId: DataFormatId;
34
34
  duration: number;
35
35
  encodingConfidenceLevel: number | undefined;
@@ -37,14 +37,14 @@ interface PreviewConfig {
37
37
  errorMessage?: string | undefined;
38
38
  fileType: FileTypeResult | undefined;
39
39
  hasHeaders: boolean | undefined;
40
- inferenceRecords: InferenceRecord[] | undefined;
40
+ inferenceRecords: InferenceRecord[];
41
41
  linesToSkipAtStart?: number | undefined;
42
- parsedRecords: ParsingRecord[] | undefined;
42
+ parsedRecords: ParsingRecord[];
43
43
  quoteEscapeChar?: string | undefined;
44
44
  quoteMarkId?: string | undefined;
45
45
  quoteMarkOtherCharSeq?: string | undefined;
46
46
  recordDelimiterId: RecordDelimiterId | undefined;
47
- recordDelimiterOtherCharSeq?: RecordDelimiterId | undefined;
47
+ recordDelimiterOtherCharSeq?: string | undefined;
48
48
  size: number | undefined;
49
49
  skipEmptyLines?: boolean | undefined;
50
50
  skipLinesWithEmptyValues?: boolean | undefined;
@@ -52,8 +52,12 @@ interface PreviewConfig {
52
52
  text: string | undefined;
53
53
  valueDelimiterId: ValueDelimiterId | undefined;
54
54
  valueDelimiterOtherCharSeq?: string | undefined;
55
- valueTrimMethodId?: string | undefined;
55
+ valueTrimMethodId?: ValueTrimMethodId | undefined;
56
56
  }
57
+ /**
58
+ *
59
+ */
60
+ type ValueTrimMethodId = 'both' | 'left' | 'right' | 'none';
57
61
  /**
58
62
  * Data view content audit configuration.
59
63
  */
@@ -71,7 +75,34 @@ interface ContentAuditConfig {
71
75
  * Data view relationships audit configuration.
72
76
  */
73
77
  interface RelationshipsAuditConfig {
74
- placeholder?: string;
78
+ placeholder: string;
79
+ }
80
+ /**
81
+ *
82
+ */
83
+ type DataFormatId = 'dpe' | 'dtv' | 'json' | 'spss' | 'xlsx' | 'xml' | 'unknown';
84
+ /**
85
+ *
86
+ */
87
+ type RecordDelimiterId = '\n' | '\r' | '\r\n';
88
+ /**
89
+ *
90
+ */
91
+ type ValueDelimiterId = '' | ':' | ',' | '!' | '0x1E' | ';' | ' ' | '\t' | '_' | '0x1F' | '|';
92
+ /**
93
+ *
94
+ */
95
+ declare const ORDERED_VALUE_DELIMITER_IDS: ValueDelimiterId[];
96
+ /**
97
+ *
98
+ */
99
+ type ParsingRecord = ParsingResult[];
100
+ /**
101
+ *
102
+ */
103
+ interface ParsingResult {
104
+ value: string | null;
105
+ valueWasQuoted: boolean;
75
106
  }
76
107
  type DataTypeId = 'boolean' | 'numeric' | 'string' | 'temporal' | 'unknown';
77
108
  type DataSubtypeId = NumericSubtypeId | StringSubtypeId | TemporalSubtypeId;
@@ -80,11 +111,6 @@ type NumericSignId = 'negative' | 'zero' | 'positive';
80
111
  type NumericUnitsId = 'currency' | 'percentage' | 'plain';
81
112
  type StringSubtypeId = 'email' | 'ipv4' | 'ipv6' | 'ulid' | 'uuid' | 'url' | 'plain';
82
113
  type TemporalSubtypeId = 'date' | 'dateTime' | 'time';
83
- type ParsingRecord = ParsingResult[];
84
- interface ParsingResult {
85
- value: string | null;
86
- valueWasQuoted: boolean;
87
- }
88
114
  /**
89
115
  *
90
116
  */
@@ -107,7 +133,7 @@ type InferenceResult = BooleanInferenceResult | NumericInferenceResult | StringI
107
133
  interface BooleanInferenceResult {
108
134
  dataTypeId: 'boolean';
109
135
  dataSubtypeId: undefined;
110
- inputValue: boolean | string | undefined;
136
+ inputValue: string;
111
137
  inputValueWasQuoted: boolean;
112
138
  inferredValue: boolean;
113
139
  }
@@ -177,20 +203,12 @@ interface UnknownInferenceResult {
177
203
  inputValueWasQuoted: boolean;
178
204
  inferredValue: null;
179
205
  }
180
- type DataFormatId = 'dpe' | 'dtv' | 'json' | 'spss' | 'xlsx' | 'xml' | 'unknown';
181
- type RecordDelimiterId = '\n' | '\r' | '\r\n';
182
- type ValueDelimiterId = '' | ':' | ',' | '!' | '0x1E' | ';' | ' ' | '\t' | '_' | '0x1F' | '|';
183
- /**
184
- *
185
- */
186
- declare const ORDERED_VALUE_DELIMITER_IDS: ValueDelimiterId[];
187
206
  export { ORDERED_VALUE_DELIMITER_IDS };
188
- export type { DataViewInterface, DataViewConfig, DataViewLocalisedConfig, PreviewConfig, ContentAuditConfig, RelationshipsAuditConfig, DataFormatId, // Data format.
189
- DataTypeId, // Data type.
207
+ export type { DataViewInterface, DataViewConfig, DataViewLocalisedConfig, PreviewConfig, ContentAuditConfig, RelationshipsAuditConfig, DataFormatId, RecordDelimiterId, ValueDelimiterId, ParsingRecord, ParsingResult, DataTypeId, // Data type.
190
208
  DataSubtypeId, NumericSubtypeId, // Numeric subtype and characteristics.
191
209
  NumericSignId, NumericUnitsId, StringSubtypeId, // String subtype.
192
210
  TemporalSubtypeId, // Temporal subtype.
193
- RecordDelimiterId, ValueDelimiterId, ParsingRecord, ParsingResult, InferenceSummary, InferenceRecord, InferenceResult, BooleanInferenceResult, // Boolean.
211
+ InferenceSummary, InferenceRecord, InferenceResult, BooleanInferenceResult, // Boolean.
194
212
  NumericInferenceResult, // Numeric.
195
213
  BigIntInferenceResult, NumberInferenceResult, StringInferenceResult, // String.
196
214
  TemporalInferenceResult, // Temporal.
@@ -3,7 +3,7 @@ import { EncodingTypeConfig } from '../encoding';
3
3
  import { ModuleConfig } from '../component/module';
4
4
  import { ToolConfig } from '../component/tool';
5
5
  import { ConnectorOperationOptions, ObjectColumnConfig } from '../component/connector';
6
- import { ContentAuditConfig, InferenceRecord, ParsingRecord, TypeParsedRecordsResult, ValueDelimiterId } from '../component/dataView';
6
+ import { ContentAuditConfig, InferenceRecord, InferenceSummary, ParsingRecord, ValueDelimiterId } from '../component/dataView';
7
7
  import { ContextConfig, ContextOperationOptions } from '../component/context';
8
8
  /**
9
9
  * Engine runtime interface.
@@ -44,7 +44,7 @@ interface EngineCallbackData {
44
44
  */
45
45
  interface EngineUtilities {
46
46
  inferValues: (parsingRecord: ParsingRecord, columnConfigs: ObjectColumnConfig[]) => InferenceRecord;
47
- typeParsedRecords: (parsedRecords: ParsingRecord[]) => TypeParsedRecordsResult;
47
+ inferDataTypes: (parsedRecords: ParsingRecord[]) => InferenceSummary;
48
48
  }
49
49
  /**
50
50
  * Audit object content options and result.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.506",
3
+ "version": "0.3.508",
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>",