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