UNPKG

prisma-util

Version:

Prisma Util is an easy to use tool that merges multiple Prisma schema files, allows extending of models, resolves naming conflicts both manually and automatically and provides easy access to Prisma commands and timing reports. It's mostly a plug-and-play

49 lines (48 loc) 1.61 kB
/** * A Feature is a middleware that will be generated. */ export declare type Feature = { identifier: string; code: string; }; /** * Packages are the scope wrappers for middlewares. */ export declare type Package = { identifier: string; features: Feature[]; }; /** * Project Toolchain Middleware API implementation. * * This class orchestrates middleware generation and hashing and provides an unified API for using the generated code. * It provides an easy way of creating middleware and correct scoping to make sure that Prisma Util users have a smooth experience. * * This API is intended for internal use only. You should not instantiate this class, but rather use the exported * instance. ({@link MiddlewareToolchainInstance}) */ declare class MiddlewareToolchain { private processPromise?; private packages; constructor(); /** * Add a middleware to the current queue. * @param pack The package name. * @param name The name of this middleware. * @param code The code for this middleware. * @returns This instance for chaining. */ defineMiddleware(pack: string, name: string, code: string): this; /** * Generate all of the middleware that are currently in the queue. */ generate(): Promise<void>; } /** * Instance of the Project Toolchain Middleware API Implementation. * * This is the entry-point to all middleware creation, as it provides an unified interface for generating scoped * middleware that are easy to use. */ export declare const MiddlewareToolchainInstance: MiddlewareToolchain; export {};