@datapos/datapos-shared 0.3.469 → 0.3.471

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.
@@ -1,6 +1,6 @@
1
1
  import { ComponentConfig } from '..';
2
2
  import { ConnectorConfig } from '.';
3
- import { ValueDataTypeId } from '../dataView';
3
+ import { DataTypeId } from '../dataView';
4
4
  /**
5
5
  * Connection configuration.
6
6
  */
@@ -78,7 +78,7 @@ interface ConnectionColumnConfig {
78
78
  minValue?: string;
79
79
  patterns?: Record<string, string>;
80
80
  storageTypeId?: StorageDataTypeId;
81
- valueDataTypeId?: ValueDataTypeId;
81
+ DataTypeId?: DataTypeId;
82
82
  validValueCount?: number;
83
83
  validValues?: Record<string, string>;
84
84
  voidValueCount?: number;
@@ -36,7 +36,7 @@ interface DataViewPreviewConfig {
36
36
  fileType: FileTypeResult | undefined;
37
37
  hasHeaders: boolean | undefined;
38
38
  recordDelimiterId?: RecordDelimiterId;
39
- records: InferredResult[][];
39
+ records: InferenceResult[][];
40
40
  size: number;
41
41
  text: string;
42
42
  valueDelimiterId?: ValueDelimiterId;
@@ -64,28 +64,27 @@ type ObjectRecord = (NamedValueRecord | StringValueRecord | ValueRecord)[];
64
64
  type NamedValueRecord = Record<string, bigint | boolean | number | string | null>;
65
65
  type StringValueRecord = (string | null)[];
66
66
  type ValueRecord = (bigint | boolean | number | string | null)[];
67
- type ValueDataTypeId = 'boolean' | 'numeric' | 'string' | 'temporal' | 'unknown';
68
- type NumericValueSignId = 'negative' | 'zero' | 'positive';
69
- type NumericValueSubtypeId = 'bigint' | 'integer' | 'decimal';
70
- type NumericValueUnitsId = 'currency' | 'percentage' | 'plain';
71
- type StringValueSubtypeId = 'email' | 'ipv4' | 'ipv6' | 'ulid' | 'uuid' | 'url' | 'plain';
72
- type TemporalValueSubtypeId = 'date' | 'dateTime' | 'time';
73
- type ParseRecord = ParseField[];
74
- interface ParseField {
67
+ type DataTypeId = 'boolean' | 'numeric' | 'string' | 'temporal' | 'unknown';
68
+ type NumericSignId = 'negative' | 'zero' | 'positive';
69
+ type NumericSubtypeId = 'bigint' | 'integer' | 'decimal';
70
+ type NumericUnitsId = 'currency' | 'percentage' | 'plain';
71
+ type StringSubtypeId = 'email' | 'ipv4' | 'ipv6' | 'ulid' | 'uuid' | 'url' | 'plain';
72
+ type TemporalSubtypeId = 'date' | 'dateTime' | 'time';
73
+ interface ParsingResult {
75
74
  value: string | null;
76
75
  valueWasQuoted: boolean;
77
76
  }
78
77
  /**
79
- * Inferred result.
78
+ * Inferred value.
80
79
  */
81
- type InferredResult = BooleanInferenceResult | NumericInferenceResult | StringInferenceResult | TemporalInferenceResult | UnknownInferenceResult;
80
+ type InferenceResult = BooleanInferenceResult | NumericInferenceResult | StringInferenceResult | TemporalInferenceResult | UnknownInferenceResult;
82
81
  /**
83
82
  * Boolean inference result.
84
83
  */
85
84
  interface BooleanInferenceResult {
86
85
  dataTypeId: 'boolean';
87
86
  inputValue: boolean | string | undefined;
88
- parsedValue: boolean;
87
+ inferredValue: boolean;
89
88
  }
90
89
  type NumericInferenceResult = BigIntInferenceResult | NumberInferenceResult;
91
90
  interface BigIntInferenceResult {
@@ -93,44 +92,44 @@ interface BigIntInferenceResult {
93
92
  dataSubtypeId: 'bigint';
94
93
  format: string;
95
94
  inputValue: bigint | string | undefined;
96
- parsedValue: bigint;
95
+ inferredValue: bigint;
97
96
  currencySymbolId: string | undefined;
98
97
  decimalPlaces: number;
99
- signId: NumericValueSignId;
100
- unitsId: NumericValueUnitsId;
98
+ signId: NumericSignId;
99
+ unitsId: NumericUnitsId;
101
100
  }
102
101
  interface NumberInferenceResult {
103
102
  dataTypeId: 'numeric';
104
103
  dataSubtypeId: 'integer' | 'decimal';
105
104
  format: string;
106
105
  inputValue: number | string | undefined;
107
- parsedValue: number;
106
+ inferredValue: number;
108
107
  currencySymbolId: string | undefined;
109
108
  decimalPlaces: number;
110
- signId: NumericValueSignId;
111
- unitsId: NumericValueUnitsId;
109
+ signId: NumericSignId;
110
+ unitsId: NumericUnitsId;
112
111
  }
113
112
  /**
114
113
  * String inference result.
115
114
  */
116
115
  interface StringInferenceResult {
117
116
  dataTypeId: 'string';
118
- dataSubtypeId: StringValueSubtypeId;
117
+ dataSubtypeId: StringSubtypeId;
119
118
  format: undefined;
120
119
  inputValue: string;
121
- parsedValue: string;
120
+ inferredValue: string;
122
121
  }
123
122
  interface TemporalInferenceResult {
124
123
  dataTypeId: 'temporal';
125
- dataSubtypeId: TemporalValueSubtypeId;
124
+ dataSubtypeId: TemporalSubtypeId;
126
125
  format: string;
127
126
  inputValue: string;
128
- parsedValue: Date;
127
+ inferredValue: Date;
129
128
  }
130
129
  interface UnknownInferenceResult {
131
130
  dataTypeId: 'unknown';
132
131
  inputValue: string | null | undefined;
133
- parsedValue: null;
132
+ inferredValue: null;
134
133
  }
135
134
  type DataFormatId = 'dpe' | 'dtv' | 'json' | 'spss' | 'xlsx' | 'xml';
136
135
  type RecordDelimiterId = '\n' | '\r' | '\r\n';
@@ -140,4 +139,11 @@ type ValueDelimiterId = '' | ':' | ',' | '!' | '0x1E' | ';' | ' ' | '\t' | '_' |
140
139
  */
141
140
  declare const ORDERED_VALUE_DELIMITER_IDS: ValueDelimiterId[];
142
141
  export { ORDERED_VALUE_DELIMITER_IDS };
143
- export type { BigIntInferenceResult, BooleanInferenceResult, DataViewConfig, DataViewContentAuditConfig, DataViewInterface, DataViewLocalisedConfig, DataViewPreviewConfig, DataFormatId, InferredResult, NamedValueRecord, NumberInferenceResult, NumericInferenceResult, NumericValueSignId, NumericValueSubtypeId, NumericValueUnitsId, ObjectRecord, ParseField, ParseRecord, RecordDelimiterId, StringInferenceResult, StringValueRecord, StringValueSubtypeId, TemporalInferenceResult, TemporalValueSubtypeId, UnknownInferenceResult, ValueDataTypeId, ValueDelimiterId, ValueRecord };
142
+ export type { DataViewConfig, DataViewContentAuditConfig, DataViewInterface, DataViewLocalisedConfig, DataViewPreviewConfig, DataFormatId, DataTypeId, NumericSubtypeId, // Numeric.
143
+ NumericSignId, NumericUnitsId, StringSubtypeId, // String.
144
+ TemporalSubtypeId, // Temporal.
145
+ ObjectRecord, NamedValueRecord, StringValueRecord, ValueRecord, RecordDelimiterId, ValueDelimiterId, ParsingResult, InferenceResult, BooleanInferenceResult, // Boolean.
146
+ NumericInferenceResult, // Numeric.
147
+ BigIntInferenceResult, NumberInferenceResult, StringInferenceResult, // String.
148
+ TemporalInferenceResult, // Temporal.
149
+ UnknownInferenceResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.469",
3
+ "version": "0.3.471",
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>",