@kya-os/contracts 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/agentshield-api/endpoints.d.ts +21 -0
- package/dist/agentshield-api/endpoints.js +20 -0
- package/dist/agentshield-api/index.d.ts +5 -0
- package/dist/agentshield-api/index.js +27 -0
- package/dist/agentshield-api/schemas.d.ts +9846 -0
- package/dist/agentshield-api/schemas.js +92 -0
- package/dist/agentshield-api/types.d.ts +92 -0
- package/dist/agentshield-api/types.js +12 -0
- package/dist/cli.d.ts +3 -6
- package/dist/cli.js +3 -10
- package/dist/config/base.d.ts +19 -0
- package/dist/config/base.js +2 -0
- package/dist/config/delegation.d.ts +46 -0
- package/dist/config/delegation.js +2 -0
- package/dist/config/identity.d.ts +22 -0
- package/dist/config/identity.js +2 -0
- package/dist/config/index.d.ts +17 -0
- package/dist/config/index.js +2 -0
- package/dist/config/proofing.d.ts +26 -0
- package/dist/config/proofing.js +2 -0
- package/dist/config/tool-protection.d.ts +36 -0
- package/dist/config/tool-protection.js +2 -0
- package/dist/delegation/constraints.d.ts +0 -266
- package/dist/delegation/constraints.js +3 -110
- package/dist/delegation/index.d.ts +0 -6
- package/dist/delegation/index.js +0 -6
- package/dist/delegation/schemas.d.ts +174 -514
- package/dist/delegation/schemas.js +3 -247
- package/dist/did/index.d.ts +0 -6
- package/dist/did/index.js +0 -6
- package/dist/did/resolve-contract.d.ts +0 -167
- package/dist/did/resolve-contract.js +0 -20
- package/dist/did/schemas.d.ts +0 -80
- package/dist/did/schemas.js +4 -97
- package/dist/did/types.d.ts +0 -126
- package/dist/did/types.js +0 -34
- package/dist/env/constants.d.ts +0 -45
- package/dist/env/constants.js +0 -45
- package/dist/env/index.d.ts +0 -4
- package/dist/env/index.js +0 -4
- package/dist/handshake.d.ts +0 -21
- package/dist/handshake.js +3 -11
- package/dist/index.d.ts +0 -15
- package/dist/index.js +0 -25
- package/dist/proof/index.d.ts +0 -7
- package/dist/proof/index.js +0 -7
- package/dist/proof/proof-record.d.ts +62 -172
- package/dist/proof/proof-record.js +0 -74
- package/dist/proof/signing-spec.d.ts +12 -86
- package/dist/proof/signing-spec.js +0 -71
- package/dist/proof.d.ts +16 -38
- package/dist/proof.js +3 -26
- package/dist/registry.d.ts +10 -27
- package/dist/registry.js +9 -30
- package/dist/runtime/errors.d.ts +0 -169
- package/dist/runtime/errors.js +0 -69
- package/dist/runtime/headers.d.ts +0 -50
- package/dist/runtime/headers.js +0 -30
- package/dist/runtime/index.d.ts +0 -4
- package/dist/runtime/index.js +0 -4
- package/dist/test.d.ts +0 -37
- package/dist/test.js +0 -37
- package/dist/tlkrc/index.d.ts +0 -4
- package/dist/tlkrc/index.js +0 -4
- package/dist/tlkrc/rotation.d.ts +12 -90
- package/dist/tlkrc/rotation.js +0 -72
- package/dist/tool-protection/index.d.ts +129 -0
- package/dist/tool-protection/index.js +80 -0
- package/dist/utils/validation.d.ts +0 -17
- package/dist/utils/validation.js +0 -14
- package/dist/vc/index.d.ts +0 -6
- package/dist/vc/index.js +0 -6
- package/dist/vc/schemas.d.ts +0 -596
- package/dist/vc/schemas.js +2 -111
- package/dist/vc/statuslist.d.ts +0 -202
- package/dist/vc/statuslist.js +1 -73
- package/dist/verifier.d.ts +9 -13
- package/dist/verifier.js +0 -8
- package/dist/well-known/index.d.ts +248 -0
- package/dist/well-known/index.js +104 -0
- package/package.json +27 -5
|
@@ -1,39 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Proof Record (Archive)
|
|
3
|
-
*
|
|
4
|
-
* Schema for proof records stored in KV/archive for audit trails
|
|
5
|
-
*
|
|
6
|
-
* Related Spec: MCP-I §5
|
|
7
|
-
* Python Reference: Edge-Delegation-Verification.md
|
|
8
|
-
*/
|
|
9
1
|
import { z } from 'zod';
|
|
10
|
-
/**
|
|
11
|
-
* Request Info Schema
|
|
12
|
-
*
|
|
13
|
-
* Information about the request that was proven
|
|
14
|
-
*/
|
|
15
2
|
export declare const RequestInfoSchema: z.ZodObject<{
|
|
16
3
|
method: z.ZodString;
|
|
17
4
|
url: z.ZodString;
|
|
18
5
|
bodyHash: z.ZodOptional<z.ZodString>;
|
|
19
6
|
headersHash: z.ZodOptional<z.ZodString>;
|
|
20
7
|
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
method: string;
|
|
22
8
|
url: string;
|
|
9
|
+
method: string;
|
|
23
10
|
bodyHash?: string | undefined;
|
|
24
11
|
headersHash?: string | undefined;
|
|
25
12
|
}, {
|
|
26
|
-
method: string;
|
|
27
13
|
url: string;
|
|
14
|
+
method: string;
|
|
28
15
|
bodyHash?: string | undefined;
|
|
29
16
|
headersHash?: string | undefined;
|
|
30
17
|
}>;
|
|
31
18
|
export type RequestInfo = z.infer<typeof RequestInfoSchema>;
|
|
32
|
-
/**
|
|
33
|
-
* Response Info Schema
|
|
34
|
-
*
|
|
35
|
-
* Information about the response
|
|
36
|
-
*/
|
|
37
19
|
export declare const ResponseInfoSchema: z.ZodObject<{
|
|
38
20
|
status: z.ZodNumber;
|
|
39
21
|
bodyHash: z.ZodOptional<z.ZodString>;
|
|
@@ -45,11 +27,6 @@ export declare const ResponseInfoSchema: z.ZodObject<{
|
|
|
45
27
|
bodyHash?: string | undefined;
|
|
46
28
|
}>;
|
|
47
29
|
export type ResponseInfo = z.infer<typeof ResponseInfoSchema>;
|
|
48
|
-
/**
|
|
49
|
-
* Proof Details Schema
|
|
50
|
-
*
|
|
51
|
-
* Core proof information
|
|
52
|
-
*/
|
|
53
30
|
export declare const ProofDetailsSchema: z.ZodObject<{
|
|
54
31
|
timestamp: z.ZodNumber;
|
|
55
32
|
nonce: z.ZodString;
|
|
@@ -64,13 +41,13 @@ export declare const ProofDetailsSchema: z.ZodObject<{
|
|
|
64
41
|
bodyHash: z.ZodOptional<z.ZodString>;
|
|
65
42
|
headersHash: z.ZodOptional<z.ZodString>;
|
|
66
43
|
}, "strip", z.ZodTypeAny, {
|
|
67
|
-
method: string;
|
|
68
44
|
url: string;
|
|
45
|
+
method: string;
|
|
69
46
|
bodyHash?: string | undefined;
|
|
70
47
|
headersHash?: string | undefined;
|
|
71
48
|
}, {
|
|
72
|
-
method: string;
|
|
73
49
|
url: string;
|
|
50
|
+
method: string;
|
|
74
51
|
bodyHash?: string | undefined;
|
|
75
52
|
headersHash?: string | undefined;
|
|
76
53
|
}>>;
|
|
@@ -85,16 +62,16 @@ export declare const ProofDetailsSchema: z.ZodObject<{
|
|
|
85
62
|
bodyHash?: string | undefined;
|
|
86
63
|
}>>;
|
|
87
64
|
}, "strip", z.ZodTypeAny, {
|
|
88
|
-
signature: string;
|
|
89
65
|
did: string;
|
|
90
66
|
nonce: string;
|
|
91
|
-
timestamp: number;
|
|
92
67
|
audience: string;
|
|
93
|
-
|
|
68
|
+
timestamp: number;
|
|
94
69
|
sessionId: string;
|
|
70
|
+
signature: string;
|
|
71
|
+
algorithm: "Ed25519" | "ES256";
|
|
95
72
|
request?: {
|
|
96
|
-
method: string;
|
|
97
73
|
url: string;
|
|
74
|
+
method: string;
|
|
98
75
|
bodyHash?: string | undefined;
|
|
99
76
|
headersHash?: string | undefined;
|
|
100
77
|
} | undefined;
|
|
@@ -103,16 +80,16 @@ export declare const ProofDetailsSchema: z.ZodObject<{
|
|
|
103
80
|
bodyHash?: string | undefined;
|
|
104
81
|
} | undefined;
|
|
105
82
|
}, {
|
|
106
|
-
signature: string;
|
|
107
83
|
did: string;
|
|
108
84
|
nonce: string;
|
|
109
|
-
timestamp: number;
|
|
110
85
|
audience: string;
|
|
111
|
-
|
|
86
|
+
timestamp: number;
|
|
112
87
|
sessionId: string;
|
|
88
|
+
signature: string;
|
|
89
|
+
algorithm: "Ed25519" | "ES256";
|
|
113
90
|
request?: {
|
|
114
|
-
method: string;
|
|
115
91
|
url: string;
|
|
92
|
+
method: string;
|
|
116
93
|
bodyHash?: string | undefined;
|
|
117
94
|
headersHash?: string | undefined;
|
|
118
95
|
} | undefined;
|
|
@@ -122,11 +99,6 @@ export declare const ProofDetailsSchema: z.ZodObject<{
|
|
|
122
99
|
} | undefined;
|
|
123
100
|
}>;
|
|
124
101
|
export type ProofDetails = z.infer<typeof ProofDetailsSchema>;
|
|
125
|
-
/**
|
|
126
|
-
* Linkage Info Schema
|
|
127
|
-
*
|
|
128
|
-
* Links to delegations and credentials
|
|
129
|
-
*/
|
|
130
102
|
export declare const LinkageInfoSchema: z.ZodObject<{
|
|
131
103
|
delegationId: z.ZodOptional<z.ZodString>;
|
|
132
104
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
@@ -141,11 +113,6 @@ export declare const LinkageInfoSchema: z.ZodObject<{
|
|
|
141
113
|
chainDepth?: number | undefined;
|
|
142
114
|
}>;
|
|
143
115
|
export type LinkageInfo = z.infer<typeof LinkageInfoSchema>;
|
|
144
|
-
/**
|
|
145
|
-
* CRISP Info Schema
|
|
146
|
-
*
|
|
147
|
-
* CRISP spending information
|
|
148
|
-
*/
|
|
149
116
|
export declare const CrispInfoSchema: z.ZodObject<{
|
|
150
117
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
151
118
|
delta: z.ZodOptional<z.ZodNumber>;
|
|
@@ -160,11 +127,6 @@ export declare const CrispInfoSchema: z.ZodObject<{
|
|
|
160
127
|
remaining?: number | undefined;
|
|
161
128
|
}>;
|
|
162
129
|
export type CrispInfo = z.infer<typeof CrispInfoSchema>;
|
|
163
|
-
/**
|
|
164
|
-
* Verification Info Schema
|
|
165
|
-
*
|
|
166
|
-
* Verification result for the proof
|
|
167
|
-
*/
|
|
168
130
|
export declare const VerificationInfoSchema: z.ZodObject<{
|
|
169
131
|
result: z.ZodEnum<["pending", "pass", "fail"]>;
|
|
170
132
|
reason: z.ZodOptional<z.ZodString>;
|
|
@@ -179,21 +141,11 @@ export declare const VerificationInfoSchema: z.ZodObject<{
|
|
|
179
141
|
checkedAt?: number | undefined;
|
|
180
142
|
}>;
|
|
181
143
|
export type VerificationInfo = z.infer<typeof VerificationInfoSchema>;
|
|
182
|
-
/**
|
|
183
|
-
* Proof Record Schema
|
|
184
|
-
*
|
|
185
|
-
* Complete proof record for archive/KV storage
|
|
186
|
-
*/
|
|
187
144
|
export declare const ProofRecordSchema: z.ZodObject<{
|
|
188
|
-
/** Unique identifier for the proof record */
|
|
189
145
|
id: z.ZodString;
|
|
190
|
-
/** Tool/service name that created the proof */
|
|
191
146
|
toolName: z.ZodString;
|
|
192
|
-
/** Timestamp when stored (milliseconds since epoch) */
|
|
193
147
|
storedAt: z.ZodNumber;
|
|
194
|
-
/** Expiration timestamp (milliseconds since epoch) */
|
|
195
148
|
expiresAt: z.ZodNumber;
|
|
196
|
-
/** Core proof details */
|
|
197
149
|
proof: z.ZodObject<{
|
|
198
150
|
timestamp: z.ZodNumber;
|
|
199
151
|
nonce: z.ZodString;
|
|
@@ -208,13 +160,13 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
208
160
|
bodyHash: z.ZodOptional<z.ZodString>;
|
|
209
161
|
headersHash: z.ZodOptional<z.ZodString>;
|
|
210
162
|
}, "strip", z.ZodTypeAny, {
|
|
211
|
-
method: string;
|
|
212
163
|
url: string;
|
|
164
|
+
method: string;
|
|
213
165
|
bodyHash?: string | undefined;
|
|
214
166
|
headersHash?: string | undefined;
|
|
215
167
|
}, {
|
|
216
|
-
method: string;
|
|
217
168
|
url: string;
|
|
169
|
+
method: string;
|
|
218
170
|
bodyHash?: string | undefined;
|
|
219
171
|
headersHash?: string | undefined;
|
|
220
172
|
}>>;
|
|
@@ -229,16 +181,16 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
229
181
|
bodyHash?: string | undefined;
|
|
230
182
|
}>>;
|
|
231
183
|
}, "strip", z.ZodTypeAny, {
|
|
232
|
-
signature: string;
|
|
233
184
|
did: string;
|
|
234
185
|
nonce: string;
|
|
235
|
-
timestamp: number;
|
|
236
186
|
audience: string;
|
|
237
|
-
|
|
187
|
+
timestamp: number;
|
|
238
188
|
sessionId: string;
|
|
189
|
+
signature: string;
|
|
190
|
+
algorithm: "Ed25519" | "ES256";
|
|
239
191
|
request?: {
|
|
240
|
-
method: string;
|
|
241
192
|
url: string;
|
|
193
|
+
method: string;
|
|
242
194
|
bodyHash?: string | undefined;
|
|
243
195
|
headersHash?: string | undefined;
|
|
244
196
|
} | undefined;
|
|
@@ -247,16 +199,16 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
247
199
|
bodyHash?: string | undefined;
|
|
248
200
|
} | undefined;
|
|
249
201
|
}, {
|
|
250
|
-
signature: string;
|
|
251
202
|
did: string;
|
|
252
203
|
nonce: string;
|
|
253
|
-
timestamp: number;
|
|
254
204
|
audience: string;
|
|
255
|
-
|
|
205
|
+
timestamp: number;
|
|
256
206
|
sessionId: string;
|
|
207
|
+
signature: string;
|
|
208
|
+
algorithm: "Ed25519" | "ES256";
|
|
257
209
|
request?: {
|
|
258
|
-
method: string;
|
|
259
210
|
url: string;
|
|
211
|
+
method: string;
|
|
260
212
|
bodyHash?: string | undefined;
|
|
261
213
|
headersHash?: string | undefined;
|
|
262
214
|
} | undefined;
|
|
@@ -265,7 +217,6 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
265
217
|
bodyHash?: string | undefined;
|
|
266
218
|
} | undefined;
|
|
267
219
|
}>;
|
|
268
|
-
/** Optional linkage to delegations/credentials */
|
|
269
220
|
linkage: z.ZodOptional<z.ZodObject<{
|
|
270
221
|
delegationId: z.ZodOptional<z.ZodString>;
|
|
271
222
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
@@ -279,7 +230,6 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
279
230
|
credentialId?: string | undefined;
|
|
280
231
|
chainDepth?: number | undefined;
|
|
281
232
|
}>>;
|
|
282
|
-
/** Optional CRISP spending info */
|
|
283
233
|
crisp: z.ZodOptional<z.ZodObject<{
|
|
284
234
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
285
235
|
delta: z.ZodOptional<z.ZodNumber>;
|
|
@@ -293,7 +243,6 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
293
243
|
delta?: number | undefined;
|
|
294
244
|
remaining?: number | undefined;
|
|
295
245
|
}>>;
|
|
296
|
-
/** Optional verification info */
|
|
297
246
|
verification: z.ZodOptional<z.ZodObject<{
|
|
298
247
|
result: z.ZodEnum<["pending", "pass", "fail"]>;
|
|
299
248
|
reason: z.ZodOptional<z.ZodString>;
|
|
@@ -307,18 +256,12 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
307
256
|
reason?: string | undefined;
|
|
308
257
|
checkedAt?: number | undefined;
|
|
309
258
|
}>>;
|
|
310
|
-
/** Optional metadata */
|
|
311
259
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
312
260
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
313
|
-
/** Unique identifier for the proof record */
|
|
314
261
|
id: z.ZodString;
|
|
315
|
-
/** Tool/service name that created the proof */
|
|
316
262
|
toolName: z.ZodString;
|
|
317
|
-
/** Timestamp when stored (milliseconds since epoch) */
|
|
318
263
|
storedAt: z.ZodNumber;
|
|
319
|
-
/** Expiration timestamp (milliseconds since epoch) */
|
|
320
264
|
expiresAt: z.ZodNumber;
|
|
321
|
-
/** Core proof details */
|
|
322
265
|
proof: z.ZodObject<{
|
|
323
266
|
timestamp: z.ZodNumber;
|
|
324
267
|
nonce: z.ZodString;
|
|
@@ -333,13 +276,13 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
333
276
|
bodyHash: z.ZodOptional<z.ZodString>;
|
|
334
277
|
headersHash: z.ZodOptional<z.ZodString>;
|
|
335
278
|
}, "strip", z.ZodTypeAny, {
|
|
336
|
-
method: string;
|
|
337
279
|
url: string;
|
|
280
|
+
method: string;
|
|
338
281
|
bodyHash?: string | undefined;
|
|
339
282
|
headersHash?: string | undefined;
|
|
340
283
|
}, {
|
|
341
|
-
method: string;
|
|
342
284
|
url: string;
|
|
285
|
+
method: string;
|
|
343
286
|
bodyHash?: string | undefined;
|
|
344
287
|
headersHash?: string | undefined;
|
|
345
288
|
}>>;
|
|
@@ -354,16 +297,16 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
354
297
|
bodyHash?: string | undefined;
|
|
355
298
|
}>>;
|
|
356
299
|
}, "strip", z.ZodTypeAny, {
|
|
357
|
-
signature: string;
|
|
358
300
|
did: string;
|
|
359
301
|
nonce: string;
|
|
360
|
-
timestamp: number;
|
|
361
302
|
audience: string;
|
|
362
|
-
|
|
303
|
+
timestamp: number;
|
|
363
304
|
sessionId: string;
|
|
305
|
+
signature: string;
|
|
306
|
+
algorithm: "Ed25519" | "ES256";
|
|
364
307
|
request?: {
|
|
365
|
-
method: string;
|
|
366
308
|
url: string;
|
|
309
|
+
method: string;
|
|
367
310
|
bodyHash?: string | undefined;
|
|
368
311
|
headersHash?: string | undefined;
|
|
369
312
|
} | undefined;
|
|
@@ -372,16 +315,16 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
372
315
|
bodyHash?: string | undefined;
|
|
373
316
|
} | undefined;
|
|
374
317
|
}, {
|
|
375
|
-
signature: string;
|
|
376
318
|
did: string;
|
|
377
319
|
nonce: string;
|
|
378
|
-
timestamp: number;
|
|
379
320
|
audience: string;
|
|
380
|
-
|
|
321
|
+
timestamp: number;
|
|
381
322
|
sessionId: string;
|
|
323
|
+
signature: string;
|
|
324
|
+
algorithm: "Ed25519" | "ES256";
|
|
382
325
|
request?: {
|
|
383
|
-
method: string;
|
|
384
326
|
url: string;
|
|
327
|
+
method: string;
|
|
385
328
|
bodyHash?: string | undefined;
|
|
386
329
|
headersHash?: string | undefined;
|
|
387
330
|
} | undefined;
|
|
@@ -390,7 +333,6 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
390
333
|
bodyHash?: string | undefined;
|
|
391
334
|
} | undefined;
|
|
392
335
|
}>;
|
|
393
|
-
/** Optional linkage to delegations/credentials */
|
|
394
336
|
linkage: z.ZodOptional<z.ZodObject<{
|
|
395
337
|
delegationId: z.ZodOptional<z.ZodString>;
|
|
396
338
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
@@ -404,7 +346,6 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
404
346
|
credentialId?: string | undefined;
|
|
405
347
|
chainDepth?: number | undefined;
|
|
406
348
|
}>>;
|
|
407
|
-
/** Optional CRISP spending info */
|
|
408
349
|
crisp: z.ZodOptional<z.ZodObject<{
|
|
409
350
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
410
351
|
delta: z.ZodOptional<z.ZodNumber>;
|
|
@@ -418,7 +359,6 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
418
359
|
delta?: number | undefined;
|
|
419
360
|
remaining?: number | undefined;
|
|
420
361
|
}>>;
|
|
421
|
-
/** Optional verification info */
|
|
422
362
|
verification: z.ZodOptional<z.ZodObject<{
|
|
423
363
|
result: z.ZodEnum<["pending", "pass", "fail"]>;
|
|
424
364
|
reason: z.ZodOptional<z.ZodString>;
|
|
@@ -432,18 +372,12 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
432
372
|
reason?: string | undefined;
|
|
433
373
|
checkedAt?: number | undefined;
|
|
434
374
|
}>>;
|
|
435
|
-
/** Optional metadata */
|
|
436
375
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
437
376
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
438
|
-
/** Unique identifier for the proof record */
|
|
439
377
|
id: z.ZodString;
|
|
440
|
-
/** Tool/service name that created the proof */
|
|
441
378
|
toolName: z.ZodString;
|
|
442
|
-
/** Timestamp when stored (milliseconds since epoch) */
|
|
443
379
|
storedAt: z.ZodNumber;
|
|
444
|
-
/** Expiration timestamp (milliseconds since epoch) */
|
|
445
380
|
expiresAt: z.ZodNumber;
|
|
446
|
-
/** Core proof details */
|
|
447
381
|
proof: z.ZodObject<{
|
|
448
382
|
timestamp: z.ZodNumber;
|
|
449
383
|
nonce: z.ZodString;
|
|
@@ -458,13 +392,13 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
458
392
|
bodyHash: z.ZodOptional<z.ZodString>;
|
|
459
393
|
headersHash: z.ZodOptional<z.ZodString>;
|
|
460
394
|
}, "strip", z.ZodTypeAny, {
|
|
461
|
-
method: string;
|
|
462
395
|
url: string;
|
|
396
|
+
method: string;
|
|
463
397
|
bodyHash?: string | undefined;
|
|
464
398
|
headersHash?: string | undefined;
|
|
465
399
|
}, {
|
|
466
|
-
method: string;
|
|
467
400
|
url: string;
|
|
401
|
+
method: string;
|
|
468
402
|
bodyHash?: string | undefined;
|
|
469
403
|
headersHash?: string | undefined;
|
|
470
404
|
}>>;
|
|
@@ -479,16 +413,16 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
479
413
|
bodyHash?: string | undefined;
|
|
480
414
|
}>>;
|
|
481
415
|
}, "strip", z.ZodTypeAny, {
|
|
482
|
-
signature: string;
|
|
483
416
|
did: string;
|
|
484
417
|
nonce: string;
|
|
485
|
-
timestamp: number;
|
|
486
418
|
audience: string;
|
|
487
|
-
|
|
419
|
+
timestamp: number;
|
|
488
420
|
sessionId: string;
|
|
421
|
+
signature: string;
|
|
422
|
+
algorithm: "Ed25519" | "ES256";
|
|
489
423
|
request?: {
|
|
490
|
-
method: string;
|
|
491
424
|
url: string;
|
|
425
|
+
method: string;
|
|
492
426
|
bodyHash?: string | undefined;
|
|
493
427
|
headersHash?: string | undefined;
|
|
494
428
|
} | undefined;
|
|
@@ -497,16 +431,16 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
497
431
|
bodyHash?: string | undefined;
|
|
498
432
|
} | undefined;
|
|
499
433
|
}, {
|
|
500
|
-
signature: string;
|
|
501
434
|
did: string;
|
|
502
435
|
nonce: string;
|
|
503
|
-
timestamp: number;
|
|
504
436
|
audience: string;
|
|
505
|
-
|
|
437
|
+
timestamp: number;
|
|
506
438
|
sessionId: string;
|
|
439
|
+
signature: string;
|
|
440
|
+
algorithm: "Ed25519" | "ES256";
|
|
507
441
|
request?: {
|
|
508
|
-
method: string;
|
|
509
442
|
url: string;
|
|
443
|
+
method: string;
|
|
510
444
|
bodyHash?: string | undefined;
|
|
511
445
|
headersHash?: string | undefined;
|
|
512
446
|
} | undefined;
|
|
@@ -515,7 +449,6 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
515
449
|
bodyHash?: string | undefined;
|
|
516
450
|
} | undefined;
|
|
517
451
|
}>;
|
|
518
|
-
/** Optional linkage to delegations/credentials */
|
|
519
452
|
linkage: z.ZodOptional<z.ZodObject<{
|
|
520
453
|
delegationId: z.ZodOptional<z.ZodString>;
|
|
521
454
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
@@ -529,7 +462,6 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
529
462
|
credentialId?: string | undefined;
|
|
530
463
|
chainDepth?: number | undefined;
|
|
531
464
|
}>>;
|
|
532
|
-
/** Optional CRISP spending info */
|
|
533
465
|
crisp: z.ZodOptional<z.ZodObject<{
|
|
534
466
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
535
467
|
delta: z.ZodOptional<z.ZodNumber>;
|
|
@@ -543,7 +475,6 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
543
475
|
delta?: number | undefined;
|
|
544
476
|
remaining?: number | undefined;
|
|
545
477
|
}>>;
|
|
546
|
-
/** Optional verification info */
|
|
547
478
|
verification: z.ZodOptional<z.ZodObject<{
|
|
548
479
|
result: z.ZodEnum<["pending", "pass", "fail"]>;
|
|
549
480
|
reason: z.ZodOptional<z.ZodString>;
|
|
@@ -557,29 +488,14 @@ export declare const ProofRecordSchema: z.ZodObject<{
|
|
|
557
488
|
reason?: string | undefined;
|
|
558
489
|
checkedAt?: number | undefined;
|
|
559
490
|
}>>;
|
|
560
|
-
/** Optional metadata */
|
|
561
491
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
562
492
|
}, z.ZodTypeAny, "passthrough">>;
|
|
563
493
|
export type ProofRecord = z.infer<typeof ProofRecordSchema>;
|
|
564
|
-
/**
|
|
565
|
-
* Validation Helpers
|
|
566
|
-
*/
|
|
567
|
-
/**
|
|
568
|
-
* Validate a proof record
|
|
569
|
-
*
|
|
570
|
-
* @param record - The record to validate
|
|
571
|
-
* @returns Validation result
|
|
572
|
-
*/
|
|
573
494
|
export declare function validateProofRecord(record: unknown): z.SafeParseReturnType<z.objectInputType<{
|
|
574
|
-
/** Unique identifier for the proof record */
|
|
575
495
|
id: z.ZodString;
|
|
576
|
-
/** Tool/service name that created the proof */
|
|
577
496
|
toolName: z.ZodString;
|
|
578
|
-
/** Timestamp when stored (milliseconds since epoch) */
|
|
579
497
|
storedAt: z.ZodNumber;
|
|
580
|
-
/** Expiration timestamp (milliseconds since epoch) */
|
|
581
498
|
expiresAt: z.ZodNumber;
|
|
582
|
-
/** Core proof details */
|
|
583
499
|
proof: z.ZodObject<{
|
|
584
500
|
timestamp: z.ZodNumber;
|
|
585
501
|
nonce: z.ZodString;
|
|
@@ -594,13 +510,13 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
594
510
|
bodyHash: z.ZodOptional<z.ZodString>;
|
|
595
511
|
headersHash: z.ZodOptional<z.ZodString>;
|
|
596
512
|
}, "strip", z.ZodTypeAny, {
|
|
597
|
-
method: string;
|
|
598
513
|
url: string;
|
|
514
|
+
method: string;
|
|
599
515
|
bodyHash?: string | undefined;
|
|
600
516
|
headersHash?: string | undefined;
|
|
601
517
|
}, {
|
|
602
|
-
method: string;
|
|
603
518
|
url: string;
|
|
519
|
+
method: string;
|
|
604
520
|
bodyHash?: string | undefined;
|
|
605
521
|
headersHash?: string | undefined;
|
|
606
522
|
}>>;
|
|
@@ -615,16 +531,16 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
615
531
|
bodyHash?: string | undefined;
|
|
616
532
|
}>>;
|
|
617
533
|
}, "strip", z.ZodTypeAny, {
|
|
618
|
-
signature: string;
|
|
619
534
|
did: string;
|
|
620
535
|
nonce: string;
|
|
621
|
-
timestamp: number;
|
|
622
536
|
audience: string;
|
|
623
|
-
|
|
537
|
+
timestamp: number;
|
|
624
538
|
sessionId: string;
|
|
539
|
+
signature: string;
|
|
540
|
+
algorithm: "Ed25519" | "ES256";
|
|
625
541
|
request?: {
|
|
626
|
-
method: string;
|
|
627
542
|
url: string;
|
|
543
|
+
method: string;
|
|
628
544
|
bodyHash?: string | undefined;
|
|
629
545
|
headersHash?: string | undefined;
|
|
630
546
|
} | undefined;
|
|
@@ -633,16 +549,16 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
633
549
|
bodyHash?: string | undefined;
|
|
634
550
|
} | undefined;
|
|
635
551
|
}, {
|
|
636
|
-
signature: string;
|
|
637
552
|
did: string;
|
|
638
553
|
nonce: string;
|
|
639
|
-
timestamp: number;
|
|
640
554
|
audience: string;
|
|
641
|
-
|
|
555
|
+
timestamp: number;
|
|
642
556
|
sessionId: string;
|
|
557
|
+
signature: string;
|
|
558
|
+
algorithm: "Ed25519" | "ES256";
|
|
643
559
|
request?: {
|
|
644
|
-
method: string;
|
|
645
560
|
url: string;
|
|
561
|
+
method: string;
|
|
646
562
|
bodyHash?: string | undefined;
|
|
647
563
|
headersHash?: string | undefined;
|
|
648
564
|
} | undefined;
|
|
@@ -651,7 +567,6 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
651
567
|
bodyHash?: string | undefined;
|
|
652
568
|
} | undefined;
|
|
653
569
|
}>;
|
|
654
|
-
/** Optional linkage to delegations/credentials */
|
|
655
570
|
linkage: z.ZodOptional<z.ZodObject<{
|
|
656
571
|
delegationId: z.ZodOptional<z.ZodString>;
|
|
657
572
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
@@ -665,7 +580,6 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
665
580
|
credentialId?: string | undefined;
|
|
666
581
|
chainDepth?: number | undefined;
|
|
667
582
|
}>>;
|
|
668
|
-
/** Optional CRISP spending info */
|
|
669
583
|
crisp: z.ZodOptional<z.ZodObject<{
|
|
670
584
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
671
585
|
delta: z.ZodOptional<z.ZodNumber>;
|
|
@@ -679,7 +593,6 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
679
593
|
delta?: number | undefined;
|
|
680
594
|
remaining?: number | undefined;
|
|
681
595
|
}>>;
|
|
682
|
-
/** Optional verification info */
|
|
683
596
|
verification: z.ZodOptional<z.ZodObject<{
|
|
684
597
|
result: z.ZodEnum<["pending", "pass", "fail"]>;
|
|
685
598
|
reason: z.ZodOptional<z.ZodString>;
|
|
@@ -693,18 +606,12 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
693
606
|
reason?: string | undefined;
|
|
694
607
|
checkedAt?: number | undefined;
|
|
695
608
|
}>>;
|
|
696
|
-
/** Optional metadata */
|
|
697
609
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
698
610
|
}, z.ZodTypeAny, "passthrough">, z.objectOutputType<{
|
|
699
|
-
/** Unique identifier for the proof record */
|
|
700
611
|
id: z.ZodString;
|
|
701
|
-
/** Tool/service name that created the proof */
|
|
702
612
|
toolName: z.ZodString;
|
|
703
|
-
/** Timestamp when stored (milliseconds since epoch) */
|
|
704
613
|
storedAt: z.ZodNumber;
|
|
705
|
-
/** Expiration timestamp (milliseconds since epoch) */
|
|
706
614
|
expiresAt: z.ZodNumber;
|
|
707
|
-
/** Core proof details */
|
|
708
615
|
proof: z.ZodObject<{
|
|
709
616
|
timestamp: z.ZodNumber;
|
|
710
617
|
nonce: z.ZodString;
|
|
@@ -719,13 +626,13 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
719
626
|
bodyHash: z.ZodOptional<z.ZodString>;
|
|
720
627
|
headersHash: z.ZodOptional<z.ZodString>;
|
|
721
628
|
}, "strip", z.ZodTypeAny, {
|
|
722
|
-
method: string;
|
|
723
629
|
url: string;
|
|
630
|
+
method: string;
|
|
724
631
|
bodyHash?: string | undefined;
|
|
725
632
|
headersHash?: string | undefined;
|
|
726
633
|
}, {
|
|
727
|
-
method: string;
|
|
728
634
|
url: string;
|
|
635
|
+
method: string;
|
|
729
636
|
bodyHash?: string | undefined;
|
|
730
637
|
headersHash?: string | undefined;
|
|
731
638
|
}>>;
|
|
@@ -740,16 +647,16 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
740
647
|
bodyHash?: string | undefined;
|
|
741
648
|
}>>;
|
|
742
649
|
}, "strip", z.ZodTypeAny, {
|
|
743
|
-
signature: string;
|
|
744
650
|
did: string;
|
|
745
651
|
nonce: string;
|
|
746
|
-
timestamp: number;
|
|
747
652
|
audience: string;
|
|
748
|
-
|
|
653
|
+
timestamp: number;
|
|
749
654
|
sessionId: string;
|
|
655
|
+
signature: string;
|
|
656
|
+
algorithm: "Ed25519" | "ES256";
|
|
750
657
|
request?: {
|
|
751
|
-
method: string;
|
|
752
658
|
url: string;
|
|
659
|
+
method: string;
|
|
753
660
|
bodyHash?: string | undefined;
|
|
754
661
|
headersHash?: string | undefined;
|
|
755
662
|
} | undefined;
|
|
@@ -758,16 +665,16 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
758
665
|
bodyHash?: string | undefined;
|
|
759
666
|
} | undefined;
|
|
760
667
|
}, {
|
|
761
|
-
signature: string;
|
|
762
668
|
did: string;
|
|
763
669
|
nonce: string;
|
|
764
|
-
timestamp: number;
|
|
765
670
|
audience: string;
|
|
766
|
-
|
|
671
|
+
timestamp: number;
|
|
767
672
|
sessionId: string;
|
|
673
|
+
signature: string;
|
|
674
|
+
algorithm: "Ed25519" | "ES256";
|
|
768
675
|
request?: {
|
|
769
|
-
method: string;
|
|
770
676
|
url: string;
|
|
677
|
+
method: string;
|
|
771
678
|
bodyHash?: string | undefined;
|
|
772
679
|
headersHash?: string | undefined;
|
|
773
680
|
} | undefined;
|
|
@@ -776,7 +683,6 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
776
683
|
bodyHash?: string | undefined;
|
|
777
684
|
} | undefined;
|
|
778
685
|
}>;
|
|
779
|
-
/** Optional linkage to delegations/credentials */
|
|
780
686
|
linkage: z.ZodOptional<z.ZodObject<{
|
|
781
687
|
delegationId: z.ZodOptional<z.ZodString>;
|
|
782
688
|
credentialId: z.ZodOptional<z.ZodString>;
|
|
@@ -790,7 +696,6 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
790
696
|
credentialId?: string | undefined;
|
|
791
697
|
chainDepth?: number | undefined;
|
|
792
698
|
}>>;
|
|
793
|
-
/** Optional CRISP spending info */
|
|
794
699
|
crisp: z.ZodOptional<z.ZodObject<{
|
|
795
700
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
796
701
|
delta: z.ZodOptional<z.ZodNumber>;
|
|
@@ -804,7 +709,6 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
804
709
|
delta?: number | undefined;
|
|
805
710
|
remaining?: number | undefined;
|
|
806
711
|
}>>;
|
|
807
|
-
/** Optional verification info */
|
|
808
712
|
verification: z.ZodOptional<z.ZodObject<{
|
|
809
713
|
result: z.ZodEnum<["pending", "pass", "fail"]>;
|
|
810
714
|
reason: z.ZodOptional<z.ZodString>;
|
|
@@ -818,21 +722,7 @@ export declare function validateProofRecord(record: unknown): z.SafeParseReturnT
|
|
|
818
722
|
reason?: string | undefined;
|
|
819
723
|
checkedAt?: number | undefined;
|
|
820
724
|
}>>;
|
|
821
|
-
/** Optional metadata */
|
|
822
725
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
823
726
|
}, z.ZodTypeAny, "passthrough">>;
|
|
824
|
-
/**
|
|
825
|
-
* Check if proof record is expired
|
|
826
|
-
*
|
|
827
|
-
* @param record - The record to check
|
|
828
|
-
* @returns true if expired
|
|
829
|
-
*/
|
|
830
727
|
export declare function isProofRecordExpired(record: ProofRecord): boolean;
|
|
831
|
-
/**
|
|
832
|
-
* Constants
|
|
833
|
-
*/
|
|
834
|
-
/**
|
|
835
|
-
* Default proof record TTL (30 days in milliseconds)
|
|
836
|
-
*/
|
|
837
728
|
export declare const DEFAULT_PROOF_RECORD_TTL_MS: number;
|
|
838
|
-
//# sourceMappingURL=proof-record.d.ts.map
|