@datapos/datapos-shared 0.3.77 → 0.3.78

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.
@@ -23,4 +23,4 @@ export type ComponentStatus = {
23
23
  };
24
24
  export type ComponentStatusId = 'alpha' | 'beta' | 'generalAvailability' | 'notApplicable' | 'preAlpha' | 'proposed' | 'releaseCandidate' | 'unavailable' | 'underReview';
25
25
  export declare const getComponentStatus: (id: string, localeId?: string) => ComponentStatus;
26
- export type ComponentTypeId = 'app' | 'engine' | 'connector' | 'connectorConnection' | 'context' | 'contextFocus' | 'contextFocusModel' | 'contextFocusModelDimension' | 'contextFocusModelDimensionHierarchy' | 'contextFocusModelEntity' | 'contextFocusModelEntityDataItems' | 'contextFocusModelEntityEvent' | 'contextFocusModelEntityPrimaryMeasure' | 'contextFocusModelSecondaryMeasure' | 'dataView' | 'dimension' | 'eventQuery' | 'presenter' | 'presenterPresentation' | 'informer' | 'informerDocument';
26
+ export type ComponentTypeId = 'app' | 'engine' | 'connector' | 'connectorConnection' | 'context' | 'contextFocus' | 'contextModel' | 'contextModelDimensionGroup' | 'contextModelDimension' | 'contextModelDimensionHierarchy' | 'contextModelEntityGroup' | 'contextModelEntity' | 'contextModelEntityDataItems' | 'contextModelEntityEvent' | 'contextModelEntityPrimaryMeasure' | 'contextModelSecondaryMeasureGroup' | 'contextModelSecondaryMeasure' | 'contextModelPresentationGroup' | 'contextModelPresentation' | 'dataView' | 'dimension' | 'eventQuery' | 'presenter' | 'presenterPresentation' | 'informer' | 'informerDocument';
@@ -4,7 +4,7 @@ import { nanoid } from 'nanoid';
4
4
  import { ComponentConfig } from './component';
5
5
  import { buildFetchError, OperationalError } from './errors';
6
6
  import { ConnectionConfig, ConnectionDescription, ConnectionNodeConfig } from './connection';
7
- import { convertMillisecondsToTimestamp } from '.';
7
+ import { convertMillisecondsToTimestamp } from './index';
8
8
  import { DataViewContentAuditConfig, ValueDelimiterId } from './dataView';
9
9
  import { extractExtensionFromPath, extractNameFromPath, lookupMimeTypeForExtension } from './utilities';
10
10
  export interface Connector {
@@ -25,25 +25,6 @@ export interface Connector {
25
25
  retrieveRecords?(connector: Connector, settings: RetrieveSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveSummary) => void): Promise<void>;
26
26
  upsertRecords?(connector: Connector, settings: UpsertSettings): Promise<void>;
27
27
  }
