fix(build): update build and test tooling configuration, migrate project config to .smartconfig.json, and align TypeScript typings

This commit is contained in:
2026-03-24 19:44:49 +00:00
parent 27c1500db5
commit 03431535d7
29 changed files with 2210 additions and 1669 deletions

View File

@@ -174,8 +174,8 @@ export class SmartdataCollection<T> {
/**
* the collection that is used
*/
public mongoDbCollection: plugins.mongodb.Collection;
public objectValidation: IDocValidationFunc<T> = null;
public mongoDbCollection!: plugins.mongodb.Collection;
public objectValidation: IDocValidationFunc<T> | null = null;
public collectionName: string;
public smartdataDb: SmartdataDb;
public uniqueIndexes: string[] = [];
@@ -330,7 +330,7 @@ export class SmartdataCollection<T> {
);
const smartdataWatcher = new SmartdataDbWatcher(
changeStream,
smartdataDbDocArg,
smartdataDbDocArg!,
{ bufferTimeMs },
);
await smartdataWatcher.readyDeferred.promise;
@@ -353,7 +353,7 @@ export class SmartdataCollection<T> {
this.createRegularIndexes(dbDocArg.regularIndexes);
}
const saveableObject = await dbDocArg.createSavableObject();
const saveableObject = await dbDocArg.createSavableObject() as any;
const result = await this.mongoDbCollection.insertOne(saveableObject, { session: opts?.session });
return result;
}
@@ -368,7 +368,7 @@ export class SmartdataCollection<T> {
await this.init();
await this.checkDoc(dbDocArg);
const identifiableObject = await dbDocArg.createIdentifiableObject();
const saveableObject = await dbDocArg.createSavableObject();
const saveableObject = await dbDocArg.createSavableObject() as any;
const updateableObject: any = {};
for (const key of Object.keys(saveableObject)) {
if (identifiableObject[key]) {