@datapos/datapos-development 0.3.194 → 0.3.215

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.
@@ -2,17 +2,19 @@
2
2
  * Development operations.
3
3
  */
4
4
  declare function buildConfig(): Promise<void>;
5
- declare function buildPublicDirectoryIndex(id: string): Promise<void>;
6
5
  declare function buildConnectorConfig(): Promise<void>;
7
6
  declare function buildContextConfig(): Promise<void>;
8
7
  declare function buildPresenterConfig(): Promise<void>;
9
- declare function bumpVersion(path?: string): Promise<void>;
10
- declare function echoScriptNotImplemented(name: string): void;
11
- declare function insertLicensesIntoReadme(): Promise<void>;
12
- declare function insertOWASPDependencyCheckBadgeIntoReadme(): Promise<void>;
8
+ declare function buildPublicDirectoryIndex(id: string): Promise<void>;
13
9
  declare function sendDeploymentNotice(): Promise<void>;
14
- declare function syncWithGitHub(): Promise<void>;
15
10
  declare function uploadDirectoryToR2(sourceDirectory: string, uploadDirectory: string): Promise<void>;
16
11
  declare function uploadModuleConfigToDO(): Promise<void>;
17
12
  declare function uploadModuleToR2(uploadDirectoryPath: string): Promise<void>;
18
- export { buildConfig, buildConnectorConfig, buildContextConfig, buildPresenterConfig, buildPublicDirectoryIndex, bumpVersion, echoScriptNotImplemented, insertLicensesIntoReadme, insertOWASPDependencyCheckBadgeIntoReadme, sendDeploymentNotice, syncWithGitHub, uploadDirectoryToR2, uploadModuleConfigToDO, uploadModuleToR2 };
13
+ export { buildConfig, buildConnectorConfig, buildContextConfig, buildPresenterConfig, buildPublicDirectoryIndex, sendDeploymentNotice, uploadDirectoryToR2, uploadModuleConfigToDO, uploadModuleToR2 };
14
+ export { buildArtifact, releaseArtifact, syncArtifactWithGitHub, testArtifact } from './operations/manageArtifact';
15
+ export { auditDependencies } from './operations/auditDependencies';
16
+ export { checkDependencies } from './operations/checkDependencies';
17
+ export { documentDependencies } from './operations/documentDependencies';
18
+ export { formatCode } from './operations/formatCode';
19
+ export { lintCode } from './operations/lintCode';
20
+ export { updateDataPosDependencies } from './operations/updateDataPosDependencies';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Audit dependencies operations
3
+ */
4
+ export interface SeverityCounts {
5
+ critical: number;
6
+ high: number;
7
+ moderate: number;
8
+ low: number;
9
+ unknown: number;
10
+ }
11
+ export declare const ALLOWED_SEVERITY_KEYS: (keyof SeverityCounts)[];
12
+ declare function auditDependencies(): Promise<void>;
13
+ export { auditDependencies };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Check dependencies operation.
3
+ */
4
+ declare function checkDependencies(): Promise<void>;
5
+ export { checkDependencies };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Document dependencies operation.
3
+ */
4
+ declare function documentDependencies(licenses: string[]): Promise<void>;
5
+ export { documentDependencies };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Format code operation.
3
+ */
4
+ declare function formatCode(): Promise<void>;
5
+ export { formatCode };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Lint code operation.
3
+ */
4
+ declare function lintCode(): Promise<void>;
5
+ export { lintCode };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Manage artifact operation.
3
+ */
4
+ declare function buildArtifact(): Promise<void>;
5
+ declare function releaseArtifact(): Promise<void>;
6
+ declare function syncArtifactWithGitHub(): Promise<void>;
7
+ declare function testArtifact(): void;
8
+ export { buildArtifact, releaseArtifact, syncArtifactWithGitHub, testArtifact };
@@ -0,0 +1,2 @@
1
+ declare function test(): void;
2
+ export { test };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Update datapos dependencies operation.
3
+ */
4
+ declare function updateDataPosDependencies(dependencies: string[]): Promise<void>;
5
+ export { updateDataPosDependencies };
@@ -0,0 +1,14 @@
1
+ import { ConnectorOperation, ConnectorUsageId } from '@datapos/datapos-shared';
2
+ declare function extractOperationsFromSource<T>(source: string): T[];
3
+ declare function determineConnectorUsageId(operations: ConnectorOperation[]): ConnectorUsageId;
4
+ declare function execCommand(command_: string, arguments_?: string[], outputFilePath?: string): Promise<void>;
5
+ declare function loadEnvironmentVariables(): Promise<void>;
6
+ declare function logOperationHeader(text: string): void;
7
+ declare function logOperationSuccess(message: string): void;
8
+ declare function logStepHeader(text: string): void;
9
+ declare function readJSONFile<T>(path: string): Promise<T>;
10
+ declare function readTextFile(path: string): Promise<string>;
11
+ declare function spawnCommand(command: string, arguments_?: string[], ignoreErrors?: boolean): Promise<void>;
12
+ declare function writeJSONFile(path: string, data: Record<string, unknown>): Promise<void>;
13
+ declare function writeTextFile(path: string, data: string): Promise<void>;
14
+ export { determineConnectorUsageId, execCommand, extractOperationsFromSource, loadEnvironmentVariables, logOperationHeader, logOperationSuccess, logStepHeader, readJSONFile, readTextFile, spawnCommand, writeJSONFile, writeTextFile };
@@ -1,4 +0,0 @@
1
- /**
2
- * Tests.
3
- */
4
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datapos/datapos-development",
3
- "version": "0.3.194",
3
+ "version": "0.3.215",
4
4
  "description": "A library of utilities for managing the Data Positioning repositories.",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Terrell <terrell.jm@gmail.com>",
