@datapos/datapos-shared 0.3.330 → 0.3.331
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.es.js +1 -1
- package/dist/types/src/component/connector/connectorConfig.schema.d.ts +23 -3
- package/dist/types/src/component/connector/index.d.ts +9 -31
- package/dist/types/src/component/context/contextConfig.schema.d.ts +1 -2
- package/dist/types/src/component/presenter/presenterConfig.schema.d.ts +1 -2
- package/package.json +3 -3
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Connector schema.
|
|
3
|
-
* Drafted by Copilot.
|
|
2
|
+
* Connector schema (drafted by Copilot).
|
|
4
3
|
*/
|
|
4
|
+
/** Schemas - */
|
|
5
|
+
export declare const connectorModuleCategoryIdSchema: 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
|
+
/** Schemas - Connector operations. */
|
|
7
|
+
export declare const connectorOperationSchema: 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<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>;
|
|
8
|
+
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>;
|
|
9
|
+
/** Schemas - Connector implementation. */
|
|
10
|
+
export declare const connectorImplementationSchema: import('valibot').ObjectSchema<{
|
|
11
|
+
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>;
|
|
12
|
+
readonly activeConnectionCount: import('valibot').OptionalSchema<import('valibot').NumberSchema<undefined>, undefined>;
|
|
13
|
+
readonly canDescribe: import('valibot').OptionalSchema<import('valibot').BooleanSchema<undefined>, undefined>;
|
|
14
|
+
readonly id: import('valibot').OptionalSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
15
|
+
readonly label: import('valibot').OptionalSchema<import('valibot').ObjectSchema<{
|
|
16
|
+
readonly 'en-au': import('valibot').StringSchema<undefined>;
|
|
17
|
+
readonly 'en-gb': import('valibot').StringSchema<undefined>;
|
|
18
|
+
readonly 'en-us': import('valibot').StringSchema<undefined>;
|
|
19
|
+
readonly 'es-es': import('valibot').StringSchema<undefined>;
|
|
20
|
+
}, undefined>, undefined>;
|
|
21
|
+
readonly maxConnectionCount: import('valibot').OptionalSchema<import('valibot').NumberSchema<undefined>, undefined>;
|
|
22
|
+
readonly params: import('valibot').OptionalSchema<import('valibot').ArraySchema<import('valibot').RecordSchema<import('valibot').StringSchema<undefined>, import('valibot').StringSchema<undefined>, undefined>, undefined>, undefined>;
|
|
23
|
+
}, undefined>;
|
|
24
|
+
/** Schemas - Connector configuration. */
|
|
5
25
|
export declare const connectorConfigSchema: import('valibot').ObjectSchema<{
|
|
6
26
|
readonly typeId: import('valibot').LiteralSchema<"connector", undefined>;
|
|
7
27
|
readonly category: import('valibot').NullableSchema<import('valibot').ObjectSchema<{
|
|
@@ -23,7 +43,7 @@ export declare const connectorConfigSchema: import('valibot').ObjectSchema<{
|
|
|
23
43
|
readonly maxConnectionCount: import('valibot').OptionalSchema<import('valibot').NumberSchema<undefined>, undefined>;
|
|
24
44
|
readonly params: import('valibot').OptionalSchema<import('valibot').ArraySchema<import('valibot').RecordSchema<import('valibot').StringSchema<undefined>, import('valibot').StringSchema<undefined>, undefined>, undefined>, undefined>;
|
|
25
45
|
}, undefined>, undefined>;
|
|
26
|
-
readonly operations: import('valibot').ArraySchema<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<"
|
|
46
|
+
readonly operations: import('valibot').ArraySchema<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<"retrieveRecords", undefined>, import('valibot').LiteralSchema<"upsertRecords", undefined>], undefined>, undefined>;
|
|
27
47
|
readonly usageId: 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>;
|
|
28
48
|
readonly vendorAccountURL: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
29
49
|
readonly vendorDocumentationURL: import('valibot').NullableSchema<import('valibot').StringSchema<undefined>, undefined>;
|
|
@@ -2,18 +2,19 @@ import { parse as csvParse } from 'csv-parse/browser/esm';
|
|
|
2
2
|
import { parse as dateFnsParse } from 'date-fns';
|
|
3
3
|
import { InferOutput } from 'valibot';
|
|
4
4
|
import { nanoid } from 'nanoid';
|
|
5
|
-
import {
|
|
6
|
-
import { LocalisedString } from '../../index';
|
|
5
|
+
import { Component } from '..';
|
|
7
6
|
import { buildFetchError, OperationalError } from '../../errors';
|
|
8
|
-
import { Component, ModuleConfig } from '..';
|
|
9
7
|
import { ConnectionConfig, ConnectionDescription, ConnectionNodeConfig } from './connection';
|
|
8
|
+
import { connectorConfigSchema, connectorImplementationSchema, connectorModuleCategoryIdSchema, connectorOperationSchema, connectorUsageIdSchema } from './connectorConfig.schema';
|
|
10
9
|
import { DataViewContentAuditConfig, ValueDelimiterId } from '../dataView';
|
|
11
10
|
import { extractExtensionFromPath, extractNameFromPath, lookupMimeTypeForExtension } from '../../utilities';
|
|
12
|
-
type ConnectorModuleCategoryId =
|
|
13
|
-
export type ConnectorOperation =
|
|
14
|
-
export type ConnectorUsageId =
|
|
11
|
+
export type ConnectorModuleCategoryId = InferOutput<typeof connectorModuleCategoryIdSchema>;
|
|
12
|
+
export type ConnectorOperation = InferOutput<typeof connectorOperationSchema>;
|
|
13
|
+
export type ConnectorUsageId = InferOutput<typeof connectorUsageIdSchema>;
|
|
14
|
+
/** Constants */
|
|
15
15
|
export declare const CONNECTOR_DESTINATION_OPERATIONS: string[];
|
|
16
16
|
export declare const CONNECTOR_SOURCE_OPERATIONS: string[];
|
|
17
|
+
/** Interfaces/Types - Connector. */
|
|
17
18
|
export interface Connector extends Component {
|
|
18
19
|
abortController?: AbortController;
|
|
19
20
|
readonly config: ConnectorConfig;
|
|
@@ -25,7 +26,7 @@ export interface Connector extends Component {
|
|
|
25
26
|
describeConnection?(connector: Connector, settings: DescribeSettings): Promise<DescribeResult>;
|
|
26
27
|
dropObject?(connector: Connector, settings: DropSettings): Promise<void>;
|
|
27
28
|
findObject?(connector: Connector, findSettings: FindSettings): Promise<FindResult>;
|
|
28
|
-
|
|
29
|
+
getReadableStream?(connector: Connector, getSettings: GetReaderSettings): Promise<GetReaderResult>;
|
|
29
30
|
getRecord?(connector: Connector, getSettings: GetRecordSettings): Promise<GetRecordResult>;
|
|
30
31
|
listNodes?(connector: Connector, settings: ListSettings): Promise<ListResult>;
|
|
31
32
|
previewObject?(connector: Connector, settings: PreviewSettings): Promise<PreviewResult>;
|
|
@@ -34,30 +35,11 @@ export interface Connector extends Component {
|
|
|
34
35
|
upsertRecords?(connector: Connector, settings: UpsertSettings): Promise<void>;
|
|
35
36
|
}
|
|
36
37
|
export type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;
|
|
37
|
-
export interface ConnectorConfig1 extends ModuleConfig {
|
|
38
|
-
category: ConnectorCategory | null;
|
|
39
|
-
categoryId: ConnectorModuleCategoryId;
|
|
40
|
-
implementations: Record<string, ConnectorImplementation>;
|
|
41
|
-
operations: ConnectorOperation[];
|
|
42
|
-
typeId: 'connector';
|
|
43
|
-
usageId: ConnectorUsageId;
|
|
44
|
-
vendorAccountURL: string | null;
|
|
45
|
-
vendorDocumentationURL: string | null;
|
|
46
|
-
vendorHomeURL: string | null;
|
|
47
|
-
}
|
|
48
38
|
export type ConnectorLocalisedConfig = Omit<ConnectorConfig, 'label' | 'description'> & {
|
|
49
39
|
label: string;
|
|
50
40
|
description: string;
|
|
51
41
|
};
|
|
52
|
-
export
|
|
53
|
-
activeConnectionCount?: number;
|
|
54
|
-
canDescribe?: boolean;
|
|
55
|
-
id?: string;
|
|
56
|
-
authMethodId: 'apiKey' | 'disabled' | 'oAuth2' | 'none';
|
|
57
|
-
label?: LocalisedString;
|
|
58
|
-
maxConnectionCount?: number;
|
|
59
|
-
params?: Record<string, string>[];
|
|
60
|
-
}
|
|
42
|
+
export type ConnectorImplementation = InferOutput<typeof connectorImplementationSchema>;
|
|
61
43
|
export interface ConnectorTools {
|
|
62
44
|
csvParse: typeof csvParse;
|
|
63
45
|
dataPos: {
|
|
@@ -172,9 +154,5 @@ export interface ConnectorCallbackData {
|
|
|
172
154
|
typeId: string;
|
|
173
155
|
properties: Record<string, unknown>;
|
|
174
156
|
}
|
|
175
|
-
interface ConnectorCategory {
|
|
176
|
-
id: string;
|
|
177
|
-
label: string;
|
|
178
|
-
}
|
|
179
157
|
/** Exposures */
|
|
180
158
|
export { connectorConfigSchema } from './connectorConfig.schema';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.331",
|
|
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>",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"nanoid": "^5.1.6"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@datapos/datapos-development": "^0.3.
|
|
37
|
-
"@datapos/eslint-config-datapos": "^1.0.
|
|
36
|
+
"@datapos/datapos-development": "^0.3.424",
|
|
37
|
+
"@datapos/eslint-config-datapos": "^1.0.28",
|
|
38
38
|
"@types/node": "^25.0.3",
|
|
39
39
|
"@typescript-eslint/eslint-plugin": "^8.50.0",
|
|
40
40
|
"@typescript-eslint/parser": "^8.50.0",
|