@datapos/datapos-shared 0.3.242 → 0.3.244

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/README.md CHANGED
@@ -43,8 +43,8 @@ The Data Positioning solution consists of the following modules. All modules, ex
43
43
  | Engine | ✔ | Implements the data positioning engine. |
44
44
  | Connector | ✔ | Implements a connector which handles one or more connections. |
45
45
  | Context | ✔ | Implements a context which defines one or more models. |
46
- | Informer | ✔ | Implements an informer which renders one or more documents. |
47
46
  | Presenter | ✔ | Implements a presenter which renders one or more presentations. |
47
+ | Tool | ✔ | Implements... |
48
48
 
49
49
  ### Components
50
50
 
@@ -82,13 +82,6 @@ Each module implements a set of components. All module component types extend th
82
82
  | ---------------------------------- | ------------- |
83
83
  | [Engine Types](./src/dimension.ts) | Engine types. |
84
84
 
85
- #### Informer Module Components
86
-
87
- | Item | Notes |
88
- | ----------------------------------- | ------------------------------------------------------------- |
89
- | [Informer Types](./src/informer.ts) | Informer types. The Informer type extends the Component type. |
90
- | [Recipe Types](./src/recipe.ts) | Recipe types. The Recipe type extends the Component type. |
91
-
92
85
  #### Presenter Module Components
93
86
 
94
87
  | Item | Notes |
@@ -1,14 +1,18 @@
1
1
  import { parse as csvParse } from 'csv-parse/browser/esm';
2
2
  import { parse as dateFnsParse } from 'date-fns';
3
3
  import { nanoid } from 'nanoid';
4
- import { Module } from '../../module';
5
4
  import { buildFetchError, OperationalError } from '../../errors';
6
- import { Component, ComponentConfig } from '..';
5
+ import { Component, ModuleConfig } from '..';
7
6
  import { ConnectionConfig, ConnectionDescription, ConnectionNodeConfig } from './connection';
8
7
  import { convertMillisecondsToTimestamp, LocalisedString } from '../../index';
9
8
  import { DataViewContentAuditConfig, ValueDelimiterId } from '../dataView';
10
9
  import { extractExtensionFromPath, extractNameFromPath, lookupMimeTypeForExtension } from '../../utilities';
