Skip to content

Commit 5930155

Browse files
committed
updated
0 parents  commit 5930155

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+25538
-0
lines changed

.babelrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["@babel/preset-env"]
3+
}

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
test
3+
dist
4+
build
5+
.truecallerjs/authkey.json

.eslintrc.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"ecmaVersion": "latest",
10+
"sourceType": "module"
11+
},
12+
"plugins": ["@typescript-eslint"],
13+
"rules": {}
14+
}

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: sumithemmadi
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
# liberapay: sumithemmadi
10+
# issuehunt: sumithemmadi
11+
otechie: # Replace with a single Otechie username
12+
custom: ["https://paypal.me/sumithemmadi"]

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
.truecallerjs/authkey.json
3+
coverage
4+
test/authkey.json
5+
test/request.json

.gitkeep

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src/
2+
test/
3+
docs/
4+
dist/

.npmignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
docs/
2+
3+
# Ignore source files
4+
src/
5+
6+
# Ignore development and configuration files
7+
node_modules/
8+
coverage/
9+
CODE_OF_CONDUCT.md
10+
SECURITY.md
11+
test/
12+
.git
13+
.gitkeep
14+
.github
15+
.eslint*
16+
.prettier*
17+
18+
jest.config.ts
19+
20+

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.md
2+
build
3+
dist
4+
node_modules

.prettierrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

