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