@datapos/datapos-shared 0.3.69 → 0.3.70
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,8 +1,12 @@
|
|
|
1
|
-
import { parse } from 'date-fns';
|
|
2
|
-
import {
|
|
1
|
+
import { parse as dateFnsParse } from 'date-fns';
|
|
2
|
+
import { nanoid } from 'nanoid';
|
|
3
|
+
import { Callback, parse as csvParse, Options, Parser } from 'csv-parse/browser/esm';
|
|
3
4
|
import { ComponentConfig } from './component';
|
|
5
|
+
import { convertMillisecondsToTimestamp } from '.';
|
|
6
|
+
import { buildFetchError, OperationalError } from './errors';
|
|
4
7
|
import { ConnectionConfig, ConnectionDescription, ConnectionNodeConfig } from './connection';
|
|
5
8
|
import { DataViewContentAuditConfig, ValueDelimiterId } from './dataView';
|
|
9
|
+
import { extractExtensionFromPath, extractNameFromPath, lookupMimeTypeForExtension } from './utilities';
|
|
6
10
|
export interface Connector {
|
|
7
11
|
abortController?: AbortController | undefined;
|
|
8
12
|
readonly config: ConnectorConfig;
|
|
@@ -22,11 +26,19 @@ export interface Connector {
|
|
|
22
26
|
upsertRecords?(connector: Connector, settings: UpsertSettings): Promise<void>;
|
|
23
27
|
}
|
|
24
28
|
export interface ConnectorTools {
|
|
25
|
-
csvParse:
|
|
26
|
-
|
|
27
|
-
parse: typeof
|
|
29
|
+
csvParse: typeof csvParse;
|
|
30
|
+
dateFns: {
|
|
31
|
+
parse: typeof dateFnsParse;
|
|
32
|
+
};
|
|
33
|
+
nanoid: typeof nanoid;
|
|
34
|
+
shared: {
|
|
35
|
+
buildFetchError: typeof buildFetchError;
|
|
36
|
+
convertMillisecondsToTimestamp: typeof convertMillisecondsToTimestamp;
|
|
37
|
+
extractExtensionFromPath: typeof extractExtensionFromPath;
|
|
38
|
+
extractNameFromPath: typeof extractNameFromPath;
|
|
39
|
+
lookupMimeTypeForExtension: typeof lookupMimeTypeForExtension;
|
|
40
|
+
OperationalError: typeof OperationalError;
|
|
28
41
|
};
|
|
29
|
-
nanoid: <Type extends string>(size?: number) => Type;
|
|
30
42
|
}
|
|
31
43
|
export interface ConnectorCallbackData {
|
|
32
44
|
typeId: string;
|