28
- export interface ConnectorTools {
29
- csvParse: typeof csvParse;
30
- dateFns: {
31
- parse: typeof dateFnsParse;
32
- };
33
- nanoid: typeof nanoid;
34
- shared: {
35
- buildFetchError: typeof buildFetchError;
36
- convertMillisecondsToTimestamp: typeof convertMillisecondsToTimestamp;
37
- extractExtensionFromPath: typeof extractExtensionFromPath;
38
- extractNameFromPath: typeof extractNameFromPath;
39
- lookupMimeTypeForExtension: typeof lookupMimeTypeForExtension;
40
- OperationalError: typeof OperationalError;
41
- };
42
- }
43
- export interface ConnectorCallbackData {
44
- typeId: string;
45
- properties: Record<string, unknown>;
46
- }
47
28
  export interface ConnectorConfig extends ComponentConfig {
48
29
  category?: ConnectorCategory;
49
30
  categoryId: string;
@@ -54,7 +35,7 @@ export interface ConnectorConfig extends ComponentConfig {
54
35
  vendorHomeURL?: string;
55
36
  version: string;
56
37
  }
57
- export interface ConnectorImplementation {
38
+ export type ConnectorImplementation = {
58
39
  activeConnectionCount?: number;
59
40
  canDescribe?: boolean;
60
41
  id?: string;
@@ -62,25 +43,43 @@ export interface ConnectorImplementation {
62
43
  label?: Record<string, string>;
63
44
  maxConnectionCount?: number;
64
45
  params?: Record<string, string>[];
65
- }
46
+ };
66
47
  export type ConnectorLocalisedConfig = Omit<ConnectorConfig, 'label' | 'description'> & {
67
48
  label: string;
68
49
  description: string;
69
50
  };
51
+ export type ConnectorTools = {
52
+ csvParse: typeof csvParse;
53
+ dataPos: {
54
+ buildFetchError: typeof buildFetchError;
55
+ convertMillisecondsToTimestamp: typeof convertMillisecondsToTimestamp;
56
+ extractExtensionFromPath: typeof extractExtensionFromPath;
57
+ extractNameFromPath: typeof extractNameFromPath;
58
+ lookupMimeTypeForExtension: typeof lookupMimeTypeForExtension;
59
+ OperationalError: typeof OperationalError;
60
+ };
61
+ dateFns: {
62
+ parse: typeof dateFnsParse;
63
+ };
64
+ nanoid: typeof nanoid;
65
+ };
66
+ export interface InitialiseSettings {
67
+ connectorStorageURLPrefix: string;
68
+ }
70
69
  export interface ConnectorOperationSettings {
71
70
  accountId?: string;
72
71
  appCheckToken?: string;
73
72
  sessionAccessToken?: string;
74
73
  }
75
- export interface AuditContentResult {
76
- contentAuditConfig: DataViewContentAuditConfig;
77
- }
78
74
  export interface AuditContentSettings extends ConnectorOperationSettings {
79
75
  chunkSize?: number;
80
76
  encodingId: string;
81
77
  path: string;
82
78
  valueDelimiterId: ValueDelimiterId;
83
79
  }
80
+ export interface AuditContentResult {
81
+ contentAuditConfig: DataViewContentAuditConfig;
82
+ }
84
83
  export interface CreateSettings extends ConnectorOperationSettings {
85
84
  accountId?: string;
86
85
  path: string;
@@ -94,28 +93,19 @@ interface DescribeResult {
94
93
  export interface DropSettings extends ConnectorOperationSettings {
95
94
  path: string;
96
95
  }
97
- export interface FindResult {
98
- folderPath?: string;
99
- }
100
96
  export interface FindSettings extends ConnectorOperationSettings {
101
97
  containerName?: string;
102
98
  objectName: string;
103
99
  }
104
- export interface GetResult {
105
- record?: string[] | Record<string, unknown>;
100
+ export interface FindResult {
101
+ folderPath?: string;
106
102
  }
107
103
  export interface GetSettings extends ConnectorOperationSettings {
108
104
  id: string;
109
105
  path: string;
110
106
  }
111
- export interface InitialiseSettings {
112
- connectorStorageURLPrefix: string;
113
- }
114
- export interface ListResult {
115
- cursor: string | number | undefined;
116
- connectionNodeConfigs: ConnectionNodeConfig[];
117
- isMore: boolean;
118
- totalCount: number;
107
+ export interface GetResult {
108
+ record?: string[] | Record<string, unknown>;
119
109
  }
120
110
  export interface ListSettings extends ConnectorOperationSettings {
121
111
  folderPath: string;
@@ -123,15 +113,21 @@ export interface ListSettings extends ConnectorOperationSettings {
123
113
  offset?: number;
124
114
  totalCount?: number;
125
115
  }
126
- export interface PreviewResult {
127
- data: Record<string, unknown>[] | Uint8Array;
128
- typeId: 'jsonArray' | 'uint8Array';
116
+ export interface ListResult {
117
+ cursor: string | number | undefined;
118
+ connectionNodeConfigs: ConnectionNodeConfig[];
119
+ isMore: boolean;
120
+ totalCount: number;
129
121
  }
130
122
  export interface PreviewSettings extends ConnectorOperationSettings {
131
123
  chunkSize?: number;
132
124
  extension?: string;
133
125
  path: string;
134
126
  }
127
+ export interface PreviewResult {
128
+ data: Record<string, unknown>[] | Uint8Array;
129
+ typeId: 'jsonArray' | 'uint8Array';
130
+ }
135
131
  export interface RemoveSettings extends ConnectorOperationSettings {
136
132
  keys: string[];
137
133
  path: string;
@@ -157,6 +153,10 @@ export interface UpsertSettings extends ConnectorOperationSettings {
157
153
  records: Record<string, unknown>[];
158
154
  path: string;
159
155
  }
156
+ export interface ConnectorCallbackData {
157
+ typeId: string;
158
+ properties: Record<string, unknown>;
159
+ }
160
160
  type ConnectorCategory = {
161
161
  id: string;
162
162
  label: string;
@@ -2,16 +2,9 @@ import { default as markdownIt } from 'markdown-it';
2
2
  import { ComponentConfig } from './component';
3
3
  export interface Presenter {
4
4
  readonly config: PresenterConfig;
5
- tools: PresenterTools;
6
- list(path: string): PresenterItemConfig[];
7
- render(id: string, renderTo: string | HTMLElement): Promise<void>;
8
- }
9
- export type PresenterTools = {
10
- markdownIt: typeof markdownIt;
11
- };
12
- export interface PresentationView {
13
- resize: () => void;
14
- vendorId: string;
5
+ readonly tools: PresenterTools;
6
+ list(): PresenterItemConfig[];
7
+ render(presentationPath: string, renderTo: HTMLElement): Promise<void>;
15
8
  }
16
9
  export interface PresenterConfig extends ComponentConfig {
17
10
  version: string;
@@ -20,6 +13,13 @@ export type PresenterLocalisedConfig = Omit<PresenterConfig, 'label' | 'descript
20
13
  label: string;
21
14
  description: string;
22
15
  };
16
+ export type PresenterTools = {
17
+ markdownIt: typeof markdownIt;
18
+ };
19
+ export interface PresentationView {
20
+ resize: () => void;
21
+ vendorId: string;
22
+ }
23
23
  export interface PresenterItemConfig {
24
24
  items?: PresenterItemConfig[];
25
25
  label: Record<string, string>;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@datapos/datapos-shared",
3
3
  "license": "MIT",
4
4
  "private": false,
5
- "version": "0.3.77",
5
+ "version": "0.3.78",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"