n8n-nodes-finnhub
Version:
n8n node to consume the finnhub.io REST API
77 lines • 2.58 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Finnhub = void 0;
const operations_1 = require("./operations");
class Finnhub {
constructor() {
this.description = {
displayName: 'Finnhub.io',
name: 'finnhub',
icon: 'file:finnhub.svg',
group: ['output'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume Finnhub.io API',
defaults: {
name: 'Finnhub',
},
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'finnhub',
required: true,
},
],
requestDefaults: {
baseURL: 'https://finnhub.io/api/v1',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
},
properties: [
{
displayName: 'Premium Access',
name: 'hasPremium',
type: 'boolean',
default: false,
description: 'Whether to toggle premium Finnhub endpoints based on your credential',
},
{
displayName: 'Resource',
name: 'resource',
type: 'options',
default: '',
noDataExpression: true,
displayOptions: {
show: {
hasPremium: [false],
},
},
options: operations_1.resourceOptions.free,
},
{
displayName: 'Resource',
name: 'resource',
type: 'options',
default: '',
noDataExpression: true,
displayOptions: {
show: {
hasPremium: [true],
},
},
options: operations_1.resourceOptions.premium,
},
...operations_1.operationProperties,
...operations_1.fieldProperties,
],
};
this.methods = {
loadOptions: {},
};
}
}
exports.Finnhub = Finnhub;
//# sourceMappingURL=Finnhub.node.js.map