@datapos/datapos-shared 0.3.414 → 0.3.416
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,9 +1,9 @@
|
|
|
1
|
-
async function
|
|
2
|
-
const n = `datapos-tool-${o}`, t = e.find((
|
|
1
|
+
async function a(e, o) {
|
|
2
|
+
const n = `datapos-tool-${o}`, t = e.find((r) => r.id === n);
|
|
3
3
|
if (!t) throw new Error(`Connector could not load unknown tool '${o}'.`);
|
|
4
4
|
const l = await import(`https://engine-eu.datapos.app/tools/${o}_v${t.version}/${n}.es.js`);
|
|
5
5
|
return new l.Tool();
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
a as loadTool
|
|
9
9
|
};
|
|
@@ -4,7 +4,7 @@ import { ToolConfig } from '../tool';
|
|
|
4
4
|
import { ValueDelimiterId } from '../dataView';
|
|
5
5
|
import { ConnectionConfig, ConnectionDescription, ConnectionNodeConfig } from './connection';
|
|
6
6
|
import { connectorCategoryConfigSchema, connectorConfigSchema, connectorOperationNameSchema, connectorUsageIdSchema } from './connectorConfig.schema';
|
|
7
|
-
/** Connector runtime interface. */
|
|
7
|
+
/** Connector runtime interface ans constructor. */
|
|
8
8
|
interface ConnectorInterface extends Component {
|
|
9
9
|
abortController: AbortController | undefined;
|
|
10
10
|
readonly config: ConnectorConfig;
|
|
@@ -25,6 +25,8 @@ interface ConnectorInterface extends Component {
|
|
|
25
25
|
retrieveRecords?(connector: ConnectorInterface, options: RetrieveRecordsOptions, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void>;
|
|
26
26
|
upsertRecords?(connector: ConnectorInterface, options: UpsertRecordsOptions): Promise<void>;
|
|
27
27
|
}
|
|
28
|
+
/** Class constructor that builds a ConnectorInterface. */
|
|
29
|
+
type ConnectorConstructor = new (config: ConnectorConfig, toolConfigs: ToolConfig[]) => ConnectorInterface;
|
|
28
30
|
/** Operation names a connector may support. */
|
|
29
31
|
type ConnectorOperationName = InferOutput<typeof connectorOperationNameSchema>;
|
|
30
32
|
/** Connector data pipeline usage identifiers. */
|
|
@@ -139,4 +141,4 @@ declare const constructConnectorCategoryConfig: (id: string, localeId?: import('
|
|
|
139
141
|
export { connectorConfigSchema } from './connectorConfig.schema';
|
|
140
142
|
export { constructConnectorCategoryConfig };
|
|
141
143
|
export type { ConnectionColumnConfig, ConnectionConfig, ConnectionNodeConfig, Encoding, UsageTypeId } from './connection';
|
|
142
|
-
export type { ConnectorConfig, ConnectorInterface, ConnectorLocalisedConfig, ConnectorOperationName, ConnectorOperationOptions, ConnectorUsageId, CreateObjectOptions, DropObjectOptions, FindObjectFolderPathOptions, GetReadableStreamOptions, GetRecordResult, GetRecordOptions, ListNodesResult, ListNodesOptions, PreviewObjectResult, PreviewObjectOptions, RemoveRecordsOptions, RetrieveChunksOptions, RetrieveRecordsOptions, RetrieveRecordsSummary, UpsertRecordsOptions };
|
|
144
|
+
export type { ConnectorConfig, ConnectorConstructor, ConnectorInterface, ConnectorLocalisedConfig, ConnectorOperationName, ConnectorOperationOptions, ConnectorUsageId, CreateObjectOptions, DropObjectOptions, FindObjectFolderPathOptions, GetReadableStreamOptions, GetRecordResult, GetRecordOptions, ListNodesResult, ListNodesOptions, PreviewObjectResult, PreviewObjectOptions, RemoveRecordsOptions, RetrieveChunksOptions, RetrieveRecordsOptions, RetrieveRecordsSummary, UpsertRecordsOptions };
|
|
@@ -7,7 +7,7 @@ export interface Context extends Component {
|
|
|
7
7
|
readonly config: ContextConfig;
|
|
8
8
|
list(settings?: ContextListSettings): Promise<ContextListResult>;
|
|
9
9
|
}
|
|
10
|
-
export type
|
|
10
|
+
export type ContextOperationOptions = object;
|
|
11
11
|
export type ContextListSettings = object;
|
|
12
12
|
export interface ContextListResult {
|
|
13
13
|
models: ContextModelGroupConfig[];
|
|
@@ -2,35 +2,44 @@ import { ConnectionConfig } from '../component/connector/connection';
|
|
|
2
2
|
import { ConnectorOperationOptions } from '../component/connector';
|
|
3
3
|
import { ModuleConfig } from '../component/module';
|
|
4
4
|
import { ToolConfig } from '../component/tool';
|
|
5
|
-
import { ContextCallbackData, ContextConfig,
|
|
5
|
+
import { ContextCallbackData, ContextConfig, ContextOperationOptions } from '../component/context';
|
|
6
6
|
import { DataViewContentAuditConfig, EncodingConfig, ValueDelimiterId } from '../component/dataView';
|
|
7
|
+
/** Engine runtime interface. */
|
|
8
|
+
interface EngineRuntimeInterface {
|
|
9
|
+
getEncodingConfigs: (localeId: string) => EncodingConfig[];
|
|
10
|
+
invokeWorker(errorEventCallback: (errorEvent: ErrorEvent) => void): EngineWorkerInterface;
|
|
11
|
+
}
|
|
12
|
+
/** Engine worker interface. */
|
|
13
|
+
interface EngineWorkerInterface {
|
|
14
|
+
initialise: (options: EngineWorkerInitialiseOptions) => Promise<void>;
|
|
15
|
+
processConnectorRequest: (id: string, connectionConfig: ConnectionConfig, options: ConnectorOperationOptions, callback?: (callbackData: ConnectorCallbackData) => void) => Promise<unknown>;
|
|
16
|
+
processContextRequest: (id: string, contextConfig: ContextConfig, options: ContextOperationOptions, callback?: (callbackData: ContextCallbackData) => void) => Promise<unknown>;
|
|
17
|
+
processTestRequest: (settings: TestSettings) => Promise<Record<string, unknown>>;
|
|
18
|
+
}
|
|
19
|
+
/** Engine worker initialise options. */
|
|
20
|
+
interface EngineWorkerInitialiseOptions {
|
|
21
|
+
connectorStorageURLPrefix: string;
|
|
22
|
+
toolConfigs: ToolConfig[];
|
|
23
|
+
}
|
|
7
24
|
/** Engine configuration. */
|
|
8
25
|
interface EngineConfig extends ModuleConfig {
|
|
9
26
|
typeId: 'engine';
|
|
10
27
|
}
|
|
11
|
-
/**
|
|
12
|
-
interface
|
|
13
|
-
|
|
14
|
-
|
|
28
|
+
/** Connector callback data. */
|
|
29
|
+
interface ConnectorCallbackData {
|
|
30
|
+
typeId: string;
|
|
31
|
+
properties: Record<string, unknown>;
|
|
15
32
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
interface AuditContentSettings extends ConnectorOperationOptions {
|
|
33
|
+
/** Audit object content options and result. */
|
|
34
|
+
interface AuditObjectContentOptions extends ConnectorOperationOptions {
|
|
19
35
|
chunkSize?: number;
|
|
20
36
|
encodingId: string;
|
|
21
37
|
path: string;
|
|
22
38
|
valueDelimiterId: ValueDelimiterId;
|
|
23
39
|
}
|
|
24
|
-
interface
|
|
40
|
+
interface AuditObjectContentResult {
|
|
25
41
|
contentAuditConfig: DataViewContentAuditConfig;
|
|
26
42
|
}
|
|
27
|
-
/** Connector callback data. */
|
|
28
|
-
interface ConnectorCallbackData {
|
|
29
|
-
typeId: string;
|
|
30
|
-
properties: Record<string, unknown>;
|
|
31
|
-
}
|
|
32
|
-
type ProcessContextRequest = (id: string, contextConfig: ContextConfig, settings: ContextOperationSettings, callback?: (callbackData: ConnectorCallbackData) => void) => Promise<unknown>;
|
|
33
|
-
type ProcessTestRequest = (settings: TestSettings) => Promise<Record<string, unknown>>;
|
|
34
43
|
interface TestSettings {
|
|
35
44
|
action?: string;
|
|
36
45
|
delimiter?: string;
|
|
@@ -38,15 +47,5 @@ interface TestSettings {
|
|
|
38
47
|
hasHeaders?: boolean;
|
|
39
48
|
readable: ReadableStream<Uint8Array>;
|
|
40
49
|
}
|
|
41
|
-
interface EngineInterface {
|
|
42
|
-
getEncodingConfigs: (localeId: string) => EncodingConfig[];
|
|
43
|
-
invokeWorker(errorEventCallback: (errorEvent: ErrorEvent) => void): EngineWorker;
|
|
44
|
-
}
|
|
45
|
-
interface EngineWorker {
|
|
46
|
-
initialise: InitialiseEngine;
|
|
47
|
-
processConnectorRequest: ProcessConnectorRequest;
|
|
48
|
-
processContextRequest: ProcessContextRequest;
|
|
49
|
-
processTestRequest: ProcessTestRequest;
|
|
50
|
-
}
|
|
51
50
|
/** Exports. */
|
|
52
|
-
export type {
|
|
51
|
+
export type { AuditObjectContentOptions, AuditObjectContentResult, ConnectorCallbackData, EngineConfig, EngineRuntimeInterface, EngineWorkerInitialiseOptions, EngineWorkerInterface, TestSettings };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.416",
|
|
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>",
|