@chiselstrike/api
Advanced tools
Comparing version
export { crud } from "./crud.ts"; | ||
export type { ChiselEntityClass } from "./crud.ts"; | ||
export { AuthUser, ChiselCursor, ChiselEntity, chiselIterator, labels, loggedInUser, unique, } from "./datastore.ts"; | ||
export type { Id } from "./datastore.ts"; | ||
export type { ChiselEvent } from "./kafka.ts"; | ||
export type { ChiselEvent, EventHandler } from "./kafka.ts"; | ||
export { publishEvent } from "./kafka.ts"; | ||
export { ChiselRequest, Params, Query } from "./request.ts"; | ||
export { RouteMap } from "./routing.ts"; | ||
export type { Handler, MiddlewareHandler, MiddlewareNext } from "./routing.ts"; | ||
export type { Handler, MiddlewareHandler, MiddlewareNext, ResponseLike, } from "./routing.ts"; | ||
export { getSecret, responseFromJson } from "./utils.ts"; | ||
export type { JSONValue } from "./utils.ts"; | ||
export type { Action, ReqContext } from "./policies.ts"; | ||
export type { ReqContext } from "./policies.ts"; | ||
export { Action } from "./policies.ts"; |
import { ChiselEntity } from "./datastore.ts"; | ||
import { RouteMap } from "./routing.ts"; | ||
declare type ChiselEntityClass<T extends ChiselEntity> = { | ||
export declare type ChiselEntityClass<T extends ChiselEntity> = { | ||
new (): T; | ||
@@ -54,2 +54,1 @@ findOne: (_: { | ||
}): RouteMap; | ||
export {}; |
@@ -64,3 +64,3 @@ import type { ChiselRequest } from "./request.ts"; | ||
*/ | ||
route(method: string | string[], path: string, handler: Handler): this; | ||
route(method: string | string[], path: string, handler: Handler, clientMetadata?: ClientMetadata): this; | ||
/** Adds routes from another `RouteMap` under a URL prefix. | ||
@@ -103,3 +103,16 @@ * | ||
legacyFileName: string | undefined; | ||
clientMetadata?: ClientMetadata; | ||
}; | ||
export declare type CrudHandler = "GetOne" | "GetMany" | "PostOne" | "PatchOne" | "PutOne" | "DeleteOne" | "DeleteMany"; | ||
/** Metadata used to generate chisel client code. | ||
*/ | ||
export declare type ClientMetadata = { | ||
handler: { | ||
kind: "Crud"; | ||
handler: { | ||
kind: CrudHandler; | ||
entityName: string; | ||
}; | ||
}; | ||
}; | ||
/** A request handler that maps HTTP request to an HTTP response. */ | ||
@@ -106,0 +119,0 @@ export declare type Handler = (req: ChiselRequest) => ResponseLike | Promise<ResponseLike>; |
@@ -39,1 +39,2 @@ export declare type SimpleTypeSystem = { | ||
} | ||
export declare const typeSystem: TypeSystem; |
{ | ||
"name": "@chiselstrike/api", | ||
"version": "0.14.0", | ||
"version": "0.15.0-rc.0", | ||
"keywords": [ | ||
@@ -12,3 +12,3 @@ "api", | ||
"description": "The prototype-to-production backend framework for TypeScript", | ||
"homepage": "https://www.chiselstrike.com", | ||
"homepage": "https://chiselstrike.com", | ||
"repository": { | ||
@@ -15,0 +15,0 @@ "type": "git", |
35439
1.66%849
1.8%