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