Skip to content

Commit 75798b1

Browse files
Merge branch 'release/v1.4.0'
2 parents 34926ba + a331e60 commit 75798b1

40 files changed

Lines changed: 648 additions & 194 deletions

CHANGELOG.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
11
# Cufinder TypeScript SDK Changelog
22

3+
## 1.4.0 (January 29, 2025)
4+
5+
#### Features
6+
- **New V2 API services**: Add new V2 services including `BCD`, `CCP`, `ISC`, `CBC`, `CSC`, `CSN`, `NAO` and `NAA`
7+
8+
9+
#### Documentation
10+
- **Updated README.md**: Add API reference for all new services
11+
12+
13+
314
## 1.3.1 (November 5, 2025)
415

516
#### Documentation
6-
- **Updated README.md**: Added API reference for all services
17+
- **Updated README.md**: Add API reference for all services
718

819

920

@@ -38,7 +49,7 @@
3849
- **Directory structure**: Changed from `src/` to `lib/` and `test/` to `tests/`
3950

4051
#### Features
41-
- **Comprehensive V2 API services**: Added all V2 services including CUF, LCUF, DTC, DTE, TEP, CSE, PSE, LBS, and more
52+
- **Comprehensive V2 API services**: Added all V2 services including `CUF`, `LCUF`, `DTC`, `DTE`, `TEP`, `CSE`, `PSE`, `LBS`, and more
4253
- **Enhanced type safety**: All services now use explicit `Promise<ResponseType>` return types
4354
- **Extensive JSDoc documentation**: Added complete `@example` sections for all service methods and main client
4455
- **Improved error handling**: Better response parsing with automatic handling of API response wrapper format

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ This SDK covers all 20 Cufinder API (v2) endpoints:
6565
- **CSE** - [Company Search](https://apidoc.cufinder.io/apis/company-search)
6666
- **PSE** - [Person Search](https://apidoc.cufinder.io/apis/person-search)
6767
- **LBS** - [Local Business Search (Google Maps Search API)](https://apidoc.cufinder.io/apis/local-business-search-google-maps-search-api)
68+
- **BCD** - [B2B Customers Finder](https://apidoc.cufinder.io/apis/b2b-customers-finder)
69+
- **CCP** - [Company Career Page Finder](https://apidoc.cufinder.io/apis/company-career-page-finder)
70+
- **ISC** - [Company Saas Checker](https://apidoc.cufinder.io/apis/company-saas-checker)
71+
- **CBC** - [Company B2B or B2C Checker](https://apidoc.cufinder.io/apis/company-b2b-or-b2c-checker)
72+
- **CSC** - [Company Mission Statement](https://apidoc.cufinder.io/apis/company-mission-statement)
73+
- **CSN** - [Company Snapshot](https://apidoc.cufinder.io/apis/company-snapshot)
74+
- **NAO** - [Phone Number Normalizer](https://apidoc.cufinder.io/apis/phone-number-normalizer)
75+
- **NAA** - [Address Normalizer](https://apidoc.cufinder.io/apis/address-normalizer)
6876

6977

7078
**CUF - Company Name to Domain**
@@ -259,6 +267,78 @@ const result = await client.lbs({
259267
console.log(result);
260268
```
261269

270+
**BCD - B2B Customers Finder**
271+
272+
Returns company's careers page
273+
274+
```typescript
275+
const result = await client.bcd('stripe.com');
276+
console.log(result);
277+
```
278+
279+
**CCP - Company Career Page Finder**
280+
281+
Returns is company SaaS or not
282+
283+
```typescript
284+
const result = await client.ccp('stripe.com');
285+
console.log(result);
286+
```
287+
288+
**ISC - Company Saas Checker**
289+
290+
Returns is company SaaS or not
291+
292+
```typescript
293+
const result = await client.isc('stripe.com')
294+
console.log(result.is_saas);
295+
```
296+
297+
**CBC - Company B2B or B2C Checker**
298+
299+
Returns company's business type
300+
301+
```typescript
302+
const result = await client.cbc('stripe.com')
303+
console.log(result.business_type);
304+
```
305+
306+
**CSC - Company Mission Statement**
307+
308+
Returns company's mission statement
309+
310+
```typescript
311+
const result = await client.csc('stripe.com')
312+
console.log(result.mission_statement);
313+
```
314+
315+
**CSN - Company Snapshot**
316+
317+
Returns company's snapshot information
318+
319+
```typescript
320+
const result = await client.csn('stripe.com')
321+
console.log(result.company_snapshot);
322+
```
323+
324+
**NAO - Phone Number Normalizer**
325+
326+
Returns normalized phone
327+
328+
```typescript
329+
const result = await client.nao('+18006676389')
330+
console.log(result.phone); // +1 800 667 6389
331+
```
332+
333+
**NAA - Address Normalizer**
334+
335+
Returns normalized address
336+
337+
```typescript
338+
const result = await client.naa('1095 avenue of the Americas, 6th Avenue ny 10036')
339+
console.log(result.address); // 1095 AVENUE OF THE AMERICAS 6TH AVENUE NY 10036
340+
```
341+
262342
## Error Handling
263343

264344
The SDK provides comprehensive error handling with custom error types:

lib/base_api_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class BaseApiClient {
3838
headers: {
3939
'x-api-key': config.apiKey,
4040
'Content-Type': 'application/x-www-form-urlencoded',
41-
'User-Agent': '@cufinder/cufinder-ts/1.3.1',
41+
'User-Agent': '@cufinder/cufinder-ts/1.4.0',
4242
},
4343
});
4444

lib/client.ts

Lines changed: 129 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
import { BaseApiClient } from './base_api_client';
22
import {
3+
BcdResponse,
34
CarResponse,
5+
CbcResponse,
6+
CcpResponse,
47
CecResponse,
58
CloResponse,
9+
CscResponse,
610
CseResponse,
11+
CsnResponse,
712
CufResponse,
813
DtcResponse,
914
DteResponse,
@@ -14,8 +19,11 @@ import {
1419
FclResponse,
1520
FtsResponse,
1621
FweResponse,
22+
IscResponse,
1723
LbsResponse,
1824
LcufResponse,
25+
NaaResponse,
26+
NaoResponse,
1927
NtpResponse,
2028
PseResponse,
2129
RelResponse,
@@ -25,10 +33,15 @@ import { CseParams, CufinderClientConfig, LbsParams, PseParams } from './shared/
2533

2634
// Services
2735
import {
36+
BcdService,
2837
CarService,
38+
CbcService,
39+
CcpService,
2940
CecService,
3041
CloService,
42+
CscService,
3143
CseService,
44+
CsnService,
3245
CufService,
3346
DtcService,
3447
DteService,
@@ -39,8 +52,11 @@ import {
3952
FclService,
4053
FtsService,
4154
FweService,
55+
IscService,
4256
LbsService,
4357
LcufService,
58+
NaaService,
59+
NaoService,
4460
NtpService,
4561
PseService,
4662
RelService,
@@ -302,7 +318,7 @@ export class Cufinder {
302318
/**
303319
* Search for local businesses
304320
* @param params - Optional search parameters
305-
* @returns Promise resolving to local business search results
321+
* @returns The local business search results
306322
* @example
307323
* ```typescript
308324
* const result = await client.lbs({
@@ -315,6 +331,102 @@ export class Cufinder {
315331
*/
316332
public readonly lbs: (params?: LbsParams) => Promise<LbsResponse>;
317333

334+
/**
335+
* Extract B2B Customers From the Domain
336+
* @param url - The domain to extract B2B customers for
337+
* @returns List of business names
338+
* @example
339+
* ```typescript
340+
* const result = await client.bcd('stripe.com');
341+
* console.log(result);
342+
* ```
343+
*/
344+
public readonly bcd: (url: string) => Promise<BcdResponse>;
345+
346+
/**
347+
* Find company careers page
348+
* @param url - The company domain you want to find it's career page
349+
* @returns Company's careers page
350+
* @example
351+
* ```typescript
352+
* const result = await client.ccp('stripe.com');
353+
* console.log(result);
354+
* ```
355+
*/
356+
public readonly ccp: (url: string) => Promise<CcpResponse>;
357+
358+
/**
359+
* Check company you want to know is saas or not
360+
* @param url - The company domain you want to check is saas or not
361+
* @returns Is company SaaS or not
362+
* @example
363+
* ```typescript
364+
* const result = await client.isc('stripe.com')
365+
* console.log(result.is_saas);
366+
* ```
367+
*/
368+
public readonly isc: (url: string) => Promise<IscResponse>;
369+
370+
/**
371+
* Get a company's business type
372+
* @param url - The company domain you want to check
373+
* @returns Company's business type
374+
* @example
375+
* ```typescript
376+
* const result = await client.cbc('stripe.com')
377+
* console.log(result.business_type);
378+
* ```
379+
*/
380+
public readonly cbc: (url: string) => Promise<CbcResponse>;
381+
382+
/**
383+
* Get company mission statement
384+
* @param url - The company domain you want to check
385+
* @returns Company's mission statement
386+
* @example
387+
* ```typescript
388+
* const result = await client.csc('stripe.com')
389+
* console.log(result.mission_statement);
390+
* ```
391+
*/
392+
public readonly csc: (url: string) => Promise<CscResponse>;
393+
394+
/**
395+
* Get company snapshot info
396+
* @param url - The company domain you want to check
397+
* @returns Company's snapshot information
398+
* @example
399+
* ```typescript
400+
* const result = await client.csn('stripe.com')
401+
* console.log(result.company_snapshot);
402+
* ```
403+
*/
404+
public readonly csn: (url: string) => Promise<CsnResponse>;
405+
406+
/**
407+
* Normalize phone number
408+
* @param phone - The phone number you want to normalize
409+
* @returns Normalized phone
410+
* @example
411+
* ```typescript
412+
* const result = await client.nao('+18006676389')
413+
* console.log(result.phone); // +1 800 667 6389
414+
* ```
415+
*/
416+
public readonly nao: (phone: string) => Promise<NaoResponse>;
417+
418+
/**
419+
* Get normalized address
420+
* @param address - The address you want to normalize
421+
* @returns Normalized address
422+
* @example
423+
* ```typescript
424+
* const result = await client.naa('1095 avenue of the Americas, 6th Avenue ny 10036')
425+
* console.log(result.address); // 1095 AVENUE OF THE AMERICAS 6TH AVENUE NY 10036
426+
* ```
427+
*/
428+
public readonly naa: (address: string) => Promise<NaaResponse>;
429+
318430
constructor(apiKey: string, options?: CufinderClientConfig) {
319431
this.client = new BaseApiClient({ apiKey, ...options });
320432

@@ -339,6 +451,14 @@ export class Cufinder {
339451
const cse = new CseService(this.client);
340452
const pse = new PseService(this.client);
341453
const lbs = new LbsService(this.client);
454+
const bcd = new BcdService(this.client);
455+
const ccp = new CcpService(this.client);
456+
const isc = new IscService(this.client);
457+
const cbc = new CbcService(this.client);
458+
const csc = new CscService(this.client);
459+
const csn = new CsnService(this.client);
460+
const nao = new NaoService(this.client);
461+
const naa = new NaaService(this.client);
342462

343463
// Expose services as direct functions
344464
this.cuf = (companyName, countryCode) => cuf.getDomain(companyName, countryCode);
@@ -361,5 +481,13 @@ export class Cufinder {
361481
this.cse = params => cse.searchCompanies(params);
362482
this.pse = params => pse.searchPeople(params);
363483
this.lbs = params => lbs.searchLocalBusinesses(params);
484+
this.bcd = url => bcd.extractB2BCustomers(url);
485+
this.ccp = url => ccp.findCareersPage(url);
486+
this.isc = url => isc.isSaas(url);
487+
this.cbc = url => cbc.getCompanyBusinessType(url);
488+
this.csc = url => csc.getCompanyMissionStatment(url);
489+
this.csn = url => csn.getCompanySnapshot(url);
490+
this.nao = phone => nao.normalizePhone(phone);
491+
this.naa = address => naa.normalizeAddress(address);
364492
}
365493
}

lib/services/base.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { CufinderError } from '../shared/types';
33

44
/**
55
* Base service class that provides common functionality for all services
6-
* Follows SOLID principles by providing a single responsibility base class
76
*/
87
export abstract class BaseService {
98
protected client: BaseApiClient;

lib/services/bcd.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { BaseService } from './base';
2+
import { BcdResponse } from '../shared/types';
3+
4+
/**
5+
* BCD - B2B Customers Finder API (V2)
6+
*/
7+
export class BcdService extends BaseService {
8+
/**
9+
* Extract B2B Customers From the Domain
10+
* @param params - The domain to extract B2B customers for
11+
*/
12+
public async extractB2BCustomers(url: string): Promise<BcdResponse> {
13+
try {
14+
const response = await this.client.post('/bcd', {
15+
url: url.trim(),
16+
});
17+
18+
return this.parseResponseData<BcdResponse>(response.data);
19+
} catch (error) {
20+
throw this.handleError(error, 'BCD Service');
21+
}
22+
}
23+
}

lib/services/car.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
1-
import { CarResponse } from '../shared/types';
21
import { BaseService } from './base';
2+
import { CarResponse } from '../shared/types';
33

44
/**
55
* CAR - Company Revenue Finder API (V2)
6-
* Estimates a company's annual revenue based on name
76
*/
87
export class CarService extends BaseService {
98
/**
109
* Get company revenue
1110
* @param query - The company name to get revenue info for
12-
* @returns Promise resolving to revenue data
13-
* @example
14-
* ```typescript
15-
* const revenue = await client.car('apple');
16-
* console.log(revenue.revenue.annual_revenue); // '$394.3B'
17-
* ```
1811
*/
1912
public async getRevenue(query: string): Promise<CarResponse> {
2013
try {

0 commit comments

Comments
 (0)