@datapos/datapos-shared 0.3.405 → 0.3.407
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.
|
@@ -25,61 +25,67 @@ 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>>;
|
|
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
|
-
/** Find object folder path
|
|
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
|
-
/** List nodes result. */
|
|
57
|
+
/** List nodes options and result. */
|
|
58
|
+
interface ListNodesOptions extends ConnectorOperationOptions {
|
|
59
|
+
folderPath: string;
|
|
60
|
+
limit?: number;
|
|
61
|
+
offset?: number;
|
|
62
|
+
totalCount?: number;
|
|
63
|
+
}
|
|
58
64
|
interface ListNodesResult {
|
|
59
65
|
cursor: string | number | undefined;
|
|
60
66
|
connectionNodeConfigs: ConnectionNodeConfig[];
|
|
61
67
|
isMore: boolean;
|
|
62
68
|
totalCount: number;
|
|
63
69
|
}
|
|
64
|
-
/**
|
|
65
|
-
interface
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
totalCount?: number;
|
|
70
|
+
/** Preview object options and result. */
|
|
71
|
+
interface PreviewObjectOptions extends ConnectorOperationOptions {
|
|
72
|
+
chunkSize?: number;
|
|
73
|
+
extension?: string;
|
|
74
|
+
path: string;
|
|
70
75
|
}
|
|
71
|
-
/** Preview object result. */
|
|
72
76
|
interface PreviewObjectResult {
|
|
73
77
|
data: Record<string, unknown>[] | Uint8Array;
|
|
74
78
|
typeId: 'jsonArray' | 'uint8Array';
|
|
75
79
|
}
|
|
76
|
-
/**
|
|
77
|
-
interface
|
|
80
|
+
/** Retrieve records options and summary. */
|
|
81
|
+
interface RetrieveRecordsOptions extends ConnectorOperationOptions {
|
|
78
82
|
chunkSize?: number;
|
|
79
|
-
|
|
83
|
+
encodingId: string;
|
|
80
84
|
path: string;
|
|
85
|
+
valueDelimiterId: ValueDelimiterId;
|
|
86
|
+
chunk: (records: (string[] | Record<string, unknown>)[]) => void;
|
|
87
|
+
complete: (result: RetrieveRecordsSummary) => void;
|
|
81
88
|
}
|
|
82
|
-
/** Retrieve records summary. */
|
|
83
89
|
interface RetrieveRecordsSummary {
|
|
84
90
|
byteCount: number;
|
|
85
91
|
commentLineCount: number;
|
|
@@ -88,41 +94,36 @@ interface RetrieveRecordsSummary {
|
|
|
88
94
|
lineCount: number;
|
|
89
95
|
recordCount: number;
|
|
90
96
|
}
|
|
91
|
-
|
|
92
|
-
interface RetrieveRecordsSettings extends ConnectorOperationSettings {
|
|
93
|
-
chunkSize?: number;
|
|
94
|
-
encodingId: string;
|
|
95
|
-
path: string;
|
|
96
|
-
valueDelimiterId: ValueDelimiterId;
|
|
97
|
-
}
|
|
98
|
-
interface CreateSettings extends ConnectorOperationSettings {
|
|
97
|
+
interface CreateOptions extends ConnectorOperationOptions {
|
|
99
98
|
accountId?: string;
|
|
100
99
|
path: string;
|
|
101
100
|
structure: string;
|
|
102
101
|
}
|
|
103
|
-
type
|
|
102
|
+
type DescribeOptions = ConnectorOperationOptions;
|
|
104
103
|
interface DescribeResult {
|
|
105
104
|
description: ConnectionDescription;
|
|
106
105
|
}
|
|
107
|
-
interface
|
|
106
|
+
interface DropOptions extends ConnectorOperationOptions {
|
|
108
107
|
path: string;
|
|
109
108
|
}
|
|
110
|
-
interface
|
|
109
|
+
interface GetRecordOptions extends ConnectorOperationOptions {
|
|
111
110
|
id: string;
|
|
112
111
|
path: string;
|
|
113
112
|
}
|
|
114
113
|
interface GetRecordResult {
|
|
115
114
|
record?: string[] | Record<string, unknown>;
|
|
116
115
|
}
|
|
117
|
-
interface
|
|
116
|
+
interface RemoveOptions extends ConnectorOperationOptions {
|
|
118
117
|
keys: string[];
|
|
119
118
|
path: string;
|
|
120
119
|
}
|
|
121
|
-
interface
|
|
120
|
+
interface RetrieveChunksOptions extends ConnectorOperationOptions {
|
|
122
121
|
chunkSize?: number;
|
|
123
122
|
encodingId: string;
|
|
124
123
|
path: string;
|
|
125
124
|
valueDelimiterId: ValueDelimiterId;
|
|
125
|
+
chunk: (records: (string[] | Record<string, unknown>)[]) => void;
|
|
126
|
+
complete: (result: RetrieveChunksSummary) => void;
|
|
126
127
|
}
|
|
127
128
|
interface RetrieveChunksSummary {
|
|
128
129
|
byteCount: number;
|
|
@@ -132,7 +133,7 @@ interface RetrieveChunksSummary {
|
|
|
132
133
|
lineCount: number;
|
|
133
134
|
recordCount: number;
|
|
134
135
|
}
|
|
135
|
-
interface
|
|
136
|
+
interface UpsertOptions extends ConnectorOperationOptions {
|
|
136
137
|
records: Record<string, unknown>[];
|
|
137
138
|
path: string;
|
|
138
139
|
}
|
|
@@ -142,5 +143,5 @@ declare const getConnectorCategory: (id: string, localeId?: import('../../index'
|
|
|
142
143
|
/** Exports. */
|
|
143
144
|
export { getConnectorCategory };
|
|
144
145
|
export type { ConnectionColumnConfig, ConnectionConfig, ConnectionNodeConfig, Encoding, UsageTypeId } from './connection';
|
|
145
|
-
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 };
|
|
146
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.407",
|
|
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>",
|