import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties, } from 'n8n-workflow'; /** * KBDB 憑證=「哪一台 Arcrun 實例(cypher-executor)+哪個 namespace」。 * 認證走 X-Arcrun-API-Key header(cypher 的 /kbdb/* proxy 以它當租戶 owner_id)。 * 薄殼:這裡只描述連線,不含任何業務邏輯。 */ export class KbdbApi implements ICredentialType { name = 'kbdbApi'; displayName = 'KBDB API'; documentationUrl = 'https://arcrun.dev'; properties: INodeProperties[] = [ { displayName: 'Base URL', name: 'baseUrl', type: 'string', default: '', placeholder: 'https://arcrun-cypher-executor..workers.dev', description: '你的 Arcrun 實例(cypher-executor)網址——KBDB 的對外入口', required: true, }, { displayName: 'API Key', name: 'apiKey', type: 'string', typeOptions: { password: true }, default: '', description: 'Arcrun API key(namespace)。你的資料只在這個 namespace 裡,別人看不到', required: true, }, ]; authenticate: IAuthenticateGeneric = { type: 'generic', properties: { headers: { 'X-Arcrun-API-Key': '={{$credentials.apiKey}}', }, }, }; test: ICredentialTestRequest = { request: { baseURL: '={{$credentials.baseUrl}}', url: '/kbdb/templates', }, }; }