@datapos/datapos-shared 0.3.254 → 0.3.255
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/dist/datapos-shared.es.js +985 -886
- package/dist/types/src/{component/test.d.ts → _SCHEMA_TYPES.d.ts} +16 -30
- package/dist/types/src/component/context/contextSchema.d.ts +45 -0
- package/dist/types/src/component/presenter/presenterSchema.d.ts +28 -0
- package/dist/types/src/index.d.ts +2 -0
- package/package.json +4 -2
|
@@ -5,14 +5,12 @@ type ComponentStatus = {
|
|
|
5
5
|
};
|
|
6
6
|
type ComponentStatusId = 'alpha' | 'beta' | 'generalAvailability' | 'notApplicable' | 'preAlpha' | 'proposed' | 'releaseCandidate' | 'unavailable' | 'underReview';
|
|
7
7
|
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';
|
|
8
|
-
type LocaleCode = 'en-au' | 'en-gb' | 'en-us' | 'es-es';
|
|
9
|
-
type LocalisedString = Record<LocaleCode, string>;
|
|
10
8
|
type StatusColorId = 'amber' | 'green' | 'red' | 'other';
|
|
11
9
|
type Timestamp = number;
|
|
12
10
|
interface ComponentConfig {
|
|
13
11
|
id: string;
|
|
14
|
-
label:
|
|
15
|
-
description:
|
|
12
|
+
label: Record<string, string>;
|
|
13
|
+
description: Record<string, string>;
|
|
16
14
|
firstCreatedAt?: Timestamp;
|
|
17
15
|
icon?: string;
|
|
18
16
|
iconDark?: string;
|
|
@@ -21,36 +19,24 @@ interface ComponentConfig {
|
|
|
21
19
|
statusId: ComponentStatusId;
|
|
22
20
|
typeId: ComponentTypeId;
|
|
23
21
|
}
|
|
22
|
+
type ComponentRef = {
|
|
23
|
+
id: string;
|
|
24
|
+
label: Record<string, string>;
|
|
25
|
+
description: Record<string, string>;
|
|
26
|
+
icon?: string;
|
|
27
|
+
iconDark?: string;
|
|
28
|
+
order: number;
|
|
29
|
+
path: string;
|
|
30
|
+
};
|
|
24
31
|
interface ModuleConfig extends ComponentConfig {
|
|
25
32
|
typeId: ModuleTypeId;
|
|
26
33
|
version: string;
|
|
27
34
|
}
|
|
28
35
|
type ModuleTypeId = 'app' | 'engine' | 'connector' | 'context' | 'presenter' | 'tool';
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
export type ConnectorImplementation = {
|
|
34
|
-
activeConnectionCount?: number;
|
|
35
|
-
canDescribe?: boolean;
|
|
36
|
-
id?: string;
|
|
37
|
-
authMethodId: 'apiKey' | 'disabled' | 'oAuth2' | 'none';
|
|
38
|
-
label?: LocalisedString;
|
|
39
|
-
maxConnectionCount?: number;
|
|
40
|
-
params?: Record<string, string>[];
|
|
41
|
-
};
|
|
42
|
-
type ConnectorModuleCategoryId = 'application' | 'curatedDataset' | 'database' | 'fileStore';
|
|
43
|
-
type ConnectorOperation = 'abortOperation' | 'authenticateConnection' | 'createObject' | 'describeConnection' | 'dropObject' | 'findObject' | 'getRecord' | 'listNodes' | 'previewObject' | 'removeRecords' | 'retrieveRecords' | 'upsertRecords';
|
|
44
|
-
type ConnectorUsageId = 'bidirectional' | 'destination' | 'source' | 'unknown';
|
|
45
|
-
export interface ConnectorConfig extends ModuleConfig {
|
|
46
|
-
category?: ConnectorCategory;
|
|
47
|
-
categoryId: ConnectorModuleCategoryId;
|
|
48
|
-
implementations: Record<string, ConnectorImplementation>;
|
|
49
|
-
operations: ConnectorOperation[];
|
|
50
|
-
typeId: 'connector';
|
|
51
|
-
usageId: ConnectorUsageId;
|
|
52
|
-
vendorAccountURL?: string;
|
|
53
|
-
vendorDocumentationURL?: string;
|
|
54
|
-
vendorHomeURL?: string;
|
|
36
|
+
export interface PresenterConfig extends ModuleConfig {
|
|
37
|
+
presentations: ComponentRef[];
|
|
38
|
+
operations: PresenterOperation[];
|
|
39
|
+
typeId: 'presenter';
|
|
55
40
|
}
|
|
41
|
+
type PresenterOperation = 'list' | 'render' | 'setColorMode';
|
|
56
42
|
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const contextConfigSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
5
|
+
description: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
6
|
+
firstCreatedAt: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
8
|
+
iconDark: z.ZodOptional<z.ZodString>;
|
|
9
|
+
lastUpdatedAt: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
status: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
color: z.ZodUnion<readonly [z.ZodLiteral<"amber">, z.ZodLiteral<"green">, z.ZodLiteral<"red">, z.ZodLiteral<"other">]>;
|
|
13
|
+
label: z.ZodString;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
statusId: z.ZodUnion<readonly [z.ZodLiteral<"alpha">, z.ZodLiteral<"beta">, z.ZodLiteral<"generalAvailability">, z.ZodLiteral<"notApplicable">, z.ZodLiteral<"preAlpha">, z.ZodLiteral<"proposed">, z.ZodLiteral<"releaseCandidate">, z.ZodLiteral<"unavailable">, z.ZodLiteral<"underReview">]>;
|
|
16
|
+
version: z.ZodString;
|
|
17
|
+
models: z.ZodArray<z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
20
|
+
description: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
21
|
+
firstCreatedAt: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
23
|
+
iconDark: z.ZodOptional<z.ZodString>;
|
|
24
|
+
lastUpdatedAt: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
status: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
id: z.ZodString;
|
|
27
|
+
color: z.ZodUnion<readonly [z.ZodLiteral<"amber">, z.ZodLiteral<"green">, z.ZodLiteral<"red">, z.ZodLiteral<"other">]>;
|
|
28
|
+
label: z.ZodString;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
statusId: z.ZodUnion<readonly [z.ZodLiteral<"alpha">, z.ZodLiteral<"beta">, z.ZodLiteral<"generalAvailability">, z.ZodLiteral<"notApplicable">, z.ZodLiteral<"preAlpha">, z.ZodLiteral<"proposed">, z.ZodLiteral<"releaseCandidate">, z.ZodLiteral<"unavailable">, z.ZodLiteral<"underReview">]>;
|
|
31
|
+
typeId: z.ZodUnion<readonly [z.ZodLiteral<"app">, z.ZodLiteral<"connector">, z.ZodLiteral<"connectorConnection">, z.ZodLiteral<"context">, z.ZodLiteral<"contextModelGroup">, z.ZodLiteral<"contextModel">, z.ZodLiteral<"contextModelDimensionGroup">, z.ZodLiteral<"contextModelDimension">, z.ZodLiteral<"contextModelDimensionHierarchy">, z.ZodLiteral<"contextModelEntityGroup">, z.ZodLiteral<"contextModelEntity">, z.ZodLiteral<"contextModelEntityDataItem">, z.ZodLiteral<"contextModelEntityEvent">, z.ZodLiteral<"contextModelEntityPrimaryMeasure">, z.ZodLiteral<"contextModelSecondaryMeasureGroup">, z.ZodLiteral<"contextModelSecondaryMeasure">, z.ZodLiteral<"dataView">, z.ZodLiteral<"dimension">, z.ZodLiteral<"engine">, z.ZodLiteral<"eventQuery">, z.ZodLiteral<"presenter">, z.ZodLiteral<"presenterPresentation">, z.ZodLiteral<"tool">]>;
|
|
32
|
+
modelRefs: z.ZodArray<z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
35
|
+
description: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
36
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
37
|
+
iconDark: z.ZodOptional<z.ZodString>;
|
|
38
|
+
order: z.ZodNumber;
|
|
39
|
+
path: z.ZodString;
|
|
40
|
+
}, z.core.$strip>>;
|
|
41
|
+
order: z.ZodNumber;
|
|
42
|
+
}, z.core.$strip>>;
|
|
43
|
+
operations: z.ZodArray<z.ZodLiteral<"list">>;
|
|
44
|
+
typeId: z.ZodLiteral<"context">;
|
|
45
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const presenterConfigSchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodString;
|
|
4
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
5
|
+
description: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
6
|
+
firstCreatedAt: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
8
|
+
iconDark: z.ZodOptional<z.ZodString>;
|
|
9
|
+
lastUpdatedAt: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
status: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
id: z.ZodString;
|
|
12
|
+
color: z.ZodUnion<readonly [z.ZodLiteral<"amber">, z.ZodLiteral<"green">, z.ZodLiteral<"red">, z.ZodLiteral<"other">]>;
|
|
13
|
+
label: z.ZodString;
|
|
14
|
+
}, z.core.$strip>>;
|
|
15
|
+
statusId: z.ZodUnion<readonly [z.ZodLiteral<"alpha">, z.ZodLiteral<"beta">, z.ZodLiteral<"generalAvailability">, z.ZodLiteral<"notApplicable">, z.ZodLiteral<"preAlpha">, z.ZodLiteral<"proposed">, z.ZodLiteral<"releaseCandidate">, z.ZodLiteral<"unavailable">, z.ZodLiteral<"underReview">]>;
|
|
16
|
+
version: z.ZodString;
|
|
17
|
+
presentations: z.ZodArray<z.ZodObject<{
|
|
18
|
+
id: z.ZodString;
|
|
19
|
+
label: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
20
|
+
description: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
21
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
22
|
+
iconDark: z.ZodOptional<z.ZodString>;
|
|
23
|
+
order: z.ZodNumber;
|
|
24
|
+
path: z.ZodString;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
operations: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"list">, z.ZodLiteral<"render">, z.ZodLiteral<"setColorMode">]>>;
|
|
27
|
+
typeId: z.ZodLiteral<"presenter">;
|
|
28
|
+
}, z.core.$strip>;
|
|
@@ -20,6 +20,8 @@ export type { RemoveSettings } from './component/connector';
|
|
|
20
20
|
export type { RetrieveResult, RetrieveSettings, RetrieveSummary } from './component/connector';
|
|
21
21
|
export type { UpsertSettings } from './component/connector';
|
|
22
22
|
export { connectorConfigSchema } from './component/connector/connectorSchema';
|
|
23
|
+
export { contextConfigSchema } from './component/context/contextSchema';
|
|
24
|
+
export { presenterConfigSchema } from './component/presenter/presenterSchema';
|
|
23
25
|
export type { ConnectionAuthorizationConfig, ConnectionColumnConfig, ConnectionConfig, ConnectionNodeConfig } from './component/connector/connection';
|
|
24
26
|
export type { DPAFileSystemFileHandle, Encoding, StorageTypeId, UsageTypeId } from './component/connector/connection';
|
|
25
27
|
export type { Context, ContextConfig, ContextLocalisedConfig, ContextListSettings, ContextListResult, ContextOperation } from './component/context';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datapos/datapos-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.255",
|
|
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,
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"npm-check-updates": "^19.1.2",
|
|
45
45
|
"prettier": "^3.6.2",
|
|
46
46
|
"retire": "^5.3.0",
|
|
47
|
+
"ts-to-zod": "^5.1.0",
|
|
47
48
|
"typescript": "^5.9.3",
|
|
48
49
|
"vite": "^7.2.4",
|
|
49
50
|
"vite-plugin-dts": "^4.5.4"
|
|
@@ -64,7 +65,8 @@
|
|
|
64
65
|
"_document:licenceReport": "license-report --only=prod,peer > LICENSES.json",
|
|
65
66
|
"_document:licenceCheck": "license-report-check --source ./LICENSES.json --allowed 'MIT' --allowed 'n/a' --allowed 'Apache-2.0' --output=table",
|
|
66
67
|
"_sync:withGitHub": "node -e \"import('@datapos/datapos-development').then(m => m.syncWithGitHub())\"",
|
|
67
|
-
"_update:developDep": "npm install --save-dev @datapos/datapos-development@latest"
|
|
68
|
+
"_update:developDep": "npm install --save-dev @datapos/datapos-development@latest",
|
|
69
|
+
"___ts-to-zod": "npx ts-to-zod src/schemaTypes.ts src/schemaZOD.ts"
|
|
68
70
|
},
|
|
69
71
|
"engines": {
|
|
70
72
|
"node": ">=22.0.0",
|