@tmlmobilidade/go-interfaces-rawdb 20260722.1043.2 → 20260723.1350.16
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/databases/apex.d.ts +9 -0
- package/dist/databases/apex.js +16 -0
- package/dist/databases/vehicle-events.d.ts +26 -0
- package/dist/databases/vehicle-events.js +50 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +6 -3
- package/package.json +2 -2
- package/dist/databases/raw.d.ts +0 -11
- package/dist/databases/raw.js +0 -22
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MongoInterfaceTemplate } from '../interface.template.js';
|
|
2
|
+
import { type MongoClient } from '@tmlmobilidade/go-clients-mongo';
|
|
3
|
+
import { type RawApexTransaction } from '@tmlmobilidade/go-types-apex';
|
|
4
|
+
export declare class ApexDatabase {
|
|
5
|
+
readonly transactions: MongoInterfaceTemplate<RawApexTransaction, RawApexTransaction>;
|
|
6
|
+
private readonly database;
|
|
7
|
+
private readonly databaseName;
|
|
8
|
+
constructor(instance: MongoClient);
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { MongoInterfaceTemplate } from '../interface.template.js';
|
|
3
|
+
import { RawApexTransactionSchema } from '@tmlmobilidade/go-types-apex';
|
|
4
|
+
/* * */
|
|
5
|
+
export class ApexDatabase {
|
|
6
|
+
//
|
|
7
|
+
transactions;
|
|
8
|
+
database;
|
|
9
|
+
databaseName = 'apex';
|
|
10
|
+
constructor(instance) {
|
|
11
|
+
// Create the database instance
|
|
12
|
+
this.database = instance.db(this.databaseName);
|
|
13
|
+
// Create collection interfaces
|
|
14
|
+
this.transactions = new MongoInterfaceTemplate('transactions', this.database, RawApexTransactionSchema);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { MongoInterfaceTemplate } from '../interface.template.js';
|
|
2
|
+
import { type MongoClient } from '@tmlmobilidade/go-clients-mongo';
|
|
3
|
+
import { type RawVehicleEvent } from '@tmlmobilidade/go-types-vehicle-events';
|
|
4
|
+
export declare class VehicleEventsDatabase {
|
|
5
|
+
readonly esCrtmAisa: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
6
|
+
readonly esCrtmLaVeloz: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
7
|
+
readonly ptTmlCcfl: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
8
|
+
readonly ptTmlCmAlsa: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
9
|
+
readonly ptTmlCmRl: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
10
|
+
readonly ptTmlCmTst: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
11
|
+
readonly ptTmlCmVa: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
12
|
+
readonly ptTmlCp: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
13
|
+
readonly ptTmlFertagus: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
14
|
+
readonly ptTmlMl: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
15
|
+
readonly ptTmlMobi: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
16
|
+
readonly ptTmlTcb: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
17
|
+
readonly ptTmlTtsl: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
18
|
+
readonly ptTmpUnirUt1: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
19
|
+
readonly ptTmpUnirUt2: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
20
|
+
readonly ptTmpUnirUt3: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
21
|
+
readonly ptTmpUnirUt4: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
22
|
+
readonly ptTmpUnirUt5: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
23
|
+
private readonly database;
|
|
24
|
+
private readonly databaseName;
|
|
25
|
+
constructor(instance: MongoClient);
|
|
26
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { MongoInterfaceTemplate } from '../interface.template.js';
|
|
3
|
+
import { RawVehicleEventSchema } from '@tmlmobilidade/go-types-vehicle-events';
|
|
4
|
+
/* * */
|
|
5
|
+
export class VehicleEventsDatabase {
|
|
6
|
+
//
|
|
7
|
+
esCrtmAisa;
|
|
8
|
+
esCrtmLaVeloz;
|
|
9
|
+
ptTmlCcfl;
|
|
10
|
+
ptTmlCmAlsa;
|
|
11
|
+
ptTmlCmRl;
|
|
12
|
+
ptTmlCmTst;
|
|
13
|
+
ptTmlCmVa;
|
|
14
|
+
ptTmlCp;
|
|
15
|
+
ptTmlFertagus;
|
|
16
|
+
ptTmlMl;
|
|
17
|
+
ptTmlMobi;
|
|
18
|
+
ptTmlTcb;
|
|
19
|
+
ptTmlTtsl;
|
|
20
|
+
ptTmpUnirUt1;
|
|
21
|
+
ptTmpUnirUt2;
|
|
22
|
+
ptTmpUnirUt3;
|
|
23
|
+
ptTmpUnirUt4;
|
|
24
|
+
ptTmpUnirUt5;
|
|
25
|
+
database;
|
|
26
|
+
databaseName = 'vehicle-events';
|
|
27
|
+
constructor(instance) {
|
|
28
|
+
// Create the database instance
|
|
29
|
+
this.database = instance.db(this.databaseName);
|
|
30
|
+
// Create collection interfaces
|
|
31
|
+
this.esCrtmAisa = new MongoInterfaceTemplate('es-crtm-aisa', this.database, RawVehicleEventSchema);
|
|
32
|
+
this.esCrtmLaVeloz = new MongoInterfaceTemplate('es-crtm-la-veloz', this.database, RawVehicleEventSchema);
|
|
33
|
+
this.ptTmlCcfl = new MongoInterfaceTemplate('pt-tml-ccfl', this.database, RawVehicleEventSchema);
|
|
34
|
+
this.ptTmlCmAlsa = new MongoInterfaceTemplate('pt-tml-cm-alsa', this.database, RawVehicleEventSchema);
|
|
35
|
+
this.ptTmlCmRl = new MongoInterfaceTemplate('pt-tml-cm-rl', this.database, RawVehicleEventSchema);
|
|
36
|
+
this.ptTmlCmTst = new MongoInterfaceTemplate('pt-tml-cm-tst', this.database, RawVehicleEventSchema);
|
|
37
|
+
this.ptTmlCmVa = new MongoInterfaceTemplate('pt-tml-cm-va', this.database, RawVehicleEventSchema);
|
|
38
|
+
this.ptTmlCp = new MongoInterfaceTemplate('pt-tml-cp', this.database, RawVehicleEventSchema);
|
|
39
|
+
this.ptTmlFertagus = new MongoInterfaceTemplate('pt-tml-fertagus', this.database, RawVehicleEventSchema);
|
|
40
|
+
this.ptTmlMl = new MongoInterfaceTemplate('pt-tml-ml', this.database, RawVehicleEventSchema);
|
|
41
|
+
this.ptTmlMobi = new MongoInterfaceTemplate('pt-tml-mobi', this.database, RawVehicleEventSchema);
|
|
42
|
+
this.ptTmlTcb = new MongoInterfaceTemplate('pt-tml-tcb', this.database, RawVehicleEventSchema);
|
|
43
|
+
this.ptTmlTtsl = new MongoInterfaceTemplate('pt-tml-ttsl', this.database, RawVehicleEventSchema);
|
|
44
|
+
this.ptTmpUnirUt1 = new MongoInterfaceTemplate('pt-tmp-unir-ut1', this.database, RawVehicleEventSchema);
|
|
45
|
+
this.ptTmpUnirUt2 = new MongoInterfaceTemplate('pt-tmp-unir-ut2', this.database, RawVehicleEventSchema);
|
|
46
|
+
this.ptTmpUnirUt3 = new MongoInterfaceTemplate('pt-tmp-unir-ut3', this.database, RawVehicleEventSchema);
|
|
47
|
+
this.ptTmpUnirUt4 = new MongoInterfaceTemplate('pt-tmp-unir-ut4', this.database, RawVehicleEventSchema);
|
|
48
|
+
this.ptTmpUnirUt5 = new MongoInterfaceTemplate('pt-tmp-unir-ut5', this.database, RawVehicleEventSchema);
|
|
49
|
+
}
|
|
50
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApexDatabase } from './databases/apex.js';
|
|
2
|
+
import { VehicleEventsDatabase } from './databases/vehicle-events.js';
|
|
2
3
|
declare class RawDBClass {
|
|
3
4
|
private static _instance;
|
|
4
5
|
private readonly mongoClient;
|
|
5
|
-
readonly
|
|
6
|
+
readonly apex: ApexDatabase;
|
|
7
|
+
readonly vehicleEvents: VehicleEventsDatabase;
|
|
6
8
|
/**
|
|
7
9
|
* Establishes a connection to the Mongo database and initializes the collection.
|
|
8
10
|
* @throws Error if required RAW_DB_* environment variables are missing or if the connection fails.
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* * */
|
|
2
2
|
import { MongoDatabaseClient } from '@tmlmobilidade/go-clients-mongo';
|
|
3
3
|
import { asyncSingletonProxy } from '@tmlmobilidade/utils';
|
|
4
|
-
import {
|
|
4
|
+
import { ApexDatabase } from './databases/apex.js';
|
|
5
|
+
import { VehicleEventsDatabase } from './databases/vehicle-events.js';
|
|
5
6
|
/* * */
|
|
6
7
|
class RawDBClass {
|
|
7
8
|
//
|
|
@@ -11,7 +12,8 @@ class RawDBClass {
|
|
|
11
12
|
mongoClient;
|
|
12
13
|
//
|
|
13
14
|
// Databases
|
|
14
|
-
|
|
15
|
+
apex;
|
|
16
|
+
vehicleEvents;
|
|
15
17
|
/**
|
|
16
18
|
* Establishes a connection to the Mongo database and initializes the collection.
|
|
17
19
|
* @throws Error if required RAW_DB_* environment variables are missing or if the connection fails.
|
|
@@ -27,7 +29,8 @@ class RawDBClass {
|
|
|
27
29
|
// Constructor
|
|
28
30
|
constructor(mongoClient) {
|
|
29
31
|
this.mongoClient = mongoClient;
|
|
30
|
-
this.
|
|
32
|
+
this.apex = new ApexDatabase(this.mongoClient);
|
|
33
|
+
this.vehicleEvents = new VehicleEventsDatabase(this.mongoClient);
|
|
31
34
|
}
|
|
32
35
|
}
|
|
33
36
|
export const rawDb = asyncSingletonProxy(RawDBClass);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmlmobilidade/go-interfaces-rawdb",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20260723.1350.16",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "iso@tmlmobilidade.pt",
|
|
6
6
|
"name": "TML-ISO"
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"@tmlmobilidade/go-clients-mongo": "*",
|
|
42
42
|
"@tmlmobilidade/go-types-apex": "*",
|
|
43
43
|
"@tmlmobilidade/go-types-shared": "*",
|
|
44
|
+
"@tmlmobilidade/go-types-vehicle-events": "*",
|
|
44
45
|
"@tmlmobilidade/logger": "*",
|
|
45
46
|
"@tmlmobilidade/strings": "*",
|
|
46
|
-
"@tmlmobilidade/types": "*",
|
|
47
47
|
"@tmlmobilidade/utils": "*",
|
|
48
48
|
"bcryptjs": "3.0.3",
|
|
49
49
|
"luxon": "3.7.2",
|
package/dist/databases/raw.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { MongoClient } from '@tmlmobilidade/go-clients-mongo';
|
|
2
|
-
import type { RawVehicleEvent } from '@tmlmobilidade/types';
|
|
3
|
-
import { MongoInterfaceTemplate } from '../interface.template.js';
|
|
4
|
-
import { RawApexTransaction } from '@tmlmobilidade/go-types-apex';
|
|
5
|
-
export declare class RawDatabase {
|
|
6
|
-
readonly rawApexTransactions: MongoInterfaceTemplate<RawApexTransaction, RawApexTransaction>;
|
|
7
|
-
readonly rawVehicleEvents: MongoInterfaceTemplate<RawVehicleEvent, RawVehicleEvent>;
|
|
8
|
-
private readonly database;
|
|
9
|
-
private readonly databaseName;
|
|
10
|
-
constructor(instance: MongoClient);
|
|
11
|
-
}
|
package/dist/databases/raw.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/* * */
|
|
2
|
-
import { MongoInterfaceTemplate } from '../interface.template.js';
|
|
3
|
-
import { RawApexTransactionSchema } from '@tmlmobilidade/go-types-apex';
|
|
4
|
-
import { RawVehicleEventSchema } from '@tmlmobilidade/types';
|
|
5
|
-
/* * */
|
|
6
|
-
export class RawDatabase {
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// Collections
|
|
10
|
-
rawApexTransactions;
|
|
11
|
-
rawVehicleEvents;
|
|
12
|
-
//
|
|
13
|
-
database;
|
|
14
|
-
databaseName = 'raw';
|
|
15
|
-
constructor(instance) {
|
|
16
|
-
// Create the database instance
|
|
17
|
-
this.database = instance.db(this.databaseName);
|
|
18
|
-
// Create collection interfaces
|
|
19
|
-
this.rawApexTransactions = new MongoInterfaceTemplate('raw_apex_transactions', this.database, RawApexTransactionSchema);
|
|
20
|
-
this.rawVehicleEvents = new MongoInterfaceTemplate('raw_vehicle_events', this.database, RawVehicleEventSchema);
|
|
21
|
-
}
|
|
22
|
-
}
|