@peac/adapter-x402 0.10.6 → 0.11.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/LICENSE +1 -1
- package/dist/carrier.d.ts +67 -0
- package/dist/carrier.d.ts.map +1 -0
- package/dist/carrier.js +145 -0
- package/dist/carrier.js.map +1 -0
- package/dist/challenge.d.ts +30 -0
- package/dist/challenge.d.ts.map +1 -0
- package/dist/challenge.js +26 -0
- package/dist/challenge.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/map.d.ts +11 -0
- package/dist/map.d.ts.map +1 -1
- package/dist/map.js +21 -0
- package/dist/map.js.map +1 -1
- package/package.json +6 -6
package/LICENSE
CHANGED
|
@@ -175,7 +175,7 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
|
175
175
|
|
|
176
176
|
END OF TERMS AND CONDITIONS
|
|
177
177
|
|
|
178
|
-
Copyright 2025 PEAC Protocol Contributors
|
|
178
|
+
Copyright 2025-2026 PEAC Protocol Contributors
|
|
179
179
|
|
|
180
180
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
181
|
you may not use this file except in compliance with the License.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* x402 carrier adapter for Evidence Carrier Contract (DD-124).
|
|
3
|
+
*
|
|
4
|
+
* v0.11.1: header-only transport via PEAC-Receipt (compact JWS).
|
|
5
|
+
* Extracts from x402 HTTP 402 (offer) and HTTP 200 (settlement) responses.
|
|
6
|
+
* All size limits enforce the 8 KB header ceiling (x402_headers).
|
|
7
|
+
* Reference mode is not supported; receipt_jws is required.
|
|
8
|
+
*/
|
|
9
|
+
import type { PeacEvidenceCarrier, CarrierMeta, CarrierValidationResult, CarrierAdapter } from '@peac/kernel';
|
|
10
|
+
/** x402 carrier size limits (DD-127) */
|
|
11
|
+
export declare const X402_CARRIER_LIMITS: {
|
|
12
|
+
readonly embed: 65536;
|
|
13
|
+
readonly headers: 8192;
|
|
14
|
+
};
|
|
15
|
+
/** Simple header map */
|
|
16
|
+
export type X402HeaderMap = Record<string, string>;
|
|
17
|
+
/** x402 HTTP response (402 or 200) with headers and body */
|
|
18
|
+
export interface X402ResponseLike {
|
|
19
|
+
headers?: X402HeaderMap;
|
|
20
|
+
body?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
/** Extraction result */
|
|
23
|
+
export interface X402ExtractResult {
|
|
24
|
+
receipts: PeacEvidenceCarrier[];
|
|
25
|
+
meta: CarrierMeta;
|
|
26
|
+
}
|
|
27
|
+
/** Async extraction result */
|
|
28
|
+
export interface X402ExtractAsyncResult extends X402ExtractResult {
|
|
29
|
+
violations: string[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Extract carrier from x402 offer response (HTTP 402).
|
|
33
|
+
*
|
|
34
|
+
* Reads PEAC-Receipt header for compact JWS (header-only in v0.11.1).
|
|
35
|
+
*/
|
|
36
|
+
export declare function fromOfferResponse(headers: X402HeaderMap, _body?: Record<string, unknown>): X402ExtractResult | null;
|
|
37
|
+
/**
|
|
38
|
+
* Extract carrier from x402 offer response (async, DD-129).
|
|
39
|
+
*
|
|
40
|
+
* Computes receipt_ref from the JWS.
|
|
41
|
+
*/
|
|
42
|
+
export declare function fromOfferResponseAsync(headers: X402HeaderMap, _body?: Record<string, unknown>): Promise<X402ExtractAsyncResult | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Extract carrier from x402 settlement response (HTTP 200).
|
|
45
|
+
*
|
|
46
|
+
* Reads PEAC-Receipt header for compact JWS.
|
|
47
|
+
*/
|
|
48
|
+
export declare function fromSettlementResponse(headers: X402HeaderMap, _body?: Record<string, unknown>): X402ExtractResult | null;
|
|
49
|
+
/**
|
|
50
|
+
* Extract carrier from x402 settlement response (async, DD-129).
|
|
51
|
+
*/
|
|
52
|
+
export declare function fromSettlementResponseAsync(headers: X402HeaderMap, _body?: Record<string, unknown>): Promise<X402ExtractAsyncResult | null>;
|
|
53
|
+
/**
|
|
54
|
+
* CarrierAdapter implementation for x402 HTTP responses.
|
|
55
|
+
*
|
|
56
|
+
* v0.11.1: header-only transport. Extracts from and attaches to
|
|
57
|
+
* PEAC-Receipt header. Requires receipt_jws for attachment.
|
|
58
|
+
*/
|
|
59
|
+
export declare class X402CarrierAdapter implements CarrierAdapter<X402ResponseLike, X402ResponseLike> {
|
|
60
|
+
extract(input: X402ResponseLike): {
|
|
61
|
+
receipts: PeacEvidenceCarrier[];
|
|
62
|
+
meta: CarrierMeta;
|
|
63
|
+
} | null;
|
|
64
|
+
attach(output: X402ResponseLike, carriers: PeacEvidenceCarrier[], meta?: CarrierMeta): X402ResponseLike;
|
|
65
|
+
validateConstraints(carrier: PeacEvidenceCarrier, meta: CarrierMeta): CarrierValidationResult;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=carrier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carrier.d.ts","sourceRoot":"","sources":["../src/carrier.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,WAAW,EACX,uBAAuB,EACvB,cAAc,EACf,MAAM,cAAc,CAAC;AAYtB,wCAAwC;AACxC,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAMX,wBAAwB;AACxB,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEnD,4DAA4D;AAC5D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC;AAED,wBAAwB;AACxB,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,mBAAmB,EAAE,CAAC;IAChC,IAAI,EAAE,WAAW,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0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* x402 carrier adapter for Evidence Carrier Contract (DD-124).
|
|
4
|
+
*
|
|
5
|
+
* v0.11.1: header-only transport via PEAC-Receipt (compact JWS).
|
|
6
|
+
* Extracts from x402 HTTP 402 (offer) and HTTP 200 (settlement) responses.
|
|
7
|
+
* All size limits enforce the 8 KB header ceiling (x402_headers).
|
|
8
|
+
* Reference mode is not supported; receipt_jws is required.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.X402CarrierAdapter = exports.X402_CARRIER_LIMITS = void 0;
|
|
12
|
+
exports.fromOfferResponse = fromOfferResponse;
|
|
13
|
+
exports.fromOfferResponseAsync = fromOfferResponseAsync;
|
|
14
|
+
exports.fromSettlementResponse = fromSettlementResponse;
|
|
15
|
+
exports.fromSettlementResponseAsync = fromSettlementResponseAsync;
|
|
16
|
+
const kernel_1 = require("@peac/kernel");
|
|
17
|
+
const schema_1 = require("@peac/schema");
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
// Constants
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
/** x402 carrier size limits (DD-127) */
|
|
22
|
+
exports.X402_CARRIER_LIMITS = {
|
|
23
|
+
embed: schema_1.CARRIER_TRANSPORT_LIMITS.x402_embed,
|
|
24
|
+
headers: schema_1.CARRIER_TRANSPORT_LIMITS.x402_headers,
|
|
25
|
+
};
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
// Helpers
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
function defaultX402Meta() {
|
|
30
|
+
return {
|
|
31
|
+
transport: 'x402',
|
|
32
|
+
format: 'embed',
|
|
33
|
+
max_size: exports.X402_CARRIER_LIMITS.headers,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Extract JWS from PEAC-Receipt header (case-insensitive per RFC 9110).
|
|
38
|
+
*/
|
|
39
|
+
function extractJwsFromHeaders(headers) {
|
|
40
|
+
const key = Object.keys(headers).find((k) => k.toLowerCase() === kernel_1.PEAC_RECEIPT_HEADER.toLowerCase());
|
|
41
|
+
if (!key)
|
|
42
|
+
return null;
|
|
43
|
+
const value = headers[key];
|
|
44
|
+
return value && value.length > 0 ? value : null;
|
|
45
|
+
}
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
// Extract from Offer Response (HTTP 402)
|
|
48
|
+
// ---------------------------------------------------------------------------
|
|
49
|
+
/**
|
|
50
|
+
* Extract carrier from x402 offer response (HTTP 402).
|
|
51
|
+
*
|
|
52
|
+
* Reads PEAC-Receipt header for compact JWS (header-only in v0.11.1).
|
|
53
|
+
*/
|
|
54
|
+
function fromOfferResponse(headers, _body) {
|
|
55
|
+
const jws = extractJwsFromHeaders(headers);
|
|
56
|
+
if (!jws)
|
|
57
|
+
return null;
|
|
58
|
+
const carrier = {
|
|
59
|
+
receipt_ref: 'sha256:0000000000000000000000000000000000000000000000000000000000000000',
|
|
60
|
+
receipt_jws: jws,
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
receipts: [carrier],
|
|
64
|
+
meta: {
|
|
65
|
+
...defaultX402Meta(),
|
|
66
|
+
redaction: ['receipt_ref_pending_async'],
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Extract carrier from x402 offer response (async, DD-129).
|
|
72
|
+
*
|
|
73
|
+
* Computes receipt_ref from the JWS.
|
|
74
|
+
*/
|
|
75
|
+
async function fromOfferResponseAsync(headers, _body) {
|
|
76
|
+
const jws = extractJwsFromHeaders(headers);
|
|
77
|
+
if (!jws)
|
|
78
|
+
return null;
|
|
79
|
+
const ref = await (0, schema_1.computeReceiptRef)(jws);
|
|
80
|
+
const carrier = {
|
|
81
|
+
receipt_ref: ref,
|
|
82
|
+
receipt_jws: jws,
|
|
83
|
+
};
|
|
84
|
+
return {
|
|
85
|
+
receipts: [carrier],
|
|
86
|
+
meta: defaultX402Meta(),
|
|
87
|
+
violations: [],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
// ---------------------------------------------------------------------------
|
|
91
|
+
// Extract from Settlement Response (HTTP 200)
|
|
92
|
+
// ---------------------------------------------------------------------------
|
|
93
|
+
/**
|
|
94
|
+
* Extract carrier from x402 settlement response (HTTP 200).
|
|
95
|
+
*
|
|
96
|
+
* Reads PEAC-Receipt header for compact JWS.
|
|
97
|
+
*/
|
|
98
|
+
function fromSettlementResponse(headers, _body) {
|
|
99
|
+
return fromOfferResponse(headers, _body);
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Extract carrier from x402 settlement response (async, DD-129).
|
|
103
|
+
*/
|
|
104
|
+
async function fromSettlementResponseAsync(headers, _body) {
|
|
105
|
+
return fromOfferResponseAsync(headers, _body);
|
|
106
|
+
}
|
|
107
|
+
// ---------------------------------------------------------------------------
|
|
108
|
+
// X402CarrierAdapter
|
|
109
|
+
// ---------------------------------------------------------------------------
|
|
110
|
+
/**
|
|
111
|
+
* CarrierAdapter implementation for x402 HTTP responses.
|
|
112
|
+
*
|
|
113
|
+
* v0.11.1: header-only transport. Extracts from and attaches to
|
|
114
|
+
* PEAC-Receipt header. Requires receipt_jws for attachment.
|
|
115
|
+
*/
|
|
116
|
+
class X402CarrierAdapter {
|
|
117
|
+
extract(input) {
|
|
118
|
+
if (!input.headers)
|
|
119
|
+
return null;
|
|
120
|
+
return fromOfferResponse(input.headers, input.body);
|
|
121
|
+
}
|
|
122
|
+
attach(output, carriers, meta) {
|
|
123
|
+
if (carriers.length === 0)
|
|
124
|
+
return output;
|
|
125
|
+
const carrier = carriers[0];
|
|
126
|
+
if (!carrier.receipt_jws) {
|
|
127
|
+
throw new Error('x402 carrier requires receipt_jws (embed format) in v0.11.1');
|
|
128
|
+
}
|
|
129
|
+
const effectiveMeta = meta ?? defaultX402Meta();
|
|
130
|
+
const validation = (0, schema_1.validateCarrierConstraints)(carrier, effectiveMeta);
|
|
131
|
+
if (!validation.valid) {
|
|
132
|
+
throw new Error(`Carrier constraint violation: ${validation.violations.join('; ')}`);
|
|
133
|
+
}
|
|
134
|
+
if (!output.headers) {
|
|
135
|
+
output.headers = {};
|
|
136
|
+
}
|
|
137
|
+
output.headers[kernel_1.PEAC_RECEIPT_HEADER] = carrier.receipt_jws;
|
|
138
|
+
return output;
|
|
139
|
+
}
|
|
140
|
+
validateConstraints(carrier, meta) {
|
|
141
|
+
return (0, schema_1.validateCarrierConstraints)(carrier, meta);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
exports.X402CarrierAdapter = X402CarrierAdapter;
|
|
145
|
+
//# sourceMappingURL=carrier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carrier.js","sourceRoot":"","sources":["../src/carrier.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAkFH,8CAoBC;AAOD,wDAkBC;AAWD,wDAKC;AAKD,kEAKC;AAjJD,yCAAmD;AACnD,yCAIsB;AAEtB,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,wCAAwC;AAC3B,QAAA,mBAAmB,GAAG;IACjC,KAAK,EAAE,iCAAwB,CAAC,UAAU;IAC1C,OAAO,EAAE,iCAAwB,CAAC,YAAY;CACtC,CAAC;AA0BX,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAS,eAAe;IACtB,OAAO;QACL,SAAS,EAAE,MAAM;QACjB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,2BAAmB,CAAC,OAAO;KACtC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAAC,OAAsB;IACnD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,IAAI,CACnC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,4BAAmB,CAAC,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GAAG,OAAO,CAAC,WAAW,CAAC;QAE1D,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,mBAAmB,CAAC,OAA4B,EAAE,IAAiB;QACjE,OAAO,IAAA,mCAA0B,EAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;CACF;AArCD,gDAqCC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* x402 challenge type mapping.
|
|
3
|
+
*
|
|
4
|
+
* Maps x402 HTTP 402 responses to a normalized challenge type taxonomy.
|
|
5
|
+
* For x402, the challenge is always 'payment' since the protocol is
|
|
6
|
+
* specifically designed for payment-gated resource access.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Normalized challenge types across protocols.
|
|
10
|
+
*
|
|
11
|
+
* This taxonomy enables cross-protocol comparison of access challenges:
|
|
12
|
+
* - payment: Resource requires payment (x402, ACP checkout)
|
|
13
|
+
* - auth: Resource requires authentication
|
|
14
|
+
* - consent: Resource requires user consent
|
|
15
|
+
* - rate_limit: Access throttled
|
|
16
|
+
* - purpose_denied: Access denied based on declared purpose
|
|
17
|
+
* - other: Unrecognized challenge type
|
|
18
|
+
*/
|
|
19
|
+
export type ChallengeType = 'payment' | 'auth' | 'consent' | 'rate_limit' | 'purpose_denied' | 'other';
|
|
20
|
+
/**
|
|
21
|
+
* Map x402 response to a normalized challenge type.
|
|
22
|
+
*
|
|
23
|
+
* x402 is a payment protocol; the challenge is always 'payment'.
|
|
24
|
+
* This function exists for cross-protocol normalization: other protocols
|
|
25
|
+
* may return different challenge types from the same taxonomy.
|
|
26
|
+
*
|
|
27
|
+
* @returns 'payment' (always, for x402)
|
|
28
|
+
*/
|
|
29
|
+
export declare function mapX402ToChallengeType(): ChallengeType;
|
|
30
|
+
//# sourceMappingURL=challenge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"challenge.d.ts","sourceRoot":"","sources":["../src/challenge.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;;;;;;;;GAUG;AACH,MAAM,MAAM,aAAa,GACrB,SAAS,GACT,MAAM,GACN,SAAS,GACT,YAAY,GACZ,gBAAgB,GAChB,OAAO,CAAC;AAMZ;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,IAAI,aAAa,CAEtD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* x402 challenge type mapping.
|
|
4
|
+
*
|
|
5
|
+
* Maps x402 HTTP 402 responses to a normalized challenge type taxonomy.
|
|
6
|
+
* For x402, the challenge is always 'payment' since the protocol is
|
|
7
|
+
* specifically designed for payment-gated resource access.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.mapX402ToChallengeType = mapX402ToChallengeType;
|
|
11
|
+
// ---------------------------------------------------------------------------
|
|
12
|
+
// Mapping
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
/**
|
|
15
|
+
* Map x402 response to a normalized challenge type.
|
|
16
|
+
*
|
|
17
|
+
* x402 is a payment protocol; the challenge is always 'payment'.
|
|
18
|
+
* This function exists for cross-protocol normalization: other protocols
|
|
19
|
+
* may return different challenge types from the same taxonomy.
|
|
20
|
+
*
|
|
21
|
+
* @returns 'payment' (always, for x402)
|
|
22
|
+
*/
|
|
23
|
+
function mapX402ToChallengeType() {
|
|
24
|
+
return 'payment';
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=challenge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"challenge.js","sourceRoot":"","sources":["../src/challenge.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAsCH,wDAEC;AAfD,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,SAAgB,sBAAsB;IACpC,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -31,5 +31,9 @@ export type { Result, AdapterError, AdapterErrorCode, JsonObject } from './types
|
|
|
31
31
|
export { X402Error } from './errors.js';
|
|
32
32
|
export type { X402ErrorCode } from './errors.js';
|
|
33
33
|
export { verifyOffer, verifyReceipt, matchAcceptTerms, selectAccept } from './verify.js';
|
|
34
|
-
export { toPeacRecord } from './map.js';
|
|
34
|
+
export { toPeacRecord, toPeacCarrier } from './map.js';
|
|
35
|
+
export type { X402HeaderMap, X402ResponseLike, X402ExtractResult, X402ExtractAsyncResult, } from './carrier.js';
|
|
36
|
+
export { X402_CARRIER_LIMITS, fromOfferResponse, fromOfferResponseAsync, fromSettlementResponse, fromSettlementResponseAsync, X402CarrierAdapter, } from './carrier.js';
|
|
37
|
+
export type { ChallengeType } from './challenge.js';
|
|
38
|
+
export { mapX402ToChallengeType } from './challenge.js';
|
|
35
39
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,YAAY,EACV,eAAe,EACf,YAAY,EACZ,WAAW,EACX,cAAc,EACd,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EACjB,cAAc,GACf,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGrF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AA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dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* @packageDocumentation
|
|
28
28
|
*/
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.toPeacRecord = exports.selectAccept = exports.matchAcceptTerms = exports.verifyReceipt = exports.verifyOffer = exports.X402Error = exports.MAX_AMOUNT_LENGTH = exports.MAX_TOTAL_ACCEPTS_BYTES = exports.MAX_ACCEPT_ENTRIES = exports.X402_OFFER_RECEIPT_PROFILE = void 0;
|
|
30
|
+
exports.mapX402ToChallengeType = exports.X402CarrierAdapter = exports.fromSettlementResponseAsync = exports.fromSettlementResponse = exports.fromOfferResponseAsync = exports.fromOfferResponse = exports.X402_CARRIER_LIMITS = exports.toPeacCarrier = exports.toPeacRecord = exports.selectAccept = exports.matchAcceptTerms = exports.verifyReceipt = exports.verifyOffer = exports.X402Error = exports.MAX_AMOUNT_LENGTH = exports.MAX_TOTAL_ACCEPTS_BYTES = exports.MAX_ACCEPT_ENTRIES = exports.X402_OFFER_RECEIPT_PROFILE = void 0;
|
|
31
31
|
// Constants
|
|
32
32
|
var types_js_1 = require("./types.js");
|
|
33
33
|
Object.defineProperty(exports, "X402_OFFER_RECEIPT_PROFILE", { enumerable: true, get: function () { return types_js_1.X402_OFFER_RECEIPT_PROFILE; } });
|
|
@@ -46,4 +46,14 @@ Object.defineProperty(exports, "selectAccept", { enumerable: true, get: function
|
|
|
46
46
|
// Mapping
|
|
47
47
|
var map_js_1 = require("./map.js");
|
|
48
48
|
Object.defineProperty(exports, "toPeacRecord", { enumerable: true, get: function () { return map_js_1.toPeacRecord; } });
|
|
49
|
+
Object.defineProperty(exports, "toPeacCarrier", { enumerable: true, get: function () { return map_js_1.toPeacCarrier; } });
|
|
50
|
+
var carrier_js_1 = require("./carrier.js");
|
|
51
|
+
Object.defineProperty(exports, "X402_CARRIER_LIMITS", { enumerable: true, get: function () { return carrier_js_1.X402_CARRIER_LIMITS; } });
|
|
52
|
+
Object.defineProperty(exports, "fromOfferResponse", { enumerable: true, get: function () { return carrier_js_1.fromOfferResponse; } });
|
|
53
|
+
Object.defineProperty(exports, "fromOfferResponseAsync", { enumerable: true, get: function () { return carrier_js_1.fromOfferResponseAsync; } });
|
|
54
|
+
Object.defineProperty(exports, "fromSettlementResponse", { enumerable: true, get: function () { return carrier_js_1.fromSettlementResponse; } });
|
|
55
|
+
Object.defineProperty(exports, "fromSettlementResponseAsync", { enumerable: true, get: function () { return carrier_js_1.fromSettlementResponseAsync; } });
|
|
56
|
+
Object.defineProperty(exports, "X402CarrierAdapter", { enumerable: true, get: function () { return carrier_js_1.X402CarrierAdapter; } });
|
|
57
|
+
var challenge_js_1 = require("./challenge.js");
|
|
58
|
+
Object.defineProperty(exports, "mapX402ToChallengeType", { enumerable: true, get: function () { return challenge_js_1.mapX402ToChallengeType; } });
|
|
49
59
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AAqBH,YAAY;AACZ,uCAKoB;AAJlB,sHAAA,0BAA0B,OAAA;AAC1B,8GAAA,kBAAkB,OAAA;AAClB,mHAAA,uBAAuB,OAAA;AACvB,6GAAA,iBAAiB,OAAA;AAMnB,SAAS;AACT,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAGlB,eAAe;AACf,yCAAyF;AAAhF,wGAAA,WAAW,OAAA;AAAE,0GAAA,aAAa,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAEnE,UAAU;AACV,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;AAqBH,YAAY;AACZ,uCAKoB;AAJlB,sHAAA,0BAA0B,OAAA;AAC1B,8GAAA,kBAAkB,OAAA;AAClB,mHAAA,uBAAuB,OAAA;AACvB,6GAAA,iBAAiB,OAAA;AAMnB,SAAS;AACT,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAGlB,eAAe;AACf,yCAAyF;AAAhF,wGAAA,WAAW,OAAA;AAAE,0GAAA,aAAa,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAAE,yGAAA,YAAY,OAAA;AAEnE,UAAU;AACV,mCAAuD;AAA9C,sGAAA,YAAY,OAAA;AAAE,uGAAA,aAAa,OAAA;AAUpC,2CAOsB;AANpB,iHAAA,mBAAmB,OAAA;AACnB,+GAAA,iBAAiB,OAAA;AACjB,oHAAA,sBAAsB,OAAA;AACtB,oHAAA,sBAAsB,OAAA;AACtB,yHAAA,2BAA2B,OAAA;AAC3B,gHAAA,kBAAkB,OAAA;AAKpB,+CAAwD;AAA/C,sHAAA,sBAAsB,OAAA"}
|
package/dist/map.d.ts
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - Unsigned hints (acceptIndex) explicitly marked as untrusted
|
|
14
14
|
* - Verification status metadata (structural, cryptographic, termMatching)
|
|
15
15
|
*/
|
|
16
|
+
import type { PeacEvidenceCarrier } from '@peac/kernel';
|
|
16
17
|
import type { X402PaymentRequired, X402SettlementResponse, X402PeacRecord, OfferVerification } from './types.js';
|
|
17
18
|
/**
|
|
18
19
|
* Options for record mapping
|
|
@@ -53,4 +54,14 @@ export interface ToPeacRecordOptions {
|
|
|
53
54
|
* @throws X402Error if inputs are structurally invalid
|
|
54
55
|
*/
|
|
55
56
|
export declare function toPeacRecord(paymentRequired: X402PaymentRequired, settlementResponse: X402SettlementResponse, options?: ToPeacRecordOptions): X402PeacRecord;
|
|
57
|
+
/**
|
|
58
|
+
* Convert an x402 PEAC record to a PeacEvidenceCarrier.
|
|
59
|
+
*
|
|
60
|
+
* Uses the shared `computeReceiptRef()` from `@peac/schema` (correction item 4)
|
|
61
|
+
* to produce a canonical, content-addressed receipt_ref from the JWS.
|
|
62
|
+
*
|
|
63
|
+
* @param receiptJws - Compact JWS of the PEAC receipt
|
|
64
|
+
* @returns PeacEvidenceCarrier with computed receipt_ref
|
|
65
|
+
*/
|
|
66
|
+
export declare function toPeacCarrier(receiptJws: string): Promise<PeacEvidenceCarrier>;
|
|
56
67
|
//# sourceMappingURL=map.d.ts.map
|
package/dist/map.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EAEd,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAGpB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAC1B,eAAe,EAAE,mBAAmB,EACpC,kBAAkB,EAAE,sBAAsB,EAC1C,OAAO,CAAC,EAAE,mBAAmB,GAC5B,cAAc,CAyFhB;AAMD;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAMpF"}
|
package/dist/map.js
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.toPeacRecord = toPeacRecord;
|
|
19
|
+
exports.toPeacCarrier = toPeacCarrier;
|
|
20
|
+
const schema_1 = require("@peac/schema");
|
|
19
21
|
const errors_js_1 = require("./errors.js");
|
|
20
22
|
const types_js_1 = require("./types.js");
|
|
21
23
|
/**
|
|
@@ -108,4 +110,23 @@ function toPeacRecord(paymentRequired, settlementResponse, options) {
|
|
|
108
110
|
createdAt: new Date().toISOString(),
|
|
109
111
|
};
|
|
110
112
|
}
|
|
113
|
+
// ---------------------------------------------------------------------------
|
|
114
|
+
// Evidence Carrier mapping (DD-124)
|
|
115
|
+
// ---------------------------------------------------------------------------
|
|
116
|
+
/**
|
|
117
|
+
* Convert an x402 PEAC record to a PeacEvidenceCarrier.
|
|
118
|
+
*
|
|
119
|
+
* Uses the shared `computeReceiptRef()` from `@peac/schema` (correction item 4)
|
|
120
|
+
* to produce a canonical, content-addressed receipt_ref from the JWS.
|
|
121
|
+
*
|
|
122
|
+
* @param receiptJws - Compact JWS of the PEAC receipt
|
|
123
|
+
* @returns PeacEvidenceCarrier with computed receipt_ref
|
|
124
|
+
*/
|
|
125
|
+
async function toPeacCarrier(receiptJws) {
|
|
126
|
+
const ref = await (0, schema_1.computeReceiptRef)(receiptJws);
|
|
127
|
+
return {
|
|
128
|
+
receipt_ref: ref,
|
|
129
|
+
receipt_jws: receiptJws,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
111
132
|
//# sourceMappingURL=map.js.map
|
package/dist/map.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;
|
|
1
|
+
{"version":3,"file":"map.js","sourceRoot":"","sources":["../src/map.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;AAsDH,oCA6FC;AAeD,sCAMC;AArKD,yCAAiD;AAEjD,2CAAwC;AAQxC,yCAAwD;AAyBxD;;;;;;;;;;;;;;;GAeG;AACH,SAAgB,YAA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,cAAc,CAAC,OAAO,IAAI,EAAE,cAAc,EAAE,cAAc,CAAC,OAAO,EAAE,CAAC;SAC1E;QACD,KAAK;QACL,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,oCAAoC;AACpC,8EAA8E;AAE9E;;;;;;;;GAQG;AACI,KAAK,UAAU,aAAa,CAAC,UAAkB;IACpD,MAAM,GAAG,GAAG,MAAM,IAAA,0BAAiB,EAAC,UAAU,CAAC,CAAC;IAChD,OAAO;QACL,WAAW,EAAE,GAAG;QAChB,WAAW,EAAE,UAAU;KACxB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peac/adapter-x402",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "x402 offer/receipt verification, term-matching, and PEAC record mapping",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@peac/adapter-core": "0.
|
|
23
|
-
"@peac/kernel": "0.
|
|
24
|
-
"@peac/schema": "0.
|
|
22
|
+
"@peac/adapter-core": "0.11.1",
|
|
23
|
+
"@peac/kernel": "0.11.1",
|
|
24
|
+
"@peac/schema": "0.11.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/node": "^
|
|
27
|
+
"@types/node": "^22.19.11",
|
|
28
28
|
"typescript": "^5.3.3",
|
|
29
|
-
"vitest": "^
|
|
29
|
+
"vitest": "^4.0.0"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"build": "tsc",
|