@peac/schema 0.10.6 → 0.10.8
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/attestation-receipt.d.ts +204 -0
- package/dist/attestation-receipt.d.ts.map +1 -0
- package/dist/attestation-receipt.js +249 -0
- package/dist/attestation-receipt.js.map +1 -0
- package/dist/errors.d.ts +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +63 -2
- package/dist/index.js.map +1 -1
- package/dist/interaction.d.ts +1085 -0
- package/dist/interaction.d.ts.map +1 -0
- package/dist/interaction.js +918 -0
- package/dist/interaction.js.map +1 -0
- package/dist/validators.d.ts +12 -12
- package/package.json +2 -2
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PEAC Attestation Receipt Types (v0.10.8+)
|
|
3
|
+
*
|
|
4
|
+
* Attestation receipts are lightweight signed tokens that attest to API
|
|
5
|
+
* interactions WITHOUT payment fields. This is a distinct profile from
|
|
6
|
+
* full payment receipts (PEACReceiptClaims).
|
|
7
|
+
*
|
|
8
|
+
* Use cases:
|
|
9
|
+
* - API interaction logging with evidentiary value
|
|
10
|
+
* - Middleware-issued receipts for non-payment flows
|
|
11
|
+
* - Audit trails for agent/tool interactions
|
|
12
|
+
*
|
|
13
|
+
* Claims structure:
|
|
14
|
+
* - Core JWT claims: iss, aud, iat, exp
|
|
15
|
+
* - PEAC claims: rid (UUIDv7 receipt ID)
|
|
16
|
+
* - Optional: sub, ext (extensions including interaction binding)
|
|
17
|
+
*
|
|
18
|
+
* @see docs/specs/ATTESTATION-RECEIPTS.md
|
|
19
|
+
*/
|
|
20
|
+
import { z } from 'zod';
|
|
21
|
+
/**
|
|
22
|
+
* Attestation receipt type constant
|
|
23
|
+
*/
|
|
24
|
+
export declare const ATTESTATION_RECEIPT_TYPE: "peac/attestation-receipt";
|
|
25
|
+
/**
|
|
26
|
+
* Extension key for minimal interaction binding (middleware profile)
|
|
27
|
+
*
|
|
28
|
+
* This is a simplified binding used by middleware packages. For full
|
|
29
|
+
* interaction evidence, use INTERACTION_EXTENSION_KEY from ./interaction.ts
|
|
30
|
+
*/
|
|
31
|
+
export declare const MIDDLEWARE_INTERACTION_KEY = "org.peacprotocol/middleware-interaction@0.1";
|
|
32
|
+
/**
|
|
33
|
+
* Limits for attestation receipt fields (DoS protection)
|
|
34
|
+
*/
|
|
35
|
+
export declare const ATTESTATION_LIMITS: {
|
|
36
|
+
/** Maximum issuer URL length */
|
|
37
|
+
readonly maxIssuerLength: 2048;
|
|
38
|
+
/** Maximum audience URL length */
|
|
39
|
+
readonly maxAudienceLength: 2048;
|
|
40
|
+
/** Maximum subject length */
|
|
41
|
+
readonly maxSubjectLength: 256;
|
|
42
|
+
/** Maximum path length in interaction binding */
|
|
43
|
+
readonly maxPathLength: 2048;
|
|
44
|
+
/** Maximum method length */
|
|
45
|
+
readonly maxMethodLength: 16;
|
|
46
|
+
/** Maximum HTTP status code */
|
|
47
|
+
readonly maxStatusCode: 599;
|
|
48
|
+
/** Minimum HTTP status code */
|
|
49
|
+
readonly minStatusCode: 100;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Minimal interaction binding schema (for middleware use)
|
|
53
|
+
*
|
|
54
|
+
* This is a simplified version of full interaction evidence.
|
|
55
|
+
* Contains only: method, path, status.
|
|
56
|
+
*
|
|
57
|
+
* Privacy note: Query strings are excluded by default to avoid
|
|
58
|
+
* leaking sensitive data (API keys, tokens, PII in parameters).
|
|
59
|
+
*/
|
|
60
|
+
export declare const MinimalInteractionBindingSchema: z.ZodObject<{
|
|
61
|
+
/** HTTP method (uppercase, e.g., GET, POST) */
|
|
62
|
+
method: z.ZodEffects<z.ZodString, string, string>;
|
|
63
|
+
/** Request path (no query string by default) */
|
|
64
|
+
path: z.ZodString;
|
|
65
|
+
/** HTTP response status code */
|
|
66
|
+
status: z.ZodNumber;
|
|
67
|
+
}, "strict", z.ZodTypeAny, {
|
|
68
|
+
path: string;
|
|
69
|
+
status: number;
|
|
70
|
+
method: string;
|
|
71
|
+
}, {
|
|
72
|
+
path: string;
|
|
73
|
+
status: number;
|
|
74
|
+
method: string;
|
|
75
|
+
}>;
|
|
76
|
+
/**
|
|
77
|
+
* Attestation receipt extensions schema
|
|
78
|
+
*
|
|
79
|
+
* Allows interaction binding and other namespaced extensions.
|
|
80
|
+
*/
|
|
81
|
+
export declare const AttestationExtensionsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
82
|
+
/**
|
|
83
|
+
* PEAC Attestation Receipt Claims schema
|
|
84
|
+
*
|
|
85
|
+
* This is the claims structure for attestation receipts - lightweight
|
|
86
|
+
* receipts without payment fields. For full payment receipts, use
|
|
87
|
+
* ReceiptClaimsSchema from ./validators.ts
|
|
88
|
+
*/
|
|
89
|
+
export declare const AttestationReceiptClaimsSchema: z.ZodObject<{
|
|
90
|
+
/** Issuer URL (normalized, no trailing slash) */
|
|
91
|
+
iss: z.ZodEffects<z.ZodString, string, string>;
|
|
92
|
+
/** Audience URL */
|
|
93
|
+
aud: z.ZodEffects<z.ZodString, string, string>;
|
|
94
|
+
/** Issued at (Unix seconds) */
|
|
95
|
+
iat: z.ZodNumber;
|
|
96
|
+
/** Expiration (Unix seconds) */
|
|
97
|
+
exp: z.ZodNumber;
|
|
98
|
+
/** Receipt ID (UUIDv7) */
|
|
99
|
+
rid: z.ZodString;
|
|
100
|
+
/** Subject identifier (optional) */
|
|
101
|
+
sub: z.ZodOptional<z.ZodString>;
|
|
102
|
+
/** Extensions (optional) */
|
|
103
|
+
ext: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
104
|
+
}, "strict", z.ZodTypeAny, {
|
|
105
|
+
iss: string;
|
|
106
|
+
aud: string;
|
|
107
|
+
iat: number;
|
|
108
|
+
exp: number;
|
|
109
|
+
rid: string;
|
|
110
|
+
sub?: string | undefined;
|
|
111
|
+
ext?: Record<string, unknown> | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
iss: string;
|
|
114
|
+
aud: string;
|
|
115
|
+
iat: number;
|
|
116
|
+
exp: number;
|
|
117
|
+
rid: string;
|
|
118
|
+
sub?: string | undefined;
|
|
119
|
+
ext?: Record<string, unknown> | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
export type MinimalInteractionBinding = z.infer<typeof MinimalInteractionBindingSchema>;
|
|
122
|
+
export type AttestationExtensions = z.infer<typeof AttestationExtensionsSchema>;
|
|
123
|
+
export type AttestationReceiptClaims = z.infer<typeof AttestationReceiptClaimsSchema>;
|
|
124
|
+
/**
|
|
125
|
+
* Validation result type
|
|
126
|
+
*/
|
|
127
|
+
export interface AttestationValidationResult {
|
|
128
|
+
valid: boolean;
|
|
129
|
+
error_code?: string;
|
|
130
|
+
error_message?: string;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Validate attestation receipt claims
|
|
134
|
+
*
|
|
135
|
+
* @param input - Raw input to validate
|
|
136
|
+
* @returns Validation result
|
|
137
|
+
*/
|
|
138
|
+
export declare function validateAttestationReceiptClaims(input: unknown): AttestationValidationResult;
|
|
139
|
+
/**
|
|
140
|
+
* Check if an object is valid attestation receipt claims (non-throwing)
|
|
141
|
+
*
|
|
142
|
+
* @param claims - Object to check
|
|
143
|
+
* @returns True if valid AttestationReceiptClaims
|
|
144
|
+
*/
|
|
145
|
+
export declare function isAttestationReceiptClaims(claims: unknown): claims is AttestationReceiptClaims;
|
|
146
|
+
/**
|
|
147
|
+
* Validate minimal interaction binding
|
|
148
|
+
*
|
|
149
|
+
* @param input - Raw input to validate
|
|
150
|
+
* @returns Validation result
|
|
151
|
+
*/
|
|
152
|
+
export declare function validateMinimalInteractionBinding(input: unknown): AttestationValidationResult;
|
|
153
|
+
/**
|
|
154
|
+
* Check if an object is valid minimal interaction binding (non-throwing)
|
|
155
|
+
*
|
|
156
|
+
* @param binding - Object to check
|
|
157
|
+
* @returns True if valid MinimalInteractionBinding
|
|
158
|
+
*/
|
|
159
|
+
export declare function isMinimalInteractionBinding(binding: unknown): binding is MinimalInteractionBinding;
|
|
160
|
+
/**
|
|
161
|
+
* Parameters for creating attestation receipt claims
|
|
162
|
+
*/
|
|
163
|
+
export interface CreateAttestationReceiptParams {
|
|
164
|
+
/** Issuer URL (will be normalized) */
|
|
165
|
+
issuer: string;
|
|
166
|
+
/** Audience URL */
|
|
167
|
+
audience: string;
|
|
168
|
+
/** Receipt ID (UUIDv7) */
|
|
169
|
+
rid: string;
|
|
170
|
+
/** Subject identifier (optional) */
|
|
171
|
+
sub?: string;
|
|
172
|
+
/** Interaction binding (optional) */
|
|
173
|
+
interaction?: MinimalInteractionBinding;
|
|
174
|
+
/** Additional extensions (optional) */
|
|
175
|
+
extensions?: Record<string, unknown>;
|
|
176
|
+
/** Expiration in seconds from now (default: 300) */
|
|
177
|
+
expiresIn?: number;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Create validated attestation receipt claims
|
|
181
|
+
*
|
|
182
|
+
* @param params - Attestation receipt parameters
|
|
183
|
+
* @returns Validated AttestationReceiptClaims
|
|
184
|
+
* @throws ZodError if validation fails
|
|
185
|
+
*/
|
|
186
|
+
export declare function createAttestationReceiptClaims(params: CreateAttestationReceiptParams): AttestationReceiptClaims;
|
|
187
|
+
/**
|
|
188
|
+
* Check if claims are attestation-only (no payment fields)
|
|
189
|
+
*
|
|
190
|
+
* This helps discriminate between attestation receipts and
|
|
191
|
+
* full payment receipts at runtime.
|
|
192
|
+
*
|
|
193
|
+
* @param claims - Receipt claims to check
|
|
194
|
+
* @returns True if claims lack payment fields (amt, cur, payment)
|
|
195
|
+
*/
|
|
196
|
+
export declare function isAttestationOnly(claims: Record<string, unknown>): boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Check if claims are payment receipt (has payment fields)
|
|
199
|
+
*
|
|
200
|
+
* @param claims - Receipt claims to check
|
|
201
|
+
* @returns True if claims have payment fields
|
|
202
|
+
*/
|
|
203
|
+
export declare function isPaymentReceipt(claims: Record<string, unknown>): boolean;
|
|
204
|
+
//# sourceMappingURL=attestation-receipt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attestation-receipt.d.ts","sourceRoot":"","sources":["../src/attestation-receipt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAG,0BAAmC,CAAC;AAE5E;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,gDAAgD,CAAC;AAExF;;GAEG;AACH,eAAO,MAAM,kBAAkB;IAC7B,gCAAgC;;IAEhC,kCAAkC;;IAElC,6BAA6B;;IAE7B,iDAAiD;;IAEjD,4BAA4B;;IAE5B,+BAA+B;;IAE/B,+BAA+B;;CAEvB,CAAC;AAyBX;;;;;;;;GAQG;AACH,eAAO,MAAM,+BAA+B;IAExC,+CAA+C;;IAM/C,gDAAgD;;IAEhD,gCAAgC;;;;;;;;;;EAOzB,CAAC;AAEZ;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,wCAAoC,CAAC;AAE7E;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;IAEvC,iDAAiD;;IAEjD,mBAAmB;;IAEnB,+BAA+B;;IAE/B,gCAAgC;;IAEhC,0BAA0B;;IAE1B,oCAAoC;;IAEpC,4BAA4B;;;;;;;;;;;;;;;;;;EAGrB,CAAC;AAMZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAChF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAMtF;;GAEG;AACH,MAAM,WAAW,2BA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
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* PEAC Attestation Receipt Types (v0.10.8+)
|
|
4
|
+
*
|
|
5
|
+
* Attestation receipts are lightweight signed tokens that attest to API
|
|
6
|
+
* interactions WITHOUT payment fields. This is a distinct profile from
|
|
7
|
+
* full payment receipts (PEACReceiptClaims).
|
|
8
|
+
*
|
|
9
|
+
* Use cases:
|
|
10
|
+
* - API interaction logging with evidentiary value
|
|
11
|
+
* - Middleware-issued receipts for non-payment flows
|
|
12
|
+
* - Audit trails for agent/tool interactions
|
|
13
|
+
*
|
|
14
|
+
* Claims structure:
|
|
15
|
+
* - Core JWT claims: iss, aud, iat, exp
|
|
16
|
+
* - PEAC claims: rid (UUIDv7 receipt ID)
|
|
17
|
+
* - Optional: sub, ext (extensions including interaction binding)
|
|
18
|
+
*
|
|
19
|
+
* @see docs/specs/ATTESTATION-RECEIPTS.md
|
|
20
|
+
*/
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.AttestationReceiptClaimsSchema = exports.AttestationExtensionsSchema = exports.MinimalInteractionBindingSchema = exports.ATTESTATION_LIMITS = exports.MIDDLEWARE_INTERACTION_KEY = exports.ATTESTATION_RECEIPT_TYPE = void 0;
|
|
23
|
+
exports.validateAttestationReceiptClaims = validateAttestationReceiptClaims;
|
|
24
|
+
exports.isAttestationReceiptClaims = isAttestationReceiptClaims;
|
|
25
|
+
exports.validateMinimalInteractionBinding = validateMinimalInteractionBinding;
|
|
26
|
+
exports.isMinimalInteractionBinding = isMinimalInteractionBinding;
|
|
27
|
+
exports.createAttestationReceiptClaims = createAttestationReceiptClaims;
|
|
28
|
+
exports.isAttestationOnly = isAttestationOnly;
|
|
29
|
+
exports.isPaymentReceipt = isPaymentReceipt;
|
|
30
|
+
const zod_1 = require("zod");
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// Constants
|
|
33
|
+
// ============================================================================
|
|
34
|
+
/**
|
|
35
|
+
* Attestation receipt type constant
|
|
36
|
+
*/
|
|
37
|
+
exports.ATTESTATION_RECEIPT_TYPE = 'peac/attestation-receipt';
|
|
38
|
+
/**
|
|
39
|
+
* Extension key for minimal interaction binding (middleware profile)
|
|
40
|
+
*
|
|
41
|
+
* This is a simplified binding used by middleware packages. For full
|
|
42
|
+
* interaction evidence, use INTERACTION_EXTENSION_KEY from ./interaction.ts
|
|
43
|
+
*/
|
|
44
|
+
exports.MIDDLEWARE_INTERACTION_KEY = 'org.peacprotocol/middleware-interaction@0.1';
|
|
45
|
+
/**
|
|
46
|
+
* Limits for attestation receipt fields (DoS protection)
|
|
47
|
+
*/
|
|
48
|
+
exports.ATTESTATION_LIMITS = {
|
|
49
|
+
/** Maximum issuer URL length */
|
|
50
|
+
maxIssuerLength: 2048,
|
|
51
|
+
/** Maximum audience URL length */
|
|
52
|
+
maxAudienceLength: 2048,
|
|
53
|
+
/** Maximum subject length */
|
|
54
|
+
maxSubjectLength: 256,
|
|
55
|
+
/** Maximum path length in interaction binding */
|
|
56
|
+
maxPathLength: 2048,
|
|
57
|
+
/** Maximum method length */
|
|
58
|
+
maxMethodLength: 16,
|
|
59
|
+
/** Maximum HTTP status code */
|
|
60
|
+
maxStatusCode: 599,
|
|
61
|
+
/** Minimum HTTP status code */
|
|
62
|
+
minStatusCode: 100,
|
|
63
|
+
};
|
|
64
|
+
// ============================================================================
|
|
65
|
+
// Zod Schemas
|
|
66
|
+
// ============================================================================
|
|
67
|
+
/**
|
|
68
|
+
* HTTPS URL validation (reused from validators.ts pattern)
|
|
69
|
+
*/
|
|
70
|
+
const httpsUrl = zod_1.z
|
|
71
|
+
.string()
|
|
72
|
+
.url()
|
|
73
|
+
.max(exports.ATTESTATION_LIMITS.maxIssuerLength)
|
|
74
|
+
.refine((url) => url.startsWith('https://'), 'Must be HTTPS URL');
|
|
75
|
+
/**
|
|
76
|
+
* UUIDv7 format validation
|
|
77
|
+
*/
|
|
78
|
+
const uuidv7 = zod_1.z
|
|
79
|
+
.string()
|
|
80
|
+
.regex(/^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i, 'Must be UUIDv7 format');
|
|
81
|
+
/**
|
|
82
|
+
* Minimal interaction binding schema (for middleware use)
|
|
83
|
+
*
|
|
84
|
+
* This is a simplified version of full interaction evidence.
|
|
85
|
+
* Contains only: method, path, status.
|
|
86
|
+
*
|
|
87
|
+
* Privacy note: Query strings are excluded by default to avoid
|
|
88
|
+
* leaking sensitive data (API keys, tokens, PII in parameters).
|
|
89
|
+
*/
|
|
90
|
+
exports.MinimalInteractionBindingSchema = zod_1.z
|
|
91
|
+
.object({
|
|
92
|
+
/** HTTP method (uppercase, e.g., GET, POST) */
|
|
93
|
+
method: zod_1.z
|
|
94
|
+
.string()
|
|
95
|
+
.min(1)
|
|
96
|
+
.max(exports.ATTESTATION_LIMITS.maxMethodLength)
|
|
97
|
+
.transform((m) => m.toUpperCase()),
|
|
98
|
+
/** Request path (no query string by default) */
|
|
99
|
+
path: zod_1.z.string().min(1).max(exports.ATTESTATION_LIMITS.maxPathLength),
|
|
100
|
+
/** HTTP response status code */
|
|
101
|
+
status: zod_1.z
|
|
102
|
+
.number()
|
|
103
|
+
.int()
|
|
104
|
+
.min(exports.ATTESTATION_LIMITS.minStatusCode)
|
|
105
|
+
.max(exports.ATTESTATION_LIMITS.maxStatusCode),
|
|
106
|
+
})
|
|
107
|
+
.strict();
|
|
108
|
+
/**
|
|
109
|
+
* Attestation receipt extensions schema
|
|
110
|
+
*
|
|
111
|
+
* Allows interaction binding and other namespaced extensions.
|
|
112
|
+
*/
|
|
113
|
+
exports.AttestationExtensionsSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.unknown());
|
|
114
|
+
/**
|
|
115
|
+
* PEAC Attestation Receipt Claims schema
|
|
116
|
+
*
|
|
117
|
+
* This is the claims structure for attestation receipts - lightweight
|
|
118
|
+
* receipts without payment fields. For full payment receipts, use
|
|
119
|
+
* ReceiptClaimsSchema from ./validators.ts
|
|
120
|
+
*/
|
|
121
|
+
exports.AttestationReceiptClaimsSchema = zod_1.z
|
|
122
|
+
.object({
|
|
123
|
+
/** Issuer URL (normalized, no trailing slash) */
|
|
124
|
+
iss: httpsUrl,
|
|
125
|
+
/** Audience URL */
|
|
126
|
+
aud: httpsUrl,
|
|
127
|
+
/** Issued at (Unix seconds) */
|
|
128
|
+
iat: zod_1.z.number().int().nonnegative(),
|
|
129
|
+
/** Expiration (Unix seconds) */
|
|
130
|
+
exp: zod_1.z.number().int().nonnegative(),
|
|
131
|
+
/** Receipt ID (UUIDv7) */
|
|
132
|
+
rid: uuidv7,
|
|
133
|
+
/** Subject identifier (optional) */
|
|
134
|
+
sub: zod_1.z.string().max(exports.ATTESTATION_LIMITS.maxSubjectLength).optional(),
|
|
135
|
+
/** Extensions (optional) */
|
|
136
|
+
ext: exports.AttestationExtensionsSchema.optional(),
|
|
137
|
+
})
|
|
138
|
+
.strict();
|
|
139
|
+
/**
|
|
140
|
+
* Validate attestation receipt claims
|
|
141
|
+
*
|
|
142
|
+
* @param input - Raw input to validate
|
|
143
|
+
* @returns Validation result
|
|
144
|
+
*/
|
|
145
|
+
function validateAttestationReceiptClaims(input) {
|
|
146
|
+
const result = exports.AttestationReceiptClaimsSchema.safeParse(input);
|
|
147
|
+
if (result.success) {
|
|
148
|
+
return { valid: true };
|
|
149
|
+
}
|
|
150
|
+
const firstIssue = result.error.issues[0];
|
|
151
|
+
return {
|
|
152
|
+
valid: false,
|
|
153
|
+
error_code: 'E_ATTESTATION_INVALID_CLAIMS',
|
|
154
|
+
error_message: firstIssue?.message || 'Invalid attestation receipt claims',
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Check if an object is valid attestation receipt claims (non-throwing)
|
|
159
|
+
*
|
|
160
|
+
* @param claims - Object to check
|
|
161
|
+
* @returns True if valid AttestationReceiptClaims
|
|
162
|
+
*/
|
|
163
|
+
function isAttestationReceiptClaims(claims) {
|
|
164
|
+
return exports.AttestationReceiptClaimsSchema.safeParse(claims).success;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Validate minimal interaction binding
|
|
168
|
+
*
|
|
169
|
+
* @param input - Raw input to validate
|
|
170
|
+
* @returns Validation result
|
|
171
|
+
*/
|
|
172
|
+
function validateMinimalInteractionBinding(input) {
|
|
173
|
+
const result = exports.MinimalInteractionBindingSchema.safeParse(input);
|
|
174
|
+
if (result.success) {
|
|
175
|
+
return { valid: true };
|
|
176
|
+
}
|
|
177
|
+
const firstIssue = result.error.issues[0];
|
|
178
|
+
return {
|
|
179
|
+
valid: false,
|
|
180
|
+
error_code: 'E_ATTESTATION_INVALID_INTERACTION',
|
|
181
|
+
error_message: firstIssue?.message || 'Invalid interaction binding',
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Check if an object is valid minimal interaction binding (non-throwing)
|
|
186
|
+
*
|
|
187
|
+
* @param binding - Object to check
|
|
188
|
+
* @returns True if valid MinimalInteractionBinding
|
|
189
|
+
*/
|
|
190
|
+
function isMinimalInteractionBinding(binding) {
|
|
191
|
+
return exports.MinimalInteractionBindingSchema.safeParse(binding).success;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Create validated attestation receipt claims
|
|
195
|
+
*
|
|
196
|
+
* @param params - Attestation receipt parameters
|
|
197
|
+
* @returns Validated AttestationReceiptClaims
|
|
198
|
+
* @throws ZodError if validation fails
|
|
199
|
+
*/
|
|
200
|
+
function createAttestationReceiptClaims(params) {
|
|
201
|
+
const now = Math.floor(Date.now() / 1000);
|
|
202
|
+
const expiresIn = params.expiresIn ?? 300;
|
|
203
|
+
// Normalize issuer (remove trailing slashes)
|
|
204
|
+
// Using explicit loop instead of regex to avoid ReDoS with quantifiers
|
|
205
|
+
let normalizedIssuer = params.issuer;
|
|
206
|
+
while (normalizedIssuer.endsWith('/')) {
|
|
207
|
+
normalizedIssuer = normalizedIssuer.slice(0, -1);
|
|
208
|
+
}
|
|
209
|
+
// Build extensions
|
|
210
|
+
const ext = { ...params.extensions };
|
|
211
|
+
if (params.interaction) {
|
|
212
|
+
ext[exports.MIDDLEWARE_INTERACTION_KEY] = params.interaction;
|
|
213
|
+
}
|
|
214
|
+
const claims = {
|
|
215
|
+
iss: normalizedIssuer,
|
|
216
|
+
aud: params.audience,
|
|
217
|
+
iat: now,
|
|
218
|
+
exp: now + expiresIn,
|
|
219
|
+
rid: params.rid,
|
|
220
|
+
...(params.sub && { sub: params.sub }),
|
|
221
|
+
...(Object.keys(ext).length > 0 && { ext }),
|
|
222
|
+
};
|
|
223
|
+
return exports.AttestationReceiptClaimsSchema.parse(claims);
|
|
224
|
+
}
|
|
225
|
+
// ============================================================================
|
|
226
|
+
// Type Guard for Receipt Profile Discrimination
|
|
227
|
+
// ============================================================================
|
|
228
|
+
/**
|
|
229
|
+
* Check if claims are attestation-only (no payment fields)
|
|
230
|
+
*
|
|
231
|
+
* This helps discriminate between attestation receipts and
|
|
232
|
+
* full payment receipts at runtime.
|
|
233
|
+
*
|
|
234
|
+
* @param claims - Receipt claims to check
|
|
235
|
+
* @returns True if claims lack payment fields (amt, cur, payment)
|
|
236
|
+
*/
|
|
237
|
+
function isAttestationOnly(claims) {
|
|
238
|
+
return !('amt' in claims) && !('cur' in claims) && !('payment' in claims);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Check if claims are payment receipt (has payment fields)
|
|
242
|
+
*
|
|
243
|
+
* @param claims - Receipt claims to check
|
|
244
|
+
* @returns True if claims have payment fields
|
|
245
|
+
*/
|
|
246
|
+
function isPaymentReceipt(claims) {
|
|
247
|
+
return 'amt' in claims && 'cur' in claims && 'payment' in claims;
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=attestation-receipt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attestation-receipt.js","sourceRoot":"","sources":["../src/attestation-receipt.ts"],"names":[],"mappings":";AAAA;;;;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IAAI,MAAM,IAAI,SAAS,IAAI,MAAM,CAAC;AACnE,CAAC"}
|
package/dist/errors.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type { ErrorCategory };
|
|
|
10
10
|
* @deprecated Use ERROR_CATEGORIES from @peac/kernel instead.
|
|
11
11
|
* Re-exported for backwards compatibility.
|
|
12
12
|
*/
|
|
13
|
-
export declare const ERROR_CATEGORIES_CANONICAL: readonly ["attribution", "bundle", "control", "dispute", "identity", "infrastructure", "ucp", "validation", "verification", "workflow"];
|
|
13
|
+
export declare const ERROR_CATEGORIES_CANONICAL: readonly ["attribution", "bundle", "control", "dispute", "identity", "infrastructure", "interaction", "ucp", "validation", "verification", "verifier", "workflow"];
|
|
14
14
|
/**
|
|
15
15
|
* Error severity
|
|
16
16
|
*/
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,0BAA0B,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,0BAA0B,oKAAmB,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;;;;;;;OAWG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,QAAQ,EAAE,aAAa,CAAC;IAExB;;;;;OAKG;IACH,QA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3
|
-
* Wire format frozen at peac
|
|
3
|
+
* Wire format frozen at peac-receipt/0.1 with v1.0-equivalent semantics
|
|
4
4
|
*/
|
|
5
5
|
export * from './envelope';
|
|
6
6
|
export * from './control';
|
|
@@ -27,7 +27,11 @@ export { DisputeIdSchema, DisputeTypeSchema, DisputeTargetTypeSchema, DisputeGro
|
|
|
27
27
|
export type { DisputeId, DisputeType, DisputeTargetType, DisputeGroundsCode, DisputeGrounds, DisputeState, DisputeOutcome, RemediationType, Remediation, DisputeResolution, ContactMethod, DisputeContact, DocumentRef, DisputeEvidence, DisputeAttestation, CreateDisputeAttestationParams, } from './dispute';
|
|
28
28
|
export { WorkflowIdSchema, StepIdSchema, WorkflowStatusSchema, OrchestrationFrameworkSchema, WorkflowContextSchema, WorkflowErrorContextSchema, WorkflowSummaryEvidenceSchema, WorkflowSummaryAttestationSchema, WORKFLOW_EXTENSION_KEY, WORKFLOW_SUMMARY_TYPE, WORKFLOW_STATUSES, ORCHESTRATION_FRAMEWORKS, WORKFLOW_LIMITS, WORKFLOW_ID_PATTERN, STEP_ID_PATTERN, createWorkflowId, createStepId, validateWorkflowContext, validateWorkflowContextOrdered, isValidWorkflowContext, validateWorkflowSummaryAttestation, isWorkflowSummaryAttestation, isTerminalWorkflowStatus, hasValidDagSemantics, createWorkflowContext, createWorkflowSummaryAttestation, } from './workflow';
|
|
29
29
|
export type { WorkflowId, StepId, WorkflowStatus, OrchestrationFramework, WorkflowContext, WorkflowErrorContext, WorkflowSummaryEvidence, WorkflowSummaryAttestation, WorkflowValidationResult, CreateWorkflowSummaryParams, } from './workflow';
|
|
30
|
+
export { DigestAlgSchema, DigestSchema, PayloadRefSchema, ExecutorSchema, ToolTargetSchema, ResourceTargetSchema, ResultSchema, PolicyContextSchema, RefsSchema, KindSchema, InteractionEvidenceV01Schema, INTERACTION_EXTENSION_KEY, CANONICAL_DIGEST_ALGS, DIGEST_SIZE_CONSTANTS, RESULT_STATUSES, REDACTION_MODES, POLICY_DECISIONS, WELL_KNOWN_KINDS, RESERVED_KIND_PREFIXES, INTERACTION_LIMITS, KIND_FORMAT_PATTERN, EXTENSION_KEY_PATTERN, DIGEST_VALUE_PATTERN, validateInteraction, validateInteractionOrdered, validateInteractionEvidence, isValidInteractionEvidence, isWellKnownKind, isReservedKindPrefix, isDigestTruncated, getInteraction, setInteraction, hasInteraction, createReceiptView, createInteractionEvidence, } from './interaction';
|
|
31
|
+
export type { DigestAlg, Digest, PayloadRef, Executor, ToolTarget, ResourceTarget, ResultStatus, Result, PolicyDecision, PolicyContext, Refs, InteractionEvidenceV01, ValidationError, ValidationWarning, InteractionValidationResult, SimpleValidationResult, ReceiptView, CreateInteractionParams, } from './interaction';
|
|
30
32
|
export { CreditMethodSchema, ContributionTypeSchema, CreditObligationSchema, ContributionObligationSchema, ObligationsExtensionSchema, OBLIGATIONS_EXTENSION_KEY, CREDIT_METHODS, CONTRIBUTION_TYPES, validateCreditObligation, validateContributionObligation, validateObligationsExtension, extractObligationsExtension, isCreditRequired, isContributionRequired, createCreditObligation, createContributionObligation, createObligationsExtension, } from './obligations';
|
|
31
33
|
export type { CreditMethod, ContributionType, CreditObligation, ContributionObligation, ObligationsExtension, } from './obligations';
|
|
32
34
|
export type { PEACEnvelope, AuthContext, EvidenceBlock, MetadataBlock, EnforcementContext, TransportBinding, ContextMetadata, } from './envelope';
|
|
35
|
+
export { MinimalInteractionBindingSchema, AttestationExtensionsSchema, AttestationReceiptClaimsSchema, ATTESTATION_RECEIPT_TYPE, MIDDLEWARE_INTERACTION_KEY, ATTESTATION_LIMITS, validateAttestationReceiptClaims, isAttestationReceiptClaims, validateMinimalInteractionBinding, isMinimalInteractionBinding, createAttestationReceiptClaims, isAttestationOnly, isPaymentReceipt, } from './attestation-receipt';
|
|
36
|
+
export type { MinimalInteractionBinding, AttestationExtensions, AttestationReceiptClaims, AttestationValidationResult, CreateAttestationReceiptParams, } from './attestation-receipt';
|
|
33
37
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d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AChB,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,+BAA+B,EAC/B,2BAA2B,EAC3B,8BAA8B,EAE9B,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAElB,gCAAgC,EAChC,0BAA0B,EAC1B,iCAAiC,EACjC,2BAA2B,EAC3B,8BAA8B,EAC9B,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,uBAAuB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* PEAC Protocol Schema Package
|
|
4
|
-
* Wire format frozen at peac
|
|
4
|
+
* Wire format frozen at peac-receipt/0.1 with v1.0-equivalent semantics
|
|
5
5
|
*/
|
|
6
6
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
7
|
if (k2 === undefined) k2 = k;
|
|
@@ -20,7 +20,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
exports.HashAlgorithmSchema = exports.isAttestationNotYetValid = exports.isAttestationExpired = exports.validateIdentityBinding = exports.createAgentIdentityAttestation = exports.isAgentIdentityAttestation = exports.validateAgentIdentityAttestation = exports.PROOF_METHODS = exports.CONTROL_TYPES = exports.AGENT_IDENTITY_TYPE = exports.AgentIdentityVerifiedSchema = exports.IdentityBindingSchema = exports.AgentIdentityAttestationSchema = exports.AgentIdentityEvidenceSchema = exports.AgentProofSchema = exports.BindingDetailsSchema = exports.ProofMethodSchema = exports.ControlTypeSchema = exports.validateEvidence = exports.validateSubjectSnapshot = exports.PurposeReasonSchema = exports.CanonicalPurposeSchema = exports.PurposeTokenSchema = exports.ExtensionsSchema = exports.AttestationSchema = exports.SubjectProfileSnapshotSchema = exports.SubjectProfileSchema = exports.SubjectTypeSchema = exports.PaymentRoutingSchema = exports.PaymentEvidenceSchema = exports.PaymentSplitSchema = exports.ControlBlockSchema = exports.ControlStepSchema = exports.ControlDecisionSchema = exports.ControlLicensingModeSchema = exports.ControlPurposeSchema = exports.VerifyRequestSchema = exports.AIPREFSnapshotSchema = exports.SubjectSchema = exports.ReceiptClaims = exports.ReceiptClaimsSchema = exports.JWSHeader = exports.Extensions = exports.NormalizedPayment = exports.assertJsonSafeIterative = exports.JSON_EVIDENCE_LIMITS = exports.JsonArraySchema = exports.JsonObjectSchema = exports.JsonValueSchema = exports.JsonPrimitiveSchema = void 0;
|
|
22
22
|
exports.validateDisputeContact = exports.validateDisputeResolution = exports.isDisputeAttestation = exports.isValidDisputeAttestation = exports.validateDisputeAttestation = exports.REMEDIATION_TYPES = exports.DISPUTE_OUTCOMES = exports.DISPUTE_TRANSITIONS = exports.TERMINAL_STATES = exports.DISPUTE_STATES = exports.DISPUTE_GROUNDS_CODES = exports.DISPUTE_TARGET_TYPES = exports.DISPUTE_TYPES = exports.DISPUTE_LIMITS = exports.DISPUTE_TYPE = exports.DisputeAttestationSchema = exports.DisputeEvidenceSchema = exports.DocumentRefSchema = exports.DisputeContactSchema = exports.ContactMethodSchema = exports.DisputeResolutionSchema = exports.RemediationSchema = exports.RemediationTypeSchema = exports.DisputeOutcomeSchema = exports.DisputeStateSchema = exports.DisputeGroundsSchema = exports.DisputeGroundsCodeSchema = exports.DisputeTargetTypeSchema = exports.DisputeTypeSchema = exports.DisputeIdSchema = exports.detectCycleInSources = exports.computeTotalWeight = exports.isAttributionNotYetValid = exports.isAttributionExpired = exports.createAttributionAttestation = exports.isAttributionAttestation = exports.validateAttributionAttestation = exports.validateAttributionSource = exports.validateContentHash = exports.DERIVATION_TYPES = exports.ATTRIBUTION_USAGES = exports.ATTRIBUTION_LIMITS = exports.ATTRIBUTION_TYPE = exports.AttributionAttestationSchema = exports.AttributionEvidenceSchema = exports.AttributionSourceSchema = exports.DerivationTypeSchema = exports.AttributionUsageSchema = exports.ContentHashSchema = exports.HashEncodingSchema = void 0;
|
|
23
|
-
exports.
|
|
23
|
+
exports.POLICY_DECISIONS = exports.REDACTION_MODES = exports.RESULT_STATUSES = exports.DIGEST_SIZE_CONSTANTS = exports.CANONICAL_DIGEST_ALGS = exports.INTERACTION_EXTENSION_KEY = exports.InteractionEvidenceV01Schema = exports.KindSchema = exports.RefsSchema = exports.PolicyContextSchema = exports.ResultSchema = exports.ResourceTargetSchema = exports.ToolTargetSchema = exports.ExecutorSchema = exports.PayloadRefSchema = exports.DigestSchema = exports.DigestAlgSchema = exports.createWorkflowSummaryAttestation = exports.createWorkflowContext = exports.hasValidDagSemantics = exports.isTerminalWorkflowStatus = exports.isWorkflowSummaryAttestation = exports.validateWorkflowSummaryAttestation = exports.isValidWorkflowContext = exports.validateWorkflowContextOrdered = exports.validateWorkflowContext = exports.createStepId = exports.createWorkflowId = exports.STEP_ID_PATTERN = exports.WORKFLOW_ID_PATTERN = exports.WORKFLOW_LIMITS = exports.ORCHESTRATION_FRAMEWORKS = exports.WORKFLOW_STATUSES = exports.WORKFLOW_SUMMARY_TYPE = exports.WORKFLOW_EXTENSION_KEY = exports.WorkflowSummaryAttestationSchema = exports.WorkflowSummaryEvidenceSchema = exports.WorkflowErrorContextSchema = exports.WorkflowContextSchema = exports.OrchestrationFrameworkSchema = exports.WorkflowStatusSchema = exports.StepIdSchema = exports.WorkflowIdSchema = exports.isDisputeNotYetValid = exports.isDisputeExpired = exports.getValidTransitions = exports.isTerminalState = exports.canTransitionTo = exports.transitionDisputeState = exports.createDisputeAttestation = void 0;
|
|
24
|
+
exports.isPaymentReceipt = exports.isAttestationOnly = exports.createAttestationReceiptClaims = exports.isMinimalInteractionBinding = exports.validateMinimalInteractionBinding = exports.isAttestationReceiptClaims = exports.validateAttestationReceiptClaims = exports.ATTESTATION_LIMITS = exports.MIDDLEWARE_INTERACTION_KEY = exports.ATTESTATION_RECEIPT_TYPE = exports.AttestationReceiptClaimsSchema = exports.AttestationExtensionsSchema = exports.MinimalInteractionBindingSchema = exports.createObligationsExtension = exports.createContributionObligation = exports.createCreditObligation = exports.isContributionRequired = exports.isCreditRequired = exports.extractObligationsExtension = exports.validateObligationsExtension = exports.validateContributionObligation = exports.validateCreditObligation = exports.CONTRIBUTION_TYPES = exports.CREDIT_METHODS = exports.OBLIGATIONS_EXTENSION_KEY = exports.ObligationsExtensionSchema = exports.ContributionObligationSchema = exports.CreditObligationSchema = exports.ContributionTypeSchema = exports.CreditMethodSchema = exports.createInteractionEvidence = exports.createReceiptView = exports.hasInteraction = exports.setInteraction = exports.getInteraction = exports.isDigestTruncated = exports.isReservedKindPrefix = exports.isWellKnownKind = exports.isValidInteractionEvidence = exports.validateInteractionEvidence = exports.validateInteractionOrdered = exports.validateInteraction = exports.DIGEST_VALUE_PATTERN = exports.EXTENSION_KEY_PATTERN = exports.KIND_FORMAT_PATTERN = exports.INTERACTION_LIMITS = exports.RESERVED_KIND_PREFIXES = exports.WELL_KNOWN_KINDS = void 0;
|
|
24
25
|
// Core envelope and types
|
|
25
26
|
__exportStar(require("./envelope"), exports);
|
|
26
27
|
__exportStar(require("./control"), exports);
|
|
@@ -195,6 +196,49 @@ Object.defineProperty(exports, "isTerminalWorkflowStatus", { enumerable: true, g
|
|
|
195
196
|
Object.defineProperty(exports, "hasValidDagSemantics", { enumerable: true, get: function () { return workflow_1.hasValidDagSemantics; } });
|
|
196
197
|
Object.defineProperty(exports, "createWorkflowContext", { enumerable: true, get: function () { return workflow_1.createWorkflowContext; } });
|
|
197
198
|
Object.defineProperty(exports, "createWorkflowSummaryAttestation", { enumerable: true, get: function () { return workflow_1.createWorkflowSummaryAttestation; } });
|
|
199
|
+
// Interaction evidence (v0.10.7+ agent execution capture)
|
|
200
|
+
var interaction_1 = require("./interaction");
|
|
201
|
+
Object.defineProperty(exports, "DigestAlgSchema", { enumerable: true, get: function () { return interaction_1.DigestAlgSchema; } });
|
|
202
|
+
Object.defineProperty(exports, "DigestSchema", { enumerable: true, get: function () { return interaction_1.DigestSchema; } });
|
|
203
|
+
Object.defineProperty(exports, "PayloadRefSchema", { enumerable: true, get: function () { return interaction_1.PayloadRefSchema; } });
|
|
204
|
+
Object.defineProperty(exports, "ExecutorSchema", { enumerable: true, get: function () { return interaction_1.ExecutorSchema; } });
|
|
205
|
+
Object.defineProperty(exports, "ToolTargetSchema", { enumerable: true, get: function () { return interaction_1.ToolTargetSchema; } });
|
|
206
|
+
Object.defineProperty(exports, "ResourceTargetSchema", { enumerable: true, get: function () { return interaction_1.ResourceTargetSchema; } });
|
|
207
|
+
Object.defineProperty(exports, "ResultSchema", { enumerable: true, get: function () { return interaction_1.ResultSchema; } });
|
|
208
|
+
Object.defineProperty(exports, "PolicyContextSchema", { enumerable: true, get: function () { return interaction_1.PolicyContextSchema; } });
|
|
209
|
+
Object.defineProperty(exports, "RefsSchema", { enumerable: true, get: function () { return interaction_1.RefsSchema; } });
|
|
210
|
+
Object.defineProperty(exports, "KindSchema", { enumerable: true, get: function () { return interaction_1.KindSchema; } });
|
|
211
|
+
Object.defineProperty(exports, "InteractionEvidenceV01Schema", { enumerable: true, get: function () { return interaction_1.InteractionEvidenceV01Schema; } });
|
|
212
|
+
// Constants
|
|
213
|
+
Object.defineProperty(exports, "INTERACTION_EXTENSION_KEY", { enumerable: true, get: function () { return interaction_1.INTERACTION_EXTENSION_KEY; } });
|
|
214
|
+
Object.defineProperty(exports, "CANONICAL_DIGEST_ALGS", { enumerable: true, get: function () { return interaction_1.CANONICAL_DIGEST_ALGS; } });
|
|
215
|
+
Object.defineProperty(exports, "DIGEST_SIZE_CONSTANTS", { enumerable: true, get: function () { return interaction_1.DIGEST_SIZE_CONSTANTS; } });
|
|
216
|
+
Object.defineProperty(exports, "RESULT_STATUSES", { enumerable: true, get: function () { return interaction_1.RESULT_STATUSES; } });
|
|
217
|
+
Object.defineProperty(exports, "REDACTION_MODES", { enumerable: true, get: function () { return interaction_1.REDACTION_MODES; } });
|
|
218
|
+
Object.defineProperty(exports, "POLICY_DECISIONS", { enumerable: true, get: function () { return interaction_1.POLICY_DECISIONS; } });
|
|
219
|
+
Object.defineProperty(exports, "WELL_KNOWN_KINDS", { enumerable: true, get: function () { return interaction_1.WELL_KNOWN_KINDS; } });
|
|
220
|
+
Object.defineProperty(exports, "RESERVED_KIND_PREFIXES", { enumerable: true, get: function () { return interaction_1.RESERVED_KIND_PREFIXES; } });
|
|
221
|
+
Object.defineProperty(exports, "INTERACTION_LIMITS", { enumerable: true, get: function () { return interaction_1.INTERACTION_LIMITS; } });
|
|
222
|
+
Object.defineProperty(exports, "KIND_FORMAT_PATTERN", { enumerable: true, get: function () { return interaction_1.KIND_FORMAT_PATTERN; } });
|
|
223
|
+
Object.defineProperty(exports, "EXTENSION_KEY_PATTERN", { enumerable: true, get: function () { return interaction_1.EXTENSION_KEY_PATTERN; } });
|
|
224
|
+
Object.defineProperty(exports, "DIGEST_VALUE_PATTERN", { enumerable: true, get: function () { return interaction_1.DIGEST_VALUE_PATTERN; } });
|
|
225
|
+
// Validation
|
|
226
|
+
Object.defineProperty(exports, "validateInteraction", { enumerable: true, get: function () { return interaction_1.validateInteraction; } });
|
|
227
|
+
Object.defineProperty(exports, "validateInteractionOrdered", { enumerable: true, get: function () { return interaction_1.validateInteractionOrdered; } });
|
|
228
|
+
Object.defineProperty(exports, "validateInteractionEvidence", { enumerable: true, get: function () { return interaction_1.validateInteractionEvidence; } });
|
|
229
|
+
Object.defineProperty(exports, "isValidInteractionEvidence", { enumerable: true, get: function () { return interaction_1.isValidInteractionEvidence; } });
|
|
230
|
+
// Helpers
|
|
231
|
+
Object.defineProperty(exports, "isWellKnownKind", { enumerable: true, get: function () { return interaction_1.isWellKnownKind; } });
|
|
232
|
+
Object.defineProperty(exports, "isReservedKindPrefix", { enumerable: true, get: function () { return interaction_1.isReservedKindPrefix; } });
|
|
233
|
+
Object.defineProperty(exports, "isDigestTruncated", { enumerable: true, get: function () { return interaction_1.isDigestTruncated; } });
|
|
234
|
+
// SDK Accessors
|
|
235
|
+
Object.defineProperty(exports, "getInteraction", { enumerable: true, get: function () { return interaction_1.getInteraction; } });
|
|
236
|
+
Object.defineProperty(exports, "setInteraction", { enumerable: true, get: function () { return interaction_1.setInteraction; } });
|
|
237
|
+
Object.defineProperty(exports, "hasInteraction", { enumerable: true, get: function () { return interaction_1.hasInteraction; } });
|
|
238
|
+
// Projection API
|
|
239
|
+
Object.defineProperty(exports, "createReceiptView", { enumerable: true, get: function () { return interaction_1.createReceiptView; } });
|
|
240
|
+
// Factory
|
|
241
|
+
Object.defineProperty(exports, "createInteractionEvidence", { enumerable: true, get: function () { return interaction_1.createInteractionEvidence; } });
|
|
198
242
|
// Obligations extension (v0.9.26+ CC Signals alignment)
|
|
199
243
|
var obligations_1 = require("./obligations");
|
|
200
244
|
Object.defineProperty(exports, "CreditMethodSchema", { enumerable: true, get: function () { return obligations_1.CreditMethodSchema; } });
|
|
@@ -216,4 +260,21 @@ Object.defineProperty(exports, "isContributionRequired", { enumerable: true, get
|
|
|
216
260
|
Object.defineProperty(exports, "createCreditObligation", { enumerable: true, get: function () { return obligations_1.createCreditObligation; } });
|
|
217
261
|
Object.defineProperty(exports, "createContributionObligation", { enumerable: true, get: function () { return obligations_1.createContributionObligation; } });
|
|
218
262
|
Object.defineProperty(exports, "createObligationsExtension", { enumerable: true, get: function () { return obligations_1.createObligationsExtension; } });
|
|
263
|
+
// Attestation receipt types (v0.10.8+ middleware profile)
|
|
264
|
+
var attestation_receipt_1 = require("./attestation-receipt");
|
|
265
|
+
Object.defineProperty(exports, "MinimalInteractionBindingSchema", { enumerable: true, get: function () { return attestation_receipt_1.MinimalInteractionBindingSchema; } });
|
|
266
|
+
Object.defineProperty(exports, "AttestationExtensionsSchema", { enumerable: true, get: function () { return attestation_receipt_1.AttestationExtensionsSchema; } });
|
|
267
|
+
Object.defineProperty(exports, "AttestationReceiptClaimsSchema", { enumerable: true, get: function () { return attestation_receipt_1.AttestationReceiptClaimsSchema; } });
|
|
268
|
+
// Constants
|
|
269
|
+
Object.defineProperty(exports, "ATTESTATION_RECEIPT_TYPE", { enumerable: true, get: function () { return attestation_receipt_1.ATTESTATION_RECEIPT_TYPE; } });
|
|
270
|
+
Object.defineProperty(exports, "MIDDLEWARE_INTERACTION_KEY", { enumerable: true, get: function () { return attestation_receipt_1.MIDDLEWARE_INTERACTION_KEY; } });
|
|
271
|
+
Object.defineProperty(exports, "ATTESTATION_LIMITS", { enumerable: true, get: function () { return attestation_receipt_1.ATTESTATION_LIMITS; } });
|
|
272
|
+
// Helpers
|
|
273
|
+
Object.defineProperty(exports, "validateAttestationReceiptClaims", { enumerable: true, get: function () { return attestation_receipt_1.validateAttestationReceiptClaims; } });
|
|
274
|
+
Object.defineProperty(exports, "isAttestationReceiptClaims", { enumerable: true, get: function () { return attestation_receipt_1.isAttestationReceiptClaims; } });
|
|
275
|
+
Object.defineProperty(exports, "validateMinimalInteractionBinding", { enumerable: true, get: function () { return attestation_receipt_1.validateMinimalInteractionBinding; } });
|
|
276
|
+
Object.defineProperty(exports, "isMinimalInteractionBinding", { enumerable: true, get: function () { return attestation_receipt_1.isMinimalInteractionBinding; } });
|
|
277
|
+
Object.defineProperty(exports, "createAttestationReceiptClaims", { enumerable: true, get: function () { return attestation_receipt_1.createAttestationReceiptClaims; } });
|
|
278
|
+
Object.defineProperty(exports, "isAttestationOnly", { enumerable: true, get: function () { return attestation_receipt_1.isAttestationOnly; } });
|
|
279
|
+
Object.defineProperty(exports, "isPaymentReceipt", { enumerable: true, get: function () { return attestation_receipt_1.isPaymentReceipt; } });
|
|
219
280
|
//# sourceMappingURL=index.js.map
|