1 | import { DMMF } from './dmmf-types';
|
2 | export interface ArgError {
|
3 | path: string[];
|
4 | error: InvalidArgError;
|
5 | }
|
6 | export interface FieldError {
|
7 | path: string[];
|
8 | error: InvalidFieldError;
|
9 | }
|
10 | export declare type InvalidFieldError = InvalidFieldNameError | InvalidFieldTypeError | EmptySelectError | NoTrueSelectError | IncludeAndSelectError | EmptyIncludeError;
|
11 | export interface InvalidFieldTypeError {
|
12 | type: 'invalidFieldType';
|
13 | modelName: string;
|
14 | fieldName: string;
|
15 | providedValue: any;
|
16 | }
|
17 | export interface InvalidFieldNameError {
|
18 | type: 'invalidFieldName';
|
19 | modelName: string;
|
20 | didYouMean?: string | null;
|
21 | providedName: string;
|
22 | isInclude?: boolean;
|
23 | isIncludeScalar?: boolean;
|
24 | outputType: DMMF.OutputType;
|
25 | }
|
26 | export interface EmptySelectError {
|
27 | type: 'emptySelect';
|
28 | field: DMMF.SchemaField;
|
29 | }
|
30 | export interface EmptyIncludeError {
|
31 | type: 'emptyInclude';
|
32 | field: DMMF.SchemaField;
|
33 | }
|
34 | export interface NoTrueSelectError {
|
35 | type: 'noTrueSelect';
|
36 | field: DMMF.SchemaField;
|
37 | }
|
38 | export interface IncludeAndSelectError {
|
39 | type: 'includeAndSelect';
|
40 | field: DMMF.SchemaField;
|
41 | }
|
42 | export declare type JavaScriptPrimitiveType = 'number' | 'string' | 'boolean';
|
43 | export declare type InvalidArgError = InvalidArgNameError | MissingArgError | InvalidArgTypeError | AtLeastOneError | AtMostOneError | InvalidNullArgError;
|
44 |
|
45 |
|
46 |
|
47 | export interface InvalidArgNameError {
|
48 | type: 'invalidName';
|
49 | providedName: string;
|
50 | providedValue: any;
|
51 | didYouMeanArg?: string;
|
52 | didYouMeanField?: string;
|
53 | originalType: DMMF.ArgType;
|
54 | possibilities?: DMMF.SchemaArgInputType[];
|
55 | outputType?: DMMF.OutputType;
|
56 | }
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | export interface MissingArgError {
|
62 | type: 'missingArg';
|
63 | missingName: string;
|
64 | missingType: DMMF.SchemaArgInputType[];
|
65 | atLeastOne: boolean;
|
66 | atMostOne: boolean;
|
67 | }
|
68 |
|
69 |
|
70 |
|
71 | export interface InvalidNullArgError {
|
72 | type: 'invalidNullArg';
|
73 | name: string;
|
74 | invalidType: DMMF.SchemaArgInputType[];
|
75 | atLeastOne: boolean;
|
76 | atMostOne: boolean;
|
77 | }
|
78 | export interface AtMostOneError {
|
79 | type: 'atMostOne';
|
80 | key: string;
|
81 | inputType: DMMF.InputType;
|
82 | providedKeys: string[];
|
83 | }
|
84 | export interface AtLeastOneError {
|
85 | type: 'atLeastOne';
|
86 | key: string;
|
87 | inputType: DMMF.InputType;
|
88 | }
|
89 |
|
90 |
|
91 |
|
92 | export interface InvalidArgTypeError {
|
93 | type: 'invalidType';
|
94 | argName: string;
|
95 | requiredType: {
|
96 | bestFittingType: DMMF.SchemaArgInputType;
|
97 | inputType: DMMF.SchemaArgInputType[];
|
98 | };
|
99 | providedValue: any;
|
100 | }
|