@@ -30,6 +30,7 @@
30
30
  "acorn": "^8.15.0",
31
31
  "acorn-typescript": "^1.4.13",
32
32
  "acorn-walk": "^8.3.4",
33
+ "dotenv": "^17.2.3",
33
34
  "zod": "^4.1.13"
34
35
  },
35
36
  "devDependencies": {
@@ -49,7 +50,7 @@
49
50
  "nanoid": "^5.1.6",
50
51
  "npm-check-updates": "^19.1.2",
51
52
  "owasp-dependency-check": "^1.0.0",
52
- "prettier": "^3.7.2",
53
+ "prettier": "^3.7.3",
53
54
  "rollup-plugin-visualizer": "^6.0.5",
54
55
  "type-fest": "^5.2.0",
55
56
  "typescript": "^5.9.3",
@@ -58,29 +59,16 @@
58
59
  "vitest": "^4.0.14"
59
60
  },
60
61
  "scripts": {
61
- "audit": "npm run _audit:vulnerabilities && npm audit",
62
- "build": "vite build",
63
- "check": "npm outdated; npm-check-updates -i",
64
- "document": "npm run _document:licenceReportJSON && npm run _document:licenceReportMarkdown && npm run _document:licenceReportCheck && npm run _document:insertLicensesIntoReadme && npm run _document:licenceTree && npm run _document:licenceTreeCheck",
65
- "format": "prettier --write src/",
66
- "lint": "eslint .",
67
- "publish:toNPM": "npm publish --access public",
68
- "release": "npm run _bump:version && npm run build && npm run _sync:withGitHub && npm run publish:toNPM",
69
- "sync": "npm run _bump:version && npm run _sync:withGitHub",
70
- "test": "vitest",
71
- "update:dataPosDeps": "npm run _update:sharedDep",
72
- "_audit:vulnerabilities": "npm run _audit:owaspDependencyCheck && npm run _audit:owaspBageInsertiions",
73
- "_audit:owaspDependencyCheck": "set -a && source .env && set +a && owasp-dependency-check --project \"@datapos/datapos-development\" --enableRetired --nvdApiKey \"$NVD_API_KEY\" --nodePackageSkipDevDependencies",
74
- "_audit:owaspBageInsertiions": "node -e \"import('./dist/datapos-development.es.js').then(m => m.insertOWASPDependencyCheckBadgeIntoReadme())\"",
75
- "_bump:version": "node -e \"import('./dist/datapos-development.es.js').then(m => m.bumpVersion())\"",
76
- "_document:licenceReportJSON": "license-report --only=prod,peer --department.value=n/a --licensePeriod=n/a --material=n/a --relatedTo.value=n/a > licenses.json",
77
- "_document:licenceReportMarkdown": "license-report --config license-report-config.json --only=prod,peer --output=markdown > licenses.md",
78
- "_document:licenceReportCheck": "license-report-check --source ./licenses.json --allowed 'MIT' --output=table",
79
- "_document:licenceTree": "license-report-recursive --only=prod,peer --department.value=n/a --licensePeriod=n/a --material=n/a --relatedTo.value=n/a --recurse --output=tree > licenseTree.json",
80
- "_document:licenceTreeCheck": "license-report-check --source ./licenseTree.json --allowed 'MIT' --output=table",
81
- "_document:insertLicensesIntoReadme": "node -e \"import('./dist/datapos-development.es.js').then(m => m.insertLicensesIntoReadme())\"",
82
- "_sync:withGitHub": "node -e \"import('./dist/datapos-development.es.js').then(m => m.syncWithGitHub())\"",
83
- "_update:sharedDep": "npm install @datapos/datapos-shared@latest"
62
+ "audit": "node -e \"import('./dist/datapos-development.es.js').then(m => m.auditDependencies())\"",
63
+ "build": "node -e \"import('./dist/datapos-development.es.js').then(m => m.buildArtifact())\"",
64
+ "check": "node -e \"import('./dist/datapos-development.es.js').then(m => m.checkDependencies())\"",
65
+ "document": "node -e \"import('./dist/datapos-development.es.js').then(m => m.documentDependencies(['BSD-2-Clause','MIT']))\"",
66
+ "format": "node -e \"import('./dist/datapos-development.es.js').then(m => m.formatCode())\"",
67
+ "lint": "node -e \"import('./dist/datapos-development.es.js').then(m => m.lintCode())\"",
68
+ "release": "node -e \"import('./dist/datapos-development.es.js').then(m => m.releaseArtifact())\"",
69
+ "sync": "node -e \"import('./dist/datapos-development.es.js').then(m => m.syncArtifactWithGitHub())\"",
70
+ "test": "node -e \"import('./dist/datapos-development.es.js').then(m => m.testArtifact())\"",
71
+ "update:dataPosDeps": "node -e \"import('./dist/datapos-development.es.js').then(m => m.updateDataPosDependencies(['shared']))\""
84
72
  },
