@jest-games-org/backend-package-graphql-to-prisma-helpers 1.0.5 → 1.0.7

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.
Files changed (58) hide show
  1. package/dist/index.esm.js +155 -321
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +177 -347
  4. package/dist/index.js.map +1 -1
  5. package/dist/modules/cursor/helpers/index.d.ts +1 -1
  6. package/dist/modules/cursor/helpers/prismaWhereInputFromGraphQLCursor.d.ts +9 -0
  7. package/dist/modules/filter/helpers/index.d.ts +19 -23
  8. package/dist/modules/filter/helpers/prismaBooleanFilterFromGraphQLFilterInput.d.ts +8 -0
  9. package/dist/modules/filter/helpers/prismaBooleanNullableFilterFromGraphQLFilterInput.d.ts +8 -0
  10. package/dist/modules/filter/helpers/prismaDateTimeFilterFromGraphQLFilterInput.d.ts +8 -0
  11. package/dist/modules/filter/helpers/prismaDateTimeNullableFilterFromGraphQLFilterInput.d.ts +8 -0
  12. package/dist/modules/filter/helpers/prismaFloatFilterFromGraphQLFilterInput.d.ts +8 -0
  13. package/dist/modules/filter/helpers/prismaFloatNullableFilterFromGraphQLFilterInput.d.ts +8 -0
  14. package/dist/modules/filter/helpers/prismaIntFilterFromGraphQLFilterInput.d.ts +8 -0
  15. package/dist/modules/filter/helpers/prismaIntNullableFilterFromGraphQLFilterInput.d.ts +8 -0
  16. package/dist/modules/filter/helpers/prismaNestedDateTimeFilterFromGraphQLFilterInput.d.ts +8 -0
  17. package/dist/modules/filter/helpers/prismaNestedDateTimeNullableFilterFromGraphQLFilterInput.d.ts +8 -0
  18. package/dist/modules/filter/helpers/prismaNestedFloatFilterFromGraphQLFilterInput.d.ts +8 -0
  19. package/dist/modules/filter/helpers/prismaNestedFloatNullableFilterFromGraphQLFilterInput.d.ts +8 -0
  20. package/dist/modules/filter/helpers/prismaNestedIntFilterFromGraphQLFilterInput.d.ts +8 -0
  21. package/dist/modules/filter/helpers/prismaNestedIntNullableFilterFromGraphQLFilterInput.d.ts +8 -0
  22. package/dist/modules/filter/helpers/prismaNestedStringFilterFromGraphQLFilterInput.d.ts +8 -0
  23. package/dist/modules/filter/helpers/prismaNestedStringNullableFilterFromGraphQLFilterInput.d.ts +8 -0
  24. package/dist/modules/filter/helpers/prismaQueryModeFromGraphQLQueryMode.d.ts +8 -0
  25. package/dist/modules/filter/helpers/prismaStringFilterFromGraphQLFilterInput.d.ts +8 -0
  26. package/dist/modules/filter/helpers/prismaStringNullableFilterFromGraphQLFilterInput.d.ts +8 -0
  27. package/dist/modules/order/helpers/index.d.ts +3 -3
  28. package/dist/modules/order/helpers/prismaOrderInputFromGraphQLOrderInput.d.ts +9 -0
  29. package/dist/modules/order/helpers/prismaOrderInputsFromGraphQLOrderInputs.d.ts +9 -0
  30. package/dist/modules/order/helpers/prismaSortOrderFromGraphQLSortOrder.d.ts +8 -0
  31. package/package.json +2 -2
  32. package/dist/modules/cursor/helpers/graphQLCursorToPrismaWhereInput.d.ts +0 -9
  33. package/dist/modules/filter/helpers/graphQLBooleanFilterInputToPrismaBooleanFilter.d.ts +0 -8
  34. package/dist/modules/filter/helpers/graphQLBooleanNullableFilterInputToPrismaBooleanNullableFilter.d.ts +0 -8
  35. package/dist/modules/filter/helpers/graphQLDateTimeFilterInputToPrismaDateTimeFilter.d.ts +0 -8
  36. package/dist/modules/filter/helpers/graphQLDateTimeNullableFilterInputToPrismaDateTimeNullableFilter.d.ts +0 -8
  37. package/dist/modules/filter/helpers/graphQLFloatFilterInputToPrismaFloatFilter.d.ts +0 -8
  38. package/dist/modules/filter/helpers/graphQLFloatNullableFilterInputToPrismaFloatNullableFilter.d.ts +0 -8
  39. package/dist/modules/filter/helpers/graphQLIdFilterInputToPrismaStringFilter.d.ts +0 -8
  40. package/dist/modules/filter/helpers/graphQLIdNullableFilterInputToPrismaStringNullableFilter.d.ts +0 -8
  41. package/dist/modules/filter/helpers/graphQLIntFilterInputToPrismaIntFilter.d.ts +0 -8
  42. package/dist/modules/filter/helpers/graphQLIntNullableFilterInputToPrismaIntNullableFilter.d.ts +0 -8
  43. package/dist/modules/filter/helpers/graphQLNestedDateTimeFilterInputToPrismaNestedDateTimeFilter.d.ts +0 -8
  44. package/dist/modules/filter/helpers/graphQLNestedDateTimeNullableFilterInputToPrismaNestedDateTimeNullableFilter.d.ts +0 -8
  45. package/dist/modules/filter/helpers/graphQLNestedFloatFilterInputToPrismaNestedFloatFilter.d.ts +0 -8
  46. package/dist/modules/filter/helpers/graphQLNestedFloatNullableFilterInputToPrismaNestedFloatNullableFilter.d.ts +0 -8
  47. package/dist/modules/filter/helpers/graphQLNestedIdFilterInputToPrismaNestedStringFilter.d.ts +0 -8
  48. package/dist/modules/filter/helpers/graphQLNestedIdNullableFilterInputToPrismaNestedStringNullableFilter.d.ts +0 -8
  49. package/dist/modules/filter/helpers/graphQLNestedIntFilterInputToPrismaNestedIntFilter.d.ts +0 -8
  50. package/dist/modules/filter/helpers/graphQLNestedIntNullableFilterInputToPrismaNestedIntNullableFilter.d.ts +0 -8
  51. package/dist/modules/filter/helpers/graphQLNestedStringFilterInputToPrismaNestedStringFilter.d.ts +0 -8
  52. package/dist/modules/filter/helpers/graphQLNestedStringNullableFilterInputToPrismaNestedStringNullableFilter.d.ts +0 -8
  53. package/dist/modules/filter/helpers/graphQLQueryModeToPrismaQueryMode.d.ts +0 -8
  54. package/dist/modules/filter/helpers/graphQLStringFilterInputToPrismaStringFilter.d.ts +0 -8
  55. package/dist/modules/filter/helpers/graphQLStringNullableFilterInputToPrismaStringNullableFilter.d.ts +0 -8
  56. package/dist/modules/order/helpers/graphQLOrderInputToPrismaOrderInput.d.ts +0 -9
  57. package/dist/modules/order/helpers/graphQLOrderInputsToPrismaOrderInputs.d.ts +0 -9
  58. package/dist/modules/order/helpers/graphQLSortOrderToPrismaSortOrder.d.ts +0 -8
