UNPKG

@n8n/n8n-nodes-langchain

Version:

![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)

22 lines 771 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.apiRequest = apiRequest; async function apiRequest(method, endpoint, parameters) { const { body, qs, option, headers } = parameters ?? {}; const credentials = await this.getCredentials('moonshotApi'); const baseUrl = credentials.url ?? 'https://api.moonshot.ai/v1'; const url = `${baseUrl}${endpoint}`; const options = { headers: headers ?? {}, method, body, qs, url, json: true, }; if (option && Object.keys(option).length !== 0) { Object.assign(options, option); } return await this.helpers.httpRequestWithAuthentication.call(this, 'moonshotApi', options); } //# sourceMappingURL=index.js.map