@datapos/datapos-shared 0.3.404 → 0.3.406
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 +36 -41
- package/dist/types/src/component/connector/connectorConfig.schema.d.ts +4 -0
- package/dist/types/src/component/connector/index.d.ts +61 -57
- package/dist/types/src/engine/index.d.ts +3 -3
- package/dist/types/src/index.d.ts +0 -4
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { l as
|
|
2
|
-
const
|
|
3
|
-
authMethodId:
|
|
4
|
-
activeConnectionCount:
|
|
5
|
-
canDescribe:
|
|
6
|
-
id:
|
|
7
|
-
label:
|
|
8
|
-
maxConnectionCount:
|
|
9
|
-
params:
|
|
10
|
-
}),
|
|
1
|
+
import { l as n, o as i, n as a, a as d, r as b, b as g, m as u, s as e, d as o, e as s, f as p, g as C, D as l } from "./index-5UsJyepS.js";
|
|
2
|
+
const h = n(["apiKey", "disabled", "oAuth2", "none"]), S = i({
|
|
3
|
+
authMethodId: h,
|
|
4
|
+
activeConnectionCount: o(s()),
|
|
5
|
+
canDescribe: o(C()),
|
|
6
|
+
id: o(e()),
|
|
7
|
+
label: o(p),
|
|
8
|
+
maxConnectionCount: o(s()),
|
|
9
|
+
params: o(d(b(e(), e())))
|
|
10
|
+
}), f = n(["application", "curatedDataset", "database", "fileStore"]), y = n([
|
|
11
11
|
"abortOperation",
|
|
12
12
|
"authenticateConnection",
|
|
13
13
|
"createObject",
|
|
@@ -22,39 +22,34 @@ const f = s(["apiKey", "disabled", "oAuth2", "none"]), v = l({
|
|
|
22
22
|
"retrieveChunks",
|
|
23
23
|
"retrieveRecords",
|
|
24
24
|
"upsertRecords"
|
|
25
|
-
]),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
{ id: "application", labels:
|
|
41
|
-
{ id: "curatedDataset", labels:
|
|
42
|
-
{ id: "database", labels:
|
|
43
|
-
{ id: "fileStore", labels:
|
|
44
|
-
],
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
return
|
|
49
|
-
}, A = (o, n = g) => {
|
|
50
|
-
const e = D.find((a) => a.id === o);
|
|
51
|
-
if (e) {
|
|
52
|
-
const a = O(e.labels, n);
|
|
53
|
-
return { id: e.id, label: a ?? e.id };
|
|
25
|
+
]), D = n(["bidirectional", "destination", "source", "unknown"]), v = i({
|
|
26
|
+
id: e(),
|
|
27
|
+
label: e()
|
|
28
|
+
}), R = i({
|
|
29
|
+
...u,
|
|
30
|
+
typeId: g("connector"),
|
|
31
|
+
category: a(v),
|
|
32
|
+
categoryId: f,
|
|
33
|
+
implementations: b(e(), S),
|
|
34
|
+
operations: d(y),
|
|
35
|
+
usageId: D,
|
|
36
|
+
vendorAccountURL: a(e()),
|
|
37
|
+
vendorDocumentationURL: a(e()),
|
|
38
|
+
vendorHomeURL: a(e())
|
|
39
|
+
}), I = [
|
|
40
|
+
{ id: "application", labels: { "en-gb": "Application" } },
|
|
41
|
+
{ id: "curatedDataset", labels: { "en-gb": "Curated Dataset" } },
|
|
42
|
+
{ id: "database", labels: { "en-gb": "Database" } },
|
|
43
|
+
{ id: "fileStore", labels: { "en-gb": "File Store" } }
|
|
44
|
+
], A = (c, m = l) => {
|
|
45
|
+
const t = I.find((r) => r.id === c);
|
|
46
|
+
if (t) {
|
|
47
|
+
const r = t.labels[m] ?? t.labels[l] ?? t.id;
|
|
48
|
+
return { id: t.id, label: r };
|
|
54
49
|
}
|
|
55
|
-
return { id:
|
|
50
|
+
return { id: c, label: c };
|
|
56
51
|
};
|
|
57
52
|
export {
|
|
58
|
-
|
|
53
|
+
R as connectorConfigSchema,
|
|
59
54
|
A as getConnectorCategory
|
|
60
55
|
};
|
|
@@ -29,6 +29,10 @@ export declare const connectorCategoryIdSchema: import('valibot').UnionSchema<re
|
|
|
29
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<"findObjectFolderPath", 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
30
|
/** Connector data pipeline usage identifiers. */
|
|
31
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
|
+
export declare const connectorCategorySchema: import('valibot').ObjectSchema<{
|
|
33
|
+
readonly id: import('valibot').StringSchema<undefined>;
|
|
34
|
+
readonly label: import('valibot').StringSchema<undefined>;
|
|
35
|
+
}, undefined>;
|
|
32
36
|
/** Top-level connector configuration object. */
|
|
33
37
|
export declare const connectorConfigSchema: import('valibot').ObjectSchema<{
|
|
34
38
|
readonly typeId: import('valibot').LiteralSchema<"connector", undefined>;
|
|
@@ -3,7 +3,7 @@ import { Component } from '..';
|
|
|
3
3
|
import { ToolConfig } from '../tool';
|
|
4
4
|
import { ValueDelimiterId } from '../dataView';
|
|
5
5
|
import { ConnectionConfig, ConnectionDescription, ConnectionNodeConfig } from './connection';
|
|
6
|
-
import { connectorConfigSchema, connectorOperationNameSchema, connectorUsageIdSchema } from './connectorConfig.schema';
|
|
6
|
+
import { connectorCategorySchema, connectorConfigSchema, connectorOperationNameSchema, connectorUsageIdSchema } from './connectorConfig.schema';
|
|
7
7
|
/** Authentication method identifiers supported by a connector implementation. */
|
|
8
8
|
/** Connector implementation. */
|
|
9
9
|
/** Category identifiers used for grouping and filtering connectors. */
|
|
@@ -25,86 +25,68 @@ interface ConnectorInterface extends Component {
|
|
|
25
25
|
readonly toolConfigs: ToolConfig[];
|
|
26
26
|
abortOperation?(connector: ConnectorInterface): void;
|
|
27
27
|
authenticateConnection?(accountId: string, windowCenterX: number, windowCenterY: number): Window;
|
|
28
|
-
createObject?(connector: ConnectorInterface,
|
|
29
|
-
describeConnection?(connector: ConnectorInterface,
|
|
30
|
-
dropObject?(connector: ConnectorInterface,
|
|
31
|
-
findObject?(connector: ConnectorInterface,
|
|
32
|
-
getReadableStream?(connector: ConnectorInterface,
|
|
33
|
-
getRecord?(connector: ConnectorInterface,
|
|
34
|
-
listNodes?(connector: ConnectorInterface,
|
|
35
|
-
previewObject?(connector: ConnectorInterface,
|
|
36
|
-
removeRecords?(connector: ConnectorInterface,
|
|
37
|
-
retrieveChunks?(connector: ConnectorInterface,
|
|
38
|
-
retrieveRecords?(connector: ConnectorInterface,
|
|
39
|
-
upsertRecords?(connector: ConnectorInterface,
|
|
40
|
-
}
|
|
41
|
-
/** Connector operation
|
|
42
|
-
interface
|
|
28
|
+
createObject?(connector: ConnectorInterface, options: CreateOptions): Promise<void>;
|
|
29
|
+
describeConnection?(connector: ConnectorInterface, options: DescribeOptions): Promise<DescribeResult>;
|
|
30
|
+
dropObject?(connector: ConnectorInterface, options: DropOptions): Promise<void>;
|
|
31
|
+
findObject?(connector: ConnectorInterface, options: FindObjectFolderPathOptions): Promise<string | null>;
|
|
32
|
+
getReadableStream?(connector: ConnectorInterface, options: GetReadableStreamOptions): Promise<ReadableStream<Uint8Array<ArrayBuffer>>>;
|
|
33
|
+
getRecord?(connector: ConnectorInterface, options: GetRecordOptions): Promise<GetRecordResult>;
|
|
34
|
+
listNodes?(connector: ConnectorInterface, options: ListNodesOptions): Promise<ListNodesResult>;
|
|
35
|
+
previewObject?(connector: ConnectorInterface, options: PreviewObjectOptions): Promise<PreviewObjectResult>;
|
|
36
|
+
removeRecords?(connector: ConnectorInterface, options: RemoveOptions): Promise<void>;
|
|
37
|
+
retrieveChunks?(connector: ConnectorInterface, options: RetrieveChunksOptions): Promise<void>;
|
|
38
|
+
retrieveRecords?(connector: ConnectorInterface, options: RetrieveRecordsOptions): Promise<void>;
|
|
39
|
+
upsertRecords?(connector: ConnectorInterface, options: UpsertOptions): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
/** Connector operation options. */
|
|
42
|
+
interface ConnectorOperationOptions {
|
|
43
43
|
accountId?: string;
|
|
44
44
|
appCheckToken?: string;
|
|
45
45
|
sessionAccessToken?: string;
|
|
46
46
|
}
|
|
47
|
-
/**
|
|
48
|
-
interface
|
|
47
|
+
/** Find object folder path options. */
|
|
48
|
+
interface FindObjectFolderPathOptions extends ConnectorOperationOptions {
|
|
49
49
|
containerName: string | undefined;
|
|
50
50
|
nodeId: string;
|
|
51
51
|
}
|
|
52
|
-
/** Get readable stream
|
|
53
|
-
interface
|
|
52
|
+
/** Get readable stream options. */
|
|
53
|
+
interface GetReadableStreamOptions extends ConnectorOperationOptions {
|
|
54
54
|
id: string;
|
|
55
55
|
path: string;
|
|
56
56
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
path: string;
|
|
60
|
-
structure: string;
|
|
61
|
-
}
|
|
62
|
-
type DescribeSettings = ConnectorOperationSettings;
|
|
63
|
-
interface DescribeResult {
|
|
64
|
-
description: ConnectionDescription;
|
|
65
|
-
}
|
|
66
|
-
interface DropSettings extends ConnectorOperationSettings {
|
|
67
|
-
path: string;
|
|
68
|
-
}
|
|
69
|
-
interface GetRecordSettings extends ConnectorOperationSettings {
|
|
70
|
-
id: string;
|
|
71
|
-
path: string;
|
|
72
|
-
}
|
|
73
|
-
interface GetRecordResult {
|
|
74
|
-
record?: string[] | Record<string, unknown>;
|
|
75
|
-
}
|
|
76
|
-
interface ListSettings extends ConnectorOperationSettings {
|
|
57
|
+
/** List nodes options and result. */
|
|
58
|
+
interface ListNodesOptions extends ConnectorOperationOptions {
|
|
77
59
|
folderPath: string;
|
|
78
60
|
limit?: number;
|
|
79
61
|
offset?: number;
|
|
80
62
|
totalCount?: number;
|
|
81
63
|
}
|
|
82
|
-
interface
|
|
64
|
+
interface ListNodesResult {
|
|
83
65
|
cursor: string | number | undefined;
|
|
84
66
|
connectionNodeConfigs: ConnectionNodeConfig[];
|
|
85
67
|
isMore: boolean;
|
|
86
68
|
totalCount: number;
|
|
87
69
|
}
|
|
88
|
-
|
|
70
|
+
/** Preview object options and result. */
|
|
71
|
+
interface PreviewObjectOptions extends ConnectorOperationOptions {
|
|
89
72
|
chunkSize?: number;
|
|
90
73
|
extension?: string;
|
|
91
74
|
path: string;
|
|
92
75
|
}
|
|
93
|
-
interface
|
|
76
|
+
interface PreviewObjectResult {
|
|
94
77
|
data: Record<string, unknown>[] | Uint8Array;
|
|
95
78
|
typeId: 'jsonArray' | 'uint8Array';
|
|
96
79
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
path: string;
|
|
100
|
-
}
|
|
101
|
-
interface RetrieveChunksSettings extends ConnectorOperationSettings {
|
|
80
|
+
/** Retrieve records options and summary. */
|
|
81
|
+
interface RetrieveRecordsOptions extends ConnectorOperationOptions {
|
|
102
82
|
chunkSize?: number;
|
|
103
83
|
encodingId: string;
|
|
104
84
|
path: string;
|
|
105
85
|
valueDelimiterId: ValueDelimiterId;
|
|
86
|
+
chunk: (records: (string[] | Record<string, unknown>)[]) => void;
|
|
87
|
+
complete: (result: RetrieveRecordsSummary) => void;
|
|
106
88
|
}
|
|
107
|
-
interface
|
|
89
|
+
interface RetrieveRecordsSummary {
|
|
108
90
|
byteCount: number;
|
|
109
91
|
commentLineCount: number;
|
|
110
92
|
emptyLineCount: number;
|
|
@@ -112,13 +94,38 @@ interface RetrieveChunksSummary {
|
|
|
112
94
|
lineCount: number;
|
|
113
95
|
recordCount: number;
|
|
114
96
|
}
|
|
115
|
-
interface
|
|
97
|
+
interface CreateOptions extends ConnectorOperationOptions {
|
|
98
|
+
accountId?: string;
|
|
99
|
+
path: string;
|
|
100
|
+
structure: string;
|
|
101
|
+
}
|
|
102
|
+
type DescribeOptions = ConnectorOperationOptions;
|
|
103
|
+
interface DescribeResult {
|
|
104
|
+
description: ConnectionDescription;
|
|
105
|
+
}
|
|
106
|
+
interface DropOptions extends ConnectorOperationOptions {
|
|
107
|
+
path: string;
|
|
108
|
+
}
|
|
109
|
+
interface GetRecordOptions extends ConnectorOperationOptions {
|
|
110
|
+
id: string;
|
|
111
|
+
path: string;
|
|
112
|
+
}
|
|
113
|
+
interface GetRecordResult {
|
|
114
|
+
record?: string[] | Record<string, unknown>;
|
|
115
|
+
}
|
|
116
|
+
interface RemoveOptions extends ConnectorOperationOptions {
|
|
117
|
+
keys: string[];
|
|
118
|
+
path: string;
|
|
119
|
+
}
|
|
120
|
+
interface RetrieveChunksOptions extends ConnectorOperationOptions {
|
|
116
121
|
chunkSize?: number;
|
|
117
122
|
encodingId: string;
|
|
118
123
|
path: string;
|
|
119
124
|
valueDelimiterId: ValueDelimiterId;
|
|
125
|
+
chunk: (records: (string[] | Record<string, unknown>)[]) => void;
|
|
126
|
+
complete: (result: RetrieveChunksSummary) => void;
|
|
120
127
|
}
|
|
121
|
-
interface
|
|
128
|
+
interface RetrieveChunksSummary {
|
|
122
129
|
byteCount: number;
|
|
123
130
|
commentLineCount: number;
|
|
124
131
|
emptyLineCount: number;
|
|
@@ -126,18 +133,15 @@ interface RetrieveRecordsSummary {
|
|
|
126
133
|
lineCount: number;
|
|
127
134
|
recordCount: number;
|
|
128
135
|
}
|
|
129
|
-
interface
|
|
136
|
+
interface UpsertOptions extends ConnectorOperationOptions {
|
|
130
137
|
records: Record<string, unknown>[];
|
|
131
138
|
path: string;
|
|
132
139
|
}
|
|
133
140
|
/** Types/Interfaces/Operations - Connector category. */
|
|
134
|
-
|
|
135
|
-
id: string;
|
|
136
|
-
label: string;
|
|
137
|
-
}
|
|
141
|
+
type ConnectorCategory = InferOutput<typeof connectorCategorySchema>;
|
|
138
142
|
declare const getConnectorCategory: (id: string, localeId?: import('../../index').LocaleCode) => ConnectorCategory;
|
|
139
143
|
/** Exports. */
|
|
140
144
|
export { getConnectorCategory };
|
|
141
145
|
export type { ConnectionColumnConfig, ConnectionConfig, ConnectionNodeConfig, Encoding, UsageTypeId } from './connection';
|
|
142
|
-
export type { ConnectorConfig, ConnectorInterface, ConnectorLocalisedConfig, ConnectorOperationName,
|
|
146
|
+
export type { ConnectorConfig, ConnectorInterface, ConnectorLocalisedConfig, ConnectorOperationName, ConnectorOperationOptions, ConnectorUsageId, CreateOptions, DropOptions, FindObjectFolderPathOptions, GetReadableStreamOptions, GetRecordResult, GetRecordOptions, ListNodesResult, ListNodesOptions, PreviewObjectResult, PreviewObjectOptions, RemoveOptions, RetrieveChunksOptions, RetrieveChunksSummary, RetrieveRecordsOptions, RetrieveRecordsSummary, UpsertOptions };
|
|
143
147
|
export { connectorConfigSchema } from './connectorConfig.schema';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ConnectionConfig } from '../component/connector/connection';
|
|
2
|
-
import {
|
|
2
|
+
import { ConnectorOperationOptions } from '../component/connector';
|
|
3
3
|
import { ModuleConfig } from '../component/module';
|
|
4
4
|
import { ToolConfig } from '../component/tool';
|
|
5
5
|
import { ContextCallbackData, ContextConfig, ContextOperationSettings } from '../component/context';
|
|
@@ -14,8 +14,8 @@ interface EngineInitialiseSettings {
|
|
|
14
14
|
toolConfigs: ToolConfig[];
|
|
15
15
|
}
|
|
16
16
|
type InitialiseEngine = (settings: EngineInitialiseSettings) => Promise<void>;
|
|
17
|
-
type ProcessConnectorRequest = (id: string, connectionConfig: ConnectionConfig, settings:
|
|
18
|
-
interface AuditContentSettings extends
|
|
17
|
+
type ProcessConnectorRequest = (id: string, connectionConfig: ConnectionConfig, settings: ConnectorOperationOptions, callback?: (callbackData: ContextCallbackData) => void) => Promise<unknown>;
|
|
18
|
+
interface AuditContentSettings extends ConnectorOperationOptions {
|
|
19
19
|
chunkSize?: number;
|
|
20
20
|
encodingId: string;
|
|
21
21
|
path: string;
|
|
@@ -29,10 +29,6 @@ export type { DataFormatId, EncodingConfig, RecordDelimiterId, ValueDelimiterId
|
|
|
29
29
|
export type { DataViewConfig, DataViewContentAuditConfig, DataViewLocalisedConfig, DataViewPreviewConfig, DataViewRelationshipsAuditConfig, ParsedValue } from './component/dataView';
|
|
30
30
|
/** Interfaces/Types - Dimension. */
|
|
31
31
|
export type { DimensionConfig, DimensionLocalisedConfig } from './component/dimension';
|
|
32
|
-
/** Interfaces/Types */
|
|
33
|
-
export type { SerialisedError } from './errors';
|
|
34
|
-
/** Errors */
|
|
35
|
-
/** Utilities */
|
|
36
32
|
/** Interfaces/Types - Event query. */
|
|
37
33
|
export type { EventQueryConfig, EventQueryLocalisedConfig } from './component/eventQuery';
|
|
38
34
|
/** Interfaces/Types */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.406",
|
|
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>",
|