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,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;
@@ -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
+ WalletTransactionWithRelations,
8
+ WalletTransactionCreateInput,
9
+ WalletTransactionUpdateInput,
10
+ WalletTransactionWhereInput,
11
+ WalletTransactionWhereUniqueInput,
12
+ WalletTransactionOrderByInput,
13
+ WalletTransactionSelectInput,
14
+ WalletTransactionIncludeInput,
15
+ WalletTransactionHookApi,
16
+ UseWalletTransactionOptions
17
+ } from '../types/WalletTransactionTypes';
18
+
19
+ /**
20
+ * A Prisma-like hook for interacting with WalletTransaction 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 WalletTransaction records
26
+ *
27
+ * @example
28
+ * // Basic usage - get all WalletTransaction records with realtime updates
29
+ * const wallettransaction = useSuparismaWalletTransaction();
30
+ * const { data, loading, error } = wallettransaction;
31
+ *
32
+ * @example
33
+ * // With filtering and ordering
34
+ * const wallettransaction = useSuparismaWalletTransaction({
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 wallettransaction.create({
43
+ * name: "Example Name",
44
+ * // other fields...
45
+ * });
46
+ *
47
+ * @example
48
+ * // Update a record
49
+ * const result = await wallettransaction.update({
50
+ * where: { id: "123" },
51
+ * data: { name: "Updated Name" }
52
+ * });
53
+ *
54
+ * @example
55
+ * // Delete a record
56
+ * const result = await wallettransaction.delete({ id: "123" });
57
+ *
58
+ * @example
59
+ * // Find records with specific criteria
60
+ * const result = await wallettransaction.findMany({
61
+ * where: { // filters },
62
+ * orderBy: { // ordering },
63
+ * take: 20 // limit
64
+ * });
65
+ *
66
+ * @example
67
+ * // Select specific fields only
68
+ * const wallettransaction = useSuparismaWalletTransaction({
69
+ * select: { id: true, name: true }
70
+ * });
71
+ *
72
+ * @example
73
+ * // Include related records
74
+ * const wallettransaction = useSuparismaWalletTransaction({
75
+ * include: { relatedModel: true }
76
+ * });
77
+ */
78
+ export const useSuparismaWalletTransaction = createSuparismaHook<
79
+ WalletTransactionWithRelations,
80
+ WalletTransactionWithRelations,
81
+ WalletTransactionCreateInput,
82
+ WalletTransactionUpdateInput,
83
+ WalletTransactionWhereInput,
84
+ WalletTransactionWhereUniqueInput,
85
+ WalletTransactionOrderByInput
86
+ >({
87
+ tableName: 'WalletTransaction',
88
+ hasCreatedAt: true,
89
+ hasUpdatedAt: true,
90
+ // Default values from schema
91
+ defaultValues: {"id":"uuid(","status":"\"pending\"","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?: UseWalletTransactionOptions) => WalletTransactionHookApi;
@@ -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
+ WatchProgressWithRelations,
8
+ WatchProgressCreateInput,
9
+ WatchProgressUpdateInput,
10
+ WatchProgressWhereInput,
11
+ WatchProgressWhereUniqueInput,
12
+ WatchProgressOrderByInput,
13
+ WatchProgressSelectInput,
14
+ WatchProgressIncludeInput,
15
+ WatchProgressHookApi,
16
+ UseWatchProgressOptions
17
+ } from '../types/WatchProgressTypes';
18
+
19
+ /**
20
+ * A Prisma-like hook for interacting with WatchProgress 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 WatchProgress records
26
+ *
27
+ * @example
28
+ * // Basic usage - get all WatchProgress records with realtime updates
29
+ * const watchprogress = useSuparismaWatchProgress();
30
+ * const { data, loading, error } = watchprogress;
31
+ *
32
+ * @example
33
+ * // With filtering and ordering
34
+ * const watchprogress = useSuparismaWatchProgress({
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 watchprogress.create({
43
+ * name: "Example Name",
44
+ * // other fields...
45
+ * });
46
+ *
47
+ * @example
48
+ * // Update a record
49
+ * const result = await watchprogress.update({
50
+ * where: { id: "123" },
51
+ * data: { name: "Updated Name" }
52
+ * });
53
+ *
54
+ * @example
55
+ * // Delete a record
56
+ * const result = await watchprogress.delete({ id: "123" });
57
+ *
58
+ * @example
59
+ * // Find records with specific criteria
60
+ * const result = await watchprogress.findMany({
61
+ * where: { // filters },
62
+ * orderBy: { // ordering },
63
+ * take: 20 // limit
64
+ * });
65
+ *
66
+ * @example
67
+ * // Select specific fields only
68
+ * const watchprogress = useSuparismaWatchProgress({
69
+ * select: { id: true, name: true }
70
+ * });
71
+ *
72
+ * @example
73
+ * // Include related records
74
+ * const watchprogress = useSuparismaWatchProgress({
75
+ * include: { relatedModel: true }
76
+ * });
77
+ */
78
+ export const useSuparismaWatchProgress = createSuparismaHook<
79
+ WatchProgressWithRelations,
80
+ WatchProgressWithRelations,
81
+ WatchProgressCreateInput,
82
+ WatchProgressUpdateInput,
83
+ WatchProgressWhereInput,
84
+ WatchProgressWhereUniqueInput,
85
+ WatchProgressOrderByInput
86
+ >({
87
+ tableName: 'WatchProgress',
88
+ hasCreatedAt: true,
89
+ hasUpdatedAt: true,
90
+ // Default values from schema
91
+ defaultValues: {"id":"uuid(","watchedSeconds":"0","lastPosition":"0","completed":"false","lastWatchedAt":"now(","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?: UseWatchProgressOptions) => WatchProgressHookApi;
@@ -0,0 +1,140 @@
1
+ // THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
2
+ // Edit the generator script instead: scripts/generate-realtime-hooks.ts
3
+
4
+ import { useSuparismaUser } from './hooks/useSuparismaUser';
5
+ import { useSuparismaTeacherPayoutInfo } from './hooks/useSuparismaTeacherPayoutInfo';
6
+ import { useSuparismaPayoutMethod } from './hooks/useSuparismaPayoutMethod';
7
+ import { useSuparismaCourse } from './hooks/useSuparismaCourse';
8
+ import { useSuparismaChapter } from './hooks/useSuparismaChapter';
9
+ import { useSuparismaLesson } from './hooks/useSuparismaLesson';
10
+ import { useSuparismaLessonQuestion } from './hooks/useSuparismaLessonQuestion';
11
+ import { useSuparismaQuestionOption } from './hooks/useSuparismaQuestionOption';
12
+ import { useSuparismaEnrollment } from './hooks/useSuparismaEnrollment';
13
+ import { useSuparismaLessonPurchase } from './hooks/useSuparismaLessonPurchase';
14
+ import { useSuparismaWatchProgress } from './hooks/useSuparismaWatchProgress';
15
+ import { useSuparismaAsset } from './hooks/useSuparismaAsset';
16
+ import { useSuparismaVideoNote } from './hooks/useSuparismaVideoNote';
17
+ import { useSuparismaDeviceSession } from './hooks/useSuparismaDeviceSession';
18
+ import { useSuparismaThing } from './hooks/useSuparismaThing';
19
+ import { useSuparismaWallet } from './hooks/useSuparismaWallet';
20
+ import { useSuparismaSavedPaymentMethod } from './hooks/useSuparismaSavedPaymentMethod';
21
+ import { useSuparismaWalletTransaction } from './hooks/useSuparismaWalletTransaction';
22
+ import { useSuparismaPayoutRequest } from './hooks/useSuparismaPayoutRequest';
23
+ import type { UseUserOptions, UserHookApi } from './types/UserTypes';
24
+ import type { UseTeacherPayoutInfoOptions, TeacherPayoutInfoHookApi } from './types/TeacherPayoutInfoTypes';
25
+ import type { UsePayoutMethodOptions, PayoutMethodHookApi } from './types/PayoutMethodTypes';
26
+ import type { UseCourseOptions, CourseHookApi } from './types/CourseTypes';
27
+ import type { UseChapterOptions, ChapterHookApi } from './types/ChapterTypes';
28
+ import type { UseLessonOptions, LessonHookApi } from './types/LessonTypes';
29
+ import type { UseLessonQuestionOptions, LessonQuestionHookApi } from './types/LessonQuestionTypes';
30
+ import type { UseQuestionOptionOptions, QuestionOptionHookApi } from './types/QuestionOptionTypes';
31
+ import type { UseEnrollmentOptions, EnrollmentHookApi } from './types/EnrollmentTypes';
32
+ import type { UseLessonPurchaseOptions, LessonPurchaseHookApi } from './types/LessonPurchaseTypes';
33
+ import type { UseWatchProgressOptions, WatchProgressHookApi } from './types/WatchProgressTypes';
34
+ import type { UseAssetOptions, AssetHookApi } from './types/AssetTypes';
35
+ import type { UseVideoNoteOptions, VideoNoteHookApi } from './types/VideoNoteTypes';
36
+ import type { UseDeviceSessionOptions, DeviceSessionHookApi } from './types/DeviceSessionTypes';
37
+ import type { UseThingOptions, ThingHookApi } from './types/ThingTypes';
38
+ import type { UseWalletOptions, WalletHookApi } from './types/WalletTypes';
39
+ import type { UseSavedPaymentMethodOptions, SavedPaymentMethodHookApi } from './types/SavedPaymentMethodTypes';
40
+ import type { UseWalletTransactionOptions, WalletTransactionHookApi } from './types/WalletTransactionTypes';
41
+ import type { UsePayoutRequestOptions, PayoutRequestHookApi } from './types/PayoutRequestTypes';
42
+ export type { SuparismaOptions, SearchQuery, SearchState, FilterOperators } from './utils/core';
43
+ export type { UserWithRelations, UserCreateInput, UserUpdateInput, UserWhereInput, UserWhereUniqueInput, UserOrderByInput, UserHookApi, UseUserOptions } from './types/UserTypes';
44
+ export type { TeacherPayoutInfoWithRelations, TeacherPayoutInfoCreateInput, TeacherPayoutInfoUpdateInput, TeacherPayoutInfoWhereInput, TeacherPayoutInfoWhereUniqueInput, TeacherPayoutInfoOrderByInput, TeacherPayoutInfoHookApi, UseTeacherPayoutInfoOptions } from './types/TeacherPayoutInfoTypes';
45
+ export type { PayoutMethodWithRelations, PayoutMethodCreateInput, PayoutMethodUpdateInput, PayoutMethodWhereInput, PayoutMethodWhereUniqueInput, PayoutMethodOrderByInput, PayoutMethodHookApi, UsePayoutMethodOptions } from './types/PayoutMethodTypes';
46
+ export type { CourseWithRelations, CourseCreateInput, CourseUpdateInput, CourseWhereInput, CourseWhereUniqueInput, CourseOrderByInput, CourseHookApi, UseCourseOptions } from './types/CourseTypes';
47
+ export type { ChapterWithRelations, ChapterCreateInput, ChapterUpdateInput, ChapterWhereInput, ChapterWhereUniqueInput, ChapterOrderByInput, ChapterHookApi, UseChapterOptions } from './types/ChapterTypes';
48
+ export type { LessonWithRelations, LessonCreateInput, LessonUpdateInput, LessonWhereInput, LessonWhereUniqueInput, LessonOrderByInput, LessonHookApi, UseLessonOptions } from './types/LessonTypes';
49
+ export type { LessonQuestionWithRelations, LessonQuestionCreateInput, LessonQuestionUpdateInput, LessonQuestionWhereInput, LessonQuestionWhereUniqueInput, LessonQuestionOrderByInput, LessonQuestionHookApi, UseLessonQuestionOptions } from './types/LessonQuestionTypes';
50
+ export type { QuestionOptionWithRelations, QuestionOptionCreateInput, QuestionOptionUpdateInput, QuestionOptionWhereInput, QuestionOptionWhereUniqueInput, QuestionOptionOrderByInput, QuestionOptionHookApi, UseQuestionOptionOptions } from './types/QuestionOptionTypes';
51
+ export type { EnrollmentWithRelations, EnrollmentCreateInput, EnrollmentUpdateInput, EnrollmentWhereInput, EnrollmentWhereUniqueInput, EnrollmentOrderByInput, EnrollmentHookApi, UseEnrollmentOptions } from './types/EnrollmentTypes';
52
+ export type { LessonPurchaseWithRelations, LessonPurchaseCreateInput, LessonPurchaseUpdateInput, LessonPurchaseWhereInput, LessonPurchaseWhereUniqueInput, LessonPurchaseOrderByInput, LessonPurchaseHookApi, UseLessonPurchaseOptions } from './types/LessonPurchaseTypes';
53
+ export type { WatchProgressWithRelations, WatchProgressCreateInput, WatchProgressUpdateInput, WatchProgressWhereInput, WatchProgressWhereUniqueInput, WatchProgressOrderByInput, WatchProgressHookApi, UseWatchProgressOptions } from './types/WatchProgressTypes';
54
+ export type { AssetWithRelations, AssetCreateInput, AssetUpdateInput, AssetWhereInput, AssetWhereUniqueInput, AssetOrderByInput, AssetHookApi, UseAssetOptions } from './types/AssetTypes';
55
+ export type { VideoNoteWithRelations, VideoNoteCreateInput, VideoNoteUpdateInput, VideoNoteWhereInput, VideoNoteWhereUniqueInput, VideoNoteOrderByInput, VideoNoteHookApi, UseVideoNoteOptions } from './types/VideoNoteTypes';
56
+ export type { DeviceSessionWithRelations, DeviceSessionCreateInput, DeviceSessionUpdateInput, DeviceSessionWhereInput, DeviceSessionWhereUniqueInput, DeviceSessionOrderByInput, DeviceSessionHookApi, UseDeviceSessionOptions } from './types/DeviceSessionTypes';
57
+ export type { ThingWithRelations, ThingCreateInput, ThingUpdateInput, ThingWhereInput, ThingWhereUniqueInput, ThingOrderByInput, ThingHookApi, UseThingOptions } from './types/ThingTypes';
58
+ export type { WalletWithRelations, WalletCreateInput, WalletUpdateInput, WalletWhereInput, WalletWhereUniqueInput, WalletOrderByInput, WalletHookApi, UseWalletOptions } from './types/WalletTypes';
59
+ export type { SavedPaymentMethodWithRelations, SavedPaymentMethodCreateInput, SavedPaymentMethodUpdateInput, SavedPaymentMethodWhereInput, SavedPaymentMethodWhereUniqueInput, SavedPaymentMethodOrderByInput, SavedPaymentMethodHookApi, UseSavedPaymentMethodOptions } from './types/SavedPaymentMethodTypes';
60
+ export type { WalletTransactionWithRelations, WalletTransactionCreateInput, WalletTransactionUpdateInput, WalletTransactionWhereInput, WalletTransactionWhereUniqueInput, WalletTransactionOrderByInput, WalletTransactionHookApi, UseWalletTransactionOptions } from './types/WalletTransactionTypes';
61
+ export type { PayoutRequestWithRelations, PayoutRequestCreateInput, PayoutRequestUpdateInput, PayoutRequestWhereInput, PayoutRequestWhereUniqueInput, PayoutRequestOrderByInput, PayoutRequestHookApi, UsePayoutRequestOptions } from './types/PayoutRequestTypes';
62
+
63
+ /**
64
+ * Interface for all Suparisma hooks with dot notation access.
65
+ * This provides IntelliSense for all available models.
66
+ *
67
+ * @example
68
+ * // Access hooks for different models
69
+ * const users = useSuparisma.user();
70
+ * const posts = useSuparisma.post();
71
+ */
72
+ export interface SuparismaHooks {
73
+ user: (options?: UseUserOptions) => UserHookApi;
74
+ teacherPayoutInfo: (options?: UseTeacherPayoutInfoOptions) => TeacherPayoutInfoHookApi;
75
+ payoutMethod: (options?: UsePayoutMethodOptions) => PayoutMethodHookApi;
76
+ course: (options?: UseCourseOptions) => CourseHookApi;
77
+ chapter: (options?: UseChapterOptions) => ChapterHookApi;
78
+ lesson: (options?: UseLessonOptions) => LessonHookApi;
79
+ lessonQuestion: (options?: UseLessonQuestionOptions) => LessonQuestionHookApi;
80
+ questionOption: (options?: UseQuestionOptionOptions) => QuestionOptionHookApi;
81
+ enrollment: (options?: UseEnrollmentOptions) => EnrollmentHookApi;
82
+ lessonPurchase: (options?: UseLessonPurchaseOptions) => LessonPurchaseHookApi;
83
+ watchProgress: (options?: UseWatchProgressOptions) => WatchProgressHookApi;
84
+ asset: (options?: UseAssetOptions) => AssetHookApi;
85
+ videoNote: (options?: UseVideoNoteOptions) => VideoNoteHookApi;
86
+ deviceSession: (options?: UseDeviceSessionOptions) => DeviceSessionHookApi;
87
+ thing: (options?: UseThingOptions) => ThingHookApi;
88
+ wallet: (options?: UseWalletOptions) => WalletHookApi;
89
+ savedPaymentMethod: (options?: UseSavedPaymentMethodOptions) => SavedPaymentMethodHookApi;
90
+ walletTransaction: (options?: UseWalletTransactionOptions) => WalletTransactionHookApi;
91
+ payoutRequest: (options?: UsePayoutRequestOptions) => PayoutRequestHookApi;
92
+ }
93
+
94
+ /**
95
+ * Main Suparisma hook object with dot notation access to all model hooks.
96
+ *
97
+ * @example
98
+ * // Get hooks for different models
99
+ * import useSuparisma from './your-output-dir'; // e.g., from './suparisma/generated'
100
+ *
101
+ * // Access user model with all hook methods
102
+ * const users = useSuparisma.user();
103
+ * const { data, loading, error } = users;
104
+ *
105
+ * // Create a new record
106
+ * await users.create({ name: "John" });
107
+ *
108
+ * // Delete a record
109
+ * await users.delete({ id: "123" });
110
+ *
111
+ * @example
112
+ * // Use with filtering and options
113
+ * const admins = useSuparisma.user({
114
+ * where: { role: 'admin' },
115
+ * orderBy: { created_at: 'desc' }
116
+ * });
117
+ */
118
+ const useSuparisma: SuparismaHooks = {
119
+ user: useSuparismaUser,
120
+ teacherPayoutInfo: useSuparismaTeacherPayoutInfo,
121
+ payoutMethod: useSuparismaPayoutMethod,
122
+ course: useSuparismaCourse,
123
+ chapter: useSuparismaChapter,
124
+ lesson: useSuparismaLesson,
125
+ lessonQuestion: useSuparismaLessonQuestion,
126
+ questionOption: useSuparismaQuestionOption,
127
+ enrollment: useSuparismaEnrollment,
128
+ lessonPurchase: useSuparismaLessonPurchase,
129
+ watchProgress: useSuparismaWatchProgress,
130
+ asset: useSuparismaAsset,
131
+ videoNote: useSuparismaVideoNote,
132
+ deviceSession: useSuparismaDeviceSession,
133
+ thing: useSuparismaThing,
134
+ wallet: useSuparismaWallet,
135
+ savedPaymentMethod: useSuparismaSavedPaymentMethod,
136
+ walletTransaction: useSuparismaWalletTransaction,
137
+ payoutRequest: useSuparismaPayoutRequest,
138
+ };
139
+
140
+ export default useSuparisma;