suparisma 0.0.3 → 1.0.0
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 +708 -72
- package/dist/generators/coreGenerator.js +1 -1
- package/dist/index.js +0 -0
- package/generated/hooks/useSuparismaAuditLog.ts +80 -0
- package/generated/hooks/useSuparismaThing.ts +82 -0
- package/generated/index.ts +55 -0
- package/generated/types/AuditLogTypes.ts +391 -0
- package/generated/types/ThingTypes.ts +394 -0
- package/generated/utils/core.ts +1490 -0
- package/generated/utils/supabase-client.ts +10 -0
- package/package.json +8 -1
- package/dist/generated/supabase-client-generated.js +0 -7
- package/dist/hooks/generated/UserTypes.js +0 -2
- package/dist/hooks/generated/core.js +0 -1089
- package/dist/hooks/generated/index.js +0 -33
- package/dist/hooks/generated/useSuparismaUser.js +0 -60
- package/dist/suparisma/generated/hooks/useSuparismaUser.js +0 -61
- package/dist/suparisma/generated/index.js +0 -33
- package/dist/suparisma/generated/types/UserTypes.js +0 -4
- package/dist/suparisma/generated/utils/core.js +0 -1090
- package/dist/suparisma/generated/utils/supabase-client.js +0 -8
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
3
|
-
// Edit the generator script instead: scripts/generate-realtime-hooks.ts
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
const useSuparismaUser_1 = require("./useSuparismaUser");
|
|
6
|
-
/**
|
|
7
|
-
* Main Suparisma hook object with dot notation access to all model hooks.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* // Get hooks for different models
|
|
11
|
-
* import useSuparisma from './hooks/generated';
|
|
12
|
-
*
|
|
13
|
-
* // Access user model with all hook methods
|
|
14
|
-
* const users = useSuparisma.user();
|
|
15
|
-
* const { data, loading, error } = users;
|
|
16
|
-
*
|
|
17
|
-
* // Create a new record
|
|
18
|
-
* await users.create({ name: "John" });
|
|
19
|
-
*
|
|
20
|
-
* // Delete a record
|
|
21
|
-
* await users.delete({ id: "123" });
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* // Use with filtering and options
|
|
25
|
-
* const admins = useSuparisma.user({
|
|
26
|
-
* where: { role: 'admin' },
|
|
27
|
-
* orderBy: { created_at: 'desc' }
|
|
28
|
-
* });
|
|
29
|
-
*/
|
|
30
|
-
const useSuparisma = {
|
|
31
|
-
user: useSuparismaUser_1.useSuparismaUser,
|
|
32
|
-
};
|
|
33
|
-
exports.default = useSuparisma;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
3
|
-
// Edit the generator script instead: scripts/generate-realtime-hooks.ts
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.useSuparismaUser = void 0;
|
|
6
|
-
const core_1 = require("./core");
|
|
7
|
-
/**
|
|
8
|
-
* A Prisma-like hook for interacting with User records with real-time capabilities.
|
|
9
|
-
*
|
|
10
|
-
* This hook provides CRUD operations, real-time updates, and search functionality.
|
|
11
|
-
*
|
|
12
|
-
* @param options - Optional configuration options for the hook
|
|
13
|
-
* @returns An object with data state and methods for interacting with User records
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* // Basic usage - get all User records with realtime updates
|
|
17
|
-
* const user = useSuparismaUser();
|
|
18
|
-
* const { data, loading, error } = user;
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* // With filtering and ordering
|
|
22
|
-
* const user = useSuparismaUser({
|
|
23
|
-
* where: { active: true },
|
|
24
|
-
* orderBy: { created_at: 'desc' },
|
|
25
|
-
* limit: 10
|
|
26
|
-
* });
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* // Create a new record
|
|
30
|
-
* const result = await user.create({
|
|
31
|
-
* name: "Example Name",
|
|
32
|
-
* // other fields...
|
|
33
|
-
* });
|
|
34
|
-
*
|
|
35
|
-
* @example
|
|
36
|
-
* // Update a record
|
|
37
|
-
* const result = await user.update({
|
|
38
|
-
* where: { id: "123" },
|
|
39
|
-
* data: { name: "Updated Name" }
|
|
40
|
-
* });
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* // Delete a record
|
|
44
|
-
* const result = await user.delete({ id: "123" });
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* // Find records with specific criteria
|
|
48
|
-
* const result = await user.findMany({
|
|
49
|
-
* where: { // filters },
|
|
50
|
-
* orderBy: { // ordering },
|
|
51
|
-
* take: 20 // limit
|
|
52
|
-
* });
|
|
53
|
-
*/
|
|
54
|
-
exports.useSuparismaUser = (0, core_1.createSuparismaHook)({
|
|
55
|
-
tableName: 'User',
|
|
56
|
-
hasCreatedAt: true,
|
|
57
|
-
hasUpdatedAt: true,
|
|
58
|
-
// Default values from schema
|
|
59
|
-
defaultValues: { "id": "uuid(", "createdAt": "now(" }
|
|
60
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
3
|
-
// Edit the generator script instead: scripts/generate-realtime-hooks.ts
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.useSuparismaUser = void 0;
|
|
6
|
-
// Corrected import for core hook factory
|
|
7
|
-
const core_1 = require("../utils/core");
|
|
8
|
-
/**
|
|
9
|
-
* A Prisma-like hook for interacting with User records with real-time capabilities.
|
|
10
|
-
*
|
|
11
|
-
* This hook provides CRUD operations, real-time updates, and search functionality.
|
|
12
|
-
*
|
|
13
|
-
* @param options - Optional configuration options for the hook
|
|
14
|
-
* @returns An object with data state and methods for interacting with User records
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* // Basic usage - get all User records with realtime updates
|
|
18
|
-
* const user = useSuparismaUser();
|
|
19
|
-
* const { data, loading, error } = user;
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* // With filtering and ordering
|
|
23
|
-
* const user = useSuparismaUser({
|
|
24
|
-
* where: { active: true },
|
|
25
|
-
* orderBy: { created_at: 'desc' },
|
|
26
|
-
* limit: 10
|
|
27
|
-
* });
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* // Create a new record
|
|
31
|
-
* const result = await user.create({
|
|
32
|
-
* name: "Example Name",
|
|
33
|
-
* // other fields...
|
|
34
|
-
* });
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* // Update a record
|
|
38
|
-
* const result = await user.update({
|
|
39
|
-
* where: { id: "123" },
|
|
40
|
-
* data: { name: "Updated Name" }
|
|
41
|
-
* });
|
|
42
|
-
*
|
|
43
|
-
* @example
|
|
44
|
-
* // Delete a record
|
|
45
|
-
* const result = await user.delete({ id: "123" });
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* // Find records with specific criteria
|
|
49
|
-
* const result = await user.findMany({
|
|
50
|
-
* where: { // filters },
|
|
51
|
-
* orderBy: { // ordering },
|
|
52
|
-
* take: 20 // limit
|
|
53
|
-
* });
|
|
54
|
-
*/
|
|
55
|
-
exports.useSuparismaUser = (0, core_1.createSuparismaHook)({
|
|
56
|
-
tableName: 'User',
|
|
57
|
-
hasCreatedAt: true,
|
|
58
|
-
hasUpdatedAt: true,
|
|
59
|
-
// Default values from schema
|
|
60
|
-
defaultValues: { "id": "uuid(", "createdAt": "now(" }
|
|
61
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
3
|
-
// Edit the generator script instead: scripts/generate-realtime-hooks.ts
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
const useSuparismaUser_1 = require("./hooks/useSuparismaUser");
|
|
6
|
-
/**
|
|
7
|
-
* Main Suparisma hook object with dot notation access to all model hooks.
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* // Get hooks for different models
|
|
11
|
-
* import useSuparisma from './your-output-dir'; // e.g., from './suparisma/generated'
|
|
12
|
-
*
|
|
13
|
-
* // Access user model with all hook methods
|
|
14
|
-
* const users = useSuparisma.user();
|
|
15
|
-
* const { data, loading, error } = users;
|
|
16
|
-
*
|
|
17
|
-
* // Create a new record
|
|
18
|
-
* await users.create({ name: "John" });
|
|
19
|
-
*
|
|
20
|
-
* // Delete a record
|
|
21
|
-
* await users.delete({ id: "123" });
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* // Use with filtering and options
|
|
25
|
-
* const admins = useSuparisma.user({
|
|
26
|
-
* where: { role: 'admin' },
|
|
27
|
-
* orderBy: { created_at: 'desc' }
|
|
28
|
-
* });
|
|
29
|
-
*/
|
|
30
|
-
const useSuparisma = {
|
|
31
|
-
user: useSuparismaUser_1.useSuparismaUser,
|
|
32
|
-
};
|
|
33
|
-
exports.default = useSuparisma;
|