@datapos/datapos-shared 0.3.359 → 0.3.363
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/dist/datapos-shared-connector.es.js +6 -607
- package/dist/datapos-shared.es.js +601 -14
- package/dist/types/src/component/connector/connection.d.ts +16 -14
- package/dist/types/src/component/connector/connectorConfig.schema.d.ts +16 -9
- package/dist/types/src/component/connector/index.d.ts +16 -38
- package/dist/types/src/errors/index.d.ts +1 -1
- package/dist/types/src/index.d.ts +1 -3
- package/package.json +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Connector schema
|
|
2
|
+
* Connector configuration schema.
|
|
3
|
+
*
|
|
4
|
+
* Defines the configuration metadata for a connector. Used for validation
|
|
5
|
+
* of connector manifests and capability discovery at runtime.
|
|
6
|
+
*/
|
|
7
|
+
/** Authentication method identifiers supported by a connector implementation. */
|
|
8
|
+
export declare const connectorAuthMethodIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"apiKey", undefined>, import('valibot').LiteralSchema<"disabled", undefined>, import('valibot').LiteralSchema<"oAuth2", undefined>, import('valibot').LiteralSchema<"none", undefined>], undefined>;
|
|
9
|
+
/** A connector implementation variant. A single connector may expose multiple
|
|
10
|
+
* implementations differing by auth method, limits, or vendor-specific behavior.
|
|
3
11
|
*/
|
|
4
|
-
/** Schema Literal Unions - Connector category identifier. */
|
|
5
|
-
export declare const connectorCategoryIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"application", undefined>, import('valibot').LiteralSchema<"curatedDataset", undefined>, import('valibot').LiteralSchema<"database", undefined>, import('valibot').LiteralSchema<"fileStore", undefined>], undefined>;
|
|
6
|
-
/** Schema Literal Unions - Connector operation name. */
|
|
7
|
-
export declare const connectorOperationNameSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"authenticateConnection", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObject", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>;
|
|
8
|
-
/** Schema Literal Unions - Connector usage identifier. */
|
|
9
|
-
export declare const connectorUsageIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"bidirectional", undefined>, import('valibot').LiteralSchema<"destination", undefined>, import('valibot').LiteralSchema<"source", undefined>, import('valibot').LiteralSchema<"unknown", undefined>], undefined>;
|
|
10
|
-
/** Schema Objects - Connector implementation. */
|
|
11
12
|
export declare const connectorImplementationSchema: import('valibot').ObjectSchema<{
|
|
12
13
|
readonly authMethodId: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"apiKey", undefined>, import('valibot').LiteralSchema<"disabled", undefined>, import('valibot').LiteralSchema<"oAuth2", undefined>, import('valibot').LiteralSchema<"none", undefined>], undefined>;
|
|
13
14
|
readonly activeConnectionCount: import('valibot').OptionalSchema<import('valibot').NumberSchema<undefined>, undefined>;
|
|
@@ -22,7 +23,13 @@ export declare const connectorImplementationSchema: import('valibot').ObjectSche
|
|
|
22
23
|
readonly maxConnectionCount: import('valibot').OptionalSchema<import('valibot').NumberSchema<undefined>, undefined>;
|
|
23
24
|
readonly params: import('valibot').OptionalSchema<import('valibot').ArraySchema<import('valibot').RecordSchema<import('valibot').StringSchema<undefined>, import('valibot').StringSchema<undefined>, undefined>, undefined>, undefined>;
|
|
24
25
|
}, undefined>;
|
|
25
|
-
/**
|
|
26
|
+
/** Category identifiers used for grouping and filtering connectors. */
|
|
27
|
+
export declare const connectorCategoryIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"application", undefined>, import('valibot').LiteralSchema<"curatedDataset", undefined>, import('valibot').LiteralSchema<"database", undefined>, import('valibot').LiteralSchema<"fileStore", undefined>], undefined>;
|
|
28
|
+
/** Operation names a connector may support. */
|
|
29
|
+
export declare const connectorOperationNameSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"abortOperation", undefined>, import('valibot').LiteralSchema<"authenticateConnection", undefined>, import('valibot').LiteralSchema<"createObject", undefined>, import('valibot').LiteralSchema<"describeConnection", undefined>, import('valibot').LiteralSchema<"dropObject", undefined>, import('valibot').LiteralSchema<"findObject", undefined>, import('valibot').LiteralSchema<"getReadableStream", undefined>, import('valibot').LiteralSchema<"getRecord", undefined>, import('valibot').LiteralSchema<"listNodes", undefined>, import('valibot').LiteralSchema<"previewObject", undefined>, import('valibot').LiteralSchema<"removeRecords", undefined>, import('valibot').LiteralSchema<"retrieveChunks", undefined>, import('valibot').LiteralSchema<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>;
|
|
30
|
+
/** Connector data pipeline usage identifiers. */
|
|
31
|
+
export declare const connectorUsageIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"bidirectional", undefined>, import('valibot').LiteralSchema<"destination", undefined>, import('valibot').LiteralSchema<"source", undefined>, import('valibot').LiteralSchema<"unknown", undefined>], undefined>;
|
|
32
|
+
/** Top-level connector configuration object. */
|
|
26
33
|
export declare const connectorConfigSchema: import('valibot').ObjectSchema<{
|
|
27
34
|
readonly typeId: import('valibot').LiteralSchema<"connector", undefined>;
|
|
28
35
|
readonly category: import('valibot').NullableSchema<import('valibot').ObjectSchema<{
|
|
@@ -1,33 +1,26 @@
|
|
|
1
|
-
import { parse as csvParse } from 'csv-parse/browser/esm';
|
|
2
|
-
import { parse as dateFnsParse } from 'date-fns';
|
|
3
1
|
import { InferOutput } from 'valibot';
|
|
4
|
-
import { nanoid } from 'nanoid';
|
|
5
2
|
import { Component } from '..';
|
|
6
|
-
import {
|
|
3
|
+
import { connectorConfigSchema } from './connectorConfig.schema';
|
|
7
4
|
import { ConnectionConfig, ConnectionDescription, ConnectionNodeConfig } from './connection';
|
|
8
|
-
import { connectorCategoryIdSchema, connectorConfigSchema, connectorImplementationSchema, connectorOperationNameSchema, connectorUsageIdSchema } from './connectorConfig.schema';
|
|
9
5
|
import { DataViewContentAuditConfig, ValueDelimiterId } from '../dataView';
|
|
10
|
-
import {
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/** Interfaces/Types - Connector configuration. */
|
|
20
|
-
export type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;
|
|
21
|
-
export type ConnectorLocalisedConfig = Omit<ConnectorConfig, 'label' | 'description'> & {
|
|
6
|
+
import { ToolConfig } from '../../index';
|
|
7
|
+
/** Authentication method identifiers supported by a connector implementation. */
|
|
8
|
+
/** Connector implementation. */
|
|
9
|
+
/** Category identifiers used for grouping and filtering connectors. */
|
|
10
|
+
/** Operation names a connector may support. */
|
|
11
|
+
/** Connector data pipeline usage identifiers. */
|
|
12
|
+
/** Connector configuration. */
|
|
13
|
+
type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;
|
|
14
|
+
type ConnectorLocalisedConfig = Omit<ConnectorConfig, 'label' | 'description'> & {
|
|
22
15
|
label: string;
|
|
23
16
|
description: string;
|
|
24
17
|
};
|
|
25
|
-
/**
|
|
26
|
-
|
|
18
|
+
/** Connector runtime interface. */
|
|
19
|
+
interface Connector extends Component {
|
|
27
20
|
abortController?: AbortController;
|
|
28
21
|
readonly config: ConnectorConfig;
|
|
29
22
|
readonly connectionConfig: ConnectionConfig;
|
|
30
|
-
readonly
|
|
23
|
+
readonly toolConfigs: ToolConfig[];
|
|
31
24
|
abortOperation?(connector: Connector): void;
|
|
32
25
|
authenticateConnection?(accountId: string, windowCenterX: number, windowCenterY: number): Window;
|
|
33
26
|
createObject?(connector: Connector, settings: CreateSettings): Promise<void>;
|
|
@@ -43,23 +36,6 @@ export interface Connector extends Component {
|
|
|
43
36
|
retrieveRecords?(connector: Connector, settings: RetrieveRecordsSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void>;
|
|
44
37
|
upsertRecords?(connector: Connector, settings: UpsertSettings): Promise<void>;
|
|
45
38
|
}
|
|
46
|
-
export interface ConnectorTools {
|
|
47
|
-
csvParse: typeof csvParse;
|
|
48
|
-
dataPos: {
|
|
49
|
-
buildFetchError: typeof buildFetchError;
|
|
50
|
-
extractExtensionFromPath: typeof extractExtensionFromPath;
|
|
51
|
-
extractNameFromPath: typeof extractNameFromPath;
|
|
52
|
-
lookupMimeTypeForExtension: typeof lookupMimeTypeForExtension;
|
|
53
|
-
OperationalError: typeof OperationalError;
|
|
54
|
-
};
|
|
55
|
-
dateFns: {
|
|
56
|
-
parse: typeof dateFnsParse;
|
|
57
|
-
};
|
|
58
|
-
nanoid: typeof nanoid;
|
|
59
|
-
}
|
|
60
|
-
/** Constants */
|
|
61
|
-
export declare const CONNECTOR_DESTINATION_OPERATIONS: string[];
|
|
62
|
-
export declare const CONNECTOR_SOURCE_OPERATIONS: string[];
|
|
63
39
|
export interface InitialiseSettings {
|
|
64
40
|
connectorStorageURLPrefix: string;
|
|
65
41
|
}
|
|
@@ -174,5 +150,7 @@ export interface ConnectorCallbackData {
|
|
|
174
150
|
typeId: string;
|
|
175
151
|
properties: Record<string, unknown>;
|
|
176
152
|
}
|
|
177
|
-
/**
|
|
153
|
+
/** Exports. */
|
|
154
|
+
export type { ConnectionConfig, ConnectionNodeConfig } from './connection';
|
|
155
|
+
export type { Connector, ConnectorConfig, ConnectorLocalisedConfig };
|
|
178
156
|
export { connectorConfigSchema } from './connectorConfig.schema';
|
|
@@ -77,7 +77,7 @@ declare function normalizeToError(value: unknown): Error;
|
|
|
77
77
|
* - Messages are normalized to end with punctuation.
|
|
78
78
|
*/
|
|
79
79
|
declare function serialiseError(error?: unknown): SerialisedError[];
|
|
80
|
-
/** Exports */
|
|
80
|
+
/** Exports. */
|
|
81
81
|
export type { SerialisedError };
|
|
82
82
|
export { ApplicationError, APIError, EngineError, FetchError, OperationalError, VueHandledError, WindowHandledRuntimeError, WindowHandledPromiseRejectionError };
|
|
83
83
|
export { buildFetchError, concatenateSerialisedErrorMessages, normalizeToError, serialiseError };
|
|
@@ -8,10 +8,8 @@ export type LocalisedString = Record<LocaleCode, string>;
|
|
|
8
8
|
export type { ComponentConfig, ComponentReference, ComponentStatus, ComponentStatusId, ComponentTypeId, ModuleConfig, ModuleTypeId, ComponentStatusColorId } from './component';
|
|
9
9
|
/** Schemas - Component */
|
|
10
10
|
export { componentConfigSchema } from './component';
|
|
11
|
-
/** Constants - Connector */
|
|
12
|
-
export { CONNECTOR_DESTINATION_OPERATIONS, CONNECTOR_SOURCE_OPERATIONS } from './component/connector';
|
|
13
11
|
/** Interfaces/Types Component - Connector */
|
|
14
|
-
export type { AuditContentResult, AuditContentSettings, Connector, ConnectorCallbackData, ConnectorConfig,
|
|
12
|
+
export type { AuditContentResult, AuditContentSettings, Connector, ConnectorCallbackData, ConnectorConfig, ConnectorLocalisedConfig, ConnectorOperationSettings, CreateSettings, DropSettings, FindResult, FindSettings, GetReadableStreamResult, GetReadableStreamSettings, GetRecordResult, GetRecordSettings, InitialiseSettings, ListResult, ListSettings, PreviewResult, PreviewSettings, RemoveSettings, RetrieveChunksSettings, RetrieveChunksSummary, RetrieveRecordsResult, RetrieveRecordsSettings, RetrieveRecordsSummary, UpsertSettings } from './component/connector';
|
|
15
13
|
/** Interfaces/Types - Connection */
|
|
16
14
|
export type { ConnectionAuthorizationConfig, ConnectionColumnConfig, ConnectionConfig, ConnectionNodeConfig, DPAFileSystemFileHandle, Encoding, StorageTypeId, UsageTypeId } from './component/connector/connection';
|
|
17
15
|
/** Schemas - Connector */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.363",
|
|
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>",
|