@tmlmobilidade/go-interfaces-rawdb 20260726.1159.27 → 20260726.1412.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,18 +1,2 @@
1
- import { ApexDatabase } from './databases/apex.js';
2
- import { CoreManagementCopyDatabase } from './databases/core-management.js';
3
- import { VehicleEventsDatabase } from './databases/vehicle-events.js';
4
- declare class RawDBClass {
5
- private static _instance;
6
- readonly apex: ApexDatabase;
7
- readonly coreManagementCopy: CoreManagementCopyDatabase;
8
- readonly vehicleEvents: VehicleEventsDatabase;
9
- private readonly mongoClient;
10
- private constructor();
11
- /**
12
- * Establishes a connection to the Mongo database and initializes the collection.
13
- * @throws Error if required RAW_DB_* environment variables are missing or if the connection fails.
14
- */
15
- static getInstance(): Promise<RawDBClass>;
16
- }
17
- export declare const rawDb: RawDBClass;
18
- export {};
1
+ export * from './interface.js';
2
+ export * from './interface.template.js';
package/dist/index.js CHANGED
@@ -1,34 +1,2 @@
1
- /* * */
2
- import { MongoDatabaseClient } from '@tmlmobilidade/go-clients-mongo';
3
- import { asyncSingletonProxy } from '@tmlmobilidade/utils';
4
- import { ApexDatabase } from './databases/apex.js';
5
- import { CoreManagementCopyDatabase } from './databases/core-management.js';
6
- import { VehicleEventsDatabase } from './databases/vehicle-events.js';
7
- /* * */
8
- class RawDBClass {
9
- //
10
- static _instance;
11
- apex;
12
- coreManagementCopy;
13
- vehicleEvents;
14
- mongoClient;
15
- constructor(mongoClient) {
16
- this.mongoClient = mongoClient;
17
- this.apex = new ApexDatabase(this.mongoClient);
18
- this.vehicleEvents = new VehicleEventsDatabase(this.mongoClient);
19
- this.coreManagementCopy = new CoreManagementCopyDatabase(this.mongoClient);
20
- }
21
- /**
22
- * Establishes a connection to the Mongo database and initializes the collection.
23
- * @throws Error if required RAW_DB_* environment variables are missing or if the connection fails.
24
- */
25
- static async getInstance() {
26
- if (!RawDBClass._instance) {
27
- const mongoClient = await MongoDatabaseClient.getClient({ prefix: 'RAWDB', tunnelType: 'GO' });
28
- RawDBClass._instance = new RawDBClass(mongoClient);
29
- }
30
- return RawDBClass._instance;
31
- }
32
- }
33
- /* * */
34
- export const rawDb = asyncSingletonProxy(RawDBClass);
1
+ export * from './interface.js';
2
+ export * from './interface.template.js';
@@ -0,0 +1,18 @@
1
+ import { ApexDatabase } from './databases/apex.js';
2
+ import { CoreManagementCopyDatabase } from './databases/core-management.js';
3
+ import { VehicleEventsDatabase } from './databases/vehicle-events.js';
4
+ declare class RawDBClass {
5
+ private static _instance;
6
+ readonly apex: ApexDatabase;
7
+ readonly coreManagementCopy: CoreManagementCopyDatabase;
8
+ readonly vehicleEvents: VehicleEventsDatabase;
9
+ private readonly mongoClient;
10
+ private constructor();
11
+ /**
12
+ * Establishes a connection to the Mongo database and initializes the collection.
13
+ * @throws Error if required RAW_DB_* environment variables are missing or if the connection fails.
14
+ */
15
+ static getInstance(): Promise<RawDBClass>;
16
+ }
17
+ export declare const rawDb: RawDBClass;
18
+ export {};
@@ -0,0 +1,34 @@
1
+ /* * */
2
+ import { MongoDatabaseClient } from '@tmlmobilidade/go-clients-mongo';
3
+ import { asyncSingletonProxy } from '@tmlmobilidade/utils';
4
+ import { ApexDatabase } from './databases/apex.js';
5
+ import { CoreManagementCopyDatabase } from './databases/core-management.js';
6
+ import { VehicleEventsDatabase } from './databases/vehicle-events.js';
7
+ /* * */
8
+ class RawDBClass {
9
+ //
10
+ static _instance;
11
+ apex;
12
+ coreManagementCopy;
13
+ vehicleEvents;
14
+ mongoClient;
15
+ constructor(mongoClient) {
16
+ this.mongoClient = mongoClient;
17
+ this.apex = new ApexDatabase(this.mongoClient);
18
+ this.vehicleEvents = new VehicleEventsDatabase(this.mongoClient);
19
+ this.coreManagementCopy = new CoreManagementCopyDatabase(this.mongoClient);
20
+ }
21
+ /**
22
+ * Establishes a connection to the Mongo database and initializes the collection.
23
+ * @throws Error if required RAW_DB_* environment variables are missing or if the connection fails.
24
+ */
25
+ static async getInstance() {
26
+ if (!RawDBClass._instance) {
27
+ const mongoClient = await MongoDatabaseClient.getClient({ prefix: 'RAWDB', tunnelType: 'GO' });
28
+ RawDBClass._instance = new RawDBClass(mongoClient);
29
+ }
30
+ return RawDBClass._instance;
31
+ }
32
+ }
33
+ /* * */
34
+ export const rawDb = asyncSingletonProxy(RawDBClass);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/go-interfaces-rawdb",
3
- "version": "20260726.1159.27",
3
+ "version": "20260726.1412.44",
4
4
  "author": {
5
5
  "email": "iso@tmlmobilidade.pt",
6
6
  "name": "TML-ISO"