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