UNPKG

@bedrijfsdatanl/n8n-nodes-bedrijfsdata

Version:

n8n node for Bedrijfsdata.nl API - Search and retrieve Dutch company information

767 lines 35.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Bedrijfsdata = void 0; const n8n_workflow_1 = require("n8n-workflow"); const GenericFunctions_1 = require("./GenericFunctions"); const CompaniesGet_properties_1 = require("./CompaniesGet.properties"); const CompaniesGetMany_properties_1 = require("./CompaniesGetMany.properties"); const SuggestGet_properties_1 = require("./SuggestGet.properties"); const EnrichGet_properties_1 = require("./EnrichGet.properties"); const LlmGet_properties_1 = require("./LlmGet.properties"); const RagDomainGet_properties_1 = require("./RagDomainGet.properties"); const RagUrlGet_properties_1 = require("./RagUrlGet.properties"); const RagSearchGet_properties_1 = require("./RagSearchGet.properties"); const RelatedFamilyGet_properties_1 = require("./RelatedFamilyGet.properties"); const RelatedSharedAddressGet_properties_1 = require("./RelatedSharedAddressGet.properties"); const AdvancedPeopleGet_properties_1 = require("./AdvancedPeopleGet.properties"); const AdvancedNewsGet_properties_1 = require("./AdvancedNewsGet.properties"); const AdvancedVacanciesGet_properties_1 = require("./AdvancedVacanciesGet.properties"); const ValidationEmailGet_properties_1 = require("./ValidationEmailGet.properties"); const ValidationBicGet_properties_1 = require("./ValidationBicGet.properties"); const ValidationCityGet_properties_1 = require("./ValidationCityGet.properties"); const ValidationGeocodingGet_properties_1 = require("./ValidationGeocodingGet.properties"); const ValidationIbanGet_properties_1 = require("./ValidationIbanGet.properties"); const ValidationKvkGet_properties_1 = require("./ValidationKvkGet.properties"); const ValidationLeiGet_properties_1 = require("./ValidationLeiGet.properties"); const ValidationPhoneGet_properties_1 = require("./ValidationPhoneGet.properties"); const ValidationPostcodeGet_properties_1 = require("./ValidationPostcodeGet.properties"); const ValidationUrlGet_properties_1 = require("./ValidationUrlGet.properties"); const ValidationVatGet_properties_1 = require("./ValidationVatGet.properties"); const OtherBagGet_properties_1 = require("./OtherBagGet.properties"); const OtherCurrencyGet_properties_1 = require("./OtherCurrencyGet.properties"); const OtherDnsGet_properties_1 = require("./OtherDnsGet.properties"); const OtherPasswordGet_properties_1 = require("./OtherPasswordGet.properties"); const OtherPropertyGet_properties_1 = require("./OtherPropertyGet.properties"); const OtherSiterankGet_properties_1 = require("./OtherSiterankGet.properties"); const OtherTenderGet_properties_1 = require("./OtherTenderGet.properties"); const OtherWebrankGet_properties_1 = require("./OtherWebrankGet.properties"); class Bedrijfsdata { constructor() { this.description = { name: 'bedrijfsdata', displayName: 'Bedrijfsdata', icon: 'file:logo.svg', group: ['transform'], version: 1, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', description: 'Get data from the Bedrijfsdata API.', defaults: { name: 'Bedrijfsdata', }, inputs: ["main"], outputs: ["main"], usableAsTool: true, credentials: [ { name: 'bedrijfsdataApi', required: true, }, ], requestDefaults: { baseURL: 'https://api.bedrijfsdata.nl/v1.2', }, properties: [ { displayName: 'Resource', name: 'resource', type: 'options', noDataExpression: true, options: [ { name: 'Company', value: 'companies', }, { name: 'Company (Related)', value: 'companies_related', }, { name: 'Data (Advanced)', value: 'advanced_data', }, { name: 'Enrich', value: 'enrich', }, { name: 'Live Web RAG', value: 'rag', }, { name: 'LLM Template', value: 'llm', }, { name: 'Other Data', value: 'data_misc', }, { name: 'Validation & Cleansing', value: 'validation', }, ], default: 'companies', }, { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, default: 'get_many', displayOptions: { show: { resource: ['companies'], }, }, options: [ { name: 'Get', value: 'get', action: 'Get company', description: 'Retrieve a company profile by Bedrijfsdata.nl ID', routing: { request: { method: 'GET', url: '/companies', qs: { front: 30, country: 'nl', } }, }, }, { name: 'Get Many', value: 'get_many', action: 'Get companies', description: 'Retrieve company profiles with advanced filtering options', routing: { request: { method: 'GET', url: '/companies', qs: { front: 30, and_or: 'AND', } }, }, }, { name: 'Get Parameter Suggestions', value: 'get_suggest', action: 'Get parameter suggestions', description: 'Retrieve valid filter values for text, apps, city & domain fields in "Get Companies" (/companies)', routing: { request: { method: 'GET', url: '/suggest', qs: { front: 30 } }, }, }, ] }, { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, default: 'get', displayOptions: { show: { resource: ['enrich'], }, }, options: [ { name: 'Enrich Company Data', value: 'get', action: 'Enrich company data', description: 'Enrich your own company data', routing: { request: { method: 'GET', url: '/enrich', qs: { front: 30, } }, }, }, ] }, { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, default: 'get', displayOptions: { show: { resource: ['llm'], }, }, options: [ { name: 'Execute LLM Template', value: 'get', action: 'Execute llm template', description: 'Generate custom content by executing your LLM template', routing: { request: { method: 'GET', url: '/llm', qs: { front: 30, } }, }, }, ] }, { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, default: 'get_url', displayOptions: { show: { resource: ['rag'], }, }, options: [ { name: 'Get RAG Domain', value: 'get_domain', action: 'Get RAG domain', description: 'Get content from a publicly accessible website', routing: { request: { method: 'GET', url: '/rag_domain', qs: { front: 30, } }, }, }, { name: 'Get RAG URL', value: 'get_url', action: 'Get RAG URL', description: 'Get content from a publicly accessible URL', routing: { request: { method: 'GET', url: '/rag_url', qs: { front: 30, } }, }, }, { name: 'Get RAG Search', value: 'get_search', action: 'Get RAG search', description: 'Get search snippets from popular search engines by query', routing: { request: { method: 'GET', url: '/rag_search', qs: { front: 30, } }, }, }, ] }, { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, default: 'get_family', displayOptions: { show: { resource: ['companies_related'], }, }, options: [ { name: 'Get Corporate Family', value: 'get_family', action: 'Get corporate family', description: 'Get companies from same corporate family as a specific company', routing: { request: { method: 'GET', url: '/corporate_family', qs: { front: 30, } }, }, }, { name: 'Get Shared Address', value: 'get_same_address', action: 'Get shared address', description: 'Get companies that are registered on the same address as a specific company', routing: { request: { method: 'GET', url: '/shared_address', qs: { front: 30, } }, }, }, ] }, { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, default: 'get_people', displayOptions: { show: { resource: ['advanced_data'], }, }, options: [ { name: 'Get Many Employees', value: 'get_people', action: 'Get many employees', description: 'Get employees of a specific company', routing: { request: { method: 'GET', url: '/people', qs: { front: 30, } }, }, }, { name: 'Get Many News', value: 'get_news', action: 'Get many news', description: 'Get news about a specific company', routing: { request: { method: 'GET', url: '/news', qs: { front: 30, } }, }, }, { name: 'Get Many Vacancies', value: 'get_vacancies', action: 'Get many vacancies', description: 'Get vacancies of a specific company', routing: { request: { method: 'GET', url: '/vacancies', qs: { front: 30, } }, }, }, ] }, { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, default: 'get_url', displayOptions: { show: { resource: ['validation'], }, }, options: [ { name: 'Geocoding', value: 'get_geocoding', action: 'Geocoding', description: 'Validate and format unstructured geographic data', routing: { request: { method: 'GET', url: '/geocoding', qs: { front: 30, } }, }, }, { name: 'Validate BIC Number', value: 'get_bic', action: 'Validate bic number', description: 'Validate BIC numbers', routing: { request: { method: 'GET', url: '/bic', qs: { front: 30, } }, }, }, { name: 'Validate City', value: 'get_city', action: 'Validate city', description: 'Validate (global) cities', routing: { request: { method: 'GET', url: '/city', qs: { front: 30, } }, }, }, { name: 'Validate Dutch VAT Number', value: 'get_vat', action: 'Validate dutch vat number', description: 'Validate Dutch VAT numbers (btw-nummers)', routing: { request: { method: 'GET', url: '/vat', qs: { front: 30, } }, }, }, { name: 'Validate Email Address', value: 'get_email', action: 'Validate email address', description: 'Validate email addresses (basic validation only)', routing: { request: { method: 'GET', url: '/email', qs: { front: 30, } }, }, }, { name: 'Validate IBAN Number', value: 'get_iban', action: 'Validate iban number', description: 'Validate IBAN numbers', routing: { request: { method: 'GET', url: '/iban', qs: { front: 30, } }, }, }, { name: 'Validate KvK Number', value: 'get_kvk', action: 'Validate kv k number', description: 'Validate KvK numbers', routing: { request: { method: 'GET', url: '/kvk', qs: { front: 30, } }, }, }, { name: 'Validate LEI Number', value: 'get_lei', action: 'Validate lei number', description: 'Validate LEI numbers', routing: { request: { method: 'GET', url: '/lei', qs: { front: 30, } }, }, }, { name: 'Validate Phone Number', value: 'get_phone', action: 'Validate phone number', description: 'Validate (global) phone numbers', routing: { request: { method: 'GET', url: '/phone', qs: { front: 30, } }, }, }, { name: 'Validate Postcode', value: 'get_postcode', action: 'Validate postcode', description: 'Validate (global) postcodes', routing: { request: { method: 'GET', url: '/postcode', qs: { front: 30, } }, }, }, { name: 'Validate URL', value: 'get_url', action: 'Validate URL', description: 'Validate URL\'s', routing: { request: { method: 'GET', url: '/url', qs: { front: 30, } }, }, }, ] }, { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, default: 'get_siterank', displayOptions: { show: { resource: ['data_misc'], }, }, options: [ { name: 'Get BAG Data', value: 'get_bag', action: 'Get bag data', description: 'Get Dutch BAG data by address', routing: { request: { method: 'GET', url: '/bag', qs: { front: 30, } }, }, }, { name: 'Get DNS Scan', value: 'get_dns', action: 'Get DNS scan', description: 'Retrieve data straight from a domain\'s DNS', routing: { request: { method: 'GET', url: '/dns', qs: { front: 30, } }, }, }, { name: 'Get EU Tenders', value: 'get_tender', action: 'Get eu tenders', description: 'Query the European Tender database', routing: { request: { method: 'GET', url: '/tender', qs: { front: 30, } }, }, }, { name: 'Get Exchange Rate', value: 'get_currency', action: 'Get exchange rate', description: 'Get exchange rates for 300+ currencies (incl. crypto).', routing: { request: { method: 'GET', url: '/currency', qs: { front: 30, } }, }, }, { name: 'Get Password Leaks', value: 'get_password', action: 'Get password leaks', description: 'Find out how many times a password was leaked before', routing: { request: { method: 'GET', url: '/password', qs: { front: 30, } }, }, }, { name: 'Get Property Information', value: 'get_property', action: 'Get property information', description: 'Get property information by address or company ID', routing: { request: { method: 'GET', url: '/property', qs: { front: 30, } }, }, }, { name: 'Get Web Rankings', value: 'get_webrank', action: 'Get web rankings', description: 'Get global rankings like Majestic, CRUX, CloudFlare and DomCop', routing: { request: { method: 'GET', url: '/webrank', qs: { front: 30, } }, }, }, { name: 'Get Website Performance', value: 'get_siterank', action: 'Get website performance', description: 'Get data on a company\'s website performance and popularity ranking', routing: { request: { method: 'GET', url: '/siterank', qs: { front: 30, } }, }, }, ] }, ...CompaniesGet_properties_1.companiesGetOperationProperties, ...CompaniesGetMany_properties_1.companiesGetManyOperationProperties, ...SuggestGet_properties_1.suggestGetOperationProperties, ...EnrichGet_properties_1.enrichGetOperationProperties, ...LlmGet_properties_1.llmGetOperationProperties, ...RagDomainGet_properties_1.ragDomainGetOperationProperties, ...RagUrlGet_properties_1.ragUrlGetOperationProperties, ...RagSearchGet_properties_1.ragSearchGetOperationProperties, ...RelatedFamilyGet_properties_1.relatedFamilyGetOperationProperties, ...RelatedSharedAddressGet_properties_1.relatedSharedAddressGetOperationProperties, ...AdvancedPeopleGet_properties_1.advancedPeopleGetOperationProperties, ...AdvancedNewsGet_properties_1.advancedNewsGetOperationProperties, ...AdvancedVacanciesGet_properties_1.advancedVacanciesGetOperationProperties, ...ValidationEmailGet_properties_1.validationEmailGetOperationProperties, ...ValidationBicGet_properties_1.validationBicGetOperationProperties, ...ValidationCityGet_properties_1.validationCityGetOperationProperties, ...ValidationGeocodingGet_properties_1.validationGeocodingGetOperationProperties, ...ValidationIbanGet_properties_1.validationIbanGetOperationProperties, ...ValidationKvkGet_properties_1.validationKvKGetOperationProperties, ...ValidationLeiGet_properties_1.validationLeiGetOperationProperties, ...ValidationPhoneGet_properties_1.validationPhoneGetOperationProperties, ...ValidationPostcodeGet_properties_1.validationPostcodeGetOperationProperties, ...ValidationUrlGet_properties_1.validationUrlGetOperationProperties, ...ValidationVatGet_properties_1.validationVatGetOperationProperties, ...OtherBagGet_properties_1.otherBagGetOperationProperties, ...OtherCurrencyGet_properties_1.otherCurrenyGetOperationProperties, ...OtherDnsGet_properties_1.otherDnsGetOperationProperties, ...OtherPasswordGet_properties_1.otherPasswordGetOperationProperties, ...OtherPropertyGet_properties_1.otherPropertyGetOperationProperties, ...OtherSiterankGet_properties_1.otherSiterankGetOperationProperties, ...OtherTenderGet_properties_1.otherTenderGetOperationProperties, ...OtherWebrankGet_properties_1.otherWebrankGetOperationProperties ], }; this.methods = { listSearch: { async getCities(query) { try { const response = await GenericFunctions_1.apiRequest.call(this, 'GET', 'suggest', {}, { type: 'city', q: query, }); if (response && response.status === 'ok' && Array.isArray(response.suggest)) { return { results: response.suggest.map(item => ({ name: item.term, value: item.term, })), }; } else { const errorMessage = (response === null || response === void 0 ? void 0 : response.message) || 'Unexpected API response from /suggest endpoint'; throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to fetch cities: ${errorMessage}`); } } catch (error) { if (error instanceof n8n_workflow_1.NodeOperationError) { throw error; } const message = error.message || 'Unknown error during API request'; throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Error fetching cities: ${message}`); } } }, }; } } exports.Bedrijfsdata = Bedrijfsdata; //# sourceMappingURL=Bedrijfsdata.node.js.map