import type { StrictOmit, Type, TypeThunkAsync } from 'ts-gems'; import { OpraFilter } from '../../filter/index.js'; import { OpraSchema } from '../../schema/index.js'; import { HttpOperation } from '../http/http-operation.js'; import type { HttpParameter } from '../http/http-parameter.js'; import { HttpRequestBody } from '../http/http-request-body.js'; import { type HttpOperationDecorator } from './http-operation.decorator.js'; declare module '../http/http-operation.js' { /** * HttpOperationStatic */ interface HttpOperationStatic { Entity: HttpOperationEntity; } interface HttpOperationEntity { Create(type: Type | string, options?: StrictOmit): HttpOperation.Entity.CreateDecorator; Create(args: HttpOperation.Entity.CreateArgs): HttpOperation.Entity.CreateDecorator; Delete(type: Type | string, options?: StrictOmit): HttpOperation.Entity.DeleteDecorator; Delete(args: HttpOperation.Entity.DeleteArgs): HttpOperation.Entity.DeleteDecorator; DeleteMany(type: Type | string, options?: StrictOmit): HttpOperation.Entity.DeleteManyDecorator; DeleteMany(args: HttpOperation.Entity.DeleteManyArgs): HttpOperation.Entity.DeleteManyDecorator; FindMany(type: Type | string, options?: StrictOmit): HttpOperation.Entity.FindManyDecorator; FindMany(args: HttpOperation.Entity.FindManyArgs): HttpOperation.Entity.FindManyDecorator; Get(type: Type | string, options?: StrictOmit): HttpOperation.Entity.GetDecorator; Get(args: HttpOperation.Entity.GetArgs): HttpOperation.Entity.GetDecorator; Replace(type: Type | string, options?: StrictOmit): HttpOperation.Entity.ReplaceDecorator; Replace(args: HttpOperation.Entity.ReplaceArgs): HttpOperation.Entity.ReplaceDecorator; Update(type: Type | string, options?: StrictOmit): HttpOperation.Entity.UpdateDecorator; Update(args: HttpOperation.Entity.UpdateArgs): HttpOperation.Entity.UpdateDecorator; UpdateMany(type: Type | string, options?: StrictOmit): HttpOperation.Entity.UpdateManyDecorator; UpdateMany(args: HttpOperation.Entity.UpdateManyArgs): HttpOperation.Entity.UpdateManyDecorator; } namespace HttpOperation { namespace Entity { interface CreateDecorator extends HttpOperationDecorator { } interface CreateArgs extends StrictOmit { type: Type | string; requestBody?: Pick & { type?: Type | string; immediateFetch?: boolean; }; } interface DeleteDecorator extends HttpOperationDecorator { KeyParam(name: string, optionsOrType?: StrictOmit | string | TypeThunkAsync): this; } interface DeleteArgs extends StrictOmit { type: Type | string; } interface FilterOptions { mappedField?: string; operators?: OpraFilter.ComparisonOperator[]; notes?: string; prepare?: (args: OpraFilter.ComparisonExpression.PrepareArgs) => any; } interface DeleteManyDecorator extends HttpOperationDecorator { Filter(field: string, operators?: OpraFilter.ComparisonOperator[] | string): this; Filter(field: string, options?: FilterOptions): this; } interface DeleteManyArgs extends StrictOmit { type: Type | string; } interface FindManyDecorator extends HttpOperationDecorator { SortFields(...fields: OpraSchema.Field.QualifiedName[]): FindManyDecorator; SortFields(fieldsMap: Record): FindManyDecorator; DefaultSort(...fields: OpraSchema.Field.QualifiedName[]): FindManyDecorator; Filter(field: OpraSchema.Field.QualifiedName, operators?: OpraFilter.ComparisonOperator[] | string): this; Filter(field: string, options?: FilterOptions): this; } interface FindManyArgs extends StrictOmit { type: Type | string; defaultLimit?: number; defaultProjection?: string[]; maxLimit?: number; } interface GetDecorator extends HttpOperationDecorator { KeyParam(name: string, optionsOrType?: StrictOmit | string | TypeThunkAsync): this; } interface GetArgs extends StrictOmit { type: Type | string; } interface ReplaceDecorator extends HttpOperationDecorator { KeyParam(name: string, optionsOrType?: StrictOmit | string | TypeThunkAsync): this; } interface ReplaceArgs extends StrictOmit { type: Type | string; } interface UpdateDecorator extends HttpOperationDecorator { KeyParam(name: string, optionsOrType?: StrictOmit | string | TypeThunkAsync): this; Filter(field: OpraSchema.Field.QualifiedName, operators?: OpraFilter.ComparisonOperator[] | string): this; Filter(field: string, options?: FilterOptions): this; } interface UpdateArgs extends StrictOmit { type: Type | string; requestBody?: Pick & { type?: Type | string; immediateFetch?: boolean; allowPatchOperators?: boolean; allowNullOptionals?: boolean; }; } interface UpdateManyDecorator extends HttpOperationDecorator { Filter(field: OpraSchema.Field.QualifiedName, operators?: OpraFilter.ComparisonOperator[] | string): this; Filter(field: string, options?: FilterOptions): this; } interface UpdateManyArgs extends StrictOmit { type: Type | string; requestBody?: Pick & { type?: Type | string; immediateFetch?: boolean; allowPatchOperators?: boolean; allowNullOptionals?: boolean; }; } } } } /** * * @param typ */ export declare function getDataTypeName(typ: Type | string): string; /** * */ export declare function createKeyParamDecorator(decorator: T, decoratorChain: Function[]): (name: string, prmOptions?: StrictOmit | string | Type) => T; /** * */ export declare function createSortFieldsDecorator(decorator: T, decoratorChain: Function[]): (...varargs: any[]) => T; /** * */ export declare function createFilterDecorator(decorator: T, decoratorChain: Function[], dataType: string | Type): (field: string, arg0?: OpraFilter.ComparisonOperator[] | string | HttpOperation.Entity.FilterOptions) => T;