@dpuse/dpuse-shared 1.0.186 → 1.0.187
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.
- package/README.md +9 -10
- package/dist/dpuse-shared.es.js +313 -206
- package/dist/dpuse-shared.es.js.map +1 -1
- package/dist/types/src/component/connection/index.d.ts +2 -1
- package/dist/types/src/component/dataView/index.d.ts +141 -26
- package/dist/types/src/component/module/connector/index.d.ts +6 -5
- package/package.json +1 -1
- package/dist/types/src/component/dataView/dataFormatIcons.d.ts +0 -6
|
@@ -85,6 +85,7 @@ export interface ObjectColumnConfig {
|
|
|
85
85
|
export type ColumnDerivationId = 'currency' | 'unit';
|
|
86
86
|
export type NumericReadingConfig = Pick<ObjectColumnConfig, 'dataSubtypeId' | 'maxDecimals' | 'maxValue' | 'maxWholeDigits' | 'minDecimals' | 'minValue' | 'minWholeDigits' | 'storageTypeId'>;
|
|
87
87
|
export type DateOrderId = 'dayFirst' | 'monthFirst';
|
|
88
|
-
export type DecimalSeparatorId =
|
|
88
|
+
export type DecimalSeparatorId = (typeof DECIMAL_SEPARATOR_IDS)[number];
|
|
89
89
|
export type StorageTypeId = 'binary' | 'boolean' | 'byte' | 'date' | 'dateTime' | 'dateTimeOffset' | 'decimal' | 'double' | 'int8' | 'int16' | 'int32' | 'int64' | 'object' | 'single' | 'string' | 'time' | 'unknown';
|
|
90
|
+
export declare const DECIMAL_SEPARATOR_IDS: readonly [",", "."];
|
|
90
91
|
export {};
|
|
@@ -20,22 +20,11 @@ export interface ReadingConfig {
|
|
|
20
20
|
parserId?: string | undefined;
|
|
21
21
|
recordDelimiterId: RecordDelimiterId | undefined;
|
|
22
22
|
valueDelimiterId: ValueDelimiterId | undefined;
|
|
23
|
-
commentMarkId?: string | undefined;
|
|
24
|
-
commentMarkOtherCharSeq?: string | undefined;
|
|
25
|
-
linesToSkipAtStart?: number | undefined;
|
|
26
|
-
quoteEscapeChar?: string | undefined;
|
|
27
|
-
quoteMarkId?: string | undefined;
|
|
28
|
-
quoteMarkOtherCharSeq?: string | undefined;
|
|
29
|
-
recordDelimiterOtherCharSeq?: string | undefined;
|
|
30
|
-
skipEmptyLines?: boolean | undefined;
|
|
31
|
-
skipLinesWithEmptyValues?: boolean | undefined;
|
|
32
|
-
skipLinesWithErrors?: boolean | undefined;
|
|
33
|
-
valueDelimiterOtherCharSeq?: string | undefined;
|
|
34
|
-
valueTrimMethodId?: 'both' | 'left' | 'right' | 'none' | undefined;
|
|
35
23
|
}
|
|
36
|
-
export type DataFormatId =
|
|
24
|
+
export type DataFormatId = (typeof DATA_FORMAT_CONFIGS)[number]['id'];
|
|
25
|
+
export type DataFormatSupportId = 'planned' | 'supported' | 'unsupported';
|
|
37
26
|
export type RecordDelimiterId = '\n' | '\r' | '\r\n';
|
|
38
|
-
export type ValueDelimiterId =
|
|
27
|
+
export type ValueDelimiterId = (typeof VALUE_DELIMITER_CONFIGS)[number]['id'] | '';
|
|
39
28
|
export interface SampleConfig {
|
|
40
29
|
issues?: SampleIssue[];
|
|
41
30
|
parsedRecords: ParsedRecord[];
|
|
@@ -72,19 +61,145 @@ export interface ContentAuditConfig {
|
|
|
72
61
|
}
|
|
73
62
|
export type ColumnChoiceConfigs = Partial<Record<string, ColumnChoiceConfig>>;
|
|
74
63
|
export interface ColumnChoiceConfig {
|
|
75
|
-
dataSubtypeId?: DataSubtypeId | undefined;
|
|
76
64
|
dataTypeId?: DataTypeId | undefined;
|
|
65
|
+
dataSubtypeId?: DataSubtypeId | undefined;
|
|
77
66
|
decimalSeparatorId?: DecimalSeparatorId | undefined;
|
|
78
67
|
nullWordsAreEmpty?: boolean | undefined;
|
|
79
68
|
}
|
|
80
|
-
export type DataTypeId = '
|
|
81
|
-
export type DataSubtypeId =
|
|
82
|
-
export type NumericSubtypeId =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
69
|
+
export type DataTypeId = DataTypeConfig['id'];
|
|
70
|
+
export type DataSubtypeId = DataTypeConfig['subtypeIds'][number];
|
|
71
|
+
export type NumericSubtypeId = Extract<DataTypeConfig, {
|
|
72
|
+
id: 'numeric';
|
|
73
|
+
}>['subtypeIds'][number];
|
|
74
|
+
export type StringSubtypeId = Extract<DataTypeConfig, {
|
|
75
|
+
id: 'string';
|
|
76
|
+
}>['subtypeIds'][number];
|
|
77
|
+
export type TemporalSubtypeId = Extract<DataTypeConfig, {
|
|
78
|
+
id: 'temporal';
|
|
79
|
+
}>['subtypeIds'][number];
|
|
80
|
+
type DataTypeConfig = (typeof DATA_TYPE_CONFIGS)[number];
|
|
81
|
+
export declare const DATA_FORMAT_CONFIGS: readonly [{
|
|
82
|
+
readonly id: "arrow";
|
|
83
|
+
readonly isTable: false;
|
|
84
|
+
readonly isText: false;
|
|
85
|
+
readonly supportId: "planned";
|
|
86
|
+
}, {
|
|
87
|
+
readonly id: "avro";
|
|
88
|
+
readonly isTable: false;
|
|
89
|
+
readonly isText: false;
|
|
90
|
+
readonly supportId: "planned";
|
|
91
|
+
}, {
|
|
92
|
+
readonly id: "dtv";
|
|
93
|
+
readonly isTable: true;
|
|
94
|
+
readonly isText: true;
|
|
95
|
+
readonly supportId: "supported";
|
|
96
|
+
}, {
|
|
97
|
+
readonly id: "json";
|
|
98
|
+
readonly isTable: false;
|
|
99
|
+
readonly isText: false;
|
|
100
|
+
readonly supportId: "planned";
|
|
101
|
+
}, {
|
|
102
|
+
readonly id: "jsonl";
|
|
103
|
+
readonly isTable: false;
|
|
104
|
+
readonly isText: false;
|
|
105
|
+
readonly supportId: "planned";
|
|
106
|
+
}, {
|
|
107
|
+
readonly id: "markdown";
|
|
108
|
+
readonly isTable: false;
|
|
109
|
+
readonly isText: true;
|
|
110
|
+
readonly supportId: "unsupported";
|
|
111
|
+
}, {
|
|
112
|
+
readonly id: "ods";
|
|
113
|
+
readonly isTable: false;
|
|
114
|
+
readonly isText: false;
|
|
115
|
+
readonly supportId: "planned";
|
|
116
|
+
}, {
|
|
117
|
+
readonly id: "parquet";
|
|
118
|
+
readonly isTable: false;
|
|
119
|
+
readonly isText: false;
|
|
120
|
+
readonly supportId: "planned";
|
|
121
|
+
}, {
|
|
122
|
+
readonly id: "sav";
|
|
123
|
+
readonly isTable: false;
|
|
124
|
+
readonly isText: false;
|
|
125
|
+
readonly supportId: "planned";
|
|
126
|
+
}, {
|
|
127
|
+
readonly id: "sqlite";
|
|
128
|
+
readonly isTable: false;
|
|
129
|
+
readonly isText: false;
|
|
130
|
+
readonly supportId: "planned";
|
|
131
|
+
}, {
|
|
132
|
+
readonly id: "xlsx";
|
|
133
|
+
readonly isTable: false;
|
|
134
|
+
readonly isText: false;
|
|
135
|
+
readonly supportId: "planned";
|
|
136
|
+
}, {
|
|
137
|
+
readonly id: "xml";
|
|
138
|
+
readonly isTable: false;
|
|
139
|
+
readonly isText: false;
|
|
140
|
+
readonly supportId: "planned";
|
|
141
|
+
}, {
|
|
142
|
+
readonly id: "unknown";
|
|
143
|
+
readonly isTable: false;
|
|
144
|
+
readonly isText: false;
|
|
145
|
+
readonly supportId: "unsupported";
|
|
146
|
+
}];
|
|
147
|
+
export declare const VALUE_DELIMITER_CONFIGS: readonly [{
|
|
148
|
+
readonly id: ",";
|
|
149
|
+
readonly character: ",";
|
|
150
|
+
}, {
|
|
151
|
+
readonly id: ";";
|
|
152
|
+
readonly character: ";";
|
|
153
|
+
}, {
|
|
154
|
+
readonly id: "\t";
|
|
155
|
+
readonly character: "\t";
|
|
156
|
+
}, {
|
|
157
|
+
readonly id: "|";
|
|
158
|
+
readonly character: "|";
|
|
159
|
+
}, {
|
|
160
|
+
readonly id: " ";
|
|
161
|
+
readonly character: " ";
|
|
162
|
+
}, {
|
|
163
|
+
readonly id: ":";
|
|
164
|
+
readonly character: ":";
|
|
165
|
+
}, {
|
|
166
|
+
readonly id: "_";
|
|
167
|
+
readonly character: "_";
|
|
168
|
+
}, {
|
|
169
|
+
readonly id: "!";
|
|
170
|
+
readonly character: "!";
|
|
171
|
+
}, {
|
|
172
|
+
readonly id: "0x1F";
|
|
173
|
+
readonly character: "\u001F";
|
|
174
|
+
}, {
|
|
175
|
+
readonly id: "0x1E";
|
|
176
|
+
readonly character: "\u001E";
|
|
177
|
+
}];
|
|
178
|
+
export declare const DATA_TYPE_CONFIGS: readonly [{
|
|
179
|
+
readonly id: "string";
|
|
180
|
+
readonly defaultSubtypeId: "plain";
|
|
181
|
+
readonly isChoosable: true;
|
|
182
|
+
readonly subtypeIds: readonly ["plain", "email", "url", "uuid", "ulid", "ipv4", "ipv6"];
|
|
183
|
+
}, {
|
|
184
|
+
readonly id: "numeric";
|
|
185
|
+
readonly defaultSubtypeId: "integer";
|
|
186
|
+
readonly isChoosable: true;
|
|
187
|
+
readonly subtypeIds: readonly ["integer", "decimal", "bigint"];
|
|
188
|
+
}, {
|
|
189
|
+
readonly id: "temporal";
|
|
190
|
+
readonly defaultSubtypeId: "dateTime";
|
|
191
|
+
readonly isChoosable: true;
|
|
192
|
+
readonly subtypeIds: readonly ["date", "dateTime", "time"];
|
|
193
|
+
}, {
|
|
194
|
+
readonly id: "boolean";
|
|
195
|
+
readonly defaultSubtypeId: undefined;
|
|
196
|
+
readonly isChoosable: true;
|
|
197
|
+
readonly subtypeIds: readonly [];
|
|
198
|
+
}, {
|
|
199
|
+
readonly id: "unknown";
|
|
200
|
+
readonly defaultSubtypeId: undefined;
|
|
201
|
+
readonly isChoosable: false;
|
|
202
|
+
readonly subtypeIds: readonly [];
|
|
203
|
+
}];
|
|
204
|
+
export declare function getValueDelimiterCharacter(valueDelimiterId: ValueDelimiterId): string;
|
|
205
|
+
export {};
|
|
@@ -5,7 +5,7 @@ import { LocalisedConfig } from '../../../locale';
|
|
|
5
5
|
import { ToolConfig } from '../tool';
|
|
6
6
|
import { ConnectionConfig, ConnectionDescriptionConfig, ConnectionNodeConfig, ObjectColumnConfig } from '../../connection';
|
|
7
7
|
import { connectorActionNameSchema, connectorCategoryConfigSchema, connectorConfigSchema, connectorItemTypeConfigSchema, connectorItemTypeIdSchema, connectorUsageConfigSchema, connectorUsageIdSchema } from './connectorConfig.schema';
|
|
8
|
-
import { ContentAuditConfig, DataFormatId,
|
|
8
|
+
import { ContentAuditConfig, DataFormatId, ParsedRecord, ReadingConfig, SampleConfig, ValueDelimiterId } from '../../dataView';
|
|
9
9
|
export { connectorConfigSchema } from './connectorConfig.schema';
|
|
10
10
|
export { auditObjectContentWithParser, buildPreviewObjectResult, type ObjectFilePreview, retrieveRecordsWithParser } from './objectParsing';
|
|
11
11
|
export interface ConnectorInterface extends Component {
|
|
@@ -42,10 +42,11 @@ export interface ConnectorUtilities {
|
|
|
42
42
|
}
|
|
43
43
|
export interface ColumnAuditor {
|
|
44
44
|
auditRecords: (parsedRecords: ParsedRecord[]) => void;
|
|
45
|
-
completeAudit: () =>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
completeAudit: () => InferenceSummary;
|
|
46
|
+
}
|
|
47
|
+
export interface InferenceSummary {
|
|
48
|
+
columnConfigs: ObjectColumnConfig[];
|
|
49
|
+
hasHeaders: boolean;
|
|
49
50
|
}
|
|
50
51
|
export type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;
|
|
51
52
|
type ConnectorCategoryConfig = InferOutput<typeof connectorCategoryConfigSchema>;
|
package/package.json
CHANGED