@faremeter/middleware 0.16.0 → 0.17.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.
@@ -1,8 +1,20 @@
1
+ /**
2
+ * Configuration options for the AgedLRUCache.
3
+ */
1
4
  export type AgedLRUCacheOpts = {
5
+ /** Maximum number of entries. Defaults to 256. */
2
6
  capacity?: number;
7
+ /** Maximum age in milliseconds before entries expire. Defaults to 30000. */
3
8
  maxAge?: number;
9
+ /** Custom time function for testing. Defaults to Date.now. */
4
10
  now?: () => number;
5
11
  };
12
+ /**
13
+ * An LRU cache with time-based expiration.
14
+ *
15
+ * Entries are evicted when they exceed maxAge or when the cache reaches
16
+ * capacity (least recently used entries are removed first).
17
+ */
6
18
  export declare class AgedLRUCache<K, V> {
7
19
  private maxAge;
8
20
  private capacity;
@@ -1 +1 @@
1
- {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/cache.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,CAAC;AAEF,qBAAa,YAAY,CAAC,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,KAAK,CAAsC;IACnD,OAAO,CAAC,GAAG,CAAe;gBAEd,IAAI,GAAE,gBAAqB;IAOvC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAiB1B,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAY3B,IAAW,IAAI,WAEd;CACF"}
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/cache.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;GAKG;AACH,qBAAa,YAAY,CAAC,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,KAAK,CAAsC;IACnD,OAAO,CAAC,GAAG,CAAe;gBAEd,IAAI,GAAE,gBAAqB;IAOvC,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAiB1B,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAY3B,IAAW,IAAI,WAEd;CACF"}
package/dist/src/cache.js CHANGED
@@ -1,3 +1,9 @@
1
+ /**
2
+ * An LRU cache with time-based expiration.
3
+ *
4
+ * Entries are evicted when they exceed maxAge or when the cache reaches
5
+ * capacity (least recently used entries are removed first).
6
+ */
1
7
  export class AgedLRUCache {
2
8
  maxAge;
3
9
  capacity;
@@ -1,26 +1,54 @@
1
- import { type x402PaymentRequirements, type x402PaymentPayload, x402VerifyResponse, x402SettleResponse } from "@faremeter/types/x402";
1
+ import { type x402PaymentRequirements as x402PaymentRequirementsV1, type x402PaymentPayload as x402PaymentPayloadV1, type x402VerifyResponse as x402VerifyResponseV1, x402SettleResponse as x402SettleResponseV1 } from "@faremeter/types/x402";
2
+ import { type x402PaymentRequirements, type x402PaymentPayload, type x402ResourceInfo, x402VerifyResponse, x402SettleResponse } from "@faremeter/types/x402v2";
2
3
  import { type AgedLRUCacheOpts } from "./cache.js";
3
- export declare function findMatchingPaymentRequirements(accepts: x402PaymentRequirements[], payload: x402PaymentPayload): {
4
+ /**
5
+ * Finds the payment requirement that matches the client's v1 payment payload.
6
+ *
7
+ * @param accepts - Array of accepted payment requirements from the facilitator
8
+ * @param payload - The client's payment payload
9
+ * @returns The matching requirement, or undefined if no match found
10
+ */
11
+ export declare function findMatchingPaymentRequirements(accepts: x402PaymentRequirementsV1[], payload: x402PaymentPayloadV1): {
4
12
  scheme: string;
5
13
  network: string;
6
14
  maxAmountRequired: string;
7
15
  resource: string;
8
16
  description: string;
9
- mimeType: string;
10
17
  payTo: string;
11
18
  maxTimeoutSeconds: number;
12
19
  asset: string;
20
+ mimeType?: string;
13
21
  outputSchema?: object;
14
22
  extra?: object;
15
23
  } | undefined;
24
+ /**
25
+ * Finds the payment requirement that matches the client's v2 payment payload.
26
+ *
27
+ * @param accepts - Array of accepted payment requirements from the facilitator
28
+ * @param payload - The client's v2 payment payload
29
+ * @returns The matching requirement, or undefined if no match found
30
+ */
31
+ export declare function findMatchingPaymentRequirementsV2(accepts: x402PaymentRequirements[], payload: x402PaymentPayload): x402PaymentRequirements | undefined;
32
+ /**
33
+ * Validates that a facilitator response is successful, throwing if not.
34
+ *
35
+ * @param res - The Response from the facilitator
36
+ */
16
37
  export declare function gateGetPaymentRequiredResponse(res: Response): void;
17
- export type RelaxedRequirements = Partial<x402PaymentRequirements>;
38
+ export type RelaxedRequirements = Partial<x402PaymentRequirementsV1>;
39
+ export type RelaxedRequirementsV2 = Partial<x402PaymentRequirements>;
18
40
  type getPaymentRequiredResponseArgs = {
19
41
  facilitatorURL: string;
20
42
  accepts: RelaxedRequirements[];
21
43
  resource: string;
22
44
  fetch?: typeof fetch;
23
45
  };
46
+ /**
47
+ * Fetches v1 payment requirements from the facilitator's /accepts endpoint.
48
+ *
49
+ * @param args - Arguments including facilitator URL and accepted payment types
50
+ * @returns The validated payment required response from the facilitator
51
+ */
24
52
  export declare function getPaymentRequiredResponse(args: getPaymentRequiredResponseArgs): Promise<{
25
53
  x402Version: number;
26
54
  accepts: {
@@ -29,56 +57,189 @@ export declare function getPaymentRequiredResponse(args: getPaymentRequiredRespo
29
57
  maxAmountRequired: string;
30
58
  resource: string;
31
59
  description: string;
32
- mimeType: string;
33
60
  payTo: string;
34
61
  maxTimeoutSeconds: number;
35
62
  asset: string;
63
+ mimeType?: string;
36
64
  outputSchema?: object;
37
65
  extra?: object;
38
66
  }[];
67
+ error: string;
68
+ }>;
69
+ type getPaymentRequiredResponseV2Args = {
70
+ facilitatorURL: string;
71
+ accepts: RelaxedRequirementsV2[];
72
+ resource: x402ResourceInfo;
73
+ fetch?: typeof fetch;
74
+ };
75
+ /**
76
+ * Fetches v2 payment requirements from the facilitator's /accepts endpoint.
77
+ *
78
+ * @param args - Arguments including facilitator URL, resource info, and accepted payment types
79
+ * @returns The validated v2 payment required response from the facilitator
80
+ */
81
+ export declare function getPaymentRequiredResponseV2(args: getPaymentRequiredResponseV2Args): Promise<{
82
+ x402Version: 2;
83
+ resource: {
84
+ url: string;
85
+ description?: string;
86
+ mimeType?: string;
87
+ };
88
+ accepts: {
89
+ scheme: string;
90
+ network: string;
91
+ amount: string;
92
+ asset: string;
93
+ payTo: string;
94
+ maxTimeoutSeconds: number;
95
+ extra?: object;
96
+ }[];
39
97
  error?: string;
98
+ extensions?: object;
40
99
  }>;
41
- type PossibleStatusCodes = 402;
100
+ type PossibleStatusCodes = 400 | 402;
42
101
  type PossibleJSONResponse = object;
102
+ /**
103
+ * Configuration for which x402 protocol versions the middleware supports.
104
+ * At least one version must be enabled.
105
+ */
106
+ export type SupportedVersionsConfig = {
107
+ /** Support x402 v1 protocol (JSON body responses, X-PAYMENT header). Default: true */
108
+ x402v1?: boolean;
109
+ /** Support x402 v2 protocol (PAYMENT-REQUIRED header, PAYMENT-SIGNATURE header). Default: false */
110
+ x402v2?: boolean;
111
+ };
112
+ /**
113
+ * Resolve and validate supported versions config.
114
+ * Returns resolved config with defaults applied.
115
+ * Throws if configuration is invalid.
116
+ */
117
+ export declare function resolveSupportedVersions(config?: SupportedVersionsConfig): Required<SupportedVersionsConfig>;
118
+ /**
119
+ * Common configuration arguments shared by all middleware implementations.
120
+ */
43
121
  export type CommonMiddlewareArgs = {
122
+ /** URL of the facilitator service. */
44
123
  facilitatorURL: string;
124
+ /** Payment requirements this endpoint accepts. Can be flat or nested arrays. */
45
125
  accepts: (RelaxedRequirements | RelaxedRequirements[])[];
126
+ /** Optional cache configuration for payment requirements responses. */
46
127
  cacheConfig?: createPaymentRequiredResponseCacheOpts;
128
+ /** Which x402 protocol versions to support. */
129
+ supportedVersions?: SupportedVersionsConfig;
130
+ };
131
+ export type SettleResultV1<MiddlewareResponse> = {
132
+ success: true;
133
+ facilitatorResponse: x402SettleResponseV1;
134
+ } | {
135
+ success: false;
136
+ errorResponse: MiddlewareResponse;
47
137
  };
48
- export type SettleResult<MiddlewareResponse> = {
138
+ export type SettleResultV2<MiddlewareResponse> = {
49
139
  success: true;
50
140
  facilitatorResponse: x402SettleResponse;
51
141
  } | {
52
142
  success: false;
53
143
  errorResponse: MiddlewareResponse;
54
144
  };
55
- export type VerifyResult<MiddlewareResponse> = {
145
+ export type SettleResult<MiddlewareResponse> = SettleResultV1<MiddlewareResponse> | SettleResultV2<MiddlewareResponse>;
146
+ export type VerifyResultV1<MiddlewareResponse> = {
147
+ success: true;
148
+ facilitatorResponse: x402VerifyResponseV1;
149
+ } | {
150
+ success: false;
151
+ errorResponse: MiddlewareResponse;
152
+ };
153
+ export type VerifyResultV2<MiddlewareResponse> = {
56
154
  success: true;
57
155
  facilitatorResponse: x402VerifyResponse;
58
156
  } | {
59
157
  success: false;
60
158
  errorResponse: MiddlewareResponse;
61
159
  };
62
- export type MiddlewareBodyContext<MiddlewareResponse> = {
160
+ export type VerifyResult<MiddlewareResponse> = VerifyResultV1<MiddlewareResponse> | VerifyResultV2<MiddlewareResponse>;
161
+ /**
162
+ * Context provided to the middleware body handler for v1 protocol requests.
163
+ * Contains payment information and functions to verify or settle the payment.
164
+ */
165
+ export type MiddlewareBodyContextV1<MiddlewareResponse> = {
166
+ protocolVersion: 1;
167
+ paymentRequirements: x402PaymentRequirementsV1;
168
+ paymentPayload: x402PaymentPayloadV1;
169
+ settle: () => Promise<SettleResultV1<MiddlewareResponse>>;
170
+ verify: () => Promise<VerifyResultV1<MiddlewareResponse>>;
171
+ };
172
+ /**
173
+ * Context provided to the middleware body handler for v2 protocol requests.
174
+ * Contains payment information and functions to verify or settle the payment.
175
+ */
176
+ export type MiddlewareBodyContextV2<MiddlewareResponse> = {
177
+ protocolVersion: 2;
63
178
  paymentRequirements: x402PaymentRequirements;
64
179
  paymentPayload: x402PaymentPayload;
65
- settle: () => Promise<SettleResult<MiddlewareResponse>>;
66
- verify: () => Promise<VerifyResult<MiddlewareResponse>>;
180
+ settle: () => Promise<SettleResultV2<MiddlewareResponse>>;
181
+ verify: () => Promise<VerifyResultV2<MiddlewareResponse>>;
67
182
  };
68
- export type HandleMiddlewareRequestArgs<MiddlewareResponse = unknown> = CommonMiddlewareArgs & {
183
+ /**
184
+ * Context provided to the middleware body handler.
185
+ * Use protocolVersion to discriminate between v1 and v2 request types.
186
+ */
187
+ export type MiddlewareBodyContext<MiddlewareResponse> = MiddlewareBodyContextV1<MiddlewareResponse> | MiddlewareBodyContextV2<MiddlewareResponse>;
188
+ /**
189
+ * Arguments for the core middleware request handler.
190
+ * Framework-specific middleware implementations adapt their request/response
191
+ * objects to this interface.
192
+ */
193
+ export type HandleMiddlewareRequestArgs<MiddlewareResponse = unknown> = Omit<CommonMiddlewareArgs, "supportedVersions"> & {
194
+ /** The resource URL being accessed. */
69
195
  resource: string;
196
+ /** Function to retrieve a request header value. */
70
197
  getHeader: (key: string) => string | undefined;
198
+ /** Function to fetch v1 payment requirements from the facilitator. */
71
199
  getPaymentRequiredResponse: typeof getPaymentRequiredResponse;
72
- sendJSONResponse: (status: PossibleStatusCodes, obj: PossibleJSONResponse) => MiddlewareResponse;
200
+ /** Optional function to fetch v2 payment requirements from the facilitator. */
201
+ getPaymentRequiredResponseV2?: typeof getPaymentRequiredResponseV2;
202
+ /** Resolved supported versions configuration. */
203
+ supportedVersions: Required<SupportedVersionsConfig>;
204
+ /** Function to send a JSON response with optional headers. */
205
+ sendJSONResponse: (status: PossibleStatusCodes, body?: PossibleJSONResponse, headers?: Record<string, string>) => MiddlewareResponse;
206
+ /** Handler function called when a valid payment is received. */
73
207
  body: (context: MiddlewareBodyContext<MiddlewareResponse>) => Promise<MiddlewareResponse | undefined>;
208
+ /** Optional function to set a response header. */
209
+ setResponseHeader?: (key: string, value: string) => void;
210
+ /** Optional custom fetch function for facilitator requests. */
74
211
  fetch?: typeof fetch;
75
212
  };
213
+ /**
214
+ * Core middleware request handler that processes x402 payment flows.
215
+ *
216
+ * This function handles both v1 and v2 protocol versions, validates payment
217
+ * headers, communicates with the facilitator, and delegates to the body
218
+ * handler when payment is valid.
219
+ *
220
+ * @param args - Handler arguments including framework-specific adapters
221
+ * @returns The middleware response, or undefined if the body handler should continue
222
+ */
76
223
  export declare function handleMiddlewareRequest<MiddlewareResponse>(args: HandleMiddlewareRequestArgs<MiddlewareResponse>): Promise<MiddlewareResponse | undefined>;
224
+ /**
225
+ * Configuration options for the payment requirements response cache.
226
+ */
77
227
  export type createPaymentRequiredResponseCacheOpts = AgedLRUCacheOpts & {
228
+ /** If true, disables caching entirely. */
78
229
  disable?: boolean;
79
230
  };
231
+ /**
232
+ * Creates a cached wrapper around payment requirements fetching functions.
233
+ *
234
+ * The cache reduces load on the facilitator by reusing recent responses
235
+ * for identical requirements.
236
+ *
237
+ * @param opts - Cache configuration options
238
+ * @returns Object containing cached getPaymentRequiredResponse functions
239
+ */
80
240
  export declare function createPaymentRequiredResponseCache(opts?: createPaymentRequiredResponseCacheOpts): {
81
241
  getPaymentRequiredResponse: typeof getPaymentRequiredResponse;
242
+ getPaymentRequiredResponseV2: typeof getPaymentRequiredResponseV2;
82
243
  };
83
244
  export {};
84
245
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,uBA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