@redonvn/redai-openapi-generic 0.1.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.
- package/README.md +38 -0
- package/dist/index.cjs +616 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +265 -0
- package/dist/index.d.ts +265 -0
- package/dist/index.js +590 -0
- package/dist/index.js.map +1 -0
- package/openclaw.plugin.json +84 -0
- package/package.json +52 -0
- package/tool-catalog.json +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../index.ts","../../redai-agent-sdk/src/client.ts","../tool-catalog.json","../generic.json"],"sourcesContent":["import { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"node:path\";\nimport {\n RedaiAgentClient,\n RedaiAgentError,\n type ToolExecutionInput\n} from \"@redonvn/redai-agent-sdk\";\nimport catalog from \"./tool-catalog.json\";\nimport spec from \"./generic.json\";\n\nexport { catalog, spec };\n\nconst DEFAULT_AUTH_STORE_PATH =\n \"C:\\\\Users\\\\Acer\\\\.openclaw\\\\workspace-nhan-vien-redai\\\\auth\\\\redai-auth.json\";\n\ntype PluginRuntimeConfig = {\n baseUrl?: string;\n bearerToken?: string;\n apiKey?: string;\n apiKeyHeader?: string;\n defaultHeaders?: Record<string, string>;\n timeoutMs?: number;\n workspaceId?: string;\n baseId?: string;\n authStorePath?: string;\n};\n\ntype ToolResult = { content: Array<{ type: \"text\"; text: string }> };\n\ntype CatalogTool = {\n name: string;\n description: string;\n method: \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n path: string;\n parameters: unknown;\n};\n\ntype OpenClawApiLike = {\n config?: {\n plugins?: {\n entries?: Record<string, { config?: PluginRuntimeConfig }>;\n };\n };\n registerTool: (\n definition: {\n name: string;\n description: string;\n parameters: unknown;\n execute: (id: string, params: unknown) => Promise<ToolResult>;\n },\n options?: { optional?: boolean }\n ) => void;\n};\n\ntype RedaiAuthEntry = {\n telegramUserId: string;\n bearerToken: string;\n workspaceId: string;\n baseId?: string | null;\n savedAt: string;\n lastValidatedAt: string | null;\n status: \"active\" | \"invalid\";\n};\n\ntype RedaiAuthStore = {\n version: 1;\n users: Record<string, RedaiAuthEntry>;\n};\n\nconst typedCatalog = catalog as {\n pluginId: string;\n optional?: boolean;\n serverUrl?: string;\n tools: CatalogTool[];\n};\n\nconst formatToolResult = (payload: unknown): ToolResult => ({\n content: [\n {\n type: \"text\",\n text: typeof payload === \"string\" ? payload : JSON.stringify(payload, null, 2)\n }\n ]\n});\n\nconst resolvePluginConfig = (api: OpenClawApiLike): PluginRuntimeConfig =>\n api.config?.plugins?.entries?.[typedCatalog.pluginId]?.config ?? {};\n\nconst cloneJson = <T>(value: T): T => JSON.parse(JSON.stringify(value)) as T;\n\nconst removeHeadersFromSchema = (schema: unknown) => {\n const cloned = cloneJson((schema ?? { type: \"object\", properties: {} }) as Record<string, unknown>);\n const objectSchema = cloned as {\n properties?: Record<string, unknown>;\n required?: string[];\n additionalProperties?: boolean;\n };\n if (!objectSchema.properties) {\n objectSchema.properties = {};\n }\n delete objectSchema.properties.headers;\n if (Array.isArray(objectSchema.required)) {\n objectSchema.required = objectSchema.required.filter((item) => item !== \"headers\");\n }\n objectSchema.additionalProperties = false;\n return objectSchema;\n};\n\nconst buildAuthWrappedParameters = (tool: CatalogTool) => {\n const baseSchema = removeHeadersFromSchema(tool.parameters);\n return {\n ...baseSchema,\n description: `${tool.description} Uses the logged-in RedAI auth for the current Telegram DM user.`,\n properties: {\n telegramUserId: {\n type: \"string\",\n description:\n \"Telegram sender ID from DM metadata. The agent must derive this automatically from the current message.\"\n },\n ...(baseSchema.properties ?? {})\n },\n required: [\n \"telegramUserId\",\n ...((baseSchema.required ?? []).filter((item: string) => item !== \"telegramUserId\"))\n ]\n };\n};\n\nconst buildAuthToolName = (toolName: string): string =>\n toolName.startsWith(\"redai_openapi_generic_\")\n ? toolName.replace(/^redai_openapi_generic_/, \"redai_openapi_generic_auth_\")\n : \"redai_openapi_generic_auth_${toolName}\";\n\nconst getAuthStorePath = (runtimeConfig: PluginRuntimeConfig) =>\n runtimeConfig.authStorePath?.trim() || DEFAULT_AUTH_STORE_PATH;\n\nconst ensureStoreDirectory = async (storePath: string) => {\n await mkdir(dirname(storePath), { recursive: true });\n};\n\nconst loadAuthStore = async (runtimeConfig: PluginRuntimeConfig): Promise<RedaiAuthStore> => {\n const storePath = getAuthStorePath(runtimeConfig);\n try {\n const raw = await readFile(storePath, \"utf8\");\n const parsed = JSON.parse(raw) as RedaiAuthStore;\n return { version: 1, users: parsed?.users ?? {} };\n } catch (error: unknown) {\n const maybeNodeError = error as NodeJS.ErrnoException;\n if (maybeNodeError?.code === \"ENOENT\") {\n await ensureStoreDirectory(storePath);\n await writeFile(storePath, JSON.stringify({ version: 1, users: {} }, null, 2), \"utf8\");\n return { version: 1, users: {} };\n }\n throw error;\n }\n};\n\nconst getAuthStoreEntry = async (runtimeConfig: PluginRuntimeConfig, telegramUserId: string) => {\n const store = await loadAuthStore(runtimeConfig);\n return store.users[telegramUserId] ?? null;\n};\n\nconst withRedaiAuth = (\n runtimeConfig: PluginRuntimeConfig,\n auth: Pick<RedaiAuthEntry, \"bearerToken\" | \"workspaceId\" | \"baseId\">\n): PluginRuntimeConfig => {\n const defaultHeaders = {\n ...(runtimeConfig.defaultHeaders ?? {}),\n \"x-workspace-id\": auth.workspaceId\n } as Record<string, string>;\n\n if (auth.baseId) {\n defaultHeaders[\"x-base-id\"] = auth.baseId;\n } else {\n delete defaultHeaders[\"x-base-id\"];\n }\n\n return {\n ...runtimeConfig,\n bearerToken: auth.bearerToken,\n apiKey: undefined,\n apiKeyHeader: undefined,\n defaultHeaders,\n workspaceId: auth.workspaceId,\n baseId: auth.baseId ?? undefined\n };\n};\n\nconst resolveUserRuntimeConfig = async (api: OpenClawApiLike, telegramUserId: string) => {\n const runtimeConfig = resolvePluginConfig(api);\n const authEntry = await getAuthStoreEntry(runtimeConfig, telegramUserId);\n if (!authEntry || authEntry.status !== \"active\") {\n return null;\n }\n return {\n runtimeConfig,\n scopedConfig: withRedaiAuth(runtimeConfig, authEntry)\n };\n};\n\nconst authRequiredResult = (telegramUserId: string) =>\n formatToolResult({\n ok: false,\n status: 401,\n statusText: \"AUTH_REQUIRED\",\n data: {\n message:\n \"Ban chua dang nhap RedAI auth hop le. Hay dung /login <bearerToken> <workspaceId> [baseId] trong DM truoc khi thao tac nghiep vu.\",\n telegramUserId\n }\n });\n\nconst hasHeadersSection = (tool: CatalogTool): boolean => {\n const parameters = tool.parameters as { properties?: Record<string, unknown> } | undefined;\n return Boolean(parameters?.properties?.headers);\n};\n\nconst mergeTenantHeaders = (\n tool: CatalogTool,\n inputHeaders: Record<string, unknown> | undefined,\n runtimeConfig: PluginRuntimeConfig\n): Record<string, string> | undefined => {\n const entries = Object.entries(inputHeaders ?? {})\n .filter(([, value]) => value !== undefined && value !== null && value !== \"\")\n .map(([key, value]) => [key, String(value)] as const);\n\n if (hasHeadersSection(tool)) {\n if (runtimeConfig.workspaceId && !entries.some(([key]) => key.toLowerCase() === \"x-workspace-id\")) {\n entries.push([\"x-workspace-id\", runtimeConfig.workspaceId]);\n }\n if (runtimeConfig.baseId && !entries.some(([key]) => key.toLowerCase() === \"x-base-id\")) {\n entries.push([\"x-base-id\", runtimeConfig.baseId]);\n }\n }\n\n return entries.length > 0 ? Object.fromEntries(entries) : undefined;\n};\n\nconst executeCatalogTool = async (\n runtimeConfig: PluginRuntimeConfig,\n tool: CatalogTool,\n rawParams: unknown\n) => {\n const client = new RedaiAgentClient({\n ...runtimeConfig,\n baseUrl: runtimeConfig.baseUrl ?? typedCatalog.serverUrl\n });\n const params = (rawParams ?? {}) as ToolExecutionInput & {\n headers?: Record<string, unknown>;\n };\n\n return client.executeTool(tool, {\n path: params.path,\n query: params.query,\n body: params.body,\n headers: mergeTenantHeaders(tool, params.headers, runtimeConfig)\n });\n};\n\nconst registerAuthProxyTool = (api: OpenClawApiLike, tool: CatalogTool) => {\n api.registerTool(\n {\n name: buildAuthToolName(tool.name),\n description: `${tool.description} Uses the logged-in RedAI auth for the current Telegram DM user.`,\n parameters: buildAuthWrappedParameters(tool),\n execute: async (_id: string, rawParams: unknown) => {\n const params = (rawParams ?? {}) as Record<string, unknown>;\n const telegramUserId = String(params.telegramUserId ?? \"\");\n const resolved = await resolveUserRuntimeConfig(api, telegramUserId);\n if (!resolved) {\n return authRequiredResult(telegramUserId);\n }\n\n const forwardedParams = { ...params };\n delete forwardedParams.telegramUserId;\n\n try {\n const response = await executeCatalogTool(resolved.scopedConfig, tool, forwardedParams);\n return formatToolResult(response.data);\n } catch (error: unknown) {\n if (error instanceof RedaiAgentError) {\n return formatToolResult({\n ok: false,\n status: error.status ?? 500,\n statusText: error.message,\n data: error.body\n });\n }\n\n return formatToolResult({\n ok: false,\n status: 500,\n statusText: \"PLUGIN_EXECUTION_FAILED\",\n data: String(error)\n });\n }\n }\n },\n { optional: typedCatalog.optional ?? true }\n );\n};\n\nexport default function register(api: OpenClawApiLike): void {\n for (const tool of typedCatalog.tools) {\n api.registerTool(\n {\n name: tool.name,\n description: tool.description,\n parameters: tool.parameters,\n execute: async (_id: string, rawParams: unknown) => {\n try {\n const response = await executeCatalogTool(resolvePluginConfig(api), tool, rawParams);\n return formatToolResult(response.data);\n } catch (error: unknown) {\n if (error instanceof RedaiAgentError) {\n return formatToolResult({\n ok: false,\n status: error.status ?? 500,\n statusText: error.message,\n data: error.body\n });\n }\n\n return formatToolResult({\n ok: false,\n status: 500,\n statusText: \"PLUGIN_EXECUTION_FAILED\",\n data: String(error)\n });\n }\n }\n },\n { optional: typedCatalog.optional ?? true }\n );\n }\n\n for (const tool of typedCatalog.tools) {\n registerAuthProxyTool(api, tool);\n }\n}\n","import type {\n ApiResponse,\n HeaderMap,\n HttpMethod,\n OperationRequest,\n PathParams,\n QueryParams,\n RedaiAgentClientOptions,\n TenantContext,\n ToolDescriptor,\n ToolExecutionInput\n} from \"./types\";\n\nconst DEFAULT_BASE_URL = \"https://api.redai.vn/api/v1\";\n\nconst encodeQueryValue = (value: QueryParams[string]): string[] => {\n if (value === undefined) {\n return [];\n }\n if (Array.isArray(value)) {\n return value.map((item) => String(item));\n }\n return [String(value)];\n};\n\nconst headersToObject = (headers: Headers): Record<string, string> => {\n const result: Record<string, string> = {};\n headers.forEach((value, key) => {\n result[key] = value;\n });\n return result;\n};\n\nconst applyPathParams = (pathTemplate: string, pathParams?: PathParams): string =>\n pathTemplate.replace(/\\{([^}]+)\\}/g, (_, key: string) => {\n const raw = pathParams?.[key];\n if (raw === undefined || raw === null) {\n throw new RedaiAgentError(`Missing required path parameter: ${key}`);\n }\n return encodeURIComponent(String(raw));\n });\n\nconst buildUrl = (baseUrl: string, path: string, query?: QueryParams): URL => {\n const url = new URL(baseUrl);\n const normalizedBasePath = url.pathname.replace(/\\/+$/, \"\");\n const normalizedRequestPath = path.startsWith(\"/\") ? path : `/${path}`;\n url.pathname = `${normalizedBasePath}${normalizedRequestPath}`.replace(/\\/{2,}/g, \"/\");\n\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n for (const item of encodeQueryValue(value)) {\n url.searchParams.append(key, item);\n }\n }\n }\n\n return url;\n};\n\nconst parseResponse = async (response: Response): Promise<unknown> => {\n const contentType = response.headers.get(\"content-type\") ?? \"\";\n if (contentType.includes(\"application/json\")) {\n return response.json();\n }\n return response.text();\n};\n\nexport class RedaiAgentError extends Error {\n status?: number;\n body?: unknown;\n\n constructor(message: string, options?: { status?: number; body?: unknown }) {\n super(message);\n this.name = \"RedaiAgentError\";\n this.status = options?.status;\n this.body = options?.body;\n }\n}\n\nexport class RedaiAgentClient {\n readonly baseUrl: string;\n\n private readonly bearerToken?: string;\n private readonly apiKey?: string;\n private readonly apiKeyHeader?: string;\n private readonly defaultHeaders?: Record<string, string>;\n private readonly timeoutMs?: number;\n private readonly fetchImpl: typeof globalThis.fetch;\n private readonly tenantContext: TenantContext;\n\n constructor(options: RedaiAgentClientOptions = {}) {\n this.baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\\/$/, \"\");\n this.bearerToken = options.bearerToken;\n this.apiKey = options.apiKey;\n this.apiKeyHeader = options.apiKeyHeader ?? \"x-api-key\";\n this.defaultHeaders = options.defaultHeaders;\n this.timeoutMs = options.timeoutMs;\n this.fetchImpl = options.fetch ?? globalThis.fetch;\n this.tenantContext = {\n workspaceId: options.workspaceId,\n baseId: options.baseId\n };\n }\n\n createTenantHeaders(overrides?: TenantContext): HeaderMap {\n const workspaceId = overrides?.workspaceId ?? this.tenantContext.workspaceId;\n const baseId = overrides?.baseId ?? this.tenantContext.baseId;\n\n return {\n \"x-workspace-id\": workspaceId,\n \"x-base-id\": baseId\n };\n }\n\n async executeTool<TData = unknown>(\n tool: ToolDescriptor,\n input: ToolExecutionInput = {}\n ): Promise<ApiResponse<TData>> {\n return this.request<TData>({\n method: tool.method,\n path: tool.path,\n pathParams: input.path as PathParams | undefined,\n query: input.query,\n headers: input.headers,\n body: input.body\n });\n }\n\n async request<TData = unknown, TBody = unknown>(\n request: OperationRequest<TBody>\n ): Promise<ApiResponse<TData>> {\n const url = buildUrl(this.baseUrl, applyPathParams(request.path, request.pathParams), request.query);\n const controller = new AbortController();\n const timeout = this.timeoutMs ? setTimeout(() => controller.abort(), this.timeoutMs) : undefined;\n const headers = this.buildHeaders(request.method, request.headers, request.body !== undefined);\n\n try {\n const response = await this.fetchImpl(url, {\n method: request.method,\n headers,\n body: request.body === undefined ? undefined : JSON.stringify(request.body),\n signal: controller.signal\n });\n const data = (await parseResponse(response)) as TData;\n const result: ApiResponse<TData> = {\n ok: response.ok,\n status: response.status,\n statusText: response.statusText,\n headers: headersToObject(response.headers),\n data\n };\n\n if (!response.ok) {\n throw new RedaiAgentError(`Request failed with status ${response.status}`, {\n status: response.status,\n body: data\n });\n }\n\n return result;\n } catch (error: unknown) {\n if (error instanceof RedaiAgentError) {\n throw error;\n }\n throw new RedaiAgentError(\"Request failed\", { body: error });\n } finally {\n if (timeout) {\n clearTimeout(timeout);\n }\n }\n }\n\n private buildHeaders(method: HttpMethod, requestHeaders?: HeaderMap, hasBody?: boolean): Headers {\n const headers = new Headers();\n\n for (const [key, value] of Object.entries(this.defaultHeaders ?? {})) {\n headers.set(key, value);\n }\n\n for (const [key, value] of Object.entries(this.createTenantHeaders())) {\n if (value !== undefined && value !== null && value !== \"\") {\n headers.set(key, value);\n }\n }\n\n if (this.bearerToken) {\n headers.set(\"authorization\", `Bearer ${this.bearerToken}`);\n } else if (this.apiKey) {\n headers.set(this.apiKeyHeader ?? \"x-api-key\", this.apiKey);\n }\n\n for (const [key, value] of Object.entries(requestHeaders ?? {})) {\n if (value !== undefined && value !== null && value !== \"\") {\n headers.set(key, value);\n }\n }\n\n if (!headers.has(\"accept\")) {\n headers.set(\"accept\", \"application/json\");\n }\n\n if (hasBody && method !== \"GET\" && !headers.has(\"content-type\")) {\n headers.set(\"content-type\", \"application/json\");\n }\n\n return headers;\n }\n}\n","{\n \"pluginId\": \"redai-openapi-generic\",\n \"pluginName\": \"RedAI User API Export - Generic\",\n \"version\": \"0.1.0\",\n \"description\": \"OpenAPI export cho nhóm API user đã chọn: Generic.\",\n \"serverUrl\": \"https://v2.redai.vn/api\",\n \"optional\": true,\n \"tools\": [\n {\n \"name\": \"redai_openapi_generic_genericpageusercontroller_getpublishedgenericpagebypath_v1\",\n \"description\": \"Lấy thông tin trang đã xuất bản theo đường dẫn\",\n \"method\": \"GET\",\n \"path\": \"/v1/user/generic-pages/by-path/{path}\",\n \"operationId\": \"genericpageusercontroller_getpublishedgenericpagebypath_v1\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": {\n \"type\": \"object\",\n \"properties\": {\n \"path\": {\n \"type\": \"string\",\n \"description\": \"Đường dẫn của trang\"\n }\n },\n \"required\": [\n \"path\"\n ],\n \"additionalProperties\": false\n }\n },\n \"required\": [\n \"path\"\n ],\n \"additionalProperties\": false,\n \"description\": \"Lấy thông tin trang đã xuất bản theo đường dẫn tool arguments\"\n },\n \"tags\": [\n \"User Generic Page\"\n ]\n }\n ]\n}\n","{\r\n \"openapi\": \"3.0.0\",\r\n \"paths\": {\r\n \"/v1/user/generic-pages/by-path/{path}\": {\r\n \"get\": {\r\n \"operationId\": \"GenericPageUserController_getPublishedGenericPageByPath_v1\",\r\n \"parameters\": [\r\n {\r\n \"name\": \"path\",\r\n \"required\": true,\r\n \"in\": \"path\",\r\n \"description\": \"Đường dẫn của trang\",\r\n \"schema\": {\r\n \"type\": \"string\"\r\n }\r\n }\r\n ],\r\n \"responses\": {\r\n \"200\": {\r\n \"description\": \"Thông tin trang\",\r\n \"content\": {\r\n \"application/json\": {\r\n \"schema\": {\r\n \"allOf\": [\r\n {\r\n \"$ref\": \"#/components/schemas/ApiResponseDto\"\r\n },\r\n {\r\n \"properties\": {\r\n \"result\": {\r\n \"$ref\": \"#/components/schemas/UserGenericPageResponseDto\"\r\n }\r\n }\r\n }\r\n ]\r\n }\r\n }\r\n }\r\n }\r\n },\r\n \"summary\": \"Lấy thông tin trang đã xuất bản theo đường dẫn\",\r\n \"tags\": [\r\n \"User Generic Page\"\r\n ]\r\n }\r\n }\r\n },\r\n \"info\": {\r\n \"title\": \"RedAI User API Export - Generic\",\r\n \"description\": \"OpenAPI export cho nhóm API user đã chọn: Generic.\",\r\n \"version\": \"1.0\",\r\n \"contact\": {\r\n \"name\": \"RedAI Support\",\r\n \"url\": \"https://redai.com/support\",\r\n \"email\": \"support@redai.com\"\r\n },\r\n \"license\": {\r\n \"name\": \"MIT\",\r\n \"url\": \"https://opensource.org/licenses/MIT\"\r\n }\r\n },\r\n \"tags\": [],\r\n \"servers\": [\r\n {\r\n \"url\": \"http://localhost:3000\",\r\n \"description\": \"Local Server\"\r\n },\r\n {\r\n \"url\": \"http://localhost:3003\",\r\n \"description\": \"Development Server\"\r\n },\r\n {\r\n \"url\": \"http://14.225.29.196:3003\",\r\n \"description\": \"Test Server\"\r\n },\r\n {\r\n \"url\": \"https://api-staging.redai.vn\",\r\n \"description\": \"Staging Server\"\r\n },\r\n {\r\n \"url\": \"https://v2.redai.vn/api\",\r\n \"description\": \"Production Server\"\r\n }\r\n ],\r\n \"components\": {\r\n \"schemas\": {\r\n \"ApiResponseDto\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"code\": {\r\n \"type\": \"number\",\r\n \"description\": \"Mã trạng thái (0: Thành công, khác 0: Mã lỗi cụ thể)\",\r\n \"example\": 0\r\n },\r\n \"message\": {\r\n \"type\": \"string\",\r\n \"description\": \"Thông điệp mô tả kết quả\",\r\n \"example\": \"Success\"\r\n }\r\n },\r\n \"required\": [\r\n \"code\",\r\n \"message\"\r\n ]\r\n },\r\n \"UserGenericPageResponseDto\": {\r\n \"type\": \"object\",\r\n \"properties\": {\r\n \"id\": {\r\n \"type\": \"string\",\r\n \"description\": \"ID của trang\",\r\n \"example\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"\r\n },\r\n \"name\": {\r\n \"type\": \"string\",\r\n \"description\": \"Tên của trang\",\r\n \"example\": \"Trang liên hệ\"\r\n },\r\n \"description\": {\r\n \"type\": \"string\",\r\n \"description\": \"Mô tả về trang\",\r\n \"example\": \"Form liên hệ cho khách hàng\",\r\n \"nullable\": true\r\n },\r\n \"path\": {\r\n \"type\": \"string\",\r\n \"description\": \"Đường dẫn URL của trang\",\r\n \"example\": \"lien-he\"\r\n },\r\n \"config\": {\r\n \"type\": \"object\",\r\n \"description\": \"Cấu hình trang dạng JSON\",\r\n \"example\": {\r\n \"formId\": \"contact-form\",\r\n \"title\": \"Liên hệ với chúng tôi\",\r\n \"subtitle\": \"Hãy để lại thông tin, chúng tôi sẽ liên hệ lại với bạn\",\r\n \"groups\": []\r\n }\r\n },\r\n \"publishedAt\": {\r\n \"type\": \"number\",\r\n \"description\": \"Thời điểm xuất bản trang (Unix timestamp)\",\r\n \"example\": 1673363400000\r\n }\r\n },\r\n \"required\": [\r\n \"id\",\r\n \"name\",\r\n \"description\",\r\n \"path\",\r\n \"config\",\r\n \"publishedAt\"\r\n ]\r\n }\r\n }\r\n },\r\n \"externalDocs\": {\r\n \"description\": \"Additional Documentation\",\r\n \"url\": \"https://redai.com/docs\"\r\n },\r\n \"generatedAt\": \"2026-03-16T08:19:30.792Z\",\r\n \"x-redai-export-modules\": [\r\n \"generic\"\r\n ],\r\n \"x-redai-export-scope\": \"user\"\r\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAA2C;AAC3C,uBAAwB;;;ACYxB,IAAM,mBAAmB;AAEzB,IAAM,mBAAmB,CAAC,UAAyC;AACjE,MAAI,UAAU,QAAW;AACvB,WAAO,CAAC;EACV;AACA,MAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,WAAO,MAAM,IAAI,CAAC,SAAS,OAAO,IAAI,CAAC;EACzC;AACA,SAAO,CAAC,OAAO,KAAK,CAAC;AACvB;AAEA,IAAM,kBAAkB,CAAC,YAA6C;AACpE,QAAM,SAAiC,CAAC;AACxC,UAAQ,QAAQ,CAAC,OAAO,QAAQ;AAC9B,WAAO,GAAG,IAAI;EAChB,CAAC;AACD,SAAO;AACT;AAEA,IAAM,kBAAkB,CAAC,cAAsB,eAC7C,aAAa,QAAQ,gBAAgB,CAAC,GAAG,QAAgB;AACvD,QAAM,MAAM,aAAa,GAAG;AAC5B,MAAI,QAAQ,UAAa,QAAQ,MAAM;AACrC,UAAM,IAAI,gBAAgB,oCAAoC,GAAG,EAAE;EACrE;AACA,SAAO,mBAAmB,OAAO,GAAG,CAAC;AACvC,CAAC;AAEH,IAAM,WAAW,CAAC,SAAiB,MAAc,UAA6B;AAC5E,QAAM,MAAM,IAAI,IAAI,OAAO;AAC3B,QAAM,qBAAqB,IAAI,SAAS,QAAQ,QAAQ,EAAE;AAC1D,QAAM,wBAAwB,KAAK,WAAW,GAAG,IAAI,OAAO,IAAI,IAAI;AACpE,MAAI,WAAW,GAAG,kBAAkB,GAAG,q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UACH;AAEA,iBAAO,iBAAiB;AAAA,YACtB,IAAI;AAAA,YACJ,QAAQ;AAAA,YACR,YAAY;AAAA,YACZ,MAAM,OAAO,KAAK;AAAA,UACpB,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,IACA,EAAE,UAAU,aAAa,YAAY,KAAK;AAAA,EAC5C;AACF;AAEe,SAAR,SAA0B,KAA4B;AAC3D,aAAW,QAAQ,aAAa,OAAO;AACrC,QAAI;AAAA,MACF;AAAA,QACE,MAAM,KAAK;AAAA,QACX,aAAa,KAAK;AAAA,QAClB,YAAY,KAAK;AAAA,QACjB,SAAS,OAAO,KAAa,cAAuB;AAClD,cAAI;AACF,kBAAM,WAAW,MAAM,mBAAmB,oBAAoB,GAAG,GAAG,MAAM,SAAS;AACnF,mBAAO,iBAAiB,SAAS,IAAI;AAAA,UACvC,SAAS,OAAgB;AACvB,gBAAI,iBAAiB,iBAAiB;AACpC,qBAAO,iBAAiB;AAAA,gBACtB,IAAI;AAAA,gBACJ,QAAQ,MAAM,UAAU;AAAA,gBACxB,YAAY,MAAM;AAAA,gBAClB,MAAM,MAAM;AAAA,cACd,CAAC;AAAA,YACH;AAEA,mBAAO,iBAAiB;AAAA,cACtB,IAAI;AAAA,cACJ,QAAQ;AAAA,cACR,YAAY;AAAA,cACZ,MAAM,OAAO,KAAK;AAAA,YACpB,CAAC;AAAA,UACH;AAAA,QACF;AAAA,MACF;AAAA,MACA,EAAE,UAAU,aAAa,YAAY,KAAK;AAAA,IAC5C;AAAA,EACF;AAEA,aAAW,QAAQ,aAAa,OAAO;AACrC,0BAAsB,KAAK,IAAI;AAAA,EACjC;AACF;","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
var pluginId = "redai-openapi-generic";
|
|
2
|
+
var pluginName = "RedAI User API Export - Generic";
|
|
3
|
+
var version = "0.1.0";
|
|
4
|
+
var description = "OpenAPI export cho nhóm API user đã chọn: Generic.";
|
|
5
|
+
var serverUrl = "https://v2.redai.vn/api";
|
|
6
|
+
var optional = true;
|
|
7
|
+
var tools = [
|
|
8
|
+
{
|
|
9
|
+
name: "redai_openapi_generic_genericpageusercontroller_getpublishedgenericpagebypath_v1",
|
|
10
|
+
description: "Lấy thông tin trang đã xuất bản theo đường dẫn",
|
|
11
|
+
method: "GET",
|
|
12
|
+
path: "/v1/user/generic-pages/by-path/{path}",
|
|
13
|
+
operationId: "genericpageusercontroller_getpublishedgenericpagebypath_v1",
|
|
14
|
+
parameters: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
path: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
path: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Đường dẫn của trang"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
required: [
|
|
26
|
+
"path"
|
|
27
|
+
],
|
|
28
|
+
additionalProperties: false
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
required: [
|
|
32
|
+
"path"
|
|
33
|
+
],
|
|
34
|
+
additionalProperties: false,
|
|
35
|
+
description: "Lấy thông tin trang đã xuất bản theo đường dẫn tool arguments"
|
|
36
|
+
},
|
|
37
|
+
tags: [
|
|
38
|
+
"User Generic Page"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
var toolCatalog = {
|
|
43
|
+
pluginId: pluginId,
|
|
44
|
+
pluginName: pluginName,
|
|
45
|
+
version: version,
|
|
46
|
+
description: description,
|
|
47
|
+
serverUrl: serverUrl,
|
|
48
|
+
optional: optional,
|
|
49
|
+
tools: tools
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var openapi = "3.0.0";
|
|
53
|
+
var paths = {
|
|
54
|
+
"/v1/user/generic-pages/by-path/{path}": {
|
|
55
|
+
get: {
|
|
56
|
+
operationId: "GenericPageUserController_getPublishedGenericPageByPath_v1",
|
|
57
|
+
parameters: [
|
|
58
|
+
{
|
|
59
|
+
name: "path",
|
|
60
|
+
required: true,
|
|
61
|
+
"in": "path",
|
|
62
|
+
description: "Đường dẫn của trang",
|
|
63
|
+
schema: {
|
|
64
|
+
type: "string"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
responses: {
|
|
69
|
+
"200": {
|
|
70
|
+
description: "Thông tin trang",
|
|
71
|
+
content: {
|
|
72
|
+
"application/json": {
|
|
73
|
+
schema: {
|
|
74
|
+
allOf: [
|
|
75
|
+
{
|
|
76
|
+
$ref: "#/components/schemas/ApiResponseDto"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
properties: {
|
|
80
|
+
result: {
|
|
81
|
+
$ref: "#/components/schemas/UserGenericPageResponseDto"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
summary: "Lấy thông tin trang đã xuất bản theo đường dẫn",
|
|
92
|
+
tags: [
|
|
93
|
+
"User Generic Page"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
var info = {
|
|
99
|
+
title: "RedAI User API Export - Generic",
|
|
100
|
+
description: "OpenAPI export cho nhóm API user đã chọn: Generic.",
|
|
101
|
+
version: "1.0",
|
|
102
|
+
contact: {
|
|
103
|
+
name: "RedAI Support",
|
|
104
|
+
url: "https://redai.com/support",
|
|
105
|
+
email: "support@redai.com"
|
|
106
|
+
},
|
|
107
|
+
license: {
|
|
108
|
+
name: "MIT",
|
|
109
|
+
url: "https://opensource.org/licenses/MIT"
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var tags = [
|
|
113
|
+
];
|
|
114
|
+
var servers = [
|
|
115
|
+
{
|
|
116
|
+
url: "http://localhost:3000",
|
|
117
|
+
description: "Local Server"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
url: "http://localhost:3003",
|
|
121
|
+
description: "Development Server"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
url: "http://14.225.29.196:3003",
|
|
125
|
+
description: "Test Server"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
url: "https://api-staging.redai.vn",
|
|
129
|
+
description: "Staging Server"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
url: "https://v2.redai.vn/api",
|
|
133
|
+
description: "Production Server"
|
|
134
|
+
}
|
|
135
|
+
];
|
|
136
|
+
var components = {
|
|
137
|
+
schemas: {
|
|
138
|
+
ApiResponseDto: {
|
|
139
|
+
type: "object",
|
|
140
|
+
properties: {
|
|
141
|
+
code: {
|
|
142
|
+
type: "number",
|
|
143
|
+
description: "Mã trạng thái (0: Thành công, khác 0: Mã lỗi cụ thể)",
|
|
144
|
+
example: 0
|
|
145
|
+
},
|
|
146
|
+
message: {
|
|
147
|
+
type: "string",
|
|
148
|
+
description: "Thông điệp mô tả kết quả",
|
|
149
|
+
example: "Success"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
required: [
|
|
153
|
+
"code",
|
|
154
|
+
"message"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
UserGenericPageResponseDto: {
|
|
158
|
+
type: "object",
|
|
159
|
+
properties: {
|
|
160
|
+
id: {
|
|
161
|
+
type: "string",
|
|
162
|
+
description: "ID của trang",
|
|
163
|
+
example: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
|
|
164
|
+
},
|
|
165
|
+
name: {
|
|
166
|
+
type: "string",
|
|
167
|
+
description: "Tên của trang",
|
|
168
|
+
example: "Trang liên hệ"
|
|
169
|
+
},
|
|
170
|
+
description: {
|
|
171
|
+
type: "string",
|
|
172
|
+
description: "Mô tả về trang",
|
|
173
|
+
example: "Form liên hệ cho khách hàng",
|
|
174
|
+
nullable: true
|
|
175
|
+
},
|
|
176
|
+
path: {
|
|
177
|
+
type: "string",
|
|
178
|
+
description: "Đường dẫn URL của trang",
|
|
179
|
+
example: "lien-he"
|
|
180
|
+
},
|
|
181
|
+
config: {
|
|
182
|
+
type: "object",
|
|
183
|
+
description: "Cấu hình trang dạng JSON",
|
|
184
|
+
example: {
|
|
185
|
+
formId: "contact-form",
|
|
186
|
+
title: "Liên hệ với chúng tôi",
|
|
187
|
+
subtitle: "Hãy để lại thông tin, chúng tôi sẽ liên hệ lại với bạn",
|
|
188
|
+
groups: [
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
publishedAt: {
|
|
193
|
+
type: "number",
|
|
194
|
+
description: "Thời điểm xuất bản trang (Unix timestamp)",
|
|
195
|
+
example: 1673363400000
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
required: [
|
|
199
|
+
"id",
|
|
200
|
+
"name",
|
|
201
|
+
"description",
|
|
202
|
+
"path",
|
|
203
|
+
"config",
|
|
204
|
+
"publishedAt"
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
var externalDocs = {
|
|
210
|
+
description: "Additional Documentation",
|
|
211
|
+
url: "https://redai.com/docs"
|
|
212
|
+
};
|
|
213
|
+
var generatedAt = "2026-03-16T08:19:30.792Z";
|
|
214
|
+
var generic = {
|
|
215
|
+
openapi: openapi,
|
|
216
|
+
paths: paths,
|
|
217
|
+
info: info,
|
|
218
|
+
tags: tags,
|
|
219
|
+
servers: servers,
|
|
220
|
+
components: components,
|
|
221
|
+
externalDocs: externalDocs,
|
|
222
|
+
generatedAt: generatedAt,
|
|
223
|
+
"x-redai-export-modules": [
|
|
224
|
+
"generic"
|
|
225
|
+
],
|
|
226
|
+
"x-redai-export-scope": "user"
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
type PluginRuntimeConfig = {
|
|
230
|
+
baseUrl?: string;
|
|
231
|
+
bearerToken?: string;
|
|
232
|
+
apiKey?: string;
|
|
233
|
+
apiKeyHeader?: string;
|
|
234
|
+
defaultHeaders?: Record<string, string>;
|
|
235
|
+
timeoutMs?: number;
|
|
236
|
+
workspaceId?: string;
|
|
237
|
+
baseId?: string;
|
|
238
|
+
authStorePath?: string;
|
|
239
|
+
};
|
|
240
|
+
type ToolResult = {
|
|
241
|
+
content: Array<{
|
|
242
|
+
type: "text";
|
|
243
|
+
text: string;
|
|
244
|
+
}>;
|
|
245
|
+
};
|
|
246
|
+
type OpenClawApiLike = {
|
|
247
|
+
config?: {
|
|
248
|
+
plugins?: {
|
|
249
|
+
entries?: Record<string, {
|
|
250
|
+
config?: PluginRuntimeConfig;
|
|
251
|
+
}>;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
registerTool: (definition: {
|
|
255
|
+
name: string;
|
|
256
|
+
description: string;
|
|
257
|
+
parameters: unknown;
|
|
258
|
+
execute: (id: string, params: unknown) => Promise<ToolResult>;
|
|
259
|
+
}, options?: {
|
|
260
|
+
optional?: boolean;
|
|
261
|
+
}) => void;
|
|
262
|
+
};
|
|
263
|
+
declare function register(api: OpenClawApiLike): void;
|
|
264
|
+
|
|
265
|
+
export { toolCatalog as catalog, register as default, generic as spec };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
var pluginId = "redai-openapi-generic";
|
|
2
|
+
var pluginName = "RedAI User API Export - Generic";
|
|
3
|
+
var version = "0.1.0";
|
|
4
|
+
var description = "OpenAPI export cho nhóm API user đã chọn: Generic.";
|
|
5
|
+
var serverUrl = "https://v2.redai.vn/api";
|
|
6
|
+
var optional = true;
|
|
7
|
+
var tools = [
|
|
8
|
+
{
|
|
9
|
+
name: "redai_openapi_generic_genericpageusercontroller_getpublishedgenericpagebypath_v1",
|
|
10
|
+
description: "Lấy thông tin trang đã xuất bản theo đường dẫn",
|
|
11
|
+
method: "GET",
|
|
12
|
+
path: "/v1/user/generic-pages/by-path/{path}",
|
|
13
|
+
operationId: "genericpageusercontroller_getpublishedgenericpagebypath_v1",
|
|
14
|
+
parameters: {
|
|
15
|
+
type: "object",
|
|
16
|
+
properties: {
|
|
17
|
+
path: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
path: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Đường dẫn của trang"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
required: [
|
|
26
|
+
"path"
|
|
27
|
+
],
|
|
28
|
+
additionalProperties: false
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
required: [
|
|
32
|
+
"path"
|
|
33
|
+
],
|
|
34
|
+
additionalProperties: false,
|
|
35
|
+
description: "Lấy thông tin trang đã xuất bản theo đường dẫn tool arguments"
|
|
36
|
+
},
|
|
37
|
+
tags: [
|
|
38
|
+
"User Generic Page"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
];
|
|
42
|
+
var toolCatalog = {
|
|
43
|
+
pluginId: pluginId,
|
|
44
|
+
pluginName: pluginName,
|
|
45
|
+
version: version,
|
|
46
|
+
description: description,
|
|
47
|
+
serverUrl: serverUrl,
|
|
48
|
+
optional: optional,
|
|
49
|
+
tools: tools
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
var openapi = "3.0.0";
|
|
53
|
+
var paths = {
|
|
54
|
+
"/v1/user/generic-pages/by-path/{path}": {
|
|
55
|
+
get: {
|
|
56
|
+
operationId: "GenericPageUserController_getPublishedGenericPageByPath_v1",
|
|
57
|
+
parameters: [
|
|
58
|
+
{
|
|
59
|
+
name: "path",
|
|
60
|
+
required: true,
|
|
61
|
+
"in": "path",
|
|
62
|
+
description: "Đường dẫn của trang",
|
|
63
|
+
schema: {
|
|
64
|
+
type: "string"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
responses: {
|
|
69
|
+
"200": {
|
|
70
|
+
description: "Thông tin trang",
|
|
71
|
+
content: {
|
|
72
|
+
"application/json": {
|
|
73
|
+
schema: {
|
|
74
|
+
allOf: [
|
|
75
|
+
{
|
|
76
|
+
$ref: "#/components/schemas/ApiResponseDto"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
properties: {
|
|
80
|
+
result: {
|
|
81
|
+
$ref: "#/components/schemas/UserGenericPageResponseDto"
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
summary: "Lấy thông tin trang đã xuất bản theo đường dẫn",
|
|
92
|
+
tags: [
|
|
93
|
+
"User Generic Page"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
var info = {
|
|
99
|
+
title: "RedAI User API Export - Generic",
|
|
100
|
+
description: "OpenAPI export cho nhóm API user đã chọn: Generic.",
|
|
101
|
+
version: "1.0",
|
|
102
|
+
contact: {
|
|
103
|
+
name: "RedAI Support",
|
|
104
|
+
url: "https://redai.com/support",
|
|
105
|
+
email: "support@redai.com"
|
|
106
|
+
},
|
|
107
|
+
license: {
|
|
108
|
+
name: "MIT",
|
|
109
|
+
url: "https://opensource.org/licenses/MIT"
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
var tags = [
|
|
113
|
+
];
|
|
114
|
+
var servers = [
|
|
115
|
+
{
|
|
116
|
+
url: "http://localhost:3000",
|
|
117
|
+
description: "Local Server"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
url: "http://localhost:3003",
|
|
121
|
+
description: "Development Server"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
url: "http://14.225.29.196:3003",
|
|
125
|
+
description: "Test Server"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
url: "https://api-staging.redai.vn",
|
|
129
|
+
description: "Staging Server"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
url: "https://v2.redai.vn/api",
|
|
133
|
+
description: "Production Server"
|
|
134
|
+
}
|
|
135
|
+
];
|
|
136
|
+
var components = {
|
|
137
|
+
schemas: {
|
|
138
|
+
ApiResponseDto: {
|
|
139
|
+
type: "object",
|
|
140
|
+
properties: {
|
|
141
|
+
code: {
|
|
142
|
+
type: "number",
|
|
143
|
+
description: "Mã trạng thái (0: Thành công, khác 0: Mã lỗi cụ thể)",
|
|
144
|
+
example: 0
|
|
145
|
+
},
|
|
146
|
+
message: {
|
|
147
|
+
type: "string",
|
|
148
|
+
description: "Thông điệp mô tả kết quả",
|
|
149
|
+
example: "Success"
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
required: [
|
|
153
|
+
"code",
|
|
154
|
+
"message"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
UserGenericPageResponseDto: {
|
|
158
|
+
type: "object",
|
|
159
|
+
properties: {
|
|
160
|
+
id: {
|
|
161
|
+
type: "string",
|
|
162
|
+
description: "ID của trang",
|
|
163
|
+
example: "f47ac10b-58cc-4372-a567-0e02b2c3d479"
|
|
164
|
+
},
|
|
165
|
+
name: {
|
|
166
|
+
type: "string",
|
|
167
|
+
description: "Tên của trang",
|
|
168
|
+
example: "Trang liên hệ"
|
|
169
|
+
},
|
|
170
|
+
description: {
|
|
171
|
+
type: "string",
|
|
172
|
+
description: "Mô tả về trang",
|
|
173
|
+
example: "Form liên hệ cho khách hàng",
|
|
174
|
+
nullable: true
|
|
175
|
+
},
|
|
176
|
+
path: {
|
|
177
|
+
type: "string",
|
|
178
|
+
description: "Đường dẫn URL của trang",
|
|
179
|
+
example: "lien-he"
|
|
180
|
+
},
|
|
181
|
+
config: {
|
|
182
|
+
type: "object",
|
|
183
|
+
description: "Cấu hình trang dạng JSON",
|
|
184
|
+
example: {
|
|
185
|
+
formId: "contact-form",
|
|
186
|
+
title: "Liên hệ với chúng tôi",
|
|
187
|
+
subtitle: "Hãy để lại thông tin, chúng tôi sẽ liên hệ lại với bạn",
|
|
188
|
+
groups: [
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
publishedAt: {
|
|
193
|
+
type: "number",
|
|
194
|
+
description: "Thời điểm xuất bản trang (Unix timestamp)",
|
|
195
|
+
example: 1673363400000
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
required: [
|
|
199
|
+
"id",
|
|
200
|
+
"name",
|
|
201
|
+
"description",
|
|
202
|
+
"path",
|
|
203
|
+
"config",
|
|
204
|
+
"publishedAt"
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
var externalDocs = {
|
|
210
|
+
description: "Additional Documentation",
|
|
211
|
+
url: "https://redai.com/docs"
|
|
212
|
+
};
|
|
213
|
+
var generatedAt = "2026-03-16T08:19:30.792Z";
|
|
214
|
+
var generic = {
|
|
215
|
+
openapi: openapi,
|
|
216
|
+
paths: paths,
|
|
217
|
+
info: info,
|
|
218
|
+
tags: tags,
|
|
219
|
+
servers: servers,
|
|
220
|
+
components: components,
|
|
221
|
+
externalDocs: externalDocs,
|
|
222
|
+
generatedAt: generatedAt,
|
|
223
|
+
"x-redai-export-modules": [
|
|
224
|
+
"generic"
|
|
225
|
+
],
|
|
226
|
+
"x-redai-export-scope": "user"
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
type PluginRuntimeConfig = {
|
|
230
|
+
baseUrl?: string;
|
|
231
|
+
bearerToken?: string;
|
|
232
|
+
apiKey?: string;
|
|
233
|
+
apiKeyHeader?: string;
|
|
234
|
+
defaultHeaders?: Record<string, string>;
|
|
235
|
+
timeoutMs?: number;
|
|
236
|
+
workspaceId?: string;
|
|
237
|
+
baseId?: string;
|
|
238
|
+
authStorePath?: string;
|
|
239
|
+
};
|
|
240
|
+
type ToolResult = {
|
|
241
|
+
content: Array<{
|
|
242
|
+
type: "text";
|
|
243
|
+
text: string;
|
|
244
|
+
}>;
|
|
245
|
+
};
|
|
246
|
+
type OpenClawApiLike = {
|
|
247
|
+
config?: {
|
|
248
|
+
plugins?: {
|
|
249
|
+
entries?: Record<string, {
|
|
250
|
+
config?: PluginRuntimeConfig;
|
|
251
|
+
}>;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
registerTool: (definition: {
|
|
255
|
+
name: string;
|
|
256
|
+
description: string;
|
|
257
|
+
parameters: unknown;
|
|
258
|
+
execute: (id: string, params: unknown) => Promise<ToolResult>;
|
|
259
|
+
}, options?: {
|
|
260
|
+
optional?: boolean;
|
|
261
|
+
}) => void;
|
|
262
|
+
};
|
|
263
|
+
declare function register(api: OpenClawApiLike): void;
|
|
264
|
+
|
|
265
|
+
export { toolCatalog as catalog, register as default, generic as spec };
|