@xyz17711/ip-blocklist 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
@@ -18,7 +18,7 @@ npm install @xyz17711/ip-blocklist
18
18
 
19
19
  | Method | Description |
20
20
  | --- | --- |
21
- | `checkIp` | Checks whether an IPv4 address appears on any of several public IP blocklists ($0.002, x402) |
21
+ | `checkIp` | IP reputation check: is this IPv4 address on a public threat blocklist (Tor exit nodes, botnets, spam networks) ($0.010, x402) |
22
22
 
23
23
  ## Quickstart
24
24
 
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export interface CheckIpResponse {
17
17
  }
18
18
  /** Typed client for ip-blocklist, e.g. `client.checkIp(...)`. */
19
19
  export declare class Client extends BaseClient {
20
- /** Checks whether an IPv4 address appears on any of several public IP blocklists ($0.002, x402) */
20
+ /** IP reputation check: is this IPv4 address on a public threat blocklist (Tor exit nodes, botnets, spam networks) ($0.010, x402) */
21
21
  checkIp(params: {
22
22
  ip: string;
23
23
  }): Promise<CheckIpResponse>;
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@
4
4
  import { Client as BaseClient } from "@xyz17711/core";
5
5
  /** Typed client for ip-blocklist, e.g. `client.checkIp(...)`. */
6
6
  export class Client extends BaseClient {
7
- /** Checks whether an IPv4 address appears on any of several public IP blocklists ($0.002, x402) */
7
+ /** IP reputation check: is this IPv4 address on a public threat blocklist (Tor exit nodes, botnets, spam networks) ($0.010, x402) */
8
8
  async checkIp(params) {
9
9
  return this.get("/v1/ip-blocklist/check", { ip: params.ip });
10
10
  }
package/dist/langchain.js CHANGED
@@ -11,7 +11,7 @@ export class IpBlocklistToolkit {
11
11
  return [
12
12
  tool(async (input) => this.client.checkIp(input), {
13
13
  name: "checkIp",
14
- description: "Checks whether an IPv4 address appears on any of several public IP blocklists ($0.002, x402)",
14
+ description: "IP reputation check: is this IPv4 address on a public threat blocklist (Tor exit nodes, botnets, spam networks) ($0.010, x402)",
15
15
  schema: z.object({ ip: z.string() }),
16
16
  }),
17
17
  ];
package/package.json CHANGED
@@ -1,7 +1,35 @@
1
1
  {
2
2
  "name": "@xyz17711/ip-blocklist",
3
- "version": "0.1.0",
4
- "description": "Generated typed client for the ip-blocklist 17711.xyz microservice.",
3
+ "version": "0.1.1",
4
+ "description": "Typed TypeScript client for the 17711.xyz Ip Blocklist 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/ip-blocklist"
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
+ "ip-blocklist"
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,30 +0,0 @@
1
- /**
2
- * Typed HTTP client and request/response interfaces for ip-blocklist.
3
- */
4
-
5
- import { Client as BaseClient, type ClientOptions } from "@xyz17711/core";
6
-
7
- export interface BlocklistMatch {
8
- /** The specific CIDR entry from that source that contains the queried IP. */
9
- cidr: string;
10
- /** Which source matched, e.g. `"firehol-level1"`. */
11
- source: string;
12
- }
13
-
14
- export interface CheckIpResponse {
15
- /** `true` if `matches` is non-empty -- a convenience flag, equivalent to `!matches.is_empty()`. */
16
- banned: boolean;
17
- ip: string;
18
- /** Every source that contains this IP, not just the first one found -- an IP flagged by several sources is a stronger signal than one flagged by a single list. */
19
- matches: BlocklistMatch[];
20
- }
21
-
22
- /** Typed client for ip-blocklist, e.g. `client.checkIp(...)`. */
23
- export class Client extends BaseClient {
24
- /** Checks whether an IPv4 address appears on any of several public IP blocklists ($0.002, x402) */
25
- async checkIp(params: { ip: string }): Promise<CheckIpResponse> {
26
- return this.get<CheckIpResponse>("/v1/ip-blocklist/check", { ip: params.ip });
27
- }
28
- }
29
-
30
- export { ClientOptions };
package/src/langchain.ts DELETED
@@ -1,28 +0,0 @@
1
- /**
2
- * LangChain.js tools for ip-blocklist, 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 `ip-blocklist/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 IpBlocklistToolkit {
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.checkIp(input),
20
- {
21
- name: "checkIp",
22
- description: "Checks whether an IPv4 address appears on any of several public IP blocklists ($0.002, x402)",
23
- schema: z.object({ ip: z.string() }),
24
- },
25
- ),
26
- ];
27
- }
28
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * Verifies every ip-blocklist 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("checkIp 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(), "GET");
14
- assert.equal(parsed.pathname, "/v1/ip-blocklist/check");
15
- return new Response(JSON.stringify({ banned: false, ip: "test", matches: [] }), { status: 200 });
16
- };
17
- try {
18
- const client = new Client("https://example.test");
19
- const result = await client.checkIp({ ip: "test" });
20
- assert.ok(result !== undefined);
21
- } finally {
22
- globalThis.fetch = originalFetch;
23
- }
24
- });
@@ -1,16 +0,0 @@
1
- /**
2
- * Verifies every ip-blocklist 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 { IpBlocklistToolkit } from "../dist/langchain.js";
9
-
10
- test("checkIp tool invoke", async () => {
11
- globalThis.fetch = async () => new Response(JSON.stringify({ banned: false, ip: "test", matches: [] }), { status: 200 });
12
- const toolkit = new IpBlocklistToolkit(new Client("https://example.test"));
13
- const t = toolkit.getTools().find((x) => x.name === "checkIp");
14
- const result = await t.invoke({ ip: "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
- }