@foldset/cloudflare 0.0.1 → 0.0.3
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/dist/ai-crawlers/index.d.ts +15 -0
- package/dist/ai-crawlers/index.d.ts.map +1 -0
- package/dist/ai-crawlers/index.js +26 -0
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -0
- package/dist/facilitators/index.d.ts +16 -0
- package/dist/facilitators/index.d.ts.map +1 -0
- package/dist/facilitators/index.js +35 -0
- package/dist/hono.d.ts +2 -0
- package/dist/hono.d.ts.map +1 -0
- package/dist/hono.js +1 -0
- package/dist/index.d.ts +8 -37
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -237
- package/dist/payment/adapter.d.ts +16 -0
- package/dist/payment/adapter.d.ts.map +1 -0
- package/dist/payment/adapter.js +43 -0
- package/dist/payment/handler.d.ts +6 -0
- package/dist/payment/handler.d.ts.map +1 -0
- package/dist/payment/handler.js +86 -0
- package/dist/payment/paywall.d.ts +4 -0
- package/dist/payment/paywall.d.ts.map +1 -0
- package/dist/payment/paywall.js +99 -0
- package/dist/payment/routes.d.ts +5 -0
- package/dist/payment/routes.d.ts.map +1 -0
- package/dist/payment/routes.js +31 -0
- package/dist/payment/settlement.d.ts +8 -0
- package/dist/payment/settlement.d.ts.map +1 -0
- package/dist/payment/settlement.js +27 -0
- package/dist/payment/setup.d.ts +7 -0
- package/dist/payment/setup.d.ts.map +1 -0
- package/dist/payment/setup.js +85 -0
- package/dist/payment-methods/index.d.ts +18 -0
- package/dist/payment-methods/index.d.ts.map +1 -0
- package/dist/payment-methods/index.js +18 -0
- package/dist/restrictions/index.d.ts +16 -0
- package/dist/restrictions/index.d.ts.map +1 -0
- package/dist/restrictions/index.js +18 -0
- package/dist/telemetry/logging.d.ts +18 -0
- package/dist/telemetry/logging.d.ts.map +1 -0
- package/dist/telemetry/logging.js +47 -0
- package/dist/telemetry/sentry.d.ts +8 -0
- package/dist/telemetry/sentry.d.ts.map +1 -0
- package/dist/telemetry/sentry.js +19 -0
- package/dist/types.d.ts +5 -9
- package/dist/types.d.ts.map +1 -0
- package/dist/webhooks/index.d.ts +23 -0
- package/dist/webhooks/index.d.ts.map +1 -0
- package/dist/webhooks/index.js +50 -0
- package/package.json +21 -18
- package/README.md +0 -1
- package/dist/adapter.d.ts +0 -71
- package/dist/adapter.js +0 -99
package/dist/adapter.d.ts
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { HTTPAdapter } from "@x402/core/server";
|
|
2
|
-
import { Context } from "hono";
|
|
3
|
-
/**
|
|
4
|
-
* Hono adapter implementation
|
|
5
|
-
*/
|
|
6
|
-
export declare class HonoAdapter implements HTTPAdapter {
|
|
7
|
-
private c;
|
|
8
|
-
/**
|
|
9
|
-
* Creates a new HonoAdapter instance.
|
|
10
|
-
*
|
|
11
|
-
* @param c - The Hono context object
|
|
12
|
-
*/
|
|
13
|
-
constructor(c: Context);
|
|
14
|
-
/**
|
|
15
|
-
* Gets a header value from the request.
|
|
16
|
-
*
|
|
17
|
-
* @param name - The header name
|
|
18
|
-
* @returns The header value or undefined
|
|
19
|
-
*/
|
|
20
|
-
getHeader(name: string): string | undefined;
|
|
21
|
-
/**
|
|
22
|
-
* Gets the HTTP method of the request.
|
|
23
|
-
*
|
|
24
|
-
* @returns The HTTP method
|
|
25
|
-
*/
|
|
26
|
-
getMethod(): string;
|
|
27
|
-
/**
|
|
28
|
-
* Gets the path of the request.
|
|
29
|
-
*
|
|
30
|
-
* @returns The request path
|
|
31
|
-
*/
|
|
32
|
-
getPath(): string;
|
|
33
|
-
/**
|
|
34
|
-
* Gets the full URL of the request.
|
|
35
|
-
*
|
|
36
|
-
* @returns The full request URL
|
|
37
|
-
*/
|
|
38
|
-
getUrl(): string;
|
|
39
|
-
/**
|
|
40
|
-
* Gets the Accept header from the request.
|
|
41
|
-
*
|
|
42
|
-
* @returns The Accept header value or empty string
|
|
43
|
-
*/
|
|
44
|
-
getAcceptHeader(): string;
|
|
45
|
-
/**
|
|
46
|
-
* Gets the User-Agent header from the request.
|
|
47
|
-
*
|
|
48
|
-
* @returns The User-Agent header value or empty string
|
|
49
|
-
*/
|
|
50
|
-
getUserAgent(): string;
|
|
51
|
-
/**
|
|
52
|
-
* Gets all query parameters from the request URL.
|
|
53
|
-
*
|
|
54
|
-
* @returns Record of query parameter key-value pairs
|
|
55
|
-
*/
|
|
56
|
-
getQueryParams(): Record<string, string | string[]>;
|
|
57
|
-
/**
|
|
58
|
-
* Gets a specific query parameter by name.
|
|
59
|
-
*
|
|
60
|
-
* @param name - The query parameter name
|
|
61
|
-
* @returns The query parameter value(s) or undefined
|
|
62
|
-
*/
|
|
63
|
-
getQueryParam(name: string): string | string[] | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* Gets the parsed request body.
|
|
66
|
-
* Requires appropriate body parsing middleware.
|
|
67
|
-
*
|
|
68
|
-
* @returns The parsed request body
|
|
69
|
-
*/
|
|
70
|
-
getBody(): Promise<unknown>;
|
|
71
|
-
}
|
package/dist/adapter.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hono adapter implementation
|
|
3
|
-
*/
|
|
4
|
-
export class HonoAdapter {
|
|
5
|
-
/**
|
|
6
|
-
* Creates a new HonoAdapter instance.
|
|
7
|
-
*
|
|
8
|
-
* @param c - The Hono context object
|
|
9
|
-
*/
|
|
10
|
-
constructor(c) {
|
|
11
|
-
this.c = c;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Gets a header value from the request.
|
|
15
|
-
*
|
|
16
|
-
* @param name - The header name
|
|
17
|
-
* @returns The header value or undefined
|
|
18
|
-
*/
|
|
19
|
-
getHeader(name) {
|
|
20
|
-
return this.c.req.header(name);
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Gets the HTTP method of the request.
|
|
24
|
-
*
|
|
25
|
-
* @returns The HTTP method
|
|
26
|
-
*/
|
|
27
|
-
getMethod() {
|
|
28
|
-
return this.c.req.method;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Gets the path of the request.
|
|
32
|
-
*
|
|
33
|
-
* @returns The request path
|
|
34
|
-
*/
|
|
35
|
-
getPath() {
|
|
36
|
-
return this.c.req.path;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Gets the full URL of the request.
|
|
40
|
-
*
|
|
41
|
-
* @returns The full request URL
|
|
42
|
-
*/
|
|
43
|
-
getUrl() {
|
|
44
|
-
return this.c.req.url;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Gets the Accept header from the request.
|
|
48
|
-
*
|
|
49
|
-
* @returns The Accept header value or empty string
|
|
50
|
-
*/
|
|
51
|
-
getAcceptHeader() {
|
|
52
|
-
return this.c.req.header("Accept") || "";
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Gets the User-Agent header from the request.
|
|
56
|
-
*
|
|
57
|
-
* @returns The User-Agent header value or empty string
|
|
58
|
-
*/
|
|
59
|
-
getUserAgent() {
|
|
60
|
-
return this.c.req.header("User-Agent") || "";
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Gets all query parameters from the request URL.
|
|
64
|
-
*
|
|
65
|
-
* @returns Record of query parameter key-value pairs
|
|
66
|
-
*/
|
|
67
|
-
getQueryParams() {
|
|
68
|
-
const query = this.c.req.query();
|
|
69
|
-
// Convert single values to match the interface
|
|
70
|
-
const result = {};
|
|
71
|
-
for (const [key, value] of Object.entries(query)) {
|
|
72
|
-
result[key] = value;
|
|
73
|
-
}
|
|
74
|
-
return result;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Gets a specific query parameter by name.
|
|
78
|
-
*
|
|
79
|
-
* @param name - The query parameter name
|
|
80
|
-
* @returns The query parameter value(s) or undefined
|
|
81
|
-
*/
|
|
82
|
-
getQueryParam(name) {
|
|
83
|
-
return this.c.req.query(name);
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Gets the parsed request body.
|
|
87
|
-
* Requires appropriate body parsing middleware.
|
|
88
|
-
*
|
|
89
|
-
* @returns The parsed request body
|
|
90
|
-
*/
|
|
91
|
-
async getBody() {
|
|
92
|
-
try {
|
|
93
|
-
return await this.c.req.json();
|
|
94
|
-
}
|
|
95
|
-
catch {
|
|
96
|
-
return undefined;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|