@datapos/datapos-shared 0.3.403 → 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.
- package/dist/datapos-shared-component.es.js +3 -3
- package/dist/datapos-shared-connector.es.js +51 -23
- package/dist/datapos-shared.es.js +9 -575
- package/dist/index-5UsJyepS.js +554 -0
- package/dist/types/src/component/connector/connectorConfig.schema.d.ts +4 -0
- package/dist/types/src/component/connector/index.d.ts +49 -45
- package/dist/types/src/engine/index.d.ts +11 -7
- package/dist/types/src/index.d.ts +0 -10
- package/package.json +1 -1
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { InferOutput } from 'valibot';
|
|
2
2
|
import { Component } from '..';
|
|
3
|
-
import { connectorConfigSchema } from './connectorConfig.schema';
|
|
4
3
|
import { ToolConfig } from '../tool';
|
|
5
4
|
import { ValueDelimiterId } from '../dataView';
|
|
6
5
|
import { ConnectionConfig, ConnectionDescription, ConnectionNodeConfig } from './connection';
|
|
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. */
|
|
10
10
|
/** Operation names a connector may support. */
|
|
11
|
+
type ConnectorOperationName = InferOutput<typeof connectorOperationNameSchema>;
|
|
11
12
|
/** Connector data pipeline usage identifiers. */
|
|
13
|
+
type ConnectorUsageId = InferOutput<typeof connectorUsageIdSchema>;
|
|
12
14
|
/** Connector configuration. */
|
|
13
15
|
type ConnectorConfig = InferOutput<typeof connectorConfigSchema>;
|
|
14
16
|
type ConnectorLocalisedConfig = Omit<ConnectorConfig, 'label' | 'description'> & {
|
|
@@ -29,8 +31,8 @@ interface ConnectorInterface extends Component {
|
|
|
29
31
|
findObject?(connector: ConnectorInterface, settings: FindObjectFolderPathSettings): Promise<string | null>;
|
|
30
32
|
getReadableStream?(connector: ConnectorInterface, settings: GetReadableStreamSettings): Promise<ReadableStream<Uint8Array<ArrayBuffer>>>;
|
|
31
33
|
getRecord?(connector: ConnectorInterface, settings: GetRecordSettings): Promise<GetRecordResult>;
|
|
32
|
-
listNodes?(connector: ConnectorInterface, settings:
|
|
33
|
-
previewObject?(connector: ConnectorInterface, settings:
|
|
34
|
+
listNodes?(connector: ConnectorInterface, settings: ListNodesSettings): Promise<ListNodesResult>;
|
|
35
|
+
previewObject?(connector: ConnectorInterface, settings: PreviewObjectSettings): Promise<PreviewObjectResult>;
|
|
34
36
|
removeRecords?(connector: ConnectorInterface, settings: RemoveSettings): Promise<void>;
|
|
35
37
|
retrieveChunks?(connector: ConnectorInterface, settings: RetrieveChunksSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveChunksSummary) => void): Promise<void>;
|
|
36
38
|
retrieveRecords?(connector: ConnectorInterface, settings: RetrieveRecordsSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void>;
|
|
@@ -42,7 +44,7 @@ interface ConnectorOperationSettings {
|
|
|
42
44
|
appCheckToken?: string;
|
|
43
45
|
sessionAccessToken?: string;
|
|
44
46
|
}
|
|
45
|
-
/**
|
|
47
|
+
/** Find object folder path settings. */
|
|
46
48
|
interface FindObjectFolderPathSettings extends ConnectorOperationSettings {
|
|
47
49
|
containerName: string | undefined;
|
|
48
50
|
nodeId: string;
|
|
@@ -52,6 +54,47 @@ interface GetReadableStreamSettings extends ConnectorOperationSettings {
|
|
|
52
54
|
id: string;
|
|
53
55
|
path: string;
|
|
54
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
|
+
}
|
|
55
98
|
interface CreateSettings extends ConnectorOperationSettings {
|
|
56
99
|
accountId?: string;
|
|
57
100
|
path: string;
|
|
@@ -71,27 +114,6 @@ interface GetRecordSettings extends ConnectorOperationSettings {
|
|
|
71
114
|
interface GetRecordResult {
|
|
72
115
|
record?: string[] | Record<string, unknown>;
|
|
73
116
|
}
|
|
74
|
-
interface ListSettings extends ConnectorOperationSettings {
|
|
75
|
-
folderPath: string;
|
|
76
|
-
limit?: number;
|
|
77
|
-
offset?: number;
|
|
78
|
-
totalCount?: number;
|
|
79
|
-
}
|
|
80
|
-
interface ListResult {
|
|
81
|
-
cursor: string | number | undefined;
|
|
82
|
-
connectionNodeConfigs: ConnectionNodeConfig[];
|
|
83
|
-
isMore: boolean;
|
|
84
|
-
totalCount: number;
|
|
85
|
-
}
|
|
86
|
-
interface PreviewSettings extends ConnectorOperationSettings {
|
|
87
|
-
chunkSize?: number;
|
|
88
|
-
extension?: string;
|
|
89
|
-
path: string;
|
|
90
|
-
}
|
|
91
|
-
interface PreviewResult {
|
|
92
|
-
data: Record<string, unknown>[] | Uint8Array;
|
|
93
|
-
typeId: 'jsonArray' | 'uint8Array';
|
|
94
|
-
}
|
|
95
117
|
interface RemoveSettings extends ConnectorOperationSettings {
|
|
96
118
|
keys: string[];
|
|
97
119
|
path: string;
|
|
@@ -110,33 +132,15 @@ interface RetrieveChunksSummary {
|
|
|
110
132
|
lineCount: number;
|
|
111
133
|
recordCount: number;
|
|
112
134
|
}
|
|
113
|
-
interface RetrieveRecordsSettings extends ConnectorOperationSettings {
|
|
114
|
-
chunkSize?: number;
|
|
115
|
-
encodingId: string;
|
|
116
|
-
path: string;
|
|
117
|
-
valueDelimiterId: ValueDelimiterId;
|
|
118
|
-
}
|
|
119
|
-
interface RetrieveRecordsSummary {
|
|
120
|
-
byteCount: number;
|
|
121
|
-
commentLineCount: number;
|
|
122
|
-
emptyLineCount: number;
|
|
123
|
-
invalidFieldLengthCount: number;
|
|
124
|
-
lineCount: number;
|
|
125
|
-
recordCount: number;
|
|
126
|
-
}
|
|
127
135
|
interface UpsertSettings extends ConnectorOperationSettings {
|
|
128
136
|
records: Record<string, unknown>[];
|
|
129
137
|
path: string;
|
|
130
138
|
}
|
|
131
139
|
/** Types/Interfaces/Operations - Connector category. */
|
|
132
|
-
|
|
133
|
-
id: string;
|
|
134
|
-
label: string;
|
|
135
|
-
}
|
|
140
|
+
type ConnectorCategory = InferOutput<typeof connectorCategorySchema>;
|
|
136
141
|
declare const getConnectorCategory: (id: string, localeId?: import('../../index').LocaleCode) => ConnectorCategory;
|
|
137
142
|
/** Exports. */
|
|
138
143
|
export { getConnectorCategory };
|
|
139
144
|
export type { ConnectionColumnConfig, ConnectionConfig, ConnectionNodeConfig, Encoding, UsageTypeId } from './connection';
|
|
140
|
-
export type { ConnectorConfig, ConnectorInterface, ConnectorLocalisedConfig, ConnectorOperationSettings };
|
|
141
|
-
export type { CreateSettings, DropSettings, FindObjectFolderPathSettings, GetReadableStreamSettings, GetRecordResult, GetRecordSettings, ListResult, ListSettings, PreviewResult, PreviewSettings, RemoveSettings, RetrieveChunksSettings, RetrieveChunksSummary, RetrieveRecordsSettings, RetrieveRecordsSummary, UpsertSettings };
|
|
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 };
|
|
142
146
|
export { connectorConfigSchema } from './connectorConfig.schema';
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { ConnectionConfig } from '../component/connector/connection';
|
|
2
|
+
import { ConnectorOperationSettings } from '../component/connector';
|
|
3
|
+
import { ModuleConfig } from '../component/module';
|
|
2
4
|
import { ToolConfig } from '../component/tool';
|
|
3
|
-
import { ConnectorOperationSettings, ListResult, RetrieveRecordsResult } from '../component/connector';
|
|
4
5
|
import { ContextCallbackData, ContextConfig, ContextOperationSettings } from '../component/context';
|
|
5
|
-
import { DataViewContentAuditConfig,
|
|
6
|
+
import { DataViewContentAuditConfig, EncodingConfig, ValueDelimiterId } from '../component/dataView';
|
|
7
|
+
/** Engine configuration. */
|
|
8
|
+
interface EngineConfig extends ModuleConfig {
|
|
9
|
+
typeId: 'engine';
|
|
10
|
+
}
|
|
11
|
+
/** Engine initialise settings. */
|
|
6
12
|
interface EngineInitialiseSettings {
|
|
7
13
|
connectorStorageURLPrefix: string;
|
|
8
14
|
toolConfigs: ToolConfig[];
|
|
9
15
|
}
|
|
10
16
|
type InitialiseEngine = (settings: EngineInitialiseSettings) => Promise<void>;
|
|
11
|
-
type ProcessConnectorRequest = (id: string, connectionConfig: ConnectionConfig, settings: ConnectorOperationSettings, callback?: (callbackData: ContextCallbackData) => void) => Promise<
|
|
17
|
+
type ProcessConnectorRequest = (id: string, connectionConfig: ConnectionConfig, settings: ConnectorOperationSettings, callback?: (callbackData: ContextCallbackData) => void) => Promise<unknown>;
|
|
12
18
|
interface AuditContentSettings extends ConnectorOperationSettings {
|
|
13
19
|
chunkSize?: number;
|
|
14
20
|
encodingId: string;
|
|
@@ -18,14 +24,12 @@ interface AuditContentSettings extends ConnectorOperationSettings {
|
|
|
18
24
|
interface AuditContentResult {
|
|
19
25
|
contentAuditConfig: DataViewContentAuditConfig;
|
|
20
26
|
}
|
|
21
|
-
type ConnectorInterfaceResult = AuditContentResult | DataViewPreviewConfig | ListResult | RetrieveRecordsResult;
|
|
22
27
|
/** Connector callback data. */
|
|
23
28
|
interface ConnectorCallbackData {
|
|
24
29
|
typeId: string;
|
|
25
30
|
properties: Record<string, unknown>;
|
|
26
31
|
}
|
|
27
|
-
type ProcessContextRequest = (id: string, contextConfig: ContextConfig, settings: ContextOperationSettings, callback?: (callbackData: ConnectorCallbackData) => void) => Promise<
|
|
28
|
-
type ContextInterfaceResult = AuditContentResult | DataViewPreviewConfig | ListResult | RetrieveRecordsResult;
|
|
32
|
+
type ProcessContextRequest = (id: string, contextConfig: ContextConfig, settings: ContextOperationSettings, callback?: (callbackData: ConnectorCallbackData) => void) => Promise<unknown>;
|
|
29
33
|
type ProcessTestRequest = (settings: TestSettings) => Promise<Record<string, unknown>>;
|
|
30
34
|
interface TestSettings {
|
|
31
35
|
action?: string;
|
|
@@ -45,4 +49,4 @@ interface EngineWorker {
|
|
|
45
49
|
processTestRequest: ProcessTestRequest;
|
|
46
50
|
}
|
|
47
51
|
/** Exports. */
|
|
48
|
-
export type { AuditContentSettings, AuditContentResult, ConnectorCallbackData,
|
|
52
|
+
export type { AuditContentSettings, AuditContentResult, ConnectorCallbackData, EngineConfig, EngineInterface, EngineWorker, EngineInitialiseSettings, TestSettings };
|
|
@@ -4,11 +4,6 @@
|
|
|
4
4
|
/** Interfaces/Types */
|
|
5
5
|
export type LocaleCode = 'en-au' | 'en-gb' | 'en-us' | 'es-es';
|
|
6
6
|
export type LocalisedString = Record<LocaleCode, string>;
|
|
7
|
-
/** Interfaces/Types - Component */
|
|
8
|
-
/** Schemas - Component */
|
|
9
|
-
export { componentConfigSchema } from './component';
|
|
10
|
-
/** Schemas - Connector */
|
|
11
|
-
export { connectorConfigSchema } from './component/connector/connectorConfig.schema';
|
|
12
7
|
/** Interfaces/Types - Context. */
|
|
13
8
|
export { contextConfigSchema } from './component/context';
|
|
14
9
|
export type { Context, ContextConfig, ContextLocalisedConfig, ContextListSettings, ContextListResult, ContextOperation, ContextCallbackData } from './component/context';
|
|
@@ -34,11 +29,6 @@ export type { DataFormatId, EncodingConfig, RecordDelimiterId, ValueDelimiterId
|
|
|
34
29
|
export type { DataViewConfig, DataViewContentAuditConfig, DataViewLocalisedConfig, DataViewPreviewConfig, DataViewRelationshipsAuditConfig, ParsedValue } from './component/dataView';
|
|
35
30
|
/** Interfaces/Types - Dimension. */
|
|
36
31
|
export type { DimensionConfig, DimensionLocalisedConfig } from './component/dimension';
|
|
37
|
-
/** Interfaces/Types - Engine. */
|
|
38
|
-
/** Interfaces/Types */
|
|
39
|
-
export type { SerialisedError } from './errors';
|
|
40
|
-
/** Errors */
|
|
41
|
-
/** Utilities */
|
|
42
32
|
/** Interfaces/Types - Event query. */
|
|
43
33
|
export type { EventQueryConfig, EventQueryLocalisedConfig } from './component/eventQuery';
|
|
44
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>",
|