UNPKG

bapig

Version:

Welcome to BAPIG, a powerful backend solution designed to streamline your development process. With over 40 built-in functionalities, BAPIG simplifies CRUD operations, facilitates authentication and encryption, handles communication tasks, and much more.

169 lines (168 loc) 6.27 kB
export declare type controller = { changeDocumentFieldEncryption(body: changeFieldEncryption): Promise<controllerResponse>; createSingleDocument(body: create): Promise<controllerResponse>; createDocumentFieldEncryption(body: createFieldEncryption): Promise<controllerResponse>; deleteSingleDocument(query: deleteDocument): Promise<controllerResponse>; listDocuments(query: list): Promise<controllerResponse>; listAllDocuments(query: list): Promise<controllerResponse>; bulkListAllDocuments(queries: list[]): Promise<controllerResponse>; authenticate(body: authenticate): Promise<controllerResponse>; getSingleDocument(query: read): Promise<controllerResponse>; bulkGetSingleDocument(queries: read[]): Promise<controllerResponse>; updateSingleDocument(body: update): Promise<controllerResponse>; validateDocument(query: documentValidation): Promise<controllerResponse>; validateDocumentFieldEncryption(query: validateFieldEncryption): Promise<controllerResponse>; deleteSingleFile(query: deleteFile): Promise<controllerResponse>; fileBulkDelete(query: deleteFile[]): Promise<controllerResponse>; documentBulkCreate(bodyArray: create[]): Promise<controllerResponse>; documentBulkUpdate(bodyArray: update[]): Promise<controllerResponse>; documentBulkDelete(queries: deleteDocument[]): Promise<controllerResponse>; sendMessage(body: messageOptions): Promise<controllerResponse>; sendEmail(options: emailSendingOptions): Promise<controllerResponse>; generateOTP(): controllerResponse; sendOTP(options: sendOTPOptions): Promise<controllerResponse>; pushNotification(options: object): Promise<controllerResponse>; search(query: search): Promise<controllerResponse>; countDocuments(query: countDocuments): Promise<controllerResponse>; bulkCountDocuments(queries: countDocuments[]): Promise<controllerResponse>; aggregate(queries: aggregate): Promise<controllerResponse>; bulkAggregate(queries: aggregate[]): Promise<controllerResponse>; updateManyDocument(body: update): Promise<controllerResponse>; bulkUpdateManyDocument(body: update[]): Promise<controllerResponse>; updateAllCollections(body: updateAllCollections): Promise<controllerResponse>; deleteManyDocument(query: deleteDocument): Promise<controllerResponse>; documentBulkDeleteMany(query: deleteDocument[]): Promise<controllerResponse>; deleteAllCollections(query: deleteAllCollections): Promise<controllerResponse>; countAllCollections(query: deleteAllCollections): Promise<controllerResponse>; listAllCollections(query: listAllCollections): Promise<controllerResponse>; performTransaction(operations: transactionOperation[]): Promise<controllerResponse>; }; export declare type controllerResponse = { success: boolean; message: any; }; export declare type documentInformation = { previousPage: number; nextPage: number; documents: any[]; totalDocuments: number; limit: number; currentPage: number; pages: number[]; }; export declare type emailSendingOptions = { from: string; to: string; subject: string; text: string; html: string; }; export declare type sendOTPOptions = { receiverEmail: string; receiverPhone: string; senderEmail: string; }; export declare type search = { condition: any; schema: string; keyword: string; sort: any; fields: any; select: any; joinForeignKeys: boolean; }; export declare type authenticate = { schema: string; condition: any; select: any; joinForeignKeys: boolean; valueToCompareWithEncryption: string; fieldWithEncryption: string; }; export declare type read = { schema: string; condition: any; select: any; joinForeignKeys: boolean; }; export interface list extends read { page?: number; limit?: number; sort: any; } export declare type update = { schema: string; condition: any; newDocumentData: any; }; export declare type create = { schema: string; documentData: any; }; export declare type deleteDocument = { schema: string; condition: any; }; export declare type deleteFile = { folderName: string; fileName: string; }; export declare type messageOptions = { receivers: string[]; message: string; }; export declare type documentValidation = { schema: string; validationType: "onCreate" | "onUpdate"; condition: any; documentId?: any; joinForeignKeys?: boolean; select?: any; }; export declare type createFieldEncryption = { schema: string; fieldToEncrypt: string; documentData: any; }; export declare type changeFieldEncryption = { schema: string; fieldWithEncryption: string; documentId: any; newValueToEncrypt: string; }; export declare type validateFieldEncryption = { schema: string; documentId: any; valueToCompareWithEncryption: string; fieldWithEncryption: string; }; export declare type countDocuments = { condition: any; schema: string; }; export declare type aggregate = { schema: string; aggregation: any[]; }; export declare type updateAllCollections = { condition: any; newDocumentData: any; }; export declare type deleteAllCollections = { condition: any; }; export declare type listAllCollections = { condition: any; joinForeignKeys: boolean; sort: any; }; export declare type encryption = { payload: string; }; export declare type objectKey = "page" | "limit" | "sort" | "condition" | "schema" | "select" | "joinForeignKeys" | "documentData" | "newDocumentData" | "aggregation" | "from" | "to" | "subject" | "text" | "html" | "documentId" | "valueToCompareWithEncryption" | "fieldWithEncryption" | "newValueToEncrypt" | "fieldToEncrypt" | "folderName" | "fileName" | "receivers" | "message" | "validationType" | "keyword" | "fields" | "validationType" | "receiverEmail" | "receiverPhone" | "senderEmail"; export declare type transactionOperation = { method: string; schema: string; condition?: any; documentData: any; };