UNPKG

@n8n/n8n-nodes-langchain

Version:
19 lines • 726 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.apiRequest = apiRequest; const n8n_workflow_1 = require("n8n-workflow"); async function apiRequest(method, endpoint, parameters) { const { body, qs, headers } = parameters ?? {}; const credentials = await this.getCredentials('moonshotApi'); const baseUrl = credentials.url ?? 'https://api.moonshot.ai/v1'; const options = { headers: headers ?? {}, method, body, qs, url: (0, n8n_workflow_1.requestUrl) `${baseUrl}${endpoint}`, json: true, }; return await this.helpers.httpRequestWithAuthentication.call(this, 'moonshotApi', options); } //# sourceMappingURL=index.js.map