leadmeteor 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2026 Leadmeteor, SAS. (https://leadmeteor.com)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Leadmeteor Node.js SDK
2
+
3
+ The official Node.js SDK for the [Leadmeteor](https://leadmeteor.com) API.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install leadmeteor
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```typescript
14
+ import Leadmeteor from "leadmeteor";
15
+
16
+ const leadmeteor = new Leadmeteor("sk_your_api_key");
17
+
18
+ // Verify an email
19
+ const { status, checks } = await leadmeteor.emails.verify({
20
+ email: "john@example.com",
21
+ });
22
+
23
+ // Look up a domain
24
+ const domain = await leadmeteor.domains.lookup({
25
+ domain: "example.com",
26
+ });
27
+ ```
28
+
29
+ ## Requirements
30
+
31
+ - Node.js 18+
32
+
33
+ ## License
34
+
35
+ MIT
@@ -0,0 +1,10 @@
1
+ export type ClientOptions = {
2
+ apiKey: string;
3
+ baseUrl?: string;
4
+ };
5
+ export declare class Client {
6
+ private readonly apiKey;
7
+ private readonly baseUrl;
8
+ constructor(options: ClientOptions);
9
+ request<T>(method: string, path: string, params?: Record<string, string>): Promise<T>;
10
+ }
package/dist/client.js ADDED
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Client = void 0;
4
+ const error_1 = require("./error");
5
+ class Client {
6
+ apiKey;
7
+ baseUrl;
8
+ constructor(options) {
9
+ if (!options.apiKey) {
10
+ throw new error_1.LeadmeteorError("API key is required", 0);
11
+ }
12
+ this.apiKey = options.apiKey;
13
+ this.baseUrl = (options.baseUrl ?? "https://api.leadmeteor.com").replace(/\/+$/, "");
14
+ }
15
+ async request(method, path, params) {
16
+ let url = `${this.baseUrl}${path}`;
17
+ if (params) {
18
+ const query = new URLSearchParams(params).toString();
19
+ url += `?${query}`;
20
+ }
21
+ const response = await fetch(url, {
22
+ method,
23
+ headers: {
24
+ Authorization: `Bearer ${this.apiKey}`,
25
+ "Content-Type": "application/json",
26
+ },
27
+ });
28
+ const body = (await response.json());
29
+ if (!response.ok || !body.success) {
30
+ const error = !body.success ? body.error : `Request failed with status ${response.status}`;
31
+ throw new error_1.LeadmeteorError(error, response.status);
32
+ }
33
+ return body.data;
34
+ }
35
+ }
36
+ exports.Client = Client;
@@ -0,0 +1,4 @@
1
+ export declare class LeadmeteorError extends Error {
2
+ readonly status: number;
3
+ constructor(message: string, status: number);
4
+ }
package/dist/error.js ADDED
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LeadmeteorError = void 0;
4
+ class LeadmeteorError extends Error {
5
+ status;
6
+ constructor(message, status) {
7
+ super(message);
8
+ this.name = "LeadmeteorError";
9
+ this.status = status;
10
+ }
11
+ }
12
+ exports.LeadmeteorError = LeadmeteorError;
@@ -0,0 +1,27 @@
1
+ import { type ClientOptions } from "./client";
2
+ import { People } from "./resources/people";
3
+ import { Companies } from "./resources/companies";
4
+ import * as _EmailsModule from "./types/emails";
5
+ import * as _DomainsModule from "./types/domains";
6
+ declare class Leadmeteor {
7
+ readonly emails: Leadmeteor.Emails;
8
+ readonly people: People;
9
+ readonly companies: Companies;
10
+ readonly domains: Leadmeteor.Domains;
11
+ constructor(apiKey: string, options?: Omit<ClientOptions, "apiKey">);
12
+ }
13
+ declare namespace Leadmeteor {
14
+ export import Emails = _EmailsModule.Emails;
15
+ interface Emails {
16
+ verify(params: Emails.EmailVerificationParams): Promise<Emails.EmailVerification>;
17
+ lookup(params: Emails.LookupParams): Promise<unknown>;
18
+ search(params: Emails.SearchParams): Promise<unknown>;
19
+ }
20
+ export import Domains = _DomainsModule.Domains;
21
+ interface Domains {
22
+ lookup(params: Domains.DomainLookupParams): Promise<Domains.DomainLookup>;
23
+ }
24
+ }
25
+ export default Leadmeteor;
26
+ export { Leadmeteor };
27
+ export { LeadmeteorError } from "./error";
package/dist/index.js ADDED
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LeadmeteorError = exports.Leadmeteor = void 0;
4
+ const client_1 = require("./client");
5
+ const emails_1 = require("./resources/emails");
6
+ const people_1 = require("./resources/people");
7
+ const companies_1 = require("./resources/companies");
8
+ const domains_1 = require("./resources/domains");
9
+ class Leadmeteor {
10
+ emails;
11
+ people;
12
+ companies;
13
+ domains;
14
+ constructor(apiKey, options) {
15
+ const client = new client_1.Client({ apiKey, ...options });
16
+ this.emails = new emails_1.EmailsResource(client);
17
+ this.people = new people_1.People(client);
18
+ this.companies = new companies_1.Companies(client);
19
+ this.domains = new domains_1.DomainsResource(client);
20
+ }
21
+ }
22
+ exports.Leadmeteor = Leadmeteor;
23
+ (function (Leadmeteor) {
24
+ })(Leadmeteor || (exports.Leadmeteor = Leadmeteor = {}));
25
+ exports.default = Leadmeteor;
26
+ var error_1 = require("./error");
27
+ Object.defineProperty(exports, "LeadmeteorError", { enumerable: true, get: function () { return error_1.LeadmeteorError; } });
@@ -0,0 +1,7 @@
1
+ import type { Client } from "../client";
2
+ export declare class Companies {
3
+ private readonly client;
4
+ constructor(client: Client);
5
+ lookup(params: Record<string, string>): Promise<unknown>;
6
+ search(params: Record<string, string>): Promise<unknown>;
7
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Companies = void 0;
4
+ class Companies {
5
+ client;
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ async lookup(params) {
10
+ return this.client.request("GET", "/v1/companies/lookup", params);
11
+ }
12
+ async search(params) {
13
+ return this.client.request("GET", "/v1/companies/search", params);
14
+ }
15
+ }
16
+ exports.Companies = Companies;
@@ -0,0 +1,7 @@
1
+ import type { Client } from "../client";
2
+ import type { Domains } from "../types/domains";
3
+ export declare class DomainsResource {
4
+ private readonly client;
5
+ constructor(client: Client);
6
+ lookup(params: Domains.DomainLookupParams): Promise<Domains.DomainLookup>;
7
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DomainsResource = void 0;
4
+ class DomainsResource {
5
+ client;
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ async lookup(params) {
10
+ return this.client.request("GET", "/v1/domains/lookup", {
11
+ domain: params.domain,
12
+ });
13
+ }
14
+ }
15
+ exports.DomainsResource = DomainsResource;
@@ -0,0 +1,9 @@
1
+ import type { Client } from "../client";
2
+ import type { Emails } from "../types/emails";
3
+ export declare class EmailsResource {
4
+ private readonly client;
5
+ constructor(client: Client);
6
+ verify(params: Emails.EmailVerificationParams): Promise<Emails.EmailVerification>;
7
+ lookup(params: Emails.LookupParams): Promise<unknown>;
8
+ search(params: Emails.SearchParams): Promise<unknown>;
9
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmailsResource = void 0;
4
+ class EmailsResource {
5
+ client;
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ async verify(params) {
10
+ return this.client.request("GET", "/v1/emails/verify", {
11
+ email: params.email,
12
+ });
13
+ }
14
+ async lookup(params) {
15
+ const query = {};
16
+ if ("email" in params) {
17
+ query.email = params.email;
18
+ }
19
+ else if ("linkedin_url" in params) {
20
+ query.linkedin_url = params.linkedin_url;
21
+ }
22
+ else {
23
+ query.name = params.name;
24
+ query.company = params.company;
25
+ }
26
+ return this.client.request("GET", "/v1/emails/lookup", query);
27
+ }
28
+ async search(params) {
29
+ return this.client.request("GET", "/v1/emails/search", {
30
+ domain: params.domain,
31
+ });
32
+ }
33
+ }
34
+ exports.EmailsResource = EmailsResource;
@@ -0,0 +1,7 @@
1
+ import type { Client } from "../client";
2
+ export declare class People {
3
+ private readonly client;
4
+ constructor(client: Client);
5
+ lookup(params: Record<string, string>): Promise<unknown>;
6
+ search(params: Record<string, string>): Promise<unknown>;
7
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.People = void 0;
4
+ class People {
5
+ client;
6
+ constructor(client) {
7
+ this.client = client;
8
+ }
9
+ async lookup(params) {
10
+ return this.client.request("GET", "/v1/people/lookup", params);
11
+ }
12
+ async search(params) {
13
+ return this.client.request("GET", "/v1/people/search", params);
14
+ }
15
+ }
16
+ exports.People = People;
@@ -0,0 +1,10 @@
1
+ export type ApiSuccessResponse<T> = {
2
+ success: true;
3
+ data: T;
4
+ };
5
+ export type ApiErrorResponse = {
6
+ success: false;
7
+ error: string;
8
+ };
9
+ export type ApiResponse<T> = ApiSuccessResponse<T> | ApiErrorResponse;
10
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // Auto-generated from API Zod schemas — do not edit manually.
3
+ // Run `npm run build` to regenerate.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1,11 @@
1
+ export declare namespace Domains {
2
+ type DomainLookupParams = {
3
+ domain: string;
4
+ };
5
+ type DomainLookup = {
6
+ domain: string;
7
+ expires_at?: string;
8
+ registered_at?: string;
9
+ registrar?: string;
10
+ };
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // Auto-generated from our API
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,33 @@
1
+ export declare namespace Emails {
2
+ type EmailVerificationParams = {
3
+ email: string;
4
+ };
5
+ type EmailVerification = {
6
+ status: Status;
7
+ checks: Checks;
8
+ };
9
+ type LookupParams = EmailVerificationParams | {
10
+ name: string;
11
+ company: string;
12
+ } | {
13
+ linkedin_url: string;
14
+ };
15
+ type SearchParams = {
16
+ domain: string;
17
+ email?: string;
18
+ };
19
+ type CheckStatus = Status;
20
+ type Status = "valid" | "skipped" | "invalid" | "unknown" | "risky";
21
+ type CheckResult = {
22
+ status: Status;
23
+ passed: boolean;
24
+ reason?: string;
25
+ };
26
+ type Checks = {
27
+ format: CheckResult;
28
+ disposable: CheckResult;
29
+ dns: CheckResult;
30
+ mx: CheckResult;
31
+ smtp: CheckResult;
32
+ };
33
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // Auto-generated from our API
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./emails";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // Auto-generated from our API
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ __exportStar(require("./emails"), exports);
19
+ //# sourceMappingURL=index.js.map
package/package.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "leadmeteor",
3
+ "version": "0.0.1",
4
+ "description": "Official Leadmeteor SDK for Node.js",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist"
9
+ ],
10
+ "scripts": {
11
+ "prebuild": "node scripts/generate-types.mjs",
12
+ "build": "tsc",
13
+ "prepublishOnly": "npm run build"
14
+ },
15
+ "keywords": ["leadmeteor", "email-verification", "sdk"],
16
+ "license": "MIT",
17
+ "devDependencies": {
18
+ "typescript": "^5.9.3"
19
+ }
20
+ }