@datapos/datapos-shared 0.3.404 → 0.3.405
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,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. */
|
|
@@ -31,8 +31,8 @@ interface ConnectorInterface extends Component {
|
|
|
31
31
|
findObject?(connector: ConnectorInterface, settings: FindObjectFolderPathSettings): Promise<string | null>;
|
|
32
32
|
getReadableStream?(connector: ConnectorInterface, settings: GetReadableStreamSettings): Promise<ReadableStream<Uint8Array<ArrayBuffer>>>;
|
|
33
33
|
getRecord?(connector: ConnectorInterface, settings: GetRecordSettings): Promise<GetRecordResult>;
|
|
34
|
-
listNodes?(connector: ConnectorInterface, settings:
|
|
35
|
-
previewObject?(connector: ConnectorInterface, settings:
|
|
34
|
+
listNodes?(connector: ConnectorInterface, settings: ListNodesSettings): Promise<ListNodesResult>;
|
|
35
|
+
previewObject?(connector: ConnectorInterface, settings: PreviewObjectSettings): Promise<PreviewObjectResult>;
|
|
36
36
|
removeRecords?(connector: ConnectorInterface, settings: RemoveSettings): Promise<void>;
|
|
37
37
|
retrieveChunks?(connector: ConnectorInterface, settings: RetrieveChunksSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveChunksSummary) => void): Promise<void>;
|
|
38
38
|
retrieveRecords?(connector: ConnectorInterface, settings: RetrieveRecordsSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void>;
|
|
@@ -44,7 +44,7 @@ interface ConnectorOperationSettings {
|
|
|
44
44
|
appCheckToken?: string;
|
|
45
45
|
sessionAccessToken?: string;
|
|
46
46
|
}
|
|
47
|
-
/**
|
|
47
|
+
/** Find object folder path settings. */
|
|
48
48
|
interface FindObjectFolderPathSettings extends ConnectorOperationSettings {
|
|
49
49
|
containerName: string | undefined;
|
|
50
50
|
nodeId: string;
|
|
@@ -54,6 +54,47 @@ interface GetReadableStreamSettings extends ConnectorOperationSettings {
|
|
|
54
54
|
id: string;
|
|
55
55
|
path: string;
|
|
56
56
|
}
|
|
57
|
+
/** List nodes result. */
|
|
58
|
+
interface ListNodesResult {
|
|
59
|
+
cursor: string | number | undefined;
|
|
60
|
+
connectionNodeConfigs: ConnectionNodeConfig[];
|
|
61
|
+
isMore: boolean;
|
|
62
|
+
totalCount: number;
|
|
63
|
+
}
|
|
64
|
+
/** List nodes settings. */
|
|
65
|
+
interface ListNodesSettings extends ConnectorOperationSettings {
|
|
66
|
+
folderPath: string;
|
|
67
|
+
limit?: number;
|
|
68
|
+
offset?: number;
|
|
69
|
+
totalCount?: number;
|
|
70
|
+
}
|
|
71
|
+
/** Preview object result. */
|
|
72
|
+
interface PreviewObjectResult {
|
|
73
|
+
data: Record<string, unknown>[] | Uint8Array;
|
|
74
|
+
typeId: 'jsonArray' | 'uint8Array';
|
|
75
|
+
}
|
|
76
|
+
/** Preview object settings. */
|
|
77
|
+
interface PreviewObjectSettings extends ConnectorOperationSettings {
|
|
78
|
+
chunkSize?: number;
|
|
79
|
+
extension?: string;
|
|
80
|
+
path: string;
|
|
81
|
+
}
|
|
82
|
+
/** Retrieve records summary. */
|
|
83
|
+
interface RetrieveRecordsSummary {
|
|
84
|
+
byteCount: number;
|
|
85
|
+
commentLineCount: number;
|
|
86
|
+
emptyLineCount: number;
|
|
87
|
+
invalidFieldLengthCount: number;
|
|
88
|
+
lineCount: number;
|
|
89
|
+
recordCount: number;
|
|
90
|
+
}
|
|
91
|
+
/** Retrieve records settings. */
|
|
92
|
+
interface RetrieveRecordsSettings extends ConnectorOperationSettings {
|
|
93
|
+
chunkSize?: number;
|
|
94
|
+
encodingId: string;
|
|
95
|
+
path: string;
|
|
96
|
+
valueDelimiterId: ValueDelimiterId;
|
|
97
|
+
}
|
|
57
98
|
interface CreateSettings extends ConnectorOperationSettings {
|
|
58
99
|
accountId?: string;
|
|
59
100
|
path: string;
|
|
@@ -73,27 +114,6 @@ interface GetRecordSettings extends ConnectorOperationSettings {
|
|
|
73
114
|
interface GetRecordResult {
|
|
74
115
|
record?: string[] | Record<string, unknown>;
|
|
75
116
|
}
|
|
76
|
-
interface ListSettings extends ConnectorOperationSettings {
|
|
77
|
-
folderPath: string;
|
|
78
|
-
limit?: number;
|
|
79
|
-
offset?: number;
|
|
80
|
-
totalCount?: number;
|
|
81
|
-
}
|
|
82
|
-
interface ListResult {
|
|
83
|
-
cursor: string | number | undefined;
|
|
84
|
-
connectionNodeConfigs: ConnectionNodeConfig[];
|
|
85
|
-
isMore: boolean;
|
|
86
|
-
totalCount: number;
|
|
87
|
-
}
|
|
88
|
-
interface PreviewSettings extends ConnectorOperationSettings {
|
|
89
|
-
chunkSize?: number;
|
|
90
|
-
extension?: string;
|
|
91
|
-
path: string;
|
|
92
|
-
}
|
|
93
|
-
interface PreviewResult {
|
|
94
|
-
data: Record<string, unknown>[] | Uint8Array;
|
|
95
|
-
typeId: 'jsonArray' | 'uint8Array';
|
|
96
|
-
}
|
|
97
117
|
interface RemoveSettings extends ConnectorOperationSettings {
|
|
98
118
|
keys: string[];
|
|
99
119
|
path: string;
|
|
@@ -112,32 +132,15 @@ interface RetrieveChunksSummary {
|
|
|
112
132
|
lineCount: number;
|
|
113
133
|
recordCount: number;
|
|
114
134
|
}
|
|
115
|
-
interface RetrieveRecordsSettings extends ConnectorOperationSettings {
|
|
116
|
-
chunkSize?: number;
|
|
117
|
-
encodingId: string;
|
|
118
|
-
path: string;
|
|
119
|
-
valueDelimiterId: ValueDelimiterId;
|
|
120
|
-
}
|
|
121
|
-
interface RetrieveRecordsSummary {
|
|
122
|
-
byteCount: number;
|
|
123
|
-
commentLineCount: number;
|
|
124
|
-
emptyLineCount: number;
|
|
125
|
-
invalidFieldLengthCount: number;
|
|
126
|
-
lineCount: number;
|
|
127
|
-
recordCount: number;
|
|
128
|
-
}
|
|
129
135
|
interface UpsertSettings extends ConnectorOperationSettings {
|
|
130
136
|
records: Record<string, unknown>[];
|
|
131
137
|
path: string;
|
|
132
138
|
}
|
|
133
139
|
/** Types/Interfaces/Operations - Connector category. */
|
|
134
|
-
|
|
135
|
-
id: string;
|
|
136
|
-
label: string;
|
|
137
|
-
}
|
|
140
|
+
type ConnectorCategory = InferOutput<typeof connectorCategorySchema>;
|
|
138
141
|
declare const getConnectorCategory: (id: string, localeId?: import('../../index').LocaleCode) => ConnectorCategory;
|
|
139
142
|
/** Exports. */
|
|
140
143
|
export { getConnectorCategory };
|
|
141
144
|
export type { ConnectionColumnConfig, ConnectionConfig, ConnectionNodeConfig, Encoding, UsageTypeId } from './connection';
|
|
142
|
-
export type { ConnectorConfig, ConnectorInterface, ConnectorLocalisedConfig, ConnectorOperationName, ConnectorOperationSettings, ConnectorUsageId, CreateSettings, DropSettings, FindObjectFolderPathSettings, GetReadableStreamSettings, GetRecordResult, GetRecordSettings,
|
|
145
|
+
export type { ConnectorConfig, ConnectorInterface, ConnectorLocalisedConfig, ConnectorOperationName, ConnectorOperationSettings, ConnectorUsageId, CreateSettings, DropSettings, FindObjectFolderPathSettings, GetReadableStreamSettings, GetRecordResult, GetRecordSettings, ListNodesResult, ListNodesSettings, PreviewObjectResult, PreviewObjectSettings, RemoveSettings, RetrieveChunksSettings, RetrieveChunksSummary, RetrieveRecordsSettings, RetrieveRecordsSummary, UpsertSettings };
|
|
143
146
|
export { connectorConfigSchema } from './connectorConfig.schema';
|
|
@@ -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.405",
|
|
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>",
|