@wecode-team/cms-supabase-api 0.1.29

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.
@@ -0,0 +1,66 @@
1
+ import { Context } from "hono";
2
+ export type { User, UserInfo } from "../services/auth.service";
3
+ export interface LoginRequest {
4
+ username: string;
5
+ password: string;
6
+ }
7
+ export interface LoginResponse {
8
+ token: string;
9
+ user: {
10
+ id: string;
11
+ username: string;
12
+ role: string;
13
+ session_id?: string;
14
+ };
15
+ }
16
+ export declare function login(c: Context, tableName: string): Promise<(Response & import("hono").TypedResponse<{
17
+ success: boolean;
18
+ message?: string | undefined;
19
+ data?: any;
20
+ error?: string | undefined;
21
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
22
+ success: boolean;
23
+ message?: string | undefined;
24
+ data?: any;
25
+ error?: string | undefined;
26
+ }, 500, "json">)>;
27
+ export declare function signupStatus(c: Context, tableName: string): Promise<(Response & import("hono").TypedResponse<{
28
+ success: boolean;
29
+ message?: string | undefined;
30
+ data?: any;
31
+ error?: string | undefined;
32
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
33
+ success: boolean;
34
+ message?: string | undefined;
35
+ data?: any;
36
+ error?: string | undefined;
37
+ }, 500, "json">)>;
38
+ export declare function signup(c: Context, tableName: string): Promise<(Response & import("hono").TypedResponse<{
39
+ success: boolean;
40
+ message?: string | undefined;
41
+ data?: any;
42
+ error?: string | undefined;
43
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
44
+ success: boolean;
45
+ message?: string | undefined;
46
+ data?: any;
47
+ error?: string | undefined;
48
+ }, 500, "json">)>;
49
+ export declare function verifyAuth(c: Context, tableName: string): Promise<Response & import("hono").TypedResponse<{
50
+ success: boolean;
51
+ message?: string | undefined;
52
+ data?: any;
53
+ error?: string | undefined;
54
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
55
+ export declare function getCurrentUser(c: Context, tableName: string): Promise<(Response & import("hono").TypedResponse<{
56
+ success: boolean;
57
+ message?: string | undefined;
58
+ data?: any;
59
+ error?: string | undefined;
60
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
61
+ success: boolean;
62
+ message?: string | undefined;
63
+ data?: any;
64
+ error?: string | undefined;
65
+ }, 500, "json">)>;
66
+ export declare function requireAuth(handler: (c: Context, ...args: any[]) => Promise<Response>): (c: Context, ...args: any[]) => Promise<Response>;
@@ -0,0 +1,68 @@
1
+ import { Context } from "hono";
2
+ export declare function getTableData(c: Context, tableName: string): Promise<(Response & import("hono").TypedResponse<{
3
+ success: boolean;
4
+ message?: string | undefined;
5
+ data?: any;
6
+ error?: string | undefined;
7
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
8
+ success: boolean;
9
+ message?: string | undefined;
10
+ data?: any;
11
+ error?: string | undefined;
12
+ }, 500, "json">)>;
13
+ export declare function createTableData(c: Context, tableName: string): Promise<(Response & import("hono").TypedResponse<{
14
+ success: boolean;
15
+ message?: string | undefined;
16
+ data?: any;
17
+ error?: string | undefined;
18
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
19
+ success: boolean;
20
+ message?: string | undefined;
21
+ data?: any;
22
+ error?: string | undefined;
23
+ }, 500, "json">)>;
24
+ export declare function updateTableData(c: Context, tableName: string): Promise<Response & import("hono").TypedResponse<{
25
+ success: boolean;
26
+ message?: string | undefined;
27
+ data?: any;
28
+ error?: string | undefined;
29
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
30
+ export declare function deleteTableData(c: Context, tableName: string): Promise<Response & import("hono").TypedResponse<{
31
+ success: boolean;
32
+ message?: string | undefined;
33
+ data?: any;
34
+ error?: string | undefined;
35
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
36
+ export declare function getRelationOptions(c: Context, tableName: string): Promise<(Response & import("hono").TypedResponse<{
37
+ success: boolean;
38
+ message?: string | undefined;
39
+ data?: any;
40
+ error?: string | undefined;
41
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
42
+ success: boolean;
43
+ message?: string | undefined;
44
+ data?: any;
45
+ error?: string | undefined;
46
+ }, 500, "json">)>;
47
+ export declare function getTableDataWithRelations(c: Context, tableName: string): Promise<(Response & import("hono").TypedResponse<{
48
+ success: boolean;
49
+ message?: string | undefined;
50
+ data?: any;
51
+ error?: string | undefined;
52
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
53
+ success: boolean;
54
+ message?: string | undefined;
55
+ data?: any;
56
+ error?: string | undefined;
57
+ }, 500, "json">)>;
58
+ export declare function dropForeignKeys(c: Context, tableName: string): Promise<(Response & import("hono").TypedResponse<{
59
+ success: boolean;
60
+ message?: string | undefined;
61
+ data?: any;
62
+ error?: string | undefined;
63
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
64
+ success: boolean;
65
+ message?: string | undefined;
66
+ data?: any;
67
+ error?: string | undefined;
68
+ }, 500, "json">)>;
@@ -0,0 +1,30 @@
1
+ import { Context } from "hono";
2
+ export declare function getModels(c: Context): Promise<(Response & import("hono").TypedResponse<{
3
+ success: boolean;
4
+ message?: string | undefined;
5
+ data?: any;
6
+ error?: string | undefined;
7
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
8
+ success: boolean;
9
+ message?: string | undefined;
10
+ data?: any;
11
+ error?: string | undefined;
12
+ }, 500, "json">)>;
13
+ export declare function createModel(c: Context): Promise<Response & import("hono").TypedResponse<{
14
+ success: boolean;
15
+ message?: string | undefined;
16
+ data?: any;
17
+ error?: string | undefined;
18
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
19
+ export declare function updateModel(c: Context): Promise<Response & import("hono").TypedResponse<{
20
+ success: boolean;
21
+ message?: string | undefined;
22
+ data?: any;
23
+ error?: string | undefined;
24
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
25
+ export declare function deleteModel(c: Context): Promise<Response & import("hono").TypedResponse<{
26
+ success: boolean;
27
+ message?: string | undefined;
28
+ data?: any;
29
+ error?: string | undefined;
30
+ }, import("hono/utils/http-status").ContentfulStatusCode, "json">>;
@@ -0,0 +1,34 @@
1
+ import { Context } from "hono";
2
+ export declare function supabaseLogin(c: Context): Promise<(Response & import("hono").TypedResponse<{
3
+ success: boolean;
4
+ message?: string | undefined;
5
+ data?: any;
6
+ error?: string | undefined;
7
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
8
+ success: boolean;
9
+ message?: string | undefined;
10
+ data?: any;
11
+ error?: string | undefined;
12
+ }, 500, "json">)>;
13
+ export declare function supabaseVerify(c: Context): Promise<(Response & import("hono").TypedResponse<{
14
+ success: boolean;
15
+ message?: string | undefined;
16
+ data?: any;
17
+ error?: string | undefined;
18
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
19
+ success: boolean;
20
+ message?: string | undefined;
21
+ data?: any;
22
+ error?: string | undefined;
23
+ }, 500, "json">)>;
24
+ export declare function supabaseCurrentUser(c: Context): Promise<(Response & import("hono").TypedResponse<{
25
+ success: boolean;
26
+ message?: string | undefined;
27
+ data?: any;
28
+ error?: string | undefined;
29
+ }, 200, "json">) | (Response & import("hono").TypedResponse<{
30
+ success: boolean;
31
+ message?: string | undefined;
32
+ data?: any;
33
+ error?: string | undefined;
34
+ }, 500, "json">)>;
@@ -0,0 +1,11 @@
1
+ export { initializeSupabase, getSupabase, testConnection, initializeCmsSystem, executeSupabaseSetup, getSupabaseSetupSQL, closeSupabase, initializeSupabase as initializeDatabase, getSupabase as getDatabase, initializeCmsSystem as syncDatabase, closeSupabase as closeDatabase, } from "./config/database";
2
+ export { default as CmsModelService, getCmsModelService, initializeCmsModel, } from "./models/cms-model";
3
+ export { getCmsModelService as CmsModel } from "./models/cms-model";
4
+ export { DynamicTableService, getDynamicTableService, } from "./services/dynamic-table.service";
5
+ export { AuthService, getAuthService, } from "./services/auth.service";
6
+ export { getModels, createModel, updateModel, deleteModel, } from "./handlers/models";
7
+ export { getTableData, createTableData, updateTableData, deleteTableData, getRelationOptions, getTableDataWithRelations, dropForeignKeys, } from "./handlers/data";
8
+ export { login, signup, signupStatus, verifyAuth, getCurrentUser, requireAuth, } from "./handlers/auth";
9
+ export type { SchemaField, JsonSchema, CmsModelAttributes, CmsModelCreationAttributes, ApiResponse, PaginatedResponse, SupabaseConfig, DatabaseConfig, TableDataOptions, SupabaseFilter, FieldTypeMapping, RelationType, RelationConfig, RelationOption, GetRelationOptionsParams, } from "./types";
10
+ export type { User, UserInfo, LoginRequest, LoginResponse, } from "./handlers/auth";
11
+ export { createCmsRoutes, createModelRoute, createDynamicDataRoute, createDynamicAuthRoute, createDataRoute, createAuthRoute, } from "./utils/route-helpers";