@tmlmobilidade/go-interfaces-rawdb 20260717.1316.58
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/raw.d.ts +11 -0
- package/dist/databases/raw.js +22 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +33 -0
- package/dist/interface.template.d.ts +99 -0
- package/dist/interface.template.js +210 -0
- package/package.json +60 -0
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RawDatabase } from './databases/raw.js';
|
|
2
|
+
declare class RawDBClass {
|
|
3
|
+
private static _instance;
|
|
4
|
+
private readonly mongoClient;
|
|
5
|
+
readonly raw: RawDatabase;
|
|
6
|
+
/**
|
|
7
|
+
* Establishes a connection to the Mongo database and initializes the collection.
|
|
8
|
+
* @throws Error if required RAW_DB_* environment variables are missing or if the connection fails.
|
|
9
|
+
*/
|
|
10
|
+
static getInstance(): Promise<RawDBClass>;
|
|
11
|
+
private constructor();
|
|
12
|
+
}
|
|
13
|
+
export declare const rawDb: RawDBClass;
|
|
14
|
+
export {};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { MongoDatabaseClient } from '@tmlmobilidade/go-clients-mongo';
|
|
3
|
+
import { asyncSingletonProxy } from '@tmlmobilidade/utils';
|
|
4
|
+
import { RawDatabase } from './databases/raw.js';
|
|
5
|
+
/* * */
|
|
6
|
+
class RawDBClass {
|
|
7
|
+
//
|
|
8
|
+
//
|
|
9
|
+
//
|
|
10
|
+
static _instance;
|
|
11
|
+
mongoClient;
|
|
12
|
+
//
|
|
13
|
+
// Databases
|
|
14
|
+
raw;
|
|
15
|
+
/**
|
|
16
|
+
* Establishes a connection to the Mongo database and initializes the collection.
|
|
17
|
+
* @throws Error if required RAW_DB_* environment variables are missing or if the connection fails.
|
|
18
|
+
*/
|
|
19
|
+
static async getInstance() {
|
|
20
|
+
if (!RawDBClass._instance) {
|
|
21
|
+
const mongoClient = await MongoDatabaseClient.getClient({ prefix: 'RAWDB' });
|
|
22
|
+
RawDBClass._instance = new RawDBClass(mongoClient);
|
|
23
|
+
}
|
|
24
|
+
return RawDBClass._instance;
|
|
25
|
+
}
|
|
26
|
+
//
|
|
27
|
+
// Constructor
|
|
28
|
+
constructor(mongoClient) {
|
|
29
|
+
this.mongoClient = mongoClient;
|
|
30
|
+
this.raw = new RawDatabase(this.mongoClient);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export const rawDb = asyncSingletonProxy(RawDBClass);
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { AnyBulkWriteOperation, BulkWriteOptions, BulkWriteResult, Collection, Db, Document, Filter, FindOptions, InsertOneOptions, SimplifiedMongoIndex, WithId } from '@tmlmobilidade/go-clients-mongo';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
export declare class MongoInterfaceTemplate<T extends Document, TCreate> {
|
|
4
|
+
private readonly collectionName;
|
|
5
|
+
private readonly createSchema;
|
|
6
|
+
private readonly database;
|
|
7
|
+
private readonly indexDescription;
|
|
8
|
+
private readonly collection;
|
|
9
|
+
private initPromise;
|
|
10
|
+
/**
|
|
11
|
+
* @param collectionName - The name of the collection to create the interface for.
|
|
12
|
+
* @param database - The database to create the interface for.
|
|
13
|
+
* @param createSchema - The schema to use for creating documents.
|
|
14
|
+
* @param indexDescription - The index description to use for the collection.
|
|
15
|
+
*/
|
|
16
|
+
constructor(collectionName: string, database: Db, createSchema: z.ZodSchema, indexDescription?: false | SimplifiedMongoIndex<T>[]);
|
|
17
|
+
/**
|
|
18
|
+
* Counts documents matching the filter criteria.
|
|
19
|
+
* @param filter The filter criteria to match documents.
|
|
20
|
+
* @returns A promise that resolves to the count of matching documents.
|
|
21
|
+
*/
|
|
22
|
+
count(filter?: Filter<T>): Promise<number>;
|
|
23
|
+
/**
|
|
24
|
+
* Finds all distinct values for a key in the collection.
|
|
25
|
+
* @param key The key to find distinct values for.
|
|
26
|
+
* @param filter Optional filter criteria to match documents before extracting distinct values.
|
|
27
|
+
* @returns A promise that resolves to an array of distinct values for the given key.
|
|
28
|
+
*/
|
|
29
|
+
distinct<Key extends keyof WithId<T>>(key: Key, filter: Filter<T>): Promise<import("mongodb").Flatten<WithId<T>[Key]>[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Finds multiple documents matching the filter criteria,
|
|
32
|
+
* with optional pagination and sorting.
|
|
33
|
+
* @param filter (Optional) filter criteria to match documents.
|
|
34
|
+
* @param options (Optional) find options.
|
|
35
|
+
* @returns A promise that resolves to an array of matching documents.
|
|
36
|
+
*/
|
|
37
|
+
findMany(filter: Filter<T>, options?: FindOptions): Promise<WithId<T>[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Finds a single document matching the filter criteria.
|
|
40
|
+
* @param filter The filter criteria to match the document.
|
|
41
|
+
* @param options Optional options.
|
|
42
|
+
* @returns A promise that resolves to the matching document or null if not found.
|
|
43
|
+
*/
|
|
44
|
+
findOne(filter: Filter<T>, options?: FindOptions): Promise<T | null>;
|
|
45
|
+
/**
|
|
46
|
+
* Provides access to the MongoDB collection instance,
|
|
47
|
+
* initializing it if it has not already been created.
|
|
48
|
+
* @returns A promise that resolves to the MongoDB collection instance.
|
|
49
|
+
* @warning Use with caution: direct access to the collection allows for executing arbitrary queries.
|
|
50
|
+
*/
|
|
51
|
+
getCollection(): Promise<Collection<T>>;
|
|
52
|
+
/**
|
|
53
|
+
* This method allows for performing multiple write operations
|
|
54
|
+
* in a single request, which can improve performance.
|
|
55
|
+
* The operations can include inserts, updates, deletes, and replacements.
|
|
56
|
+
* @param operations An array of bulk write operations to execute on the collection.
|
|
57
|
+
* @param options The options for the bulk write operation.
|
|
58
|
+
* @returns A promise that resolves to the result of the bulk write operation.
|
|
59
|
+
* @warning This method does not perform schema validation on the operations.
|
|
60
|
+
* It is the responsibility of the caller to ensure that the operations are valid and conform to the expected schemas.
|
|
61
|
+
*/
|
|
62
|
+
bulkWrite(operations: AnyBulkWriteOperation<T>[], options?: BulkWriteOptions): Promise<BulkWriteResult>;
|
|
63
|
+
/**
|
|
64
|
+
* Inserts multiple documents into the collection after validating them against the create schema.
|
|
65
|
+
* @param data An array of documents to insert, conforming to the TCreate type.
|
|
66
|
+
* @param options Optional insert options to configure the behavior of the insert operation.
|
|
67
|
+
* @returns A promise that resolves to the result of the insertMany operation.
|
|
68
|
+
*/
|
|
69
|
+
insertMany(data: TCreate[], options?: BulkWriteOptions): Promise<import("mongodb").InsertManyResult<T>>;
|
|
70
|
+
insertOne(data: TCreate, options?: InsertOneOptions): Promise<import("mongodb").InsertOneResult<T>>;
|
|
71
|
+
/**
|
|
72
|
+
* Initializes the MongoDB client and ensures that the specified database and collection exist.
|
|
73
|
+
* This method should be called before performing any operations on the database or collection.
|
|
74
|
+
* It handles the asynchronous setup process and logs any errors that occur during initialization.
|
|
75
|
+
* @throws Will throw an error if the client initialization or database/collection setup fails.
|
|
76
|
+
* @returns A promise that resolves when the initialization process is complete.
|
|
77
|
+
*/
|
|
78
|
+
protected init(): Promise<void>;
|
|
79
|
+
private ensureInitialized;
|
|
80
|
+
/**
|
|
81
|
+
* Optional override for custom setup logic:
|
|
82
|
+
* indexes, materialized views, constraints, etc.
|
|
83
|
+
*/
|
|
84
|
+
protected postInit(): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Ensures that the specified collection exists in the MongoDB database,
|
|
87
|
+
* creating it if it does not already exist.
|
|
88
|
+
* @returns A promise that resolves when the collection is ensured to exist.
|
|
89
|
+
*/
|
|
90
|
+
private createCollectionIfNotExists;
|
|
91
|
+
/**
|
|
92
|
+
* Ensures that the specified indexes exist in MongoDB, creating them if they do not already exist.
|
|
93
|
+
* This method performs input validation to prevent unsafe operations and logs the outcome of the operation.
|
|
94
|
+
* It constructs the necessary index creation queries based on the provided index descriptions and executes them using the client.
|
|
95
|
+
* @throws Will throw an error if any of the inputs are unsafe or if the index creation query fails.
|
|
96
|
+
* @returns A promise that resolves when the indexes are ensured to exist.
|
|
97
|
+
*/
|
|
98
|
+
private syncIndexes;
|
|
99
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/* * */
|
|
2
|
+
import { isSameIndex, prepareMongoIndexOptions } from '@tmlmobilidade/go-clients-mongo';
|
|
3
|
+
import { Logger } from '@tmlmobilidade/logger';
|
|
4
|
+
/* * */
|
|
5
|
+
export class MongoInterfaceTemplate {
|
|
6
|
+
//
|
|
7
|
+
collectionName;
|
|
8
|
+
createSchema;
|
|
9
|
+
database;
|
|
10
|
+
indexDescription;
|
|
11
|
+
//
|
|
12
|
+
collection;
|
|
13
|
+
initPromise = null;
|
|
14
|
+
/**
|
|
15
|
+
* @param collectionName - The name of the collection to create the interface for.
|
|
16
|
+
* @param database - The database to create the interface for.
|
|
17
|
+
* @param createSchema - The schema to use for creating documents.
|
|
18
|
+
* @param indexDescription - The index description to use for the collection.
|
|
19
|
+
*/
|
|
20
|
+
constructor(collectionName, database, createSchema, indexDescription = []) {
|
|
21
|
+
this.collectionName = collectionName;
|
|
22
|
+
this.collection = database.collection(collectionName);
|
|
23
|
+
this.database = database;
|
|
24
|
+
this.createSchema = createSchema;
|
|
25
|
+
this.indexDescription = indexDescription;
|
|
26
|
+
this.initPromise = this.init().catch((error) => {
|
|
27
|
+
Logger.error({ error, message: `MONGODB [${this.collectionName}]: Error @ constructor(): ${error.message}` });
|
|
28
|
+
throw error;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Counts documents matching the filter criteria.
|
|
33
|
+
* @param filter The filter criteria to match documents.
|
|
34
|
+
* @returns A promise that resolves to the count of matching documents.
|
|
35
|
+
*/
|
|
36
|
+
async count(filter) {
|
|
37
|
+
await this.ensureInitialized();
|
|
38
|
+
return await this.collection.countDocuments(filter);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Finds all distinct values for a key in the collection.
|
|
42
|
+
* @param key The key to find distinct values for.
|
|
43
|
+
* @param filter Optional filter criteria to match documents before extracting distinct values.
|
|
44
|
+
* @returns A promise that resolves to an array of distinct values for the given key.
|
|
45
|
+
*/
|
|
46
|
+
async distinct(key, filter) {
|
|
47
|
+
await this.ensureInitialized();
|
|
48
|
+
return this.collection.distinct(key, filter);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Finds multiple documents matching the filter criteria,
|
|
52
|
+
* with optional pagination and sorting.
|
|
53
|
+
* @param filter (Optional) filter criteria to match documents.
|
|
54
|
+
* @param options (Optional) find options.
|
|
55
|
+
* @returns A promise that resolves to an array of matching documents.
|
|
56
|
+
*/
|
|
57
|
+
async findMany(filter, options) {
|
|
58
|
+
await this.ensureInitialized();
|
|
59
|
+
return await this.collection.find(filter, options).toArray();
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Finds a single document matching the filter criteria.
|
|
63
|
+
* @param filter The filter criteria to match the document.
|
|
64
|
+
* @param options Optional options.
|
|
65
|
+
* @returns A promise that resolves to the matching document or null if not found.
|
|
66
|
+
*/
|
|
67
|
+
async findOne(filter, options) {
|
|
68
|
+
await this.ensureInitialized();
|
|
69
|
+
return await this.collection.findOne(filter, options);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Provides access to the MongoDB collection instance,
|
|
73
|
+
* initializing it if it has not already been created.
|
|
74
|
+
* @returns A promise that resolves to the MongoDB collection instance.
|
|
75
|
+
* @warning Use with caution: direct access to the collection allows for executing arbitrary queries.
|
|
76
|
+
*/
|
|
77
|
+
async getCollection() {
|
|
78
|
+
await this.ensureInitialized();
|
|
79
|
+
return this.collection;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* This method allows for performing multiple write operations
|
|
83
|
+
* in a single request, which can improve performance.
|
|
84
|
+
* The operations can include inserts, updates, deletes, and replacements.
|
|
85
|
+
* @param operations An array of bulk write operations to execute on the collection.
|
|
86
|
+
* @param options The options for the bulk write operation.
|
|
87
|
+
* @returns A promise that resolves to the result of the bulk write operation.
|
|
88
|
+
* @warning This method does not perform schema validation on the operations.
|
|
89
|
+
* It is the responsibility of the caller to ensure that the operations are valid and conform to the expected schemas.
|
|
90
|
+
*/
|
|
91
|
+
async bulkWrite(operations, options) {
|
|
92
|
+
await this.ensureInitialized();
|
|
93
|
+
return await this.collection.bulkWrite(operations, options);
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Inserts multiple documents into the collection after validating them against the create schema.
|
|
97
|
+
* @param data An array of documents to insert, conforming to the TCreate type.
|
|
98
|
+
* @param options Optional insert options to configure the behavior of the insert operation.
|
|
99
|
+
* @returns A promise that resolves to the result of the insertMany operation.
|
|
100
|
+
*/
|
|
101
|
+
async insertMany(data, options) {
|
|
102
|
+
await this.ensureInitialized();
|
|
103
|
+
// If no create schema is defined, throw an error.
|
|
104
|
+
if (!this.createSchema)
|
|
105
|
+
throw new Error(`No schema defined for insert operation for ${this.collectionName} collection.`);
|
|
106
|
+
// Validate each document against the create schema
|
|
107
|
+
const parsedDocuments = data.map((doc) => {
|
|
108
|
+
const parseResult = this.createSchema.safeParse(doc);
|
|
109
|
+
if (!parseResult.success)
|
|
110
|
+
throw new Error(`Document validation failed: ${parseResult.error.message}`);
|
|
111
|
+
return parseResult.data;
|
|
112
|
+
});
|
|
113
|
+
// Attempt to insert the documents into the collection
|
|
114
|
+
return await this.collection.insertMany(parsedDocuments, options);
|
|
115
|
+
}
|
|
116
|
+
async insertOne(data, options) {
|
|
117
|
+
await this.ensureInitialized();
|
|
118
|
+
// If no create schema is defined, throw an error.
|
|
119
|
+
if (!this.createSchema)
|
|
120
|
+
throw new Error(`No schema defined for insert operation for ${this.collectionName} collection.`);
|
|
121
|
+
// Validate the document against the create schema
|
|
122
|
+
const parseResult = this.createSchema.safeParse(data);
|
|
123
|
+
if (!parseResult.success)
|
|
124
|
+
throw new Error(`Document validation failed: ${parseResult.error.message}`);
|
|
125
|
+
// Attempt to insert the document into the collection
|
|
126
|
+
return await this.collection.insertOne(parseResult.data, options);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Initializes the MongoDB client and ensures that the specified database and collection exist.
|
|
130
|
+
* This method should be called before performing any operations on the database or collection.
|
|
131
|
+
* It handles the asynchronous setup process and logs any errors that occur during initialization.
|
|
132
|
+
* @throws Will throw an error if the client initialization or database/collection setup fails.
|
|
133
|
+
* @returns A promise that resolves when the initialization process is complete.
|
|
134
|
+
*/
|
|
135
|
+
async init() {
|
|
136
|
+
// Ensure the collection exists and its indexes are in sync
|
|
137
|
+
// with the provided index description.
|
|
138
|
+
await this.createCollectionIfNotExists();
|
|
139
|
+
await this.syncIndexes();
|
|
140
|
+
// Call postInit for any additional setup logic defined in subclasses
|
|
141
|
+
await this.postInit();
|
|
142
|
+
}
|
|
143
|
+
async ensureInitialized() {
|
|
144
|
+
if (!this.initPromise)
|
|
145
|
+
this.initPromise = this.init();
|
|
146
|
+
await this.initPromise;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Optional override for custom setup logic:
|
|
150
|
+
* indexes, materialized views, constraints, etc.
|
|
151
|
+
*/
|
|
152
|
+
async postInit() {
|
|
153
|
+
// no-op by default
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Ensures that the specified collection exists in the MongoDB database,
|
|
157
|
+
* creating it if it does not already exist.
|
|
158
|
+
* @returns A promise that resolves when the collection is ensured to exist.
|
|
159
|
+
*/
|
|
160
|
+
async createCollectionIfNotExists() {
|
|
161
|
+
const collections = await this.database.listCollections({ name: this.collectionName }).toArray();
|
|
162
|
+
if (collections.length)
|
|
163
|
+
return;
|
|
164
|
+
await this.database.createCollection(this.collectionName);
|
|
165
|
+
Logger.info({ message: `MONGODB [${this.collectionName}]: Collection created.` });
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Ensures that the specified indexes exist in MongoDB, creating them if they do not already exist.
|
|
169
|
+
* This method performs input validation to prevent unsafe operations and logs the outcome of the operation.
|
|
170
|
+
* It constructs the necessary index creation queries based on the provided index descriptions and executes them using the client.
|
|
171
|
+
* @throws Will throw an error if any of the inputs are unsafe or if the index creation query fails.
|
|
172
|
+
* @returns A promise that resolves when the indexes are ensured to exist.
|
|
173
|
+
*/
|
|
174
|
+
async syncIndexes() {
|
|
175
|
+
try {
|
|
176
|
+
if (this.indexDescription === false) {
|
|
177
|
+
Logger.info({ message: `MONGODB [${this.collectionName}]: Skipping index synchronization.` });
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
// Start index synchronization process
|
|
181
|
+
Logger.info({ message: `MONGODB [${this.collectionName}]: Synchronizing indexes...` });
|
|
182
|
+
// Normalize already applied and new indexes
|
|
183
|
+
// and filter the default _id index.
|
|
184
|
+
const existingIndexes = await this.collection.indexes();
|
|
185
|
+
const filteredExisting = existingIndexes.filter(idx => JSON.stringify(idx.key) !== JSON.stringify({ _id: 1 }));
|
|
186
|
+
// Setup desired indexes based on indexDescription
|
|
187
|
+
const indexesToCreate = [];
|
|
188
|
+
// Find indexes to create
|
|
189
|
+
for (const desiredIdx of this.indexDescription) {
|
|
190
|
+
// For the list of desired indexes,
|
|
191
|
+
// check if they are present in the existing indexes.
|
|
192
|
+
const found = filteredExisting.some(existingIdx => isSameIndex(existingIdx, desiredIdx));
|
|
193
|
+
// If not, mark them for creation.
|
|
194
|
+
if (!found)
|
|
195
|
+
indexesToCreate.push(desiredIdx);
|
|
196
|
+
}
|
|
197
|
+
// Create indexes
|
|
198
|
+
for (const idx of indexesToCreate) {
|
|
199
|
+
Logger.info({ message: `MONGODB [${this.collectionName}]: Creating index on keys ${JSON.stringify(idx.key)} with options ${JSON.stringify(prepareMongoIndexOptions(idx))}.` });
|
|
200
|
+
await this.collection.createIndex(idx.key, prepareMongoIndexOptions(idx));
|
|
201
|
+
Logger.success(`MONGODB [${this.collectionName}]: Created index on keys ${JSON.stringify(idx.key)}.`);
|
|
202
|
+
}
|
|
203
|
+
Logger.success(`MONGODB [${this.collectionName}]: Indexes synchronized.`);
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
Logger.error({ error, message: `MONGODB [${this.collectionName}]: Error @ syncIndexes(): ${error.message}` });
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tmlmobilidade/go-interfaces-rawdb",
|
|
3
|
+
"version": "20260717.1316.58",
|
|
4
|
+
"author": {
|
|
5
|
+
"email": "iso@tmlmobilidade.pt",
|
|
6
|
+
"name": "TML-ISO"
|
|
7
|
+
},
|
|
8
|
+
"license": "AGPL-3.0-or-later",
|
|
9
|
+
"homepage": "https://go.tmlmobilidade.pt",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/tmlmobilidade/go/issues"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/tmlmobilidade/go.git"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"public transit",
|
|
19
|
+
"tml",
|
|
20
|
+
"transportes metropolitanos de lisboa",
|
|
21
|
+
"go"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"type": "module",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist"
|
|
29
|
+
],
|
|
30
|
+
"main": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc && resolve-tspaths",
|
|
34
|
+
"lint": "eslint ./src/ && tsc --noEmit",
|
|
35
|
+
"lint:fix": "eslint ./src/ --fix",
|
|
36
|
+
"watch": "tsc-watch --onSuccess 'resolve-tspaths'"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@tmlmobilidade/consts": "*",
|
|
40
|
+
"@tmlmobilidade/dates": "*",
|
|
41
|
+
"@tmlmobilidade/go-clients-mongo": "*",
|
|
42
|
+
"@tmlmobilidade/go-types-apex": "*",
|
|
43
|
+
"@tmlmobilidade/go-types-shared": "*",
|
|
44
|
+
"@tmlmobilidade/logger": "*",
|
|
45
|
+
"@tmlmobilidade/strings": "*",
|
|
46
|
+
"@tmlmobilidade/types": "*",
|
|
47
|
+
"@tmlmobilidade/utils": "*",
|
|
48
|
+
"bcryptjs": "3.0.3",
|
|
49
|
+
"luxon": "3.7.2",
|
|
50
|
+
"zod": "3.25.76"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@tmlmobilidade/tsconfig": "*",
|
|
54
|
+
"@types/luxon": "3.7.2",
|
|
55
|
+
"@types/node": "26.1.1",
|
|
56
|
+
"resolve-tspaths": "0.8.23",
|
|
57
|
+
"tsc-watch": "7.2.1",
|
|
58
|
+
"typescript": "6.0.3"
|
|
59
|
+
}
|
|
60
|
+
}
|