@datapos/datapos-shared 0.3.452 → 0.3.454

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,28 +1,55 @@
1
1
  import { LiteralSchema, UnionSchema } from 'valibot';
2
+ /**
3
+ *
4
+ */
2
5
  type LiteralUnionSchema<T extends readonly string[]> = UnionSchema<{
3
6
  [K in keyof T]: LiteralSchema<T[K], undefined>;
4
7
  }, undefined>;
8
+ /**
9
+ *
10
+ */
5
11
  declare const literalUnion: <const T extends readonly string[]>(values: T) => LiteralUnionSchema<T>;
12
+ /**
13
+ *
14
+ */
6
15
  declare const localisedStringSchema: import('valibot').ObjectSchema<{
7
16
  readonly 'en-au': import('valibot').StringSchema<undefined>;
8
17
  readonly 'en-gb': import('valibot').StringSchema<undefined>;
9
18
  readonly 'en-us': import('valibot').StringSchema<undefined>;
10
19
  readonly 'es-es': import('valibot').StringSchema<undefined>;
11
20
  }, undefined>;
21
+ /**
22
+ *
23
+ */
12
24
  declare const partialLocalisedStringSchema: import('valibot').ObjectSchema<{
13
25
  readonly 'en-au': import('valibot').OptionalSchema<import('valibot').StringSchema<undefined>, undefined>;
14
26
  readonly 'en-gb': import('valibot').OptionalSchema<import('valibot').StringSchema<undefined>, undefined>;
15
27
  readonly 'en-us': import('valibot').OptionalSchema<import('valibot').StringSchema<undefined>, undefined>;
16
28
  readonly 'es-es': import('valibot').OptionalSchema<import('valibot').StringSchema<undefined>, undefined>;
17
29
  }, undefined>;
30
+ /**
31
+ *
32
+ */
18
33
  declare const componentStatusColorIdSchema: LiteralUnionSchema<readonly ["amber", "green", "red", "other"]>;
34
+ /**
35
+ *
36
+ */
19
37
  declare const componentStatusIdSchema: LiteralUnionSchema<readonly ["alpha", "beta", "generalAvailability", "notApplicable", "preAlpha", "proposed", "releaseCandidate", "unavailable", "underReview"]>;
38
+ /**
39
+ *
40
+ */
20
41
  declare const componentTypeIdSchema: LiteralUnionSchema<readonly ["app", "connector", "connectorConnection", "context", "contextModelGroup", "contextModel", "contextModelDimensionGroup", "contextModelDimension", "contextModelDimensionHierarchy", "contextModelEntityGroup", "contextModelEntity", "contextModelEntityDataItem", "contextModelEntityEvent", "contextModelEntityPrimaryMeasure", "contextModelSecondaryMeasureGroup", "contextModelSecondaryMeasure", "dataView", "dimension", "engine", "eventQuery", "presenter", "presenterPresentation", "tool"]>;
42
+ /**
43
+ *
44
+ */
21
45
  declare const componentStatusSchema: import('valibot').ObjectSchema<{
22
46
  readonly id: import('valibot').StringSchema<undefined>;
23
47
  readonly color: LiteralUnionSchema<readonly ["amber", "green", "red", "other"]>;
24
48
  readonly label: import('valibot').StringSchema<undefined>;
25
49
  }, undefined>;
