suparisma 1.2.2 → 1.2.6

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 (131) hide show
  1. package/README.md +51 -2
  2. package/dist/generators/coreGenerator.js +200 -15
  3. package/dist/generators/hookGenerator.js +20 -2
  4. package/dist/generators/typeGenerator.js +55 -5
  5. package/dist/index.js +6 -1
  6. package/package.json +1 -1
  7. package/tmp/generated-test/hooks/useSuparismaAsset.ts +94 -0
  8. package/tmp/generated-test/hooks/useSuparismaChapter.ts +96 -0
  9. package/tmp/generated-test/hooks/useSuparismaCourse.ts +96 -0
  10. package/tmp/generated-test/hooks/useSuparismaDeviceSession.ts +94 -0
  11. package/tmp/generated-test/hooks/useSuparismaEnrollment.ts +92 -0
  12. package/tmp/generated-test/hooks/useSuparismaLesson.ts +96 -0
  13. package/tmp/generated-test/hooks/useSuparismaLessonPurchase.ts +92 -0
  14. package/tmp/generated-test/hooks/useSuparismaLessonQuestion.ts +96 -0
  15. package/tmp/generated-test/hooks/useSuparismaPayoutMethod.ts +96 -0
  16. package/tmp/generated-test/hooks/useSuparismaPayoutRequest.ts +96 -0
  17. package/tmp/generated-test/hooks/useSuparismaQuestionOption.ts +92 -0
  18. package/tmp/generated-test/hooks/useSuparismaSavedPaymentMethod.ts +96 -0
  19. package/tmp/generated-test/hooks/useSuparismaTeacherPayoutInfo.ts +96 -0
  20. package/tmp/generated-test/hooks/useSuparismaThing.ts +96 -0
  21. package/tmp/generated-test/hooks/useSuparismaUser.ts +96 -0
  22. package/tmp/generated-test/hooks/useSuparismaVideoNote.ts +96 -0
  23. package/tmp/generated-test/hooks/useSuparismaWallet.ts +96 -0
  24. package/tmp/generated-test/hooks/useSuparismaWalletTransaction.ts +96 -0
  25. package/tmp/generated-test/hooks/useSuparismaWatchProgress.ts +96 -0
  26. package/tmp/generated-test/index.ts +140 -0
  27. package/tmp/generated-test/types/AssetTypes.ts +485 -0
  28. package/tmp/generated-test/types/ChapterTypes.ts +488 -0
  29. package/tmp/generated-test/types/CourseTypes.ts +519 -0
  30. package/tmp/generated-test/types/DeviceSessionTypes.ts +489 -0
  31. package/tmp/generated-test/types/EnrollmentTypes.ts +495 -0
  32. package/tmp/generated-test/types/LessonPurchaseTypes.ts +490 -0
  33. package/tmp/generated-test/types/LessonQuestionTypes.ts +496 -0
  34. package/tmp/generated-test/types/LessonTypes.ts +517 -0
  35. package/tmp/generated-test/types/PayoutMethodTypes.ts +517 -0
  36. package/tmp/generated-test/types/PayoutRequestTypes.ts +528 -0
  37. package/tmp/generated-test/types/QuestionOptionTypes.ts +479 -0
  38. package/tmp/generated-test/types/SavedPaymentMethodTypes.ts +497 -0
  39. package/tmp/generated-test/types/TeacherPayoutInfoTypes.ts +480 -0
  40. package/tmp/generated-test/types/ThingTypes.ts +482 -0
  41. package/tmp/generated-test/types/UserTypes.ts +487 -0
  42. package/tmp/generated-test/types/VideoNoteTypes.ts +489 -0
  43. package/tmp/generated-test/types/WalletTransactionTypes.ts +505 -0
  44. package/tmp/generated-test/types/WalletTypes.ts +480 -0
  45. package/tmp/generated-test/types/WatchProgressTypes.ts +493 -0
  46. package/tmp/generated-test/utils/core.ts +2306 -0
  47. package/tmp/generated-test/utils/supabase-client.ts +17 -0
  48. package/tmp/generated-test2/hooks/useSuparismaAsset.ts +94 -0
  49. package/tmp/generated-test2/hooks/useSuparismaChapter.ts +96 -0
  50. package/tmp/generated-test2/hooks/useSuparismaCourse.ts +96 -0
  51. package/tmp/generated-test2/hooks/useSuparismaDeviceSession.ts +94 -0
  52. package/tmp/generated-test2/hooks/useSuparismaEnrollment.ts +92 -0
  53. package/tmp/generated-test2/hooks/useSuparismaLesson.ts +96 -0
  54. package/tmp/generated-test2/hooks/useSuparismaLessonPurchase.ts +92 -0
  55. package/tmp/generated-test2/hooks/useSuparismaLessonQuestion.ts +96 -0
  56. package/tmp/generated-test2/hooks/useSuparismaPayoutMethod.ts +96 -0
  57. package/tmp/generated-test2/hooks/useSuparismaPayoutRequest.ts +96 -0
  58. package/tmp/generated-test2/hooks/useSuparismaQuestionOption.ts +92 -0
  59. package/tmp/generated-test2/hooks/useSuparismaSavedPaymentMethod.ts +96 -0
  60. package/tmp/generated-test2/hooks/useSuparismaTeacherPayoutInfo.ts +96 -0
  61. package/tmp/generated-test2/hooks/useSuparismaThing.ts +96 -0
  62. package/tmp/generated-test2/hooks/useSuparismaUser.ts +96 -0
  63. package/tmp/generated-test2/hooks/useSuparismaVideoNote.ts +96 -0
  64. package/tmp/generated-test2/hooks/useSuparismaWallet.ts +96 -0
  65. package/tmp/generated-test2/hooks/useSuparismaWalletTransaction.ts +96 -0
  66. package/tmp/generated-test2/hooks/useSuparismaWatchProgress.ts +96 -0
  67. package/tmp/generated-test2/index.ts +140 -0
  68. package/tmp/generated-test2/types/AssetTypes.ts +485 -0
  69. package/tmp/generated-test2/types/ChapterTypes.ts +488 -0
  70. package/tmp/generated-test2/types/CourseTypes.ts +522 -0
  71. package/tmp/generated-test2/types/DeviceSessionTypes.ts +489 -0
  72. package/tmp/generated-test2/types/EnrollmentTypes.ts +495 -0
  73. package/tmp/generated-test2/types/LessonPurchaseTypes.ts +490 -0
  74. package/tmp/generated-test2/types/LessonQuestionTypes.ts +496 -0
  75. package/tmp/generated-test2/types/LessonTypes.ts +517 -0
  76. package/tmp/generated-test2/types/PayoutMethodTypes.ts +517 -0
  77. package/tmp/generated-test2/types/PayoutRequestTypes.ts +528 -0
  78. package/tmp/generated-test2/types/QuestionOptionTypes.ts +479 -0
  79. package/tmp/generated-test2/types/SavedPaymentMethodTypes.ts +497 -0
  80. package/tmp/generated-test2/types/TeacherPayoutInfoTypes.ts +480 -0
  81. package/tmp/generated-test2/types/ThingTypes.ts +482 -0
  82. package/tmp/generated-test2/types/UserTypes.ts +490 -0
  83. package/tmp/generated-test2/types/VideoNoteTypes.ts +489 -0
  84. package/tmp/generated-test2/types/WalletTransactionTypes.ts +505 -0
  85. package/tmp/generated-test2/types/WalletTypes.ts +480 -0
  86. package/tmp/generated-test2/types/WatchProgressTypes.ts +493 -0
  87. package/tmp/generated-test2/utils/core.ts +2306 -0
  88. package/tmp/generated-test2/utils/supabase-client.ts +17 -0
  89. package/tmp/generated-test3/hooks/useSuparismaAsset.ts +94 -0
  90. package/tmp/generated-test3/hooks/useSuparismaChapter.ts +98 -0
  91. package/tmp/generated-test3/hooks/useSuparismaCourse.ts +98 -0
  92. package/tmp/generated-test3/hooks/useSuparismaDeviceSession.ts +94 -0
  93. package/tmp/generated-test3/hooks/useSuparismaEnrollment.ts +94 -0
  94. package/tmp/generated-test3/hooks/useSuparismaLesson.ts +98 -0
  95. package/tmp/generated-test3/hooks/useSuparismaLessonPurchase.ts +94 -0
  96. package/tmp/generated-test3/hooks/useSuparismaLessonQuestion.ts +98 -0
  97. package/tmp/generated-test3/hooks/useSuparismaPayoutMethod.ts +96 -0
  98. package/tmp/generated-test3/hooks/useSuparismaPayoutRequest.ts +96 -0
  99. package/tmp/generated-test3/hooks/useSuparismaQuestionOption.ts +94 -0
  100. package/tmp/generated-test3/hooks/useSuparismaSavedPaymentMethod.ts +96 -0
  101. package/tmp/generated-test3/hooks/useSuparismaTeacherPayoutInfo.ts +98 -0
  102. package/tmp/generated-test3/hooks/useSuparismaThing.ts +96 -0
  103. package/tmp/generated-test3/hooks/useSuparismaUser.ts +98 -0
  104. package/tmp/generated-test3/hooks/useSuparismaVideoNote.ts +98 -0
  105. package/tmp/generated-test3/hooks/useSuparismaWallet.ts +98 -0
  106. package/tmp/generated-test3/hooks/useSuparismaWalletTransaction.ts +98 -0
  107. package/tmp/generated-test3/hooks/useSuparismaWatchProgress.ts +98 -0
  108. package/tmp/generated-test3/index.ts +140 -0
  109. package/tmp/generated-test3/types/AssetTypes.ts +485 -0
  110. package/tmp/generated-test3/types/ChapterTypes.ts +488 -0
  111. package/tmp/generated-test3/types/CourseTypes.ts +522 -0
  112. package/tmp/generated-test3/types/DeviceSessionTypes.ts +489 -0
  113. package/tmp/generated-test3/types/EnrollmentTypes.ts +495 -0
  114. package/tmp/generated-test3/types/LessonPurchaseTypes.ts +490 -0
  115. package/tmp/generated-test3/types/LessonQuestionTypes.ts +496 -0
  116. package/tmp/generated-test3/types/LessonTypes.ts +517 -0
  117. package/tmp/generated-test3/types/PayoutMethodTypes.ts +517 -0
  118. package/tmp/generated-test3/types/PayoutRequestTypes.ts +528 -0
  119. package/tmp/generated-test3/types/QuestionOptionTypes.ts +479 -0
  120. package/tmp/generated-test3/types/SavedPaymentMethodTypes.ts +497 -0
  121. package/tmp/generated-test3/types/TeacherPayoutInfoTypes.ts +480 -0
  122. package/tmp/generated-test3/types/ThingTypes.ts +482 -0
  123. package/tmp/generated-test3/types/UserTypes.ts +490 -0
  124. package/tmp/generated-test3/types/VideoNoteTypes.ts +489 -0
  125. package/tmp/generated-test3/types/WalletTransactionTypes.ts +505 -0
  126. package/tmp/generated-test3/types/WalletTypes.ts +480 -0
  127. package/tmp/generated-test3/types/WatchProgressTypes.ts +493 -0
  128. package/tmp/generated-test3/utils/core.ts +2316 -0
  129. package/tmp/generated-test3/utils/supabase-client.ts +17 -0
  130. package/tmp/prisma-test-schema-2.prisma +339 -0
  131. package/tmp/prisma-test-schema.prisma +317 -0
