@wecode-team/cms-supabase-api 0.1.55 → 0.2.1

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,32 @@
1
+ import type { Context } from "hono";
2
+ /**
3
+ * 前端请求格式:
4
+ * POST /ai/agent/:tableName
5
+ * Accept: text/event-stream
6
+ *
7
+ * body:
8
+ * {
9
+ * input: "用户当前输入的内容",
10
+ * model: {
11
+ * id: 1,
12
+ * name: "Comments",
13
+ * table_name: "session_prefix_comments",
14
+ * json_schema: {
15
+ * fields: [
16
+ * { name: "content", type: "text", required: true },
17
+ * { name: "rating", type: "integer" }
18
+ * ]
19
+ * }
20
+ * },
21
+ * messages: [
22
+ * { role: "user", content: "上一轮用户消息" },
23
+ * { role: "assistant", content: "上一轮助手回复" },
24
+ * { role: "user", content: "用户当前输入的内容" }
25
+ * ]
26
+ * }
27
+ *
28
+ * SSE 返回格式:
29
+ * event: start | message_delta | message_done | tool_start | tool_update | tool_done | error | done
30
+ * data: JSON.stringify(eventPayload)
31
+ */
32
+ export declare function askAiAgent(c: Context): Promise<Response>;
@@ -0,0 +1,12 @@
1
+ import type { Context } from "hono";
2
+ export declare function importDataWithAi(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">)>;
package/dist/index.d.ts CHANGED
@@ -6,14 +6,17 @@ export { getCmsModelService as CmsModel } from "./models/cms-model";
6
6
  export { DynamicTableService, getDynamicTableService, } from "./services/dynamic-table.service";
7
7
  export { AuthService, getAuthService, } from "./services/auth.service";
8
8
  export { OssUploadService, OssUploadError, initializeOssUpload, getOssUploadService, } from "./services/oss-upload.service";
9
+ export { AiAgentService, getAiAgentService, } from "./services/ai-agent";
10
+ export type { AiAgentMessage, AiAgentRequest, AiAgentResult, AiAgentStreamEmit, AiAgentStreamEvent, AiAgentToolName, } from "./services/ai-agent";
9
11
  export { getModels, createModel, updateModel, deleteModel, } from "./handlers/models";
10
12
  export { getTableData, createTableData, updateTableData, deleteTableData, getRelationOptions, getTableDataWithRelations, dropForeignKeys, } from "./handlers/data";
11
13
  export { login, signup, signupStatus, forgotPassword, resetPassword, verifyAuth, getCurrentUser, requireAuth, } from "./handlers/auth";
12
14
  export { uploadToOss, } from "./handlers/upload";
13
15
  export { getConfig, updateConfig, } from "./handlers/configs";
16
+ export { askAiAgent, } from "./handlers/ai-agent";
14
17
  export type { SchemaField, JsonSchema, CmsModelAttributes, CmsModelCreationAttributes, ApiResponse, PaginatedResponse, SupabaseConfig, DatabaseConfig, TableDataOptions, SupabaseFilter, FieldTypeMapping, RelationType, RelationConfig, RelationOption, GetRelationOptionsParams, } from "./types";
15
18
  export type { User, UserInfo, LoginRequest, ForgotPasswordRequest, ResetPasswordRequest, LoginResponse, } from "./handlers/auth";
16
- export { createCmsRoutes, createModelRoute, createDynamicDataRoute, createDynamicAuthRoute, createDataRoute, createAuthRoute, createOssUploadRoute, createConfigRoute, } from "./utils/route-helpers";
19
+ export { createCmsRoutes, createModelRoute, createDynamicDataRoute, createDynamicAuthRoute, createDataRoute, createAuthRoute, createOssUploadRoute, createConfigRoute, createAiAgentRoute, } from "./utils/route-helpers";
17
20
  export type { CmsRouteOptions, } from "./utils/route-helpers";
18
21
  export { notifyCmsCrudErrorToFeishu, reportCmsCrudErrorToFeishu, } from "./utils/feishu-alert";
19
22
  export type { OssUploadProvider, OssUploadReturnMode, OssUploadConfig, NormalizedOssUploadConfig, OssUploadInput, OssUploadResult, UploadRouteResponse, } from "./types/upload";