digitaltwin-core 0.13.3 → 0.14.1
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/package.json +101 -106
- package/dist/auth/apisix_parser.d.ts +0 -146
- package/dist/auth/apisix_parser.d.ts.map +0 -1
- package/dist/auth/apisix_parser.js +0 -185
- package/dist/auth/apisix_parser.js.map +0 -1
- package/dist/auth/auth_config.d.ts +0 -126
- package/dist/auth/auth_config.d.ts.map +0 -1
- package/dist/auth/auth_config.js +0 -169
- package/dist/auth/auth_config.js.map +0 -1
- package/dist/auth/index.d.ts +0 -5
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -4
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/types.d.ts +0 -100
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js +0 -2
- package/dist/auth/types.js.map +0 -1
- package/dist/auth/user_service.d.ts +0 -86
- package/dist/auth/user_service.d.ts.map +0 -1
- package/dist/auth/user_service.js +0 -237
- package/dist/auth/user_service.js.map +0 -1
- package/dist/components/assets_manager.d.ts +0 -662
- package/dist/components/assets_manager.d.ts.map +0 -1
- package/dist/components/assets_manager.js +0 -1529
- package/dist/components/assets_manager.js.map +0 -1
- package/dist/components/async_upload.d.ts +0 -20
- package/dist/components/async_upload.d.ts.map +0 -1
- package/dist/components/async_upload.js +0 -10
- package/dist/components/async_upload.js.map +0 -1
- package/dist/components/collector.d.ts +0 -203
- package/dist/components/collector.d.ts.map +0 -1
- package/dist/components/collector.js +0 -202
- package/dist/components/collector.js.map +0 -1
- package/dist/components/custom_table_manager.d.ts +0 -503
- package/dist/components/custom_table_manager.d.ts.map +0 -1
- package/dist/components/custom_table_manager.js +0 -1052
- package/dist/components/custom_table_manager.js.map +0 -1
- package/dist/components/global_assets_handler.d.ts +0 -63
- package/dist/components/global_assets_handler.d.ts.map +0 -1
- package/dist/components/global_assets_handler.js +0 -127
- package/dist/components/global_assets_handler.js.map +0 -1
- package/dist/components/handler.d.ts +0 -104
- package/dist/components/handler.d.ts.map +0 -1
- package/dist/components/handler.js +0 -110
- package/dist/components/handler.js.map +0 -1
- package/dist/components/harvester.d.ts +0 -182
- package/dist/components/harvester.d.ts.map +0 -1
- package/dist/components/harvester.js +0 -393
- package/dist/components/harvester.js.map +0 -1
- package/dist/components/index.d.ts +0 -11
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -9
- package/dist/components/index.js.map +0 -1
- package/dist/components/interfaces.d.ts +0 -126
- package/dist/components/interfaces.d.ts.map +0 -1
- package/dist/components/interfaces.js +0 -8
- package/dist/components/interfaces.js.map +0 -1
- package/dist/components/map_manager.d.ts +0 -61
- package/dist/components/map_manager.d.ts.map +0 -1
- package/dist/components/map_manager.js +0 -242
- package/dist/components/map_manager.js.map +0 -1
- package/dist/components/tileset_manager.d.ts +0 -125
- package/dist/components/tileset_manager.d.ts.map +0 -1
- package/dist/components/tileset_manager.js +0 -618
- package/dist/components/tileset_manager.js.map +0 -1
- package/dist/components/types.d.ts +0 -226
- package/dist/components/types.d.ts.map +0 -1
- package/dist/components/types.js +0 -8
- package/dist/components/types.js.map +0 -1
- package/dist/database/adapters/knex_database_adapter.d.ts +0 -92
- package/dist/database/adapters/knex_database_adapter.d.ts.map +0 -1
- package/dist/database/adapters/knex_database_adapter.js +0 -647
- package/dist/database/adapters/knex_database_adapter.js.map +0 -1
- package/dist/database/database_adapter.d.ts +0 -251
- package/dist/database/database_adapter.d.ts.map +0 -1
- package/dist/database/database_adapter.js +0 -46
- package/dist/database/database_adapter.js.map +0 -1
- package/dist/engine/digital_twin_engine.d.ts +0 -253
- package/dist/engine/digital_twin_engine.d.ts.map +0 -1
- package/dist/engine/digital_twin_engine.js +0 -790
- package/dist/engine/digital_twin_engine.js.map +0 -1
- package/dist/engine/endpoints.d.ts +0 -47
- package/dist/engine/endpoints.d.ts.map +0 -1
- package/dist/engine/endpoints.js +0 -56
- package/dist/engine/endpoints.js.map +0 -1
- package/dist/engine/events.d.ts +0 -93
- package/dist/engine/events.d.ts.map +0 -1
- package/dist/engine/events.js +0 -71
- package/dist/engine/events.js.map +0 -1
- package/dist/engine/initializer.d.ts +0 -62
- package/dist/engine/initializer.d.ts.map +0 -1
- package/dist/engine/initializer.js +0 -108
- package/dist/engine/initializer.js.map +0 -1
- package/dist/engine/queue_manager.d.ts +0 -87
- package/dist/engine/queue_manager.d.ts.map +0 -1
- package/dist/engine/queue_manager.js +0 -196
- package/dist/engine/queue_manager.js.map +0 -1
- package/dist/engine/scheduler.d.ts +0 -30
- package/dist/engine/scheduler.d.ts.map +0 -1
- package/dist/engine/scheduler.js +0 -370
- package/dist/engine/scheduler.js.map +0 -1
- package/dist/engine/upload_processor.d.ts +0 -36
- package/dist/engine/upload_processor.d.ts.map +0 -1
- package/dist/engine/upload_processor.js +0 -101
- package/dist/engine/upload_processor.js.map +0 -1
- package/dist/env/env.d.ts +0 -134
- package/dist/env/env.d.ts.map +0 -1
- package/dist/env/env.js +0 -177
- package/dist/env/env.js.map +0 -1
- package/dist/index.d.ts +0 -49
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -57
- package/dist/index.js.map +0 -1
- package/dist/openapi/generator.d.ts +0 -93
- package/dist/openapi/generator.d.ts.map +0 -1
- package/dist/openapi/generator.js +0 -293
- package/dist/openapi/generator.js.map +0 -1
- package/dist/openapi/index.d.ts +0 -9
- package/dist/openapi/index.d.ts.map +0 -1
- package/dist/openapi/index.js +0 -9
- package/dist/openapi/index.js.map +0 -1
- package/dist/openapi/types.d.ts +0 -182
- package/dist/openapi/types.d.ts.map +0 -1
- package/dist/openapi/types.js +0 -16
- package/dist/openapi/types.js.map +0 -1
- package/dist/storage/adapters/local_storage_service.d.ts +0 -51
- package/dist/storage/adapters/local_storage_service.d.ts.map +0 -1
- package/dist/storage/adapters/local_storage_service.js +0 -110
- package/dist/storage/adapters/local_storage_service.js.map +0 -1
- package/dist/storage/adapters/ovh_storage_service.d.ts +0 -61
- package/dist/storage/adapters/ovh_storage_service.d.ts.map +0 -1
- package/dist/storage/adapters/ovh_storage_service.js +0 -172
- package/dist/storage/adapters/ovh_storage_service.js.map +0 -1
- package/dist/storage/storage_factory.d.ts +0 -14
- package/dist/storage/storage_factory.d.ts.map +0 -1
- package/dist/storage/storage_factory.js +0 -36
- package/dist/storage/storage_factory.js.map +0 -1
- package/dist/storage/storage_service.d.ts +0 -163
- package/dist/storage/storage_service.d.ts.map +0 -1
- package/dist/storage/storage_service.js +0 -54
- package/dist/storage/storage_service.js.map +0 -1
- package/dist/types/data_record.d.ts +0 -123
- package/dist/types/data_record.d.ts.map +0 -1
- package/dist/types/data_record.js +0 -8
- package/dist/types/data_record.js.map +0 -1
- package/dist/utils/http_responses.d.ts +0 -155
- package/dist/utils/http_responses.d.ts.map +0 -1
- package/dist/utils/http_responses.js +0 -190
- package/dist/utils/http_responses.js.map +0 -1
- package/dist/utils/index.d.ts +0 -8
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -6
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -74
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -92
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/map_to_data_record.d.ts +0 -10
- package/dist/utils/map_to_data_record.d.ts.map +0 -1
- package/dist/utils/map_to_data_record.js +0 -36
- package/dist/utils/map_to_data_record.js.map +0 -1
- package/dist/utils/servable_endpoint.d.ts +0 -63
- package/dist/utils/servable_endpoint.d.ts.map +0 -1
- package/dist/utils/servable_endpoint.js +0 -67
- package/dist/utils/servable_endpoint.js.map +0 -1
- package/dist/utils/zip_utils.d.ts +0 -66
- package/dist/utils/zip_utils.d.ts.map +0 -1
- package/dist/utils/zip_utils.js +0 -169
- package/dist/utils/zip_utils.js.map +0 -1
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Type definitions for digital twin component configurations
|
|
3
|
-
*
|
|
4
|
-
* This module defines the configuration interfaces used by all digital twin
|
|
5
|
-
* components including collectors, harvesters, handlers, and asset managers.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Base configuration interface for all digital twin components.
|
|
9
|
-
*
|
|
10
|
-
* Every component must provide this minimal configuration to identify
|
|
11
|
-
* itself within the system and define its data handling characteristics.
|
|
12
|
-
*
|
|
13
|
-
* @interface ComponentConfiguration
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```typescript
|
|
17
|
-
* const config: ComponentConfiguration = {
|
|
18
|
-
* name: 'weather-collector',
|
|
19
|
-
* description: 'Collects weather data from external API',
|
|
20
|
-
* contentType: 'application/json',
|
|
21
|
-
* tags: ['weather', 'external-api'],
|
|
22
|
-
* extension: '.json'
|
|
23
|
-
* }
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export interface ComponentConfiguration {
|
|
27
|
-
/** Unique identifier for the component (used as table name and endpoint prefix) */
|
|
28
|
-
name: string;
|
|
29
|
-
/** Human-readable description of what this component does */
|
|
30
|
-
description: string;
|
|
31
|
-
/** MIME type of the data this component produces or handles */
|
|
32
|
-
contentType: string;
|
|
33
|
-
/** Optional tags for categorization and filtering */
|
|
34
|
-
tags?: string[];
|
|
35
|
-
/** Allowed file extension for uploads (e.g., '.glb', '.json'). If set, POST/PUT operations will validate file extensions. */
|
|
36
|
-
extension?: string;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Configuration for AssetsManager components.
|
|
40
|
-
*
|
|
41
|
-
* Extends base configuration with endpoint definition for file management operations.
|
|
42
|
-
*
|
|
43
|
-
* @interface AssetsManagerConfiguration
|
|
44
|
-
* @extends {ComponentConfiguration}
|
|
45
|
-
*/
|
|
46
|
-
export interface AssetsManagerConfiguration extends ComponentConfiguration {
|
|
47
|
-
/** HTTP endpoint path for asset CRUD operations (e.g., 'api/assets') */
|
|
48
|
-
endpoint: string;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Configuration for Collector components.
|
|
52
|
-
*
|
|
53
|
-
* Collectors fetch data from external sources on a scheduled basis
|
|
54
|
-
* and expose endpoints for retrieving the collected data.
|
|
55
|
-
*
|
|
56
|
-
* @interface CollectorConfiguration
|
|
57
|
-
* @extends {ComponentConfiguration}
|
|
58
|
-
*/
|
|
59
|
-
export interface CollectorConfiguration extends ComponentConfiguration {
|
|
60
|
-
/** HTTP endpoint path for retrieving collected data (e.g., 'api/weather') */
|
|
61
|
-
endpoint: string;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Configuration for Harvester components.
|
|
65
|
-
*
|
|
66
|
-
* Harvesters process data collected by Collectors, applying transformations,
|
|
67
|
-
* aggregations, or analysis. They can be triggered by new source data
|
|
68
|
-
* or run on a schedule.
|
|
69
|
-
*
|
|
70
|
-
* @interface HarvesterConfiguration
|
|
71
|
-
* @extends {ComponentConfiguration}
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* ```typescript
|
|
75
|
-
* const config: HarvesterConfiguration = {
|
|
76
|
-
* name: 'traffic-analysis',
|
|
77
|
-
* description: 'Analyzes traffic patterns',
|
|
78
|
-
* contentType: 'application/json',
|
|
79
|
-
* endpoint: 'api/traffic-analysis',
|
|
80
|
-
* source: 'traffic-collector',
|
|
81
|
-
* source_range: '1h',
|
|
82
|
-
* triggerMode: 'on-source',
|
|
83
|
-
* dependencies: ['weather-collector'],
|
|
84
|
-
* dependenciesLimit: [1]
|
|
85
|
-
* }
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
export interface HarvesterConfiguration extends ComponentConfiguration {
|
|
89
|
-
/**
|
|
90
|
-
* Source range definition for data retrieval.
|
|
91
|
-
*
|
|
92
|
-
* Time-based formats: "3d" (days), "6h" (hours), "30m" (minutes), "120s" (seconds)
|
|
93
|
-
* Count-based: number (e.g., 10 for last 10 records)
|
|
94
|
-
*/
|
|
95
|
-
source_range?: string | number;
|
|
96
|
-
/** If true, requires exact limit to be met before processing (strict mode) */
|
|
97
|
-
source_range_min?: boolean;
|
|
98
|
-
/** If true, stores multiple results instead of single result */
|
|
99
|
-
multiple_results?: boolean;
|
|
100
|
-
/** HTTP endpoint path for retrieving harvested data */
|
|
101
|
-
endpoint: string;
|
|
102
|
-
/** Source component name to harvest data from */
|
|
103
|
-
source?: string;
|
|
104
|
-
/** List of dependent component names for additional data */
|
|
105
|
-
dependencies?: string[];
|
|
106
|
-
/** Record limits for each dependency (corresponds to dependencies array index) */
|
|
107
|
-
dependenciesLimit?: number[];
|
|
108
|
-
/**
|
|
109
|
-
* Trigger mode for the harvester execution.
|
|
110
|
-
*
|
|
111
|
-
* - 'schedule': Runs on cron schedule from getSchedule()
|
|
112
|
-
* - 'on-source': Triggered when source collector completes
|
|
113
|
-
* - 'both': Both scheduled and event-driven execution
|
|
114
|
-
*/
|
|
115
|
-
triggerMode?: 'schedule' | 'on-source' | 'both';
|
|
116
|
-
/**
|
|
117
|
-
* Debounce delay in milliseconds for on-source triggers.
|
|
118
|
-
* Prevents rapid re-execution when source updates frequently.
|
|
119
|
-
* Default: 1000ms
|
|
120
|
-
*/
|
|
121
|
-
debounceMs?: number;
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Configuration for assets (deprecated, use AssetsManagerConfiguration).
|
|
125
|
-
*
|
|
126
|
-
* @interface AssetsConfiguration
|
|
127
|
-
* @extends {ComponentConfiguration}
|
|
128
|
-
* @deprecated Use AssetsManagerConfiguration instead
|
|
129
|
-
*/
|
|
130
|
-
export interface AssetsConfiguration extends ComponentConfiguration {
|
|
131
|
-
/** HTTP endpoint path */
|
|
132
|
-
endpoint: string;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Standard HTTP response structure for component endpoints.
|
|
136
|
-
*
|
|
137
|
-
* All component handlers return this structure to provide consistent
|
|
138
|
-
* API responses across the digital twin system.
|
|
139
|
-
*
|
|
140
|
-
* @interface DataResponse
|
|
141
|
-
*
|
|
142
|
-
* @example
|
|
143
|
-
* ```typescript
|
|
144
|
-
* // Success response with JSON data
|
|
145
|
-
* const response: DataResponse = {
|
|
146
|
-
* status: 200,
|
|
147
|
-
* content: JSON.stringify({ data: 'value' }),
|
|
148
|
-
* headers: { 'Content-Type': 'application/json' }
|
|
149
|
-
* }
|
|
150
|
-
*
|
|
151
|
-
* // Binary response for file download
|
|
152
|
-
* const fileResponse: DataResponse = {
|
|
153
|
-
* status: 200,
|
|
154
|
-
* content: fileBuffer,
|
|
155
|
-
* headers: {
|
|
156
|
-
* 'Content-Type': 'application/octet-stream',
|
|
157
|
-
* 'Content-Disposition': 'attachment; filename="data.bin"'
|
|
158
|
-
* }
|
|
159
|
-
* }
|
|
160
|
-
* ```
|
|
161
|
-
*/
|
|
162
|
-
export interface DataResponse {
|
|
163
|
-
/** HTTP status code (200, 400, 401, 404, 500, etc.) */
|
|
164
|
-
status: number;
|
|
165
|
-
/** Response body (Buffer for binary, string for text/JSON) */
|
|
166
|
-
content: Buffer | string;
|
|
167
|
-
/** Optional HTTP headers to include in response */
|
|
168
|
-
headers?: Record<string, string>;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Configuration for CustomTableManager components.
|
|
172
|
-
*
|
|
173
|
-
* Allows defining custom database tables with arbitrary columns
|
|
174
|
-
* and optional custom endpoints for specialized data management.
|
|
175
|
-
*
|
|
176
|
-
* @interface StoreConfiguration
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* ```typescript
|
|
180
|
-
* const config: StoreConfiguration = {
|
|
181
|
-
* name: 'wms_layers',
|
|
182
|
-
* description: 'Manage WMS map layers',
|
|
183
|
-
* columns: {
|
|
184
|
-
* wms_url: 'text not null',
|
|
185
|
-
* layer_name: 'text not null',
|
|
186
|
-
* active: 'boolean default true'
|
|
187
|
-
* },
|
|
188
|
-
* endpoints: [
|
|
189
|
-
* { path: '/toggle/:id', method: 'put', handler: 'toggleLayer' }
|
|
190
|
-
* ]
|
|
191
|
-
* }
|
|
192
|
-
* ```
|
|
193
|
-
*/
|
|
194
|
-
export interface StoreConfiguration {
|
|
195
|
-
/** Name of the store (used as database table name) */
|
|
196
|
-
name: string;
|
|
197
|
-
/** Human-readable description of what this store manages */
|
|
198
|
-
description: string;
|
|
199
|
-
/**
|
|
200
|
-
* Database columns definition.
|
|
201
|
-
* Key: column name, Value: SQL type definition (e.g., 'text not null', 'integer', 'boolean default true')
|
|
202
|
-
*/
|
|
203
|
-
columns: {
|
|
204
|
-
[columnName: string]: string;
|
|
205
|
-
};
|
|
206
|
-
/** Custom endpoints beyond the standard CRUD operations */
|
|
207
|
-
endpoints?: EndpointDefinition[];
|
|
208
|
-
/** Optional tags for categorization and OpenAPI documentation */
|
|
209
|
-
tags?: string[];
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Definition for a custom HTTP endpoint on a CustomTableManager.
|
|
213
|
-
*
|
|
214
|
-
* @interface EndpointDefinition
|
|
215
|
-
*/
|
|
216
|
-
export interface EndpointDefinition {
|
|
217
|
-
/** HTTP path relative to store name (e.g., "/toggle/:id", "/batch") */
|
|
218
|
-
path: string;
|
|
219
|
-
/** HTTP method for this endpoint */
|
|
220
|
-
method: 'get' | 'post' | 'put' | 'delete';
|
|
221
|
-
/** Name of the method in the manager class to handle this endpoint */
|
|
222
|
-
handler: string;
|
|
223
|
-
/** Optional response content type (defaults to 'application/json') */
|
|
224
|
-
responseType?: string;
|
|
225
|
-
}
|
|
226
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,sBAAsB;IACnC,mFAAmF;IACnF,IAAI,EAAE,MAAM,CAAA;IACZ,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAA;IACnB,+DAA+D;IAC/D,WAAW,EAAE,MAA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xB,mDAAmD;IACnD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACnC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,kBAAkB;IAC/B,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAA;IACZ,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,OAAO,EAAE;QACL,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAA;KAC/B,CAAA;IACD,2DAA2D;IAC3D,SAAS,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAChC,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IAC/B,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAA;IACZ,oCAAoC;IACpC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,CAAA;IACzC,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAA;IACf,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAA;CACxB"}
|
package/dist/components/types.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Type definitions for digital twin component configurations
|
|
3
|
-
*
|
|
4
|
-
* This module defines the configuration interfaces used by all digital twin
|
|
5
|
-
* components including collectors, harvesters, handlers, and asset managers.
|
|
6
|
-
*/
|
|
7
|
-
export {};
|
|
8
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/components/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { Knex } from 'knex';
|
|
2
|
-
import type { MetadataRow } from '../database_adapter.js';
|
|
3
|
-
import { DatabaseAdapter } from '../database_adapter.js';
|
|
4
|
-
import type { DataRecord } from '../../types/data_record.js';
|
|
5
|
-
import type { StorageService } from '../../storage/storage_service.js';
|
|
6
|
-
export interface PostgreSQLConfig {
|
|
7
|
-
host: string;
|
|
8
|
-
port?: number;
|
|
9
|
-
user: string;
|
|
10
|
-
password: string;
|
|
11
|
-
database: string;
|
|
12
|
-
ssl?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export interface SQLiteConfig {
|
|
15
|
-
filename: string;
|
|
16
|
-
client?: 'sqlite3' | 'better-sqlite3';
|
|
17
|
-
enableForeignKeys?: boolean;
|
|
18
|
-
busyTimeout?: number;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Knex-based implementation with extended querying capabilities.
|
|
22
|
-
*/
|
|
23
|
-
export declare class KnexDatabaseAdapter extends DatabaseAdapter {
|
|
24
|
-
#private;
|
|
25
|
-
constructor(config: Knex.Config, storage: StorageService);
|
|
26
|
-
/**
|
|
27
|
-
* Create a KnexDatabaseAdapter for PostgreSQL with simplified configuration
|
|
28
|
-
*/
|
|
29
|
-
static forPostgreSQL(pgConfig: PostgreSQLConfig, storage: StorageService, _tableName?: string): KnexDatabaseAdapter;
|
|
30
|
-
/**
|
|
31
|
-
* Create a KnexDatabaseAdapter for SQLite with simplified configuration
|
|
32
|
-
*/
|
|
33
|
-
static forSQLite(sqliteConfig: SQLiteConfig, storage: StorageService, _tableName?: string): KnexDatabaseAdapter;
|
|
34
|
-
save(meta: MetadataRow): Promise<DataRecord>;
|
|
35
|
-
delete(id: string, name: string): Promise<void>;
|
|
36
|
-
getById(id: string, name: string): Promise<DataRecord | undefined>;
|
|
37
|
-
getLatestByName(name: string): Promise<DataRecord | undefined>;
|
|
38
|
-
doesTableExists(name: string): Promise<boolean>;
|
|
39
|
-
createTable(name: string): Promise<void>;
|
|
40
|
-
createTableWithColumns(name: string, columns: Record<string, string>): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Migrate existing table schema to match expected schema.
|
|
43
|
-
*
|
|
44
|
-
* Automatically adds missing columns and indexes for asset tables.
|
|
45
|
-
* Only performs safe operations (adding columns with defaults or nullable).
|
|
46
|
-
*
|
|
47
|
-
* @param {string} name - Table name to migrate
|
|
48
|
-
* @returns {Promise<string[]>} Array of migration messages describing what was done
|
|
49
|
-
*/
|
|
50
|
-
migrateTableSchema(name: string): Promise<string[]>;
|
|
51
|
-
getFirstByName(name: string): Promise<DataRecord | undefined>;
|
|
52
|
-
getByDateRange(name: string, startDate: Date, endDate?: Date, limit?: number): Promise<DataRecord[]>;
|
|
53
|
-
getAfterDate(name: string, afterDate: Date, limit?: number): Promise<DataRecord[]>;
|
|
54
|
-
getLatestBefore(name: string, beforeDate: Date): Promise<DataRecord | undefined>;
|
|
55
|
-
getLatestRecordsBefore(name: string, beforeDate: Date, limit: number): Promise<DataRecord[]>;
|
|
56
|
-
hasRecordsAfterDate(name: string, afterDate: Date): Promise<boolean>;
|
|
57
|
-
countByDateRange(name: string, startDate: Date, endDate?: Date): Promise<number>;
|
|
58
|
-
saveBatch(metadataList: MetadataRow[]): Promise<DataRecord[]>;
|
|
59
|
-
deleteBatch(deleteRequests: Array<{
|
|
60
|
-
id: string;
|
|
61
|
-
name: string;
|
|
62
|
-
}>): Promise<void>;
|
|
63
|
-
getByIdsBatch(requests: Array<{
|
|
64
|
-
id: string;
|
|
65
|
-
name: string;
|
|
66
|
-
}>): Promise<DataRecord[]>;
|
|
67
|
-
getAllAssetsPaginated(name: string, offset?: number, limit?: number): Promise<{
|
|
68
|
-
records: DataRecord[];
|
|
69
|
-
total: number;
|
|
70
|
-
}>;
|
|
71
|
-
findByConditions(tableName: string, conditions: Record<string, any>): Promise<DataRecord[]>;
|
|
72
|
-
updateById(tableName: string, id: number, data: Record<string, any>): Promise<void>;
|
|
73
|
-
close(): Promise<void>;
|
|
74
|
-
/**
|
|
75
|
-
* Find records for custom tables (returns raw database rows, not DataRecords)
|
|
76
|
-
* This bypasses mapToDataRecord() which assumes standard table structure
|
|
77
|
-
*/
|
|
78
|
-
findCustomTableRecords(tableName: string, conditions?: Record<string, any>): Promise<any[]>;
|
|
79
|
-
/**
|
|
80
|
-
* Get a single custom table record by ID (returns raw database row, not DataRecord)
|
|
81
|
-
*/
|
|
82
|
-
getCustomTableRecordById(tableName: string, id: number): Promise<any | null>;
|
|
83
|
-
/**
|
|
84
|
-
* Insert a record into a custom table (returns the new record ID)
|
|
85
|
-
*/
|
|
86
|
-
insertCustomTableRecord(tableName: string, data: Record<string, any>): Promise<number>;
|
|
87
|
-
/**
|
|
88
|
-
* Get the underlying Knex instance for advanced operations
|
|
89
|
-
*/
|
|
90
|
-
getKnex(): Knex;
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=knex_database_adapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"knex_database_adapter.d.ts","sourceRoot":"","sources":["../../../src/database/adapters/knex_database_adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAEhC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAA;AAGtE,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAA;CAChB;AAED,MAAM,WAAW,YAAY;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,SAAS,GAAG,gBAAgB,CAAA;IACrC,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3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