fix: fix credentials and parsing of numbers

This commit is contained in:
drobnikj
2023-08-09 09:49:39 +02:00
parent e09bad0440
commit 83d8e96f9c
2 changed files with 6 additions and 6 deletions
@@ -1,6 +1,6 @@
import { INodeParams, INodeCredential } from '../src/Interface' import { INodeParams, INodeCredential } from '../src/Interface'
class ApifyApi implements INodeCredential { class ApifyApiCredential implements INodeCredential {
label: string label: string
name: string name: string
version: number version: number
@@ -23,4 +23,4 @@ class ApifyApi implements INodeCredential {
} }
} }
module.exports = { credClass: ApifyApi } module.exports = { credClass: ApifyApiCredential }
@@ -103,8 +103,8 @@ class ApifyWebsiteContentCrawler_DocumentLoaders implements INode {
// Get input options and merge with additional input // Get input options and merge with additional input
const urls = nodeData.inputs?.urls as string const urls = nodeData.inputs?.urls as string
const crawlerType = nodeData.inputs?.crawlerType as string const crawlerType = nodeData.inputs?.crawlerType as string
const maxCrawlDepth = nodeData.inputs?.maxCrawlDepth as number const maxCrawlDepth = nodeData.inputs?.maxCrawlDepth as string
const maxCrawlPages = nodeData.inputs?.maxCrawlPages as number const maxCrawlPages = nodeData.inputs?.maxCrawlPages as string
const additionalInput = const additionalInput =
typeof nodeData.inputs?.additionalInput === 'object' typeof nodeData.inputs?.additionalInput === 'object'
? nodeData.inputs?.additionalInput ? nodeData.inputs?.additionalInput
@@ -112,8 +112,8 @@ class ApifyWebsiteContentCrawler_DocumentLoaders implements INode {
const input = { const input = {
startUrls: urls.split(',').map((url) => ({ url: url.trim() })), startUrls: urls.split(',').map((url) => ({ url: url.trim() })),
crawlerType, crawlerType,
maxCrawlDepth, maxCrawlDepth: parseInt(maxCrawlDepth, 10),
maxCrawlPages, maxCrawlPages: parseInt(maxCrawlPages, 10),
...additionalInput ...additionalInput
} }