@datapos/datapos-shared 0.3.69 → 0.3.71

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,8 +1,12 @@
1
- import { parse } from 'date-fns';
2
- import { Callback, Options, Parser } from 'csv-parse/browser/esm';
1
+ import { parse as csvParse } from 'csv-parse/browser/esm';
2
+ import { parse as dateFnsParse } from 'date-fns';
3
+ import { nanoid } from 'nanoid';
3
4
  import { ComponentConfig } from './component';
5
+ import { convertMillisecondsToTimestamp } from '.';
6
+ import { buildFetchError, OperationalError } from './errors';
4
7
  import { ConnectionConfig, ConnectionDescription, ConnectionNodeConfig } from './connection';
5
8
  import { DataViewContentAuditConfig, ValueDelimiterId } from './dataView';
9
+ import { extractExtensionFromPath, extractNameFromPath, lookupMimeTypeForExtension } from './utilities';
6
10
  export interface Connector {
7
11
  abortController?: AbortController | undefined;
8
12
  readonly config: ConnectorConfig;
@@ -18,15 +22,23 @@ export interface Connector {
18
22
  listNodes?(connector: Connector, settings: ListSettings): Promise<ListResult>;
19
23
  previewObject?(connector: Connector, settings: PreviewSettings): Promise<PreviewResult>;
20
24
  removeRecords?(connector: Connector, settings: RemoveSettings): Promise<void>;
21
- retrieveRecords?(connector: Connector, settings: RetrieveSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveSummary) => void, tools?: RetrieveTools): Promise<void>;
25
+ retrieveRecords?(connector: Connector, settings: RetrieveSettings, chunk: (records: (string[] | Record<string, unknown>)[]) => void, complete: (result: RetrieveSummary) => void): Promise<void>;
22
26
  upsertRecords?(connector: Connector, settings: UpsertSettings): Promise<void>;
23
27
  }
24
28
  export interface ConnectorTools {
25
- csvParse: (options: Options, callback?: Callback) => Parser | undefined;
26
- dateFNS: {
27
- parse: typeof parse;
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;
28
41
  };
29
- nanoid: <Type extends string>(size?: number) => Type;
30
42
  }
31
43
  export interface ConnectorCallbackData {
32
44
  typeId: string;
@@ -141,9 +153,6 @@ export interface RetrieveSummary {
141
153
  lineCount: number;
142
154
  recordCount: number;
143
155
  }
144
- export interface RetrieveTools {
145
- csvParse: (options: Options, callback?: Callback) => Parser | undefined;
146
- }
147
156
  export interface UpsertSettings extends ConnectorOperationSettings {
148
157
  records: Record<string, unknown>[];
149
158
  path: string;
@@ -12,7 +12,7 @@ export type { InitialiseSettings } from './connector';
12
12
  export type { ListResult, ListSettings } from './connector';
13
13
  export type { PreviewResult, PreviewSettings } from './connector';
14
14
  export type { RemoveSettings } from './connector';
15
- export type { RetrieveResult, RetrieveSettings, RetrieveSummary, RetrieveTools } from './connector';
15
+ export type { RetrieveResult, RetrieveSettings, RetrieveSummary } from './connector';
16
16
  export type { UpsertSettings } from './connector';
17
17
  export type { Context, ContextConfig, ContextFocusConfig, ContextFocusConfigListResult, ContextFocusConfigListSettings, ContextModelConfig, ContextDimensionConfig, ContextDimensionGroupConfig, ContextEntityCharacteristicConfig, ContextEntityGroupConfig, ContextEntityComputationConfig, ContextSecondaryMeasureGroupConfig, ContextViewGroupConfig, ContextFocusLocalisedConfig } from './context';
18
18
  export type { ContextEntityConfig, ContextEntityEventConfig, ContextHierarchyConfig, ContextViewConfig, Event } from './context';
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.69",
5
+ "version": "0.3.71",
6
6
  "type": "module",
7
7
  "files": [
8
8
  "dist"