teppi-check 0.1.0
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 +105 -0
- package/npm/checks.d.ts +20 -0
- package/npm/checks.d.ts.map +1 -0
- package/npm/cli.d.ts +3 -0
- package/npm/cli.d.ts.map +1 -0
- package/npm/cli.js +7254 -0
- package/npm/index.d.ts +5 -0
- package/npm/index.d.ts.map +1 -0
- package/npm/index.js +7194 -0
- package/npm/probe.d.ts +31 -0
- package/npm/probe.d.ts.map +1 -0
- package/npm/report.d.ts +5 -0
- package/npm/report.d.ts.map +1 -0
- package/npm/terms.d.ts +31 -0
- package/package.json +40 -0
package/npm/probe.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type Check } from './checks.ts';
|
|
2
|
+
export declare const DEFAULT_USER_AGENT = "node";
|
|
3
|
+
export type ProbeOptions = {
|
|
4
|
+
readonly url: string;
|
|
5
|
+
readonly method?: string;
|
|
6
|
+
readonly body?: string;
|
|
7
|
+
readonly userAgent?: string;
|
|
8
|
+
readonly timeoutMs?: number;
|
|
9
|
+
readonly fetchImpl?: typeof fetch;
|
|
10
|
+
};
|
|
11
|
+
export type ProbeResult = {
|
|
12
|
+
readonly url: string;
|
|
13
|
+
readonly method: string;
|
|
14
|
+
readonly observedAt: string;
|
|
15
|
+
readonly reachable: boolean;
|
|
16
|
+
readonly httpStatus: number | null;
|
|
17
|
+
readonly handshakeMs: number;
|
|
18
|
+
readonly termsSource: string;
|
|
19
|
+
readonly advertised: {
|
|
20
|
+
amount: string;
|
|
21
|
+
asset: string;
|
|
22
|
+
network: string;
|
|
23
|
+
scheme: string;
|
|
24
|
+
}[];
|
|
25
|
+
readonly requestHash: string;
|
|
26
|
+
readonly responseHash: string | null;
|
|
27
|
+
readonly checks: readonly Check[];
|
|
28
|
+
readonly verdict: 'pass' | 'fail';
|
|
29
|
+
};
|
|
30
|
+
export declare function probe(options: ProbeOptions): Promise<ProbeRes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AAS,KAAK,EAAE,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;CAClC,CAAC;AAgBF,wBAAsB,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CA+DvE"}
|
package/npm/report.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ProbeResult } from './probe.ts';
|
|
2
|
+
export declare function shouldColour(env: Record<string, string | undefined>, isTty: boolean): boolean;
|
|
3
|
+
export declare function formatText(result: ProbeResult, colour: boolean): string;
|
|
4
|
+
export declare function formatJson(result: ProbeResult): string;
|
|
5
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAW9C,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAI7F;AASD,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,GAAG,MAAM,CA6CvE;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAEtD"}
|
package/npm/terms.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type PaymentRequirement = {
|
|
2
|
+
readonly scheme?: string;
|
|
3
|
+
readonly network?: string;
|
|
4
|
+
readonly maxAmountRequired?: string;
|
|
5
|
+
readonly amount?: string;
|
|
6
|
+
readonly resource?: string;
|
|
7
|
+
readonly description?: string;
|
|
8
|
+
readonly payTo?: string;
|
|
9
|
+
readonly asset?: string;
|
|
10
|
+
readonly maxTimeoutSeconds?: number;
|
|
11
|
+
readonly inputSchema?: unknown;
|
|
12
|
+
readonly outputSchema?: unknown;
|
|
13
|
+
readonly extra?: Record<string, unknown>;
|
|
14
|
+
};
|
|
15
|
+
export type PaymentTerms = {
|
|
16
|
+
readonly x402Version?: number;
|
|
17
|
+
readonly accepts: readonly PaymentRequirement[];
|
|
18
|
+
readonly error?: string;
|
|
19
|
+
};
|
|
20
|
+
export type TermsSource = 'header' | 'body' | 'none';
|
|
21
|
+
export type ParsedTerms = {
|
|
22
|
+
readonly terms: PaymentTerms | null;
|
|
23
|
+
readonly source: TermsSource;
|
|
24
|
+
readonly parseError: string | null;
|
|
25
|
+
};
|
|
26
|
+
export declare function parseTerms(headers: Headers, body: string): ParsedTerms;
|
|
27
|
+
export declare function priceOf(requirement: PaymentRequirement): string | null;
|
|
28
|
+
export declare function schemasOf(requirement: PaymentRequirement): {
|
|
29
|
+
input: unknown;
|
|
30
|
+
output: unknown;
|
|
31
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "teppi-check",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Probe any paid endpoint and print what it actually returns for the money. Reproduces any entry in the Teppi record.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"x402",
|
|
7
|
+
"402",
|
|
8
|
+
"agent",
|
|
9
|
+
"payments",
|
|
10
|
+
"mcp",
|
|
11
|
+
"verification",
|
|
12
|
+
"machine-delivery-record"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"type": "module",
|
|
16
|
+
"bin": {
|
|
17
|
+
"teppi-check": "./npm/cli.js"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
".": "./npm/index.js"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@teppi/x402": "0.0.0",
|
|
24
|
+
"ajv": "^8.17.1",
|
|
25
|
+
"esbuild": "^0.28.2",
|
|
26
|
+
"tsx": "^4.19.2",
|
|
27
|
+
"typescript": "^5.7.2",
|
|
28
|
+
"vitest": "^4.1.0"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"npm",
|
|
32
|
+
"README.md"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"typecheck": "tsc --build",
|
|
36
|
+
"check": "tsx src/cli.ts",
|
|
37
|
+
"build": "node build.mjs"
|
|
38
|
+
},
|
|
39
|
+
"types": "./npm/index.d.ts"
|
|
40
|
+
}
|