50
+ /**
51
+ *
52
+ */
26
53
  declare const componentConfigCoreFields: {
27
54
  readonly id: import('valibot').StringSchema<undefined>;
28
55
  readonly label: import('valibot').ObjectSchema<{
@@ -48,6 +75,9 @@ declare const componentConfigCoreFields: {
48
75
  }, undefined>, undefined>;
49
76
  readonly statusId: LiteralUnionSchema<readonly ["alpha", "beta", "generalAvailability", "notApplicable", "preAlpha", "proposed", "releaseCandidate", "unavailable", "underReview"]>;
50
77
  };
78
+ /**
79
+ *
80
+ */
51
81
  declare const componentConfigSchema: import('valibot').ObjectSchema<{
52
82
  readonly typeId: LiteralUnionSchema<readonly ["app", "connector", "connectorConnection", "context", "contextModelGroup", "contextModel", "contextModelDimensionGroup", "contextModelDimension", "contextModelDimensionHierarchy", "contextModelEntityGroup", "contextModelEntity", "contextModelEntityDataItem", "contextModelEntityEvent", "contextModelEntityPrimaryMeasure", "contextModelSecondaryMeasureGroup", "contextModelSecondaryMeasure", "dataView", "dimension", "engine", "eventQuery", "presenter", "presenterPresentation", "tool"]>;
53
83
  readonly id: import('valibot').StringSchema<undefined>;
@@ -74,6 +104,9 @@ declare const componentConfigSchema: import('valibot').ObjectSchema<{
74
104
  }, undefined>, undefined>;
75
105
  readonly statusId: LiteralUnionSchema<readonly ["alpha", "beta", "generalAvailability", "notApplicable", "preAlpha", "proposed", "releaseCandidate", "unavailable", "underReview"]>;
76
106
  }, undefined>;
107
+ /**
108
+ *
109
+ */
77
110
  declare const componentReferenceSchema: import('valibot').ObjectSchema<{
78
111
  readonly id: import('valibot').StringSchema<undefined>;
79
112
  readonly label: import('valibot').ObjectSchema<{
@@ -93,5 +126,4 @@ declare const componentReferenceSchema: import('valibot').ObjectSchema<{
93
126
  readonly order: import('valibot').NumberSchema<undefined>;
94
127
  readonly path: import('valibot').StringSchema<undefined>;
95
128
  }, undefined>;
96
- /** Exports. */
97
129
  export { componentConfigCoreFields, componentConfigSchema, componentReferenceSchema, componentStatusColorIdSchema, componentStatusIdSchema, componentStatusSchema, componentTypeIdSchema, literalUnion, localisedStringSchema, partialLocalisedStringSchema };
@@ -1,5 +1,12 @@
1
1
  import { ComponentConfig } from '..';
2
2
  import { ConnectorConfig } from '.';
3
+ /** Connection configuration. */
4
+ interface ConnectionConfig extends ComponentConfig {
5
+ authorisation: Record<string, ConnectionAuthorisationConfig>;
6
+ connectorConfig: ConnectorConfig;
7
+ lastVerifiedAt: number;
8
+ notation?: string;
9
+ }
3
10
  /** Connection authorisation configuration. */
4
11
  interface ConnectionAuthorisationConfig {
5
12
  accessToken: string;
@@ -11,13 +18,6 @@ interface ConnectionAuthorisationConfig {
11
18
  tokenType: string;
12
19
  uid: string;
13
20
  }
14
- /** Connection configuration. */
15
- interface ConnectionConfig extends ComponentConfig {
16
- authorisation: Record<string, ConnectionAuthorisationConfig>;
17
- connectorConfig: ConnectorConfig;
18
- lastVerifiedAt: number;
19
- notation?: string;
20
- }
21
21
  /** Connection node configuration. */
22
22
  interface ConnectionNodeConfig {
23
23
  childCount?: number;
@@ -8,6 +8,9 @@
8
8
  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>;
9
9
  /** Connector data pipeline usage identifiers. */
10
10
  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>;
11
+ /**
12
+ *
13
+ */
11
14
  declare const connectorCategoryConfigSchema: import('valibot').ObjectSchema<{
12
15
  readonly id: import('valibot').StringSchema<undefined>;
13
16
  readonly label: import('valibot').ObjectSchema<{
@@ -74,5 +77,4 @@ declare const connectorConfigSchema: import('valibot').ObjectSchema<{
74
77
  }, undefined>, undefined>;
75
78
  readonly statusId: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"alpha", undefined>, import('valibot').LiteralSchema<"beta", undefined>, import('valibot').LiteralSchema<"generalAvailability", undefined>, import('valibot').LiteralSchema<"notApplicable", undefined>, import('valibot').LiteralSchema<"preAlpha", undefined>, import('valibot').LiteralSchema<"proposed", undefined>, import('valibot').LiteralSchema<"releaseCandidate", undefined>, import('valibot').LiteralSchema<"unavailable", undefined>, import('valibot').LiteralSchema<"underReview", undefined>], undefined>;
76
79
  }, undefined>;
77
- /** Exports. */
78
80
  export { connectorCategoryConfigSchema, connectorConfigSchema, connectorOperationNameSchema, connectorUsageIdSchema };
@@ -12,21 +12,66 @@ interface ConnectorInterface extends Component {
12
12
  abortController: AbortController | undefined;
13
13
  readonly config: ConnectorConfig;
14
14
  readonly toolConfigs: ToolConfig[];
15
+ /**
16
+ * Abort the active long running operation.
17
+ */
15
18
  abortOperation?(connector: ConnectorInterface): void;
19
+ /**
20
+ * Authenticate a specified connection.
21
+ */
16
22
  authenticateConnection?(accountId: string, windowCenterX: number, windowCenterY: number): Window;
23
+ /**
24
+ * Create an object for a specified connection.
25
+ */
17
26
  createObject?(connector: ConnectorInterface, options: CreateObjectOptions): Promise<void>;
27
+ /**
28
+ * Describe a specified connection.
29
+ */
18
30
  describeConnection?(connector: ConnectorInterface, options: DescribeConnectionOptions): Promise<DescribeConnectionResult>;
31
+ /**
32
+ * Drop (delete) an object for a specified connection.
33
+ */
19
34
  dropObject?(connector: ConnectorInterface, options: DropObjectOptions): Promise<void>;
35
+ /**
36
+ * Find an object for a specified connection.
37
+ */
20
38
  findObject?(connector: ConnectorInterface, options: FindObjectFolderPathOptions): Promise<string | null>;
39
+ /**
40
+ * Get a reader that can retrieve all records from an object for a specified connection.
41
+ */
21
42
  getReadableStream?(connector: ConnectorInterface, options: GetReadableStreamOptions): Promise<ReadableStream<Uint8Array>>;
43
+ /**
44
+ * Get a record for an object for a specified connection.
45
+ */
22
46
  getRecord?(connector: ConnectorInterface, options: GetRecordOptions): Promise<GetRecordResult>;
47
+ /**
48
+ * List nodes in a folder for a specified connection.
49
+ */
23
50
  listNodes?(connector: ConnectorInterface, options: ListNodesOptions): Promise<ListNodesResult>;
51
+ /**
52
+ * Preview an object for a specified connection.
53
+ */
24
54
  previewObject?(connector: ConnectorInterface, options: PreviewObjectOptions): Promise<DataViewPreviewConfig>;
55
+ /**
56
+ * Remove one or more records from an object for a specified connection.
57
+ */
25
58
  removeRecords?(connector: ConnectorInterface, options: RemoveRecordsOptions): Promise<void>;
59
+ /**
60
+ * Retrieve all chunks from an object for a specified connection.
61
+ */
26
62
  retrieveChunks?(connector: ConnectorInterface, options: RetrieveChunksOptions, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: () => void): Promise<void>;
63
+ /**
64
+ * Retrieve all records from an object for a specified connection.
65
+ */
27
66
  retrieveRecords?(connector: ConnectorInterface, options: RetrieveRecordsOptions, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveRecordsSummary) => void): Promise<void>;
67
+ /**
68
+ * Upsert one or more records into an object for a specified connection.
69
+ */
28
70
  upsertRecords?(connector: ConnectorInterface, options: UpsertRecordsOptions): Promise<void>;
29
71
  }
72
+ /**
73
+ *
74
+ */
30
75
  type ConnectorConstructor = new (EngineUtilities: EngineUtilities, toolConfigs: ToolConfig[]) => ConnectorInterface;
31
76
  /**
32
77
  * Operation names a connector may support.
@@ -145,11 +190,30 @@ interface RetrieveRecordsOptions extends ConnectorOperationOptions {
145
190
  valueDelimiterId: ValueDelimiterId;
146
191
  }
147
192
  interface RetrieveRecordsSummary {
193
+ /**
194
+ * Number of processed bytes.
195
+ */
148
196
  byteCount: number;
197
+ /**
198
+ * Count the number of lines being fully commented.
199
+ */
149
200
  commentLineCount: number;
201
+ /**
202
+ * Count the number of processed empty lines; work only with the skip_empty_lines option or an error will be thrown
203
+ * if an empty line is found.
204
+ */
150
205
  emptyLineCount: number;
206
+ /**
207
+ * Number of lines encountered in the source dataset, start at 1 for the first line.
208
+ */
151
209
  lineCount: number;
210
+ /**
211
+ * Number of non uniform records when relax_column_count is true.
212
+ */
152
213
  nonUniformRecordCount: number;
214
+ /**
215
+ * Count the number of processed records.
216
+ */
153
217
  recordCount: number;
154
218
  }
155
219
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Context schema (drafted by Copilot).
2
+ * Context schema.
3
3
  */
4
4
  export declare const contextConfigSchema: import('valibot').ObjectSchema<{
5
5
  readonly typeId: import('valibot').LiteralSchema<"context", undefined>;
@@ -12,10 +12,6 @@ export type ContextListOptions = object;
12
12
  export interface ContextListResult {
13
13
  models: ContextModelGroupConfig[];
14
14
  }
15
- export interface ContextCallbackData {
16
- typeId: string;
17
- properties: Record<string, unknown>;
18
- }
19
15
  export type ContextConfig = InferOutput<typeof contextConfigSchema>;
20
16
  export interface ContextConfig1 extends ModuleConfig {
21
17
  models: ContextModelGroupConfig[];
@@ -38,10 +38,7 @@ interface DataViewPreviewConfig {
38
38
  fileType: FileTypeResult | undefined;
39
39
  hasHeaders: boolean | undefined;
40
40
  recordDelimiterId?: RecordDelimiterId;
41
- records: {
42
- isValid: boolean;
43
- value: ParsedValue | undefined;
44
- }[][];
41
+ records: ParseResult[][];
45
42
  size: number;
46
43
  text: string;
47
44
  valueDelimiterId?: ValueDelimiterId;
@@ -69,5 +66,11 @@ interface ParseResult {
69
66
  type DataFormatId = 'dtv' | 'e/e' | 'json' | 'spss' | 'xls' | 'xlsx' | 'xml';
70
67
  type RecordDelimiterId = '\n' | '\r' | '\r\n';
71
68
  type ValueDelimiterId = '' | ':' | ',' | '!' | '0x1E' | ';' | ' ' | '\t' | '_' | '0x1F' | '|';
69
+ type DataTypeId = 'boolean' | 'numeric' | 'string' | 'temporal';
70
+ type NumericTypeId = 'bigint' | 'integer' | 'decimal';
71
+ type NumericUnitsId = 'currency' | 'percentage' | 'plain';
72
+ type StringTypeId = 'email' | 'ipv4' | 'ipv6' | 'ulid' | 'uuid' | 'url' | 'plain';
73
+ type TemporalTypeId = 'date' | 'dateTime' | 'time';
72
74
  export { ORDERED_VALUE_DELIMITER_IDS };
73
- export type { DataFormatId, DataViewContentAuditConfig, DataViewConfig, DataViewPreviewConfig, ParseResult, ParsedValue, RecordDelimiterId, ValueDelimiterId };
75
+ export type { DataFormatId, DataViewContentAuditConfig, DataViewConfig, DataViewPreviewConfig, ParseResult, RecordDelimiterId, ValueDelimiterId };
76
+ export type { DataTypeId, NumericTypeId, NumericUnitsId, StringTypeId, TemporalTypeId };
@@ -1,9 +1,13 @@
1
1
  /**
2
2
  * Module configuration schema.
3
3
  */
4
- /** */
4
+ /**
5
+ *
6
+ */
5
7
  declare const moduleTypeIdSchema: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"app", undefined>, import('valibot').LiteralSchema<"engine", undefined>, import('valibot').LiteralSchema<"connector", undefined>, import('valibot').LiteralSchema<"context", undefined>, import('valibot').LiteralSchema<"presenter", undefined>, import('valibot').LiteralSchema<"tool", undefined>], undefined>;
6
- /** */
8
+ /**
9
+ *
10
+ */
7
11
  declare const moduleConfigCoreFields: {
8
12
  readonly version: import('valibot').StringSchema<undefined>;
9
13
  readonly id: import('valibot').StringSchema<undefined>;
@@ -30,7 +34,9 @@ declare const moduleConfigCoreFields: {
30
34
  }, undefined>, undefined>;
31
35
  readonly statusId: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"alpha", undefined>, import('valibot').LiteralSchema<"beta", undefined>, import('valibot').LiteralSchema<"generalAvailability", undefined>, import('valibot').LiteralSchema<"notApplicable", undefined>, import('valibot').LiteralSchema<"preAlpha", undefined>, import('valibot').LiteralSchema<"proposed", undefined>, import('valibot').LiteralSchema<"releaseCandidate", undefined>, import('valibot').LiteralSchema<"unavailable", undefined>, import('valibot').LiteralSchema<"underReview", undefined>], undefined>;
32
36
  };
33
- /** */
37
+ /**
38
+ *
39
+ */
34
40
  declare const moduleConfigSchema: import('valibot').ObjectSchema<{
35
41
  readonly typeId: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"app", undefined>, import('valibot').LiteralSchema<"engine", undefined>, import('valibot').LiteralSchema<"connector", undefined>, import('valibot').LiteralSchema<"context", undefined>, import('valibot').LiteralSchema<"presenter", undefined>, import('valibot').LiteralSchema<"tool", undefined>], undefined>;
36
42
  readonly version: import('valibot').StringSchema<undefined>;
@@ -58,5 +64,4 @@ declare const moduleConfigSchema: import('valibot').ObjectSchema<{
58
64
  }, undefined>, undefined>;
59
65
  readonly statusId: import('valibot').UnionSchema<readonly [import('valibot').LiteralSchema<"alpha", undefined>, import('valibot').LiteralSchema<"beta", undefined>, import('valibot').LiteralSchema<"generalAvailability", undefined>, import('valibot').LiteralSchema<"notApplicable", undefined>, import('valibot').LiteralSchema<"preAlpha", undefined>, import('valibot').LiteralSchema<"proposed", undefined>, import('valibot').LiteralSchema<"releaseCandidate", undefined>, import('valibot').LiteralSchema<"unavailable", undefined>, import('valibot').LiteralSchema<"underReview", undefined>], undefined>;
60
66
  }, undefined>;
61
- /** Exports. */
62
67
  export { moduleConfigCoreFields, moduleConfigSchema, moduleTypeIdSchema };
@@ -3,7 +3,7 @@ import { EncodingTypeConfig } from '../encoding';
3
3
  import { ModuleConfig } from '../component/module';
4
4
  import { ToolConfig } from '../component/tool';
5
5
  import { ConnectionColumnConfig, ConnectorOperationOptions } from '../component/connector';
6
- import { ContextCallbackData, ContextConfig, ContextOperationOptions } from '../component/context';
6
+ import { ContextConfig, ContextOperationOptions } from '../component/context';
7
7
  import { DataViewContentAuditConfig, ParseResult, ValueDelimiterId } from '../component/dataView';
8
8
  /**
9
9
  * Engine runtime interface.
@@ -17,8 +17,8 @@ interface EngineRuntimeInterface {
17
17
  */
18
18
  interface EngineWorkerInterface {
19
19
  initialise: (options: EngineWorkerInitialiseOptions) => Promise<void>;
20
- processConnectorRequest: (id: string, connectionConfig: ConnectionConfig, options: ConnectorOperationOptions, callback?: (callbackData: ConnectorCallbackData) => void) => Promise<unknown>;
21
- processContextRequest: (id: string, contextConfig: ContextConfig, options: ContextOperationOptions, callback?: (callbackData: ContextCallbackData) => void) => Promise<unknown>;
20
+ processConnectorRequest: (id: string, connectionConfig: ConnectionConfig, options: ConnectorOperationOptions, callback?: (callbackData: EngineCallbackData) => void) => Promise<unknown>;
21
+ processContextRequest: (id: string, contextConfig: ContextConfig, options: ContextOperationOptions, callback?: (callbackData: EngineCallbackData) => void) => Promise<unknown>;
22
22
  processTestRequest: (settings: TestSettings) => Promise<Record<string, unknown>>;
23
23
  }
24
24
  /** Engine worker initialise options. */
@@ -42,9 +42,9 @@ interface EngineConfig extends ModuleConfig {
42
42
  typeId: 'engine';
43
43
  }
44
44
  /**
45
- * Connector callback data.
45
+ * Engine callback data.
46
46
  */
47
- interface ConnectorCallbackData {
47
+ interface EngineCallbackData {
48
48
  typeId: string;
49
49
  properties: Record<string, unknown>;
50
50
  }
@@ -67,4 +67,4 @@ interface TestSettings {
67
67
  hasHeaders?: boolean;
68
68
  readable: ReadableStream<Uint8Array>;
69
69
  }
70
- export type { AuditObjectContentOptions, AuditObjectContentResult, ConnectorCallbackData, EngineConfig, EngineRuntimeInterface, EngineUtilities, EngineWorkerInitialiseOptions, EngineWorkerInterface, TestSettings };
70
+ export type { AuditObjectContentOptions, AuditObjectContentResult, EngineCallbackData, EngineConfig, EngineRuntimeInterface, EngineUtilities, EngineWorkerInitialiseOptions, EngineWorkerInterface, TestSettings };
@@ -3,7 +3,7 @@
3
3
  */
4
4
  /** Interfaces/Types - Context. */
5
5
  export { contextConfigSchema } from './component/context';
6
- export type { Context, ContextConfig, ContextLocalisedConfig, ContextListOptions, ContextListResult, ContextOperation, ContextCallbackData } from './component/context';
6
+ export type { Context, ContextConfig, ContextLocalisedConfig, ContextListOptions, ContextListResult, ContextOperation } from './component/context';
7
7
  /** Interfaces/Types - Context model. */
8
8
  export type { ContextModelGroupConfig, ContextModelGroupLocalisedConfig, ContextModelConfig, ContextModelLocalisedConfig } from './component/context';
9
9
  /** Interfaces/Types - Context model dimension. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.452",
3
+ "version": "0.3.454",
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>",