@@ -0,0 +1,490 @@
1
+ // THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
2
+ // Edit the generator script instead
3
+
4
+ import type { User } from '@prisma/client';
5
+ import type { ModelResult, SuparismaOptions, SearchQuery, SearchState, FilterOperators, IncludeValue } from '../utils/core';
6
+ import type { TeacherPayoutInfoWithRelations, TeacherPayoutInfoSelectInput } from './TeacherPayoutInfoTypes';
7
+ import type { CourseWithRelations, CourseSelectInput } from './CourseTypes';
8
+
9
+ /**
10
+ * Extended User type that includes relation fields.
11
+ * This represents the complete shape of User records returned from the database.
12
+ */
13
+ export interface UserWithRelations {
14
+ id: string;
15
+ email: string;
16
+ name?: string;
17
+ createdAt: Date;
18
+ phone?: string;
19
+ updatedAt: Date;
20
+ role: string;
21
+ photo?: string;
22
+ payoutInfo?: TeacherPayoutInfoWithRelations | null;
23
+ courses?: CourseWithRelations[];
24
+ }
25
+
26
+ /**
27
+ * Input type for creating a new User record.
28
+ * Fields with default values are optional and will be filled automatically if not provided.
29
+ *
30
+ * @example
31
+ * // Create a minimal user
32
+ * user.create({
33
+ * // Required fields only
34
+ * email: string,
35
+ * });
36
+ *
37
+ * @example
38
+ * // Create with optional fields
39
+ * user.create({
40
+ * // All fields including optional ones
41
+ * id?: string,
42
+ * email: string,
43
+ * name?: string,
44
+ * });
45
+ */
46
+ export interface UserCreateInput {
47
+ id?: string;
48
+ email: string;
49
+ name?: string;
50
+ phone?: string;
51
+ role?: string;
52
+ photo?: string;
53
+ }
54
+
55
+ /**
56
+ * Input type for updating an existing User record.
57
+ * All fields are optional since you only need to specify the fields you want to change.
58
+ *
59
+ * @example
60
+ * // Update a user's fields
61
+ * user.update({
62
+ * where: { id: "123" },
63
+ * data: {
64
+ * id?: string,
65
+ * email: string,
66
+ * }
67
+ * });
68
+ */
69
+ export type UserUpdateInput = Partial<UserCreateInput>;
70
+
71
+ /**
72
+ * Filter type for querying User records.
73
+ * You can filter by any field in the model using equality or advanced filter operators.
74
+ * Supports OR and AND logical operations for complex queries.
75
+ *
76
+ * @example
77
+ * // Basic filtering
78
+ * user.findMany({
79
+ * where: {
80
+ * id: "value",
81
+ * email: "value"
82
+ * }
83
+ * });
84
+ *
85
+ * @example
86
+ * // Advanced filtering
87
+ * user.findMany({
88
+ * where: {
89
+ * // Use advanced operators
90
+ * id: { contains: "partial" }
91
+ * }
92
+ * });
93
+ *
94
+ * @example
95
+ * // OR conditions - match ANY condition
96
+ * user.findMany({
97
+ * where: {
98
+ * OR: [
99
+ * { id: "value1" },
100
+ * { email: { contains: "value2" } }
101
+ * ]
102
+ * }
103
+ * });
104
+ *
105
+ * @example
106
+ * // AND conditions - match ALL conditions
107
+ * user.findMany({
108
+ * where: {
109
+ * AND: [
110
+ * { id: "value1" },
111
+ * { email: { gt: 100 } }
112
+ * ]
113
+ * }
114
+ * });
115
+ *
116
+ * @example
117
+ * // Complex nested logic
118
+ * user.findMany({
119
+ * where: {
120
+ * active: true, // Regular condition (implicit AND)
121
+ * OR: [
122
+ * { role: "admin" },
123
+ * { role: "moderator" }
124
+ * ]
125
+ * }
126
+ * });
127
+ *
128
+ * @example
129
+ * // Array filtering (for array fields)
130
+ * user.findMany({
131
+ * where: {
132
+ * // Array contains specific items
133
+ * courses?: { has: ["item1", "item2"] }
134
+ * }
135
+ * });
136
+ */
137
+ export type UserWhereInput = {
138
+ id?: string | FilterOperators<string>;
139
+ email?: string | FilterOperators<string>;
140
+ name?: string | FilterOperators<string>;
141
+ createdAt?: Date | FilterOperators<Date>;
142
+ phone?: string | FilterOperators<string>;
143
+ updatedAt?: Date | FilterOperators<Date>;
144
+ role?: string | FilterOperators<string>;
145
+ photo?: string | FilterOperators<string>;
146
+ } & {
147
+ /** Match ANY of the provided conditions */
148
+ OR?: UserWhereInput[];
149
+ /** Match ALL of the provided conditions */
150
+ AND?: UserWhereInput[];
151
+ };
152
+
153
+ /**
154
+ * Unique identifier for finding a specific User record.
155
+ * Usually uses the ID field but can be any field marked as @unique in the schema.
156
+ *
157
+ * @example
158
+ * // Find by ID
159
+ * user.findUnique({ id: "123" });
160
+ *
161
+ * @example
162
+ * // Delete by ID
163
+ * user.delete({ id: "123" });
164
+ */
165
+ export type UserWhereUniqueInput = {
166
+ id: string;
167
+ };
168
+
169
+ /**
170
+ * Sort options for User queries.
171
+ * Specify the field to sort by and the direction ('asc' or 'desc').
172
+ *
173
+ * @example
174
+ * // Sort by creation date, newest first
175
+ * user.findMany({
176
+ * orderBy: { created_at: 'desc' }
177
+ * });
178
+ *
179
+ * @example
180
+ * // Sort alphabetically
181
+ * user.findMany({
182
+ * orderBy: { name: 'asc' }
183
+ * });
184
+ */
185
+ export type UserOrderByInput = {
186
+ [key in keyof UserSelectInput]?: 'asc' | 'desc';
187
+ };
188
+
189
+ /**
190
+ * Select specific scalar fields to return from User queries.
191
+ * Relation fields are intentionally excluded; use `include` for relations.
192
+ */
193
+ export type UserSelectInput = {
194
+ id?: boolean;
195
+ email?: boolean;
196
+ name?: boolean;
197
+ createdAt?: boolean;
198
+ phone?: boolean;
199
+ updatedAt?: boolean;
200
+ role?: boolean;
201
+ photo?: boolean;
202
+ };
203
+
204
+ /**
205
+ * Include related records when querying User.
206
+ * Only real Prisma relation fields are allowed here.
207
+ */
208
+ export type UserIncludeInput = {
209
+ payoutInfo?: IncludeValue | { select?: TeacherPayoutInfoSelectInput };
210
+ courses?: IncludeValue | { select?: CourseSelectInput };
211
+ };
212
+
213
+ /**
214
+ * Result type for operations that return a single User record.
215
+ */
216
+ export type UserSingleResult = ModelResult<UserWithRelations>;
217
+
218
+ /**
219
+ * Result type for operations that return multiple User records.
220
+ */
221
+ export type UserManyResult = ModelResult<UserWithRelations[]>;
222
+
223
+ /**
224
+ * Configuration options for the User hook.
225
+ * Includes where filters, ordering, pagination, and field selection.
226
+ */
227
+ export type UseUserOptions = SuparismaOptions<
228
+ UserWhereInput,
229
+ UserOrderByInput,
230
+ UserSelectInput,
231
+ UserIncludeInput
232
+ >;
233
+
234
+ /**
235
+ * The complete API for interacting with User records.
236
+ * This interface defines all available operations and state properties.
237
+ */
238
+ export interface UserHookApi {
239
+ /**
240
+ * Current array of User records.
241
+ * This is automatically updated when:
242
+ * - The initial data is loaded
243
+ * - Mutations are performed (create, update, delete)
244
+ * - Real-time updates are received from other clients
245
+ * - The refresh method is called
246
+ *
247
+ * @example
248
+ * // Render a list of user records
249
+ * const { data } = user;
250
+ * return (
251
+ * <ul>
252
+ * {data.map(item => (
253
+ * <li key={item.id}>{item.name}</li>
254
+ * ))}
255
+ * </ul>
256
+ * );
257
+ */
258
+ data: UserWithRelations[];
259
+
260
+ /**
261
+ * Error object if the last operation failed, null otherwise.
262
+ *
263
+ * @example
264
+ * // Handle potential errors
265
+ * const { error } = user;
266
+ * if (error) {
267
+ * return <div>Error: {error.message}</div>;
268
+ * }
269
+ */
270
+ error: Error | null;
271
+
272
+ /**
273
+ * Boolean indicating if an operation is in progress.
274
+ *
275
+ * @example
276
+ * // Show loading state
277
+ * const { loading } = user;
278
+ * if (loading) {
279
+ * return <div>Loading...</div>;
280
+ * }
281
+ */
282
+ loading: boolean;
283
+
284
+ /**
285
+ * The current count of records matching the filter criteria.
286
+ * This automatically updates with the data, including realtime updates.
287
+ * It always reflects the current length of the data array, respecting any filters.
288
+ *
289
+ * @example
290
+ * // Display the count in the UI
291
+ * const { count } = user;
292
+ * return <div>Total records: {count}</div>;
293
+ */
294
+ count: number;
295
+
296
+
297
+
298
+ /**
299
+ * Find a single User record by its unique identifier.
300
+ *
301
+ * @param where - The unique identifier to find the record by
302
+ * @returns A promise with the found record or error
303
+ *
304
+ * @example
305
+ * // Find user by ID
306
+ * const result = await user.findUnique({ id: "123" });
307
+ * if (result.data) {
308
+ * console.log("Found user:", result.data);
309
+ * }
310
+ */
311
+ findUnique: (where: UserWhereUniqueInput) => UserSingleResult;
312
+
313
+ /**
314
+ * Find multiple User records matching the filter criteria.
315
+ * Supports filtering, sorting, and pagination.
316
+ *
317
+ * @param params - Optional query parameters
318
+ * @returns A promise with the matching records or error
319
+ *
320
+ * @example
321
+ * // Get all user records
322
+ * const result = await user.findMany();
323
+ *
324
+ * @example
325
+ * // Filter and sort records
326
+ * const result = await user.findMany({
327
+ * where: { active: true },
328
+ * orderBy: { created_at: 'desc' },
329
+ * take: 10,
330
+ * skip: 0
331
+ * });
332
+ */
333
+ findMany: (params?: {
334
+ where?: UserWhereInput;
335
+ orderBy?: UserOrderByInput;
336
+ take?: number;
337
+ skip?: number;
338
+ }) => UserManyResult;
339
+
340
+ /**
341
+ * Find the first User record matching the filter criteria.
342
+ *
343
+ * @param params - Optional query parameters
344
+ * @returns A promise with the first matching record or error
345
+ *
346
+ * @example
347
+ * // Find the first active user
348
+ * const result = await user.findFirst({
349
+ * where: { active: true }
350
+ * });
351
+ *
352
+ * @example
353
+ * // Find the oldest user
354
+ * const result = await user.findFirst({
355
+ * orderBy: { created_at: 'asc' }
356
+ * });
357
+ */
358
+ findFirst: (params?: {
359
+ where?: UserWhereInput;
360
+ orderBy?: UserOrderByInput;
361
+ }) => UserSingleResult;
362
+
363
+ /**
364
+ * Create a new User record.
365
+ * Fields with default values are optional and will use their defaults if not provided.
366
+ *
367
+ * @param data - The data for the new record
368
+ * @returns A promise with the created record or error
369
+ *
370
+ * @example
371
+ * // Create a new user
372
+ * const result = await user.create({
373
+ * email: "value"
374
+ * });
375
+ *
376
+ * @example
377
+ * // Create with custom ID (overriding default)
378
+ * const result = await user.create({
379
+ * id: "custom-id",
380
+ * email: "value"
381
+ * });
382
+ */
383
+ create: (data: UserCreateInput) => UserSingleResult;
384
+
385
+ /**
386
+ * Update an existing User record.
387
+ *
388
+ * @param params - Object with the record identifier and fields to update
389
+ * @returns A promise with the updated record or error
390
+ *
391
+ * @example
392
+ * // Update a user's fields
393
+ * const result = await user.update({
394
+ * where: { id: "123" },
395
+ * data: {
396
+ * id?: "updated value",
397
+ * email: "updated value"
398
+ * }
399
+ * });
400
+ */
401
+ update: (params: {
402
+ where: UserWhereUniqueInput;
403
+ data: UserUpdateInput;
404
+ }) => UserSingleResult;
405
+
406
+ /**
407
+ * Delete a User record by its unique identifier.
408
+ *
409
+ * @param where - The unique identifier of the record to delete
410
+ * @returns A promise with the deleted record or error
411
+ *
412
+ * @example
413
+ * // Delete a user by ID
414
+ * const result = await user.delete({ id: "123" });
415
+ * if (result.data) {
416
+ * console.log("Deleted user:", result.data);
417
+ * }
418
+ */
419
+ delete: (where: UserWhereUniqueInput) => UserSingleResult;
420
+
421
+ /**
422
+ * Delete multiple User records matching the filter criteria.
423
+ *
424
+ * @param params - Optional filter parameters
425
+ * @returns A promise with the count of deleted records or error
426
+ *
427
+ * @example
428
+ * // Delete all inactive user records
429
+ * const result = await user.deleteMany({
430
+ * where: { active: false }
431
+ * });
432
+ * console.log(`Deleted ${result.count} records`);
433
+ *
434
+ * @example
435
+ * // Delete all user records (use with caution!)
436
+ * const result = await user.deleteMany();
437
+ */
438
+ deleteMany: (params?: {
439
+ where?: UserWhereInput;
440
+ }) => Promise<{ count: number; error: Error | null }>;
441
+
442
+ /**
443
+ * Create a record if it doesn't exist, or update it if it does.
444
+ *
445
+ * @param params - Object with the identifier, update data, and create data
446
+ * @returns A promise with the created or updated record or error
447
+ *
448
+ * @example
449
+ * // Upsert a user by ID
450
+ * const result = await user.upsert({
451
+ * where: { id: "123" },
452
+ * update: { name: "Updated Name" },
453
+ * create: {
454
+ * id: "123",
455
+ * name: "New Name",
456
+ * email: "value"
457
+ * }
458
+ * });
459
+ */
460
+ upsert: (params: {
461
+ where: UserWhereUniqueInput;
462
+ update: UserUpdateInput;
463
+ create: UserCreateInput;
464
+ }) => UserSingleResult;
465
+
466
+ /**
467
+ * Manually refresh the data with current filter settings.
468
+ * Useful after external operations or when realtime is disabled.
469
+ *
470
+ * @param params - Optional override parameters for this specific refresh
471
+ * @returns A promise with the refreshed data or error
472
+ *
473
+ * @example
474
+ * // Refresh with current filter settings
475
+ * await user.refresh();
476
+ *
477
+ * @example
478
+ * // Refresh with different filters for this call only
479
+ * await user.refresh({
480
+ * where: { active: true },
481
+ * orderBy: { name: 'asc' }
482
+ * });
483
+ */
484
+ refresh: (params?: {
485
+ where?: UserWhereInput;
486
+ orderBy?: UserOrderByInput;
487
+ take?: number;
488
+ skip?: number;
489
+ }) => UserManyResult;
490
+ }