import { GrpcRequest, isGrpcRequest, isGrpcRequestId } from '../grpc-request'; import * as models from '../index'; import { Request } from '../request'; export function getById(requestId: string): Promise { return isGrpcRequestId(requestId) ? models.grpcRequest.getById(requestId) : models.request.getById(requestId); } export function remove(request: Request | GrpcRequest) { return isGrpcRequest(request) ? models.grpcRequest.remove(request) : models.request.remove(request); } export function update(request: T, patch: Partial = {}): Promise { // @ts-expect-error -- TSCONVERSION return isGrpcRequest(request) ? models.grpcRequest.update(request, patch) // @ts-expect-error -- TSCONVERSION : models.request.update(request, patch); } export function duplicate(request: T, patch: Partial = {}): Promise { // @ts-expect-error -- TSCONVERSION return isGrpcRequest(request) ? models.grpcRequest.duplicate(request, patch) // @ts-expect-error -- TSCONVERSION : models.request.duplicate(request, patch); }