forked from ps73/feathers-prisma
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
57 lines (47 loc) · 1.41 KB
/
types.ts
File metadata and controls
57 lines (47 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { Prisma } from '@prisma/client';
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface Models {
}
export type IdField = string | number | { [key: string]: any };
export type Paginate = {
default?: number;
max?: number;
}
export interface PrismaServiceOptions {
model: Uncapitalize<Prisma.ModelName>;
events?: string[];
multi?: boolean | string[];
id?: string;
paginate?: Paginate;
whitelist?: string[];
filters?: string[];
}
export type EagerQuery = (string | string[] | string[][])[] | Record<string, boolean | string[]>;
export interface QueryParamRecordFilters {
$in?: (string | boolean | number)[];
$nin?: (string | boolean | number)[];
$lt?: string | number;
$lte?: string | number;
$gt?: string | number;
$gte?: string | number;
$ne?: string | boolean | number;
$eager?: EagerQuery;
$rawWhere?: Record<string, any>;
// prisma specific
$contains?: string;
$search?: string;
$startsWith?: string;
$endsWith?: string;
$mode?: string;
}
export type QueryParamRecord = string | boolean | number;
export type QueryParamRecordsOr = Record<string, QueryParamRecord | QueryParamRecordFilters>[];
export type QueryParam = {
[key: string]: string | boolean | number | QueryParamRecordFilters | QueryParamRecordsOr;
}
export interface FeathersQueryData {
id?: IdField,
query: Record<string, any>,
filters: Record<string, any>,
whitelist: string[],
}