UNPKG

@resin/pinejs

Version:

Pine.js is a sophisticated rules-driven API engine that enables you to define rules in a structured subset of English. Those rules are used in order for Pine.js to generate a database schema and the associated [OData](http://www.odata.org/) API. This make

41 lines (40 loc) 1.31 kB
import type * as Express from 'express'; import type { AbstractSqlModel } from '@resin/abstract-sql-compiler'; import type { Database } from '../database-layer/db'; import type { Migration } from '../migrator/migrator'; import type { Resolvable } from '../sbvr-api/common-types'; import * as Bluebird from 'bluebird'; import * as sbvrUtils from '../sbvr-api/sbvr-utils'; export declare type SetupFunction = (app: Express.Application, sbvrUtilsInstance: typeof sbvrUtils, db: Database) => Resolvable<void>; export interface Model { apiRoot?: string; modelName?: string; modelFile?: string; modelText?: string; abstractSql?: AbstractSqlModel; migrationsPath?: string; migrations?: { [index: string]: Migration; }; initSqlPath?: string; initSql?: string; customServerCode?: string | { setup: SetupFunction; }; logging?: { [key in keyof Console | 'default']?: boolean; }; } export interface User { username: string; password: string; permissions: string[]; } export interface Config { models: Model[]; users?: User[]; } export declare const setup: (app: Express.Application) => { loadConfig: (data: Config) => Bluebird<void>; loadApplicationConfig: (arg1: string | Config | undefined) => Bluebird<void>; };