@datapos/datapos-shared 0.3.241 → 0.3.243

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,6 +1,6 @@
1
- import { Module } from '../../module';
2
- import { Component, ComponentConfig, ComponentRef } from '..';
3
- export interface Context extends Module, Component {
1
+ import { LocalisedString } from '../../index';
2
+ import { Component, ComponentConfig, ComponentRef, ModuleConfig } from '..';
3
+ export interface Context extends Component {
4
4
  readonly config: ContextConfig;
5
5
  list(settings?: ContextListSettings): Promise<ContextListResult>;
6
6
  }
@@ -13,10 +13,11 @@ export type ContextCallbackData = {
13
13
  typeId: string;
14
14
  properties: Record<string, unknown>;
15
15
  };
16
- export interface ContextConfig extends ComponentConfig {
16
+ export interface ContextConfig extends ModuleConfig {
17
17
  models: ContextModelGroupConfig[];
18
- version: string;
18
+ typeId: 'context';
19
19
  }
20
+ export type ContextModuleOperation = 'list';
20
21
  export type ContextLocalisedConfig = Omit<ContextConfig, 'label' | 'description'> & {
21
22
  label: string;
22
23
  description: string;
@@ -41,8 +42,8 @@ export type ContextModelLocalisedConfig = Omit<ContextModelConfig, 'label' | 'de
41
42
  };
42
43
  export interface ContextModelDimensionGroupConfig {
43
44
  id: string;
44
- label: Record<string, string>;
45
- description?: Record<string, unknown>;
45
+ label: Partial<LocalisedString>;
46
+ description: Partial<LocalisedString>;
46
47
  dimensionRefs: ComponentRef[];
47
48
  }
48
49
  export type ContextModelDimensionGroupLocalisedConfig = Omit<ContextModelDimensionGroupConfig, 'label' | 'description'> & {
@@ -51,7 +52,7 @@ export type ContextModelDimensionGroupLocalisedConfig = Omit<ContextModelDimensi
51
52
  };
52
53
  export interface ContextModelDimensionConfig {
53
54
  id: string;
54
- label: Record<string, string>;
55
+ label: Partial<LocalisedString>;
55
56
  hierarchies: ContextModelDimensionHierarchyConfig[];
56
57
  }
57
58
  export type ContextModelDimensionLocalisedConfig = Omit<ContextModelDimensionConfig, 'label' | 'description'> & {
@@ -60,7 +61,7 @@ export type ContextModelDimensionLocalisedConfig = Omit<ContextModelDimensionCon
60
61
  };
61
62
  export interface ContextModelDimensionHierarchyConfig {
62
63
  id: string;
63
- label: Record<string, string>;
64
+ label: Partial<LocalisedString>;
64
65
  }
65
66
  export type ContextModelDimensionHierarchyLocalisedConfig = Omit<ContextModelDimensionHierarchyConfig, 'label' | 'description'> & {
66
67
  label: string;
@@ -68,7 +69,7 @@ export type ContextModelDimensionHierarchyLocalisedConfig = Omit<ContextModelDim
68
69
  };
69
70
  export interface ContextModelEntityGroupConfig {
70
71
  id: string;
71
- label: Record<string, string>;
72
+ label: Partial<LocalisedString>;
72
73
  description?: Record<string, unknown>;
73
74
  entityRefs: ComponentRef[];
74
75
  }
@@ -78,8 +79,8 @@ export type ContextModelEntityGroupLocalisedConfig = Omit<ContextModelEntityGrou
78
79
  };
79
80
  export interface ContextModelEntityConfig {
80
81
  id: string;
81
- label: Record<string, string>;
82
- labelPlural: Record<string, string>;
82
+ label: Partial<LocalisedString>;
83
+ labelPlural: Partial<LocalisedString>;
83
84
  dataItems: ContextModelEntityDataItemConfig[];
84
85
  events: ContextModelEntityEventConfig[];
85
86
  primaryMeasures: ContextModelEntityPrimaryMeasureConfig[];
@@ -90,7 +91,7 @@ export type ContextModelEntityLocalisedConfig = Omit<ContextModelEntityConfig, '
90
91
  };
91
92
  export interface ContextModelEntityDataItemConfig {
92
93
  id: string;
93
- label: Record<string, string>;
94
+ label: Partial<LocalisedString>;
94
95
  }
95
96
  export type ContextModelEntityDataItemLocalisedConfig = Omit<ContextModelEntityDataItemConfig, 'label' | 'description'> & {
96
97
  label: string;
@@ -107,7 +108,7 @@ export type ContextModelEntityEventLocalisedConfig = Omit<ContextModelEntityEven
107
108
  };
108
109
  export interface ContextModelEntityPrimaryMeasureConfig {
109
110
  id: string;
110
- label: Record<string, string>;
111
+ label: Partial<LocalisedString>;
111
112
  }
112
113
  export type ContextModelEntityPrimaryMeasureLocalisedConfig = Omit<ContextModelEntityPrimaryMeasureConfig, 'label' | 'description'> & {
113
114
  label: string;
@@ -115,7 +116,7 @@ export type ContextModelEntityPrimaryMeasureLocalisedConfig = Omit<ContextModelE
115
116
  };
116
117
  export interface ContextModelSecondaryMeasureGroupConfig {
117
118
  id: string;
118
- label: Record<string, string>;
119
+ label: Partial<LocalisedString>;
119
120
  description?: Record<string, unknown>;
120
121
  secondaryMeasureRefs: ComponentRef[];
121
122
  }
@@ -125,7 +126,7 @@ export type ContextModelSecondaryMeasureGroupLocalisedConfig = Omit<ContextModel
125
126
  };
126
127
  export interface ContextModelSecondaryMeasureConfig {
127
128
  id: string;
128
- label: Record<string, string>;
129
+ label: Partial<LocalisedString>;
129
130
  }
130
131
  export type ContextModelSecondaryMeasureLocalisedConfig = Omit<ContextModelSecondaryMeasureConfig, 'label' | 'description'> & {
131
132
  label: string;
@@ -19,6 +19,8 @@ export type ComponentRef = {
19
19
  id: string;
20
20
  label: Partial<LocalisedString>;
21
21
  description: Partial<LocalisedString>;
22
+ icon?: string;
23
+ iconDark?: string;
22
24
  order: number;
23
25
  path: string;
24
26
  };
@@ -29,4 +31,9 @@ export type ComponentStatus = {
29
31
  };
30
32
  export type ComponentStatusId = 'alpha' | 'beta' | 'generalAvailability' | 'notApplicable' | 'preAlpha' | 'proposed' | 'releaseCandidate' | 'unavailable' | 'underReview';
31
33
  export declare const getComponentStatus: (id: string, localeId?: LocaleCode) => ComponentStatus;
32
- 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 EngineModuleConfig 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';
@@ -42,7 +35,6 @@ export type { DimensionConfig, DimensionLocalisedConfig } from './component/dime
42
35
  export type { ConnectorInterfaceResult, ContextInterfaceResult, Engine, 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.241",
3
+ "version": "0.3.243",
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 {};