CODE_OF_CONDUCT.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Code of Conduct for https://github.com/sumithemmadi/truecallerjs
2+
3+
## Our Pledge
4+
5+
We, as members, contributors, and maintainers of this repository, pledge to foster an open, inclusive, and respectful environment for everyone who engages with our project. We are dedicated to providing a harassment-free experience, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to a positive environment include:
10+
11+
- Being respectful and considerate towards others.
12+
- Encouraging and supporting each other's ideas and contributions.
13+
- Providing and receiving constructive feedback with grace and openness.
14+
- Being empathetic and understanding towards differing perspectives.
15+
16+
Examples of unacceptable behavior include:
17+
18+
- Use of offensive, derogatory, or inappropriate language.
19+
- Harassment, trolling, or any form of personal attacks.
20+
- Publishing private information without explicit permission.
21+
- Engaging in any behavior that could be considered inappropriate or harmful.
22+
23+
## Responsibilities
24+
25+
Project maintainers are responsible for upholding the standards of conduct within the repository. They have the right and duty to remove, edit, or reject comments, code, and other contributions that violate this Code of Conduct.
26+
27+
## Scope
28+
29+
This Code of Conduct applies to all interactions within the repository, as well as to any public representation of the project. This includes comments, issues, pull requests, code reviews, and any other communication.
30+
31+
## Enforcement
32+
33+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [Your Contact Email]. All complaints will be reviewed promptly and treated with confidentiality and respect. Project maintainers are obligated to respect the privacy and security of the reporter of any incident.
34+
35+
## Consequences
36+
37+
Anyone found to be violating this Code of Conduct may face consequences, which can include:
38+
39+
1. **Warning**: A private, written warning from the project maintainers.
40+
2. **Temporary Ban**: A temporary ban from participating in the repository.
41+
3. **Permanent Ban**: A permanent ban from the repository and its related activities.
42+
43+
Project maintainers will use their discretion in determining the appropriate consequences for each case, considering the severity and impact of the violation.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Emmadi Sumith Kumar
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
# TruecallerJS
2+
3+
<!-- ![TruecallerJS logo](Screenshot_20230606-183149_Chrome.png) -->
4+
5+
[![NPM version](https://img.shields.io/npm/v/truecallerjs.svg)](https://www.npmjs.com/package/truecallerjs)
6+
[![GIT Stars](https://img.shields.io/github/stars/sumithemmadi/truecallerjs)](https://github.com/sumithemmadi/truecallerjs/)
7+
[![Download](https://img.shields.io/npm/dt/truecallerjs.svg)](https://github.com/sumithemmadi/truecallerjs)
8+
[![GitHub Sponsors](https://img.shields.io/github/sponsors/sumithemmadi)](https://github.com/sumithemmadi/truecallerjs)
9+
[![LICENSE](https://img.shields.io/npm/l/truecallerjs.svg)](https://github.com/sumithemmadi/truecallerjs/blob/main/LICENSE)
10+
[![Maintenance](https://img.shields.io/npms-io/maintenance-score/truecallerjs)](https://github.com/sumithemmadi/truecallerjs)
11+
[![Issues](https://img.shields.io/github/issues/sumithemmadi/truecallerjs)](https://github.com/sumithemmadi/truecallerjs/issues)
12+
13+
Welcome to TruecallerJS! This is a library for retrieving phone number details using the Truecaller API. It provides a simple and convenient way to access information about phone numbers in your Node.js, JavaScript, and TypeScript projects.
14+
15+
## Description
16+
17+
TruecallerJS is built to simplify the process of fetching phone number details. With this library, you can easily integrate Truecaller functionality into your Node.js, JavaScript, and TypeScript applications. It abstracts the complexities of interacting with the Truecaller API and provides a streamlined interface for fetching and processing phone number information.
18+
19+
## Features
20+
21+
- **Phone Number Lookup**: Retrieve detailed information about a phone number, including the owner's name, location, and more.
22+
23+
- **Support for Node.js, JavaScript, and TypeScript**: TruecallerJS can be used in Node.js projects, as well as in JavaScript and TypeScript applications.
24+
- **Simple and Lightweight**: TruecallerJS is designed to be easy to use and lightweight.
25+
26+
## Table of Contents
27+
28+
- [TruecallerJS](#truecallerjs)
29+
- [Description](#description)
30+
- [Features](#features)
31+
- [Table of Contents](#table-of-contents)
32+
- [Installation](#installation)
33+
- [Command Line Usage](#command-line-usage)
34+
- [Limitations](#limitations)
35+
- [Usage](#usage)
36+
- [Simple Example](#simple-example)
37+
- [Bulk Search on Multiple Phone Numbers](#bulk-search-on-multiple-phone-numbers)
38+
- [Disclaimer](#disclaimer)
39+
- [Contributing](#contributing)
40+
- [License](#license)
41+
- [Acknowledgments](#acknowledgments)
42+
43+
## Installation
44+
45+
You can install TruecallerJS using npm:
46+
47+
```bash
48+
npm install truecallerjs
49+
```
50+
51+
To use TruecallerJS from the command line
52+
53+
```bash
54+
npm install -g truecallerjs
55+
```
56+
57+
> **Note**: If you are using a version of `truecallerjs` that is older than [1.1.2](https://github.com/sumithemmadi/truecallerjs/tree/truecallerjs-v1.1.2), we recommend referring to the [truecallerjs-v1.1.2](https://github.com/sumithemmadi/truecallerjs/tree/truecallerjs-v1.1.2) documentation for instructions.
58+
> **Note**: If you are using `truecallerjs` version from [1.1.3](https://github.com/sumithemmadi/truecallerjs/tree/truecallerjs-v1.1.2) to [1.1.5](https://github.com/sumithemmadi/truecallerjs/tree/truecallerjs-v1.1.5), please refer to the [truecallerjs-v1.1.5](https://github.com/sumithemmadi/truecallerjs/tree/truecallerjs-v1.1.5) documentation for instructions.
59+
60+
## Command Line Usage
61+
62+
To use TruecallerJS from the command line, you can run the `truecallerjs` command followed by the desired options and arguments.
63+
64+
Here are some examples of the available options:
65+
66+
- `truecallerjs login`: Use this command to log in to your Truecaller account.
67+
- `truecallerjs -s [number]`: Use this command to search for a phone number and retrieve the caller name and related information.
68+
- `truecallerjs --bulksearch, --bs` command is used to performing bulk number searches using the Truecaller service. It allows you to search for multiple phone numbers at once, making it convenient for processing large sets of phone numbers in a single request.
69+
70+
- `truecallerjs --bulksearch, --bs`: Use this command to perform a bulk number search.
71+
- Additional options include `--raw`, `--name`, `--email`, `--json`, `--xml`, `--yaml`, `--text`, `--nc`, `--installationid`, `--verbose`, and `--help`.
72+
73+
For example:
74+
75+
```bash
76+
~$ truecallerjs -s +9199123456789 --json
77+
{
78+
...
79+
"name":"Sumith Emmadi"
80+
...
81+
}
82+
83+
~$ truecallerjs -s +9199123456789 --name
84+
Name : Sumith Emmadi
85+
```
86+
87+
Example for bulk search
88+
89+
```bash
90+
truecallerjs --bulksearch <phone_number_1>,<phone_number_2>,<phone_number_3>,...,<phone_number_n>
91+
```
92+
93+
Replace `<phone_number_1>, <phone_number_2>, ..., <phone_number_n>` with the actual phone numbers you want to search. Separate each phone number with a comma.
94+
95+
```bash
96+
~$ truecallerjs --bs 9912345678,+14051234567,+919987654321
97+
```
98+
99+
> **Note** : If the country code is not specified for a phone number, it will default to using your own country code.
100+
101+
### Limitations
102+
103+
Please note the following limitations when using the `--bulksearch` option:
104+
105+
1. Maximum Number of Phone Numbers: The tool supports searching 30 or fewer phone numbers at once in a single request. If you exceed this limit, you may need to split your input into multiple requests.
106+
107+
2. Formatting: Ensure that the phone numbers are correctly formatted and do not contain any additional characters or spaces. The tool expects the phone numbers to be provided in a comma-separated format.
108+
109+
## Usage
110+
111+
To use the project, start by installing the `truecallerjs` package via npm:
112+
113+
```bash
114+
npm install truecallerjs
115+
```
116+
117+
### Simple Example
118+
119+
Here's a basic example of how to perform a normal search for a phone number:
120+
121+
```js
122+
import truecallerjs, { SearchData, Format } from "truecallerjs";
123+
124+
async function performTruecallerSearch(): Promise<void> {
125+
const searchData: SearchData = {
126+
number: "9912345678",
127+
countryCode: "IN",
128+
installationId: "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug",
129+
};
130+
131+
try {
132+
const response: Format = await truecallerjs.search(searchData);
133+
console.log(response.json());
134+
135+
// Additional response methods:
136+
// console.log(response.xml());
137+
// console.log(response.yaml());
138+
// console.log(response.text());
139+
140+
// Example of available data from the response:
141+
console.log(response.getName()); // "Sumith Emmadi"
142+
console.log(response.getAlternateName()); // "sumith"
143+
console.log(response.getAddresses()); // {....}
144+
console.log(response.getEmailId()); // [email protected]
145+
console.log(response.getCountryDetails()); // {...}
146+
} catch (error) {
147+
console.error("Error occurred:", error);
148+
}
149+
}
150+
151+
performTruecallerSearch();
152+
```
153+
154+
In the above example, the `truecallerjs` package is used to search for a phone number. The `search_data` object contains the necessary parameters, including the number, country code, and installation ID. The response from the `truecallerjs.search()` function provides various methods to access the returned data.
155+
156+
> **Note** : Make sure to log in using the `truecallerjs login` command and obtain your installation ID using the `truecallerjs -i` command.
157+
158+
### Bulk Search on Multiple Phone Numbers
159+
160+
The `truecallerjs` package also supports bulk search on multiple phone numbers:
161+
162+
```js
163+
import truecallerjs, { BulkSearchData, Format } from "truecallerjs";
164+
165+
async function performBulkTruecallerSearch(): Promise<void> {
166+
const countryCode: string = "IN";
167+
const installationId: string = "a1k07--Vgdfyvv_rftf5uuudhuhnkljyvvtfftjuhbuijbhug";
168+
const phoneNumbers: string = "+9912345678,+14051234567,+919987654321";
169+
170+
try {
171+
const response: BulkSearchData = await truecallerjs.bulkSearch(phoneNumbers, countryCode, installationId);
172+
console.log(response);
173+
} catch (error) {
174+
console.error("Error occurred:", error);
175+
}
176+
}
177+
178+
performBulkTruecallerSearch();
179+
180+
```
181+
182+
In this example, the `truecallerjs.bulkSearch()` function is used to perform bulk searches on multiple phone numbers. The `phoneNumbers` parameter should contain the phone numbers separated by commas. The `countryCode` and `installationId` parameters are used to specify the default country code and installation ID, respectively.
183+
184+
> **Note** : Make sure to log in using the `truecallerjs login` command and obtain your installation ID using the `truecallerjs -i` command.
185+
186+
For more details and additional functionalities, please refer to the [documentation](https://github.com/sumithemmadi/truecallerjs/tree/main/docs), including the process for logging in and obtaining the installation ID.
187+
188+
## Disclaimer
189+
190+
The `truecallerjs` tool is not an official Truecaller product. It is a custom script developed by [Sumith Emmadi](https://github.com/sumithemmadi), and its functionality is dependent on the Truecaller service. Please use this tool responsibly and in compliance with the terms of service of Truecaller.
191+
192+
For more information and support, please contact [Sumith Emmadi](https://github.com/sumithemmadi) at <[email protected]> .
193+
194+
## Contributing
195+
196+
Contributions to the `truecallerjs` are not only welcome but highly encouraged!
197+
198+
1. Fork this repository `git clone https://github.com/sumithemmadi/truecallerjs.git`
199+
2. Create a new branch for your contribution.
200+
3. Add your content in the appropriate folder or create a new file.
201+
4. Commit your changes and push them to your forked repository.
202+
5. Open a pull request, explaining the nature of your contribution.
203+
204+
Please note that all contributions should align with the spirit of the repository and be suitable for all audiences. Offensive or inappropriate content will not be accepted.
205+
206+
## License
207+
208+
TruecallerJS is open source and licensed under the MIT License. See the LICENSE file for more information.
209+
210+
## 💝 Sponsor
211+
212+
If you find TruecallerJS helpful or inspiring, consider supporting me through GitHub Sponsors. Your sponsorship helps me dedicate more time and effort to open source development and creating impactful projects.
213+
214+
- **Sponsor Me**: [https://github.com/sponsors/sumithemmadi](https://github.com/sponsors/sumithemmadi/)
215+
- **Paypal**: [paypal.me/sumithemmadi](https://paypal.me/sumithemmadi)
216+
- **UPI ID** : sumithemmadi@paytm
217+
218+
### 💖 Sponsors
219+
220+
[![Sponsors](https://sumithemmadi.github.io/sponsor.svg)](https://github.com/sponsors/sumithemmadi/)
221+
222+
## Acknowledgments
223+
224+
Thank you for choosing TruecallerJS! I hope it helps you retrieve phone number details efficiently.
225+
226+
Repository:
227+
[https://github.com/sumithemmadi/truecallerjs.git](https://github.com/sumithemmadi/truecallerjs.git)

SECURITY.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## Security Policy
2+
3+
### Supported Versions
4+
5+
| Version | Supported |
6+
| ------- | ------------------ |
7+
| 2.2.x | :white_check_mark: |
8+
| 2.1.x | :x: |
9+
| 2.0.x | :x: |
10+
| < 1.1.x | :x: |
11+
| < 1.0.x | :x: |
12+
13+
### Reporting a Vulnerability
14+
15+
To report a security vulnerability, please email [[email protected]](mailto:[email protected]). Provide a detailed description, steps to reproduce, and PoC if possible.
16+
17+
I will acknowledge receipt within 7 days and investigate. If valid, I will release a fix and coordinate disclosure responsibly.
18+
19+
### Security Updates and Support
20+
21+
We only provide security updates for version 2.1.x. Upgrade to the latest supported version for protection.
22+
23+
Thank you for your contributions to a safer environment.

dist/cjs/cli.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env node
2+
export {};

0 commit comments

Comments
 (0)