@jest-games-org/backend-package-graphql-to-prisma-helpers 1.0.6 → 1.0.8
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/index.esm.js +116 -228
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +133 -249
- package/dist/index.js.map +1 -1
- package/dist/modules/cursor/helpers/prismaWhereInputFromGraphQLCursor.d.ts +2 -1
- package/dist/modules/filter/helpers/index.d.ts +18 -22
- package/dist/modules/filter/helpers/{prismaBooleanFilterFromGraphQLBooleanFilterInput.d.ts → prismaBooleanFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaBooleanNullableFilterFromGraphQLBooleanNullableFilterInput.d.ts → prismaBooleanNullableFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaDateTimeFilterFromGraphQLDateTimeFilterInput.d.ts → prismaDateTimeFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaDateTimeNullableFilterFromGraphQLDateTimeNullableFilterInput.d.ts → prismaDateTimeNullableFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaFloatFilterFromGraphQLFloatFilterInput.d.ts → prismaFloatFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaFloatNullableFilterFromGraphQLFloatNullableFilterInput.d.ts → prismaFloatNullableFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaIntFilterFromGraphQLIntFilterInput.d.ts → prismaIntFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaIntNullableFilterFromGraphQLIntNullableFilterInput.d.ts → prismaIntNullableFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaNestedDateTimeFilterFromGraphQLNestedDateTimeFilterInput.d.ts → prismaNestedDateTimeFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaNestedDateTimeNullableFilterFromGraphQLNestedDateTimeNullableFilterInput.d.ts → prismaNestedDateTimeNullableFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaNestedFloatFilterFromGraphQLNestedFloatFilterInput.d.ts → prismaNestedFloatFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaNestedFloatNullableFilterFromGraphQLNestedFloatNullableFilterInput.d.ts → prismaNestedFloatNullableFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaNestedIntFilterFromGraphQLNestedIntFilterInput.d.ts → prismaNestedIntFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaNestedIntNullableFilterFromGraphQLNestedIntNullableFilterInput.d.ts → prismaNestedIntNullableFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaNestedStringFilterFromGraphQLNestedStringFilterInput.d.ts → prismaNestedStringFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaNestedStringNullableFilterFromGraphQLNestedStringNullableFilterInput.d.ts → prismaNestedStringNullableFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaStringFilterFromGraphQLStringFilterInput.d.ts → prismaStringFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/dist/modules/filter/helpers/{prismaStringNullableFilterFromGraphQLStringNullableFilterInput.d.ts → prismaStringNullableFilterFromGraphQLFilterInput.d.ts} +2 -2
- package/package.json +4 -4
- package/dist/modules/filter/helpers/prismaNestedStringFilterFromGraphQLNestedIdFilterInput.d.ts +0 -8
- package/dist/modules/filter/helpers/prismaNestedStringNullableFilterFromGraphQLNestedIdNullableFilterInput.d.ts +0 -8
- package/dist/modules/filter/helpers/prismaStringFilterFromGraphQLIdFilterInput.d.ts +0 -8
- package/dist/modules/filter/helpers/prismaStringNullableFilterFromGraphQLIdNullableFilterInput.d.ts +0 -8
package/dist/index.esm.js
CHANGED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
import { createCipheriv } from 'crypto';
|
|
2
|
+
|
|
3
|
+
var QueryMode;
|
|
4
|
+
(function (QueryMode) {
|
|
5
|
+
QueryMode["Default"] = "DEFAULT";
|
|
6
|
+
QueryMode["Insensitive"] = "INSENSITIVE";
|
|
7
|
+
})(QueryMode || (QueryMode = {}));
|
|
8
|
+
|
|
9
|
+
var SortOrder;
|
|
10
|
+
(function (SortOrder) {
|
|
11
|
+
SortOrder["Ascending"] = "ASCENDING";
|
|
12
|
+
SortOrder["Descending"] = "DESCENDING";
|
|
13
|
+
})(SortOrder || (SortOrder = {}));
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Decodes the given Buffer.
|
|
17
|
+
* @param encodedBuffer The encoded Buffer.
|
|
18
|
+
* @returns The decoded string.
|
|
19
|
+
*/
|
|
20
|
+
const decodeBuffer = (encodedBuffer) => {
|
|
21
|
+
// Return the decoded Buffer.
|
|
22
|
+
return Buffer.from(encodedBuffer, 'base64');
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Decodes the given string.
|
|
27
|
+
* @param encodedString The encoded string.
|
|
28
|
+
* @returns The decoded string.
|
|
29
|
+
*/
|
|
30
|
+
const decodeString = (encodedString) => {
|
|
31
|
+
// Return the decoded string.
|
|
32
|
+
return Buffer.from(encodedString, 'base64').toString();
|
|
33
|
+
};
|
|
34
|
+
|
|
1
35
|
/**
|
|
2
36
|
* Decodes the given object.
|
|
3
37
|
* @param encodedObject The encoded object.
|
|
@@ -5,53 +39,18 @@
|
|
|
5
39
|
*/
|
|
6
40
|
const decodeObject = (encodedObject) => {
|
|
7
41
|
// Return the decoded object.
|
|
8
|
-
return JSON.parse(
|
|
42
|
+
return JSON.parse(decodeString(encodedObject));
|
|
9
43
|
};
|
|
10
44
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const verifyDecodedCursor = (decodedCursor) => {
|
|
17
|
-
// Deconstruct the decoded cursor.
|
|
18
|
-
const { args, data } = decodedCursor;
|
|
19
|
-
// Get the order by keys.
|
|
20
|
-
const orderByKeys = args.orderBy.map((o) => Object.keys(o)[0]).sort();
|
|
21
|
-
// Get the data keys.
|
|
22
|
-
const dataKeys = Object.keys(data).sort();
|
|
23
|
-
// Check if there are order by keys, if not throw an error.
|
|
24
|
-
if (orderByKeys.length === 0) {
|
|
25
|
-
throw new Error('The cursor is invalid: order by keys not found.');
|
|
26
|
-
}
|
|
27
|
-
// Check if there are data keys, if not throw an error.
|
|
28
|
-
if (dataKeys.length === 0) {
|
|
29
|
-
throw new Error('The cursor is invalid: data keys not found.');
|
|
30
|
-
}
|
|
31
|
-
// Check if the order by keys length and data keys length are the same, if not throw an error.
|
|
32
|
-
if (orderByKeys.length !== dataKeys.length) {
|
|
33
|
-
throw new Error('The cursor is invalid: the number of order by and data keys do not match.');
|
|
34
|
-
}
|
|
35
|
-
// Check if the order by keys and date keys are the same, if not throw an error.
|
|
36
|
-
if (orderByKeys.join(',') !== dataKeys.join(',')) {
|
|
37
|
-
throw new Error('The cursor is invalid: the order by and data keys do not match.');
|
|
38
|
-
}
|
|
39
|
-
// Return success.
|
|
40
|
-
return true;
|
|
45
|
+
const decryptString = (text, key, iv) => {
|
|
46
|
+
const cipher = createCipheriv('aes-256-cbc', key, iv);
|
|
47
|
+
let decrpyted = cipher.update(text, 'hex', 'utf8');
|
|
48
|
+
decrpyted += cipher.final('utf8');
|
|
49
|
+
return decrpyted;
|
|
41
50
|
};
|
|
42
51
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
* @param cursor The cursor to decode.
|
|
46
|
-
* @returns The decoded cursor.
|
|
47
|
-
*/
|
|
48
|
-
const decodeCursor = (cursor) => {
|
|
49
|
-
// Decode the cursor.
|
|
50
|
-
const decodedCursor = decodeObject(cursor);
|
|
51
|
-
// Verify the decoded cursor.
|
|
52
|
-
verifyDecodedCursor(decodedCursor);
|
|
53
|
-
// Return the decoded cursor.
|
|
54
|
-
return decodedCursor;
|
|
52
|
+
const decryptObject = (encryptedObject, encryptionKey, iv) => {
|
|
53
|
+
return JSON.parse(decryptString(encryptedObject, encryptionKey, iv));
|
|
55
54
|
};
|
|
56
55
|
|
|
57
56
|
/**
|
|
@@ -59,16 +58,19 @@ const decodeCursor = (cursor) => {
|
|
|
59
58
|
* @param cursor The GraphQL Cursor.
|
|
60
59
|
* @returns The Prisma Where Input.
|
|
61
60
|
*/
|
|
62
|
-
const prismaWhereInputFromGraphQLCursor = (cursor) => {
|
|
61
|
+
const prismaWhereInputFromGraphQLCursor = (cursor, encryptionKey) => {
|
|
63
62
|
if (!cursor) {
|
|
64
63
|
return {};
|
|
65
64
|
}
|
|
66
|
-
const
|
|
65
|
+
const decodedCursor = decodeObject(cursor);
|
|
66
|
+
const iv = decodeBuffer(decodedCursor.iv);
|
|
67
|
+
const args = decodeObject(decodedCursor.args);
|
|
68
|
+
const data = decryptObject(decodedCursor.data, encryptionKey, iv);
|
|
67
69
|
let prismaWhereInput = {};
|
|
68
|
-
for (let i = args.
|
|
69
|
-
const isLast = i === args.
|
|
70
|
-
const [key, direction] = Object.entries(args.
|
|
71
|
-
const isAsc = direction ===
|
|
70
|
+
for (let i = args.order.length - 1; i >= 0; i--) {
|
|
71
|
+
const isLast = i === args.order.length - 1;
|
|
72
|
+
const [key, direction] = Object.entries(args.order[i])[0];
|
|
73
|
+
const isAsc = direction === SortOrder.Ascending;
|
|
72
74
|
const value = data[key];
|
|
73
75
|
const isNull = value === null;
|
|
74
76
|
const orBlock1 = isNull ? { [key]: { not: null } } : { [key]: isAsc ? { gt: value } : { lt: value } };
|
|
@@ -79,11 +81,11 @@ const prismaWhereInputFromGraphQLCursor = (cursor) => {
|
|
|
79
81
|
};
|
|
80
82
|
|
|
81
83
|
/**
|
|
82
|
-
* Prisma Boolean Filter From GraphQL
|
|
84
|
+
* Prisma Boolean Filter From GraphQL Filter Input.
|
|
83
85
|
* @param input The GraphQL Boolean Filter Input.
|
|
84
86
|
* @returns The Prisma Boolean Filter.
|
|
85
87
|
*/
|
|
86
|
-
const
|
|
88
|
+
const prismaBooleanFilterFromGraphQLFilterInput = (input) => {
|
|
87
89
|
if (!input) {
|
|
88
90
|
return undefined;
|
|
89
91
|
}
|
|
@@ -91,11 +93,11 @@ const prismaBooleanFilterFromGraphQLBooleanFilterInput = (input) => {
|
|
|
91
93
|
};
|
|
92
94
|
|
|
93
95
|
/**
|
|
94
|
-
* Prisma Boolean Nullable Filter From GraphQL
|
|
96
|
+
* Prisma Boolean Nullable Filter From GraphQL Filter Input.
|
|
95
97
|
* @param input The GraphQL Boolean Nullable Filter Input.
|
|
96
98
|
* @returns The Prisma Boolean Nullable Filter.
|
|
97
99
|
*/
|
|
98
|
-
const
|
|
100
|
+
const prismaBooleanNullableFilterFromGraphQLFilterInput = (input) => {
|
|
99
101
|
if (!input) {
|
|
100
102
|
return undefined;
|
|
101
103
|
}
|
|
@@ -103,11 +105,11 @@ const prismaBooleanNullableFilterFromGraphQLBooleanNullableFilterInput = (input)
|
|
|
103
105
|
};
|
|
104
106
|
|
|
105
107
|
/**
|
|
106
|
-
* Prisma Nested Date Time Filter From GraphQL
|
|
108
|
+
* Prisma Nested Date Time Filter From GraphQL Filter Input.
|
|
107
109
|
* @param input The GraphQL Nested Date Time Filter Input.
|
|
108
110
|
* @returns The Prisma Nested Date Time Filter.
|
|
109
111
|
*/
|
|
110
|
-
const
|
|
112
|
+
const prismaNestedDateTimeFilterFromGraphQLFilterInput = (input) => {
|
|
111
113
|
if (!input) {
|
|
112
114
|
return undefined;
|
|
113
115
|
}
|
|
@@ -119,16 +121,16 @@ const prismaNestedDateTimeFilterFromGraphQLNestedDateTimeFilterInput = (input) =
|
|
|
119
121
|
lte: input.lte ?? undefined,
|
|
120
122
|
gt: input.gt ?? undefined,
|
|
121
123
|
gte: input.gte ?? undefined,
|
|
122
|
-
not:
|
|
124
|
+
not: prismaNestedDateTimeFilterFromGraphQLFilterInput(input.not),
|
|
123
125
|
};
|
|
124
126
|
};
|
|
125
127
|
|
|
126
128
|
/**
|
|
127
|
-
* Prisma Date Time Filter From GraphQL
|
|
129
|
+
* Prisma Date Time Filter From GraphQL Filter Input.
|
|
128
130
|
* @param input The GraphQL Date Time Filter Input.
|
|
129
131
|
* @returns The Prisma Date Time Filter.
|
|
130
132
|
*/
|
|
131
|
-
const
|
|
133
|
+
const prismaDateTimeFilterFromGraphQLFilterInput = (input) => {
|
|
132
134
|
if (!input) {
|
|
133
135
|
return undefined;
|
|
134
136
|
}
|
|
@@ -140,16 +142,16 @@ const prismaDateTimeFilterFromGraphQLDateTimeFilterInput = (input) => {
|
|
|
140
142
|
lte: input.lte ?? undefined,
|
|
141
143
|
gt: input.gt ?? undefined,
|
|
142
144
|
gte: input.gte ?? undefined,
|
|
143
|
-
not:
|
|
145
|
+
not: prismaNestedDateTimeFilterFromGraphQLFilterInput(input.not),
|
|
144
146
|
};
|
|
145
147
|
};
|
|
146
148
|
|
|
147
149
|
/**
|
|
148
|
-
* Prisma Nested Date Time Nullable Filter From GraphQL
|
|
150
|
+
* Prisma Nested Date Time Nullable Filter From GraphQL Filter Input.
|
|
149
151
|
* @param input The GraphQL Nested Date Time Nullable Filter Input.
|
|
150
152
|
* @returns The Prisma Nested Date Time Nullable Filter.
|
|
151
153
|
*/
|
|
152
|
-
const
|
|
154
|
+
const prismaNestedDateTimeNullableFilterFromGraphQLFilterInput = (input) => {
|
|
153
155
|
if (!input) {
|
|
154
156
|
return undefined;
|
|
155
157
|
}
|
|
@@ -161,18 +163,16 @@ const prismaNestedDateTimeNullableFilterFromGraphQLNestedDateTimeNullableFilterI
|
|
|
161
163
|
lte: input.lte ?? undefined,
|
|
162
164
|
gt: input.gt ?? undefined,
|
|
163
165
|
gte: input.gte ?? undefined,
|
|
164
|
-
not: input.not
|
|
165
|
-
? prismaNestedDateTimeNullableFilterFromGraphQLNestedDateTimeNullableFilterInput(input.not)
|
|
166
|
-
: input.not,
|
|
166
|
+
not: input.not ? prismaNestedDateTimeNullableFilterFromGraphQLFilterInput(input.not) : input.not,
|
|
167
167
|
};
|
|
168
168
|
};
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
|
-
* Prisma Date Time Nullable Filter From GraphQL
|
|
171
|
+
* Prisma Date Time Nullable Filter From GraphQL Filter Input.
|
|
172
172
|
* @param input The GraphQL Date Time Nullable Filter Input.
|
|
173
173
|
* @returns The Prisma Date Time Nullable Filter.
|
|
174
174
|
*/
|
|
175
|
-
const
|
|
175
|
+
const prismaDateTimeNullableFilterFromGraphQLFilterInput = (input) => {
|
|
176
176
|
if (!input) {
|
|
177
177
|
return undefined;
|
|
178
178
|
}
|
|
@@ -184,18 +184,16 @@ const prismaDateTimeNullableFilterFromGraphQLDateTimeNullableFilterInput = (inpu
|
|
|
184
184
|
lte: input.lte ?? undefined,
|
|
185
185
|
gt: input.gt ?? undefined,
|
|
186
186
|
gte: input.gte ?? undefined,
|
|
187
|
-
not: input.not
|
|
188
|
-
? prismaNestedDateTimeNullableFilterFromGraphQLNestedDateTimeNullableFilterInput(input.not)
|
|
189
|
-
: input.not,
|
|
187
|
+
not: input.not ? prismaNestedDateTimeNullableFilterFromGraphQLFilterInput(input.not) : input.not,
|
|
190
188
|
};
|
|
191
189
|
};
|
|
192
190
|
|
|
193
191
|
/**
|
|
194
|
-
* Prisma Nested Float Filter From GraphQL
|
|
192
|
+
* Prisma Nested Float Filter From GraphQL Filter Input.
|
|
195
193
|
* @param input The GraphQL Nested Float Filter Input.
|
|
196
194
|
* @returns The Prisma Nested Float Filter.
|
|
197
195
|
*/
|
|
198
|
-
const
|
|
196
|
+
const prismaNestedFloatFilterFromGraphQLFilterInput = (input) => {
|
|
199
197
|
if (!input) {
|
|
200
198
|
return undefined;
|
|
201
199
|
}
|
|
@@ -207,16 +205,16 @@ const prismaNestedFloatFilterFromGraphQLNestedFloatFilterInput = (input) => {
|
|
|
207
205
|
lte: input.lte ?? undefined,
|
|
208
206
|
gt: input.gt ?? undefined,
|
|
209
207
|
gte: input.gte ?? undefined,
|
|
210
|
-
not:
|
|
208
|
+
not: prismaNestedFloatFilterFromGraphQLFilterInput(input.not),
|
|
211
209
|
};
|
|
212
210
|
};
|
|
213
211
|
|
|
214
212
|
/**
|
|
215
|
-
* Prisma Float Filter From GraphQL
|
|
213
|
+
* Prisma Float Filter From GraphQL Filter Input.
|
|
216
214
|
* @param input The GraphQL Float Filter Input.
|
|
217
215
|
* @returns The Prisma Float Filter.
|
|
218
216
|
*/
|
|
219
|
-
const
|
|
217
|
+
const prismaFloatFilterFromGraphQLFilterInput = (input) => {
|
|
220
218
|
if (!input) {
|
|
221
219
|
return undefined;
|
|
222
220
|
}
|
|
@@ -228,16 +226,16 @@ const prismaFloatFilterFromGraphQLFloatFilterInput = (input) => {
|
|
|
228
226
|
lte: input.lte ?? undefined,
|
|
229
227
|
gt: input.gt ?? undefined,
|
|
230
228
|
gte: input.gte ?? undefined,
|
|
231
|
-
not:
|
|
229
|
+
not: prismaNestedFloatFilterFromGraphQLFilterInput(input.not),
|
|
232
230
|
};
|
|
233
231
|
};
|
|
234
232
|
|
|
235
233
|
/**
|
|
236
|
-
* Prisma Nested Float Nullable Filter From GraphQL
|
|
234
|
+
* Prisma Nested Float Nullable Filter From GraphQL Filter Input.
|
|
237
235
|
* @param input The GraphQL Nested Float Nullable Filter Input.
|
|
238
236
|
* @returns The Prisma Nested Float Nullable Filter.
|
|
239
237
|
*/
|
|
240
|
-
const
|
|
238
|
+
const prismaNestedFloatNullableFilterFromGraphQLFilterInput = (input) => {
|
|
241
239
|
if (!input) {
|
|
242
240
|
return undefined;
|
|
243
241
|
}
|
|
@@ -249,16 +247,16 @@ const prismaNestedFloatNullableFilterFromGraphQLNestedFloatNullableFilterInput =
|
|
|
249
247
|
lte: input.lte ?? undefined,
|
|
250
248
|
gt: input.gt ?? undefined,
|
|
251
249
|
gte: input.gte ?? undefined,
|
|
252
|
-
not: input.not ?
|
|
250
|
+
not: input.not ? prismaNestedFloatNullableFilterFromGraphQLFilterInput(input.not) : input.not,
|
|
253
251
|
};
|
|
254
252
|
};
|
|
255
253
|
|
|
256
254
|
/**
|
|
257
|
-
* Prisma Float Nullable Filter From GraphQL
|
|
255
|
+
* Prisma Float Nullable Filter From GraphQL Filter Input.
|
|
258
256
|
* @param input The GraphQL Float Nullable Filter Input.
|
|
259
257
|
* @returns The Prisma Float Nullable Filter.
|
|
260
258
|
*/
|
|
261
|
-
const
|
|
259
|
+
const prismaFloatNullableFilterFromGraphQLFilterInput = (input) => {
|
|
262
260
|
if (!input) {
|
|
263
261
|
return undefined;
|
|
264
262
|
}
|
|
@@ -270,138 +268,16 @@ const prismaFloatNullableFilterFromGraphQLFloatNullableFilterInput = (input) =>
|
|
|
270
268
|
lte: input.lte ?? undefined,
|
|
271
269
|
gt: input.gt ?? undefined,
|
|
272
270
|
gte: input.gte ?? undefined,
|
|
273
|
-
not: input.not ?
|
|
271
|
+
not: input.not ? prismaNestedFloatNullableFilterFromGraphQLFilterInput(input.not) : input.not,
|
|
274
272
|
};
|
|
275
273
|
};
|
|
276
274
|
|
|
277
275
|
/**
|
|
278
|
-
* Prisma Nested
|
|
279
|
-
* @param input The GraphQL Nested Id Filter Input.
|
|
280
|
-
* @returns The Prisma Nested String Filter.
|
|
281
|
-
*/
|
|
282
|
-
const prismaNestedStringFilterFromGraphQLNestedIdFilterInput = (input) => {
|
|
283
|
-
if (!input) {
|
|
284
|
-
return undefined;
|
|
285
|
-
}
|
|
286
|
-
return {
|
|
287
|
-
contains: input.contains ?? undefined,
|
|
288
|
-
endsWith: input.endsWith ?? undefined,
|
|
289
|
-
equals: input.equals ?? undefined,
|
|
290
|
-
gt: input.gt ?? undefined,
|
|
291
|
-
gte: input.gte ?? undefined,
|
|
292
|
-
in: input.in?.filter((o) => !!o),
|
|
293
|
-
lt: input.lt ?? undefined,
|
|
294
|
-
lte: input.lte ?? undefined,
|
|
295
|
-
not: prismaNestedStringFilterFromGraphQLNestedIdFilterInput(input.not),
|
|
296
|
-
notIn: input.notIn?.filter((o) => !!o),
|
|
297
|
-
startsWith: input.startsWith ?? undefined,
|
|
298
|
-
};
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
var QueryMode;
|
|
302
|
-
(function (QueryMode) {
|
|
303
|
-
QueryMode["Default"] = "DEFAULT";
|
|
304
|
-
QueryMode["Insensitive"] = "INSENSITIVE";
|
|
305
|
-
})(QueryMode || (QueryMode = {}));
|
|
306
|
-
|
|
307
|
-
var SortOrder;
|
|
308
|
-
(function (SortOrder) {
|
|
309
|
-
SortOrder["Ascending"] = "ASCENDING";
|
|
310
|
-
SortOrder["Descending"] = "DESCENDING";
|
|
311
|
-
})(SortOrder || (SortOrder = {}));
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Prisma Query Mode From GraphQL Query Mode.
|
|
315
|
-
* @param queryMode The GraphQL Query Mode.
|
|
316
|
-
* @returns The Prisma Query Mode.
|
|
317
|
-
*/
|
|
318
|
-
const prismaQueryModeFromGraphQLQueryMode = (queryMode) => {
|
|
319
|
-
if (!queryMode) {
|
|
320
|
-
return undefined;
|
|
321
|
-
}
|
|
322
|
-
return queryMode === QueryMode.Default ? 'default' : 'insensitive';
|
|
323
|
-
};
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Prisma String Filter From GraphQL Id Filter Input.
|
|
327
|
-
* @param input The GraphQL Id Filter Input.
|
|
328
|
-
* @returns The Prisma String Filter.
|
|
329
|
-
*/
|
|
330
|
-
const prismaStringFilterFromGraphQLIdFilterInput = (input) => {
|
|
331
|
-
if (!input) {
|
|
332
|
-
return undefined;
|
|
333
|
-
}
|
|
334
|
-
return {
|
|
335
|
-
contains: input.contains ?? undefined,
|
|
336
|
-
endsWith: input.endsWith ?? undefined,
|
|
337
|
-
equals: input.equals ?? undefined,
|
|
338
|
-
gt: input.gt ?? undefined,
|
|
339
|
-
gte: input.gte ?? undefined,
|
|
340
|
-
in: input.in?.filter((o) => !!o),
|
|
341
|
-
lt: input.lt ?? undefined,
|
|
342
|
-
lte: input.lte ?? undefined,
|
|
343
|
-
mode: prismaQueryModeFromGraphQLQueryMode(input.mode),
|
|
344
|
-
not: prismaNestedStringFilterFromGraphQLNestedIdFilterInput(input.not),
|
|
345
|
-
notIn: input.notIn?.filter((o) => !!o),
|
|
346
|
-
startsWith: input.startsWith ?? undefined,
|
|
347
|
-
};
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* Prisma Nested String Nullable Filter From GraphQL Nested ID Nullable Filter Input.
|
|
352
|
-
* @param input The GraphQL Nested ID Nullable Filter Input.
|
|
353
|
-
* @returns The Prisma Nested String Nullable Filter.
|
|
354
|
-
*/
|
|
355
|
-
const prismaNestedStringNullableFilterFromGraphQLNestedIdNullableFilterInput = (input) => {
|
|
356
|
-
if (!input) {
|
|
357
|
-
return undefined;
|
|
358
|
-
}
|
|
359
|
-
return {
|
|
360
|
-
contains: input.contains ?? undefined,
|
|
361
|
-
endsWith: input.endsWith ?? undefined,
|
|
362
|
-
equals: input.equals,
|
|
363
|
-
gt: input.gt ?? undefined,
|
|
364
|
-
gte: input.gte ?? undefined,
|
|
365
|
-
in: input.in ? input.in.filter((o) => !!o) : input.in,
|
|
366
|
-
lt: input.lt ?? undefined,
|
|
367
|
-
lte: input.lte ?? undefined,
|
|
368
|
-
not: input.not ? prismaNestedStringNullableFilterFromGraphQLNestedIdNullableFilterInput(input.not) : input.not,
|
|
369
|
-
notIn: input.notIn ? input.notIn.filter((o) => !!o) : input.notIn,
|
|
370
|
-
startsWith: input.startsWith ?? undefined,
|
|
371
|
-
};
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* Prisma String Nullable Filter From GraphQL ID Nullable Filter Input.
|
|
376
|
-
* @param input The GraphQL ID Nullable Filter Input.
|
|
377
|
-
* @returns The Prisma String Nullable Filter.
|
|
378
|
-
*/
|
|
379
|
-
const prismaStringNullableFilterFromGraphQLIdNullableFilterInput = (input) => {
|
|
380
|
-
if (!input) {
|
|
381
|
-
return undefined;
|
|
382
|
-
}
|
|
383
|
-
return {
|
|
384
|
-
contains: input.contains ?? undefined,
|
|
385
|
-
endsWith: input.endsWith ?? undefined,
|
|
386
|
-
equals: input.equals,
|
|
387
|
-
gt: input.gt ?? undefined,
|
|
388
|
-
gte: input.gte ?? undefined,
|
|
389
|
-
in: input.in ? input.in.filter((o) => !!o) : input.in,
|
|
390
|
-
lt: input.lt ?? undefined,
|
|
391
|
-
lte: input.lte ?? undefined,
|
|
392
|
-
mode: prismaQueryModeFromGraphQLQueryMode(input.mode),
|
|
393
|
-
not: input.not ? prismaNestedStringNullableFilterFromGraphQLNestedIdNullableFilterInput(input.not) : input.not,
|
|
394
|
-
notIn: input.notIn ? input.notIn.filter((o) => !!o) : input.notIn,
|
|
395
|
-
startsWith: input.startsWith ?? undefined,
|
|
396
|
-
};
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
/**
|
|
400
|
-
* Prisma Nested Int Filter From GraphQL Nested Int Filter Input.
|
|
276
|
+
* Prisma Nested Int Filter From GraphQL Filter Input.
|
|
401
277
|
* @param input The GraphQL Nested Int Filter Input.
|
|
402
278
|
* @returns The Prisma Nested Int Filter.
|
|
403
279
|
*/
|
|
404
|
-
const
|
|
280
|
+
const prismaNestedIntFilterFromGraphQLFilterInput = (input) => {
|
|
405
281
|
if (!input) {
|
|
406
282
|
return undefined;
|
|
407
283
|
}
|
|
@@ -413,16 +289,16 @@ const prismaNestedIntFilterFromGraphQLNestedIntFilterInput = (input) => {
|
|
|
413
289
|
lte: input.lte ?? undefined,
|
|
414
290
|
gt: input.gt ?? undefined,
|
|
415
291
|
gte: input.gte ?? undefined,
|
|
416
|
-
not:
|
|
292
|
+
not: prismaNestedIntFilterFromGraphQLFilterInput(input.not),
|
|
417
293
|
};
|
|
418
294
|
};
|
|
419
295
|
|
|
420
296
|
/**
|
|
421
|
-
* Prisma Int Filter From GraphQL
|
|
297
|
+
* Prisma Int Filter From GraphQL Filter Input.
|
|
422
298
|
* @param input The GraphQL Int Filter Input.
|
|
423
299
|
* @returns The Prisma Int Filter.
|
|
424
300
|
*/
|
|
425
|
-
const
|
|
301
|
+
const prismaIntFilterFromGraphQLFilterInput = (input) => {
|
|
426
302
|
if (!input) {
|
|
427
303
|
return undefined;
|
|
428
304
|
}
|
|
@@ -434,16 +310,16 @@ const prismaIntFilterFromGraphQLIntFilterInput = (input) => {
|
|
|
434
310
|
lte: input.lte ?? undefined,
|
|
435
311
|
gt: input.gt ?? undefined,
|
|
436
312
|
gte: input.gte ?? undefined,
|
|
437
|
-
not:
|
|
313
|
+
not: prismaNestedIntFilterFromGraphQLFilterInput(input.not),
|
|
438
314
|
};
|
|
439
315
|
};
|
|
440
316
|
|
|
441
317
|
/**
|
|
442
|
-
* Prisma Nested Int Nullable Filter From GraphQL
|
|
318
|
+
* Prisma Nested Int Nullable Filter From GraphQL Filter Input.
|
|
443
319
|
* @param input The GraphQL Nested Int Nullable Filter Input.
|
|
444
320
|
* @returns The Prisma Nested Int Nullable Filter.
|
|
445
321
|
*/
|
|
446
|
-
const
|
|
322
|
+
const prismaNestedIntNullableFilterFromGraphQLFilterInput = (input) => {
|
|
447
323
|
if (!input) {
|
|
448
324
|
return undefined;
|
|
449
325
|
}
|
|
@@ -455,16 +331,16 @@ const prismaNestedIntNullableFilterFromGraphQLNestedIntNullableFilterInput = (in
|
|
|
455
331
|
lte: input.lte ?? undefined,
|
|
456
332
|
gt: input.gt ?? undefined,
|
|
457
333
|
gte: input.gte ?? undefined,
|
|
458
|
-
not: input.not ?
|
|
334
|
+
not: input.not ? prismaNestedIntNullableFilterFromGraphQLFilterInput(input.not) : input.not,
|
|
459
335
|
};
|
|
460
336
|
};
|
|
461
337
|
|
|
462
338
|
/**
|
|
463
|
-
* Prisma Int Nullable Filter From GraphQL
|
|
339
|
+
* Prisma Int Nullable Filter From GraphQL Filter Input.
|
|
464
340
|
* @param input The GraphQL Int Nullable Filter Input.
|
|
465
341
|
* @returns The Prisma Int Nullable Filter.
|
|
466
342
|
*/
|
|
467
|
-
const
|
|
343
|
+
const prismaIntNullableFilterFromGraphQLFilterInput = (input) => {
|
|
468
344
|
if (!input) {
|
|
469
345
|
return undefined;
|
|
470
346
|
}
|
|
@@ -476,16 +352,16 @@ const prismaIntNullableFilterFromGraphQLIntNullableFilterInput = (input) => {
|
|
|
476
352
|
lte: input.lte ?? undefined,
|
|
477
353
|
gt: input.gt ?? undefined,
|
|
478
354
|
gte: input.gte ?? undefined,
|
|
479
|
-
not: input.not ?
|
|
355
|
+
not: input.not ? prismaNestedIntNullableFilterFromGraphQLFilterInput(input.not) : input.not,
|
|
480
356
|
};
|
|
481
357
|
};
|
|
482
358
|
|
|
483
359
|
/**
|
|
484
|
-
* Prisma Nested String Filter From GraphQL
|
|
360
|
+
* Prisma Nested String Filter From GraphQL Filter Input.
|
|
485
361
|
* @param input The GraphQL Nested String Filter Input.
|
|
486
362
|
* @returns The Prisma Nested String Filter.
|
|
487
363
|
*/
|
|
488
|
-
const
|
|
364
|
+
const prismaNestedStringFilterFromGraphQLFilterInput = (input) => {
|
|
489
365
|
if (!input) {
|
|
490
366
|
return undefined;
|
|
491
367
|
}
|
|
@@ -500,16 +376,16 @@ const prismaNestedStringFilterFromGraphQLNestedStringFilterInput = (input) => {
|
|
|
500
376
|
contains: input.contains ?? undefined,
|
|
501
377
|
startsWith: input.startsWith ?? undefined,
|
|
502
378
|
endsWith: input.endsWith ?? undefined,
|
|
503
|
-
not:
|
|
379
|
+
not: prismaNestedStringFilterFromGraphQLFilterInput(input.not),
|
|
504
380
|
};
|
|
505
381
|
};
|
|
506
382
|
|
|
507
383
|
/**
|
|
508
|
-
* Prisma Nested String Nullable Filter From GraphQL
|
|
384
|
+
* Prisma Nested String Nullable Filter From GraphQL Filter Input.
|
|
509
385
|
* @param input The GraphQL Nested String Nullable Filter Input.
|
|
510
386
|
* @returns The Prisma Nested String Nullable Filter.
|
|
511
387
|
*/
|
|
512
|
-
const
|
|
388
|
+
const prismaNestedStringNullableFilterFromGraphQLFilterInput = (input) => {
|
|
513
389
|
if (!input) {
|
|
514
390
|
return undefined;
|
|
515
391
|
}
|
|
@@ -524,16 +400,28 @@ const prismaNestedStringNullableFilterFromGraphQLNestedStringNullableFilterInput
|
|
|
524
400
|
contains: input.contains ?? undefined,
|
|
525
401
|
startsWith: input.startsWith ?? undefined,
|
|
526
402
|
endsWith: input.endsWith ?? undefined,
|
|
527
|
-
not: input.not ?
|
|
403
|
+
not: input.not ? prismaNestedStringNullableFilterFromGraphQLFilterInput(input.not) : input.not,
|
|
528
404
|
};
|
|
529
405
|
};
|
|
530
406
|
|
|
531
407
|
/**
|
|
532
|
-
* Prisma
|
|
408
|
+
* Prisma Query Mode From GraphQL Query Mode.
|
|
409
|
+
* @param queryMode The GraphQL Query Mode.
|
|
410
|
+
* @returns The Prisma Query Mode.
|
|
411
|
+
*/
|
|
412
|
+
const prismaQueryModeFromGraphQLQueryMode = (queryMode) => {
|
|
413
|
+
if (!queryMode) {
|
|
414
|
+
return undefined;
|
|
415
|
+
}
|
|
416
|
+
return queryMode === QueryMode.Default ? 'default' : 'insensitive';
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Prisma String Filter From GraphQL Filter Input.
|
|
533
421
|
* @param input The GraphQL String Filter Input.
|
|
534
422
|
* @returns The Prisma String Filter.
|
|
535
423
|
*/
|
|
536
|
-
const
|
|
424
|
+
const prismaStringFilterFromGraphQLFilterInput = (input) => {
|
|
537
425
|
if (!input) {
|
|
538
426
|
return undefined;
|
|
539
427
|
}
|
|
@@ -549,16 +437,16 @@ const prismaStringFilterFromGraphQLStringFilterInput = (input) => {
|
|
|
549
437
|
startsWith: input.startsWith ?? undefined,
|
|
550
438
|
endsWith: input.endsWith ?? undefined,
|
|
551
439
|
mode: prismaQueryModeFromGraphQLQueryMode(input.mode),
|
|
552
|
-
not:
|
|
440
|
+
not: prismaNestedStringFilterFromGraphQLFilterInput(input.not),
|
|
553
441
|
};
|
|
554
442
|
};
|
|
555
443
|
|
|
556
444
|
/**
|
|
557
|
-
* Prisma String Nullable Filter From GraphQL
|
|
445
|
+
* Prisma String Nullable Filter From GraphQL Filter Input.
|
|
558
446
|
* @param input The GraphQL String Nullable Filter Input.
|
|
559
447
|
* @returns The Prisma String Nullable Filter.
|
|
560
448
|
*/
|
|
561
|
-
const
|
|
449
|
+
const prismaStringNullableFilterFromGraphQLFilterInput = (input) => {
|
|
562
450
|
if (!input) {
|
|
563
451
|
return undefined;
|
|
564
452
|
}
|
|
@@ -574,7 +462,7 @@ const prismaStringNullableFilterFromGraphQLStringNullableFilterInput = (input) =
|
|
|
574
462
|
startsWith: input.startsWith ?? undefined,
|
|
575
463
|
endsWith: input.endsWith ?? undefined,
|
|
576
464
|
mode: prismaQueryModeFromGraphQLQueryMode(input.mode),
|
|
577
|
-
not: input.not ?
|
|
465
|
+
not: input.not ? prismaNestedStringNullableFilterFromGraphQLFilterInput(input.not) : input.not,
|
|
578
466
|
};
|
|
579
467
|
};
|
|
580
468
|
|
|
@@ -613,5 +501,5 @@ const prismaOrderInputsFromGraphQLOrderInputs = (inputs) => {
|
|
|
613
501
|
return inputs.map(prismaOrderInputFromGraphQLOrderInput);
|
|
614
502
|
};
|
|
615
503
|
|
|
616
|
-
export {
|
|
504
|
+
export { prismaBooleanFilterFromGraphQLFilterInput, prismaBooleanNullableFilterFromGraphQLFilterInput, prismaDateTimeFilterFromGraphQLFilterInput, prismaDateTimeNullableFilterFromGraphQLFilterInput, prismaFloatFilterFromGraphQLFilterInput, prismaFloatNullableFilterFromGraphQLFilterInput, prismaIntFilterFromGraphQLFilterInput, prismaIntNullableFilterFromGraphQLFilterInput, prismaNestedDateTimeFilterFromGraphQLFilterInput, prismaNestedDateTimeNullableFilterFromGraphQLFilterInput, prismaNestedFloatFilterFromGraphQLFilterInput, prismaNestedFloatNullableFilterFromGraphQLFilterInput, prismaNestedIntFilterFromGraphQLFilterInput, prismaNestedIntNullableFilterFromGraphQLFilterInput, prismaNestedStringFilterFromGraphQLFilterInput, prismaNestedStringNullableFilterFromGraphQLFilterInput, prismaOrderInputFromGraphQLOrderInput, prismaOrderInputsFromGraphQLOrderInputs, prismaQueryModeFromGraphQLQueryMode, prismaSortOrderFromGraphQLSortOrder, prismaStringFilterFromGraphQLFilterInput, prismaStringNullableFilterFromGraphQLFilterInput, prismaWhereInputFromGraphQLCursor };
|
|
617
505
|
//# sourceMappingURL=index.esm.js.map
|