@datapos/datapos-shared 0.3.505 → 0.3.507

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.
@@ -85,9 +85,20 @@ interface ParsingResult {
85
85
  value: string | null;
86
86
  valueWasQuoted: boolean;
87
87
  }
88
+ /**
89
+ *
90
+ */
91
+ interface InferenceSummary {
92
+ columnConfigs: ObjectColumnConfig[];
93
+ hasHeaderRow: boolean;
94
+ typedRecords: InferenceRecord[];
95
+ }
96
+ /**
97
+ *
98
+ */
88
99
  type InferenceRecord = InferenceResult[];
89
100
  /**
90
- * Inferred value.
101
+ *
91
102
  */
92
103
  type InferenceResult = BooleanInferenceResult | NumericInferenceResult | StringInferenceResult | TemporalInferenceResult | UnknownInferenceResult;
93
104
  /**
@@ -100,12 +111,18 @@ interface BooleanInferenceResult {
100
111
  inputValueWasQuoted: boolean;
101
112
  inferredValue: boolean;
102
113
  }
114
+ /**
115
+ *
116
+ */
103
117
  type NumericInferenceResult = BigIntInferenceResult | NumberInferenceResult;
118
+ /**
119
+ *
120
+ */
104
121
  interface BigIntInferenceResult {
105
122
  dataTypeId: 'numeric';
106
123
  dataSubtypeId: 'bigint';
107
124
  format: string;
108
- inputValue: bigint | string | undefined;
125
+ inputValue: string;
109
126
  inputValueWasQuoted: boolean;
110
127
  inferredValue: bigint;
111
128
  currencySymbolId: string | undefined;
@@ -113,11 +130,14 @@ interface BigIntInferenceResult {
113
130
  signId: NumericSignId;
114
131
  unitsId: NumericUnitsId;
115
132
  }
133
+ /**
134
+ *
135
+ */
116
136
  interface NumberInferenceResult {
117
137
  dataTypeId: 'numeric';
118
138
  dataSubtypeId: 'integer' | 'decimal';
119
139
  format: string;
120
- inputValue: number | string | undefined;
140
+ inputValue: string;
121
141
  inputValueWasQuoted: boolean;
122
142
  inferredValue: number;
123
143
  currencySymbolId: string | undefined;
@@ -131,11 +151,14 @@ interface NumberInferenceResult {
131
151
  interface StringInferenceResult {
132
152
  dataTypeId: 'string';
133
153
  dataSubtypeId: StringSubtypeId;
134
- format: undefined;
154
+ format: string;
135
155
  inputValue: string;
136
156
  inputValueWasQuoted: boolean;
137
157
  inferredValue: string;
138
158
  }
159
+ /**
160
+ *
161
+ */
139
162
  interface TemporalInferenceResult {
140
163
  dataTypeId: 'temporal';
141
164
  dataSubtypeId: TemporalSubtypeId;
@@ -144,18 +167,16 @@ interface TemporalInferenceResult {
144
167
  inputValueWasQuoted: boolean;
145
168
  inferredValue: Date;
146
169
  }
170
+ /**
171
+ *
172
+ */
147
173
  interface UnknownInferenceResult {
148
174
  dataTypeId: 'unknown';
149
175
  dataSubtypeId: undefined;
150
- inputValue: string | null | undefined;
176
+ inputValue: string | null;
151
177
  inputValueWasQuoted: boolean;
152
178
  inferredValue: null;
153
179
  }
154
- interface TypeParsedRecordsResult {
155
- columnConfigs: ObjectColumnConfig[];
156
- hasHeaderRow: boolean;
157
- typedRecords: InferenceRecord[];
158
- }
159
180
  type DataFormatId = 'dpe' | 'dtv' | 'json' | 'spss' | 'xlsx' | 'xml' | 'unknown';
160
181
  type RecordDelimiterId = '\n' | '\r' | '\r\n';
161
182
  type ValueDelimiterId = '' | ':' | ',' | '!' | '0x1E' | ';' | ' ' | '\t' | '_' | '0x1F' | '|';
@@ -169,9 +190,8 @@ DataTypeId, // Data type.
169
190
  DataSubtypeId, NumericSubtypeId, // Numeric subtype and characteristics.
170
191
  NumericSignId, NumericUnitsId, StringSubtypeId, // String subtype.
171
192
  TemporalSubtypeId, // Temporal subtype.
172
- RecordDelimiterId, ValueDelimiterId, ParsingRecord, ParsingResult, InferenceRecord, InferenceResult, BooleanInferenceResult, // Boolean.
193
+ RecordDelimiterId, ValueDelimiterId, ParsingRecord, ParsingResult, InferenceSummary, InferenceRecord, InferenceResult, BooleanInferenceResult, // Boolean.
173
194
  NumericInferenceResult, // Numeric.
174
195
  BigIntInferenceResult, NumberInferenceResult, StringInferenceResult, // String.
175
196
  TemporalInferenceResult, // Temporal.
176
- UnknownInferenceResult, // Unknown.
177
- TypeParsedRecordsResult };
197
+ UnknownInferenceResult };
@@ -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.505",
3
+ "version": "0.3.507",
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>",