From 5295c72ca1e01a55c6e6bd290da66cbb4bebd51b Mon Sep 17 00:00:00 2001 From: JzoNg Date: Fri, 18 Oct 2024 18:18:23 +0800 Subject: [PATCH] endpoints mock data --- .../plugins/plugin-detail-panel/mock.ts | 43 +++++++++++++++++++ web/app/components/plugins/types.ts | 17 +++++++- 2 files changed, 59 insertions(+), 1 deletion(-) diff --git a/web/app/components/plugins/plugin-detail-panel/mock.ts b/web/app/components/plugins/plugin-detail-panel/mock.ts index 98e72086b5..7c421ce942 100644 --- a/web/app/components/plugins/plugin-detail-panel/mock.ts +++ b/web/app/components/plugins/plugin-detail-panel/mock.ts @@ -35,3 +35,46 @@ export const toolNotion = { source: PluginSource.marketplace, meta: null, } + +export const toolNotionEndpoints = [ + { + id: 'dlfajkgjdga-dfjalksjfglkds-dfjakld', + created_at: '2024-10-16 16:05:33', + updated_at: '2024-10-16 16:05:33', + settings: { + 'api-key': '*******', + }, + tenant_id: 'jflkdsjoewingljlsadjgoijg', + plugin_id: 'Notion/notion-page-search', + expired_at: '2024-10-16 16:05:33', + declaration: { + settings: [ + { + type: 'secret-input', + name: 'api-key', + required: true, + default: null, + options: null, + label: { + 'en-US': 'API-key', + 'zh-Hans': 'API-key', + }, + help: null, + url: null, + placeholder: { + 'en-US': 'Please input your API key', + 'zh-Hans': '请输入你的 API key', + }, + }, + ], + endpoint: [ + { path: '/duck/', method: 'GET' }, + { path: '/neko', method: 'GET' }, + ], + }, + name: 'default', + enabled: true, + url: 'http://localhost:5002/e/45rj9V4TRxAjL0I2wXRZgZdXjdHEKBh8', + hook_id: '45rj9V4TRxAjL0I2wXRZgZdXjdHEKBh8', + }, +] diff --git a/web/app/components/plugins/types.ts b/web/app/components/plugins/types.ts index 698b4e3532..4b3b750497 100644 --- a/web/app/components/plugins/types.ts +++ b/web/app/components/plugins/types.ts @@ -28,7 +28,7 @@ export type PluginToolDeclaration = { export type PluginEndpointDeclaration = { settings: CredentialFormSchemaBase[] - endpoint: EndpointItem[] + endpoints: EndpointItem[] } export type EndpointItem = { @@ -36,6 +36,21 @@ export type EndpointItem = { method: string } +export type EndpointListItem = { + id: string + created_at: string + updated_at: string + settings: Record + tenant_id: string + plugin_id: string + expired_at: string + declaration: PluginEndpointDeclaration + name: string + enabled: boolean + url: string + hook_id: string +} + export type PluginDeclaration = { version: string author: string