85
73
  "engines": {
86
74
  "node": ">=22.0.0",
@@ -1,55 +0,0 @@
1
- interface ComponentStatus {
2
- id: string;
3
- color: StatusColorId;
4
- label: string;
5
- }
6
- type ComponentStatusId = 'alpha' | 'beta' | 'generalAvailability' | 'notApplicable' | 'preAlpha' | 'proposed' | 'releaseCandidate' | 'unavailable' | 'underReview';
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
- type StatusColorId = 'amber' | 'green' | 'red' | 'other';
11
- interface ComponentConfig {
12
- id: string;
13
- label: Record<string, string>;
14
- description: Record<string, string>;
15
- firstCreatedAt?: number;
16
- icon?: string;
17
- iconDark?: string;
18
- lastUpdatedAt?: number;
19
- status?: ComponentStatus;
20
- statusId: ComponentStatusId;
21
- typeId: ComponentTypeId;
22
- }
23
- interface ModuleConfig extends ComponentConfig {
24
- typeId: ModuleTypeId;
25
- version: string;
26
- }
27
- type ModuleTypeId = 'app' | 'engine' | 'connector' | 'context' | 'presenter' | 'tool';
28
- interface ConnectorCategory {
29
- id: string;
30
- label: string;
31
- }
32
- export interface ConnectorImplementation {
33
- activeConnectionCount?: number;
34
- canDescribe?: boolean;
35
- id?: string;
36
- authMethodId: 'apiKey' | 'disabled' | 'oAuth2' | 'none';
37
- label?: LocalisedString;
38
- maxConnectionCount?: number;
39
- params?: Record<string, string>[];
40
- }
41
- type ConnectorModuleCategoryId = 'application' | 'curatedDataset' | 'database' | 'fileStore';
42
- type ConnectorOperation = 'abortOperation' | 'authenticateConnection' | 'createObject' | 'describeConnection' | 'dropObject' | 'findObject' | 'getRecord' | 'listNodes' | 'previewObject' | 'removeRecords' | 'retrieveRecords' | 'upsertRecords';
43
- type ConnectorUsageId = 'bidirectional' | 'destination' | 'source' | 'unknown';
44
- export interface ConnectorConfig extends ModuleConfig {
45
- category?: ConnectorCategory;
46
- categoryId: ConnectorModuleCategoryId;
47
- implementations: Record<string, ConnectorImplementation>;
48
- operations: ConnectorOperation[];
49
- typeId: 'connector';
50
- usageId: ConnectorUsageId;
51
- vendorAccountURL?: string;
52
- vendorDocumentationURL?: string;
53
- vendorHomeURL?: string;
54
- }
55
- export {};
@@ -1,46 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const connectorImplementationSchema: z.ZodObject<{
3
- activeConnectionCount: z.ZodOptional<z.ZodNumber>;
4
- canDescribe: z.ZodOptional<z.ZodBoolean>;
5
- id: z.ZodOptional<z.ZodString>;
6
- authMethodId: z.ZodUnion<readonly [z.ZodLiteral<"apiKey">, z.ZodLiteral<"disabled">, z.ZodLiteral<"oAuth2">, z.ZodLiteral<"none">]>;
7
- label: z.ZodOptional<z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"en-au">, z.ZodLiteral<"en-gb">, z.ZodLiteral<"en-us">, z.ZodLiteral<"es-es">]>, z.ZodString>>;
8
- maxConnectionCount: z.ZodOptional<z.ZodNumber>;
9
- params: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
10
- }, z.core.$strip>;
11
- export declare const connectorConfigSchema: z.ZodObject<{
12
- id: z.ZodString;
13
- label: z.ZodRecord<z.ZodString, z.ZodString>;
14
- description: z.ZodRecord<z.ZodString, z.ZodString>;
15
- firstCreatedAt: z.ZodOptional<z.ZodNumber>;
16
- icon: z.ZodOptional<z.ZodString>;
17
- iconDark: z.ZodOptional<z.ZodString>;
18
- lastUpdatedAt: z.ZodOptional<z.ZodNumber>;
19
- status: z.ZodOptional<z.ZodNullable<z.ZodObject<{
20
- id: z.ZodString;
21
- color: z.ZodUnion<readonly [z.ZodLiteral<"amber">, z.ZodLiteral<"green">, z.ZodLiteral<"red">, z.ZodLiteral<"other">]>;
22
- label: z.ZodString;
23
- }, z.core.$strip>>>;
24
- 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">]>;
25
- version: z.ZodString;
26
- category: z.ZodOptional<z.ZodObject<{
27
- id: z.ZodString;
28
- label: z.ZodString;
29
- }, z.core.$strip>>;
30
- categoryId: z.ZodUnion<readonly [z.ZodLiteral<"application">, z.ZodLiteral<"curatedDataset">, z.ZodLiteral<"database">, z.ZodLiteral<"fileStore">]>;
31
- implementations: z.ZodRecord<z.ZodString, z.ZodObject<{
32
- activeConnectionCount: z.ZodOptional<z.ZodNumber>;
33
- canDescribe: z.ZodOptional<z.ZodBoolean>;
34
- id: z.ZodOptional<z.ZodString>;
35
- authMethodId: z.ZodUnion<readonly [z.ZodLiteral<"apiKey">, z.ZodLiteral<"disabled">, z.ZodLiteral<"oAuth2">, z.ZodLiteral<"none">]>;
36
- label: z.ZodOptional<z.ZodRecord<z.ZodUnion<readonly [z.ZodLiteral<"en-au">, z.ZodLiteral<"en-gb">, z.ZodLiteral<"en-us">, z.ZodLiteral<"es-es">]>, z.ZodString>>;
37
- maxConnectionCount: z.ZodOptional<z.ZodNumber>;
38
- params: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodString>>>;
39
- }, z.core.$strip>>;
40
- operations: z.ZodArray<z.ZodUnion<readonly [z.ZodLiteral<"abortOperation">, z.ZodLiteral<"authenticateConnection">, z.ZodLiteral<"createObject">, z.ZodLiteral<"describeConnection">, z.ZodLiteral<"dropObject">, z.ZodLiteral<"findObject">, z.ZodLiteral<"getRecord">, z.ZodLiteral<"listNodes">, z.ZodLiteral<"previewObject">, z.ZodLiteral<"removeRecords">, z.ZodLiteral<"retrieveRecords">, z.ZodLiteral<"upsertRecords">]>>;
41
- typeId: z.ZodLiteral<"connector">;
42
- usageId: z.ZodUnion<readonly [z.ZodLiteral<"bidirectional">, z.ZodLiteral<"destination">, z.ZodLiteral<"source">, z.ZodLiteral<"unknown">]>;
43
- vendorAccountURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
- vendorDocumentationURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
- vendorHomeURL: z.ZodOptional<z.ZodNullable<z.ZodString>>;
46
- }, z.core.$strip>;