@tmlmobilidade/go-interfaces-labdb 20260811.1505.45 → 20260828.1636.54

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,28 @@
1
1
  import { ClickHouseInterfaceTemplate } from '../interface.template.js';
2
2
  import { ClickHouseClient } from '@tmlmobilidade/go-clients-clickhouse';
3
+ import { HashedShape, type HashedTrip, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality } from '@tmlmobilidade/go-types-operation';
4
+ import { type Ride } from '@tmlmobilidade/go-types-operation';
3
5
  import { type SimplifiedVehicleEvent } from '@tmlmobilidade/go-types-vehicle-events';
4
6
  export declare class OperationDatabase {
5
- readonly vehicleEvents: ClickHouseInterfaceTemplate<SimplifiedVehicleEvent>;
7
+ readonly hashedShapes: ClickHouseInterfaceTemplate<HashedShape>;
8
+ readonly hashedTrips: ClickHouseInterfaceTemplate<HashedTrip>;
9
+ readonly rideAnalysisAtLeastOneVehicleEventOnFirstStop: ClickHouseInterfaceTemplate<RideAnalysisAtLeastOneVehicleEventOnFirstStop>;
10
+ readonly rideAnalysisAtLeastOneVehicleEventOnLastStop: ClickHouseInterfaceTemplate<RideAnalysisAtLeastOneVehicleEventOnLastStop>;
11
+ readonly rideAnalysisExpectedApexValidationInterval: ClickHouseInterfaceTemplate<RideAnalysisExpectedApexValidationInterval>;
12
+ readonly rideAnalysisExpectedDriverIdQty: ClickHouseInterfaceTemplate<RideAnalysisExpectedDriverIdQty>;
13
+ readonly rideAnalysisExpectedStartTime: ClickHouseInterfaceTemplate<RideAnalysisExpectedStartTime>;
14
+ readonly rideAnalysisExpectedVehicleEventDelay: ClickHouseInterfaceTemplate<RideAnalysisExpectedVehicleEventDelay>;
15
+ readonly rideAnalysisExpectedVehicleEventInterval: ClickHouseInterfaceTemplate<RideAnalysisExpectedVehicleEventInterval>;
16
+ readonly rideAnalysisExpectedVehicleEventQty: ClickHouseInterfaceTemplate<RideAnalysisExpectedVehicleEventQty>;
17
+ readonly rideAnalysisExpectedVehicleIdQty: ClickHouseInterfaceTemplate<RideAnalysisExpectedVehicleIdQty>;
18
+ readonly rideAnalysisMatchingApexLocations: ClickHouseInterfaceTemplate<RideAnalysisMatchingApexLocations>;
19
+ readonly rideAnalysisMatchingVehicleIds: ClickHouseInterfaceTemplate<RideAnalysisMatchingVehicleIds>;
20
+ readonly rideAnalysisSimpleOneApexValidation: ClickHouseInterfaceTemplate<RideAnalysisSimpleOneApexValidation>;
21
+ readonly rideAnalysisSimpleOneVehicleEventOrApexValidation: ClickHouseInterfaceTemplate<RideAnalysisSimpleOneVehicleEventOrApexValidation>;
22
+ readonly rideAnalysisSimpleThreeVehicleEvents: ClickHouseInterfaceTemplate<RideAnalysisSimpleThreeVehicleEvents>;
23
+ readonly rideAnalysisTransactionSequentiality: ClickHouseInterfaceTemplate<RideAnalysisTransactionSequentiality>;
24
+ readonly rides: ClickHouseInterfaceTemplate<Ride>;
25
+ readonly simplifiedVehicleEvents: ClickHouseInterfaceTemplate<SimplifiedVehicleEvent>;
6
26
  private readonly databaseName;
7
27
  constructor(instance: ClickHouseClient);
8
28
  init(): Promise<void>;
@@ -1,19 +1,145 @@
1
1
  /* * */
2
2
  import { ClickHouseInterfaceTemplate } from '../interface.template.js';
3
- import { simplifiedVehicleEventTableSchema } from '../schemas/operation.js';
3
+ import { hashedShapeTableSchema, hashedTripTableSchema, rideAnalysisAtLeastOneVehicleEventOnFirstStopTableSchema, rideAnalysisAtLeastOneVehicleEventOnLastStopTableSchema, rideAnalysisExpectedApexValidationIntervalTableSchema, rideAnalysisExpectedDriverIdQtyTableSchema, rideAnalysisExpectedStartTimeTableSchema, rideAnalysisExpectedVehicleEventDelayTableSchema, rideAnalysisExpectedVehicleEventIntervalTableSchema, rideAnalysisExpectedVehicleEventQtyTableSchema, rideAnalysisExpectedVehicleIdQtyTableSchema, rideAnalysisMatchingApexLocationsTableSchema, rideAnalysisMatchingVehicleIdsTableSchema, rideAnalysisSimpleOneApexValidationTableSchema, rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema, rideAnalysisSimpleThreeVehicleEventsTableSchema, rideAnalysisTransactionSequentialityTableSchema, ridesTableSchema, simplifiedVehicleEventTableSchema } from '../schemas/operation.js';
4
4
  /* * */
5
5
  export class OperationDatabase {
6
6
  //
7
- vehicleEvents;
7
+ hashedShapes;
8
+ hashedTrips;
9
+ rideAnalysisAtLeastOneVehicleEventOnFirstStop;
10
+ rideAnalysisAtLeastOneVehicleEventOnLastStop;
11
+ rideAnalysisExpectedApexValidationInterval;
12
+ rideAnalysisExpectedDriverIdQty;
13
+ rideAnalysisExpectedStartTime;
14
+ rideAnalysisExpectedVehicleEventDelay;
15
+ rideAnalysisExpectedVehicleEventInterval;
16
+ rideAnalysisExpectedVehicleEventQty;
17
+ rideAnalysisExpectedVehicleIdQty;
18
+ rideAnalysisMatchingApexLocations;
19
+ rideAnalysisMatchingVehicleIds;
20
+ rideAnalysisSimpleOneApexValidation;
21
+ rideAnalysisSimpleOneVehicleEventOrApexValidation;
22
+ rideAnalysisSimpleThreeVehicleEvents;
23
+ rideAnalysisTransactionSequentiality;
24
+ rides;
25
+ simplifiedVehicleEvents;
8
26
  databaseName = 'operation';
9
27
  constructor(instance) {
10
- this.vehicleEvents = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'simplified_vehicle_events', simplifiedVehicleEventTableSchema, {
28
+ this.hashedShapes = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'hashed_shapes', hashedShapeTableSchema, {
29
+ engine: 'ReplacingMergeTree(updated_at)',
30
+ orderBy: ['_id', 'shape_id'],
31
+ partitionBy: undefined,
32
+ });
33
+ this.hashedTrips = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'hashed_trips', hashedTripTableSchema, {
34
+ engine: 'ReplacingMergeTree(updated_at)',
35
+ orderBy: ['_id', 'stop_sequence'],
36
+ partitionBy: undefined,
37
+ });
38
+ this.rideAnalysisAtLeastOneVehicleEventOnFirstStop = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_at_least_one_vehicle_event_on_first_stop', rideAnalysisAtLeastOneVehicleEventOnFirstStopTableSchema, {
39
+ engine: 'ReplacingMergeTree(updated_at)',
40
+ orderBy: ['ride_id'],
41
+ partitionBy: 'intDiv(operational_date, 100)',
42
+ });
43
+ this.rideAnalysisAtLeastOneVehicleEventOnLastStop = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_at_least_one_vehicle_event_on_last_stop', rideAnalysisAtLeastOneVehicleEventOnLastStopTableSchema, {
44
+ engine: 'ReplacingMergeTree(updated_at)',
45
+ orderBy: ['ride_id'],
46
+ partitionBy: 'intDiv(operational_date, 100)',
47
+ });
48
+ this.rideAnalysisExpectedApexValidationInterval = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_expected_apex_validation_interval', rideAnalysisExpectedApexValidationIntervalTableSchema, {
49
+ engine: 'ReplacingMergeTree(updated_at)',
50
+ orderBy: ['ride_id'],
51
+ partitionBy: 'intDiv(operational_date, 100)',
52
+ });
53
+ this.rideAnalysisExpectedDriverIdQty = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_expected_driver_id_qty', rideAnalysisExpectedDriverIdQtyTableSchema, {
54
+ engine: 'ReplacingMergeTree(updated_at)',
55
+ orderBy: ['ride_id'],
56
+ partitionBy: 'intDiv(operational_date, 100)',
57
+ });
58
+ this.rideAnalysisExpectedStartTime = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_expected_start_time', rideAnalysisExpectedStartTimeTableSchema, {
59
+ engine: 'ReplacingMergeTree(updated_at)',
60
+ orderBy: ['ride_id'],
61
+ partitionBy: 'intDiv(operational_date, 100)',
62
+ });
63
+ this.rideAnalysisExpectedVehicleEventDelay = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_expected_vehicle_event_delay', rideAnalysisExpectedVehicleEventDelayTableSchema, {
64
+ engine: 'ReplacingMergeTree(updated_at)',
65
+ orderBy: ['ride_id'],
66
+ partitionBy: 'intDiv(operational_date, 100)',
67
+ });
68
+ this.rideAnalysisExpectedVehicleEventInterval = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_expected_vehicle_event_interval', rideAnalysisExpectedVehicleEventIntervalTableSchema, {
69
+ engine: 'ReplacingMergeTree(updated_at)',
70
+ orderBy: ['ride_id'],
71
+ partitionBy: 'intDiv(operational_date, 100)',
72
+ });
73
+ this.rideAnalysisExpectedVehicleEventQty = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_expected_vehicle_event_qty', rideAnalysisExpectedVehicleEventQtyTableSchema, {
74
+ engine: 'ReplacingMergeTree(updated_at)',
75
+ orderBy: ['ride_id'],
76
+ partitionBy: 'intDiv(operational_date, 100)',
77
+ });
78
+ this.rideAnalysisExpectedVehicleIdQty = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_expected_vehicle_id_qty', rideAnalysisExpectedVehicleIdQtyTableSchema, {
79
+ engine: 'ReplacingMergeTree(updated_at)',
80
+ orderBy: ['ride_id'],
81
+ partitionBy: 'intDiv(operational_date, 100)',
82
+ });
83
+ this.rideAnalysisMatchingApexLocations = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_matching_apex_locations', rideAnalysisMatchingApexLocationsTableSchema, {
84
+ engine: 'ReplacingMergeTree(updated_at)',
85
+ orderBy: ['ride_id'],
86
+ partitionBy: 'intDiv(operational_date, 100)',
87
+ });
88
+ this.rideAnalysisMatchingVehicleIds = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_matching_vehicle_ids', rideAnalysisMatchingVehicleIdsTableSchema, {
89
+ engine: 'ReplacingMergeTree(updated_at)',
90
+ orderBy: ['ride_id'],
91
+ partitionBy: 'intDiv(operational_date, 100)',
92
+ });
93
+ this.rideAnalysisSimpleOneApexValidation = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_simple_one_apex_validation', rideAnalysisSimpleOneApexValidationTableSchema, {
94
+ engine: 'ReplacingMergeTree(updated_at)',
95
+ orderBy: ['ride_id'],
96
+ partitionBy: 'intDiv(operational_date, 100)',
97
+ });
98
+ this.rideAnalysisSimpleOneVehicleEventOrApexValidation = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_simple_one_vehicle_event_or_apex_validation', rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema, {
99
+ engine: 'ReplacingMergeTree(updated_at)',
100
+ orderBy: ['ride_id'],
101
+ partitionBy: 'intDiv(operational_date, 100)',
102
+ });
103
+ this.rideAnalysisSimpleThreeVehicleEvents = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_simple_three_vehicle_events', rideAnalysisSimpleThreeVehicleEventsTableSchema, {
104
+ engine: 'ReplacingMergeTree(updated_at)',
105
+ orderBy: ['ride_id'],
106
+ partitionBy: 'intDiv(operational_date, 100)',
107
+ });
108
+ this.rideAnalysisTransactionSequentiality = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'ride_analysis_transaction_sequentiality', rideAnalysisTransactionSequentialityTableSchema, {
109
+ engine: 'ReplacingMergeTree(updated_at)',
110
+ orderBy: ['ride_id'],
111
+ partitionBy: 'intDiv(operational_date, 100)',
112
+ });
113
+ this.rides = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'rides', ridesTableSchema, {
114
+ engine: 'ReplacingMergeTree(updated_at)',
115
+ orderBy: ['agency_id', 'operational_date', 'route_short_name', 'shape_id', 'start_time_scheduled', '_id'],
116
+ partitionBy: 'intDiv(operational_date, 100)',
117
+ });
118
+ this.simplifiedVehicleEvents = new ClickHouseInterfaceTemplate(instance, this.databaseName, 'simplified_vehicle_events', simplifiedVehicleEventTableSchema, {
11
119
  engine: 'ReplacingMergeTree(created_at)',
12
120
  orderBy: ['agency_id', 'operational_date', 'vehicle_id', 'created_at', '_id'],
13
121
  partitionBy: 'intDiv(operational_date, 100)',
14
122
  });
