I am trying to get [email protected] to return an updated object (Azure Function v4, Typescript, [email protected], Azure SQL Server) as per update() option returning: true.
See the commented out line below:
async update(query: any, value: Partial<T>, transaction?: Transaction) {
const err = new Error();
try {
const model = await this.create(transaction);
return model.update(value, {
where: query,
// returning: true,
transaction: transaction
});
} catch (ex: any) {
err.message = 'Unable to update query:' + JSON.stringify(query) + ' value:' + JSON.stringify(value) + '\n' + this.logTableError(ex);
throw err;
}
}
The class is an abstract wrapper for all my models and I compile and deploy it as a private NPM package that I reuse in multiple projects successfully.
But if I uncomment that line, I get the following errors in the projects where I use that package.
NOTE: the NPM project still compiles perfectly fine and it's only projects that use the package that are affected.
If I look at the types (*.ts.d) file in node_modules the issue is associated with the types used by Sequelize hooks that are added to make the cascade update() work.
Both the NPM package and my project using the package have @types/[email protected].
Can anyone advise please why these types are getting the error:
Cannot find name '*'

