terrier-engine 4.0.3 → 4.0.4

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.
Files changed (2) hide show
  1. package/db-client.ts +3 -3
  2. package/package.json +1 -1
package/db-client.ts CHANGED
@@ -197,7 +197,7 @@ export default class DbClient<PM extends ModelTypeMap, UM extends ModelTypeMap,
197
197
  * @param id the id of the record
198
198
  * @param includes relations to include in the returned object
199
199
  */
200
- async find<T extends keyof PM & string>(modelType: T, id: string, includes?: I[T]): Promise<PM[T]> {
200
+ async find<T extends keyof PM & string>(modelType: T, id: string, includes?: Includes<PM,T,I>): Promise<PM[T]> {
201
201
  const query = new ModelQuery<PM,T,I>(modelType).where("id = ?", id)
202
202
  if (includes) {
203
203
  query.includes(includes)
@@ -218,9 +218,9 @@ export default class DbClient<PM extends ModelTypeMap, UM extends ModelTypeMap,
218
218
  * @param idOrSlug the id or slug of the record
219
219
  * @param includes relations to include in the returned object
220
220
  */
221
- async findByIdOrSlug<T extends keyof PM & string>(modelType: T, idOrSlug: string, includes?: I[T]): Promise<PM[T]> {
221
+ async findByIdOrSlug<T extends keyof PM & string>(modelType: T, idOrSlug: string, includes?: Includes<PM, T, I>): Promise<PM[T]> {
222
222
  const column = isUuid(idOrSlug) ? "id" : "slug"
223
- const query = new ModelQuery(modelType).where(`${column} = ?`, idOrSlug)
223
+ const query = new ModelQuery<PM, T, I>(modelType).where(`${column} = ?`, idOrSlug)
224
224
  if (includes) {
225
225
  query.includes(includes)
226
226
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "files": [
5
5
  "*"
6
6
  ],
7
- "version": "4.0.3",
7
+ "version": "4.0.4",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/Terrier-Tech/terrier-engine"