15
123
  }
16
124
  async init() {
17
- await this.vehicleEvents.init();
125
+ await this.hashedShapes.init();
126
+ await this.hashedTrips.init();
127
+ await this.rideAnalysisAtLeastOneVehicleEventOnFirstStop.init();
128
+ await this.rideAnalysisAtLeastOneVehicleEventOnLastStop.init();
129
+ await this.rideAnalysisExpectedApexValidationInterval.init();
130
+ await this.rideAnalysisExpectedDriverIdQty.init();
131
+ await this.rideAnalysisExpectedStartTime.init();
132
+ await this.rideAnalysisExpectedVehicleEventDelay.init();
133
+ await this.rideAnalysisExpectedVehicleEventInterval.init();
134
+ await this.rideAnalysisExpectedVehicleEventQty.init();
135
+ await this.rideAnalysisExpectedVehicleIdQty.init();
136
+ await this.rideAnalysisMatchingApexLocations.init();
137
+ await this.rideAnalysisMatchingVehicleIds.init();
138
+ await this.rideAnalysisSimpleOneApexValidation.init();
139
+ await this.rideAnalysisSimpleOneVehicleEventOrApexValidation.init();
140
+ await this.rideAnalysisSimpleThreeVehicleEvents.init();
141
+ await this.rideAnalysisTransactionSequentiality.init();
142
+ await this.rides.init();
143
+ await this.simplifiedVehicleEvents.init();
18
144
  }
