UNPKG

@gsb-core/core

Version:

GSB core services and classes for platform-independent web applications

58 lines (57 loc) 4.02 kB
import { QueryParams } from '../../types/query-params'; import { GsbSaveRequest, GsbSaveMultiRequest, GsbSaveMappedRequest, GsbGetCodeRequest, GetTokenRequest, GsbUploadFileRequest } from '../../types/requests'; import { GsbQueryResponse, GsbSaveResponse, GsbQueryOpResponse, GsbSaveMultiResponse, GsbDefinitionResponse, GsbGetCodeResponse, GsbAuthResponse, GsbBulkResponse, GsbUploadFileResponse } from '../../types/responses'; import { GsbBulkRequest } from '../../types/requests'; export declare class GsbEntityService { private apiService; private useCache; constructor(useCache?: boolean); static getInstance(useCache?: boolean): GsbEntityService; reduceEntityDef(request: any, checkEntityDef?: boolean): void; getToken(request: GetTokenRequest): Promise<GsbAuthResponse>; refreshToken(request: any, token?: string, tenantCode?: string): Promise<GsbAuthResponse>; getById<T extends object>(definitionType: (new () => T) | string, id: string, token?: string, tenantCode?: string): Promise<T | null>; getCopy<T extends object>(req: QueryParams<any>, token?: string, tenantCode?: string): Promise<GsbQueryResponse | null>; get(req: QueryParams<any>, token?: string, tenantCode?: string): Promise<GsbQueryResponse>; query(req: QueryParams<any>, token?: string, tenantCode?: string): Promise<GsbQueryResponse>; queryMapped(req: QueryParams<any>, token?: string, tenantCode?: string): Promise<GsbQueryResponse>; /** * Save an entity * @param entity The entity to save, should have _entDefName property * @param token Optional auth token * @param tenantCode Optional tenant code * @returns Promise with save response */ saveEnt(entity: any, token?: string, tenantCode?: string): Promise<GsbSaveResponse>; save(req: GsbSaveRequest, token?: string, tenantCode?: string): Promise<GsbSaveResponse>; updateQuery(req: QueryParams<any>, token?: string, tenantCode?: string): Promise<GsbQueryOpResponse>; saveMulti(req: GsbSaveMultiRequest, token?: string, tenantCode?: string): Promise<GsbSaveMultiResponse>; /** * Execute multiple operations in a single bulk request * @param bulkRequest The bulk request containing multiple operations * @param token Optional auth token * @param tenantCode Optional tenant code * @returns Promise with bulk operation results */ executeBulk(bulkRequest: GsbBulkRequest, token?: string, tenantCode?: string): Promise<GsbBulkResponse>; getCode(req: GsbGetCodeRequest, token?: string, tenantCode?: string): Promise<GsbGetCodeResponse>; saveMappedItems(req: GsbSaveMappedRequest, token?: string, tenantCode?: string): Promise<GsbSaveResponse>; removeMappedItems(req: GsbSaveMappedRequest, token?: string, tenantCode?: string): Promise<GsbQueryOpResponse>; getDefinition(req: { entityDef: { id?: string; name?: string; }; }, token?: string, tenantCode?: string): Promise<GsbDefinitionResponse>; delete(req: GsbSaveRequest, token?: string, tenantCode?: string): Promise<GsbQueryOpResponse>; deleteById(entDefName: string, id: string, token?: string, tenantCode?: string): Promise<GsbQueryOpResponse>; deleteEnt(entity: any, token?: string, tenantCode?: string): Promise<GsbQueryOpResponse>; deleteQuery(req: QueryParams<any>, token?: string, tenantCode?: string): Promise<GsbQueryOpResponse>; runWorkflow(req: any, token?: string, tenantCode?: string): Promise<any>; startWorkflow(req: any, token?: string, tenantCode?: string): Promise<any>; runWfFunction(req: any, token?: string, tenantCode?: string): Promise<any>; testWfFunction(req: any, token?: string, tenantCode?: string): Promise<any>; iterateTask(req: any, token?: string, tenantCode?: string): Promise<any>; changePassword(req: any, token?: string, tenantCode?: string): Promise<any>; uploadFile(req: GsbUploadFileRequest, token?: string, tenantCode?: string): Promise<GsbUploadFileResponse>; }