UNPKG

cobalt-int-sdk

Version:

Wrapper around Cobalt Intelligence services, such as the Secretary of State API.

68 lines 3.9 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const _1 = require("."); const dotenv_1 = __importDefault(require("dotenv")); const _2 = require("."); dotenv_1.default.config(); (async () => { // Texas uses long polling // await getDetails('IRON GROUND TRUCKING LLC', 'texas'); // Delaware uses long polling // await getDetails('SUPERIOR BUILDING SERVICES, INC.', 'delaware'); // Delaware uses long polling // Test alternatives // await getDetails('pizza', 'delaware'); // Missouri is normal // await getDetails('STOKESBERRY TRUCKING LLC', 'missouri'); // sosId with colorado // await getDetailsBySosId('20151458554', 'colorado'); // sosId with Delaware // await getDetailsBySosId('2011864', 'delaware'); // Delinquent Taxes // await getDelinquentTaxes(); // test searchAllStatesByBusinessName // await searchAllStates(); // Get by name // await getDetails("DEERE & company", 'mo', true, true); // await getDetailsBySosId('70674247', 'pennsylvania', false); // await getDetailsByPersonName('Peter', '', 'alaska', true, false, false, null, null, null); // await getListBySearchQuery('pizza tax sean', 'wy', true); // Verify TIN await verifyTIN('123456789', 'frank sanchez llc'); })(); async function getDetails(businessName, state, liveData, screenshot, uccData, street, city, zip) { var _a, _b, _c, _d, _e, _f; const sosApi = new _1.SosApi(process.env.cobaltIntApiKey, 'dev'); // const sosApi = new SosApi(process.env.jacobAPIKey, 'dev'); const details = await sosApi.getBusinessDetails(businessName, state, liveData, screenshot, uccData, street, city, zip); console.log('details', details, (_b = (_a = details === null || details === void 0 ? void 0 : details.results) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.uccData, (_d = (_c = details === null || details === void 0 ? void 0 : details.results) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.messages, (_f = (_e = details === null || details === void 0 ? void 0 : details.results) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.documents); } async function getDetailsBySosId(sosId, state, liveData, screenshot, uccData, street, city, zip) { const sosApi = new _1.SosApi(process.env.cobaltIntApiKey, 'dev'); const details = await sosApi.getBusinessDetailsBySosId(sosId, state, liveData, screenshot, uccData, street, city, zip); console.log('details', details); } async function getDetailsByPersonName(firstName, lastName, state, liveData, screenshot, uccData, street, city, zip) { const sosApi = new _1.SosApi(process.env.cobaltIntApiKey, 'dev'); const details = await sosApi.getDetailsByPersonName(firstName, lastName, state, liveData, screenshot, uccData, street, city, zip); console.log('details', details); } async function getListBySearchQuery(searchQuery, state, liveData) { const sosApi = new _1.SosApi(process.env.cobaltIntApiKey); const details = await sosApi.getListBySearchQuery(searchQuery, state, liveData); console.log('details', details); } async function searchAllStates() { const sosApi = new _1.SosApi(process.env.cobaltIntApiKey); const results = await sosApi.searchAllStatesByBusinessName('pizza hut llc'); console.log('Results', results); } async function verifyTIN(tin, businessName) { const tinVerification = new _2.TINVerification(process.env.cobaltIntApiKey); const results = await tinVerification.verifyTIN(tin, businessName); console.log('Results', results); } //# sourceMappingURL=example.js.map