generated from template/apps-template
temp
This commit is contained in:
21
agents/noco/callback/index.ts
Normal file
21
agents/noco/callback/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
export type BaseNocoItem<T = {}> = {
|
||||
Id: number,
|
||||
CreatedAt: string
|
||||
UpdatedAt: string
|
||||
} & T;
|
||||
export type NocoWehookPayload<NocoItem = {}> = {
|
||||
/** 请求id */
|
||||
id: string;
|
||||
type: "records.after.trigger";
|
||||
/**
|
||||
* 多维表base id
|
||||
**/
|
||||
base_id: string;
|
||||
version: "v3",
|
||||
data: {
|
||||
table_id: string;
|
||||
table_name: string;
|
||||
rows: BaseNocoItem<NocoItem>[];
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ import { CreateColumnData } from "@kevisual/noco"
|
||||
export const columns: CreateColumnData[] = [
|
||||
{
|
||||
title: 'Id',
|
||||
// @ts-ignore
|
||||
uidt: "ID",
|
||||
pk: true,
|
||||
pv: true,
|
||||
@@ -10,7 +11,7 @@ export const columns: CreateColumnData[] = [
|
||||
|
||||
title: '标题',
|
||||
uidt: 'SingleLineText',
|
||||
description: '简单的标题',
|
||||
description: '简单的标题, 最简单的介绍',
|
||||
},
|
||||
{
|
||||
title: '标签',
|
||||
@@ -115,4 +116,22 @@ export const columns: CreateColumnData[] = [
|
||||
title: '提示词',
|
||||
uidt: 'LongText',
|
||||
description: '和AI交互时候简单的实时提示词',
|
||||
}]
|
||||
}]
|
||||
|
||||
|
||||
export type ColumnItem<T = {}> = {
|
||||
'Id': number,
|
||||
'CreatedAt': string,
|
||||
'UpdatedAt': string,
|
||||
"标题": string,
|
||||
"标签"?: string,
|
||||
"总结"?: string,
|
||||
"描述"?: string,
|
||||
"数据"?: string,
|
||||
"链接"?: string,
|
||||
"类型"?: string,
|
||||
"启动时间"?: string,
|
||||
"任务"?: "非任务" | "运行中" | "已停止" | "个人计划" | "已完成" | "AI自动化",
|
||||
"任务结果"?: string,
|
||||
"提示词"?: string,
|
||||
} & T;
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NocoApi } from "@kevisual/noco";
|
||||
import { columns } from "../common/base-table.ts";
|
||||
|
||||
import { ColumnItem } from "./base-table.ts";
|
||||
type ReponseData<T = {}> = {
|
||||
code: number,
|
||||
message?: string,
|
||||
@@ -11,19 +11,7 @@ export type CoreOptions<T = {}> = {
|
||||
baseId?: string
|
||||
} & T
|
||||
|
||||
type CoreItem = {
|
||||
Id: number,
|
||||
标题: string,
|
||||
总结?: string,
|
||||
启动时间?: string,
|
||||
标签?: string,
|
||||
任务?: string, // 运行中,已完成,未开始
|
||||
链接?: string,
|
||||
数据?: string,
|
||||
类型?: string,
|
||||
提示词?: string,
|
||||
任务结果?: string,
|
||||
}
|
||||
type CoreItem = ColumnItem
|
||||
export class Core {
|
||||
nocoApi: NocoApi;
|
||||
baseId?: string;
|
||||
@@ -68,7 +56,7 @@ export class Core {
|
||||
tableId = res?.data?.id;
|
||||
}
|
||||
this.tableId = tableId;
|
||||
if(this.nocoApi.record) {
|
||||
if (this.nocoApi.record) {
|
||||
this.nocoApi.record.table = tableId;
|
||||
}
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { NocoApi } from "@kevisual/noco";
|
||||
import { Core } from "../common/index.ts";
|
||||
|
||||
export class Control extends Core {
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
import { NocoApi } from "@kevisual/noco";
|
||||
import { columns } from "./common/base-table.ts";
|
||||
import { columns, ColumnItem } from "./common/base-table.ts";
|
||||
import { Life } from "../noco/life/index.ts";
|
||||
import { Control } from "../noco/control/index.ts";
|
||||
import { Core } from "./common/core.ts";
|
||||
|
||||
import { NocoWehookPayload } from "./callback/index.ts";
|
||||
export {
|
||||
NocoApi,
|
||||
columns,
|
||||
ColumnItem,
|
||||
Control,
|
||||
Life
|
||||
Life,
|
||||
Core,
|
||||
}
|
||||
|
||||
export type {
|
||||
NocoWehookPayload
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import { NocoApi } from "@kevisual/noco";
|
||||
import { Core } from "../common/index.ts";
|
||||
|
||||
export class Life extends Core {
|
||||
|
||||
Reference in New Issue
Block a user