@platformatic/sql-mapper
Advanced tools
Comparing version 0.27.0 to 0.28.1
import { FastifyPluginAsync, FastifyInstance, FastifyReply, FastifyRequest } from 'fastify' | ||
import type { PlatformaticApp } from '@platformatic/types' | ||
import { SQL, SQLQuery } from '@databases/sql' | ||
@@ -309,2 +310,25 @@ | ||
// Extend the PlatformaticApp interface, | ||
// Unfortunately we neeed to copy over all the types from SQLMapperPluginInterface | ||
declare module '@platformatic/types' { | ||
interface PlatformaticApp { | ||
/** | ||
* A Database abstraction layer from [@Databases](https://www.atdatabases.org/) | ||
*/ | ||
db: Database, | ||
/** | ||
* The SQL builder from [@Databases](https://www.atdatabases.org/) | ||
*/ | ||
sql: SQL, | ||
/** | ||
* An object containing a key for each table found in the schema, with basic CRUD operations. See [entity.md](./entity.md) for details. | ||
*/ | ||
entities: Entities, | ||
/** | ||
* Adds hooks to the entity. | ||
*/ | ||
addEntityHooks(entityName: string, hooks: EntityHooks): any | ||
} | ||
} | ||
export interface PlatformaticContext { | ||
@@ -316,6 +340,2 @@ app: FastifyInstance, | ||
declare module 'fastify' { | ||
interface FastifyInstance { | ||
platformatic: SQLMapperPluginInterface | ||
} | ||
interface FastifyRequest { | ||
@@ -342,1 +362,2 @@ platformaticContext: PlatformaticContext | ||
} | ||
{ | ||
"name": "@platformatic/sql-mapper", | ||
"version": "0.27.0", | ||
"version": "0.28.1", | ||
"description": "A data mapper utility for SQL databases", | ||
"main": "mapper.js", | ||
"types": "mapper.d.ts", | ||
"repository": { | ||
@@ -30,3 +31,4 @@ "type": "git", | ||
"fastify-plugin": "^4.5.0", | ||
"inflected": "^2.1.0" | ||
"inflected": "^2.1.0", | ||
"@platformatic/types": "0.28.1" | ||
}, | ||
@@ -33,0 +35,0 @@ "tsd": { |
164408
5201
8
+ Added@platformatic/types@0.28.1
+ Added@platformatic/types@0.28.1(transitive)