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.
- package/README.md +51 -2
- package/dist/generators/coreGenerator.js +200 -15
- package/dist/generators/hookGenerator.js +20 -2
- package/dist/generators/typeGenerator.js +55 -5
- 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,94 @@
|
|
|
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
|
+
AssetWithRelations,
|
|
8
|
+
AssetCreateInput,
|
|
9
|
+
AssetUpdateInput,
|
|
10
|
+
AssetWhereInput,
|
|
11
|
+
AssetWhereUniqueInput,
|
|
12
|
+
AssetOrderByInput,
|
|
13
|
+
AssetSelectInput,
|
|
14
|
+
AssetIncludeInput,
|
|
15
|
+
AssetHookApi,
|
|
16
|
+
UseAssetOptions
|
|
17
|
+
} from '../types/AssetTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with Asset 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 Asset records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all Asset records with realtime updates
|
|
29
|
+
* const asset = useSuparismaAsset();
|
|
30
|
+
* const { data, loading, error } = asset;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const asset = useSuparismaAsset({
|
|
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 asset.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await asset.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await asset.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await asset.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const asset = useSuparismaAsset({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const asset = useSuparismaAsset({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaAsset = createSuparismaHook<
|
|
79
|
+
AssetWithRelations,
|
|
80
|
+
AssetWithRelations,
|
|
81
|
+
AssetCreateInput,
|
|
82
|
+
AssetUpdateInput,
|
|
83
|
+
AssetWhereInput,
|
|
84
|
+
AssetWhereUniqueInput,
|
|
85
|
+
AssetOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'Asset',
|
|
88
|
+
hasCreatedAt: true,
|
|
89
|
+
hasUpdatedAt: false,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","createdAt":"now("},
|
|
92
|
+
// Field name for createdAt from Prisma schema
|
|
93
|
+
createdAtField: "createdAt"
|
|
94
|
+
}) as unknown as (options?: UseAssetOptions) => AssetHookApi;
|
|
@@ -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
|
+
ChapterWithRelations,
|
|
8
|
+
ChapterCreateInput,
|
|
9
|
+
ChapterUpdateInput,
|
|
10
|
+
ChapterWhereInput,
|
|
11
|
+
ChapterWhereUniqueInput,
|
|
12
|
+
ChapterOrderByInput,
|
|
13
|
+
ChapterSelectInput,
|
|
14
|
+
ChapterIncludeInput,
|
|
15
|
+
ChapterHookApi,
|
|
16
|
+
UseChapterOptions
|
|
17
|
+
} from '../types/ChapterTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with Chapter 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 Chapter records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all Chapter records with realtime updates
|
|
29
|
+
* const chapter = useSuparismaChapter();
|
|
30
|
+
* const { data, loading, error } = chapter;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const chapter = useSuparismaChapter({
|
|
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 chapter.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await chapter.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await chapter.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await chapter.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const chapter = useSuparismaChapter({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const chapter = useSuparismaChapter({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaChapter = createSuparismaHook<
|
|
79
|
+
ChapterWithRelations,
|
|
80
|
+
ChapterWithRelations,
|
|
81
|
+
ChapterCreateInput,
|
|
82
|
+
ChapterUpdateInput,
|
|
83
|
+
ChapterWhereInput,
|
|
84
|
+
ChapterWhereUniqueInput,
|
|
85
|
+
ChapterOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'Chapter',
|
|
88
|
+
hasCreatedAt: true,
|
|
89
|
+
hasUpdatedAt: true,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","order":"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?: UseChapterOptions) => ChapterHookApi;
|
|
@@ -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
|
+
CourseWithRelations,
|
|
8
|
+
CourseCreateInput,
|
|
9
|
+
CourseUpdateInput,
|
|
10
|
+
CourseWhereInput,
|
|
11
|
+
CourseWhereUniqueInput,
|
|
12
|
+
CourseOrderByInput,
|
|
13
|
+
CourseSelectInput,
|
|
14
|
+
CourseIncludeInput,
|
|
15
|
+
CourseHookApi,
|
|
16
|
+
UseCourseOptions
|
|
17
|
+
} from '../types/CourseTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with Course 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 Course records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all Course records with realtime updates
|
|
29
|
+
* const course = useSuparismaCourse();
|
|
30
|
+
* const { data, loading, error } = course;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const course = useSuparismaCourse({
|
|
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 course.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await course.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await course.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await course.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const course = useSuparismaCourse({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const course = useSuparismaCourse({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaCourse = createSuparismaHook<
|
|
79
|
+
CourseWithRelations,
|
|
80
|
+
CourseWithRelations,
|
|
81
|
+
CourseCreateInput,
|
|
82
|
+
CourseUpdateInput,
|
|
83
|
+
CourseWhereInput,
|
|
84
|
+
CourseWhereUniqueInput,
|
|
85
|
+
CourseOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'Course',
|
|
88
|
+
hasCreatedAt: true,
|
|
89
|
+
hasUpdatedAt: true,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","published":"false","createdAt":"now(","allowIndividualLessonPurchase":"false","blockScreenRecording":"true","maxDevices":"0","price":"0","pricingType":"\"paid\"","defaultLessonPrice":"0"},
|
|
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?: UseCourseOptions) => CourseHookApi;
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
DeviceSessionWithRelations,
|
|
8
|
+
DeviceSessionCreateInput,
|
|
9
|
+
DeviceSessionUpdateInput,
|
|
10
|
+
DeviceSessionWhereInput,
|
|
11
|
+
DeviceSessionWhereUniqueInput,
|
|
12
|
+
DeviceSessionOrderByInput,
|
|
13
|
+
DeviceSessionSelectInput,
|
|
14
|
+
DeviceSessionIncludeInput,
|
|
15
|
+
DeviceSessionHookApi,
|
|
16
|
+
UseDeviceSessionOptions
|
|
17
|
+
} from '../types/DeviceSessionTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with DeviceSession 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 DeviceSession records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all DeviceSession records with realtime updates
|
|
29
|
+
* const devicesession = useSuparismaDeviceSession();
|
|
30
|
+
* const { data, loading, error } = devicesession;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const devicesession = useSuparismaDeviceSession({
|
|
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 devicesession.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await devicesession.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await devicesession.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await devicesession.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const devicesession = useSuparismaDeviceSession({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const devicesession = useSuparismaDeviceSession({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaDeviceSession = createSuparismaHook<
|
|
79
|
+
DeviceSessionWithRelations,
|
|
80
|
+
DeviceSessionWithRelations,
|
|
81
|
+
DeviceSessionCreateInput,
|
|
82
|
+
DeviceSessionUpdateInput,
|
|
83
|
+
DeviceSessionWhereInput,
|
|
84
|
+
DeviceSessionWhereUniqueInput,
|
|
85
|
+
DeviceSessionOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'DeviceSession',
|
|
88
|
+
hasCreatedAt: true,
|
|
89
|
+
hasUpdatedAt: false,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","lastActiveAt":"now(","createdAt":"now("},
|
|
92
|
+
// Field name for createdAt from Prisma schema
|
|
93
|
+
createdAtField: "createdAt"
|
|
94
|
+
}) as unknown as (options?: UseDeviceSessionOptions) => DeviceSessionHookApi;
|
|
@@ -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
|
+
EnrollmentWithRelations,
|
|
8
|
+
EnrollmentCreateInput,
|
|
9
|
+
EnrollmentUpdateInput,
|
|
10
|
+
EnrollmentWhereInput,
|
|
11
|
+
EnrollmentWhereUniqueInput,
|
|
12
|
+
EnrollmentOrderByInput,
|
|
13
|
+
EnrollmentSelectInput,
|
|
14
|
+
EnrollmentIncludeInput,
|
|
15
|
+
EnrollmentHookApi,
|
|
16
|
+
UseEnrollmentOptions
|
|
17
|
+
} from '../types/EnrollmentTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with Enrollment 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 Enrollment records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all Enrollment records with realtime updates
|
|
29
|
+
* const enrollment = useSuparismaEnrollment();
|
|
30
|
+
* const { data, loading, error } = enrollment;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const enrollment = useSuparismaEnrollment({
|
|
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 enrollment.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await enrollment.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await enrollment.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await enrollment.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const enrollment = useSuparismaEnrollment({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const enrollment = useSuparismaEnrollment({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaEnrollment = createSuparismaHook<
|
|
79
|
+
EnrollmentWithRelations,
|
|
80
|
+
EnrollmentWithRelations,
|
|
81
|
+
EnrollmentCreateInput,
|
|
82
|
+
EnrollmentUpdateInput,
|
|
83
|
+
EnrollmentWhereInput,
|
|
84
|
+
EnrollmentWhereUniqueInput,
|
|
85
|
+
EnrollmentOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'Enrollment',
|
|
88
|
+
hasCreatedAt: false,
|
|
89
|
+
hasUpdatedAt: false,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","enrolledAt":"now(","screenshotAttempts":"0","screenRecordingAttempts":"0"}
|
|
92
|
+
}) as unknown as (options?: UseEnrollmentOptions) => EnrollmentHookApi;
|
|
@@ -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
|
+
LessonWithRelations,
|
|
8
|
+
LessonCreateInput,
|
|
9
|
+
LessonUpdateInput,
|
|
10
|
+
LessonWhereInput,
|
|
11
|
+
LessonWhereUniqueInput,
|
|
12
|
+
LessonOrderByInput,
|
|
13
|
+
LessonSelectInput,
|
|
14
|
+
LessonIncludeInput,
|
|
15
|
+
LessonHookApi,
|
|
16
|
+
UseLessonOptions
|
|
17
|
+
} from '../types/LessonTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with Lesson 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 Lesson records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all Lesson records with realtime updates
|
|
29
|
+
* const lesson = useSuparismaLesson();
|
|
30
|
+
* const { data, loading, error } = lesson;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const lesson = useSuparismaLesson({
|
|
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 lesson.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await lesson.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await lesson.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await lesson.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const lesson = useSuparismaLesson({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const lesson = useSuparismaLesson({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaLesson = createSuparismaHook<
|
|
79
|
+
LessonWithRelations,
|
|
80
|
+
LessonWithRelations,
|
|
81
|
+
LessonCreateInput,
|
|
82
|
+
LessonUpdateInput,
|
|
83
|
+
LessonWhereInput,
|
|
84
|
+
LessonWhereUniqueInput,
|
|
85
|
+
LessonOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'Lesson',
|
|
88
|
+
hasCreatedAt: true,
|
|
89
|
+
hasUpdatedAt: true,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","order":"0","createdAt":"now(","isFree":"false","price":"0"},
|
|
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?: UseLessonOptions) => LessonHookApi;
|
|
@@ -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
|
+
LessonPurchaseWithRelations,
|
|
8
|
+
LessonPurchaseCreateInput,
|
|
9
|
+
LessonPurchaseUpdateInput,
|
|
10
|
+
LessonPurchaseWhereInput,
|
|
11
|
+
LessonPurchaseWhereUniqueInput,
|
|
12
|
+
LessonPurchaseOrderByInput,
|
|
13
|
+
LessonPurchaseSelectInput,
|
|
14
|
+
LessonPurchaseIncludeInput,
|
|
15
|
+
LessonPurchaseHookApi,
|
|
16
|
+
UseLessonPurchaseOptions
|
|
17
|
+
} from '../types/LessonPurchaseTypes';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A Prisma-like hook for interacting with LessonPurchase 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 LessonPurchase records
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Basic usage - get all LessonPurchase records with realtime updates
|
|
29
|
+
* const lessonpurchase = useSuparismaLessonPurchase();
|
|
30
|
+
* const { data, loading, error } = lessonpurchase;
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // With filtering and ordering
|
|
34
|
+
* const lessonpurchase = useSuparismaLessonPurchase({
|
|
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 lessonpurchase.create({
|
|
43
|
+
* name: "Example Name",
|
|
44
|
+
* // other fields...
|
|
45
|
+
* });
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* // Update a record
|
|
49
|
+
* const result = await lessonpurchase.update({
|
|
50
|
+
* where: { id: "123" },
|
|
51
|
+
* data: { name: "Updated Name" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // Delete a record
|
|
56
|
+
* const result = await lessonpurchase.delete({ id: "123" });
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Find records with specific criteria
|
|
60
|
+
* const result = await lessonpurchase.findMany({
|
|
61
|
+
* where: { // filters },
|
|
62
|
+
* orderBy: { // ordering },
|
|
63
|
+
* take: 20 // limit
|
|
64
|
+
* });
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Select specific fields only
|
|
68
|
+
* const lessonpurchase = useSuparismaLessonPurchase({
|
|
69
|
+
* select: { id: true, name: true }
|
|
70
|
+
* });
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Include related records
|
|
74
|
+
* const lessonpurchase = useSuparismaLessonPurchase({
|
|
75
|
+
* include: { relatedModel: true }
|
|
76
|
+
* });
|
|
77
|
+
*/
|
|
78
|
+
export const useSuparismaLessonPurchase = createSuparismaHook<
|
|
79
|
+
LessonPurchaseWithRelations,
|
|
80
|
+
LessonPurchaseWithRelations,
|
|
81
|
+
LessonPurchaseCreateInput,
|
|
82
|
+
LessonPurchaseUpdateInput,
|
|
83
|
+
LessonPurchaseWhereInput,
|
|
84
|
+
LessonPurchaseWhereUniqueInput,
|
|
85
|
+
LessonPurchaseOrderByInput
|
|
86
|
+
>({
|
|
87
|
+
tableName: 'LessonPurchase',
|
|
88
|
+
hasCreatedAt: false,
|
|
89
|
+
hasUpdatedAt: false,
|
|
90
|
+
// Default values from schema
|
|
91
|
+
defaultValues: {"id":"uuid(","purchasedAt":"now("}
|
|
92
|
+
}) as unknown as (options?: UseLessonPurchaseOptions) => LessonPurchaseHookApi;
|