digitaltwin-core 0.14.2 → 1.0.0
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/LICENSE +20 -20
- package/README.md +494 -359
- package/dist/auth/apisix_parser.d.ts +141 -0
- package/dist/auth/apisix_parser.d.ts.map +1 -0
- package/dist/auth/apisix_parser.js +161 -0
- package/dist/auth/apisix_parser.js.map +1 -0
- package/dist/auth/auth_config.d.ts +126 -0
- package/dist/auth/auth_config.d.ts.map +1 -0
- package/dist/auth/auth_config.js +169 -0
- package/dist/auth/auth_config.js.map +1 -0
- package/dist/auth/auth_provider.d.ts +118 -0
- package/dist/auth/auth_provider.d.ts.map +1 -0
- package/dist/auth/auth_provider.js +8 -0
- package/dist/auth/auth_provider.js.map +1 -0
- package/dist/auth/auth_provider_factory.d.ts +91 -0
- package/dist/auth/auth_provider_factory.d.ts.map +1 -0
- package/dist/auth/auth_provider_factory.js +146 -0
- package/dist/auth/auth_provider_factory.js.map +1 -0
- package/dist/auth/index.d.ts +8 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +7 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/providers/gateway_auth_provider.d.ts +78 -0
- package/dist/auth/providers/gateway_auth_provider.d.ts.map +1 -0
- package/dist/auth/providers/gateway_auth_provider.js +109 -0
- package/dist/auth/providers/gateway_auth_provider.js.map +1 -0
- package/dist/auth/providers/index.d.ts +4 -0
- package/dist/auth/providers/index.d.ts.map +1 -0
- package/dist/auth/providers/index.js +4 -0
- package/dist/auth/providers/index.js.map +1 -0
- package/dist/auth/providers/jwt_auth_provider.d.ts +91 -0
- package/dist/auth/providers/jwt_auth_provider.d.ts.map +1 -0
- package/dist/auth/providers/jwt_auth_provider.js +204 -0
- package/dist/auth/providers/jwt_auth_provider.js.map +1 -0
- package/dist/auth/providers/no_auth_provider.d.ts +61 -0
- package/dist/auth/providers/no_auth_provider.d.ts.map +1 -0
- package/dist/auth/providers/no_auth_provider.js +76 -0
- package/dist/auth/providers/no_auth_provider.js.map +1 -0
- package/dist/auth/types.d.ts +100 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +2 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/auth/user_service.d.ts +86 -0
- package/dist/auth/user_service.d.ts.map +1 -0
- package/dist/auth/user_service.js +237 -0
- package/dist/auth/user_service.js.map +1 -0
- package/dist/components/assets_manager.d.ts +662 -0
- package/dist/components/assets_manager.d.ts.map +1 -0
- package/dist/components/assets_manager.js +1537 -0
- package/dist/components/assets_manager.js.map +1 -0
- package/dist/components/async_upload.d.ts +20 -0
- package/dist/components/async_upload.d.ts.map +1 -0
- package/dist/components/async_upload.js +10 -0
- package/dist/components/async_upload.js.map +1 -0
- package/dist/components/collector.d.ts +203 -0
- package/dist/components/collector.d.ts.map +1 -0
- package/dist/components/collector.js +214 -0
- package/dist/components/collector.js.map +1 -0
- package/dist/components/custom_table_manager.d.ts +503 -0
- package/dist/components/custom_table_manager.d.ts.map +1 -0
- package/dist/components/custom_table_manager.js +1023 -0
- package/dist/components/custom_table_manager.js.map +1 -0
- package/dist/components/global_assets_handler.d.ts +63 -0
- package/dist/components/global_assets_handler.d.ts.map +1 -0
- package/dist/components/global_assets_handler.js +127 -0
- package/dist/components/global_assets_handler.js.map +1 -0
- package/dist/components/handler.d.ts +104 -0
- package/dist/components/handler.d.ts.map +1 -0
- package/dist/components/handler.js +110 -0
- package/dist/components/handler.js.map +1 -0
- package/dist/components/harvester.d.ts +182 -0
- package/dist/components/harvester.d.ts.map +1 -0
- package/dist/components/harvester.js +406 -0
- package/dist/components/harvester.js.map +1 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +9 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/interfaces.d.ts +126 -0
- package/dist/components/interfaces.d.ts.map +1 -0
- package/dist/components/interfaces.js +8 -0
- package/dist/components/interfaces.js.map +1 -0
- package/dist/components/map_manager.d.ts +61 -0
- package/dist/components/map_manager.d.ts.map +1 -0
- package/dist/components/map_manager.js +242 -0
- package/dist/components/map_manager.js.map +1 -0
- package/dist/components/tileset_manager.d.ts +125 -0
- package/dist/components/tileset_manager.d.ts.map +1 -0
- package/dist/components/tileset_manager.js +623 -0
- package/dist/components/tileset_manager.js.map +1 -0
- package/dist/components/types.d.ts +226 -0
- package/dist/components/types.d.ts.map +1 -0
- package/dist/components/types.js +8 -0
- package/dist/components/types.js.map +1 -0
- package/dist/database/adapters/knex_database_adapter.d.ts +97 -0
- package/dist/database/adapters/knex_database_adapter.d.ts.map +1 -0
- package/dist/database/adapters/knex_database_adapter.js +729 -0
- package/dist/database/adapters/knex_database_adapter.js.map +1 -0
- package/dist/database/database_adapter.d.ts +262 -0
- package/dist/database/database_adapter.d.ts.map +1 -0
- package/dist/database/database_adapter.js +46 -0
- package/dist/database/database_adapter.js.map +1 -0
- package/dist/engine/digital_twin_engine.d.ts +295 -0
- package/dist/engine/digital_twin_engine.d.ts.map +1 -0
- package/dist/engine/digital_twin_engine.js +907 -0
- package/dist/engine/digital_twin_engine.js.map +1 -0
- package/dist/engine/endpoints.d.ts +47 -0
- package/dist/engine/endpoints.d.ts.map +1 -0
- package/dist/engine/endpoints.js +88 -0
- package/dist/engine/endpoints.js.map +1 -0
- package/dist/engine/error_handler.d.ts +20 -0
- package/dist/engine/error_handler.d.ts.map +1 -0
- package/dist/engine/error_handler.js +69 -0
- package/dist/engine/error_handler.js.map +1 -0
- package/dist/engine/events.d.ts +93 -0
- package/dist/engine/events.d.ts.map +1 -0
- package/dist/engine/events.js +71 -0
- package/dist/engine/events.js.map +1 -0
- package/dist/engine/health.d.ts +112 -0
- package/dist/engine/health.d.ts.map +1 -0
- package/dist/engine/health.js +190 -0
- package/dist/engine/health.js.map +1 -0
- package/dist/engine/initializer.d.ts +62 -0
- package/dist/engine/initializer.d.ts.map +1 -0
- package/dist/engine/initializer.js +108 -0
- package/dist/engine/initializer.js.map +1 -0
- package/dist/engine/queue_manager.d.ts +87 -0
- package/dist/engine/queue_manager.d.ts.map +1 -0
- package/dist/engine/queue_manager.js +196 -0
- package/dist/engine/queue_manager.js.map +1 -0
- package/dist/engine/scheduler.d.ts +30 -0
- package/dist/engine/scheduler.d.ts.map +1 -0
- package/dist/engine/scheduler.js +378 -0
- package/dist/engine/scheduler.js.map +1 -0
- package/dist/engine/upload_processor.d.ts +36 -0
- package/dist/engine/upload_processor.d.ts.map +1 -0
- package/dist/engine/upload_processor.js +113 -0
- package/dist/engine/upload_processor.js.map +1 -0
- package/dist/env/env.d.ts +134 -0
- package/dist/env/env.d.ts.map +1 -0
- package/dist/env/env.js +177 -0
- package/dist/env/env.js.map +1 -0
- package/dist/errors/index.d.ts +94 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +149 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +65 -0
- package/dist/index.js.map +1 -0
- package/dist/openapi/generator.d.ts +93 -0
- package/dist/openapi/generator.d.ts.map +1 -0
- package/dist/openapi/generator.js +293 -0
- package/dist/openapi/generator.js.map +1 -0
- package/dist/openapi/index.d.ts +9 -0
- package/dist/openapi/index.d.ts.map +1 -0
- package/dist/openapi/index.js +9 -0
- package/dist/openapi/index.js.map +1 -0
- package/dist/openapi/types.d.ts +182 -0
- package/dist/openapi/types.d.ts.map +1 -0
- package/dist/openapi/types.js +16 -0
- package/dist/openapi/types.js.map +1 -0
- package/dist/storage/adapters/local_storage_service.d.ts +57 -0
- package/dist/storage/adapters/local_storage_service.d.ts.map +1 -0
- package/dist/storage/adapters/local_storage_service.js +132 -0
- package/dist/storage/adapters/local_storage_service.js.map +1 -0
- package/dist/storage/adapters/ovh_storage_service.d.ts +72 -0
- package/dist/storage/adapters/ovh_storage_service.d.ts.map +1 -0
- package/dist/storage/adapters/ovh_storage_service.js +205 -0
- package/dist/storage/adapters/ovh_storage_service.js.map +1 -0
- package/dist/storage/storage_factory.d.ts +14 -0
- package/dist/storage/storage_factory.d.ts.map +1 -0
- package/dist/storage/storage_factory.js +43 -0
- package/dist/storage/storage_factory.js.map +1 -0
- package/dist/storage/storage_service.d.ts +163 -0
- package/dist/storage/storage_service.d.ts.map +1 -0
- package/dist/storage/storage_service.js +58 -0
- package/dist/storage/storage_service.js.map +1 -0
- package/dist/types/data_record.d.ts +123 -0
- package/dist/types/data_record.d.ts.map +1 -0
- package/dist/types/data_record.js +8 -0
- package/dist/types/data_record.js.map +1 -0
- package/dist/utils/graceful_shutdown.d.ts +44 -0
- package/dist/utils/graceful_shutdown.d.ts.map +1 -0
- package/dist/utils/graceful_shutdown.js +79 -0
- package/dist/utils/graceful_shutdown.js.map +1 -0
- package/dist/utils/http_responses.d.ts +175 -0
- package/dist/utils/http_responses.d.ts.map +1 -0
- package/dist/utils/http_responses.js +216 -0
- package/dist/utils/http_responses.js.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +74 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +92 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/map_to_data_record.d.ts +10 -0
- package/dist/utils/map_to_data_record.d.ts.map +1 -0
- package/dist/utils/map_to_data_record.js +36 -0
- package/dist/utils/map_to_data_record.js.map +1 -0
- package/dist/utils/safe_async.d.ts +50 -0
- package/dist/utils/safe_async.d.ts.map +1 -0
- package/dist/utils/safe_async.js +90 -0
- package/dist/utils/safe_async.js.map +1 -0
- package/dist/utils/servable_endpoint.d.ts +63 -0
- package/dist/utils/servable_endpoint.d.ts.map +1 -0
- package/dist/utils/servable_endpoint.js +67 -0
- package/dist/utils/servable_endpoint.js.map +1 -0
- package/dist/utils/zip_utils.d.ts +66 -0
- package/dist/utils/zip_utils.d.ts.map +1 -0
- package/dist/utils/zip_utils.js +169 -0
- package/dist/utils/zip_utils.js.map +1 -0
- package/dist/validation/index.d.ts +3 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +7 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/schemas.d.ts +273 -0
- package/dist/validation/schemas.d.ts.map +1 -0
- package/dist/validation/schemas.js +82 -0
- package/dist/validation/schemas.js.map +1 -0
- package/dist/validation/validate.d.ts +49 -0
- package/dist/validation/validate.d.ts.map +1 -0
- package/dist/validation/validate.js +110 -0
- package/dist/validation/validate.js.map +1 -0
- package/package.json +23 -13
package/dist/index.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Main entry point for the digitaltwin-core package
|
|
3
|
+
*
|
|
4
|
+
* This module provides the core functionality for building digital twin applications,
|
|
5
|
+
* including data collection, processing, asset management, and real-time synchronization.
|
|
6
|
+
*
|
|
7
|
+
* @version 1.0.0
|
|
8
|
+
* @author FARI Team
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { DigitalTwinEngine, Collector, AssetsManager } from 'digitaltwin-core';
|
|
13
|
+
*
|
|
14
|
+
* const engine = new DigitalTwinEngine({ ... });
|
|
15
|
+
* await engine.start();
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
// Core Engine
|
|
19
|
+
export { DigitalTwinEngine } from './engine/digital_twin_engine.js';
|
|
20
|
+
// Base Components
|
|
21
|
+
export { Collector } from './components/collector.js';
|
|
22
|
+
export { Harvester } from './components/harvester.js';
|
|
23
|
+
export { Handler } from './components/handler.js';
|
|
24
|
+
export { AssetsManager } from './components/assets_manager.js';
|
|
25
|
+
export { GlobalAssetsHandler } from './components/global_assets_handler.js';
|
|
26
|
+
export { CustomTableManager } from './components/custom_table_manager.js';
|
|
27
|
+
export { TilesetManager } from './components/tileset_manager.js';
|
|
28
|
+
export { isAsyncUploadable } from './components/async_upload.js';
|
|
29
|
+
// Storage Services
|
|
30
|
+
export { StorageService } from './storage/storage_service.js';
|
|
31
|
+
export { LocalStorageService } from './storage/adapters/local_storage_service.js';
|
|
32
|
+
export { OvhS3StorageService } from './storage/adapters/ovh_storage_service.js';
|
|
33
|
+
export { StorageServiceFactory } from './storage/storage_factory.js';
|
|
34
|
+
// Database Services
|
|
35
|
+
export { DatabaseAdapter } from './database/database_adapter.js';
|
|
36
|
+
export { KnexDatabaseAdapter } from './database/adapters/knex_database_adapter.js';
|
|
37
|
+
// Types and Interfaces
|
|
38
|
+
export * from './components/types.js';
|
|
39
|
+
export * from './components/interfaces.js';
|
|
40
|
+
export * from './types/data_record.js';
|
|
41
|
+
// Authentication
|
|
42
|
+
export * from './auth/index.js';
|
|
43
|
+
// Errors
|
|
44
|
+
export * from './errors/index.js';
|
|
45
|
+
// Validation
|
|
46
|
+
export * from './validation/index.js';
|
|
47
|
+
// Utilities
|
|
48
|
+
export { Logger, LogLevel } from './utils/logger.js';
|
|
49
|
+
export { safeAsync, tryAsync, safeCleanup, retryAsync } from './utils/safe_async.js';
|
|
50
|
+
export { setupGracefulShutdown } from './utils/graceful_shutdown.js';
|
|
51
|
+
export { mapToDataRecord } from './utils/map_to_data_record.js';
|
|
52
|
+
export { servableEndpoint } from './utils/servable_endpoint.js';
|
|
53
|
+
export { HttpStatus, jsonResponse, successResponse, errorResponse, badRequestResponse, unauthorizedResponse, forbiddenResponse, notFoundResponse, textResponse, fileResponse, multiStatusResponse } from './utils/http_responses.js';
|
|
54
|
+
// Engine Components
|
|
55
|
+
export { QueueManager } from './engine/queue_manager.js';
|
|
56
|
+
export { errorHandler, asyncHandler, notFoundHandler } from './engine/error_handler.js';
|
|
57
|
+
export { HealthChecker, createDatabaseCheck, createRedisCheck, createStorageCheck, performHealthCheck, livenessCheck } from './engine/health.js';
|
|
58
|
+
export { UploadProcessor } from './engine/upload_processor.js';
|
|
59
|
+
export { initializeComponents } from './engine/initializer.js';
|
|
60
|
+
export * from './engine/events.js';
|
|
61
|
+
export * from './engine/endpoints.js';
|
|
62
|
+
// OpenAPI Documentation Generation
|
|
63
|
+
export * from './openapi/index.js';
|
|
64
|
+
export { Env } from './env/env.js';
|
|
65
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,cAAc;AACd,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAEnE,kBAAkB;AAClB,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA;AAC3E,OAAO,EACH,kBAAkB,EAGrB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAA;AAChE,OAAO,EAAwB,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAEtF,mBAAmB;AACnB,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEpE,oBAAoB;AACpB,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAkC,MAAM,8CAA8C,CAAA;AAElH,uBAAuB;AACvB,cAAc,uBAAuB,CAAA;AACrC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AAEtC,iBAA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* This module provides utilities to automatically generate OpenAPI 3.0
|
|
5
|
+
* documentation from Digital Twin components that implement OpenAPIDocumentable.
|
|
6
|
+
*/
|
|
7
|
+
import type { OpenAPIDocument, OpenAPIGeneratorOptions, OpenAPISchema } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Generates OpenAPI 3.0 specifications from Digital Twin components.
|
|
10
|
+
*
|
|
11
|
+
* The generator aggregates OpenAPI specs from all components that implement
|
|
12
|
+
* the OpenAPIDocumentable interface and produces a complete OpenAPI document.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { OpenAPIGenerator } from 'digitaltwin-core'
|
|
17
|
+
* import * as components from './src/components'
|
|
18
|
+
*
|
|
19
|
+
* const spec = OpenAPIGenerator.generate({
|
|
20
|
+
* info: {
|
|
21
|
+
* title: 'My Digital Twin API',
|
|
22
|
+
* version: '1.0.0',
|
|
23
|
+
* description: 'API documentation'
|
|
24
|
+
* },
|
|
25
|
+
* components: Object.values(components),
|
|
26
|
+
* servers: [{ url: 'http://localhost:3000' }]
|
|
27
|
+
* })
|
|
28
|
+
*
|
|
29
|
+
* // Write to file
|
|
30
|
+
* OpenAPIGenerator.writeYAML(spec, './openapi.yaml')
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare class OpenAPIGenerator {
|
|
34
|
+
/**
|
|
35
|
+
* Generates an OpenAPI document from the provided components.
|
|
36
|
+
*
|
|
37
|
+
* @param options - Generation options including components and metadata
|
|
38
|
+
* @returns Complete OpenAPI document
|
|
39
|
+
*/
|
|
40
|
+
static generate(options: OpenAPIGeneratorOptions): OpenAPIDocument;
|
|
41
|
+
/**
|
|
42
|
+
* Returns default security schemes for APISIX/Keycloak authentication.
|
|
43
|
+
*/
|
|
44
|
+
private static getDefaultSecuritySchemes;
|
|
45
|
+
/**
|
|
46
|
+
* Converts an OpenAPI document to YAML string.
|
|
47
|
+
*
|
|
48
|
+
* @param document - OpenAPI document to convert
|
|
49
|
+
* @returns YAML string representation
|
|
50
|
+
*/
|
|
51
|
+
static toYAML(document: OpenAPIDocument): string;
|
|
52
|
+
/**
|
|
53
|
+
* Converts an OpenAPI document to JSON string.
|
|
54
|
+
*
|
|
55
|
+
* @param document - OpenAPI document to convert
|
|
56
|
+
* @param pretty - Whether to format with indentation (default: true)
|
|
57
|
+
* @returns JSON string representation
|
|
58
|
+
*/
|
|
59
|
+
static toJSON(document: OpenAPIDocument, pretty?: boolean): string;
|
|
60
|
+
/**
|
|
61
|
+
* Recursively converts an object to YAML format.
|
|
62
|
+
* Simple implementation without external dependencies.
|
|
63
|
+
*/
|
|
64
|
+
private static objectToYAML;
|
|
65
|
+
/**
|
|
66
|
+
* Helper to create a simple schema reference.
|
|
67
|
+
*/
|
|
68
|
+
static schemaRef(name: string): OpenAPISchema;
|
|
69
|
+
/**
|
|
70
|
+
* Helper to create a common response for 200 OK with content.
|
|
71
|
+
*/
|
|
72
|
+
static successResponse(contentType: string, schema: OpenAPISchema, description?: string): {
|
|
73
|
+
'200': {
|
|
74
|
+
description: string;
|
|
75
|
+
content: {
|
|
76
|
+
[contentType]: {
|
|
77
|
+
schema: OpenAPISchema;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Helper to create common error responses.
|
|
84
|
+
*/
|
|
85
|
+
static errorResponses(codes?: Array<400 | 401 | 403 | 404 | 500>): Record<string, {
|
|
86
|
+
description: string;
|
|
87
|
+
}>;
|
|
88
|
+
/**
|
|
89
|
+
* Common schemas used across components.
|
|
90
|
+
*/
|
|
91
|
+
static commonSchemas: Record<string, OpenAPISchema>;
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/openapi/generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACR,eAAe,EACf,uBAAuB,EAEvB,aAAa,EAGhB,MAAM,YAAY,CAAA;AAGnB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,gBAAgB;IACzB;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,uBAAuB,GAAG,eAAe;IAqFlE;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAWxC;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM;IAIhD;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,eAAe,EAAE,MAAM,UAAO,GAAG,MAAM;IAI/D;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAoF3B;;OAEG;IACH,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa;IAI7C;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,SAAwB;;;;gBAKtF,CAAC,WAAW,CAAC;;kBAAY;;;;IAMzC;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,GAAE,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAwB;qBACnC,MAAM;;IAiBzD;;OAEG;IACH,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAuClD;CACJ"}
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview OpenAPI specification generator for Digital Twin components
|
|
3
|
+
*
|
|
4
|
+
* This module provides utilities to automatically generate OpenAPI 3.0
|
|
5
|
+
* documentation from Digital Twin components that implement OpenAPIDocumentable.
|
|
6
|
+
*/
|
|
7
|
+
import { isOpenAPIDocumentable } from './types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Generates OpenAPI 3.0 specifications from Digital Twin components.
|
|
10
|
+
*
|
|
11
|
+
* The generator aggregates OpenAPI specs from all components that implement
|
|
12
|
+
* the OpenAPIDocumentable interface and produces a complete OpenAPI document.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* import { OpenAPIGenerator } from 'digitaltwin-core'
|
|
17
|
+
* import * as components from './src/components'
|
|
18
|
+
*
|
|
19
|
+
* const spec = OpenAPIGenerator.generate({
|
|
20
|
+
* info: {
|
|
21
|
+
* title: 'My Digital Twin API',
|
|
22
|
+
* version: '1.0.0',
|
|
23
|
+
* description: 'API documentation'
|
|
24
|
+
* },
|
|
25
|
+
* components: Object.values(components),
|
|
26
|
+
* servers: [{ url: 'http://localhost:3000' }]
|
|
27
|
+
* })
|
|
28
|
+
*
|
|
29
|
+
* // Write to file
|
|
30
|
+
* OpenAPIGenerator.writeYAML(spec, './openapi.yaml')
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export class OpenAPIGenerator {
|
|
34
|
+
/**
|
|
35
|
+
* Generates an OpenAPI document from the provided components.
|
|
36
|
+
*
|
|
37
|
+
* @param options - Generation options including components and metadata
|
|
38
|
+
* @returns Complete OpenAPI document
|
|
39
|
+
*/
|
|
40
|
+
static generate(options) {
|
|
41
|
+
const { info, servers, components, additionalSchemas, additionalTags, includeAuth = true } = options;
|
|
42
|
+
// Filter components that implement OpenAPIDocumentable
|
|
43
|
+
const documentableComponents = components.filter(isOpenAPIDocumentable);
|
|
44
|
+
// Aggregate paths, tags, and schemas from all components
|
|
45
|
+
const allPaths = {};
|
|
46
|
+
const allTags = additionalTags ? [...additionalTags] : [];
|
|
47
|
+
const allSchemas = additionalSchemas ? { ...additionalSchemas } : {};
|
|
48
|
+
const tagNames = new Set(additionalTags?.map(t => t.name) || []);
|
|
49
|
+
for (const component of documentableComponents) {
|
|
50
|
+
try {
|
|
51
|
+
const spec = component.getOpenAPISpec();
|
|
52
|
+
// Merge paths
|
|
53
|
+
for (const [path, pathItem] of Object.entries(spec.paths)) {
|
|
54
|
+
if (allPaths[path]) {
|
|
55
|
+
// Merge operations into existing path
|
|
56
|
+
allPaths[path] = { ...allPaths[path], ...pathItem };
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
allPaths[path] = pathItem;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// Merge tags (avoid duplicates)
|
|
63
|
+
if (spec.tags) {
|
|
64
|
+
for (const tag of spec.tags) {
|
|
65
|
+
if (!tagNames.has(tag.name)) {
|
|
66
|
+
allTags.push(tag);
|
|
67
|
+
tagNames.add(tag.name);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// Merge schemas
|
|
72
|
+
if (spec.schemas) {
|
|
73
|
+
Object.assign(allSchemas, spec.schemas);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
const componentName = 'getConfiguration' in component
|
|
78
|
+
? component.getConfiguration().name
|
|
79
|
+
: 'unknown';
|
|
80
|
+
console.warn(`Warning: Failed to get OpenAPI spec from component "${componentName}":`, error);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Sort tags alphabetically
|
|
84
|
+
allTags.sort((a, b) => a.name.localeCompare(b.name));
|
|
85
|
+
// Build components section
|
|
86
|
+
const componentsSection = {};
|
|
87
|
+
if (Object.keys(allSchemas).length > 0) {
|
|
88
|
+
componentsSection.schemas = allSchemas;
|
|
89
|
+
}
|
|
90
|
+
if (includeAuth) {
|
|
91
|
+
componentsSection.securitySchemes = this.getDefaultSecuritySchemes();
|
|
92
|
+
}
|
|
93
|
+
// Build final document
|
|
94
|
+
const document = {
|
|
95
|
+
openapi: '3.0.3',
|
|
96
|
+
info,
|
|
97
|
+
paths: allPaths
|
|
98
|
+
};
|
|
99
|
+
if (servers && servers.length > 0) {
|
|
100
|
+
document.servers = servers;
|
|
101
|
+
}
|
|
102
|
+
if (allTags.length > 0) {
|
|
103
|
+
document.tags = allTags;
|
|
104
|
+
}
|
|
105
|
+
if (Object.keys(componentsSection).length > 0) {
|
|
106
|
+
document.components = componentsSection;
|
|
107
|
+
}
|
|
108
|
+
return document;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Returns default security schemes for APISIX/Keycloak authentication.
|
|
112
|
+
*/
|
|
113
|
+
static getDefaultSecuritySchemes() {
|
|
114
|
+
return {
|
|
115
|
+
ApiKeyAuth: {
|
|
116
|
+
type: 'apiKey',
|
|
117
|
+
in: 'header',
|
|
118
|
+
name: 'x-user-id',
|
|
119
|
+
description: 'Keycloak user ID (forwarded by APISIX)'
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Converts an OpenAPI document to YAML string.
|
|
125
|
+
*
|
|
126
|
+
* @param document - OpenAPI document to convert
|
|
127
|
+
* @returns YAML string representation
|
|
128
|
+
*/
|
|
129
|
+
static toYAML(document) {
|
|
130
|
+
return this.objectToYAML(document, 0);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Converts an OpenAPI document to JSON string.
|
|
134
|
+
*
|
|
135
|
+
* @param document - OpenAPI document to convert
|
|
136
|
+
* @param pretty - Whether to format with indentation (default: true)
|
|
137
|
+
* @returns JSON string representation
|
|
138
|
+
*/
|
|
139
|
+
static toJSON(document, pretty = true) {
|
|
140
|
+
return JSON.stringify(document, null, pretty ? 2 : undefined);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Recursively converts an object to YAML format.
|
|
144
|
+
* Simple implementation without external dependencies.
|
|
145
|
+
*/
|
|
146
|
+
static objectToYAML(obj, indent) {
|
|
147
|
+
const spaces = ' '.repeat(indent);
|
|
148
|
+
if (obj === null || obj === undefined) {
|
|
149
|
+
return 'null';
|
|
150
|
+
}
|
|
151
|
+
if (typeof obj === 'string') {
|
|
152
|
+
// Check if string needs quoting
|
|
153
|
+
if (obj === '' ||
|
|
154
|
+
obj.includes(':') ||
|
|
155
|
+
obj.includes('#') ||
|
|
156
|
+
obj.includes('\n') ||
|
|
157
|
+
obj.includes('"') ||
|
|
158
|
+
obj.includes("'") ||
|
|
159
|
+
obj.startsWith(' ') ||
|
|
160
|
+
obj.endsWith(' ') ||
|
|
161
|
+
obj === 'true' ||
|
|
162
|
+
obj === 'false' ||
|
|
163
|
+
obj === 'null' ||
|
|
164
|
+
/^[\d.]+$/.test(obj)) {
|
|
165
|
+
// Use double quotes and escape
|
|
166
|
+
return `"${obj.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n')}"`;
|
|
167
|
+
}
|
|
168
|
+
return obj;
|
|
169
|
+
}
|
|
170
|
+
if (typeof obj === 'number' || typeof obj === 'boolean') {
|
|
171
|
+
return String(obj);
|
|
172
|
+
}
|
|
173
|
+
if (Array.isArray(obj)) {
|
|
174
|
+
if (obj.length === 0) {
|
|
175
|
+
return '[]';
|
|
176
|
+
}
|
|
177
|
+
const items = obj.map(item => {
|
|
178
|
+
const value = this.objectToYAML(item, indent + 1);
|
|
179
|
+
if (typeof item === 'object' && item !== null && !Array.isArray(item)) {
|
|
180
|
+
// Object in array - put first property on same line as dash
|
|
181
|
+
const lines = value.split('\n');
|
|
182
|
+
if (lines.length > 0) {
|
|
183
|
+
return `${spaces}- ${lines[0].trimStart()}\n${lines.slice(1).join('\n')}`;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return `${spaces}- ${value}`;
|
|
187
|
+
});
|
|
188
|
+
return items.join('\n').replace(/\n+$/, '');
|
|
189
|
+
}
|
|
190
|
+
if (typeof obj === 'object') {
|
|
191
|
+
const entries = Object.entries(obj);
|
|
192
|
+
if (entries.length === 0) {
|
|
193
|
+
return '{}';
|
|
194
|
+
}
|
|
195
|
+
const lines = entries.map(([key, value]) => {
|
|
196
|
+
// Handle special keys that need quoting
|
|
197
|
+
const quotedKey = /[:\s#[\]{}]/.test(key) ? `"${key}"` : key;
|
|
198
|
+
if (value === null || value === undefined) {
|
|
199
|
+
return `${spaces}${quotedKey}: null`;
|
|
200
|
+
}
|
|
201
|
+
if (typeof value === 'object' && !Array.isArray(value) && Object.keys(value).length > 0) {
|
|
202
|
+
return `${spaces}${quotedKey}:\n${this.objectToYAML(value, indent + 1)}`;
|
|
203
|
+
}
|
|
204
|
+
if (Array.isArray(value) && value.length > 0) {
|
|
205
|
+
return `${spaces}${quotedKey}:\n${this.objectToYAML(value, indent + 1)}`;
|
|
206
|
+
}
|
|
207
|
+
return `${spaces}${quotedKey}: ${this.objectToYAML(value, indent + 1)}`;
|
|
208
|
+
});
|
|
209
|
+
return lines.join('\n');
|
|
210
|
+
}
|
|
211
|
+
return String(obj);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Helper to create a simple schema reference.
|
|
215
|
+
*/
|
|
216
|
+
static schemaRef(name) {
|
|
217
|
+
return { $ref: `#/components/schemas/${name}` };
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Helper to create a common response for 200 OK with content.
|
|
221
|
+
*/
|
|
222
|
+
static successResponse(contentType, schema, description = 'Successful response') {
|
|
223
|
+
return {
|
|
224
|
+
'200': {
|
|
225
|
+
description,
|
|
226
|
+
content: {
|
|
227
|
+
[contentType]: { schema }
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Helper to create common error responses.
|
|
234
|
+
*/
|
|
235
|
+
static errorResponses(codes = [400, 401, 404, 500]) {
|
|
236
|
+
const responses = {};
|
|
237
|
+
const descriptions = {
|
|
238
|
+
400: 'Bad request',
|
|
239
|
+
401: 'Unauthorized',
|
|
240
|
+
403: 'Forbidden',
|
|
241
|
+
404: 'Not found',
|
|
242
|
+
500: 'Internal server error'
|
|
243
|
+
};
|
|
244
|
+
for (const code of codes) {
|
|
245
|
+
responses[String(code)] = { description: descriptions[code] };
|
|
246
|
+
}
|
|
247
|
+
return responses;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Common schemas used across components.
|
|
251
|
+
*/
|
|
252
|
+
static { this.commonSchemas = {
|
|
253
|
+
Error: {
|
|
254
|
+
type: 'object',
|
|
255
|
+
properties: {
|
|
256
|
+
error: { type: 'string' },
|
|
257
|
+
message: { type: 'string' }
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
Point: {
|
|
261
|
+
type: 'object',
|
|
262
|
+
required: ['type', 'coordinates'],
|
|
263
|
+
properties: {
|
|
264
|
+
type: { type: 'string', enum: ['Point'] },
|
|
265
|
+
coordinates: {
|
|
266
|
+
type: 'array',
|
|
267
|
+
items: { type: 'number' }
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
Feature: {
|
|
272
|
+
type: 'object',
|
|
273
|
+
required: ['type', 'geometry', 'properties'],
|
|
274
|
+
properties: {
|
|
275
|
+
type: { type: 'string', enum: ['Feature'] },
|
|
276
|
+
geometry: { type: 'object' },
|
|
277
|
+
properties: { type: 'object' }
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
FeatureCollection: {
|
|
281
|
+
type: 'object',
|
|
282
|
+
required: ['type', 'features'],
|
|
283
|
+
properties: {
|
|
284
|
+
type: { type: 'string', enum: ['FeatureCollection'] },
|
|
285
|
+
features: {
|
|
286
|
+
type: 'array',
|
|
287
|
+
items: { $ref: '#/components/schemas/Feature' }
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}; }
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/openapi/generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,gBAAgB;IACzB;;;;;OAKG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EAAE,QAAQ;YACd,QAAQ,EAAE,CAAC,MAAM,EAAE,UAAU,CAAC;YAC9B,UAAU,EAAE;gBACR,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,mBAAmB,CAAC,EAAE;gBACrD,QAAQ,EAAE;oBACN,IAAI,EAAE,OAAO;oBACb,KAAK,EAAE,EAAE,IAAI,EAAE,8BAA8B,EAAE;iBAClD;aACJ;SACJ;KACJ,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview OpenAPI documentation generation module
|
|
3
|
+
*
|
|
4
|
+
* This module exports utilities for generating OpenAPI 3.0 specifications
|
|
5
|
+
* from Digital Twin components.
|
|
6
|
+
*/
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export * from './generator.js';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/openapi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview OpenAPI documentation generation module
|
|
3
|
+
*
|
|
4
|
+
* This module exports utilities for generating OpenAPI 3.0 specifications
|
|
5
|
+
* from Digital Twin components.
|
|
6
|
+
*/
|
|
7
|
+
export * from './types.js';
|
|
8
|
+
export * from './generator.js';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/openapi/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|