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