19
145
  }
@@ -1,4 +1,4 @@
1
- import { ClickHouseClient, queryFromFile, queryFromString } from '@tmlmobilidade/go-clients-clickhouse';
1
+ import { ClickHouseClient, queryEachStatementFromFile, queryFromFile, queryFromString } from '@tmlmobilidade/go-clients-clickhouse';
2
2
  import { OperationDatabase } from './databases/operation.js';
3
3
  import { PerformanceDatabase } from './databases/performance.js';
4
4
  import { SimplifiedApexDatabase } from './databases/simplified-apex.js';
@@ -14,6 +14,14 @@ declare class LabDbClass {
14
14
  * Concurrent callers share the same initialization promise so schema setup runs once.
15
15
  */
16
16
  static getInstance(): Promise<LabDbClass>;
17
+ /**
18
+ * It should be used for statements that do not have any output,
19
+ * when the format clause is not applicable, or when you are not interested in the response at all.
20
+ * The response stream is destroyed immediately as we do not expect useful information there.
21
+ *
22
+ * Examples of such statements are DDLs or custom inserts.
23
+ */
24
+ command(...args: Parameters<ClickHouseClient['command']>): Promise<import("@clickhouse/client").CommandResult>;
17
25
  /**
18
26
  * Returns the ClickHouse client.
19
27
  * @returns The ClickHouse client.
@@ -22,6 +30,35 @@ declare class LabDbClass {
22
30
  */
23
31
  getClient(): Promise<ClickHouseClient>;
24
32
  private init;
33
+ /**
34
+ * The primary method for data insertion. It is recommended to avoid arrays in case of large inserts
35
+ * to reduce application memory consumption and consider streaming for most of such use cases.
36
+ * As the insert operation does not provide any output, the response stream is immediately destroyed.
37
+ */
38
+ insert(...args: Parameters<ClickHouseClient['insert']>): Promise<import("@clickhouse/client").InsertResult>;
39
+ /**
40
+ * Used for most statements that can have a response, such as `SELECT`.
41
+ *
42
+ * The `FORMAT` clause should be specified separately via {@link QueryParams.format} (default is `JSON`);
43
+ * this method will always append `FORMAT <format>` to the end of {@link QueryParams.query}.
44
+ * If the query already contains a `FORMAT` clause, ClickHouse will return a syntax error due to a duplicate `FORMAT`.
45
+ * This is intended behavior.
46
+ *
47
+ * Use {@link labDb.insert} for data insertion, {@link labDb.command} for DDLs.
48
+ */
49
+ query(...args: Parameters<ClickHouseClient['query']>): Promise<import("@clickhouse/client").ResultSet<unknown>>;
50
+ /**
51
+ * Executes a query from a .sql file with optional parameter substitutions.
52
+ * @param filePath Absolute or relative path to the .sql file.
53
+ * @param params Optional key-value substitutions applied to the query (replaces {key} placeholders).
54
+ * @returns Query result rows typed as `T`.
55
+ * @example
56
+ * const users = await labDb.queryEachStatementFromFile<User>('get_users.sql', {
57
+ * start_date: '2024-01-01',
58
+ * end_date: '2024-12-31',
59
+ * });
60
+ */
61
+ queryEachStatementFromFile<T>(filePath: string, params?: Record<string, number | string | string[]>): ReturnType<typeof queryEachStatementFromFile<T>>;
25
62
  /**
26
63
  * Executes a query from a .sql file with optional parameter substitutions.
27
64
  * @param filePath Absolute or relative path to the .sql file.
@@ -48,7 +85,7 @@ declare class LabDbClass {
48
85
  * { start_date: '2024-01-01', end_date: '2024-12-31' }
49
86
  * );
50
87
  */
51
- queryFromString<T>(query: string, params?: Record<string, number | string>): ReturnType<typeof queryFromString<T>>;
88
+ queryFromString<T>(query: string, params?: Record<string, number | string | string[]>): ReturnType<typeof queryFromString<T>>;
52
89
  }