11
- export interface Connector extends Module, Component {
10
+ type ConnectorModuleCategoryId = 'application' | 'curatedDataset' | 'database' | 'fileStore';
11
+ export type ConnectorModuleOperation = 'abortOperation' | 'authenticateConnection' | 'createObject' | 'describeConnection' | 'dropObject' | 'findObject' | 'getRecord' | 'listNodes' | 'previewObject' | 'removeRecords' | 'retrieveRecords' | 'upsertRecords';
12
+ export type ConnectorModuleUsageId = 'bidirectional' | 'destination' | 'source';
13
+ export declare const CONNECTOR_DESTINATION_OPERATIONS: string[];
14
+ export declare const CONNECTOR_SOURCE_OPERATIONS: string[];
15
+ export interface Connector extends Component {
12
16
  abortController?: AbortController | undefined;
13
17
  readonly config: ConnectorConfig;
14
18
  readonly connectionConfig: ConnectionConfig;
@@ -26,15 +30,16 @@ export interface Connector extends Module, Component {
26
30
  retrieveRecords?(connector: Connector, settings: RetrieveSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveSummary) => void): Promise<void>;
27
31
  upsertRecords?(connector: Connector, settings: UpsertSettings): Promise<void>;
28
32
  }
29
- export interface ConnectorConfig extends ComponentConfig {
33
+ export interface ConnectorConfig extends ModuleConfig {
30
34
  category?: ConnectorCategory;
31
- categoryId: string;
35
+ categoryId: ConnectorModuleCategoryId;
32
36
  implementations: Record<string, ConnectorImplementation>;
33
- usageId: 'bidirectional' | 'destination' | 'source';
37
+ operations: ConnectorModuleOperation[];
38
+ typeId: 'connector';
39
+ usageId: ConnectorModuleUsageId;
34
40
  vendorAccountURL?: string;
35
41
  vendorDocumentationURL?: string;
36
42
  vendorHomeURL?: string;
37
- version: string;
38
43
  }
39
44
  export type ConnectorLocalisedConfig = Omit<ConnectorConfig, 'label' | 'description'> & {
40
45
  label: string;
@@ -1,7 +1,6 @@
1
1
  import { LocalisedString } from '../../index';
2
- import { Module } from '../../module';
3
- import { Component, ComponentConfig, ComponentRef } from '..';
4
- export interface Context extends Module, Component {
2
+ import { Component, ComponentConfig, ComponentRef, ModuleConfig } from '..';
3
+ export interface Context extends Component {
5
4
  readonly config: ContextConfig;
6
5
  list(settings?: ContextListSettings): Promise<ContextListResult>;
7
6
  }
@@ -14,10 +13,11 @@ export type ContextCallbackData = {
14
13
  typeId: string;
15
14
  properties: Record<string, unknown>;
16
15
  };
17
- export interface ContextConfig extends ComponentConfig {
16
+ export interface ContextConfig extends ModuleConfig {
18
17
  models: ContextModelGroupConfig[];
19
- version: string;
18
+ typeId: 'context';
20
19
  }
20
+ export type ContextModuleOperation = 'list';
21
21
  export type ContextLocalisedConfig = Omit<ContextConfig, 'label' | 'description'> & {
22
22
  label: string;
23
23
  description: string;
@@ -31,4 +31,9 @@ export type ComponentStatus = {
31
31
  };
32
32
  export type ComponentStatusId = 'alpha' | 'beta' | 'generalAvailability' | 'notApplicable' | 'preAlpha' | 'proposed' | 'releaseCandidate' | 'unavailable' | 'underReview';
33
33
  export declare const getComponentStatus: (id: string, localeId?: LocaleCode) => ComponentStatus;
34
- export type ComponentTypeId = 'connector' | 'connectorConnection' | 'context' | 'contextModelGroup' | 'contextModel' | 'contextModelDimensionGroup' | 'contextModelDimension' | 'contextModelDimensionHierarchy' | 'contextModelEntityGroup' | 'contextModelEntity' | 'contextModelEntityDataItem' | 'contextModelEntityEvent' | 'contextModelEntityPrimaryMeasure' | 'contextModelSecondaryMeasureGroup' | 'contextModelSecondaryMeasure' | 'dataView' | 'dimension' | 'eventQuery' | 'presenter' | 'presenterPresentation' | 'informer' | 'informerDocument';
34
+ export type ComponentTypeId = 'app' | 'connector' | 'connectorConnection' | 'context' | 'contextModelGroup' | 'contextModel' | 'contextModelDimensionGroup' | 'contextModelDimension' | 'contextModelDimensionHierarchy' | 'contextModelEntityGroup' | 'contextModelEntity' | 'contextModelEntityDataItem' | 'contextModelEntityEvent' | 'contextModelEntityPrimaryMeasure' | 'contextModelSecondaryMeasureGroup' | 'contextModelSecondaryMeasure' | 'dataView' | 'dimension' | 'engine' | 'eventQuery' | 'presenter' | 'presenterPresentation' | 'tool';
35
+ export interface ModuleConfig extends ComponentConfig {
36
+ typeId: ModuleTypeId;
37
+ version: string;
38
+ }
39
+ export type ModuleTypeId = 'app' | 'engine' | 'connector' | 'context' | 'presenter' | 'tool';
@@ -1,14 +1,14 @@
1
- import { Module } from '../../module';
2
- import { Component, ComponentConfig, ComponentRef } from '..';
3
- export interface Presenter extends Module, Component {
1
+ import { Component, ComponentRef, ModuleConfig } from '..';
2
+ export interface Presenter extends Component {
4
3
  readonly config: PresenterConfig;
5
4
  list(): ComponentRef[];
6
5
  render(presentationPath: string, renderTo: HTMLElement, data?: unknown): Promise<void>;
7
6
  }
8
- export interface PresenterConfig extends ComponentConfig {
7
+ export interface PresenterConfig extends ModuleConfig {
9
8
  presentations: ComponentRef[];
10
- version: string;
9
+ typeId: 'presenter';
11
10
  }
11
+ export type PresenterModuleOperation = 'list' | 'render';
12
12
  export type PresenterLocalisedConfig = Omit<PresenterConfig, 'label' | 'description'> & {
13
13
  label: string;
14
14
  description: string;
@@ -0,0 +1,4 @@
1
+ import { ModuleConfig } from '..';
2
+ export interface ToolModuleConfig extends ModuleConfig {
3
+ typeId: 'tool';
4
+ }
@@ -1,14 +1,17 @@
1
1
  import { ConnectionConfig } from '../component/connector/connection';
2
- import { Module } from '../module';
3
2
  import { AuditContentResult, ConnectorCallbackData, ConnectorOperationSettings, InitialiseSettings, ListResult, RetrieveResult } from '../component/connector';
3
+ import { Component, ModuleConfig } from '../component';
4
4
  import { ContextCallbackData, ContextConfig, ContextOperationSettings } from '../component/context';
5
5
  import { DataViewPreviewConfig, EncodingConfig } from '../component/dataView';
6
+ export interface EngineConfig extends ModuleConfig {
7
+ typeId: 'engine';
8
+ }
6
9
  type InitialiseEngine = (settings: InitialiseSettings) => Promise<void>;
7
10
  type ProcessConnectorRequest = (id: string, connectionConfig: ConnectionConfig, settings: ConnectorOperationSettings, callback?: ((callbackData: ContextCallbackData) => void) | undefined) => Promise<ContextInterfaceResult>;
8
11
  export type ContextInterfaceResult = AuditContentResult | DataViewPreviewConfig | ListResult | RetrieveResult;
9
12
  type ProcessContextRequest = (id: string, contextConfig: ContextConfig, settings: ContextOperationSettings, callback?: ((callbackData: ConnectorCallbackData) => void) | undefined) => Promise<ConnectorInterfaceResult>;
10
13
  export type ConnectorInterfaceResult = AuditContentResult | DataViewPreviewConfig | ListResult | RetrieveResult;
11
- export interface Engine extends Module {
14
+ export interface Engine extends Component {
12
15
  getEncodingConfigs: (localeId: string) => EncodingConfig[];
13
16
  invokeWorker(errorEventCallback: (errorEvent: ErrorEvent) => void): EngineWorker;
14
17
  }
@@ -4,16 +4,9 @@
4
4
  export type LocaleCode = 'en-au' | 'en-gb' | 'en-us' | 'es-es';
5
5
  export type LocalisedString = Record<LocaleCode, string>;
6
6
  export type StatusColorId = 'amber' | 'green' | 'red' | 'other';
7
- export type { ModuleConfig } from './module';
8
- export type { AppModuleConfig } from './module';
9
- export type { ConnectorModuleConfig, ConnectorModuleOperation, ConnectorModuleUsageId } from './module';
10
- export type { ContextModuleConfig, ContextModuleOperation } from './module';
11
- export type { EngineModuleConfig } from './module';
12
- export type { InformerModuleConfig, InformerModuleOperation } from './module';
13
- export type { PresenterModuleConfig, PresenterModuleOperation } from './module';
14
- export type { ToolModuleConfig } from './module';
15
- export { CONNECTOR_DESTINATION_OPERATIONS, CONNECTOR_SOURCE_OPERATIONS } from './module';
16
- export type { ComponentConfig, ComponentRef, ComponentStatus, ComponentStatusId, ComponentTypeId } from './component';
7
+ export type { ComponentConfig, ComponentRef, ComponentStatus, ComponentStatusId, ComponentTypeId, ModuleConfig, ModuleTypeId } from './component';
8
+ export type { ConnectorModuleOperation, ConnectorModuleUsageId } from './component/connector';
9
+ export { CONNECTOR_DESTINATION_OPERATIONS, CONNECTOR_SOURCE_OPERATIONS } from './component/connector';
17
10
  export type { AuditContentResult, AuditContentSettings } from './component/connector';
18
11
  export type { Connector, ConnectorCallbackData, ConnectorConfig, ConnectorImplementation, ConnectorOperationSettings, ConnectorLocalisedConfig, ConnectorTools } from './component/connector';
19
12
  export type { CreateSettings } from './component/connector';
@@ -39,10 +32,9 @@ export type { ContextModelSecondaryMeasureGroupConfig, ContextModelSecondaryMeas
39
32
  export type { DataFormatId, EncodingConfig, RecordDelimiterId, ValueDelimiterId } from './component/dataView';
40
33
  export type { DataViewConfig, DataViewContentAuditConfig, DataViewLocalisedConfig, DataViewPreviewConfig, DataViewRelationshipsAuditConfig, ParsedValue } from './component/dataView';
41
34
  export type { DimensionConfig, DimensionLocalisedConfig } from './component/dimension';
42
- export type { ConnectorInterfaceResult, ContextInterfaceResult, Engine, EngineWorker } from './engine';
35
+ export type { ConnectorInterfaceResult, ContextInterfaceResult, Engine, EngineConfig, EngineWorker } from './engine';
43
36
  export type { SerialisedError } from './errors';
44
37
  export type { EventQueryConfig, EventQueryLocalisedConfig } from './component/eventQuery';
45
- export type { Informer, InformerConfig, InformerLocalisedConfig, InformerTools } from './component/informer';
46
38
  export type { Presenter, PresenterConfig, PresenterLocalisedConfig } from './component/presenter';
47
39
  export type { PresentationConfig, PresentationView } from './component/presenter/presentation';
48
40
  export type { PresentationCategoryId, PresentationCartesianTypeId, PresentationPolarTypeId, PresentationRangeTypeId, PresentationVisualConfig, PresentationVisualContentConfig, PresentationVisualViewConfig, PresentationVisualCartesianChartViewConfig, PresentationVisualChordDiagramViewConfig, PresentationVisualPeriodFlowBoundariesChartViewConfig, PresentationVisualPolarChartViewConfig, PresentationVisualRangeChartViewConfig, PresentationVisualSankeyDiagramViewConfig, PresentationVisualStreamGraphViewConfig, PresentationVisualValueTableViewConfig } from './component/presenter/presentation';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-shared",
3
- "version": "0.3.242",
3
+ "version": "0.3.244",
4
4
  "description": "A TypeScript library containing common declarations and utilities used across other Data Positioning repositories.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -1,3 +0,0 @@
1
- /**
2
- * Document composables, constants, errors, types/interfaces and utilities.
3
- */
@@ -1,16 +0,0 @@
1
- import { Module } from '../../module';
2
- import { Component, ComponentConfig, ComponentRef } from '..';
3
- export interface Informer extends Module, Component {
4
- readonly config: InformerConfig;
5
- readonly tools: InformerTools;
6
- list(): ComponentRef[];
7
- render(informerPath: string, renderTo: HTMLElement, data?: unknown): Promise<void>;
8
- }
9
- export interface InformerConfig extends ComponentConfig {
10
- version: string;
11
- }
12
- export type InformerLocalisedConfig = Omit<InformerConfig, 'label' | 'description'> & {
13
- label: string;
14
- description: string;
15
- };
16
- export type InformerTools = {};
@@ -1,19 +0,0 @@
1
- import { ComponentConfig } from '..';
2
- export interface Recipe {
3
- readonly config: RecipeConfig;
4
- list(path: string): RecipeItemConfig[];
5
- render(id: string, renderTo: string | HTMLElement): Promise<void>;
6
- }
7
- export interface RecipeConfig extends ComponentConfig {
8
- version: string;
9
- }
10
- export type RecipeLocalisedConfig = Omit<RecipeConfig, 'label' | 'description'> & {
11
- label: string;
12
- description: string;
13
- };
14
- export interface RecipeItemConfig {
15
- items?: RecipeItemConfig[];
16
- label: Record<string, string>;
17
- name: string;
18
- typeId: 'folder' | 'object';
19
- }
@@ -1,4 +0,0 @@
1
- import { ComponentConfig } from '..';
2
- export interface TutorialConfig extends ComponentConfig {
3
- placeholder?: string;
4
- }
@@ -1,56 +0,0 @@
1
- import { ContextModelGroupConfig } from '../component/context';
2
- import { LocalisedString } from '../index';
3
- export interface Module {
4
- }
5
- export interface ModuleConfig {
6
- id: string;
7
- label: Partial<LocalisedString>;
8
- description: Partial<LocalisedString>;
9
- statusId: unknown;
10
- typeId: ModuleTypeId;
11
- version: string;
12
- }
13
- type ModuleTypeId = 'app' | 'engine' | 'connector' | 'context' | 'informer' | 'presenter' | 'tool';
14
- export interface AppModuleConfig extends ModuleConfig {
15
- typeId: 'app';
16
- }
17
- export interface EngineModuleConfig extends ModuleConfig {
18
- typeId: 'engine';
19
- }
20
- export interface ConnectorModuleConfig extends ModuleConfig {
21
- categoryId: ConnectorModuleCategoryId;
22
- implementations: Record<string, unknown>;
23
- icon: string;
24
- iconDark: string;
25
- operations: ConnectorModuleOperation[];
26
- typeId: 'connector';
27
- usageId: ConnectorModuleUsageId | null;
28
- vendorAccountURL?: string;
29
- vendorDocumentationURL?: string;
30
- vendorHomeURL?: string;
31
- }
32
- type ConnectorModuleCategoryId = 'application' | 'curatedDataset' | 'database' | 'fileStore';
33
- export type ConnectorModuleOperation = 'abortOperation' | 'authenticateConnection' | 'createObject' | 'describeConnection' | 'dropObject' | 'findObject' | 'getRecord' | 'listNodes' | 'previewObject' | 'removeRecords' | 'retrieveRecords' | 'upsertRecords';
34
- export type ConnectorModuleUsageId = 'bidirectional' | 'destination' | 'source';
35
- export declare const CONNECTOR_DESTINATION_OPERATIONS: string[];
36
- export declare const CONNECTOR_SOURCE_OPERATIONS: string[];
37
- export interface ContextModuleConfig extends ModuleConfig {
38
- operations: ContextModuleOperation[];
39
- models: ContextModelGroupConfig[];
40
- typeId: 'context';
41
- }
42
- export type ContextModuleOperation = 'list';
43
- export interface InformerModuleConfig extends ModuleConfig {
44
- operations: InformerModuleOperation[];
45
- typeId: 'informer';
46
- }
47
- export type InformerModuleOperation = 'list' | 'render';
48
- export interface PresenterModuleConfig extends ModuleConfig {
49
- operations: PresenterModuleOperation[];
50
- typeId: 'presenter';
51
- }
52
- export type PresenterModuleOperation = 'list' | 'render';
53
- export interface ToolModuleConfig extends ModuleConfig {
54
- typeId: 'tool';
55
- }
56
- export {};