UNPKG

@fin.cx/opendata

Version:

A comprehensive TypeScript library that manages open business data for German companies by integrating MongoDB, processing JSONL bulk data, and automating browser interactions for Handelsregister data retrieval.

132 lines (131 loc) 4.57 kB
import type { BusinessRecord } from './classes.businessrecord.js'; import type { OpenData } from './classes.main.opendata.js'; import * as plugins from './plugins.js'; /** * the HandlesRegister exposed as a class */ export declare class HandelsRegister { private openDataRef; private asyncExecutionStack; private uniqueDowloadFolder; smartbrowserInstance: plugins.smartbrowser.SmartBrowser; constructor(openDataRef: OpenData); start(): Promise<void>; stop(): Promise<void>; /** * Creates a new page and configures it to allow file downloads * to a predefined path. */ getNewPage: () => Promise<plugins.smartbrowser.smartpuppeteer.puppeteer.Page>; private navigateToPage; private waitForResults; private clickFindButton; private downloadFile; /** * Helper method to parse the German registration string */ private parseGermanRegistration; /** * Search for a company by name and return basic info */ searchCompany(companyNameArg: string, resultsLimitArg?: number): Promise<{ name?: string; startDate?: string; endDate?: string; status?: "active" | "liquidating" | "closed"; address?: string; postalCode?: string; city?: string; country?: string; phone?: string; fax?: string; email?: string; website?: string; businessType?: string; registrationId?: string; germanParsedRegistration?: { court?: string; type?: "HRA" | "HRB" | "GnR" | "PR" | "VR" | "GsR"; number?: string; }; legalForm?: "GmbH" | "GmbH & Co. KG" | "AG" | "LLC" | "LLP" | "GmbH & Co. KGaA" | "GmbH & Co. KGaA, LLC"; managingDirectors?: string[]; boardOfDirectors?: string[]; supervisoryBoard?: string[]; foundingDate?: string; capital?: string; purpose?: string; lastUpdate?: string; }[]>; /** * Search for a specific company (known register type/number/court), * then click on an element that triggers a file download. */ getSpecificCompany(companyArg: BusinessRecord['data']['germanParsedRegistration']): Promise<{ businessRecords: { name?: string; startDate?: string; endDate?: string; status?: "active" | "liquidating" | "closed"; address?: string; postalCode?: string; city?: string; country?: string; phone?: string; fax?: string; email?: string; website?: string; businessType?: string; registrationId?: string; germanParsedRegistration?: { court?: string; type?: "HRA" | "HRB" | "GnR" | "PR" | "VR" | "GsR"; number?: string; }; legalForm?: "GmbH" | "GmbH & Co. KG" | "AG" | "LLC" | "LLP" | "GmbH & Co. KGaA" | "GmbH & Co. KGaA, LLC"; managingDirectors?: string[]; boardOfDirectors?: string[]; supervisoryBoard?: string[]; foundingDate?: string; capital?: string; purpose?: string; lastUpdate?: string; }[]; files: plugins.smartfile.SmartFile[]; }>; /** * get specific company by full name */ getSpecificCompanyByName(companyNameArg: string): Promise<{ businessRecords: { name?: string; startDate?: string; endDate?: string; status?: "active" | "liquidating" | "closed"; address?: string; postalCode?: string; city?: string; country?: string; phone?: string; fax?: string; email?: string; website?: string; businessType?: string; registrationId?: string; germanParsedRegistration?: { court?: string; type?: "HRA" | "HRB" | "GnR" | "PR" | "VR" | "GsR"; number?: string; }; legalForm?: "GmbH" | "GmbH & Co. KG" | "AG" | "LLC" | "LLP" | "GmbH & Co. KGaA" | "GmbH & Co. KGaA, LLC"; managingDirectors?: string[]; boardOfDirectors?: string[]; supervisoryBoard?: string[]; foundingDate?: string; capital?: string; purpose?: string; lastUpdate?: string; }[]; files: plugins.smartfile.SmartFile[]; }>; }