@xyz17711/contact-finder 0.1.0 → 0.1.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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  [![npm](https://img.shields.io/npm/v/@xyz17711/contact-finder)](https://www.npmjs.com/package/@xyz17711/contact-finder)
5
5
  [![License](https://img.shields.io/npm/l/@xyz17711/contact-finder)](https://github.com/17711-services/clients/blob/main/LICENSE)
6
6
 
7
- Typed TypeScript client for **📇 contact-finder-service**, part of the
7
+ Typed TypeScript client for **contact-finder-service**, part of the
8
8
  [17711.xyz](https://api.17711.xyz) microservice fleet -- pay-per-call APIs settled in USDC via
9
9
  [x402](https://x402.org), listed on [x402scan](https://www.x402scan.com/server/f1c7b972-3405-4b75-8b4f-d1bfbd6305ff).
10
10
 
@@ -25,7 +25,7 @@ npm install @xyz17711/contact-finder
25
25
  ```typescript
26
26
  import { Client } from "@xyz17711/contact-finder";
27
27
 
28
- const client = new Client("https://api.17711.xyz/registry/📇 contact-finder-service");
28
+ const client = new Client("https://api.17711.xyz/registry/contact-finder-service");
29
29
  // see the Methods table above for every available call and its request/response type
30
30
  ```
31
31
 
@@ -38,7 +38,7 @@ network, and payee address attached:
38
38
  ```typescript
39
39
  import { Client, PaymentRequiredError } from "@xyz17711/contact-finder";
40
40
 
41
- const client = new Client("https://api.17711.xyz/registry/📇 contact-finder-service");
41
+ const client = new Client("https://api.17711.xyz/registry/contact-finder-service");
42
42
  try {
43
43
  await client.getContacts(/* ... */);
44
44
  } catch (e) {
@@ -54,7 +54,7 @@ own environment/secrets manager, never a literal string in source code:
54
54
  ```typescript
55
55
  import { Client } from "@xyz17711/contact-finder";
56
56
 
57
- const client = new Client("https://api.17711.xyz/registry/📇 contact-finder-service", {
57
+ const client = new Client("https://api.17711.xyz/registry/contact-finder-service", {
58
58
  x402PrivateKey: process.env.X402_PRIVATE_KEY,
59
59
  x402ExpectedNetwork: "eip155:8453", // Base mainnet; use eip155:84532 for Base Sepolia testnet
60
60
  x402MaxPaymentUsdc: 0.01, // refuse any single call above this
@@ -73,7 +73,7 @@ with that same key in this process.
73
73
  import { Client } from "@xyz17711/contact-finder";
74
74
  import { ContactFinderToolkit } from "@xyz17711/contact-finder/langchain";
75
75
 
76
- const client = new Client("https://api.17711.xyz/registry/📇 contact-finder-service", { /* ...wallet options... */ });
76
+ const client = new Client("https://api.17711.xyz/registry/contact-finder-service", { /* ...wallet options... */ });
77
77
  const tools = new ContactFinderToolkit(client).getTools();
78
78
  ```
79
79
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Typed HTTP client and request/response interfaces for 📇 contact-finder-service.
2
+ * Typed HTTP client and request/response interfaces for contact-finder-service.
3
3
  */
4
4
  import { Client as BaseClient, type ClientOptions } from "@xyz17711/core";
5
5
  export interface Contact {
@@ -68,7 +68,7 @@ export interface GetContactsRequest {
68
68
  /** The oldest result you accept, in seconds. Omit it for the default (results up to 12 hours old); `0` forces a fresh read of the website. The response always says how old it is. */
69
69
  max_age_seconds?: number | null;
70
70
  }
71
- /** Typed client for 📇 contact-finder-service, e.g. `client.getContacts(...)`. */
71
+ /** Typed client for contact-finder-service, e.g. `client.getContacts(...)`. */
72
72
  export declare class Client extends BaseClient {
73
73
  /** Contact finder: public business emails, phone numbers, contact forms and support pages of a domain, with role and source ($0.009, x402) */
74
74
  getContacts(request: GetContactsRequest): Promise<GetContactsResponse>;
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Typed HTTP client and request/response interfaces for 📇 contact-finder-service.
2
+ * Typed HTTP client and request/response interfaces for contact-finder-service.
3
3
  */
4
4
  import { Client as BaseClient } from "@xyz17711/core";
5
- /** Typed client for 📇 contact-finder-service, e.g. `client.getContacts(...)`. */
5
+ /** Typed client for contact-finder-service, e.g. `client.getContacts(...)`. */
6
6
  export class Client extends BaseClient {
7
7
  /** Contact finder: public business emails, phone numbers, contact forms and support pages of a domain, with role and source ($0.009, x402) */
8
8
  async getContacts(request) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * LangChain.js tools for 📇 contact-finder-service, grouped in one Toolkit -- one tool per operation, each just an async function (JS has no separate sync form to generate). Requires the `@langchain/core`+`zod` peer dependencies declared in this package's own package.json -- imported from `contact-finder/langchain`, never from the package root, so importing the base client never requires them installed.
2
+ * LangChain.js tools for contact-finder-service, grouped in one Toolkit -- one tool per operation, each just an async function (JS has no separate sync form to generate). Requires the `@langchain/core`+`zod` peer dependencies declared in this package's own package.json -- imported from `contact-finder/langchain`, never from the package root, so importing the base client never requires them installed.
3
3
  */
4
4
  import { z } from "zod";
5
5
  import { Client } from "./index.js";
package/dist/langchain.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * LangChain.js tools for 📇 contact-finder-service, grouped in one Toolkit -- one tool per operation, each just an async function (JS has no separate sync form to generate). Requires the `@langchain/core`+`zod` peer dependencies declared in this package's own package.json -- imported from `contact-finder/langchain`, never from the package root, so importing the base client never requires them installed.
2
+ * LangChain.js tools for contact-finder-service, grouped in one Toolkit -- one tool per operation, each just an async function (JS has no separate sync form to generate). Requires the `@langchain/core`+`zod` peer dependencies declared in this package's own package.json -- imported from `contact-finder/langchain`, never from the package root, so importing the base client never requires them installed.
3
3
  */
4
4
  import { tool } from "@langchain/core/tools";
5
5
  import { z } from "zod";
package/package.json CHANGED
@@ -1,7 +1,35 @@
1
1
  {
2
2
  "name": "@xyz17711/contact-finder",
3
- "version": "0.1.0",
4
- "description": "Generated typed client for the 📇 contact-finder-service 17711.xyz microservice.",
3
+ "version": "0.1.1",
4
+ "description": "Typed TypeScript client for the 17711.xyz Contact Finder API: pay-per-call, settled in USDC via x402.",
5
+ "license": "MIT",
6
+ "author": "17711 Services",
7
+ "homepage": "https://api.17711.xyz",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/17711-services/clients.git",
11
+ "directory": "node/packages/contact-finder"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/17711-services/clients/issues"
15
+ },
16
+ "keywords": [
17
+ "x402",
18
+ "usdc",
19
+ "api-client",
20
+ "pay-per-call",
21
+ "ai-agents",
22
+ "mcp",
23
+ "langchain",
24
+ "contact-finder"
25
+ ],
26
+ "files": [
27
+ "dist",
28
+ "README.md"
29
+ ],
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
5
33
  "type": "module",
6
34
  "main": "dist/index.js",
7
35
  "types": "dist/index.d.ts",
package/src/index.ts DELETED
@@ -1,85 +0,0 @@
1
- /**
2
- * Typed HTTP client and request/response interfaces for 📇 contact-finder-service.
3
- */
4
-
5
- import { Client as BaseClient, type ClientOptions } from "@xyz17711/core";
6
-
7
- export interface Contact {
8
- /** `high` (published as a link or in structured data), `medium` or `low`. */
9
- confidence: string;
10
- /** How it appears there: `mailto`, `text`, `jsonld`, `tel`, `form`, `link`, `probe` (a common address that exists), `security.txt`. */
11
- found_in: string;
12
- /** `email`, `phone`, `form` (a contact form), `page` (a contact, support or help-centre page), `messaging` (WhatsApp, Telegram, Signal, Messenger), `security` (a vulnerability-reporting contact) or `social` (a profile link). */
13
- kind: string;
14
- /** The label published next to it (link text or heading), when there is one. */
15
- label?: string | null;
16
- /** For an e-mail address: whether its domain has mail servers (`false` = it cannot receive mail). */
17
- mx_valid?: boolean | null;
18
- /** `sales`, `support`, `press`, `jobs`, `legal`, `privacy`, `security`, `billing` or `general`. */
19
- role: string;
20
- /** The page where it was found. */
21
- source_url: string;
22
- /** The address, number or link, exactly as published. */
23
- value: string;
24
- }
25
-
26
- export interface DomainMail {
27
- /** DMARC policy: `reject`, `quarantine`, `none` or `absent`. */
28
- dmarc?: string | null;
29
- /** Mail servers (MX) of the website's domain, highest priority first (at most 5). */
30
- mx: string[];
31
- /** Mail platform deduced from the MX records (`google-workspace`, `microsoft-365`, ...). */
32
- provider?: string | null;
33
- /** SPF policy: `strict` (-all), `soft` (~all), `neutral` (?all), `open` (+all) or `none`. */
34
- spf?: string | null;
35
- }
36
-
37
- export interface GetContactsResponse {
38
- /** How old this answer is, in seconds (0 for a fresh read). */
39
- age_seconds: number;
40
- /** Public business contacts: role mailboxes, phones, contact forms, messaging links, security contact and social profiles -- only what is literally published on the pages read. */
41
- contacts: Contact[];
42
- /** The host that was searched, lowercased, without scheme or path. */
43
- domain: string;
44
- /** Mail health of the website's own domain: mail servers, platform, SPF and DMARC policies. */
45
- domain_mail: DomainMail;
46
- /** `true` when this answer was served from a stored result rather than a fresh read. */
47
- from_cache: boolean;
48
- /** Whether a contact form was found. */
49
- has_contact_form: boolean;
50
- /** E-mail addresses that look personal (a named individual) or have no recognizable role: they are not returned, only counted. */
51
- omitted_non_role_addresses: number;
52
- /** How many of the pages used came from a stored copy (fresh enough for `max_age_seconds`). */
53
- pages_from_cache: number;
54
- /** The pages that were actually read. */
55
- pages_read: string[];
56
- /** `true` when the website was found from `company_name`. */
57
- resolved_from_name: boolean;
58
- /** When the website was read to build this list (UTC). */
59
- retrieved_at: string;
60
- /** The first security contact published (security.txt), when there is one. */
61
- security_contact?: string | null;
62
- /** Language of the website (ISO 639-1 code). */
63
- source_language: string;
64
- /** How many pages could not be refreshed and were answered from an older stored copy. */
65
- stale_pages: number;
66
- }
67
-
68
- export interface GetContactsRequest {
69
- /** The company's name, when you do not know its website (e.g. `Mistral AI`): the official site is looked up first. `domain` wins when both are given. */
70
- company_name?: string | null;
71
- /** The company's website: a domain such as `stripe.com` or a full URL (`https://stripe.com/`). Give this or `company_name`. */
72
- domain?: string | null;
73
- /** The oldest result you accept, in seconds. Omit it for the default (results up to 12 hours old); `0` forces a fresh read of the website. The response always says how old it is. */
74
- max_age_seconds?: number | null;
75
- }
76
-
77
- /** Typed client for 📇 contact-finder-service, e.g. `client.getContacts(...)`. */
78
- export class Client extends BaseClient {
79
- /** Contact finder: public business emails, phone numbers, contact forms and support pages of a domain, with role and source ($0.009, x402) */
80
- async getContacts(request: GetContactsRequest): Promise<GetContactsResponse> {
81
- return this.post<GetContactsResponse>("/v1/contact-finder/get_contacts", request);
82
- }
83
- }
84
-
85
- export { ClientOptions };
package/src/langchain.ts DELETED
@@ -1,28 +0,0 @@
1
- /**
2
- * LangChain.js tools for 📇 contact-finder-service, grouped in one Toolkit -- one tool per operation, each just an async function (JS has no separate sync form to generate). Requires the `@langchain/core`+`zod` peer dependencies declared in this package's own package.json -- imported from `contact-finder/langchain`, never from the package root, so importing the base client never requires them installed.
3
- */
4
-
5
- import { tool } from "@langchain/core/tools";
6
- import { z } from "zod";
7
- import { Client } from "./index.js";
8
-
9
- export class ContactFinderToolkit {
10
- private client: Client;
11
-
12
- constructor(client: Client) {
13
- this.client = client;
14
- }
15
-
16
- getTools() {
17
- return [
18
- tool(
19
- async (input) => this.client.getContacts(input),
20
- {
21
- name: "getContacts",
22
- description: "Contact finder: public business emails, phone numbers, contact forms and support pages of a domain, with role and source ($0.009, x402)",
23
- schema: z.object({ company_name: z.string().nullable().optional(), domain: z.string().nullable().optional(), max_age_seconds: z.number().nullable().optional() }),
24
- },
25
- ),
26
- ];
27
- }
28
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * Verifies every contact-finder client method sends a request to the expected path/HTTP verb and parses a well-formed response -- one test per operation, real fetch mocked via a plain reassignment of `globalThis.fetch` (no extra test/mocking dependency). Runs against the COMPILED package (`../dist/index.js`) -- build before testing.
3
- */
4
-
5
- import { test } from "node:test";
6
- import assert from "node:assert/strict";
7
- import { Client } from "../dist/index.js";
8
-
9
- test("getContacts calls the expected path", async () => {
10
- const originalFetch = globalThis.fetch;
11
- globalThis.fetch = async (url, init = {}) => {
12
- const parsed = new URL(url);
13
- assert.equal((init.method ?? "GET").toUpperCase(), "POST");
14
- assert.equal(parsed.pathname, "/v1/contact-finder/get_contacts");
15
- return new Response(JSON.stringify({ age_seconds: 0, contacts: [], domain: "test", domain_mail: { dmarc: null, mx: [], provider: null, spf: null }, from_cache: false, has_contact_form: false, omitted_non_role_addresses: 0, pages_from_cache: 0, pages_read: [], resolved_from_name: false, retrieved_at: "test", security_contact: null, source_language: "test", stale_pages: 0 }), { status: 200 });
16
- };
17
- try {
18
- const client = new Client("https://example.test");
19
- const result = await client.getContacts({ company_name: null, domain: null, max_age_seconds: null });
20
- assert.ok(result !== undefined);
21
- } finally {
22
- globalThis.fetch = originalFetch;
23
- }
24
- });
@@ -1,16 +0,0 @@
1
- /**
2
- * Verifies every contact-finder LangChain tool through the real StructuredTool (`.invoke()`), not just the underlying client method -- catches schema-shape bugs a plain client-method test would miss. Requires the `langchain`/`zod` dev dependencies.
3
- */
4
-
5
- import { test } from "node:test";
6
- import assert from "node:assert/strict";
7
- import { Client } from "../dist/index.js";
8
- import { ContactFinderToolkit } from "../dist/langchain.js";
9
-
10
- test("getContacts tool invoke", async () => {
11
- globalThis.fetch = async () => new Response(JSON.stringify({ age_seconds: 0, contacts: [], domain: "test", domain_mail: { dmarc: null, mx: [], provider: null, spf: null }, from_cache: false, has_contact_form: false, omitted_non_role_addresses: 0, pages_from_cache: 0, pages_read: [], resolved_from_name: false, retrieved_at: "test", security_contact: null, source_language: "test", stale_pages: 0 }), { status: 200 });
12
- const toolkit = new ContactFinderToolkit(new Client("https://example.test"));
13
- const t = toolkit.getTools().find((x) => x.name === "getContacts");
14
- const result = await t.invoke({ company_name: "test", domain: "test", max_age_seconds: 0 });
15
- assert.ok(result !== undefined);
16
- });
package/tsconfig.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "module": "ES2020",
5
- "moduleResolution": "bundler",
6
- "declaration": true,
7
- "outDir": "dist",
8
- "rootDir": "src",
9
- "strict": true,
10
- "esModuleInterop": true,
11
- "skipLibCheck": true
12
- },
13
- "include": [
14
- "src"
15
- ]
16
- }