@apify/n8n-nodes-apify
Version:
n8n nodes for Apify
65 lines • 2.46 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Apify = void 0;
const Apify_properties_1 = require("./Apify.properties");
const Apify_methods_1 = require("./Apify.methods");
const router_1 = require("./resources/router");
class Apify {
constructor() {
this.description = {
displayName: 'Apify',
name: 'apify',
icon: 'file:apify.svg',
group: ['transform'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'The Apify integration for n8n lets you automate web scraping, data extraction, and workflow orchestration by connecting Apify Actors directly to your n8n workflows. This integration is especially valuable for AI and large language model (LLM) use cases. Collect, process, and deliver high-quality, up-to-date data for generative AI and chatbots.',
defaults: {
name: 'Apify',
},
inputs: ["main"],
outputs: ["main"],
usableAsTool: true,
credentials: [
{
displayName: 'Apify API key connection',
name: 'apifyApi',
required: false,
displayOptions: {
show: {
authentication: ['apifyApi'],
},
},
},
{
displayName: 'Apify OAuth2 connection',
name: 'apifyOAuth2Api',
required: false,
displayOptions: {
show: {
authentication: ['apifyOAuth2Api'],
},
},
},
],
properties: Apify_properties_1.properties,
};
this.methods = Apify_methods_1.methods;
}
async execute() {
const items = this.getInputData();
const returnData = [];
for (let i = 0; i < items.length; i++) {
const data = await router_1.resourceRouter.call(this, i);
if (Array.isArray(data)) {
returnData.push(...data);
}
else {
returnData.push(data);
}
}
return [returnData];
}
}
exports.Apify = Apify;
//# sourceMappingURL=Apify.node.js.map