53
90
  export declare const labDb: LabDbClass;
54
91
  export {};
package/dist/interface.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* * */
2
- import { ClickHouseDatabaseClient, queryFromFile, queryFromString } from '@tmlmobilidade/go-clients-clickhouse';
2
+ import { ClickHouseDatabaseClient, queryEachStatementFromFile, queryFromFile, queryFromString } from '@tmlmobilidade/go-clients-clickhouse';
3
3
  import { asyncSingletonProxy } from '@tmlmobilidade/utils';
4
4
  import { OperationDatabase } from './databases/operation.js';
5
5
  import { PerformanceDatabase } from './databases/performance.js';
@@ -34,6 +34,16 @@ class LabDbClass {
34
34
  }
35
35
  return await LabDbClass._instance;
36
36
  }
37
+ /**
38
+ * It should be used for statements that do not have any output,
39
+ * when the format clause is not applicable, or when you are not interested in the response at all.
40
+ * The response stream is destroyed immediately as we do not expect useful information there.
41
+ *
42
+ * Examples of such statements are DDLs or custom inserts.
43
+ */
44
+ async command(...args) {
45
+ return await this.clickhouseClient.command(...args);
46
+ }
37
47
  /**
38
48
  * Returns the ClickHouse client.
39
49
  * @returns The ClickHouse client.
@@ -51,6 +61,41 @@ class LabDbClass {
51
61
  this.simplifiedApex.init(),
52
62
  ]);
53
63
  }
64
+ /**
65
+ * The primary method for data insertion. It is recommended to avoid arrays in case of large inserts
66
+ * to reduce application memory consumption and consider streaming for most of such use cases.
67
+ * As the insert operation does not provide any output, the response stream is immediately destroyed.
68
+ */
69
+ async insert(...args) {
70
+ return await this.clickhouseClient.insert(...args);
71
+ }
72
+ /**
73
+ * Used for most statements that can have a response, such as `SELECT`.
74
+ *
75
+ * The `FORMAT` clause should be specified separately via {@link QueryParams.format} (default is `JSON`);
76
+ * this method will always append `FORMAT <format>` to the end of {@link QueryParams.query}.
77
+ * If the query already contains a `FORMAT` clause, ClickHouse will return a syntax error due to a duplicate `FORMAT`.
78
+ * This is intended behavior.
79
+ *
80
+ * Use {@link labDb.insert} for data insertion, {@link labDb.command} for DDLs.
81
+ */
82
+ async query(...args) {
83
+ return await this.clickhouseClient.query(...args);
84
+ }
85
+ /**
86
+ * Executes a query from a .sql file with optional parameter substitutions.
87
+ * @param filePath Absolute or relative path to the .sql file.
88
+ * @param params Optional key-value substitutions applied to the query (replaces {key} placeholders).
89
+ * @returns Query result rows typed as `T`.
90
+ * @example
91
+ * const users = await labDb.queryEachStatementFromFile<User>('get_users.sql', {
92
+ * start_date: '2024-01-01',
93
+ * end_date: '2024-12-31',
94
+ * });
95
+ */
96
+ async queryEachStatementFromFile(filePath, params) {
97
+ return await queryEachStatementFromFile(this.clickhouseClient, filePath, params);
98
+ }
54
99
  /**
55
100
  * Executes a query from a .sql file with optional parameter substitutions.
56
101
  * @param filePath Absolute or relative path to the .sql file.
@@ -37,12 +37,12 @@ export declare class ClickHouseInterfaceTemplate<T extends object> {
37
37
  delete(where: string, params?: Record<string, number | string | string[]>): Promise<void>;
38
38
  /**
39
39
  * Executes a DISTINCT query on the ClickHouse table using the service's client.
40
- * @param select The columns to select in the query (e.g., `"*"`, `"column1, column2"`).
40
+ * @param field The field to select distinct values for (e.g., `"field_name"`).
41
41
  * @param where The WHERE clause to filter the results (e.g., `"id = 1"`).
42
42
  * @param params Optional key-value substitutions applied to the WHERE clause (replaces $1, $2, etc.).
43
43
  * @returns A promise that resolves to an array of distinct values matching the query.
44
44
  */
