Improve API extension context types (#7714)

This commit is contained in:
Nicola Krumschmidt
2021-08-31 15:11:59 +02:00
committed by GitHub
parent 353e4f06c7
commit 4d8e9d7297
3 changed files with 8 additions and 3 deletions

2
package-lock.json generated
View File

@@ -51261,6 +51261,7 @@
"fs-extra": "10.0.0",
"geojson": "0.5.0",
"joi": "17.4.2",
"knex": "0.95.10",
"knex-schema-inspector": "1.5.14",
"lodash": "4.17.21",
"vue": "3.2.6",
@@ -53400,6 +53401,7 @@
"fs-extra": "10.0.0",
"geojson": "0.5.0",
"joi": "17.4.2",
"knex": "0.95.10",
"knex-schema-inspector": "1.5.14",
"lodash": "4.17.21",
"npm-run-all": "4.1.5",

View File

@@ -50,6 +50,7 @@
"fs-extra": "10.0.0",
"geojson": "0.5.0",
"joi": "17.4.2",
"knex": "0.95.10",
"knex-schema-inspector": "1.5.14",
"lodash": "4.17.21",
"vue": "3.2.6",

View File

@@ -1,3 +1,4 @@
import { Knex } from 'knex';
import {
API_EXTENSION_PACKAGE_TYPES,
API_EXTENSION_TYPES,
@@ -7,6 +8,7 @@ import {
EXTENSION_PKG_KEY,
EXTENSION_TYPES,
} from '../constants';
import { Accountability } from './accountability';
export type AppExtensionType = typeof APP_EXTENSION_TYPES[number];
export type ApiExtensionType = typeof API_EXTENSION_TYPES[number];
@@ -61,7 +63,7 @@ export type ExtensionManifest = {
export type ApiExtensionContext = {
services: any;
exceptions: any;
database: any;
env: any;
getSchema: any;
database: Knex;
env: Record<string, any>;
getSchema: (options?: { accountability?: Accountability; database?: Knex }) => Promise<Record<string, any>>;
};