@datapos/datapos-shared 0.3.438 → 0.3.440
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,10 +1,13 @@
|
|
|
1
1
|
import { InferOutput } from 'valibot';
|
|
2
2
|
import { Component } from '..';
|
|
3
|
+
import { EngineShared } from '../../engine';
|
|
3
4
|
import { ToolConfig } from '../tool';
|
|
4
5
|
import { ConnectionDescription, ConnectionNodeConfig } from './connection';
|
|
5
6
|
import { connectorCategoryConfigSchema, connectorConfigSchema, connectorOperationNameSchema, connectorUsageIdSchema } from './connectorConfig.schema';
|
|
6
7
|
import { DataViewPreviewConfig, ValueDelimiterId } from '../dataView';
|
|
7
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Connector interface an constructor.
|
|
10
|
+
*/
|
|
8
11
|
interface ConnectorInterface extends Component {
|
|
9
12
|
abortController: AbortController | undefined;
|
|
10
13
|
readonly config: ConnectorConfig;
|
|
@@ -24,7 +27,7 @@ interface ConnectorInterface extends Component {
|
|
|
24
27
|
retrieveRecords?(connector: ConnectorInterface, options: RetrieveRecordsOptions, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void>;
|
|
25
28
|
upsertRecords?(connector: ConnectorInterface, options: UpsertRecordsOptions): Promise<void>;
|
|
26
29
|
}
|
|
27
|
-
type ConnectorConstructor = new (toolConfigs: ToolConfig[]) => ConnectorInterface;
|
|
30
|
+
type ConnectorConstructor = new (engineShared: EngineShared, toolConfigs: ToolConfig[]) => ConnectorInterface;
|
|
28
31
|
/** Operation names a connector may support. */
|
|
29
32
|
type ConnectorOperationName = InferOutput<typeof connectorOperationNameSchema>;
|
|
30
33
|
/** Connector data pipeline usage identifiers. */
|
|
@@ -61,7 +61,7 @@ interface ValueDelimiter {
|
|
|
61
61
|
id: string;
|
|
62
62
|
label: string;
|
|
63
63
|
}
|
|
64
|
-
export declare const ORDERED_VALUE_DELIMITER_IDS:
|
|
64
|
+
export declare const ORDERED_VALUE_DELIMITER_IDS: ValueDelimiterId[];
|
|
65
65
|
export declare const getValueDelimiter: (id: string, localeId?: import('../../locale').LocaleCode) => ValueDelimiter;
|
|
66
66
|
export declare const getValueDelimiters: (localeId?: import('../../locale').LocaleCode) => ValueDelimiter[];
|
|
67
67
|
export type ParsedValue = bigint | boolean | number | string | null;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ConnectionConfig } from '../component/connector/connection';
|
|
2
|
-
import { ConnectorOperationOptions } from '../component/connector';
|
|
3
2
|
import { EncodingTypeConfig } from '../encoding';
|
|
4
3
|
import { ModuleConfig } from '../component/module';
|
|
5
4
|
import { ToolConfig } from '../component/tool';
|
|
5
|
+
import { ConnectionColumnConfig, ConnectorOperationOptions, UsageTypeId } from '../component/connector';
|
|
6
6
|
import { ContextCallbackData, ContextConfig, ContextOperationOptions } from '../component/context';
|
|
7
|
-
import { DataViewContentAuditConfig,
|
|
8
|
-
/**
|
|
7
|
+
import { DataViewContentAuditConfig, ParsedValue, ValueDelimiterId } from '../component/dataView';
|
|
8
|
+
/**
|
|
9
|
+
* Engine runtime interface.
|
|
10
|
+
*/
|
|
9
11
|
interface EngineRuntimeInterface {
|
|
10
12
|
getEncodingTypeConfigs: (localeId: string) => EncodingTypeConfig[];
|
|
11
13
|
invokeWorker(errorEventCallback: (errorEvent: ErrorEvent) => void): EngineWorkerInterface;
|
|
@@ -22,22 +24,39 @@ interface EngineWorkerInitialiseOptions {
|
|
|
22
24
|
connectorStorageURLPrefix: string;
|
|
23
25
|
toolConfigs: ToolConfig[];
|
|
24
26
|
}
|
|
25
|
-
|
|
27
|
+
export interface ParseResult {
|
|
28
|
+
isValid: boolean;
|
|
29
|
+
originalValue: string | null | undefined;
|
|
30
|
+
parsedValue: ParsedValue;
|
|
31
|
+
usageTypeId: UsageTypeId;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Engine Shared.
|
|
35
|
+
*/
|
|
26
36
|
interface EngineShared {
|
|
27
|
-
|
|
37
|
+
parseRecord: (columnConfigs: ConnectionColumnConfig[], record: {
|
|
38
|
+
value: string | null | undefined;
|
|
39
|
+
isQuoted: boolean;
|
|
40
|
+
}[], isPreview: boolean) => ParseResult[];
|
|
28
41
|
}
|
|
29
|
-
/**
|
|
42
|
+
/**
|
|
43
|
+
* Engine configuration.
|
|
44
|
+
*/
|
|
30
45
|
interface EngineConfig extends ModuleConfig {
|
|
31
46
|
typeId: 'engine';
|
|
32
47
|
}
|
|
33
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Connector callback data.
|
|
50
|
+
*/
|
|
34
51
|
interface ConnectorCallbackData {
|
|
35
52
|
typeId: string;
|
|
36
53
|
properties: Record<string, unknown>;
|
|
37
54
|
}
|
|
38
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Audit object content options and result.
|
|
57
|
+
*/
|
|
39
58
|
interface AuditObjectContentOptions extends ConnectorOperationOptions {
|
|
40
|
-
chunkSize
|
|
59
|
+
chunkSize: number | undefined;
|
|
41
60
|
encodingId: string;
|
|
42
61
|
path: string;
|
|
43
62
|
valueDelimiterId: ValueDelimiterId;
|
|
@@ -52,5 +71,4 @@ interface TestSettings {
|
|
|
52
71
|
hasHeaders?: boolean;
|
|
53
72
|
readable: ReadableStream<Uint8Array>;
|
|
54
73
|
}
|
|
55
|
-
/** Exports. */
|
|
56
74
|
export type { AuditObjectContentOptions, AuditObjectContentResult, ConnectorCallbackData, EngineConfig, EngineRuntimeInterface, EngineShared, EngineWorkerInitialiseOptions, EngineWorkerInterface, TestSettings };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared composables, constants, errors, interfaces, schemas, types and utilities.
|
|
3
3
|
*/
|
|
4
|
-
/** Interfaces/Types */
|
|
5
4
|
/** Interfaces/Types - Context. */
|
|
6
5
|
export { contextConfigSchema } from './component/context';
|
|
7
6
|
export type { Context, ContextConfig, ContextLocalisedConfig, ContextListOptions, ContextListResult, ContextOperation, ContextCallbackData } from './component/context';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.440",
|
|
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>",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
],
|
|
57
57
|
"prettier": "@datapos/datapos-development/prettierrc",
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"@datapos/datapos-development": "^0.3.
|
|
60
|
-
"@datapos/eslint-config-datapos": "^1.0.
|
|
59
|
+
"@datapos/datapos-development": "^0.3.438",
|
|
60
|
+
"@datapos/eslint-config-datapos": "^1.0.35",
|
|
61
61
|
"@types/node": "^25.0.3",
|
|
62
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
63
|
-
"@typescript-eslint/parser": "^8.
|
|
62
|
+
"@typescript-eslint/eslint-plugin": "^8.51.0",
|
|
63
|
+
"@typescript-eslint/parser": "^8.51.0",
|
|
64
64
|
"eslint": "^9.39.2",
|
|
65
65
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
66
66
|
"eslint-plugin-import": "^2.32.0",
|