45
- distinct<T>(field: keyof T, where: string, params?: Record<string, number | string>): Promise<T[keyof T][]>;
45
+ distinct<K extends keyof T>(field: K, where: string, params?: Record<string, number | string>): Promise<T[K][]>;
46
46
  /**
47
47
  * Provides access to the ClickHouse client instance,
48
48
  * initializing it if it has not already been created.
@@ -64,7 +64,7 @@ export declare class ClickHouseInterfaceTemplate<T extends object> {
64
64
  * @param values An array of data objects to insert into the table.
65
65
  * @returns A promise that resolves when the data is inserted successfully.
66
66
  */
67
- insert<T>(format: DataFormat | undefined, values: T[]): Promise<import("@clickhouse/client").InsertResult>;
67
+ insert(format: DataFormat | undefined, values: T[]): Promise<import("@clickhouse/client").InsertResult>;
68
68
  /**
69
69
  * Executes a simple SELECT query on the ClickHouse table using the service's client.
70
70
  * @param select The columns to select in the query (e.g., `"*"`, `"column1, column2"`).
@@ -98,7 +98,7 @@ export declare class ClickHouseInterfaceTemplate<T extends object> {
98
98
  * end_date: '2024-12-31',
99
99
  * });
100
100
  */
101
- queryFromFile<T>(filePath: string, params?: Record<string, number | string>): ReturnType<typeof queryFromFile<T>>;
101
+ queryFromFile(filePath: string, params?: Record<string, number | string>): ReturnType<typeof queryFromFile<T>>;
102
102
  /**
103
103
  * Executes a query from a string.
104
104
  * @param client The ClickHouse client to use for executing the query.
@@ -111,7 +111,7 @@ export declare class ClickHouseInterfaceTemplate<T extends object> {
111
111
  * { start_date: '2024-01-01', end_date: '2024-12-31' }
112
112
  * );
113
113
  */
114
- queryFromString<T>(query: string, params?: Record<string, number | string>): ReturnType<typeof queryFromString<T>>;
114
+ queryFromString(query: string, params?: Record<string, number | string>): ReturnType<typeof queryFromString<T>>;
115
115
  /**
116
116
  * Ensures that the specified database exists in ClickHouse, creating it if it does not already exist.
117
117
  * This method performs input validation to prevent SQL injection and logs the outcome of the operation.
@@ -53,14 +53,14 @@ export class ClickHouseInterfaceTemplate {
53
53
  }
54
54
  /**
55
55
  * Executes a DISTINCT query on the ClickHouse table using the service's client.
56
- * @param select The columns to select in the query (e.g., `"*"`, `"column1, column2"`).
56
+ * @param field The field to select distinct values for (e.g., `"field_name"`).
57
57
  * @param where The WHERE clause to filter the results (e.g., `"id = 1"`).
58
58
  * @param params Optional key-value substitutions applied to the WHERE clause (replaces $1, $2, etc.).
59
59
  * @returns A promise that resolves to an array of distinct values matching the query.
60
60
  */
61
61
  async distinct(field, where, params) {
62
62
  const result = await queryFromString(this.client, `SELECT DISTINCT ${String(field)} FROM "${this.databaseName}"."${this.tableName}" WHERE ${where}`, params);
63
- return result.map(doc => doc[field]);
63
+ return result;
64
64
  }
