@intuitionrobotics/db-api-generator
Version:
21 lines (20 loc) • 1.03 kB
TypeScript
import { DB_Object, Clause_Where } from "@intuitionrobotics/firebase";
import { ApiWithBody, ApiWithQuery, HttpMethod } from "@intuitionrobotics/thunderstorm";
export declare const DefaultApiDefs: {
[k: string]: GenericApiDef;
};
export declare const ErrorKey_BadInput = "bad-input";
export type BadInputErrorBody = {
path: string;
input?: string;
};
export type GenericApiDef = {
method: HttpMethod;
key: string;
suffix?: string;
};
export type ApiBinder_DBCreate<DBType extends DB_Object, RequestType extends Omit<DBType, "_id"> = Omit<DBType, "_id">> = ApiWithBody<string, RequestType, DBType>;
export type ApiBinder_DBDelete<DBType extends DB_Object> = ApiWithQuery<string, DBType, DB_Object>;
export type ApiBinder_DBUniuqe<DBType extends DB_Object> = ApiWithQuery<string, DBType, DB_Object>;
export type ApiBinder_DBUpdate<DBType extends DB_Object> = ApiWithBody<string, DBType, DBType>;
export type ApiBinder_DBQuery<DBType extends DB_Object> = ApiWithBody<string, Clause_Where<DBType>, DBType[]>;