@zenstackhq/orm 3.9.7 → 3.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants-BQEq4CBi.mjs +161 -0
- package/dist/constants-BQEq4CBi.mjs.map +1 -0
- package/dist/constants-CcJSpq4B.cjs +244 -0
- package/dist/constants-CcJSpq4B.cjs.map +1 -0
- package/dist/constants-RUWhnVl4.d.mts +129 -0
- package/dist/constants-lRwcp6Hv.d.cts +129 -0
- package/dist/constants.cjs +11 -0
- package/dist/constants.d.cts +2 -0
- package/dist/constants.d.mts +2 -0
- package/dist/constants.mjs +2 -0
- package/dist/index.cjs +436 -320
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +81 -142
- package/dist/index.d.mts +83 -144
- package/dist/index.mjs +552 -436
- package/dist/index.mjs.map +1 -1
- package/package.json +20 -10
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
//#region src/client/constants.ts
|
|
2
|
+
/**
|
|
3
|
+
* The types of fields that are numeric.
|
|
4
|
+
*/
|
|
5
|
+
const NUMERIC_FIELD_TYPES = [
|
|
6
|
+
"Int",
|
|
7
|
+
"Float",
|
|
8
|
+
"BigInt",
|
|
9
|
+
"Decimal"
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* Prefix for JSON field used to store joined delegate rows.
|
|
13
|
+
*/
|
|
14
|
+
const DELEGATE_JOINED_FIELD_PREFIX = "$delegate$";
|
|
15
|
+
/**
|
|
16
|
+
* Logical combinators used in filters.
|
|
17
|
+
*/
|
|
18
|
+
const LOGICAL_COMBINATORS = [
|
|
19
|
+
"AND",
|
|
20
|
+
"OR",
|
|
21
|
+
"NOT"
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Aggregation operators.
|
|
25
|
+
*/
|
|
26
|
+
const AggregateOperators = [
|
|
27
|
+
"_count",
|
|
28
|
+
"_sum",
|
|
29
|
+
"_avg",
|
|
30
|
+
"_min",
|
|
31
|
+
"_max"
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Mapping of filter operators to their corresponding filter kind categories.
|
|
35
|
+
*/
|
|
36
|
+
const FILTER_PROPERTY_TO_KIND = {
|
|
37
|
+
equals: "Equality",
|
|
38
|
+
not: "Equality",
|
|
39
|
+
in: "Equality",
|
|
40
|
+
notIn: "Equality",
|
|
41
|
+
lt: "Range",
|
|
42
|
+
lte: "Range",
|
|
43
|
+
gt: "Range",
|
|
44
|
+
gte: "Range",
|
|
45
|
+
between: "Range",
|
|
46
|
+
contains: "Like",
|
|
47
|
+
startsWith: "Like",
|
|
48
|
+
endsWith: "Like",
|
|
49
|
+
mode: "Like",
|
|
50
|
+
is: "Relation",
|
|
51
|
+
isNot: "Relation",
|
|
52
|
+
some: "Relation",
|
|
53
|
+
every: "Relation",
|
|
54
|
+
none: "Relation",
|
|
55
|
+
path: "Json",
|
|
56
|
+
string_contains: "Json",
|
|
57
|
+
string_starts_with: "Json",
|
|
58
|
+
string_ends_with: "Json",
|
|
59
|
+
array_contains: "Json",
|
|
60
|
+
array_starts_with: "Json",
|
|
61
|
+
array_ends_with: "Json",
|
|
62
|
+
fuzzy: "Fuzzy",
|
|
63
|
+
fts: "FullText",
|
|
64
|
+
has: "List",
|
|
65
|
+
hasEvery: "List",
|
|
66
|
+
hasSome: "List",
|
|
67
|
+
isEmpty: "List"
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* List of core CRUD operations. It excludes the 'orThrow' variants.
|
|
71
|
+
*/
|
|
72
|
+
const CoreCrudOperations = [
|
|
73
|
+
"findMany",
|
|
74
|
+
"findUnique",
|
|
75
|
+
"findFirst",
|
|
76
|
+
"create",
|
|
77
|
+
"createMany",
|
|
78
|
+
"createManyAndReturn",
|
|
79
|
+
"update",
|
|
80
|
+
"updateMany",
|
|
81
|
+
"updateManyAndReturn",
|
|
82
|
+
"upsert",
|
|
83
|
+
"delete",
|
|
84
|
+
"deleteMany",
|
|
85
|
+
"count",
|
|
86
|
+
"aggregate",
|
|
87
|
+
"groupBy",
|
|
88
|
+
"exists"
|
|
89
|
+
];
|
|
90
|
+
/**
|
|
91
|
+
* List of core read operations. It excludes the 'orThrow' variants.
|
|
92
|
+
*/
|
|
93
|
+
const CoreReadOperations = [
|
|
94
|
+
"findMany",
|
|
95
|
+
"findUnique",
|
|
96
|
+
"findFirst",
|
|
97
|
+
"count",
|
|
98
|
+
"aggregate",
|
|
99
|
+
"groupBy",
|
|
100
|
+
"exists"
|
|
101
|
+
];
|
|
102
|
+
/**
|
|
103
|
+
* List of core write operations.
|
|
104
|
+
*/
|
|
105
|
+
const CoreWriteOperations = [
|
|
106
|
+
"create",
|
|
107
|
+
"createMany",
|
|
108
|
+
"createManyAndReturn",
|
|
109
|
+
"update",
|
|
110
|
+
"updateMany",
|
|
111
|
+
"updateManyAndReturn",
|
|
112
|
+
"upsert",
|
|
113
|
+
"delete",
|
|
114
|
+
"deleteMany"
|
|
115
|
+
];
|
|
116
|
+
/**
|
|
117
|
+
* List of core create operations.
|
|
118
|
+
*/
|
|
119
|
+
const CoreCreateOperations = [
|
|
120
|
+
"create",
|
|
121
|
+
"createMany",
|
|
122
|
+
"createManyAndReturn",
|
|
123
|
+
"upsert"
|
|
124
|
+
];
|
|
125
|
+
/**
|
|
126
|
+
* List of core update operations.
|
|
127
|
+
*/
|
|
128
|
+
const CoreUpdateOperations = [
|
|
129
|
+
"update",
|
|
130
|
+
"updateMany",
|
|
131
|
+
"updateManyAndReturn",
|
|
132
|
+
"upsert"
|
|
133
|
+
];
|
|
134
|
+
/**
|
|
135
|
+
* List of core delete operations.
|
|
136
|
+
*/
|
|
137
|
+
const CoreDeleteOperations = ["delete", "deleteMany"];
|
|
138
|
+
/**
|
|
139
|
+
* List of all CRUD operations, including 'orThrow' variants.
|
|
140
|
+
*/
|
|
141
|
+
const AllCrudOperations = [
|
|
142
|
+
...CoreCrudOperations,
|
|
143
|
+
"findUniqueOrThrow",
|
|
144
|
+
"findFirstOrThrow"
|
|
145
|
+
];
|
|
146
|
+
/**
|
|
147
|
+
* List of all read operations, including 'orThrow' variants.
|
|
148
|
+
*/
|
|
149
|
+
const AllReadOperations = [
|
|
150
|
+
...CoreReadOperations,
|
|
151
|
+
"findUniqueOrThrow",
|
|
152
|
+
"findFirstOrThrow"
|
|
153
|
+
];
|
|
154
|
+
/**
|
|
155
|
+
* List of all write operations - simply an alias of CoreWriteOperations.
|
|
156
|
+
*/
|
|
157
|
+
const AllWriteOperations = CoreWriteOperations;
|
|
158
|
+
//#endregion
|
|
159
|
+
export { CoreCreateOperations as a, CoreReadOperations as c, DELEGATE_JOINED_FIELD_PREFIX as d, FILTER_PROPERTY_TO_KIND as f, AllWriteOperations as i, CoreUpdateOperations as l, NUMERIC_FIELD_TYPES as m, AllCrudOperations as n, CoreCrudOperations as o, LOGICAL_COMBINATORS as p, AllReadOperations as r, CoreDeleteOperations as s, AggregateOperators as t, CoreWriteOperations as u };
|
|
160
|
+
|
|
161
|
+
//# sourceMappingURL=constants-BQEq4CBi.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-BQEq4CBi.mjs","names":[],"sources":["../src/client/constants.ts"],"sourcesContent":["// /**\n// * The comment prefix for annotation generated Kysely queries with context information.\n// */\n// export const CONTEXT_COMMENT_PREFIX = '-- $$context:';\n\n/**\n * The types of fields that are numeric.\n */\nexport const NUMERIC_FIELD_TYPES = ['Int', 'Float', 'BigInt', 'Decimal'];\n\n/**\n * Client API methods that are not supported in transactions.\n */\nexport const TRANSACTION_UNSUPPORTED_METHODS = ['$transaction', '$connect', '$disconnect', '$use'] as const;\n\n/**\n * Prefix for JSON field used to store joined delegate rows.\n */\nexport const DELEGATE_JOINED_FIELD_PREFIX = '$delegate$';\n\n/**\n * Logical combinators used in filters.\n */\nexport const LOGICAL_COMBINATORS = ['AND', 'OR', 'NOT'] as const;\n\n/**\n * Aggregation operators.\n */\nexport const AggregateOperators = ['_count', '_sum', '_avg', '_min', '_max'] as const;\nexport type AggregateOperators = (typeof AggregateOperators)[number];\n\n/**\n * Mapping of filter operators to their corresponding filter kind categories.\n */\nexport const FILTER_PROPERTY_TO_KIND = {\n // Equality operators\n equals: 'Equality',\n not: 'Equality',\n in: 'Equality',\n notIn: 'Equality',\n\n // Range operators\n lt: 'Range',\n lte: 'Range',\n gt: 'Range',\n gte: 'Range',\n between: 'Range',\n\n // Like operators\n contains: 'Like',\n startsWith: 'Like',\n endsWith: 'Like',\n mode: 'Like',\n\n // Relation operators\n is: 'Relation',\n isNot: 'Relation',\n some: 'Relation',\n every: 'Relation',\n none: 'Relation',\n\n // Json operators\n path: 'Json',\n string_contains: 'Json',\n string_starts_with: 'Json',\n string_ends_with: 'Json',\n array_contains: 'Json',\n array_starts_with: 'Json',\n array_ends_with: 'Json',\n\n // Fuzzy search operators\n fuzzy: 'Fuzzy',\n\n // Full-text search operators\n fts: 'FullText',\n\n // List operators\n has: 'List',\n hasEvery: 'List',\n hasSome: 'List',\n isEmpty: 'List',\n} as const;\n\n/**\n * Mapping of filter operators to their corresponding filter kind categories.\n */\nexport type FilterPropertyToKind = typeof FILTER_PROPERTY_TO_KIND;\n\n/**\n * List of core CRUD operations. It excludes the 'orThrow' variants.\n */\nexport const CoreCrudOperations = [\n 'findMany',\n 'findUnique',\n 'findFirst',\n 'create',\n 'createMany',\n 'createManyAndReturn',\n 'update',\n 'updateMany',\n 'updateManyAndReturn',\n 'upsert',\n 'delete',\n 'deleteMany',\n 'count',\n 'aggregate',\n 'groupBy',\n 'exists',\n] as const;\n\n/**\n * List of core CRUD operations. It excludes the 'orThrow' variants.\n */\nexport type CoreCrudOperations = (typeof CoreCrudOperations)[number];\n\n/**\n * List of core read operations. It excludes the 'orThrow' variants.\n */\nexport const CoreReadOperations = [\n 'findMany',\n 'findUnique',\n 'findFirst',\n 'count',\n 'aggregate',\n 'groupBy',\n 'exists',\n] as const;\n\n/**\n * List of core read operations. It excludes the 'orThrow' variants.\n */\nexport type CoreReadOperations = (typeof CoreReadOperations)[number];\n\n/**\n * List of core write operations.\n */\nexport const CoreWriteOperations = [\n 'create',\n 'createMany',\n 'createManyAndReturn',\n 'update',\n 'updateMany',\n 'updateManyAndReturn',\n 'upsert',\n 'delete',\n 'deleteMany',\n] as const;\n\n/**\n * List of core write operations.\n */\nexport type CoreWriteOperations = (typeof CoreWriteOperations)[number];\n\n/**\n * List of core create operations.\n */\nexport const CoreCreateOperations = ['create', 'createMany', 'createManyAndReturn', 'upsert'] as const;\n\n/**\n * List of core create operations.\n */\nexport type CoreCreateOperations = (typeof CoreCreateOperations)[number];\n\n/**\n * List of core update operations.\n */\nexport const CoreUpdateOperations = ['update', 'updateMany', 'updateManyAndReturn', 'upsert'] as const;\n\n/**\n * List of core update operations.\n */\nexport type CoreUpdateOperations = (typeof CoreUpdateOperations)[number];\n\n/**\n * List of core delete operations.\n */\nexport const CoreDeleteOperations = ['delete', 'deleteMany'] as const;\n\n/**\n * List of core delete operations.\n */\nexport type CoreDeleteOperations = (typeof CoreDeleteOperations)[number];\n\n/**\n * List of all CRUD operations, including 'orThrow' variants.\n */\nexport const AllCrudOperations = [...CoreCrudOperations, 'findUniqueOrThrow', 'findFirstOrThrow'] as const;\n\n/**\n * List of all CRUD operations, including 'orThrow' variants.\n */\nexport type AllCrudOperations = (typeof AllCrudOperations)[number];\n\n/**\n * List of all read operations, including 'orThrow' variants.\n */\nexport const AllReadOperations = [...CoreReadOperations, 'findUniqueOrThrow', 'findFirstOrThrow'] as const;\n\n/**\n * List of all read operations, including 'orThrow' variants.\n */\nexport type AllReadOperations = (typeof AllReadOperations)[number];\n\n/**\n * List of all write operations - simply an alias of CoreWriteOperations.\n */\nexport const AllWriteOperations = CoreWriteOperations;\n\n/**\n * List of all write operations - simply an alias of CoreWriteOperations.\n */\nexport type AllWriteOperations = CoreWriteOperations;\n"],"mappings":";;;;AAQA,MAAa,sBAAsB;CAAC;CAAO;CAAS;CAAU;CAAU;;;;AAUxE,MAAa,+BAA+B;;;;AAK5C,MAAa,sBAAsB;CAAC;CAAO;CAAM;CAAM;;;;AAKvD,MAAa,qBAAqB;CAAC;CAAU;CAAQ;CAAQ;CAAQ;CAAO;;;;AAM5E,MAAa,0BAA0B;CAEnC,QAAQ;CACR,KAAK;CACL,IAAI;CACJ,OAAO;CAGP,IAAI;CACJ,KAAK;CACL,IAAI;CACJ,KAAK;CACL,SAAS;CAGT,UAAU;CACV,YAAY;CACZ,UAAU;CACV,MAAM;CAGN,IAAI;CACJ,OAAO;CACP,MAAM;CACN,OAAO;CACP,MAAM;CAGN,MAAM;CACN,iBAAiB;CACjB,oBAAoB;CACpB,kBAAkB;CAClB,gBAAgB;CAChB,mBAAmB;CACnB,iBAAiB;CAGjB,OAAO;CAGP,KAAK;CAGL,KAAK;CACL,UAAU;CACV,SAAS;CACT,SAAS;CACZ;;;;AAUD,MAAa,qBAAqB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACH;;;;AAUD,MAAa,qBAAqB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACH;;;;AAUD,MAAa,sBAAsB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACH;;;;AAUD,MAAa,uBAAuB;CAAC;CAAU;CAAc;CAAuB;CAAS;;;;AAU7F,MAAa,uBAAuB;CAAC;CAAU;CAAc;CAAuB;CAAS;;;;AAU7F,MAAa,uBAAuB,CAAC,UAAU,aAAa;;;;AAU5D,MAAa,oBAAoB;CAAC,GAAG;CAAoB;CAAqB;CAAmB;;;;AAUjG,MAAa,oBAAoB;CAAC,GAAG;CAAoB;CAAqB;CAAmB;;;;AAUjG,MAAa,qBAAqB"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
//#region src/client/constants.ts
|
|
2
|
+
/**
|
|
3
|
+
* The types of fields that are numeric.
|
|
4
|
+
*/
|
|
5
|
+
const NUMERIC_FIELD_TYPES = [
|
|
6
|
+
"Int",
|
|
7
|
+
"Float",
|
|
8
|
+
"BigInt",
|
|
9
|
+
"Decimal"
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* Prefix for JSON field used to store joined delegate rows.
|
|
13
|
+
*/
|
|
14
|
+
const DELEGATE_JOINED_FIELD_PREFIX = "$delegate$";
|
|
15
|
+
/**
|
|
16
|
+
* Logical combinators used in filters.
|
|
17
|
+
*/
|
|
18
|
+
const LOGICAL_COMBINATORS = [
|
|
19
|
+
"AND",
|
|
20
|
+
"OR",
|
|
21
|
+
"NOT"
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Aggregation operators.
|
|
25
|
+
*/
|
|
26
|
+
const AggregateOperators = [
|
|
27
|
+
"_count",
|
|
28
|
+
"_sum",
|
|
29
|
+
"_avg",
|
|
30
|
+
"_min",
|
|
31
|
+
"_max"
|
|
32
|
+
];
|
|
33
|
+
/**
|
|
34
|
+
* Mapping of filter operators to their corresponding filter kind categories.
|
|
35
|
+
*/
|
|
36
|
+
const FILTER_PROPERTY_TO_KIND = {
|
|
37
|
+
equals: "Equality",
|
|
38
|
+
not: "Equality",
|
|
39
|
+
in: "Equality",
|
|
40
|
+
notIn: "Equality",
|
|
41
|
+
lt: "Range",
|
|
42
|
+
lte: "Range",
|
|
43
|
+
gt: "Range",
|
|
44
|
+
gte: "Range",
|
|
45
|
+
between: "Range",
|
|
46
|
+
contains: "Like",
|
|
47
|
+
startsWith: "Like",
|
|
48
|
+
endsWith: "Like",
|
|
49
|
+
mode: "Like",
|
|
50
|
+
is: "Relation",
|
|
51
|
+
isNot: "Relation",
|
|
52
|
+
some: "Relation",
|
|
53
|
+
every: "Relation",
|
|
54
|
+
none: "Relation",
|
|
55
|
+
path: "Json",
|
|
56
|
+
string_contains: "Json",
|
|
57
|
+
string_starts_with: "Json",
|
|
58
|
+
string_ends_with: "Json",
|
|
59
|
+
array_contains: "Json",
|
|
60
|
+
array_starts_with: "Json",
|
|
61
|
+
array_ends_with: "Json",
|
|
62
|
+
fuzzy: "Fuzzy",
|
|
63
|
+
fts: "FullText",
|
|
64
|
+
has: "List",
|
|
65
|
+
hasEvery: "List",
|
|
66
|
+
hasSome: "List",
|
|
67
|
+
isEmpty: "List"
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* List of core CRUD operations. It excludes the 'orThrow' variants.
|
|
71
|
+
*/
|
|
72
|
+
const CoreCrudOperations = [
|
|
73
|
+
"findMany",
|
|
74
|
+
"findUnique",
|
|
75
|
+
"findFirst",
|
|
76
|
+
"create",
|
|
77
|
+
"createMany",
|
|
78
|
+
"createManyAndReturn",
|
|
79
|
+
"update",
|
|
80
|
+
"updateMany",
|
|
81
|
+
"updateManyAndReturn",
|
|
82
|
+
"upsert",
|
|
83
|
+
"delete",
|
|
84
|
+
"deleteMany",
|
|
85
|
+
"count",
|
|
86
|
+
"aggregate",
|
|
87
|
+
"groupBy",
|
|
88
|
+
"exists"
|
|
89
|
+
];
|
|
90
|
+
/**
|
|
91
|
+
* List of core read operations. It excludes the 'orThrow' variants.
|
|
92
|
+
*/
|
|
93
|
+
const CoreReadOperations = [
|
|
94
|
+
"findMany",
|
|
95
|
+
"findUnique",
|
|
96
|
+
"findFirst",
|
|
97
|
+
"count",
|
|
98
|
+
"aggregate",
|
|
99
|
+
"groupBy",
|
|
100
|
+
"exists"
|
|
101
|
+
];
|
|
102
|
+
/**
|
|
103
|
+
* List of core write operations.
|
|
104
|
+
*/
|
|
105
|
+
const CoreWriteOperations = [
|
|
106
|
+
"create",
|
|
107
|
+
"createMany",
|
|
108
|
+
"createManyAndReturn",
|
|
109
|
+
"update",
|
|
110
|
+
"updateMany",
|
|
111
|
+
"updateManyAndReturn",
|
|
112
|
+
"upsert",
|
|
113
|
+
"delete",
|
|
114
|
+
"deleteMany"
|
|
115
|
+
];
|
|
116
|
+
/**
|
|
117
|
+
* List of core create operations.
|
|
118
|
+
*/
|
|
119
|
+
const CoreCreateOperations = [
|
|
120
|
+
"create",
|
|
121
|
+
"createMany",
|
|
122
|
+
"createManyAndReturn",
|
|
123
|
+
"upsert"
|
|
124
|
+
];
|
|
125
|
+
/**
|
|
126
|
+
* List of core update operations.
|
|
127
|
+
*/
|
|
128
|
+
const CoreUpdateOperations = [
|
|
129
|
+
"update",
|
|
130
|
+
"updateMany",
|
|
131
|
+
"updateManyAndReturn",
|
|
132
|
+
"upsert"
|
|
133
|
+
];
|
|
134
|
+
/**
|
|
135
|
+
* List of core delete operations.
|
|
136
|
+
*/
|
|
137
|
+
const CoreDeleteOperations = ["delete", "deleteMany"];
|
|
138
|
+
/**
|
|
139
|
+
* List of all CRUD operations, including 'orThrow' variants.
|
|
140
|
+
*/
|
|
141
|
+
const AllCrudOperations = [
|
|
142
|
+
...CoreCrudOperations,
|
|
143
|
+
"findUniqueOrThrow",
|
|
144
|
+
"findFirstOrThrow"
|
|
145
|
+
];
|
|
146
|
+
/**
|
|
147
|
+
* List of all read operations, including 'orThrow' variants.
|
|
148
|
+
*/
|
|
149
|
+
const AllReadOperations = [
|
|
150
|
+
...CoreReadOperations,
|
|
151
|
+
"findUniqueOrThrow",
|
|
152
|
+
"findFirstOrThrow"
|
|
153
|
+
];
|
|
154
|
+
/**
|
|
155
|
+
* List of all write operations - simply an alias of CoreWriteOperations.
|
|
156
|
+
*/
|
|
157
|
+
const AllWriteOperations = CoreWriteOperations;
|
|
158
|
+
//#endregion
|
|
159
|
+
Object.defineProperty(exports, "AggregateOperators", {
|
|
160
|
+
enumerable: true,
|
|
161
|
+
get: function() {
|
|
162
|
+
return AggregateOperators;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
Object.defineProperty(exports, "AllCrudOperations", {
|
|
166
|
+
enumerable: true,
|
|
167
|
+
get: function() {
|
|
168
|
+
return AllCrudOperations;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
Object.defineProperty(exports, "AllReadOperations", {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: function() {
|
|
174
|
+
return AllReadOperations;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
Object.defineProperty(exports, "AllWriteOperations", {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
get: function() {
|
|
180
|
+
return AllWriteOperations;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
Object.defineProperty(exports, "CoreCreateOperations", {
|
|
184
|
+
enumerable: true,
|
|
185
|
+
get: function() {
|
|
186
|
+
return CoreCreateOperations;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(exports, "CoreCrudOperations", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: function() {
|
|
192
|
+
return CoreCrudOperations;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
Object.defineProperty(exports, "CoreDeleteOperations", {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
get: function() {
|
|
198
|
+
return CoreDeleteOperations;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
Object.defineProperty(exports, "CoreReadOperations", {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function() {
|
|
204
|
+
return CoreReadOperations;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
Object.defineProperty(exports, "CoreUpdateOperations", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function() {
|
|
210
|
+
return CoreUpdateOperations;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
Object.defineProperty(exports, "CoreWriteOperations", {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
get: function() {
|
|
216
|
+
return CoreWriteOperations;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
Object.defineProperty(exports, "DELEGATE_JOINED_FIELD_PREFIX", {
|
|
220
|
+
enumerable: true,
|
|
221
|
+
get: function() {
|
|
222
|
+
return DELEGATE_JOINED_FIELD_PREFIX;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
Object.defineProperty(exports, "FILTER_PROPERTY_TO_KIND", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: function() {
|
|
228
|
+
return FILTER_PROPERTY_TO_KIND;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
Object.defineProperty(exports, "LOGICAL_COMBINATORS", {
|
|
232
|
+
enumerable: true,
|
|
233
|
+
get: function() {
|
|
234
|
+
return LOGICAL_COMBINATORS;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
Object.defineProperty(exports, "NUMERIC_FIELD_TYPES", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function() {
|
|
240
|
+
return NUMERIC_FIELD_TYPES;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
//# sourceMappingURL=constants-CcJSpq4B.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants-CcJSpq4B.cjs","names":[],"sources":["../src/client/constants.ts"],"sourcesContent":["// /**\n// * The comment prefix for annotation generated Kysely queries with context information.\n// */\n// export const CONTEXT_COMMENT_PREFIX = '-- $$context:';\n\n/**\n * The types of fields that are numeric.\n */\nexport const NUMERIC_FIELD_TYPES = ['Int', 'Float', 'BigInt', 'Decimal'];\n\n/**\n * Client API methods that are not supported in transactions.\n */\nexport const TRANSACTION_UNSUPPORTED_METHODS = ['$transaction', '$connect', '$disconnect', '$use'] as const;\n\n/**\n * Prefix for JSON field used to store joined delegate rows.\n */\nexport const DELEGATE_JOINED_FIELD_PREFIX = '$delegate$';\n\n/**\n * Logical combinators used in filters.\n */\nexport const LOGICAL_COMBINATORS = ['AND', 'OR', 'NOT'] as const;\n\n/**\n * Aggregation operators.\n */\nexport const AggregateOperators = ['_count', '_sum', '_avg', '_min', '_max'] as const;\nexport type AggregateOperators = (typeof AggregateOperators)[number];\n\n/**\n * Mapping of filter operators to their corresponding filter kind categories.\n */\nexport const FILTER_PROPERTY_TO_KIND = {\n // Equality operators\n equals: 'Equality',\n not: 'Equality',\n in: 'Equality',\n notIn: 'Equality',\n\n // Range operators\n lt: 'Range',\n lte: 'Range',\n gt: 'Range',\n gte: 'Range',\n between: 'Range',\n\n // Like operators\n contains: 'Like',\n startsWith: 'Like',\n endsWith: 'Like',\n mode: 'Like',\n\n // Relation operators\n is: 'Relation',\n isNot: 'Relation',\n some: 'Relation',\n every: 'Relation',\n none: 'Relation',\n\n // Json operators\n path: 'Json',\n string_contains: 'Json',\n string_starts_with: 'Json',\n string_ends_with: 'Json',\n array_contains: 'Json',\n array_starts_with: 'Json',\n array_ends_with: 'Json',\n\n // Fuzzy search operators\n fuzzy: 'Fuzzy',\n\n // Full-text search operators\n fts: 'FullText',\n\n // List operators\n has: 'List',\n hasEvery: 'List',\n hasSome: 'List',\n isEmpty: 'List',\n} as const;\n\n/**\n * Mapping of filter operators to their corresponding filter kind categories.\n */\nexport type FilterPropertyToKind = typeof FILTER_PROPERTY_TO_KIND;\n\n/**\n * List of core CRUD operations. It excludes the 'orThrow' variants.\n */\nexport const CoreCrudOperations = [\n 'findMany',\n 'findUnique',\n 'findFirst',\n 'create',\n 'createMany',\n 'createManyAndReturn',\n 'update',\n 'updateMany',\n 'updateManyAndReturn',\n 'upsert',\n 'delete',\n 'deleteMany',\n 'count',\n 'aggregate',\n 'groupBy',\n 'exists',\n] as const;\n\n/**\n * List of core CRUD operations. It excludes the 'orThrow' variants.\n */\nexport type CoreCrudOperations = (typeof CoreCrudOperations)[number];\n\n/**\n * List of core read operations. It excludes the 'orThrow' variants.\n */\nexport const CoreReadOperations = [\n 'findMany',\n 'findUnique',\n 'findFirst',\n 'count',\n 'aggregate',\n 'groupBy',\n 'exists',\n] as const;\n\n/**\n * List of core read operations. It excludes the 'orThrow' variants.\n */\nexport type CoreReadOperations = (typeof CoreReadOperations)[number];\n\n/**\n * List of core write operations.\n */\nexport const CoreWriteOperations = [\n 'create',\n 'createMany',\n 'createManyAndReturn',\n 'update',\n 'updateMany',\n 'updateManyAndReturn',\n 'upsert',\n 'delete',\n 'deleteMany',\n] as const;\n\n/**\n * List of core write operations.\n */\nexport type CoreWriteOperations = (typeof CoreWriteOperations)[number];\n\n/**\n * List of core create operations.\n */\nexport const CoreCreateOperations = ['create', 'createMany', 'createManyAndReturn', 'upsert'] as const;\n\n/**\n * List of core create operations.\n */\nexport type CoreCreateOperations = (typeof CoreCreateOperations)[number];\n\n/**\n * List of core update operations.\n */\nexport const CoreUpdateOperations = ['update', 'updateMany', 'updateManyAndReturn', 'upsert'] as const;\n\n/**\n * List of core update operations.\n */\nexport type CoreUpdateOperations = (typeof CoreUpdateOperations)[number];\n\n/**\n * List of core delete operations.\n */\nexport const CoreDeleteOperations = ['delete', 'deleteMany'] as const;\n\n/**\n * List of core delete operations.\n */\nexport type CoreDeleteOperations = (typeof CoreDeleteOperations)[number];\n\n/**\n * List of all CRUD operations, including 'orThrow' variants.\n */\nexport const AllCrudOperations = [...CoreCrudOperations, 'findUniqueOrThrow', 'findFirstOrThrow'] as const;\n\n/**\n * List of all CRUD operations, including 'orThrow' variants.\n */\nexport type AllCrudOperations = (typeof AllCrudOperations)[number];\n\n/**\n * List of all read operations, including 'orThrow' variants.\n */\nexport const AllReadOperations = [...CoreReadOperations, 'findUniqueOrThrow', 'findFirstOrThrow'] as const;\n\n/**\n * List of all read operations, including 'orThrow' variants.\n */\nexport type AllReadOperations = (typeof AllReadOperations)[number];\n\n/**\n * List of all write operations - simply an alias of CoreWriteOperations.\n */\nexport const AllWriteOperations = CoreWriteOperations;\n\n/**\n * List of all write operations - simply an alias of CoreWriteOperations.\n */\nexport type AllWriteOperations = CoreWriteOperations;\n"],"mappings":";;;;AAQA,MAAa,sBAAsB;CAAC;CAAO;CAAS;CAAU;CAAU;;;;AAUxE,MAAa,+BAA+B;;;;AAK5C,MAAa,sBAAsB;CAAC;CAAO;CAAM;CAAM;;;;AAKvD,MAAa,qBAAqB;CAAC;CAAU;CAAQ;CAAQ;CAAQ;CAAO;;;;AAM5E,MAAa,0BAA0B;CAEnC,QAAQ;CACR,KAAK;CACL,IAAI;CACJ,OAAO;CAGP,IAAI;CACJ,KAAK;CACL,IAAI;CACJ,KAAK;CACL,SAAS;CAGT,UAAU;CACV,YAAY;CACZ,UAAU;CACV,MAAM;CAGN,IAAI;CACJ,OAAO;CACP,MAAM;CACN,OAAO;CACP,MAAM;CAGN,MAAM;CACN,iBAAiB;CACjB,oBAAoB;CACpB,kBAAkB;CAClB,gBAAgB;CAChB,mBAAmB;CACnB,iBAAiB;CAGjB,OAAO;CAGP,KAAK;CAGL,KAAK;CACL,UAAU;CACV,SAAS;CACT,SAAS;CACZ;;;;AAUD,MAAa,qBAAqB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACH;;;;AAUD,MAAa,qBAAqB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACH;;;;AAUD,MAAa,sBAAsB;CAC/B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACH;;;;AAUD,MAAa,uBAAuB;CAAC;CAAU;CAAc;CAAuB;CAAS;;;;AAU7F,MAAa,uBAAuB;CAAC;CAAU;CAAc;CAAuB;CAAS;;;;AAU7F,MAAa,uBAAuB,CAAC,UAAU,aAAa;;;;AAU5D,MAAa,oBAAoB;CAAC,GAAG;CAAoB;CAAqB;CAAmB;;;;AAUjG,MAAa,oBAAoB;CAAC,GAAG;CAAoB;CAAqB;CAAmB;;;;AAUjG,MAAa,qBAAqB"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
//#region src/client/constants.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Client API methods that are not supported in transactions.
|
|
4
|
+
*/
|
|
5
|
+
declare const TRANSACTION_UNSUPPORTED_METHODS: readonly ["$transaction", "$connect", "$disconnect", "$use"];
|
|
6
|
+
/**
|
|
7
|
+
* Logical combinators used in filters.
|
|
8
|
+
*/
|
|
9
|
+
declare const LOGICAL_COMBINATORS: readonly ["AND", "OR", "NOT"];
|
|
10
|
+
/**
|
|
11
|
+
* Aggregation operators.
|
|
12
|
+
*/
|
|
13
|
+
declare const AggregateOperators: readonly ["_count", "_sum", "_avg", "_min", "_max"];
|
|
14
|
+
type AggregateOperators = (typeof AggregateOperators)[number];
|
|
15
|
+
/**
|
|
16
|
+
* Mapping of filter operators to their corresponding filter kind categories.
|
|
17
|
+
*/
|
|
18
|
+
declare const FILTER_PROPERTY_TO_KIND: {
|
|
19
|
+
readonly equals: "Equality";
|
|
20
|
+
readonly not: "Equality";
|
|
21
|
+
readonly in: "Equality";
|
|
22
|
+
readonly notIn: "Equality";
|
|
23
|
+
readonly lt: "Range";
|
|
24
|
+
readonly lte: "Range";
|
|
25
|
+
readonly gt: "Range";
|
|
26
|
+
readonly gte: "Range";
|
|
27
|
+
readonly between: "Range";
|
|
28
|
+
readonly contains: "Like";
|
|
29
|
+
readonly startsWith: "Like";
|
|
30
|
+
readonly endsWith: "Like";
|
|
31
|
+
readonly mode: "Like";
|
|
32
|
+
readonly is: "Relation";
|
|
33
|
+
readonly isNot: "Relation";
|
|
34
|
+
readonly some: "Relation";
|
|
35
|
+
readonly every: "Relation";
|
|
36
|
+
readonly none: "Relation";
|
|
37
|
+
readonly path: "Json";
|
|
38
|
+
readonly string_contains: "Json";
|
|
39
|
+
readonly string_starts_with: "Json";
|
|
40
|
+
readonly string_ends_with: "Json";
|
|
41
|
+
readonly array_contains: "Json";
|
|
42
|
+
readonly array_starts_with: "Json";
|
|
43
|
+
readonly array_ends_with: "Json";
|
|
44
|
+
readonly fuzzy: "Fuzzy";
|
|
45
|
+
readonly fts: "FullText";
|
|
46
|
+
readonly has: "List";
|
|
47
|
+
readonly hasEvery: "List";
|
|
48
|
+
readonly hasSome: "List";
|
|
49
|
+
readonly isEmpty: "List";
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Mapping of filter operators to their corresponding filter kind categories.
|
|
53
|
+
*/
|
|
54
|
+
type FilterPropertyToKind = typeof FILTER_PROPERTY_TO_KIND;
|
|
55
|
+
/**
|
|
56
|
+
* List of core CRUD operations. It excludes the 'orThrow' variants.
|
|
57
|
+
*/
|
|
58
|
+
declare const CoreCrudOperations: readonly ["findMany", "findUnique", "findFirst", "create", "createMany", "createManyAndReturn", "update", "updateMany", "updateManyAndReturn", "upsert", "delete", "deleteMany", "count", "aggregate", "groupBy", "exists"];
|
|
59
|
+
/**
|
|
60
|
+
* List of core CRUD operations. It excludes the 'orThrow' variants.
|
|
61
|
+
*/
|
|
62
|
+
type CoreCrudOperations = (typeof CoreCrudOperations)[number];
|
|
63
|
+
/**
|
|
64
|
+
* List of core read operations. It excludes the 'orThrow' variants.
|
|
65
|
+
*/
|
|
66
|
+
declare const CoreReadOperations: readonly ["findMany", "findUnique", "findFirst", "count", "aggregate", "groupBy", "exists"];
|
|
67
|
+
/**
|
|
68
|
+
* List of core read operations. It excludes the 'orThrow' variants.
|
|
69
|
+
*/
|
|
70
|
+
type CoreReadOperations = (typeof CoreReadOperations)[number];
|
|
71
|
+
/**
|
|
72
|
+
* List of core write operations.
|
|
73
|
+
*/
|
|
74
|
+
declare const CoreWriteOperations: readonly ["create", "createMany", "createManyAndReturn", "update", "updateMany", "updateManyAndReturn", "upsert", "delete", "deleteMany"];
|
|
75
|
+
/**
|
|
76
|
+
* List of core write operations.
|
|
77
|
+
*/
|
|
78
|
+
type CoreWriteOperations = (typeof CoreWriteOperations)[number];
|
|
79
|
+
/**
|
|
80
|
+
* List of core create operations.
|
|
81
|
+
*/
|
|
82
|
+
declare const CoreCreateOperations: readonly ["create", "createMany", "createManyAndReturn", "upsert"];
|
|
83
|
+
/**
|
|
84
|
+
* List of core create operations.
|
|
85
|
+
*/
|
|
86
|
+
type CoreCreateOperations = (typeof CoreCreateOperations)[number];
|
|
87
|
+
/**
|
|
88
|
+
* List of core update operations.
|
|
89
|
+
*/
|
|
90
|
+
declare const CoreUpdateOperations: readonly ["update", "updateMany", "updateManyAndReturn", "upsert"];
|
|
91
|
+
/**
|
|
92
|
+
* List of core update operations.
|
|
93
|
+
*/
|
|
94
|
+
type CoreUpdateOperations = (typeof CoreUpdateOperations)[number];
|
|
95
|
+
/**
|
|
96
|
+
* List of core delete operations.
|
|
97
|
+
*/
|
|
98
|
+
declare const CoreDeleteOperations: readonly ["delete", "deleteMany"];
|
|
99
|
+
/**
|
|
100
|
+
* List of core delete operations.
|
|
101
|
+
*/
|
|
102
|
+
type CoreDeleteOperations = (typeof CoreDeleteOperations)[number];
|
|
103
|
+
/**
|
|
104
|
+
* List of all CRUD operations, including 'orThrow' variants.
|
|
105
|
+
*/
|
|
106
|
+
declare const AllCrudOperations: readonly ["findMany", "findUnique", "findFirst", "create", "createMany", "createManyAndReturn", "update", "updateMany", "updateManyAndReturn", "upsert", "delete", "deleteMany", "count", "aggregate", "groupBy", "exists", "findUniqueOrThrow", "findFirstOrThrow"];
|
|
107
|
+
/**
|
|
108
|
+
* List of all CRUD operations, including 'orThrow' variants.
|
|
109
|
+
*/
|
|
110
|
+
type AllCrudOperations = (typeof AllCrudOperations)[number];
|
|
111
|
+
/**
|
|
112
|
+
* List of all read operations, including 'orThrow' variants.
|
|
113
|
+
*/
|
|
114
|
+
declare const AllReadOperations: readonly ["findMany", "findUnique", "findFirst", "count", "aggregate", "groupBy", "exists", "findUniqueOrThrow", "findFirstOrThrow"];
|
|
115
|
+
/**
|
|
116
|
+
* List of all read operations, including 'orThrow' variants.
|
|
117
|
+
*/
|
|
118
|
+
type AllReadOperations = (typeof AllReadOperations)[number];
|
|
119
|
+
/**
|
|
120
|
+
* List of all write operations - simply an alias of CoreWriteOperations.
|
|
121
|
+
*/
|
|
122
|
+
declare const AllWriteOperations: readonly ["create", "createMany", "createManyAndReturn", "update", "updateMany", "updateManyAndReturn", "upsert", "delete", "deleteMany"];
|
|
123
|
+
/**
|
|
124
|
+
* List of all write operations - simply an alias of CoreWriteOperations.
|
|
125
|
+
*/
|
|
126
|
+
type AllWriteOperations = CoreWriteOperations;
|
|
127
|
+
//#endregion
|
|
128
|
+
export { CoreCreateOperations as a, CoreReadOperations as c, FilterPropertyToKind as d, LOGICAL_COMBINATORS as f, AllWriteOperations as i, CoreUpdateOperations as l, AllCrudOperations as n, CoreCrudOperations as o, TRANSACTION_UNSUPPORTED_METHODS as p, AllReadOperations as r, CoreDeleteOperations as s, AggregateOperators as t, CoreWriteOperations as u };
|
|
129
|
+
//# sourceMappingURL=constants-RUWhnVl4.d.mts.map
|