65
65
  /**
66
66
  * Provides access to the ClickHouse client instance,
@@ -180,8 +180,19 @@ export class ClickHouseInterfaceTemplate {
180
180
  throw new Error(`LABDB [${this.databaseName}]: Unsafe database name provided.`);
181
181
  // Perform the query to create the database if it does not exist
182
182
  try {
183
+ // First check if the database already exists
184
+ const result = await this.client.query({
185
+ query: `SELECT 1 FROM system.databases WHERE name = {name:String} LIMIT 1`,
186
+ query_params: { name: this.databaseName },
187
+ });
188
+ const resultData = await result.json();
189
+ const databaseAlreadyExists = resultData.data.length > 0;
190
+ // Always execute CREATE DATABASE IF NOT EXISTS to avoid race conditions
191
+ // if another instance creates the database after our existence check.
183
192
  await this.client.command({ query: `CREATE DATABASE IF NOT EXISTS "${this.databaseName}"` });
184
- Logger.info({ message: `LABDB [${this.databaseName}]: Database created.` });
193
+ // Only log if the database did not exist when we checked.
194
+ if (!databaseAlreadyExists)
195
+ Logger.info({ message: `LABDB [${this.databaseName}]: Database created.` });
185
196
  }
186
197
  catch (error) {
187
198
  Logger.error({ error, message: `LABDB [${this.databaseName}]: Error @ createDatabase(): ${error.message}` });
@@ -220,8 +231,19 @@ export class ClickHouseInterfaceTemplate {
220
231
  `;
221
232
  // Perform the query to create the table
222
233
  try {
234
+ // Check whether the table already exists.
235
+ const result = await this.client.query({
236
+ query: `SELECT 1 FROM system.tables WHERE database = {database:String} AND name = {table:String} LIMIT 1`,
237
+ query_params: { database: this.databaseName, table: this.tableName },
238
+ });
239
+ const resultData = await result.json();
240
+ const tableAlreadyExists = resultData.data.length > 0;
241
+ // Always execute CREATE TABLE IF NOT EXISTS to avoid race conditions
242
+ // if another instance creates the table after our existence check.
223
243
  await this.client.command({ query: createTableQuery });
224
- Logger.info({ message: `LABDB [${this.tableName}]: Table created.` });
244
+ // Only log if the table did not exist when we checked.
245
+ if (!tableAlreadyExists)
246
+ Logger.info({ message: `LABDB [${this.tableName}]: Table created.` });
225
247
  }
226
248
  catch (error) {
227
249
  // If the error is not an ACCESS_DENIED, throw it right away
@@ -1,3 +1,22 @@
1
1
  import { type ClickHouseTableSchema } from '@tmlmobilidade/go-clients-clickhouse';
2
+ import { type HashedShape, type HashedTrip, type Ride, type RideAnalysisAtLeastOneVehicleEventOnFirstStop, type RideAnalysisAtLeastOneVehicleEventOnLastStop, type RideAnalysisExpectedApexValidationInterval, type RideAnalysisExpectedDriverIdQty, type RideAnalysisExpectedStartTime, type RideAnalysisExpectedVehicleEventDelay, type RideAnalysisExpectedVehicleEventInterval, type RideAnalysisExpectedVehicleEventQty, type RideAnalysisExpectedVehicleIdQty, type RideAnalysisMatchingApexLocations, type RideAnalysisMatchingVehicleIds, type RideAnalysisSimpleOneApexValidation, type RideAnalysisSimpleOneVehicleEventOrApexValidation, type RideAnalysisSimpleThreeVehicleEvents, type RideAnalysisTransactionSequentiality } from '@tmlmobilidade/go-types-operation';
2
3
  import { type SimplifiedVehicleEvent } from '@tmlmobilidade/go-types-vehicle-events';
3
4
  export declare const simplifiedVehicleEventTableSchema: ClickHouseTableSchema<SimplifiedVehicleEvent>;
5
+ export declare const hashedShapeTableSchema: ClickHouseTableSchema<HashedShape>;
6
+ export declare const hashedTripTableSchema: ClickHouseTableSchema<HashedTrip>;
7
+ export declare const rideAnalysisAtLeastOneVehicleEventOnFirstStopTableSchema: ClickHouseTableSchema<RideAnalysisAtLeastOneVehicleEventOnFirstStop>;
8
+ export declare const rideAnalysisAtLeastOneVehicleEventOnLastStopTableSchema: ClickHouseTableSchema<RideAnalysisAtLeastOneVehicleEventOnLastStop>;
9
+ export declare const rideAnalysisExpectedApexValidationIntervalTableSchema: ClickHouseTableSchema<RideAnalysisExpectedApexValidationInterval>;
10
+ export declare const rideAnalysisExpectedDriverIdQtyTableSchema: ClickHouseTableSchema<RideAnalysisExpectedDriverIdQty>;
11
+ export declare const rideAnalysisExpectedStartTimeTableSchema: ClickHouseTableSchema<RideAnalysisExpectedStartTime>;
12
+ export declare const rideAnalysisExpectedVehicleEventDelayTableSchema: ClickHouseTableSchema<RideAnalysisExpectedVehicleEventDelay>;
13
+ export declare const rideAnalysisExpectedVehicleEventIntervalTableSchema: ClickHouseTableSchema<RideAnalysisExpectedVehicleEventInterval>;
14
+ export declare const rideAnalysisExpectedVehicleEventQtyTableSchema: ClickHouseTableSchema<RideAnalysisExpectedVehicleEventQty>;
15
+ export declare const rideAnalysisExpectedVehicleIdQtyTableSchema: ClickHouseTableSchema<RideAnalysisExpectedVehicleIdQty>;
16
+ export declare const rideAnalysisMatchingApexLocationsTableSchema: ClickHouseTableSchema<RideAnalysisMatchingApexLocations>;
17
+ export declare const rideAnalysisMatchingVehicleIdsTableSchema: ClickHouseTableSchema<RideAnalysisMatchingVehicleIds>;
18
+ export declare const rideAnalysisSimpleOneApexValidationTableSchema: ClickHouseTableSchema<RideAnalysisSimpleOneApexValidation>;
19
+ export declare const rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema: ClickHouseTableSchema<RideAnalysisSimpleOneVehicleEventOrApexValidation>;
20
+ export declare const rideAnalysisSimpleThreeVehicleEventsTableSchema: ClickHouseTableSchema<RideAnalysisSimpleThreeVehicleEvents>;
21
+ export declare const rideAnalysisTransactionSequentialityTableSchema: ClickHouseTableSchema<RideAnalysisTransactionSequentiality>;
22
+ export declare const ridesTableSchema: ClickHouseTableSchema<Ride>;
@@ -19,3 +19,181 @@ export const simplifiedVehicleEventTableSchema = {
19
19
  trip_id: { type: 'String' },
20
20
  vehicle_id: { type: 'LowCardinality(String)' },
21
21
  };
22
+ /* * */
23
+ export const hashedShapeTableSchema = {
24
+ _id: { type: 'String' },
25
+ agency_id: { type: 'LowCardinality(String)' },
26
+ extension: { type: 'UInt32 CODEC(T64, ZSTD)' },
27
+ shape_id: { type: 'LowCardinality(String)' },
28
+ shape_polyline: { type: 'String CODEC(ZSTD)' },
29
+ updated_at: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
30
+ };
31
+ /* * */
32
+ export const hashedTripTableSchema = {
33
+ _id: { type: 'String' },
34
+ agency_id: { type: 'LowCardinality(String)' },
35
+ arrival_time: { type: 'FixedString(8)' },
36
+ departure_time: { type: 'FixedString(8)' },
37
+ drop_off_type: { type: 'FixedString(1)' },
38
+ pickup_type: { type: 'FixedString(1)' },
39
+ shape_dist_traveled: { type: 'Float32 CODEC(Gorilla, ZSTD)' },
40
+ shape_id: { type: 'LowCardinality(String)' },
41
+ stop_id: { type: 'LowCardinality(String)' },
42
+ stop_lat: { type: 'Float32 CODEC(Gorilla, ZSTD)' },
43
+ stop_lon: { type: 'Float32 CODEC(Gorilla, ZSTD)' },
44
+ stop_name: { type: 'String CODEC(ZSTD)' },
45
+ stop_sequence: { type: 'UInt16 CODEC(T64, ZSTD)' },
46
+ timepoint: { type: 'Bool' },
47
+ updated_at: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
48
+ };
49
+ /* * */
50
+ const rideAnalysisBaseTableSchema = {
51
+ agency_id: { type: 'LowCardinality(String)' },
52
+ grade_status: { type: 'LowCardinality(String)' },
53
+ operational_date: { type: 'UInt32' },
54
+ reason: { type: 'LowCardinality(Nullable(String))' },
55
+ remarks: { type: 'Nullable(String) CODEC(ZSTD)' },
56
+ ride_id: { type: 'String' },
57
+ updated_at: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
58
+ };
59
+ /* * */
60
+ export const rideAnalysisAtLeastOneVehicleEventOnFirstStopTableSchema = {
61
+ ...rideAnalysisBaseTableSchema,
62
+ vehicle_events_on_first_stop_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
63
+ };
64
+ /* * */
65
+ export const rideAnalysisAtLeastOneVehicleEventOnLastStopTableSchema = {
66
+ ...rideAnalysisBaseTableSchema,
67
+ vehicle_events_on_last_stop_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
68
+ };
69
+ /* * */
70
+ export const rideAnalysisExpectedApexValidationIntervalTableSchema = {
71
+ ...rideAnalysisBaseTableSchema,
72
+ observed_average_interval: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
73
+ observed_max_interval: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
74
+ observed_min_interval: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
75
+ };
76
+ /* * */
77
+ export const rideAnalysisExpectedDriverIdQtyTableSchema = {
78
+ ...rideAnalysisBaseTableSchema,
79
+ observed_driver_ids_qty: { type: 'Nullable(UInt8) CODEC(T64, ZSTD)' },
80
+ };
81
+ /* * */
82
+ export const rideAnalysisExpectedStartTimeTableSchema = {
83
+ ...rideAnalysisBaseTableSchema,
84
+ observed_start_time: { type: 'Nullable(Int64) CODEC(DoubleDelta, ZSTD)' },
85
+ observed_start_time_delta: { type: 'Nullable(Int16) CODEC(T64, ZSTD)' },
86
+ };
87
+ /* * */
88
+ export const rideAnalysisExpectedVehicleEventDelayTableSchema = {
89
+ ...rideAnalysisBaseTableSchema,
90
+ observed_average_delay: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
91
+ observed_max_delay: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
92
+ observed_min_delay: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
93
+ vehicle_events_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
94
+ vehicle_events_with_delay_percent: { type: 'Nullable(UInt8) CODEC(T64, ZSTD)' },
95
+ vehicle_events_with_delay_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
96
+ };
97
+ /* * */
98
+ export const rideAnalysisExpectedVehicleEventIntervalTableSchema = {
99
+ ...rideAnalysisBaseTableSchema,
100
+ observed_average_interval: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
101
+ observed_max_interval: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
102
+ observed_min_interval: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
103
+ };
104
+ /* * */
105
+ export const rideAnalysisExpectedVehicleEventQtyTableSchema = {
106
+ ...rideAnalysisBaseTableSchema,
107
+ expected_vehicle_events_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
108
+ observed_vehicle_events_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
109
+ };
110
+ /* * */
111
+ export const rideAnalysisExpectedVehicleIdQtyTableSchema = {
112
+ ...rideAnalysisBaseTableSchema,
113
+ observed_vehicle_ids_qty: { type: 'Nullable(UInt8) CODEC(T64, ZSTD)' },
114
+ };
115
+ /* * */
116
+ export const rideAnalysisMatchingApexLocationsTableSchema = {
117
+ ...rideAnalysisBaseTableSchema,
118
+ expected_apex_locations_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
119
+ matching_apex_locations_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
120
+ missing_apex_locations_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
121
+ };
122
+ /* * */
123
+ export const rideAnalysisMatchingVehicleIdsTableSchema = {
124
+ ...rideAnalysisBaseTableSchema,
125
+ extra_apex_vehicle_ids_qty: { type: 'Nullable(UInt8) CODEC(T64, ZSTD)' },
126
+ extra_vehicle_events_vehicle_ids_qty: { type: 'Nullable(UInt8) CODEC(T64, ZSTD)' },
127
+ matching_vehicle_ids_qty: { type: 'Nullable(UInt8) CODEC(T64, ZSTD)' },
128
+ total_vehicle_ids_qty: { type: 'Nullable(UInt8) CODEC(T64, ZSTD)' },
129
+ };
130
+ /* * */
131
+ export const rideAnalysisSimpleOneApexValidationTableSchema = {
132
+ ...rideAnalysisBaseTableSchema,
133
+ };
134
+ /* * */
135
+ export const rideAnalysisSimpleOneVehicleEventOrApexValidationTableSchema = {
136
+ ...rideAnalysisBaseTableSchema,
137
+ };
138
+ /* * */
139
+ export const rideAnalysisSimpleThreeVehicleEventsTableSchema = {
140
+ ...rideAnalysisBaseTableSchema,
141
+ stop_ids_first: { type: 'Array(LowCardinality(String))' },
142
+ stop_ids_last: { type: 'Array(LowCardinality(String))' },
143
+ stop_ids_middle: { type: 'Array(LowCardinality(String))' },
144
+ };
145
+ /* * */
146
+ export const rideAnalysisTransactionSequentialityTableSchema = {
147
+ ...rideAnalysisBaseTableSchema,
148
+ expected_transactions_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
149
+ found_transactions_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
150
+ missing_transactions_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
151
+ };
152
+ /* * */
153
+ export const ridesTableSchema = {
154
+ _id: { type: 'String' },
155
+ agency_code: { type: 'LowCardinality(String)' },
156
+ agency_id: { type: 'LowCardinality(String)' },
157
+ apex_banking_taps_amount: { type: 'Nullable(Int32) CODEC(T64, ZSTD)' },
158
+ apex_banking_taps_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
159
+ apex_locations_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
160
+ apex_refunds_amount: { type: 'Nullable(Int32) CODEC(T64, ZSTD)' },
161
+ apex_refunds_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
162
+ apex_sales_amount: { type: 'Nullable(Int32) CODEC(T64, ZSTD)' },
163
+ apex_sales_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
164
+ apex_validations_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
165
+ direction_id: { type: 'FixedString(1)' },
166
+ driver_ids: { type: 'Array(LowCardinality(String))' },
167
+ end_time_observed: { type: 'Nullable(Int64) CODEC(DoubleDelta, ZSTD)' },
168
+ end_time_scheduled: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
169
+ extension_observed: { type: 'Nullable(UInt32) CODEC(T64, ZSTD)' },
170
+ extension_scheduled: { type: 'UInt32 CODEC(T64, ZSTD)' },
171
+ hashed_shape_id: { type: 'LowCardinality(String)' },
172
+ hashed_trip_id: { type: 'LowCardinality(String)' },
173
+ headsign: { type: 'LowCardinality(String)' },
174
+ operational_date: { type: 'UInt32' },
175
+ passengers_estimated: { type: 'Nullable(UInt32) CODEC(T64, ZSTD)' },
176
+ passengers_observed: { type: 'Nullable(UInt32) CODEC(T64, ZSTD)' },
177
+ passengers_observed_banking_taps_amount: { type: 'Nullable(Int32) CODEC(T64, ZSTD)' },
178
+ passengers_observed_banking_taps_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
179
+ passengers_observed_prepaid_amount: { type: 'Nullable(Int32) CODEC(T64, ZSTD)' },
180
+ passengers_observed_prepaid_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
181
+ passengers_observed_sales_amount: { type: 'Nullable(Int32) CODEC(T64, ZSTD)' },
182
+ passengers_observed_sales_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
183
+ passengers_observed_subscription_qty: { type: 'Nullable(UInt16) CODEC(T64, ZSTD)' },
184
+ plan_id: { type: 'LowCardinality(String)' },
185
+ processing_status: { type: 'LowCardinality(String)' },
186
+ route_color: { type: 'FixedString(7)' },
187
+ route_id: { type: 'LowCardinality(String)' },
188
+ route_long_name: { type: 'LowCardinality(String)' },
189
+ route_short_name: { type: 'LowCardinality(String)' },
190
+ route_text_color: { type: 'FixedString(7)' },
191
+ seen_first_at: { type: 'Nullable(Int64) CODEC(DoubleDelta, ZSTD)' },
192
+ seen_last_at: { type: 'Nullable(Int64) CODEC(DoubleDelta, ZSTD)' },
193
+ shape_id: { type: 'LowCardinality(String)' },
194
+ start_time_observed: { type: 'Nullable(Int64) CODEC(DoubleDelta, ZSTD)' },
195
+ start_time_scheduled: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
196
+ trip_id: { type: 'LowCardinality(String)' },
197
+ updated_at: { type: 'Int64 CODEC(DoubleDelta, ZSTD)' },
198
+ vehicle_ids: { type: 'Array(LowCardinality(String))' },
199
+ };
@@ -1,5 +1,5 @@
1
1
  import { type ClickHouseTableSchema } from '@tmlmobilidade/go-clients-clickhouse';
