So, for example to get an @Model working, there's an export tap dance that needs to happen:
import {
Db,
IDbGetParams,
IFromDbOptions,
Json,
Model,
SakuraApi,
SapiModelMixin
} from '@sakuraapi/api';
import {
Collection,
CollectionInsertOneOptions,
CollectionOptions,
Cursor,
Db as MongoDb,
DeleteWriteOpResultObject,
InsertOneWriteOpResult,
ObjectID,
ReplaceOneOptions,
UpdateWriteOpResult
} from 'mongodb';
import {dbs} from '../config/db';
export {
Collection,
CollectionInsertOneOptions,
CollectionOptions,
Cursor,
MongoDb,
DeleteWriteOpResultObject,
InsertOneWriteOpResult,
ObjectID,
ReplaceOneOptions,
UpdateWriteOpResult,
IDbGetParams,
IFromDbOptions,
SakuraApi
};
@Model({
dbConfig: dbs.user
})
export class User extends SapiModelMixin() {
}
That's a lot of setup work. It looks like TypeScript issue 9944 is scheduled to have some sort of solution in 2.8, so revisit the issue then. In the meantime, sapi cli needs to reduce the pain in setting up a model.
Might as well create generators for Services and Routables at the same time.
This has become expecially important because of how mixins work (don't work?) with TypeScript 2.6 (see: https://github.com/Microsoft/TypeScript/issues/9944).
So, for example to get an
@Model
working, there's an export tap dance that needs to happen:That's a lot of setup work. It looks like TypeScript issue 9944 is scheduled to have some sort of solution in 2.8, so revisit the issue then. In the meantime,
sapi
cli needs to reduce the pain in setting up a model.Might as well create generators for Services and Routables at the same time.