package/dist/index.esm.js CHANGED
@@ -55,85 +55,62 @@ const decodeCursor = (cursor) => {
55
55
  };
56
56
 
57
57
  /**
58
- * Map the GraphQL cursor to a Prisma where input.
59
- * @param cursor The GraphQL cursor
60
- * @returns The Prisma where input
58
+ * Prisma Where Input From GraphQL Cursor.
59
+ * @param cursor The GraphQL Cursor.
60
+ * @returns The Prisma Where Input.
61
61
  */
62
- const graphQLCursorToPrismaWhereInput = (cursor) => {
63
- // If the cursor is null or undefined, return empty.
62
+ const prismaWhereInputFromGraphQLCursor = (cursor) => {
64
63
  if (!cursor) {
65
64
  return {};
66
65
  }
67
- // Decode the cursor.
68
66
  const { args, data } = decodeCursor(cursor);
69
- // Initialize Prisma where input.
70
67
  let prismaWhereInput = {};
71
- // Iterate over the order by arguments (last to first).
72
68
  for (let i = args.orderBy.length - 1; i >= 0; i--) {
73
- // Check if the index is the last index.
74
69
  const isLast = i === args.orderBy.length - 1;
75
- // Get the order by key and direction.
76
70
  const [key, direction] = Object.entries(args.orderBy[i])[0];
77
- // Check if the direction is ascending.
78
71
  const isAsc = direction === 'asc';
79
- // Get the data value for the order by key.
80
72
  const value = data[key];
81
- // Check if the value is null.
82
73
  const isNull = value === null;
83
- // Get the first OR block.
84
74
  const orBlock1 = isNull ? { [key]: { not: null } } : { [key]: isAsc ? { gt: value } : { lt: value } };
85
- // Get the second OR block.
86
75
  const orBlock2 = isLast ? undefined : { AND: [{ [key]: { equals: value } }, prismaWhereInput] };
87
- // Create the Prisma where input.
88
76
  prismaWhereInput = { OR: [orBlock1, orBlock2].filter((b) => !!b) };
89
77
  }
90
- // Return the Prisma where input.
91
78
  return prismaWhereInput;
92
79
  };
93
80
 
94
81
  /**
95
- * Maps the GraphQL boolean filter input to a Prisma boolean filter.
96
- * @param input The GraphQL filter input.
97
- * @returns The Prisma filter.
82
+ * Prisma Boolean Filter From GraphQL Filter Input.
83
+ * @param input The GraphQL Boolean Filter Input.
84
+ * @returns The Prisma Boolean Filter.
98
85
  */
99
- const graphQLBooleanFilterInputToPrismaBooleanFilter = (input) => {
100
- // If the GraphQL filter input is null or undefined, return undefined.
101
- if (input === null || input === undefined) {
86
+ const prismaBooleanFilterFromGraphQLFilterInput = (input) => {
87
+ if (!input) {
102
88
  return undefined;
103
89
  }
104
- // Return the Prisma filter.
105
- return {
106
- equals: input.equals ?? undefined,
107
- };
90
+ return { equals: input.equals ?? undefined };
108
91
  };
109
92
 
110
93
  /**
111
- * Maps the GraphQL boolean nullable filter input to a Prisma boolean nullable filter.
112
- * @param input The GraphQL filter input.
113
- * @returns The Prisma filter.
94
+ * Prisma Boolean Nullable Filter From GraphQL Filter Input.
95
+ * @param input The GraphQL Boolean Nullable Filter Input.
96
+ * @returns The Prisma Boolean Nullable Filter.
114
97
  */
115
- const graphQLBooleanNullableFilterInputToPrismaBooleanNullableFilter = (input) => {
116
- // If the GraphQL filter input is null or undefined, return undefined.
117
- if (input === null || input === undefined) {
98
+ const prismaBooleanNullableFilterFromGraphQLFilterInput = (input) => {
99
+ if (!input) {
118
100
  return undefined;
119
101
  }
120
- // Return the Prisma filter.
121
- return {
122
- equals: input.equals,
123
- };
102
+ return { equals: input.equals };
124
103
  };
125
104
 
126
105
  /**
127
- * Maps the GraphQL nested date time filter input to a Prisma neseted date time filter.
128
- * @param input The GraphQL filter input.
129
- * @returns The Prisma filter.
106
+ * Prisma Nested Date Time Filter From GraphQL Filter Input.
107
+ * @param input The GraphQL Nested Date Time Filter Input.
108
+ * @returns The Prisma Nested Date Time Filter.
130
109
  */
131
- const graphQLNestedDateTimeFilterInputToPrismaNestedDateTimeFilter = (input) => {
132
- // If the GraphQL filter input is null or undefined, return undefined.
133
- if (input === null || input === undefined) {
110
+ const prismaNestedDateTimeFilterFromGraphQLFilterInput = (input) => {
111
+ if (!input) {
134
112
  return undefined;
135
113
  }
136
- // Return the Prisma filter.
137
114
  return {
138
115
  equals: input.equals ?? undefined,
139
116
  in: input.in?.filter((o) => !!o),
@@ -142,21 +119,19 @@ const graphQLNestedDateTimeFilterInputToPrismaNestedDateTimeFilter = (input) =>
142
119
  lte: input.lte ?? undefined,
143
120
  gt: input.gt ?? undefined,
144
121
  gte: input.gte ?? undefined,
145
- not: graphQLNestedDateTimeFilterInputToPrismaNestedDateTimeFilter(input.not),
122
+ not: prismaNestedDateTimeFilterFromGraphQLFilterInput(input.not),
146
123
  };
147
124
  };
148
125
 
149
126
  /**
150
- * Maps the GraphQL date time filter input to a Prisma date time filter.
151
- * @param input The GraphQL filter input.
152
- * @returns The Prisma filter.
127
+ * Prisma Date Time Filter From GraphQL Filter Input.
128
+ * @param input The GraphQL Date Time Filter Input.
129
+ * @returns The Prisma Date Time Filter.
153
130
  */
154
- const graphQLDateTimeFilterInputToPrismaDateTimeFilter = (input) => {
155
- // If the GraphQL filter input is null or undefined, return undefined.
156
- if (input === null || input === undefined) {
131
+ const prismaDateTimeFilterFromGraphQLFilterInput = (input) => {
132
+ if (!input) {
157
133
  return undefined;
158
134
  }
159
- // Return the Prisma filter.
160
135
  return {
161
136
  equals: input.equals ?? undefined,
162
137
  in: input.in?.filter((o) => !!o),
@@ -165,21 +140,19 @@ const graphQLDateTimeFilterInputToPrismaDateTimeFilter = (input) => {
165
140
  lte: input.lte ?? undefined,
166
141
  gt: input.gt ?? undefined,
167
142
  gte: input.gte ?? undefined,
168
- not: graphQLNestedDateTimeFilterInputToPrismaNestedDateTimeFilter(input.not),
143
+ not: prismaNestedDateTimeFilterFromGraphQLFilterInput(input.not),
169
144
  };
170
145
  };
171
146
 
172
147
  /**
173
- * Maps the GraphQL nested date time nullable filter input to a Prisma nested date time nullable filter.
174
- * @param input The GraphQL filter input.
175
- * @returns The Prisma filter.
148
+ * Prisma Nested Date Time Nullable Filter From GraphQL Filter Input.
149
+ * @param input The GraphQL Nested Date Time Nullable Filter Input.
150
+ * @returns The Prisma Nested Date Time Nullable Filter.
176
151
  */
177
- const graphQLNestedDateTimeNullableFilterInputToPrismaNestedDateTimeNullableFilter = (input) => {
178
- // If the GraphQL filter input is null or undefined, return undefined.
179
- if (input === null || input === undefined) {
152
+ const prismaNestedDateTimeNullableFilterFromGraphQLFilterInput = (input) => {
153
+ if (!input) {
180
154
  return undefined;
181
155
  }
182
- // Return the Prisma filter.
183
156
  return {
184
157
  equals: input.equals,
185
158
  in: input.in ? input.in.filter((o) => !!o) : input.in,
@@ -188,21 +161,19 @@ const graphQLNestedDateTimeNullableFilterInputToPrismaNestedDateTimeNullableFilt
188
161
  lte: input.lte ?? undefined,
189
162
  gt: input.gt ?? undefined,
190
163
  gte: input.gte ?? undefined,
191
- not: input.not ? graphQLNestedDateTimeNullableFilterInputToPrismaNestedDateTimeNullableFilter(input.not) : input.not,
164
+ not: input.not ? prismaNestedDateTimeNullableFilterFromGraphQLFilterInput(input.not) : input.not,
192
165
  };
193
166
  };
194
167
 
195
168
  /**
196
- * Maps the GraphQL date time nullable filter input to the Prisma date time nullable filter.
197
- * @param input The GraphQL filter input.
198
- * @returns The Prisma filter.
169
+ * Prisma Date Time Nullable Filter From GraphQL Filter Input.
170
+ * @param input The GraphQL Date Time Nullable Filter Input.
171
+ * @returns The Prisma Date Time Nullable Filter.
199
172
  */
200
- const graphQLDateTimeNullableFilterInputToPrismaDateTimeNullableFilter = (input) => {
201
- // If the GraphQL filter input is null or undefined, return undefined.
202
- if (input === null || input === undefined) {
173
+ const prismaDateTimeNullableFilterFromGraphQLFilterInput = (input) => {
174
+ if (!input) {
203
175
  return undefined;
204
176
  }
205
- // Return the Prisma filter.
206
177
  return {
207
178
  equals: input.equals,
208
179
  in: input.in ? input.in.filter((o) => !!o) : input.in,
@@ -211,21 +182,19 @@ const graphQLDateTimeNullableFilterInputToPrismaDateTimeNullableFilter = (input)
211
182
  lte: input.lte ?? undefined,
212
183
  gt: input.gt ?? undefined,
213
184
  gte: input.gte ?? undefined,
214
- not: input.not ? graphQLNestedDateTimeNullableFilterInputToPrismaNestedDateTimeNullableFilter(input.not) : input.not,
185
+ not: input.not ? prismaNestedDateTimeNullableFilterFromGraphQLFilterInput(input.not) : input.not,
215
186
  };
216
187
  };
217
188
 
218
189
  /**
219
- * Maps the GraphQL nested float filter input to a Prisma nested float filter.
220
- * @param input The GraphQL filter input.
221
- * @returns The Prisma filter.
190
+ * Prisma Nested Float Filter From GraphQL Filter Input.
191
+ * @param input The GraphQL Nested Float Filter Input.
192
+ * @returns The Prisma Nested Float Filter.
222
193
  */
223
- const graphQLNestedFloatFilterInputToPrismaNestedFloatFilter = (input) => {
224
- // If the GraphQL filter input is null or undefined, return undefined.
225
- if (input === null || input === undefined) {
194
+ const prismaNestedFloatFilterFromGraphQLFilterInput = (input) => {
195
+ if (!input) {
226
196
  return undefined;
227
197
  }
228
- // Return the Prisma filter.
229
198
  return {
230
199
  equals: input.equals ?? undefined,
231
200
  in: input.in?.filter((o) => !!o),
@@ -234,21 +203,19 @@ const graphQLNestedFloatFilterInputToPrismaNestedFloatFilter = (input) => {
234
203
  lte: input.lte ?? undefined,
235
204
  gt: input.gt ?? undefined,
236
205
  gte: input.gte ?? undefined,
237
- not: graphQLNestedFloatFilterInputToPrismaNestedFloatFilter(input.not),
206
+ not: prismaNestedFloatFilterFromGraphQLFilterInput(input.not),
238
207
  };
239
208
  };
240
209
 
241
210
  /**
242
- * Maps the GraphQL float filter input to a Prisma float filter.
243
- * @param input The GraphQL filter input.
244
- * @returns The Prisma filter.
211
+ * Prisma Float Filter From GraphQL Filter Input.
212
+ * @param input The GraphQL Float Filter Input.
213
+ * @returns The Prisma Float Filter.
245
214
  */
246
- const graphQLFloatFilterInputToPrismaFloatFilter = (input) => {
247
- // If the GraphQL filter input is null or undefined, return undefined.
248
- if (input === null || input === undefined) {
215
+ const prismaFloatFilterFromGraphQLFilterInput = (input) => {
216
+ if (!input) {
249
217
  return undefined;
250
218
  }
251
- // Return the Prisma filter.
252
219
  return {
253
220
  equals: input.equals ?? undefined,
254
221
  in: input.in?.filter((o) => !!o),
@@ -257,21 +224,19 @@ const graphQLFloatFilterInputToPrismaFloatFilter = (input) => {
257
224
  lte: input.lte ?? undefined,
258
225
  gt: input.gt ?? undefined,
259
226
  gte: input.gte ?? undefined,
260
- not: graphQLNestedFloatFilterInputToPrismaNestedFloatFilter(input.not),
227
+ not: prismaNestedFloatFilterFromGraphQLFilterInput(input.not),
261
228
  };
262
229
  };
263
230
 
264
231
  /**
265
- * Maps the GraphQL nested float nullable filter input to a Prisma nested float nullable filter.
266
- * @param input The GraphQL filter.
267
- * @returns The Prisma filter.
232
+ * Prisma Nested Float Nullable Filter From GraphQL Filter Input.
233
+ * @param input The GraphQL Nested Float Nullable Filter Input.
234
+ * @returns The Prisma Nested Float Nullable Filter.
268
235
  */
269
- const graphQLNestedFloatNullableFilterInputToPrismaNestedFloatNullableFilter = (input) => {
270
- // If the GraphQL filter input is null or undefined, return undefined.
271
- if (input === null || input === undefined) {
236
+ const prismaNestedFloatNullableFilterFromGraphQLFilterInput = (input) => {
237
+ if (!input) {
272
238
  return undefined;
273
239
  }
274
- // Return the Prisma filter.
275
240
  return {
276
241
  equals: input.equals,
277
242
  in: input.in ? input.in.filter((o) => !!o) : input.in,
@@ -280,21 +245,19 @@ const graphQLNestedFloatNullableFilterInputToPrismaNestedFloatNullableFilter = (
280
245
  lte: input.lte ?? undefined,
281
246
  gt: input.gt ?? undefined,
282
247
  gte: input.gte ?? undefined,
283
- not: input.not ? graphQLNestedFloatNullableFilterInputToPrismaNestedFloatNullableFilter(input.not) : input.not,
248
+ not: input.not ? prismaNestedFloatNullableFilterFromGraphQLFilterInput(input.not) : input.not,
284
249
  };
285
250
  };
286
251
 
287
252
  /**
288
- * Maps the GraphQL float nullable filter input to a Prisma float nullable filter.
289
- * @param input The GraphQL filter input.
290
- * @returns The Prisma filter.
253
+ * Prisma Float Nullable Filter From GraphQL Filter Input.
254
+ * @param input The GraphQL Float Nullable Filter Input.
255
+ * @returns The Prisma Float Nullable Filter.
291
256
  */
292
- const graphQLFloatNullableFilterInputToPrismaFloatNullableFilter = (input) => {
293
- // If the GraphQL filter input is null or undefined, return undefined.
294
- if (input === null || input === undefined) {
257
+ const prismaFloatNullableFilterFromGraphQLFilterInput = (input) => {
258
+ if (!input) {
295
259
  return undefined;
296
260
  }
297
- // Return the Prisma filter.
298
261
  return {
299
262
  equals: input.equals,
300
263
  in: input.in ? input.in.filter((o) => !!o) : input.in,
@@ -303,153 +266,19 @@ const graphQLFloatNullableFilterInputToPrismaFloatNullableFilter = (input) => {
303
266
  lte: input.lte ?? undefined,
304
267
  gt: input.gt ?? undefined,
305
268
  gte: input.gte ?? undefined,
306
- not: input.not ? graphQLNestedFloatNullableFilterInputToPrismaNestedFloatNullableFilter(input.not) : input.not,
269
+ not: input.not ? prismaNestedFloatNullableFilterFromGraphQLFilterInput(input.not) : input.not,
307
270
  };
308
271
  };
309
272
 
310
273
  /**
311
- * Maps the GraphQL nested id filter input to the Prisma nested string filter.
312
- * @param input The GraphQL filter input.
313
- * @returns The Prisma filter.
274
+ * Prisma Nested Int Filter From GraphQL Filter Input.
275
+ * @param input The GraphQL Nested Int Filter Input.
276
+ * @returns The Prisma Nested Int Filter.
314
277
  */
315
- const graphQLNestedIdFilterInputToPrismaNestedStringFilter = (input) => {
316
- // If the GraphQL filter input is null or undefined, return undefined.
317
- if (input === null || input === undefined) {
278
+ const prismaNestedIntFilterFromGraphQLFilterInput = (input) => {
279
+ if (!input) {
318
280
  return undefined;
319
281
  }
320
- // Return the Prisma filter.
321
- return {
322
- contains: input.contains ?? undefined,
323
- endsWith: input.endsWith ?? undefined,
324
- equals: input.equals ?? undefined,
325
- gt: input.gt ?? undefined,
326
- gte: input.gte ?? undefined,
327
- in: input.in?.filter((o) => !!o),
328
- lt: input.lt ?? undefined,
329
- lte: input.lte ?? undefined,
330
- not: graphQLNestedIdFilterInputToPrismaNestedStringFilter(input.not),
331
- notIn: input.notIn?.filter((o) => !!o),
332
- startsWith: input.startsWith ?? undefined,
333
- };
334
- };
335
-
336
- var QueryMode;
337
- (function (QueryMode) {
338
- QueryMode["Default"] = "DEFAULT";
339
- QueryMode["Insensitive"] = "INSENSITIVE";
340
- })(QueryMode || (QueryMode = {}));
341
-
342
- var SortOrder;
343
- (function (SortOrder) {
344
- SortOrder["Ascending"] = "ASCENDING";
345
- SortOrder["Descending"] = "DESCENDING";
346
- })(SortOrder || (SortOrder = {}));
347
-
348
- /**
349
- * Maps the GraphQL query mode to a Prisma query mode.
350
- * @param queryMode The GraphQL query mode.
351
- * @returns The Prisma query mode.
352
- */
353
- const graphQLQueryModeToPrismaQueryMode = (queryMode) => {
354
- // If the query mode is null or undefined, return undefined.
355
- if (queryMode === null || queryMode === undefined) {
356
- return undefined;
357
- }
358
- // Return the Prisma query mode.
359
- return queryMode === QueryMode.Default ? 'default' : 'insensitive';
360
- };
361
-
362
- /**
363
- * Maps the GraphQL id filter input to the Prisma string filter.
364
- * @param input The GraphQL filter input.
365
- * @returns The Prisma filter.
366
- */
367
- const graphQLIdFilterInputToPrismaStringFilter = (input) => {
368
- // If the GraphQL filter input is null or undefined, return undefined.
369
- if (input === null || input === undefined) {
370
- return undefined;
371
- }
372
- // Return the Prisma filter.
373
- return {
374
- contains: input.contains ?? undefined,
375
- endsWith: input.endsWith ?? undefined,
376
- equals: input.equals ?? undefined,
377
- gt: input.gt ?? undefined,
378
- gte: input.gte ?? undefined,
379
- in: input.in?.filter((o) => !!o),
380
- lt: input.lt ?? undefined,
381
- lte: input.lte ?? undefined,
382
- mode: graphQLQueryModeToPrismaQueryMode(input.mode),
383
- not: graphQLNestedIdFilterInputToPrismaNestedStringFilter(input.not),
384
- notIn: input.notIn?.filter((o) => !!o),
385
- startsWith: input.startsWith ?? undefined,
386
- };
387
- };
388
-
389
- /**
390
- * Maps the GraphQL nested id nullable filter input to the Prisma nested string nullable filter.
391
- * @param input The GraphQL filter input.
392
- * @returns The Prisma filter.
393
- */
394
- const graphQLNestedIdNullableFilterInputToPrismaNestedStringNullableFilter = (input) => {
395
- // If the GraphQL filter input is null or undefined, return undefined.
396
- if (input === null || input === undefined) {
397
- return undefined;
398
- }
399
- // Return the Prisma filter.
400
- return {
401
- contains: input.contains ?? undefined,
402
- endsWith: input.endsWith ?? undefined,
403
- equals: input.equals,
404
- gt: input.gt ?? undefined,
405
- gte: input.gte ?? undefined,
406
- in: input.in ? input.in.filter((o) => !!o) : input.in,
407
- lt: input.lt ?? undefined,
408
- lte: input.lte ?? undefined,
409
- not: input.not ? graphQLNestedIdNullableFilterInputToPrismaNestedStringNullableFilter(input.not) : input.not,
410
- notIn: input.notIn ? input.notIn.filter((o) => !!o) : input.notIn,
411
- startsWith: input.startsWith ?? undefined,
412
- };
413
- };
414
-
415
- /**
416
- * Maps the GraphQL id nullable filter input to the Prisma string nullable filter.
417
- * @param input The GraphQL filter input.
418
- * @returns The Prisma string.
419
- */
420
- const graphQLIdNullableFilterInputToPrismaStringNullableFilter = (input) => {
421
- // If the GraphQL filter input is null or undefined, return undefined.
422
- if (input === null || input === undefined) {
423
- return undefined;
424
- }
425
- // Return the Prisma filter.
426
- return {
427
- contains: input.contains ?? undefined,
428
- endsWith: input.endsWith ?? undefined,
429
- equals: input.equals,
430
- gt: input.gt ?? undefined,
431
- gte: input.gte ?? undefined,
432
- in: input.in ? input.in.filter((o) => !!o) : input.in,
433
- lt: input.lt ?? undefined,
434
- lte: input.lte ?? undefined,
435
- mode: graphQLQueryModeToPrismaQueryMode(input.mode),
436
- not: input.not ? graphQLNestedIdNullableFilterInputToPrismaNestedStringNullableFilter(input.not) : input.not,
437
- notIn: input.notIn ? input.notIn.filter((o) => !!o) : input.notIn,
438
- startsWith: input.startsWith ?? undefined,
439
- };
440
- };
441
-
442
- /**
443
- * Maps the GraphQL nested int filter input to a Prisma nested int filter.
444
- * @param input The GraphQL filter input.
445
- * @returns The Prisma filter.
446
- */
447
- const graphQLNestedIntFilterInputToPrismaNestedIntFilter = (input) => {
448
- // If the GraphQL filter input is null or undefined, return undefined.
449
- if (input === null || input === undefined) {
450
- return undefined;
451
- }
452
- // Return the Prisma filter.
453
282
  return {
454
283
  equals: input.equals ?? undefined,
455
284
  in: input.in?.filter((o) => !!o),
@@ -458,21 +287,19 @@ const graphQLNestedIntFilterInputToPrismaNestedIntFilter = (input) => {
458
287
  lte: input.lte ?? undefined,
459
288
  gt: input.gt ?? undefined,
460
289
  gte: input.gte ?? undefined,
461
- not: graphQLNestedIntFilterInputToPrismaNestedIntFilter(input.not),
290
+ not: prismaNestedIntFilterFromGraphQLFilterInput(input.not),
462
291
  };
463
292
  };
464
293
 
465
294
  /**
466
- * Map the GraphQL int filter input to a Prisma int filter.
467
- * @param input The GraphQL filter input.
468
- * @returns The Prisma filter.
295
+ * Prisma Int Filter From GraphQL Filter Input.
296
+ * @param input The GraphQL Int Filter Input.
297
+ * @returns The Prisma Int Filter.
469
298
  */
470
- const graphQLIntFilterInputToPrismaIntFilter = (input) => {
471
- // If the GraphQL filter input is null or undefined, return undefined.
472
- if (input === null || input === undefined) {
299
+ const prismaIntFilterFromGraphQLFilterInput = (input) => {
300
+ if (!input) {
473
301
  return undefined;
474
302
  }
475
- // Return the Prisma filter.
476
303
  return {
477
304
  equals: input.equals ?? undefined,
478
305
  in: input.in?.filter((o) => !!o),
@@ -481,21 +308,19 @@ const graphQLIntFilterInputToPrismaIntFilter = (input) => {
481
308
  lte: input.lte ?? undefined,
482
309
  gt: input.gt ?? undefined,
483
310
  gte: input.gte ?? undefined,
484
- not: graphQLNestedIntFilterInputToPrismaNestedIntFilter(input.not),
311
+ not: prismaNestedIntFilterFromGraphQLFilterInput(input.not),
485
312
  };
486
313
  };
487
314
 
488
315
  /**
489
- * Maps the GraphQL nested int nullable filter input to a Prisma nested int nullable filter.
490
- * @param input The GraphQL filter input.
491
- * @returns The Prisma filter.
316
+ * Prisma Nested Int Nullable Filter From GraphQL Filter Input.
317
+ * @param input The GraphQL Nested Int Nullable Filter Input.
318
+ * @returns The Prisma Nested Int Nullable Filter.
492
319
  */
493
- const graphQLNestedIntNullableFilterInputToPrismaNestedIntNullableFilter = (input) => {
494
- // If the GraphQL filter input is null or undefined, return undefined.
495
- if (input === null || input === undefined) {
320
+ const prismaNestedIntNullableFilterFromGraphQLFilterInput = (input) => {
321
+ if (!input) {
496
322
  return undefined;
497
323
  }
498
- // Return the Prisma filter.
499
324
  return {
500
325
  equals: input.equals,
501
326
  in: input.in ? input.in.filter((o) => !!o) : input.in,
@@ -504,21 +329,19 @@ const graphQLNestedIntNullableFilterInputToPrismaNestedIntNullableFilter = (inpu
504
329
  lte: input.lte ?? undefined,
505
330
  gt: input.gt ?? undefined,
506
331
  gte: input.gte ?? undefined,
507
- not: input.not ? graphQLNestedIntNullableFilterInputToPrismaNestedIntNullableFilter(input.not) : input.not,
332
+ not: input.not ? prismaNestedIntNullableFilterFromGraphQLFilterInput(input.not) : input.not,
508
333
  };
509
334
  };
510
335
 
511
336
  /**
512
- * Maps the GraphQL int nullable filter input to a Prisma int nullable filter.
513
- * @param input The GraphQL filter input.
514
- * @returns The Prisma filter.
337
+ * Prisma Int Nullable Filter From GraphQL Filter Input.
338
+ * @param input The GraphQL Int Nullable Filter Input.
339
+ * @returns The Prisma Int Nullable Filter.
515
340
  */
516
- const graphQLIntNullableFilterInputToPrismaIntNullableFilter = (input) => {
517
- // If the GraphQL filter input is null or undefined, return undefined.
518
- if (input === null || input === undefined) {
341
+ const prismaIntNullableFilterFromGraphQLFilterInput = (input) => {
342
+ if (!input) {
519
343
  return undefined;
520
344
  }
521
- // Return the Prisma filter.
522
345
  return {
523
346
  equals: input.equals,
524
347
  in: input.in ? input.in.filter((o) => !!o) : input.in,
@@ -527,21 +350,19 @@ const graphQLIntNullableFilterInputToPrismaIntNullableFilter = (input) => {
527
350
  lte: input.lte ?? undefined,
528
351
  gt: input.gt ?? undefined,
529
352
  gte: input.gte ?? undefined,
530
- not: input.not ? graphQLNestedIntNullableFilterInputToPrismaNestedIntNullableFilter(input.not) : input.not,
353
+ not: input.not ? prismaNestedIntNullableFilterFromGraphQLFilterInput(input.not) : input.not,
531
354
  };
532
355
  };
533
356
 
534
357
  /**
535
- * Maps the GraphQL nested string filter input to a Prisma nested string filter.
536
- * @param input The GraphQL filter input.
537
- * @returns The Prisma filter.
358
+ * Prisma Nested String Filter From GraphQL Filter Input.
359
+ * @param input The GraphQL Nested String Filter Input.
360
+ * @returns The Prisma Nested String Filter.
538
361
  */
539
- const graphQLNestedStringFilterInputToPrismaNestedStringFilter = (input) => {
540
- // If the GraphQL filter input is null or undefined, return undefined.
541
- if (input === null || input === undefined) {
362
+ const prismaNestedStringFilterFromGraphQLFilterInput = (input) => {
363
+ if (!input) {
542
364
  return undefined;
543
365
  }
544
- // Return the Prisma filter.
545
366
  return {
546
367
  equals: input.equals ?? undefined,
547
368
  in: input.in?.filter((o) => !!o),
@@ -553,21 +374,19 @@ const graphQLNestedStringFilterInputToPrismaNestedStringFilter = (input) => {
553
374
  contains: input.contains ?? undefined,
554
375
  startsWith: input.startsWith ?? undefined,
555
376
  endsWith: input.endsWith ?? undefined,
556
- not: graphQLNestedStringFilterInputToPrismaNestedStringFilter(input.not),
377
+ not: prismaNestedStringFilterFromGraphQLFilterInput(input.not),
557
378
  };
558
379
  };
559
380
 
560
381
  /**
561
- * Maps the GraphQL nested string nullable filter input to a Prisma nested string nullable filter.
562
- * @param input The GraphQL filter input.
563
- * @returns The Prisma afilter.
382
+ * Prisma Nested String Nullable Filter From GraphQL Filter Input.
383
+ * @param input The GraphQL Nested String Nullable Filter Input.
384
+ * @returns The Prisma Nested String Nullable Filter.
564
385
  */
565
- const graphQLNestedStringNullableFilterInputToPrismaNestedStringNullableFilter = (input) => {
566
- // If the GraphQL filter input is null or undefined, return undefined.
567
- if (input === null || input === undefined) {
386
+ const prismaNestedStringNullableFilterFromGraphQLFilterInput = (input) => {
387
+ if (!input) {
568
388
  return undefined;
569
389
  }
570
- // Return the Prisma filter.
571
390
  return {
572
391
  equals: input.equals,
573
392
  in: input.in ? input.in.filter((o) => !!o) : input.in,
@@ -579,21 +398,43 @@ const graphQLNestedStringNullableFilterInputToPrismaNestedStringNullableFilter =
579
398
  contains: input.contains ?? undefined,
580
399
  startsWith: input.startsWith ?? undefined,
581
400
  endsWith: input.endsWith ?? undefined,
582
- not: input.not ? graphQLNestedStringNullableFilterInputToPrismaNestedStringNullableFilter(input.not) : input.not,
401
+ not: input.not ? prismaNestedStringNullableFilterFromGraphQLFilterInput(input.not) : input.not,
583
402
  };
584
403
  };
585
404
 
405
+ var QueryMode;
406
+ (function (QueryMode) {
407
+ QueryMode["Default"] = "DEFAULT";
408
+ QueryMode["Insensitive"] = "INSENSITIVE";
409
+ })(QueryMode || (QueryMode = {}));
410
+
411
+ var SortOrder;
412
+ (function (SortOrder) {
413
+ SortOrder["Ascending"] = "ASCENDING";
414
+ SortOrder["Descending"] = "DESCENDING";
415
+ })(SortOrder || (SortOrder = {}));
416
+
417
+ /**
418
+ * Prisma Query Mode From GraphQL Query Mode.
419
+ * @param queryMode The GraphQL Query Mode.
420
+ * @returns The Prisma Query Mode.
421
+ */
422
+ const prismaQueryModeFromGraphQLQueryMode = (queryMode) => {
423
+ if (!queryMode) {
424
+ return undefined;
425
+ }
426
+ return queryMode === QueryMode.Default ? 'default' : 'insensitive';
427
+ };
428
+
586
429
  /**
587
- * Maps the GraphQL string filter input to a Prisma string filter.
588
- * @param input The GraphQL filter input.
589
- * @returns The Prisma filter.
430
+ * Prisma String Filter From GraphQL Filter Input.
431
+ * @param input The GraphQL String Filter Input.
432
+ * @returns The Prisma String Filter.
590
433
  */
591
- const graphQLStringFilterInputToPrismaStringFilter = (input) => {
592
- // If the GraphQL filter input is null or undefined, return undefined.
593
- if (input === null || input === undefined) {
434
+ const prismaStringFilterFromGraphQLFilterInput = (input) => {
435
+ if (!input) {
594
436
  return undefined;
595
437
  }
596
- // Return the Prisma filter.
597
438
  return {
598
439
  equals: input.equals ?? undefined,
599
440
  in: input.in?.filter((o) => !!o),
@@ -605,22 +446,20 @@ const graphQLStringFilterInputToPrismaStringFilter = (input) => {
605
446
  contains: input.contains ?? undefined,
606
447
  startsWith: input.startsWith ?? undefined,
607
448
  endsWith: input.endsWith ?? undefined,
608
- mode: graphQLQueryModeToPrismaQueryMode(input.mode),
609
- not: graphQLNestedStringFilterInputToPrismaNestedStringFilter(input.not),
449
+ mode: prismaQueryModeFromGraphQLQueryMode(input.mode),
450
+ not: prismaNestedStringFilterFromGraphQLFilterInput(input.not),
610
451
  };
611
452
  };
612
453
 
613
454
  /**
614
- * Maps the GraphQL string nullable filter input to a Prisma string nullable filter.
615
- * @param input The GraphQL filter.
616
- * @returns The Prisma filter.
455
+ * Prisma String Nullable Filter From GraphQL Filter Input.
456
+ * @param input The GraphQL String Nullable Filter Input.
457
+ * @returns The Prisma String Nullable Filter.
617
458
  */
618
- const graphQLStringNullableFilterInputToPrismaStringNullableFilter = (input) => {
619
- // If the GraphQL filter input is null or undefined, return undefined
620
- if (input === null || input === undefined) {
459
+ const prismaStringNullableFilterFromGraphQLFilterInput = (input) => {
460
+ if (!input) {
621
461
  return undefined;
622
462
  }
623
- // Return the Prisma filter
624
463
  return {
625
464
  equals: input.equals,
626
465
  in: input.in ? input.in.filter((o) => !!o) : input.in,
@@ -632,50 +471,45 @@ const graphQLStringNullableFilterInputToPrismaStringNullableFilter = (input) =>
632
471
  contains: input.contains ?? undefined,
633
472
  startsWith: input.startsWith ?? undefined,
634
473
  endsWith: input.endsWith ?? undefined,
635
- mode: graphQLQueryModeToPrismaQueryMode(input.mode),
636
- not: input.not ? graphQLNestedStringNullableFilterInputToPrismaNestedStringNullableFilter(input.not) : input.not,
474
+ mode: prismaQueryModeFromGraphQLQueryMode(input.mode),
475
+ not: input.not ? prismaNestedStringNullableFilterFromGraphQLFilterInput(input.not) : input.not,
637
476
  };
638
477
  };
639
478
 
640
479
  /**
641
- * Maps the GraphQL sort order to a Prisma sort order.
642
- * @param sortOrder The GraphQL sort order.
643
- * @returns The Prisma sort order.
480
+ * Prisma Sort Order From GraphQL Sort Order.
481
+ * @param sortOrder The GraphQL Sort Order.
482
+ * @returns The Prisma Sort Order.
644
483
  */
645
- const graphQLSortOrderToPrismaSortOrder = (sortOrder) => {
646
- // If the GraphQL sort order is null or undefined, return undefined.
647
- if (sortOrder === null || sortOrder === undefined) {
484
+ const prismaSortOrderFromGraphQLSortOrder = (sortOrder) => {
485
+ if (!sortOrder) {
648
486
  return undefined;
649
487
  }
650
- // Return the Prisma sort order.
651
488
  return sortOrder === SortOrder.Ascending ? 'asc' : 'desc';
652
489
  };
653
490
 
654
491
  /**
655
- * Maps the GraphQL order input to a Prisma order input.
656
- * @param input The GraphQL order input.
657
- * @returns The Prisma order input.
492
+ * Prisma Order Input From GraphQL Order Input.
493
+ * @param input The GraphQL Order Input.
494
+ * @returns The Prisma Order Input.
658
495
  */
659
- const graphQLOrderInputToPrismaOrderInput = (input) => {
660
- // Return the Prisma order by.
496
+ const prismaOrderInputFromGraphQLOrderInput = (input) => {
661
497
  return Object.fromEntries(Object.entries(input).map(([key, value]) => {
662
- return [key, graphQLSortOrderToPrismaSortOrder(value)];
498
+ return [key, prismaSortOrderFromGraphQLSortOrder(value)];
663
499
  }));
664
500
  };
665
501
 
666
502
  /**
667
- * Maps the GraphQL order inputs to the Prisma order inputs.
668
- * @param inputs The GraphQL order inputs.
669
- * @returns The Prisma order inputs.
503
+ * Prisma Order Inputs From GraphQL Order Inputs.
504
+ * @param inputs The GraphQL Prder Inputs.
505
+ * @returns The Prisma Order Inputs.
670
506
  */
671
- const graphQLOrderInputsToPrismaOrderInputs = (inputs) => {
672
- // If the GraphQL order inputs is null or undefined, return undefined.
673
- if (inputs === null || inputs === undefined) {
507
+ const prismaOrderInputsFromGraphQLOrderInputs = (inputs) => {
508
+ if (!inputs) {
674
509
  return undefined;
675
510
  }
676
- // Return the Prisma order inputs.
677
- return inputs.map(graphQLOrderInputToPrismaOrderInput);
511
+ return inputs.map(prismaOrderInputFromGraphQLOrderInput);
678
512
  };
679
513
 
680
- export { graphQLBooleanFilterInputToPrismaBooleanFilter, graphQLBooleanNullableFilterInputToPrismaBooleanNullableFilter, graphQLCursorToPrismaWhereInput, graphQLDateTimeFilterInputToPrismaDateTimeFilter, graphQLDateTimeNullableFilterInputToPrismaDateTimeNullableFilter, graphQLFloatFilterInputToPrismaFloatFilter, graphQLFloatNullableFilterInputToPrismaFloatNullableFilter, graphQLIdFilterInputToPrismaStringFilter, graphQLIdNullableFilterInputToPrismaStringNullableFilter, graphQLIntFilterInputToPrismaIntFilter, graphQLIntNullableFilterInputToPrismaIntNullableFilter, graphQLNestedDateTimeFilterInputToPrismaNestedDateTimeFilter, graphQLNestedDateTimeNullableFilterInputToPrismaNestedDateTimeNullableFilter, graphQLNestedFloatFilterInputToPrismaNestedFloatFilter, graphQLNestedFloatNullableFilterInputToPrismaNestedFloatNullableFilter, graphQLNestedIdFilterInputToPrismaNestedStringFilter, graphQLNestedIdNullableFilterInputToPrismaNestedStringNullableFilter, graphQLNestedIntFilterInputToPrismaNestedIntFilter, graphQLNestedIntNullableFilterInputToPrismaNestedIntNullableFilter, graphQLNestedStringFilterInputToPrismaNestedStringFilter, graphQLNestedStringNullableFilterInputToPrismaNestedStringNullableFilter, graphQLOrderInputToPrismaOrderInput, graphQLOrderInputsToPrismaOrderInputs, graphQLQueryModeToPrismaQueryMode, graphQLSortOrderToPrismaSortOrder, graphQLStringFilterInputToPrismaStringFilter, graphQLStringNullableFilterInputToPrismaStringNullableFilter };
514
+ export { prismaBooleanFilterFromGraphQLFilterInput, prismaBooleanNullableFilterFromGraphQLFilterInput, prismaDateTimeFilterFromGraphQLFilterInput, prismaDateTimeNullableFilterFromGraphQLFilterInput, prismaFloatFilterFromGraphQLFilterInput, prismaFloatNullableFilterFromGraphQLFilterInput, prismaIntFilterFromGraphQLFilterInput, prismaIntNullableFilterFromGraphQLFilterInput, prismaNestedDateTimeFilterFromGraphQLFilterInput, prismaNestedDateTimeNullableFilterFromGraphQLFilterInput, prismaNestedFloatFilterFromGraphQLFilterInput, prismaNestedFloatNullableFilterFromGraphQLFilterInput, prismaNestedIntFilterFromGraphQLFilterInput, prismaNestedIntNullableFilterFromGraphQLFilterInput, prismaNestedStringFilterFromGraphQLFilterInput, prismaNestedStringNullableFilterFromGraphQLFilterInput, prismaOrderInputFromGraphQLOrderInput, prismaOrderInputsFromGraphQLOrderInputs, prismaQueryModeFromGraphQLQueryMode, prismaSortOrderFromGraphQLSortOrder, prismaStringFilterFromGraphQLFilterInput, prismaStringNullableFilterFromGraphQLFilterInput, prismaWhereInputFromGraphQLCursor };
681
515
  //# sourceMappingURL=index.esm.js.map