@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, settings: CreateSettings): Promise<void>;
29
- describeConnection?(connector: ConnectorInterface, settings: DescribeSettings): Promise<DescribeResult>;
30
- dropObject?(connector: ConnectorInterface, settings: DropSettings): Promise<void>;
31
- findObject?(connector: ConnectorInterface, settings: FindObjectFolderPathSettings): Promise<string | null>;
32
- getReadableStream?(connector: ConnectorInterface, settings: GetReadableStreamSettings): Promise<ReadableStream<Uint8Array<ArrayBuffer>>>;
33
- getRecord?(connector: ConnectorInterface, settings: GetRecordSettings): Promise<GetRecordResult>;
34
- listNodes?(connector: ConnectorInterface, settings: ListNodesSettings): Promise<ListNodesResult>;
35
- previewObject?(connector: ConnectorInterface, settings: PreviewObjectSettings): Promise<PreviewObjectResult>;
36
- removeRecords?(connector: ConnectorInterface, settings: RemoveSettings): Promise<void>;
37
- retrieveChunks?(connector: ConnectorInterface, settings: RetrieveChunksSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveChunksSummary) => void): Promise<void>;
38
- retrieveRecords?(connector: ConnectorInterface, settings: RetrieveRecordsSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void>;
39
- upsertRecords?(connector: ConnectorInterface, settings: UpsertSettings): Promise<void>;
40
- }
41
- /** Connector operation settings. */
42
- interface ConnectorOperationSettings {
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 settings. */
48
- interface FindObjectFolderPathSettings extends ConnectorOperationSettings {
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 settings. */
53
- interface GetReadableStreamSettings extends ConnectorOperationSettings {
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
- /** List nodes settings. */
65
- interface ListNodesSettings extends ConnectorOperationSettings {
66
- folderPath: string;
67
- limit?: number;
68
- offset?: number;
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
- /** Preview object settings. */
77
- interface PreviewObjectSettings extends ConnectorOperationSettings {
80
+ /** Retrieve records options and summary. */
81
+ interface RetrieveRecordsOptions extends ConnectorOperationOptions {
78
82
  chunkSize?: number;
79
- extension?: string;
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
- /** Retrieve records settings. */
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 DescribeSettings = ConnectorOperationSettings;
102
+ type DescribeOptions = ConnectorOperationOptions;
104
103
  interface DescribeResult {
105
104
  description: ConnectionDescription;
106
105
  }
107
- interface DropSettings extends ConnectorOperationSettings {
106
+ interface DropOptions extends ConnectorOperationOptions {
108
107
  path: string;
109
108
  }
110
- interface GetRecordSettings extends ConnectorOperationSettings {
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 RemoveSettings extends ConnectorOperationSettings {
116
+ interface RemoveOptions extends ConnectorOperationOptions {
118
117
  keys: string[];
119
118
  path: string;
120
119
  }
121
- interface RetrieveChunksSettings extends ConnectorOperationSettings {
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 UpsertSettings extends ConnectorOperationSettings {
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, ConnectorOperationSettings, ConnectorUsageId, CreateSettings, DropSettings, FindObjectFolderPathSettings, GetReadableStreamSettings, GetRecordResult, GetRecordSettings, ListNodesResult, ListNodesSettings, PreviewObjectResult, PreviewObjectSettings, RemoveSettings, RetrieveChunksSettings, RetrieveChunksSummary, RetrieveRecordsSettings, RetrieveRecordsSummary, UpsertSettings };
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 { ConnectorOperationSettings } from '../component/connector';
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: ConnectorOperationSettings, callback?: (callbackData: ContextCallbackData) => void) => Promise<unknown>;
18
- interface AuditContentSettings extends ConnectorOperationSettings {
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.405",
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>",