@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.
Files changed (54) hide show
  1. package/dist/ai-crawlers/index.d.ts +15 -0
  2. package/dist/ai-crawlers/index.d.ts.map +1 -0
  3. package/dist/ai-crawlers/index.js +26 -0
  4. package/dist/config.d.ts +2 -0
  5. package/dist/config.d.ts.map +1 -0
  6. package/dist/config.js +1 -0
  7. package/dist/facilitators/index.d.ts +16 -0
  8. package/dist/facilitators/index.d.ts.map +1 -0
  9. package/dist/facilitators/index.js +35 -0
  10. package/dist/hono.d.ts +2 -0
  11. package/dist/hono.d.ts.map +1 -0
  12. package/dist/hono.js +1 -0
  13. package/dist/index.d.ts +8 -37
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +1 -237
  16. package/dist/payment/adapter.d.ts +16 -0
  17. package/dist/payment/adapter.d.ts.map +1 -0
  18. package/dist/payment/adapter.js +43 -0
  19. package/dist/payment/handler.d.ts +6 -0
  20. package/dist/payment/handler.d.ts.map +1 -0
  21. package/dist/payment/handler.js +86 -0
  22. package/dist/payment/paywall.d.ts +4 -0
  23. package/dist/payment/paywall.d.ts.map +1 -0
  24. package/dist/payment/paywall.js +99 -0
  25. package/dist/payment/routes.d.ts +5 -0
  26. package/dist/payment/routes.d.ts.map +1 -0
  27. package/dist/payment/routes.js +31 -0
  28. package/dist/payment/settlement.d.ts +8 -0
  29. package/dist/payment/settlement.d.ts.map +1 -0
  30. package/dist/payment/settlement.js +27 -0
  31. package/dist/payment/setup.d.ts +7 -0
  32. package/dist/payment/setup.d.ts.map +1 -0
  33. package/dist/payment/setup.js +85 -0
  34. package/dist/payment-methods/index.d.ts +18 -0
  35. package/dist/payment-methods/index.d.ts.map +1 -0
  36. package/dist/payment-methods/index.js +18 -0
  37. package/dist/restrictions/index.d.ts +16 -0
  38. package/dist/restrictions/index.d.ts.map +1 -0
  39. package/dist/restrictions/index.js +18 -0
  40. package/dist/telemetry/logging.d.ts +18 -0
  41. package/dist/telemetry/logging.d.ts.map +1 -0
  42. package/dist/telemetry/logging.js +47 -0
  43. package/dist/telemetry/sentry.d.ts +8 -0
  44. package/dist/telemetry/sentry.d.ts.map +1 -0
  45. package/dist/telemetry/sentry.js +19 -0
  46. package/dist/types.d.ts +5 -9
  47. package/dist/types.d.ts.map +1 -0
  48. package/dist/webhooks/index.d.ts +23 -0
  49. package/dist/webhooks/index.d.ts.map +1 -0
  50. package/dist/webhooks/index.js +50 -0
  51. package/package.json +21 -18
  52. package/README.md +0 -1
  53. package/dist/adapter.d.ts +0 -71
  54. 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
- }