@peac/kernel 0.9.31 → 0.10.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/dist/constants.d.ts +95 -6
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +102 -7
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/constants.d.ts
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Wire format type for PEAC receipts
|
|
10
|
-
*
|
|
10
|
+
* Normalized to peac-receipt/0.1 per DEC-20260114-002
|
|
11
11
|
*/
|
|
12
|
-
export declare const WIRE_TYPE: "peac
|
|
12
|
+
export declare const WIRE_TYPE: "peac-receipt/0.1";
|
|
13
13
|
/**
|
|
14
14
|
* Wire format version (extracted from WIRE_TYPE)
|
|
15
15
|
* Use this for wire_version fields in receipts
|
|
16
16
|
*/
|
|
17
|
-
export declare const WIRE_VERSION: "0.
|
|
17
|
+
export declare const WIRE_VERSION: "0.1";
|
|
18
18
|
/**
|
|
19
19
|
* Supported cryptographic algorithms
|
|
20
20
|
*/
|
|
@@ -33,7 +33,35 @@ export declare const HEADERS: {
|
|
|
33
33
|
readonly purposeReason: "PEAC-Purpose-Reason";
|
|
34
34
|
};
|
|
35
35
|
/**
|
|
36
|
-
*
|
|
36
|
+
* Policy manifest settings (/.well-known/peac.txt)
|
|
37
|
+
*
|
|
38
|
+
* Policy documents declare access terms for agents and gateways.
|
|
39
|
+
* @see docs/specs/PEAC-TXT.md
|
|
40
|
+
*/
|
|
41
|
+
export declare const POLICY: {
|
|
42
|
+
readonly manifestPath: "/.well-known/peac.txt";
|
|
43
|
+
readonly fallbackPath: "/peac.txt";
|
|
44
|
+
readonly manifestVersion: "peac-policy/0.1";
|
|
45
|
+
readonly cacheTtlSeconds: 3600;
|
|
46
|
+
readonly maxBytes: 262144;
|
|
47
|
+
readonly maxDepth: 8;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Issuer configuration settings (/.well-known/peac-issuer.json)
|
|
51
|
+
*
|
|
52
|
+
* Issuer config enables verifiers to discover JWKS and verification endpoints.
|
|
53
|
+
* @see docs/specs/PEAC-ISSUER.md
|
|
54
|
+
*/
|
|
55
|
+
export declare const ISSUER_CONFIG: {
|
|
56
|
+
readonly configPath: "/.well-known/peac-issuer.json";
|
|
57
|
+
readonly configVersion: "peac-issuer/0.1";
|
|
58
|
+
readonly cacheTtlSeconds: 3600;
|
|
59
|
+
readonly maxBytes: 65536;
|
|
60
|
+
readonly maxDepth: 4;
|
|
61
|
+
readonly fetchTimeoutMs: 10000;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* @deprecated Use POLICY instead. Will be removed in v1.0.
|
|
37
65
|
*/
|
|
38
66
|
export declare const DISCOVERY: {
|
|
39
67
|
readonly manifestPath: "/.well-known/peac.txt";
|
|
@@ -63,12 +91,61 @@ export declare const LIMITS: {
|
|
|
63
91
|
readonly maxAmountCents: 999999999999;
|
|
64
92
|
readonly minAmountCents: 1;
|
|
65
93
|
};
|
|
94
|
+
/**
|
|
95
|
+
* Bundle format version.
|
|
96
|
+
* Used in dispute bundles, audit bundles, and archive bundles.
|
|
97
|
+
*/
|
|
98
|
+
export declare const BUNDLE_VERSION: "peac-bundle/0.1";
|
|
99
|
+
/**
|
|
100
|
+
* Verification report format version.
|
|
101
|
+
*/
|
|
102
|
+
export declare const VERIFICATION_REPORT_VERSION: "peac-verification-report/0.1";
|
|
103
|
+
/**
|
|
104
|
+
* Hash format constants and utilities.
|
|
105
|
+
* All hashes use the self-describing format: sha256:<64 lowercase hex chars>
|
|
106
|
+
*/
|
|
107
|
+
export declare const HASH: {
|
|
108
|
+
/** Canonical hash algorithm */
|
|
109
|
+
algorithm: "sha256";
|
|
110
|
+
/** Hash prefix pattern */
|
|
111
|
+
prefix: "sha256:";
|
|
112
|
+
/** Valid hash regex: sha256:<64 lowercase hex> */
|
|
113
|
+
pattern: RegExp;
|
|
114
|
+
/** Hex-only pattern for legacy comparison */
|
|
115
|
+
hexPattern: RegExp;
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Parse a sha256:<hex> hash string into components.
|
|
119
|
+
* Returns null if the format is invalid.
|
|
120
|
+
*
|
|
121
|
+
* @param hash - Hash string to parse (e.g., "sha256:abc123...")
|
|
122
|
+
* @returns Parsed hash or null if invalid
|
|
123
|
+
*/
|
|
124
|
+
export declare function parseHash(hash: string): {
|
|
125
|
+
alg: 'sha256';
|
|
126
|
+
hex: string;
|
|
127
|
+
} | null;
|
|
128
|
+
/**
|
|
129
|
+
* Format a hex string as a sha256:<hex> hash.
|
|
130
|
+
* Validates that the hex is exactly 64 lowercase characters.
|
|
131
|
+
*
|
|
132
|
+
* @param hex - Hex string (64 lowercase characters)
|
|
133
|
+
* @returns Formatted hash or null if invalid
|
|
134
|
+
*/
|
|
135
|
+
export declare function formatHash(hex: string): string | null;
|
|
136
|
+
/**
|
|
137
|
+
* Validate a hash string is in the correct format.
|
|
138
|
+
*
|
|
139
|
+
* @param hash - Hash string to validate
|
|
140
|
+
* @returns true if valid sha256:<64 hex> format
|
|
141
|
+
*/
|
|
142
|
+
export declare function isValidHash(hash: string): boolean;
|
|
66
143
|
/**
|
|
67
144
|
* All constants export
|
|
68
145
|
*/
|
|
69
146
|
export declare const CONSTANTS: {
|
|
70
|
-
readonly WIRE_TYPE: "peac
|
|
71
|
-
readonly WIRE_VERSION: "0.
|
|
147
|
+
readonly WIRE_TYPE: "peac-receipt/0.1";
|
|
148
|
+
readonly WIRE_VERSION: "0.1";
|
|
72
149
|
readonly ALGORITHMS: {
|
|
73
150
|
readonly supported: readonly ["EdDSA"];
|
|
74
151
|
readonly default: "EdDSA";
|
|
@@ -99,5 +176,17 @@ export declare const CONSTANTS: {
|
|
|
99
176
|
readonly maxAmountCents: 999999999999;
|
|
100
177
|
readonly minAmountCents: 1;
|
|
101
178
|
};
|
|
179
|
+
readonly BUNDLE_VERSION: "peac-bundle/0.1";
|
|
180
|
+
readonly VERIFICATION_REPORT_VERSION: "peac-verification-report/0.1";
|
|
181
|
+
readonly HASH: {
|
|
182
|
+
/** Canonical hash algorithm */
|
|
183
|
+
algorithm: "sha256";
|
|
184
|
+
/** Hash prefix pattern */
|
|
185
|
+
prefix: "sha256:";
|
|
186
|
+
/** Valid hash regex: sha256:<64 lowercase hex> */
|
|
187
|
+
pattern: RegExp;
|
|
188
|
+
/** Hex-only pattern for legacy comparison */
|
|
189
|
+
hexPattern: RegExp;
|
|
190
|
+
};
|
|
102
191
|
};
|
|
103
192
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAG,kBAA2B,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,YAAY,EAAG,KAAc,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,UAAU;;;CAGb,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,OAAO;;;;;;CAOV,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,SAAS;;;;CAIZ,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,IAAI;;;;CAIP,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,OAAO;;;;CAIV,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,MAAM;;;CAGT,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAG,kBAA2B,CAAC;A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
@@ -7,17 +7,20 @@
|
|
|
7
7
|
* From v0.9.16+, this will be auto-generated via codegen.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.CONSTANTS = exports.LIMITS = exports.RECEIPT = exports.JWKS = exports.DISCOVERY = exports.HEADERS = exports.ALGORITHMS = exports.WIRE_VERSION = exports.WIRE_TYPE = void 0;
|
|
10
|
+
exports.CONSTANTS = exports.HASH = exports.VERIFICATION_REPORT_VERSION = exports.BUNDLE_VERSION = exports.LIMITS = exports.RECEIPT = exports.JWKS = exports.DISCOVERY = exports.ISSUER_CONFIG = exports.POLICY = exports.HEADERS = exports.ALGORITHMS = exports.WIRE_VERSION = exports.WIRE_TYPE = void 0;
|
|
11
|
+
exports.parseHash = parseHash;
|
|
12
|
+
exports.formatHash = formatHash;
|
|
13
|
+
exports.isValidHash = isValidHash;
|
|
11
14
|
/**
|
|
12
15
|
* Wire format type for PEAC receipts
|
|
13
|
-
*
|
|
16
|
+
* Normalized to peac-receipt/0.1 per DEC-20260114-002
|
|
14
17
|
*/
|
|
15
|
-
exports.WIRE_TYPE = 'peac
|
|
18
|
+
exports.WIRE_TYPE = 'peac-receipt/0.1';
|
|
16
19
|
/**
|
|
17
20
|
* Wire format version (extracted from WIRE_TYPE)
|
|
18
21
|
* Use this for wire_version fields in receipts
|
|
19
22
|
*/
|
|
20
|
-
exports.WIRE_VERSION = '0.
|
|
23
|
+
exports.WIRE_VERSION = '0.1';
|
|
21
24
|
/**
|
|
22
25
|
* Supported cryptographic algorithms
|
|
23
26
|
*/
|
|
@@ -37,12 +40,40 @@ exports.HEADERS = {
|
|
|
37
40
|
purposeReason: 'PEAC-Purpose-Reason',
|
|
38
41
|
};
|
|
39
42
|
/**
|
|
40
|
-
*
|
|
43
|
+
* Policy manifest settings (/.well-known/peac.txt)
|
|
44
|
+
*
|
|
45
|
+
* Policy documents declare access terms for agents and gateways.
|
|
46
|
+
* @see docs/specs/PEAC-TXT.md
|
|
41
47
|
*/
|
|
42
|
-
exports.
|
|
48
|
+
exports.POLICY = {
|
|
43
49
|
manifestPath: '/.well-known/peac.txt',
|
|
44
|
-
|
|
50
|
+
fallbackPath: '/peac.txt',
|
|
51
|
+
manifestVersion: 'peac-policy/0.1',
|
|
52
|
+
cacheTtlSeconds: 3600,
|
|
53
|
+
maxBytes: 262144, // 256 KiB
|
|
54
|
+
maxDepth: 8,
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Issuer configuration settings (/.well-known/peac-issuer.json)
|
|
58
|
+
*
|
|
59
|
+
* Issuer config enables verifiers to discover JWKS and verification endpoints.
|
|
60
|
+
* @see docs/specs/PEAC-ISSUER.md
|
|
61
|
+
*/
|
|
62
|
+
exports.ISSUER_CONFIG = {
|
|
63
|
+
configPath: '/.well-known/peac-issuer.json',
|
|
64
|
+
configVersion: 'peac-issuer/0.1',
|
|
45
65
|
cacheTtlSeconds: 3600,
|
|
66
|
+
maxBytes: 65536, // 64 KiB
|
|
67
|
+
maxDepth: 4,
|
|
68
|
+
fetchTimeoutMs: 10000,
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated Use POLICY instead. Will be removed in v1.0.
|
|
72
|
+
*/
|
|
73
|
+
exports.DISCOVERY = {
|
|
74
|
+
manifestPath: exports.POLICY.manifestPath,
|
|
75
|
+
manifestVersion: 'peac/0.9',
|
|
76
|
+
cacheTtlSeconds: exports.POLICY.cacheTtlSeconds,
|
|
46
77
|
};
|
|
47
78
|
/**
|
|
48
79
|
* JWKS rotation and revocation settings
|
|
@@ -67,6 +98,67 @@ exports.LIMITS = {
|
|
|
67
98
|
maxAmountCents: 999999999999,
|
|
68
99
|
minAmountCents: 1,
|
|
69
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* Bundle format version.
|
|
103
|
+
* Used in dispute bundles, audit bundles, and archive bundles.
|
|
104
|
+
*/
|
|
105
|
+
exports.BUNDLE_VERSION = 'peac-bundle/0.1';
|
|
106
|
+
/**
|
|
107
|
+
* Verification report format version.
|
|
108
|
+
*/
|
|
109
|
+
exports.VERIFICATION_REPORT_VERSION = 'peac-verification-report/0.1';
|
|
110
|
+
/**
|
|
111
|
+
* Hash format constants and utilities.
|
|
112
|
+
* All hashes use the self-describing format: sha256:<64 lowercase hex chars>
|
|
113
|
+
*/
|
|
114
|
+
exports.HASH = {
|
|
115
|
+
/** Canonical hash algorithm */
|
|
116
|
+
algorithm: 'sha256',
|
|
117
|
+
/** Hash prefix pattern */
|
|
118
|
+
prefix: 'sha256:',
|
|
119
|
+
/** Valid hash regex: sha256:<64 lowercase hex> */
|
|
120
|
+
pattern: /^sha256:[0-9a-f]{64}$/,
|
|
121
|
+
/** Hex-only pattern for legacy comparison */
|
|
122
|
+
hexPattern: /^[0-9a-f]{64}$/,
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Parse a sha256:<hex> hash string into components.
|
|
126
|
+
* Returns null if the format is invalid.
|
|
127
|
+
*
|
|
128
|
+
* @param hash - Hash string to parse (e.g., "sha256:abc123...")
|
|
129
|
+
* @returns Parsed hash or null if invalid
|
|
130
|
+
*/
|
|
131
|
+
function parseHash(hash) {
|
|
132
|
+
if (!exports.HASH.pattern.test(hash)) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
alg: 'sha256',
|
|
137
|
+
hex: hash.slice(7), // Remove 'sha256:' prefix
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Format a hex string as a sha256:<hex> hash.
|
|
142
|
+
* Validates that the hex is exactly 64 lowercase characters.
|
|
143
|
+
*
|
|
144
|
+
* @param hex - Hex string (64 lowercase characters)
|
|
145
|
+
* @returns Formatted hash or null if invalid
|
|
146
|
+
*/
|
|
147
|
+
function formatHash(hex) {
|
|
148
|
+
if (!exports.HASH.hexPattern.test(hex)) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
return `sha256:${hex}`;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Validate a hash string is in the correct format.
|
|
155
|
+
*
|
|
156
|
+
* @param hash - Hash string to validate
|
|
157
|
+
* @returns true if valid sha256:<64 hex> format
|
|
158
|
+
*/
|
|
159
|
+
function isValidHash(hash) {
|
|
160
|
+
return exports.HASH.pattern.test(hash);
|
|
161
|
+
}
|
|
70
162
|
/**
|
|
71
163
|
* All constants export
|
|
72
164
|
*/
|
|
@@ -79,5 +171,8 @@ exports.CONSTANTS = {
|
|
|
79
171
|
JWKS: exports.JWKS,
|
|
80
172
|
RECEIPT: exports.RECEIPT,
|
|
81
173
|
LIMITS: exports.LIMITS,
|
|
174
|
+
BUNDLE_VERSION: exports.BUNDLE_VERSION,
|
|
175
|
+
VERIFICATION_REPORT_VERSION: exports.VERIFICATION_REPORT_VERSION,
|
|
176
|
+
HASH: exports.HASH,
|
|
82
177
|
};
|
|
83
178
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAuIH,8BAQC;AASD,gCAKC;AAQD,kCAEC;AArKD;;;GAGG;AACU,QAAA,SAAS,GAAG,kBAA2B,CAAC;AAErD;;;GAGG;AACU,QAAA,YAAY,GAAG,KAAc,CAAC;AAE3C;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB,SAAS,EAAE,CAAC,OAAO,CAAU;IAC7B,OAAO,EAAE,OAAgB;CACjB,CAAC;AAEX;;GAEG;AACU,QAAA,OAAO,GAAG;IACrB,OAAO,EAAE,cAAuB;IAChC,IAAI,EAAE,MAAe;IACrB,6BAA6B;IAC7B,OAAO,EAAE,cAAuB;IAChC,cAAc,EAAE,sBAA+B;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O,EAAE,uBAAuB;IAEhC,6CAA6C;IAC7C,UAAU,EAAE,gBAAgB;CAC7B,CAAC;AAEF;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,IAAY;IACpC,IAAI,CAAC,YAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO;QACL,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,0BAA0B;KAC/C,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,GAAW;IACpC,IAAI,CAAC,YAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,UAAU,GAAG,EAAE,CAAC;AACzB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,WAAW,CAAC,IAAY;IACtC,OAAO,YAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjC,CAAC;AAED;;GAEG;AACU,QAAA,SAAS,GAAG;IACvB,SAAS,EAAT,iBAAS;IACT,YAAY,EAAZ,oBAAY;IACZ,UAAU,EAAV,kBAAU;IACV,OAAO,EAAP,eAAO;IACP,SAAS,EAAT,iBAAS;IACT,IAAI,EAAJ,YAAI;IACJ,OAAO,EAAP,eAAO;IACP,MAAM,EAAN,cAAM;IACN,cAAc,EAAd,sBAAc;IACd,2BAA2B,EAA3B,mCAA2B;IAC3B,IAAI,EAAJ,YAAI;CACI,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* @packageDocumentation
|
|
6
6
|
*/
|
|
7
7
|
export type { JsonPrimitive, JsonValue, JsonArray, JsonObject, ErrorDefinition, PaymentRailEntry, ControlEngineEntry, TransportMethodEntry, AgentProtocolEntry, } from './types.js';
|
|
8
|
-
export { WIRE_TYPE, WIRE_VERSION, ALGORITHMS, HEADERS,
|
|
8
|
+
export { WIRE_TYPE, WIRE_VERSION, ALGORITHMS, HEADERS, POLICY, ISSUER_CONFIG, DISCOVERY, // @deprecated - use POLICY instead
|
|
9
|
+
JWKS, RECEIPT, LIMITS, BUNDLE_VERSION, VERIFICATION_REPORT_VERSION, HASH, parseHash, formatHash, isValidHash, CONSTANTS, } from './constants.js';
|
|
9
10
|
export { ERROR_CODES, ERRORS, BUNDLE_ERRORS, DISPUTE_ERRORS, getError, isRetriable, type ErrorCode, } from './errors.js';
|
|
10
11
|
export { PAYMENT_RAILS, CONTROL_ENGINES, TRANSPORT_METHODS, AGENT_PROTOCOLS, REGISTRIES, findPaymentRail, findControlEngine, findTransportMethod, findAgentProtocol, } from './registries.js';
|
|
11
12
|
export { VARY_HEADERS, applyPurposeVary, getPeacVaryHeaders, needsPurposeVary } from './http.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAEV,aAAa,EACb,SAAS,EACT,SAAS,EACT,UAAU,EAEV,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,SAAS,EACT,YAAY,EACZ,UAAU,EACV,OAAO,EACP,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,YAAY,EAEV,aAAa,EACb,SAAS,EACT,SAAS,EACT,UAAU,EAEV,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,SAAS,EACT,YAAY,EACZ,UAAU,EACV,OAAO,EACP,MAAM,EACN,aAAa,EACb,SAAS,EAAE,mCAAmC;AAC9C,IAAI,EACJ,OAAO,EACP,MAAM,EACN,cAAc,EACd,2BAA2B,EAC3B,IAAI,EACJ,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,GACV,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,WAAW,EACX,MAAM,EACN,aAAa,EACb,cAAc,EACd,QAAQ,EACR,WAAW,EACX,KAAK,SAAS,GACf,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,17 +6,25 @@
|
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.needsPurposeVary = exports.getPeacVaryHeaders = exports.applyPurposeVary = exports.VARY_HEADERS = exports.findAgentProtocol = exports.findTransportMethod = exports.findControlEngine = exports.findPaymentRail = exports.REGISTRIES = exports.AGENT_PROTOCOLS = exports.TRANSPORT_METHODS = exports.CONTROL_ENGINES = exports.PAYMENT_RAILS = exports.isRetriable = exports.getError = exports.DISPUTE_ERRORS = exports.BUNDLE_ERRORS = exports.ERRORS = exports.ERROR_CODES = exports.CONSTANTS = exports.LIMITS = exports.RECEIPT = exports.JWKS = exports.DISCOVERY = exports.HEADERS = exports.ALGORITHMS = exports.WIRE_VERSION = exports.WIRE_TYPE = void 0;
|
|
9
|
+
exports.needsPurposeVary = exports.getPeacVaryHeaders = exports.applyPurposeVary = exports.VARY_HEADERS = exports.findAgentProtocol = exports.findTransportMethod = exports.findControlEngine = exports.findPaymentRail = exports.REGISTRIES = exports.AGENT_PROTOCOLS = exports.TRANSPORT_METHODS = exports.CONTROL_ENGINES = exports.PAYMENT_RAILS = exports.isRetriable = exports.getError = exports.DISPUTE_ERRORS = exports.BUNDLE_ERRORS = exports.ERRORS = exports.ERROR_CODES = exports.CONSTANTS = exports.isValidHash = exports.formatHash = exports.parseHash = exports.HASH = exports.VERIFICATION_REPORT_VERSION = exports.BUNDLE_VERSION = exports.LIMITS = exports.RECEIPT = exports.JWKS = exports.DISCOVERY = exports.ISSUER_CONFIG = exports.POLICY = exports.HEADERS = exports.ALGORITHMS = exports.WIRE_VERSION = exports.WIRE_TYPE = void 0;
|
|
10
10
|
// Export constants
|
|
11
11
|
var constants_js_1 = require("./constants.js");
|
|
12
12
|
Object.defineProperty(exports, "WIRE_TYPE", { enumerable: true, get: function () { return constants_js_1.WIRE_TYPE; } });
|
|
13
13
|
Object.defineProperty(exports, "WIRE_VERSION", { enumerable: true, get: function () { return constants_js_1.WIRE_VERSION; } });
|
|
14
14
|
Object.defineProperty(exports, "ALGORITHMS", { enumerable: true, get: function () { return constants_js_1.ALGORITHMS; } });
|
|
15
15
|
Object.defineProperty(exports, "HEADERS", { enumerable: true, get: function () { return constants_js_1.HEADERS; } });
|
|
16
|
+
Object.defineProperty(exports, "POLICY", { enumerable: true, get: function () { return constants_js_1.POLICY; } });
|
|
17
|
+
Object.defineProperty(exports, "ISSUER_CONFIG", { enumerable: true, get: function () { return constants_js_1.ISSUER_CONFIG; } });
|
|
16
18
|
Object.defineProperty(exports, "DISCOVERY", { enumerable: true, get: function () { return constants_js_1.DISCOVERY; } });
|
|
17
19
|
Object.defineProperty(exports, "JWKS", { enumerable: true, get: function () { return constants_js_1.JWKS; } });
|
|
18
20
|
Object.defineProperty(exports, "RECEIPT", { enumerable: true, get: function () { return constants_js_1.RECEIPT; } });
|
|
19
21
|
Object.defineProperty(exports, "LIMITS", { enumerable: true, get: function () { return constants_js_1.LIMITS; } });
|
|
22
|
+
Object.defineProperty(exports, "BUNDLE_VERSION", { enumerable: true, get: function () { return constants_js_1.BUNDLE_VERSION; } });
|
|
23
|
+
Object.defineProperty(exports, "VERIFICATION_REPORT_VERSION", { enumerable: true, get: function () { return constants_js_1.VERIFICATION_REPORT_VERSION; } });
|
|
24
|
+
Object.defineProperty(exports, "HASH", { enumerable: true, get: function () { return constants_js_1.HASH; } });
|
|
25
|
+
Object.defineProperty(exports, "parseHash", { enumerable: true, get: function () { return constants_js_1.parseHash; } });
|
|
26
|
+
Object.defineProperty(exports, "formatHash", { enumerable: true, get: function () { return constants_js_1.formatHash; } });
|
|
27
|
+
Object.defineProperty(exports, "isValidHash", { enumerable: true, get: function () { return constants_js_1.isValidHash; } });
|
|
20
28
|
Object.defineProperty(exports, "CONSTANTS", { enumerable: true, get: function () { return constants_js_1.CONSTANTS; } });
|
|
21
29
|
// Export errors
|
|
22
30
|
var errors_js_1 = require("./errors.js");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAiBH,mBAAmB;AACnB,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAiBH,mBAAmB;AACnB,+CAkBwB;AAjBtB,yGAAA,SAAS,OAAA;AACT,4GAAA,YAAY,OAAA;AACZ,0GAAA,UAAU,OAAA;AACV,uGAAA,OAAO,OAAA;AACP,sGAAA,MAAM,OAAA;AACN,6GAAA,aAAa,OAAA;AACb,yGAAA,SAAS,OAAA;AACT,oGAAA,IAAI,OAAA;AACJ,uGAAA,OAAO,OAAA;AACP,sGAAA,MAAM,OAAA;AACN,8GAAA,cAAc,OAAA;AACd,2HAAA,2BAA2B,OAAA;AAC3B,oGAAA,IAAI,OAAA;AACJ,yGAAA,SAAS,OAAA;AACT,0GAAA,UAAU,OAAA;AACV,2GAAA,WAAW,OAAA;AACX,yGAAA,SAAS,OAAA;AAGX,gBAAgB;AAChB,yCAQqB;AAPnB,wGAAA,WAAW,OAAA;AACX,mGAAA,MAAM,OAAA;AACN,0GAAA,aAAa,OAAA;AACb,2GAAA,cAAc,OAAA;AACd,qGAAA,QAAQ,OAAA;AACR,wGAAA,WAAW,OAAA;AAIb,oBAAoB;AACpB,iDAUyB;AATvB,8GAAA,aAAa,OAAA;AACb,gHAAA,eAAe,OAAA;AACf,kHAAA,iBAAiB,OAAA;AACjB,gHAAA,eAAe,OAAA;AACf,2GAAA,UAAU,OAAA;AACV,gHAAA,eAAe,OAAA;AACf,kHAAA,iBAAiB,OAAA;AACjB,oHAAA,mBAAmB,OAAA;AACnB,kHAAA,iBAAiB,OAAA;AAGnB,0DAA0D;AAC1D,qCAAiG;AAAxF,uGAAA,YAAY,OAAA;AAAE,2GAAA,gBAAgB,OAAA;AAAE,6GAAA,kBAAkB,OAAA;AAAE,2GAAA,gBAAgB,OAAA"}
|