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,92 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
2
|
+
// Edit the generator script instead: scripts/generate-realtime-hooks.ts
|
|
3
|
+
|
|
4
|
+
// Corrected import for core hook factory
|
|
5
|
+
import { createSuparismaHook } from '../utils/core';
|
|
6
|
+
import type {
|
|
7
|
+
QuestionOptionWithRelations,
|
|
8
|
+
QuestionOptionCreateInput,
|
|
9
|
+
QuestionOptionUpdateInput,
|
|
10
|
+
QuestionOptionWhereInput,
|
|
11
|
+
QuestionOptionWhereUniqueInput,
|
|
12
|
+
QuestionOptionOrderByInput,
|
|
13
|
+
QuestionOptionSelectInput,
|
|
14
|
+
QuestionOptionIncludeInput,
|
|
15
|
+
QuestionOptionHookApi,
|
|
16
|
+
UseQuestionOptionOptions
|
|
17
|
+
} from '../types/QuestionOptionTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with QuestionOption records with real-time capabilities.
|
|
21
|
+
*
|
|
22
|
+
* This hook provides CRUD operations, real-time updates, and search functionality.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Optional configuration options for the hook
|
|
25
|
+
* @returns An object with data state and methods for interacting with QuestionOption records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all QuestionOption records with realtime updates
|
|
29
|
+
* const questionoption = useSuparismaQuestionOption();
|
|
30
|
+
* const { data, loading, error } = questionoption;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const questionoption = useSuparismaQuestionOption({
|
|
35
|
+
* where: { active: true },
|
|
36
|
+
* orderBy: { createdAt: 'desc' }, // Note: Using actual Prisma field name
|
|
37
|
+
* limit: 10
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Create a new record
|
|
42
|
+
* const result = await questionoption.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await questionoption.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await questionoption.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await questionoption.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const questionoption = useSuparismaQuestionOption({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const questionoption = useSuparismaQuestionOption({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaQuestionOption = createSuparismaHook<
|
|
79
|
+
QuestionOptionWithRelations,
|
|
80
|
+
QuestionOptionWithRelations,
|
|
81
|
+
QuestionOptionCreateInput,
|
|
82
|
+
QuestionOptionUpdateInput,
|
|
83
|
+
QuestionOptionWhereInput,
|
|
84
|
+
QuestionOptionWhereUniqueInput,
|
|
85
|
+
QuestionOptionOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'QuestionOption',
|
|
88
|
+
hasCreatedAt: false,
|
|
89
|
+
hasUpdatedAt: false,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","isCorrect":"false","order":"0"}
|
|
92
|
+
}) as unknown as (options?: UseQuestionOptionOptions) => QuestionOptionHookApi;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
2
|
+
// Edit the generator script instead: scripts/generate-realtime-hooks.ts
|
|
3
|
+
|
|
4
|
+
// Corrected import for core hook factory
|
|
5
|
+
import { createSuparismaHook } from '../utils/core';
|
|
6
|
+
import type {
|
|
7
|
+
SavedPaymentMethodWithRelations,
|
|
8
|
+
SavedPaymentMethodCreateInput,
|
|
9
|
+
SavedPaymentMethodUpdateInput,
|
|
10
|
+
SavedPaymentMethodWhereInput,
|
|
11
|
+
SavedPaymentMethodWhereUniqueInput,
|
|
12
|
+
SavedPaymentMethodOrderByInput,
|
|
13
|
+
SavedPaymentMethodSelectInput,
|
|
14
|
+
SavedPaymentMethodIncludeInput,
|
|
15
|
+
SavedPaymentMethodHookApi,
|
|
16
|
+
UseSavedPaymentMethodOptions
|
|
17
|
+
} from '../types/SavedPaymentMethodTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with SavedPaymentMethod records with real-time capabilities.
|
|
21
|
+
*
|
|
22
|
+
* This hook provides CRUD operations, real-time updates, and search functionality.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Optional configuration options for the hook
|
|
25
|
+
* @returns An object with data state and methods for interacting with SavedPaymentMethod records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all SavedPaymentMethod records with realtime updates
|
|
29
|
+
* const savedpaymentmethod = useSuparismaSavedPaymentMethod();
|
|
30
|
+
* const { data, loading, error } = savedpaymentmethod;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const savedpaymentmethod = useSuparismaSavedPaymentMethod({
|
|
35
|
+
* where: { active: true },
|
|
36
|
+
* orderBy: { createdAt: 'desc' }, // Note: Using actual Prisma field name
|
|
37
|
+
* limit: 10
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Create a new record
|
|
42
|
+
* const result = await savedpaymentmethod.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await savedpaymentmethod.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await savedpaymentmethod.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await savedpaymentmethod.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const savedpaymentmethod = useSuparismaSavedPaymentMethod({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const savedpaymentmethod = useSuparismaSavedPaymentMethod({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaSavedPaymentMethod = createSuparismaHook<
|
|
79
|
+
SavedPaymentMethodWithRelations,
|
|
80
|
+
SavedPaymentMethodWithRelations,
|
|
81
|
+
SavedPaymentMethodCreateInput,
|
|
82
|
+
SavedPaymentMethodUpdateInput,
|
|
83
|
+
SavedPaymentMethodWhereInput,
|
|
84
|
+
SavedPaymentMethodWhereUniqueInput,
|
|
85
|
+
SavedPaymentMethodOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'SavedPaymentMethod',
|
|
88
|
+
hasCreatedAt: true,
|
|
89
|
+
hasUpdatedAt: true,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","isDefault":"false","createdAt":"now("},
|
|
92
|
+
// Field name for createdAt from Prisma schema
|
|
93
|
+
createdAtField: "createdAt",
|
|
94
|
+
// Field name for updatedAt from Prisma schema
|
|
95
|
+
updatedAtField: "updatedAt"
|
|
96
|
+
}) as unknown as (options?: UseSavedPaymentMethodOptions) => SavedPaymentMethodHookApi;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
2
|
+
// Edit the generator script instead: scripts/generate-realtime-hooks.ts
|
|
3
|
+
|
|
4
|
+
// Corrected import for core hook factory
|
|
5
|
+
import { createSuparismaHook } from '../utils/core';
|
|
6
|
+
import type {
|
|
7
|
+
TeacherPayoutInfoWithRelations,
|
|
8
|
+
TeacherPayoutInfoCreateInput,
|
|
9
|
+
TeacherPayoutInfoUpdateInput,
|
|
10
|
+
TeacherPayoutInfoWhereInput,
|
|
11
|
+
TeacherPayoutInfoWhereUniqueInput,
|
|
12
|
+
TeacherPayoutInfoOrderByInput,
|
|
13
|
+
TeacherPayoutInfoSelectInput,
|
|
14
|
+
TeacherPayoutInfoIncludeInput,
|
|
15
|
+
TeacherPayoutInfoHookApi,
|
|
16
|
+
UseTeacherPayoutInfoOptions
|
|
17
|
+
} from '../types/TeacherPayoutInfoTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with TeacherPayoutInfo records with real-time capabilities.
|
|
21
|
+
*
|
|
22
|
+
* This hook provides CRUD operations, real-time updates, and search functionality.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Optional configuration options for the hook
|
|
25
|
+
* @returns An object with data state and methods for interacting with TeacherPayoutInfo records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all TeacherPayoutInfo records with realtime updates
|
|
29
|
+
* const teacherpayoutinfo = useSuparismaTeacherPayoutInfo();
|
|
30
|
+
* const { data, loading, error } = teacherpayoutinfo;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const teacherpayoutinfo = useSuparismaTeacherPayoutInfo({
|
|
35
|
+
* where: { active: true },
|
|
36
|
+
* orderBy: { createdAt: 'desc' }, // Note: Using actual Prisma field name
|
|
37
|
+
* limit: 10
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Create a new record
|
|
42
|
+
* const result = await teacherpayoutinfo.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await teacherpayoutinfo.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await teacherpayoutinfo.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await teacherpayoutinfo.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const teacherpayoutinfo = useSuparismaTeacherPayoutInfo({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const teacherpayoutinfo = useSuparismaTeacherPayoutInfo({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaTeacherPayoutInfo = createSuparismaHook<
|
|
79
|
+
TeacherPayoutInfoWithRelations,
|
|
80
|
+
TeacherPayoutInfoWithRelations,
|
|
81
|
+
TeacherPayoutInfoCreateInput,
|
|
82
|
+
TeacherPayoutInfoUpdateInput,
|
|
83
|
+
TeacherPayoutInfoWhereInput,
|
|
84
|
+
TeacherPayoutInfoWhereUniqueInput,
|
|
85
|
+
TeacherPayoutInfoOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'TeacherPayoutInfo',
|
|
88
|
+
hasCreatedAt: true,
|
|
89
|
+
hasUpdatedAt: true,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","payoutFrequency":"\"daily\"","createdAt":"now("},
|
|
92
|
+
// Field name for createdAt from Prisma schema
|
|
93
|
+
createdAtField: "createdAt",
|
|
94
|
+
// Field name for updatedAt from Prisma schema
|
|
95
|
+
updatedAtField: "updatedAt"
|
|
96
|
+
}) as unknown as (options?: UseTeacherPayoutInfoOptions) => TeacherPayoutInfoHookApi;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
2
|
+
// Edit the generator script instead: scripts/generate-realtime-hooks.ts
|
|
3
|
+
|
|
4
|
+
// Corrected import for core hook factory
|
|
5
|
+
import { createSuparismaHook } from '../utils/core';
|
|
6
|
+
import type {
|
|
7
|
+
ThingWithRelations,
|
|
8
|
+
ThingCreateInput,
|
|
9
|
+
ThingUpdateInput,
|
|
10
|
+
ThingWhereInput,
|
|
11
|
+
ThingWhereUniqueInput,
|
|
12
|
+
ThingOrderByInput,
|
|
13
|
+
ThingSelectInput,
|
|
14
|
+
ThingIncludeInput,
|
|
15
|
+
ThingHookApi,
|
|
16
|
+
UseThingOptions
|
|
17
|
+
} from '../types/ThingTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with Thing records with real-time capabilities.
|
|
21
|
+
*
|
|
22
|
+
* This hook provides CRUD operations, real-time updates, and search functionality.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Optional configuration options for the hook
|
|
25
|
+
* @returns An object with data state and methods for interacting with Thing records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all Thing records with realtime updates
|
|
29
|
+
* const thing = useSuparismaThing();
|
|
30
|
+
* const { data, loading, error } = thing;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const thing = useSuparismaThing({
|
|
35
|
+
* where: { active: true },
|
|
36
|
+
* orderBy: { createdAt: 'desc' }, // Note: Using actual Prisma field name
|
|
37
|
+
* limit: 10
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Create a new record
|
|
42
|
+
* const result = await thing.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await thing.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await thing.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await thing.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const thing = useSuparismaThing({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const thing = useSuparismaThing({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaThing = createSuparismaHook<
|
|
79
|
+
ThingWithRelations,
|
|
80
|
+
ThingWithRelations,
|
|
81
|
+
ThingCreateInput,
|
|
82
|
+
ThingUpdateInput,
|
|
83
|
+
ThingWhereInput,
|
|
84
|
+
ThingWhereUniqueInput,
|
|
85
|
+
ThingOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'Thing',
|
|
88
|
+
hasCreatedAt: true,
|
|
89
|
+
hasUpdatedAt: true,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","status":"\"pending\"","priority":"0","createdAt":"now("},
|
|
92
|
+
// Field name for createdAt from Prisma schema
|
|
93
|
+
createdAtField: "createdAt",
|
|
94
|
+
// Field name for updatedAt from Prisma schema
|
|
95
|
+
updatedAtField: "updatedAt"
|
|
96
|
+
}) as unknown as (options?: UseThingOptions) => ThingHookApi;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
2
|
+
// Edit the generator script instead: scripts/generate-realtime-hooks.ts
|
|
3
|
+
|
|
4
|
+
// Corrected import for core hook factory
|
|
5
|
+
import { createSuparismaHook } from '../utils/core';
|
|
6
|
+
import type {
|
|
7
|
+
UserWithRelations,
|
|
8
|
+
UserCreateInput,
|
|
9
|
+
UserUpdateInput,
|
|
10
|
+
UserWhereInput,
|
|
11
|
+
UserWhereUniqueInput,
|
|
12
|
+
UserOrderByInput,
|
|
13
|
+
UserSelectInput,
|
|
14
|
+
UserIncludeInput,
|
|
15
|
+
UserHookApi,
|
|
16
|
+
UseUserOptions
|
|
17
|
+
} from '../types/UserTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with User records with real-time capabilities.
|
|
21
|
+
*
|
|
22
|
+
* This hook provides CRUD operations, real-time updates, and search functionality.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Optional configuration options for the hook
|
|
25
|
+
* @returns An object with data state and methods for interacting with User records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all User records with realtime updates
|
|
29
|
+
* const user = useSuparismaUser();
|
|
30
|
+
* const { data, loading, error } = user;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const user = useSuparismaUser({
|
|
35
|
+
* where: { active: true },
|
|
36
|
+
* orderBy: { createdAt: 'desc' }, // Note: Using actual Prisma field name
|
|
37
|
+
* limit: 10
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Create a new record
|
|
42
|
+
* const result = await user.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await user.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await user.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await user.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const user = useSuparismaUser({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const user = useSuparismaUser({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaUser = createSuparismaHook<
|
|
79
|
+
UserWithRelations,
|
|
80
|
+
UserWithRelations,
|
|
81
|
+
UserCreateInput,
|
|
82
|
+
UserUpdateInput,
|
|
83
|
+
UserWhereInput,
|
|
84
|
+
UserWhereUniqueInput,
|
|
85
|
+
UserOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'User',
|
|
88
|
+
hasCreatedAt: true,
|
|
89
|
+
hasUpdatedAt: true,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","createdAt":"now(","role":"\"student\""},
|
|
92
|
+
// Field name for createdAt from Prisma schema
|
|
93
|
+
createdAtField: "createdAt",
|
|
94
|
+
// Field name for updatedAt from Prisma schema
|
|
95
|
+
updatedAtField: "updatedAt"
|
|
96
|
+
}) as unknown as (options?: UseUserOptions) => UserHookApi;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
2
|
+
// Edit the generator script instead: scripts/generate-realtime-hooks.ts
|
|
3
|
+
|
|
4
|
+
// Corrected import for core hook factory
|
|
5
|
+
import { createSuparismaHook } from '../utils/core';
|
|
6
|
+
import type {
|
|
7
|
+
VideoNoteWithRelations,
|
|
8
|
+
VideoNoteCreateInput,
|
|
9
|
+
VideoNoteUpdateInput,
|
|
10
|
+
VideoNoteWhereInput,
|
|
11
|
+
VideoNoteWhereUniqueInput,
|
|
12
|
+
VideoNoteOrderByInput,
|
|
13
|
+
VideoNoteSelectInput,
|
|
14
|
+
VideoNoteIncludeInput,
|
|
15
|
+
VideoNoteHookApi,
|
|
16
|
+
UseVideoNoteOptions
|
|
17
|
+
} from '../types/VideoNoteTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with VideoNote records with real-time capabilities.
|
|
21
|
+
*
|
|
22
|
+
* This hook provides CRUD operations, real-time updates, and search functionality.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Optional configuration options for the hook
|
|
25
|
+
* @returns An object with data state and methods for interacting with VideoNote records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all VideoNote records with realtime updates
|
|
29
|
+
* const videonote = useSuparismaVideoNote();
|
|
30
|
+
* const { data, loading, error } = videonote;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const videonote = useSuparismaVideoNote({
|
|
35
|
+
* where: { active: true },
|
|
36
|
+
* orderBy: { createdAt: 'desc' }, // Note: Using actual Prisma field name
|
|
37
|
+
* limit: 10
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Create a new record
|
|
42
|
+
* const result = await videonote.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await videonote.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await videonote.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await videonote.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const videonote = useSuparismaVideoNote({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const videonote = useSuparismaVideoNote({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaVideoNote = createSuparismaHook<
|
|
79
|
+
VideoNoteWithRelations,
|
|
80
|
+
VideoNoteWithRelations,
|
|
81
|
+
VideoNoteCreateInput,
|
|
82
|
+
VideoNoteUpdateInput,
|
|
83
|
+
VideoNoteWhereInput,
|
|
84
|
+
VideoNoteWhereUniqueInput,
|
|
85
|
+
VideoNoteOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'VideoNote',
|
|
88
|
+
hasCreatedAt: true,
|
|
89
|
+
hasUpdatedAt: true,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","color":"\"default\"","createdAt":"now("},
|
|
92
|
+
// Field name for createdAt from Prisma schema
|
|
93
|
+
createdAtField: "createdAt",
|
|
94
|
+
// Field name for updatedAt from Prisma schema
|
|
95
|
+
updatedAtField: "updatedAt"
|
|
96
|
+
}) as unknown as (options?: UseVideoNoteOptions) => VideoNoteHookApi;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
2
|
+
// Edit the generator script instead: scripts/generate-realtime-hooks.ts
|
|
3
|
+
|
|
4
|
+
// Corrected import for core hook factory
|
|
5
|
+
import { createSuparismaHook } from '../utils/core';
|
|
6
|
+
import type {
|
|
7
|
+
WalletWithRelations,
|
|
8
|
+
WalletCreateInput,
|
|
9
|
+
WalletUpdateInput,
|
|
10
|
+
WalletWhereInput,
|
|
11
|
+
WalletWhereUniqueInput,
|
|
12
|
+
WalletOrderByInput,
|
|
13
|
+
WalletSelectInput,
|
|
14
|
+
WalletIncludeInput,
|
|
15
|
+
WalletHookApi,
|
|
16
|
+
UseWalletOptions
|
|
17
|
+
} from '../types/WalletTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with Wallet records with real-time capabilities.
|
|
21
|
+
*
|
|
22
|
+
* This hook provides CRUD operations, real-time updates, and search functionality.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Optional configuration options for the hook
|
|
25
|
+
* @returns An object with data state and methods for interacting with Wallet records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all Wallet records with realtime updates
|
|
29
|
+
* const wallet = useSuparismaWallet();
|
|
30
|
+
* const { data, loading, error } = wallet;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const wallet = useSuparismaWallet({
|
|
35
|
+
* where: { active: true },
|
|
36
|
+
* orderBy: { createdAt: 'desc' }, // Note: Using actual Prisma field name
|
|
37
|
+
* limit: 10
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Create a new record
|
|
42
|
+
* const result = await wallet.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await wallet.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await wallet.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await wallet.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const wallet = useSuparismaWallet({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const wallet = useSuparismaWallet({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaWallet = createSuparismaHook<
|
|
79
|
+
WalletWithRelations,
|
|
80
|
+
WalletWithRelations,
|
|
81
|
+
WalletCreateInput,
|
|
82
|
+
WalletUpdateInput,
|
|
83
|
+
WalletWhereInput,
|
|
84
|
+
WalletWhereUniqueInput,
|
|
85
|
+
WalletOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'Wallet',
|
|
88
|
+
hasCreatedAt: true,
|
|
89
|
+
hasUpdatedAt: true,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","balance":"0","currency":"\"EGP\"","createdAt":"now("},
|
|
92
|
+
// Field name for createdAt from Prisma schema
|
|
93
|
+
createdAtField: "createdAt",
|
|
94
|
+
// Field name for updatedAt from Prisma schema
|
|
95
|
+
updatedAtField: "updatedAt"
|
|
96
|
+
}) as unknown as (options?: UseWalletOptions) => WalletHookApi;
|