@xyz17711/company-check 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/company-check)](https://www.npmjs.com/package/@xyz17711/company-check)
5
5
  [![License](https://img.shields.io/npm/l/@xyz17711/company-check)](https://github.com/17711-services/clients/blob/main/LICENSE)
6
6
 
7
- Typed TypeScript client for **🏢 company-check-service**, part of the
7
+ Typed TypeScript client for **company-check-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/company-check
25
25
  ```typescript
26
26
  import { Client } from "@xyz17711/company-check";
27
27
 
28
- const client = new Client("https://api.17711.xyz/registry/🏢 company-check-service");
28
+ const client = new Client("https://api.17711.xyz/registry/company-check-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/company-check";
40
40
 
41
- const client = new Client("https://api.17711.xyz/registry/🏢 company-check-service");
41
+ const client = new Client("https://api.17711.xyz/registry/company-check-service");
42
42
  try {
43
43
  await client.verifyCompany(/* ... */);
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/company-check";
56
56
 
57
- const client = new Client("https://api.17711.xyz/registry/🏢 company-check-service", {
57
+ const client = new Client("https://api.17711.xyz/registry/company-check-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/company-check";
74
74
  import { CompanyCheckToolkit } from "@xyz17711/company-check/langchain";
75
75
 
76
- const client = new Client("https://api.17711.xyz/registry/🏢 company-check-service", { /* ...wallet options... */ });
76
+ const client = new Client("https://api.17711.xyz/registry/company-check-service", { /* ...wallet options... */ });
77
77
  const tools = new CompanyCheckToolkit(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 🏢 company-check-service.
2
+ * Typed HTTP client and request/response interfaces for company-check-service.
3
3
  */
4
4
  import { Client as BaseClient, type ClientOptions } from "@xyz17711/core";
5
5
  export interface Company {
@@ -131,7 +131,7 @@ export interface VerifyCompanyRequest {
131
131
  /** An EU VAT number with its country prefix (`FR22424761419`, `DE811907980`). */
132
132
  vat_number?: string | null;
133
133
  }
134
- /** Typed client for 🏢 company-check-service, e.g. `client.verifyCompany(...)`. */
134
+ /** Typed client for company-check-service, e.g. `client.verifyCompany(...)`. */
135
135
  export declare class Client extends BaseClient {
136
136
  /** Company check (KYB) and business verification: VAT validation (VIES), LEI lookup, registry status and company directors ($0.009, x402) */
137
137
  verifyCompany(request: VerifyCompanyRequest): Promise<VerifyCompanyResponse>;
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Typed HTTP client and request/response interfaces for 🏢 company-check-service.
2
+ * Typed HTTP client and request/response interfaces for company-check-service.
3
3
  */
4
4
  import { Client as BaseClient } from "@xyz17711/core";
5
- /** Typed client for 🏢 company-check-service, e.g. `client.verifyCompany(...)`. */
5
+ /** Typed client for company-check-service, e.g. `client.verifyCompany(...)`. */
6
6
  export class Client extends BaseClient {
7
7
  /** Company check (KYB) and business verification: VAT validation (VIES), LEI lookup, registry status and company directors ($0.009, x402) */
8
8
  async verifyCompany(request) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * LangChain.js tools for 🏢 company-check-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 `company-check/langchain`, never from the package root, so importing the base client never requires them installed.
2
+ * LangChain.js tools for company-check-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 `company-check/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 🏢 company-check-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 `company-check/langchain`, never from the package root, so importing the base client never requires them installed.
2
+ * LangChain.js tools for company-check-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 `company-check/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/company-check",
3
- "version": "0.1.0",
4
- "description": "Generated typed client for the 🏢 company-check-service 17711.xyz microservice.",
3
+ "version": "0.1.1",
4
+ "description": "Typed TypeScript client for the 17711.xyz Company Check 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/company-check"
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
+ "company-check"
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,154 +0,0 @@
1
- /**
2
- * Typed HTTP client and request/response interfaces for 🏢 company-check-service.
3
- */
4
-
5
- import { Client as BaseClient, type ClientOptions } from "@xyz17711/core";
6
-
7
- export interface Company {
8
- /** Main activity code (NAF/APE for France). */
9
- activity_code?: string | null;
10
- address?: string | null;
11
- /** Date of closure (YYYY-MM-DD), when closed. */
12
- closed_at?: string | null;
13
- /** ISO country code of the legal seat. */
14
- country: string;
15
- /** Date of creation (YYYY-MM-DD). */
16
- created_at?: string | null;
17
- /** Employee size bracket, e.g. `50-99`. */
18
- employees?: string | null;
19
- /** SIRET of the head office (France). */
20
- head_office_id?: string | null;
21
- /** Legal form (`SAS`, `SARL`, ...) or its register code. */
22
- legal_form?: string | null;
23
- legal_name: string;
24
- lei?: string | null;
25
- /** Number in the company register (SIREN for France). */
26
- registration_number?: string | null;
27
- /** Size category: `PME`, `ETI`, `GE`. */
28
- size_category?: string | null;
29
- /** `active`, `closed` or `unknown`. */
30
- status: string;
31
- /** Commercial name or acronym, when different. */
32
- trade_name?: string | null;
33
- vat_number?: string | null;
34
- }
35
-
36
- export interface Director {
37
- /** Month and year of birth (`1975-01`) for a person, as published in the register. */
38
- born?: string | null;
39
- /** `person` or `company`. */
40
- kind: string;
41
- /** Full name of the person or the legal entity. */
42
- name: string;
43
- nationality?: string | null;
44
- /** Registration number of a legal-entity director. */
45
- registration_number?: string | null;
46
- /** Role as published (`Président de SAS`, `Directeur Général`, `Commissaire aux comptes titulaire`...). */
47
- role: string;
48
- }
49
-
50
- export interface Financial {
51
- /** Net result, in euros. */
52
- net_result?: number | null;
53
- /** Revenue, in euros. */
54
- revenue?: number | null;
55
- year: number;
56
- }
57
-
58
- export interface Flag {
59
- /** Stable code, e.g. `company.closed`, `vat.invalid`, `vat.name_mismatch`, `lei.lapsed`. */
60
- code: string;
61
- message: string;
62
- /** `high`, `medium`, `low` or `info`. */
63
- severity: string;
64
- }
65
-
66
- export interface LeiParent {
67
- country?: string | null;
68
- legal_name: string;
69
- lei: string;
70
- }
71
-
72
- export interface LeiRecord {
73
- direct_parent?: LeiParent | null;
74
- /** Entity status in the LEI register (`ACTIVE`, `INACTIVE`). */
75
- entity_status: string;
76
- lei: string;
77
- next_renewal?: string | null;
78
- /** Registration status of the LEI (`ISSUED`, `LAPSED`, ...). */
79
- registration_status: string;
80
- ultimate_parent?: LeiParent | null;
81
- }
82
-
83
- export interface Candidate {
84
- city?: string | null;
85
- name: string;
86
- registration_number: string;
87
- status: string;
88
- }
89
-
90
- export interface VatCheck {
91
- /** When the number was validated (UTC). */
92
- checked_at: string;
93
- /** The number as checked, with country prefix. */
94
- number: string;
95
- registered_address?: string | null;
96
- /** Name registered for the VAT number, when the member state discloses it. */
97
- registered_name?: string | null;
98
- /** `valid`, `invalid` or `unavailable` (the EU service did not answer: try again later). */
99
- status: string;
100
- }
101
-
102
- export interface VerifyCompanyResponse {
103
- /** How old this answer is, in seconds (0 for a fresh check). */
104
- age_seconds: number;
105
- company: Company;
106
- /** `high` (identified by a number), `medium` (a clear name match) or `low` (several similar names). */
107
- confidence: string;
108
- /** What this answer does not cover for the company's country. */
109
- coverage_note: string;
110
- /** Officers and statutory auditors published in the register (France only). */
111
- directors: Director[];
112
- /** Revenue and net result of the latest published years (France only). */
113
- financials: Financial[];
114
- /** Things to know: closed company, invalid VAT number, name mismatch, lapsed LEI. */
115
- flags: Flag[];
116
- /** `true` when this answer was served from a stored result. */
117
- from_cache: boolean;
118
- lei?: LeiRecord | null;
119
- /** How the company was identified: `lei`, `vat_number`, `registration_number` or `name`. */
120
- matched_by: string;
121
- /** Other companies that matched a name search (to disambiguate). */
122
- other_candidates: Candidate[];
123
- /** When the registers were queried (UTC). */
124
- retrieved_at: string;
125
- /** The registers consulted. */
126
- sources: string[];
127
- /** VAT number validation, when a VAT number is known. */
128
- vat?: VatCheck | null;
129
- }
130
-
131
- export interface VerifyCompanyRequest {
132
- /** The company's name (`OVH`, `Mistral AI`). Give at least one of `company_name`, `registration_number`, `vat_number` or `lei`. */
133
- company_name?: string | null;
134
- /** ISO 3166-1 alpha-2 country code (`FR`, `DE`) to narrow a name or number search. */
135
- country?: string | null;
136
- /** A Legal Entity Identifier (20 characters). */
137
- lei?: string | null;
138
- /** The oldest answer you accept, in seconds. Omit it for the default (answers up to 6 hours old); `0` forces a fresh check, including a new VAT validation. */
139
- max_age_seconds?: number | null;
140
- /** A company registration number: a French SIREN (9 digits) or SIRET (14 digits), or a number from another register (then give `country`). */
141
- registration_number?: string | null;
142
- /** An EU VAT number with its country prefix (`FR22424761419`, `DE811907980`). */
143
- vat_number?: string | null;
144
- }
145
-
146
- /** Typed client for 🏢 company-check-service, e.g. `client.verifyCompany(...)`. */
147
- export class Client extends BaseClient {
148
- /** Company check (KYB) and business verification: VAT validation (VIES), LEI lookup, registry status and company directors ($0.009, x402) */
149
- async verifyCompany(request: VerifyCompanyRequest): Promise<VerifyCompanyResponse> {
150
- return this.post<VerifyCompanyResponse>("/v1/company-check/verify_company", request);
151
- }
152
- }
153
-
154
- export { ClientOptions };
package/src/langchain.ts DELETED
@@ -1,28 +0,0 @@
1
- /**
2
- * LangChain.js tools for 🏢 company-check-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 `company-check/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 CompanyCheckToolkit {
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.verifyCompany(input),
20
- {
21
- name: "verifyCompany",
22
- description: "Company check (KYB) and business verification: VAT validation (VIES), LEI lookup, registry status and company directors ($0.009, x402)",
23
- schema: z.object({ company_name: z.string().nullable().optional(), country: z.string().nullable().optional(), lei: z.string().nullable().optional(), max_age_seconds: z.number().nullable().optional(), registration_number: z.string().nullable().optional(), vat_number: z.string().nullable().optional() }),
24
- },
25
- ),
26
- ];
27
- }
28
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * Verifies every company-check 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("verifyCompany 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/company-check/verify_company");
15
- return new Response(JSON.stringify({ age_seconds: 0, company: { activity_code: null, address: null, closed_at: null, country: "test", created_at: null, employees: null, head_office_id: null, legal_form: null, legal_name: "test", lei: null, registration_number: null, size_category: null, status: "test", trade_name: null, vat_number: null }, confidence: "test", coverage_note: "test", directors: [], financials: [], flags: [], from_cache: false, lei: null, matched_by: "test", other_candidates: [], retrieved_at: "test", sources: [], vat: null }), { status: 200 });
16
- };
17
- try {
18
- const client = new Client("https://example.test");
19
- const result = await client.verifyCompany({ company_name: null, country: null, lei: null, max_age_seconds: null, registration_number: null, vat_number: null });
20
- assert.ok(result !== undefined);
21
- } finally {
22
- globalThis.fetch = originalFetch;
23
- }
24
- });
@@ -1,16 +0,0 @@
1
- /**
2
- * Verifies every company-check 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 { CompanyCheckToolkit } from "../dist/langchain.js";
9
-
10
- test("verifyCompany tool invoke", async () => {
11
- globalThis.fetch = async () => new Response(JSON.stringify({ age_seconds: 0, company: { activity_code: null, address: null, closed_at: null, country: "test", created_at: null, employees: null, head_office_id: null, legal_form: null, legal_name: "test", lei: null, registration_number: null, size_category: null, status: "test", trade_name: null, vat_number: null }, confidence: "test", coverage_note: "test", directors: [], financials: [], flags: [], from_cache: false, lei: null, matched_by: "test", other_candidates: [], retrieved_at: "test", sources: [], vat: null }), { status: 200 });
12
- const toolkit = new CompanyCheckToolkit(new Client("https://example.test"));
13
- const t = toolkit.getTools().find((x) => x.name === "verifyCompany");
14
- const result = await t.invoke({ company_name: "test", country: "test", lei: "test", max_age_seconds: 0, registration_number: "test", vat_number: "test" });
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
- }