2
- import { type SimplifiedApexBankingTap, SimplifiedApexInspection, SimplifiedApexInspectionDecision, SimplifiedApexLocation, SimplifiedApexOnBoardRefund, SimplifiedApexOnBoardSale, SimplifiedApexValidation } from '@tmlmobilidade/go-types-apex';
2
+ import { type SimplifiedApexBankingTap, type SimplifiedApexInspection, type SimplifiedApexInspectionDecision, type SimplifiedApexLocation, type SimplifiedApexOnBoardRefund, type SimplifiedApexOnBoardSale, type SimplifiedApexValidation } from '@tmlmobilidade/go-types-apex';
3
3
  export declare const simplifiedApexBankingTapTableSchema: ClickHouseTableSchema<SimplifiedApexBankingTap>;
4
4
  export declare const simplifiedApexInspectionDecisionTableSchema: ClickHouseTableSchema<SimplifiedApexInspectionDecision>;
5
5
  export declare const simplifiedApexInspectionTableSchema: ClickHouseTableSchema<SimplifiedApexInspection>;
@@ -5,6 +5,7 @@ export const simplifiedApexBankingTapTableSchema = {
5
5
  agency_code: { type: 'LowCardinality(String)' },
6
6
  agency_id: { type: 'LowCardinality(String)' },
7
7
  apex_version: { type: 'LowCardinality(String)' },
8
+ banking_tap_id: { type: 'String' },
8
9
  banking_token: { type: 'String' },
9
10
  card_brand: { type: 'UInt8' },
10
11
  card_pan: { type: 'String' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/go-interfaces-labdb",
3
- "version": "20260811.1505.45",
3
+ "version": "20260828.1636.54",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"
@@ -38,14 +38,14 @@
38
38
  "dependencies": {
39
39
  "@tmlmobilidade/go-clients-clickhouse": "*",
40
40
  "@tmlmobilidade/go-types-apex": "*",
41
+ "@tmlmobilidade/go-types-operation": "*",
41
42
  "@tmlmobilidade/go-types-performance": "*",
42
43
  "@tmlmobilidade/go-types-vehicle-events": "*",
43
44
  "@tmlmobilidade/logger": "*",
44
- "@tmlmobilidade/types": "*",
45
45
  "@tmlmobilidade/utils": "*"
46
46
  },
47
47
  "devDependencies": {
48
- "@tmlmobilidade/tsconfig": "*",
48
+ "@tmlmobilidade/go-utils-tsconfig": "*",
49
49
  "@types/node": "26.1.2",
50
50
  "resolve-tspaths": "0.8.23",
51
51
  "tsc-watch": "7.2.1",