@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,55 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Delegation Record Schemas
|
|
3
|
-
*
|
|
4
|
-
* Types and schemas for delegation records that link VCs with CRISP constraints.
|
|
5
|
-
* Delegations represent the transfer of authority from one DID to another.
|
|
6
|
-
*
|
|
7
|
-
* **IMPORTANT**: Per Python POC design (Delegation-Service.md:136-146),
|
|
8
|
-
* delegations SHOULD be issued as W3C Verifiable Credentials, not just reference them.
|
|
9
|
-
* This file provides both:
|
|
10
|
-
* - DelegationRecord: Legacy/internal format (contains delegation data)
|
|
11
|
-
* - DelegationCredential: W3C VC format (delegation as credentialSubject)
|
|
12
|
-
*
|
|
13
|
-
* Related Spec: MCP-I §4.1, §4.2, W3C VC Data Model 1.1
|
|
14
|
-
* Python Reference: Delegation-Documentation.md, Delegation-Service.md
|
|
15
|
-
*/
|
|
16
1
|
import { z } from 'zod';
|
|
17
2
|
import { CredentialStatusSchema } from '../vc/schemas.js';
|
|
18
|
-
/**
|
|
19
|
-
* Delegation Status
|
|
20
|
-
*
|
|
21
|
-
* Lifecycle status of a delegation
|
|
22
|
-
*/
|
|
23
3
|
export declare const DelegationStatusSchema: z.ZodEnum<["active", "revoked", "expired"]>;
|
|
24
4
|
export type DelegationStatus = z.infer<typeof DelegationStatusSchema>;
|
|
25
|
-
/**
|
|
26
|
-
* Delegation Record Schema
|
|
27
|
-
*
|
|
28
|
-
* Complete delegation record linking issuer (delegator) to subject (delegatee)
|
|
29
|
-
* with backing VC and CRISP constraints.
|
|
30
|
-
*
|
|
31
|
-
* **Key Invariants:**
|
|
32
|
-
* - Delegation MUST reference a live VC via `vcId`
|
|
33
|
-
* - Revocation of VC invalidates all linked delegations
|
|
34
|
-
* - Chain: no cycles allowed
|
|
35
|
-
* - Child `notAfter` ≤ parent `notAfter`
|
|
36
|
-
* - Child scopes ⊆ parent scopes
|
|
37
|
-
* - Child budgets ≤ parent budgets (same unit)
|
|
38
|
-
*/
|
|
39
5
|
export declare const DelegationRecordSchema: z.ZodObject<{
|
|
40
|
-
/** Unique identifier for the delegation */
|
|
41
6
|
id: z.ZodString;
|
|
42
|
-
/** DID of the delegator (issuer, e.g., merchant/user) */
|
|
43
7
|
issuerDid: z.ZodString;
|
|
44
|
-
/** DID of the delegatee (subject, e.g., agent) */
|
|
45
8
|
subjectDid: z.ZodString;
|
|
46
|
-
/** Optional controller (user account ID or DID) */
|
|
47
9
|
controller: z.ZodOptional<z.ZodString>;
|
|
48
|
-
/** ID of the backing Verifiable Credential */
|
|
49
10
|
vcId: z.ZodString;
|
|
50
|
-
/** Optional parent delegation ID for chain tracking */
|
|
51
11
|
parentId: z.ZodOptional<z.ZodString>;
|
|
52
|
-
/** CRISP constraints on this delegation */
|
|
53
12
|
constraints: z.ZodObject<{
|
|
54
13
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
55
14
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -444,32 +403,19 @@ export declare const DelegationRecordSchema: z.ZodObject<{
|
|
|
444
403
|
}>, "many">;
|
|
445
404
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
446
405
|
}, z.ZodTypeAny, "passthrough">>;
|
|
447
|
-
/** Detached JWS signature over canonical delegation document */
|
|
448
406
|
signature: z.ZodString;
|
|
449
|
-
/** Current status of the delegation */
|
|
450
407
|
status: z.ZodEnum<["active", "revoked", "expired"]>;
|
|
451
|
-
/** Timestamp when created (milliseconds since epoch) */
|
|
452
408
|
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
453
|
-
/** Timestamp when revoked (if status is revoked) */
|
|
454
409
|
revokedAt: z.ZodOptional<z.ZodNumber>;
|
|
455
|
-
/** Optional reason for revocation */
|
|
456
410
|
revokedReason: z.ZodOptional<z.ZodString>;
|
|
457
|
-
/** Optional metadata */
|
|
458
411
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
459
412
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
460
|
-
/** Unique identifier for the delegation */
|
|
461
413
|
id: z.ZodString;
|
|
462
|
-
/** DID of the delegator (issuer, e.g., merchant/user) */
|
|
463
414
|
issuerDid: z.ZodString;
|
|
464
|
-
/** DID of the delegatee (subject, e.g., agent) */
|
|
465
415
|
subjectDid: z.ZodString;
|
|
466
|
-
/** Optional controller (user account ID or DID) */
|
|
467
416
|
controller: z.ZodOptional<z.ZodString>;
|
|
468
|
-
/** ID of the backing Verifiable Credential */
|
|
469
417
|
vcId: z.ZodString;
|
|
470
|
-
/** Optional parent delegation ID for chain tracking */
|
|
471
418
|
parentId: z.ZodOptional<z.ZodString>;
|
|
472
|
-
/** CRISP constraints on this delegation */
|
|
473
419
|
constraints: z.ZodObject<{
|
|
474
420
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
475
421
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -864,32 +810,19 @@ export declare const DelegationRecordSchema: z.ZodObject<{
|
|
|
864
810
|
}>, "many">;
|
|
865
811
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
866
812
|
}, z.ZodTypeAny, "passthrough">>;
|
|
867
|
-
/** Detached JWS signature over canonical delegation document */
|
|
868
813
|
signature: z.ZodString;
|
|
869
|
-
/** Current status of the delegation */
|
|
870
814
|
status: z.ZodEnum<["active", "revoked", "expired"]>;
|
|
871
|
-
/** Timestamp when created (milliseconds since epoch) */
|
|
872
815
|
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
873
|
-
/** Timestamp when revoked (if status is revoked) */
|
|
874
816
|
revokedAt: z.ZodOptional<z.ZodNumber>;
|
|
875
|
-
/** Optional reason for revocation */
|
|
876
817
|
revokedReason: z.ZodOptional<z.ZodString>;
|
|
877
|
-
/** Optional metadata */
|
|
878
818
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
879
819
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
880
|
-
/** Unique identifier for the delegation */
|
|
881
820
|
id: z.ZodString;
|
|
882
|
-
/** DID of the delegator (issuer, e.g., merchant/user) */
|
|
883
821
|
issuerDid: z.ZodString;
|
|
884
|
-
/** DID of the delegatee (subject, e.g., agent) */
|
|
885
822
|
subjectDid: z.ZodString;
|
|
886
|
-
/** Optional controller (user account ID or DID) */
|
|
887
823
|
controller: z.ZodOptional<z.ZodString>;
|
|
888
|
-
/** ID of the backing Verifiable Credential */
|
|
889
824
|
vcId: z.ZodString;
|
|
890
|
-
/** Optional parent delegation ID for chain tracking */
|
|
891
825
|
parentId: z.ZodOptional<z.ZodString>;
|
|
892
|
-
/** CRISP constraints on this delegation */
|
|
893
826
|
constraints: z.ZodObject<{
|
|
894
827
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
895
828
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1284,37 +1217,20 @@ export declare const DelegationRecordSchema: z.ZodObject<{
|
|
|
1284
1217
|
}>, "many">;
|
|
1285
1218
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1286
1219
|
}, z.ZodTypeAny, "passthrough">>;
|
|
1287
|
-
/** Detached JWS signature over canonical delegation document */
|
|
1288
1220
|
signature: z.ZodString;
|
|
1289
|
-
/** Current status of the delegation */
|
|
1290
1221
|
status: z.ZodEnum<["active", "revoked", "expired"]>;
|
|
1291
|
-
/** Timestamp when created (milliseconds since epoch) */
|
|
1292
1222
|
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
1293
|
-
/** Timestamp when revoked (if status is revoked) */
|
|
1294
1223
|
revokedAt: z.ZodOptional<z.ZodNumber>;
|
|
1295
|
-
/** Optional reason for revocation */
|
|
1296
1224
|
revokedReason: z.ZodOptional<z.ZodString>;
|
|
1297
|
-
/** Optional metadata */
|
|
1298
1225
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
1299
1226
|
}, z.ZodTypeAny, "passthrough">>;
|
|
1300
1227
|
export type DelegationRecord = z.infer<typeof DelegationRecordSchema>;
|
|
1301
|
-
/**
|
|
1302
|
-
* Delegation Chain Entry
|
|
1303
|
-
*
|
|
1304
|
-
* Represents a single link in a delegation chain
|
|
1305
|
-
*/
|
|
1306
1228
|
export declare const DelegationChainEntrySchema: z.ZodObject<{
|
|
1307
|
-
/** Delegation ID */
|
|
1308
1229
|
delegationId: z.ZodString;
|
|
1309
|
-
/** Issuer DID */
|
|
1310
1230
|
issuerDid: z.ZodString;
|
|
1311
|
-
/** Subject DID */
|
|
1312
1231
|
subjectDid: z.ZodString;
|
|
1313
|
-
/** VC ID */
|
|
1314
1232
|
vcId: z.ZodString;
|
|
1315
|
-
/** Depth in chain (0 = root) */
|
|
1316
1233
|
depth: z.ZodNumber;
|
|
1317
|
-
/** Constraints */
|
|
1318
1234
|
constraints: z.ZodObject<{
|
|
1319
1235
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
1320
1236
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1709,17 +1625,13 @@ export declare const DelegationChainEntrySchema: z.ZodObject<{
|
|
|
1709
1625
|
}>, "many">;
|
|
1710
1626
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1711
1627
|
}, z.ZodTypeAny, "passthrough">>;
|
|
1712
|
-
/** Status */
|
|
1713
1628
|
status: z.ZodEnum<["active", "revoked", "expired"]>;
|
|
1714
1629
|
}, "strip", z.ZodTypeAny, {
|
|
1715
1630
|
status: "active" | "revoked" | "expired";
|
|
1716
|
-
issuerDid: string;
|
|
1717
|
-
subjectDid: string;
|
|
1718
|
-
vcId: string;
|
|
1719
1631
|
constraints: {
|
|
1632
|
+
scopes?: string[] | undefined;
|
|
1720
1633
|
notBefore?: number | undefined;
|
|
1721
1634
|
notAfter?: number | undefined;
|
|
1722
|
-
scopes?: string[] | undefined;
|
|
1723
1635
|
crisp?: z.objectOutputType<{
|
|
1724
1636
|
budget: z.ZodOptional<z.ZodObject<{
|
|
1725
1637
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -1766,17 +1678,17 @@ export declare const DelegationChainEntrySchema: z.ZodObject<{
|
|
|
1766
1678
|
} & {
|
|
1767
1679
|
[k: string]: unknown;
|
|
1768
1680
|
};
|
|
1681
|
+
issuerDid: string;
|
|
1682
|
+
subjectDid: string;
|
|
1683
|
+
vcId: string;
|
|
1769
1684
|
delegationId: string;
|
|
1770
1685
|
depth: number;
|
|
1771
1686
|
}, {
|
|
1772
1687
|
status: "active" | "revoked" | "expired";
|
|
1773
|
-
issuerDid: string;
|
|
1774
|
-
subjectDid: string;
|
|
1775
|
-
vcId: string;
|
|
1776
1688
|
constraints: {
|
|
1689
|
+
scopes?: string[] | undefined;
|
|
1777
1690
|
notBefore?: number | undefined;
|
|
1778
1691
|
notAfter?: number | undefined;
|
|
1779
|
-
scopes?: string[] | undefined;
|
|
1780
1692
|
crisp?: z.objectInputType<{
|
|
1781
1693
|
budget: z.ZodOptional<z.ZodObject<{
|
|
1782
1694
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -1823,33 +1735,22 @@ export declare const DelegationChainEntrySchema: z.ZodObject<{
|
|
|
1823
1735
|
} & {
|
|
1824
1736
|
[k: string]: unknown;
|
|
1825
1737
|
};
|
|
1738
|
+
issuerDid: string;
|
|
1739
|
+
subjectDid: string;
|
|
1740
|
+
vcId: string;
|
|
1826
1741
|
delegationId: string;
|
|
1827
1742
|
depth: number;
|
|
1828
1743
|
}>;
|
|
1829
1744
|
export type DelegationChainEntry = z.infer<typeof DelegationChainEntrySchema>;
|
|
1830
|
-
/**
|
|
1831
|
-
* Delegation Chain
|
|
1832
|
-
*
|
|
1833
|
-
* Represents a complete delegation chain from root to leaf
|
|
1834
|
-
*/
|
|
1835
1745
|
export declare const DelegationChainSchema: z.ZodObject<{
|
|
1836
|
-
/** Root issuer DID */
|
|
1837
1746
|
rootIssuer: z.ZodString;
|
|
1838
|
-
/** Leaf subject DID */
|
|
1839
1747
|
leafSubject: z.ZodString;
|
|
1840
|
-
/** All delegations in the chain, ordered root to leaf */
|
|
1841
1748
|
chain: z.ZodArray<z.ZodObject<{
|
|
1842
|
-
/** Delegation ID */
|
|
1843
1749
|
delegationId: z.ZodString;
|
|
1844
|
-
/** Issuer DID */
|
|
1845
1750
|
issuerDid: z.ZodString;
|
|
1846
|
-
/** Subject DID */
|
|
1847
1751
|
subjectDid: z.ZodString;
|
|
1848
|
-
/** VC ID */
|
|
1849
1752
|
vcId: z.ZodString;
|
|
1850
|
-
/** Depth in chain (0 = root) */
|
|
1851
1753
|
depth: z.ZodNumber;
|
|
1852
|
-
/** Constraints */
|
|
1853
1754
|
constraints: z.ZodObject<{
|
|
1854
1755
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
1855
1756
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2244,17 +2145,13 @@ export declare const DelegationChainSchema: z.ZodObject<{
|
|
|
2244
2145
|
}>, "many">;
|
|
2245
2146
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
2246
2147
|
}, z.ZodTypeAny, "passthrough">>;
|
|
2247
|
-
/** Status */
|
|
2248
2148
|
status: z.ZodEnum<["active", "revoked", "expired"]>;
|
|
2249
2149
|
}, "strip", z.ZodTypeAny, {
|
|
2250
2150
|
status: "active" | "revoked" | "expired";
|
|
2251
|
-
issuerDid: string;
|
|
2252
|
-
subjectDid: string;
|
|
2253
|
-
vcId: string;
|
|
2254
2151
|
constraints: {
|
|
2152
|
+
scopes?: string[] | undefined;
|
|
2255
2153
|
notBefore?: number | undefined;
|
|
2256
2154
|
notAfter?: number | undefined;
|
|
2257
|
-
scopes?: string[] | undefined;
|
|
2258
2155
|
crisp?: z.objectOutputType<{
|
|
2259
2156
|
budget: z.ZodOptional<z.ZodObject<{
|
|
2260
2157
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -2301,17 +2198,17 @@ export declare const DelegationChainSchema: z.ZodObject<{
|
|
|
2301
2198
|
} & {
|
|
2302
2199
|
[k: string]: unknown;
|
|
2303
2200
|
};
|
|
2201
|
+
issuerDid: string;
|
|
2202
|
+
subjectDid: string;
|
|
2203
|
+
vcId: string;
|
|
2304
2204
|
delegationId: string;
|
|
2305
2205
|
depth: number;
|
|
2306
2206
|
}, {
|
|
2307
2207
|
status: "active" | "revoked" | "expired";
|
|
2308
|
-
issuerDid: string;
|
|
2309
|
-
subjectDid: string;
|
|
2310
|
-
vcId: string;
|
|
2311
2208
|
constraints: {
|
|
2209
|
+
scopes?: string[] | undefined;
|
|
2312
2210
|
notBefore?: number | undefined;
|
|
2313
2211
|
notAfter?: number | undefined;
|
|
2314
|
-
scopes?: string[] | undefined;
|
|
2315
2212
|
crisp?: z.objectInputType<{
|
|
2316
2213
|
budget: z.ZodOptional<z.ZodObject<{
|
|
2317
2214
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -2358,14 +2255,14 @@ export declare const DelegationChainSchema: z.ZodObject<{
|
|
|
2358
2255
|
} & {
|
|
2359
2256
|
[k: string]: unknown;
|
|
2360
2257
|
};
|
|
2258
|
+
issuerDid: string;
|
|
2259
|
+
subjectDid: string;
|
|
2260
|
+
vcId: string;
|
|
2361
2261
|
delegationId: string;
|
|
2362
2262
|
depth: number;
|
|
2363
2263
|
}>, "many">;
|
|
2364
|
-
/** Total chain depth */
|
|
2365
2264
|
depth: z.ZodNumber;
|
|
2366
|
-
/** Whether the entire chain is valid */
|
|
2367
2265
|
valid: z.ZodBoolean;
|
|
2368
|
-
/** Optional validation errors */
|
|
2369
2266
|
errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
2370
2267
|
}, "strip", z.ZodTypeAny, {
|
|
2371
2268
|
valid: boolean;
|
|
@@ -2374,13 +2271,10 @@ export declare const DelegationChainSchema: z.ZodObject<{
|
|
|
2374
2271
|
leafSubject: string;
|
|
2375
2272
|
chain: {
|
|
2376
2273
|
status: "active" | "revoked" | "expired";
|
|
2377
|
-
issuerDid: string;
|
|
2378
|
-
subjectDid: string;
|
|
2379
|
-
vcId: string;
|
|
2380
2274
|
constraints: {
|
|
2275
|
+
scopes?: string[] | undefined;
|
|
2381
2276
|
notBefore?: number | undefined;
|
|
2382
2277
|
notAfter?: number | undefined;
|
|
2383
|
-
scopes?: string[] | undefined;
|
|
2384
2278
|
crisp?: z.objectOutputType<{
|
|
2385
2279
|
budget: z.ZodOptional<z.ZodObject<{
|
|
2386
2280
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -2427,6 +2321,9 @@ export declare const DelegationChainSchema: z.ZodObject<{
|
|
|
2427
2321
|
} & {
|
|
2428
2322
|
[k: string]: unknown;
|
|
2429
2323
|
};
|
|
2324
|
+
issuerDid: string;
|
|
2325
|
+
subjectDid: string;
|
|
2326
|
+
vcId: string;
|
|
2430
2327
|
delegationId: string;
|
|
2431
2328
|
depth: number;
|
|
2432
2329
|
}[];
|
|
@@ -2438,13 +2335,10 @@ export declare const DelegationChainSchema: z.ZodObject<{
|
|
|
2438
2335
|
leafSubject: string;
|
|
2439
2336
|
chain: {
|
|
2440
2337
|
status: "active" | "revoked" | "expired";
|
|
2441
|
-
issuerDid: string;
|
|
2442
|
-
subjectDid: string;
|
|
2443
|
-
vcId: string;
|
|
2444
2338
|
constraints: {
|
|
2339
|
+
scopes?: string[] | undefined;
|
|
2445
2340
|
notBefore?: number | undefined;
|
|
2446
2341
|
notAfter?: number | undefined;
|
|
2447
|
-
scopes?: string[] | undefined;
|
|
2448
2342
|
crisp?: z.objectInputType<{
|
|
2449
2343
|
budget: z.ZodOptional<z.ZodObject<{
|
|
2450
2344
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -2491,25 +2385,19 @@ export declare const DelegationChainSchema: z.ZodObject<{
|
|
|
2491
2385
|
} & {
|
|
2492
2386
|
[k: string]: unknown;
|
|
2493
2387
|
};
|
|
2388
|
+
issuerDid: string;
|
|
2389
|
+
subjectDid: string;
|
|
2390
|
+
vcId: string;
|
|
2494
2391
|
delegationId: string;
|
|
2495
2392
|
depth: number;
|
|
2496
2393
|
}[];
|
|
2497
2394
|
errors?: string[] | undefined;
|
|
2498
2395
|
}>;
|
|
2499
2396
|
export type DelegationChain = z.infer<typeof DelegationChainSchema>;
|
|
2500
|
-
/**
|
|
2501
|
-
* Delegation Creation Request
|
|
2502
|
-
*
|
|
2503
|
-
* Input for creating a new delegation
|
|
2504
|
-
*/
|
|
2505
2397
|
export declare const DelegationCreationRequestSchema: z.ZodObject<{
|
|
2506
|
-
/** Delegator DID */
|
|
2507
2398
|
issuerDid: z.ZodString;
|
|
2508
|
-
/** Delegatee DID */
|
|
2509
2399
|
subjectDid: z.ZodString;
|
|
2510
|
-
/** Optional controller */
|
|
2511
2400
|
controller: z.ZodOptional<z.ZodString>;
|
|
2512
|
-
/** Constraints */
|
|
2513
2401
|
constraints: z.ZodObject<{
|
|
2514
2402
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
2515
2403
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2904,17 +2792,13 @@ export declare const DelegationCreationRequestSchema: z.ZodObject<{
|
|
|
2904
2792
|
}>, "many">;
|
|
2905
2793
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
2906
2794
|
}, z.ZodTypeAny, "passthrough">>;
|
|
2907
|
-
/** Optional parent delegation ID */
|
|
2908
2795
|
parentId: z.ZodOptional<z.ZodString>;
|
|
2909
|
-
/** Optional VC ID (if not provided, will be created) */
|
|
2910
2796
|
vcId: z.ZodOptional<z.ZodString>;
|
|
2911
2797
|
}, "strip", z.ZodTypeAny, {
|
|
2912
|
-
issuerDid: string;
|
|
2913
|
-
subjectDid: string;
|
|
2914
2798
|
constraints: {
|
|
2799
|
+
scopes?: string[] | undefined;
|
|
2915
2800
|
notBefore?: number | undefined;
|
|
2916
2801
|
notAfter?: number | undefined;
|
|
2917
|
-
scopes?: string[] | undefined;
|
|
2918
2802
|
crisp?: z.objectOutputType<{
|
|
2919
2803
|
budget: z.ZodOptional<z.ZodObject<{
|
|
2920
2804
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -2961,16 +2845,16 @@ export declare const DelegationCreationRequestSchema: z.ZodObject<{
|
|
|
2961
2845
|
} & {
|
|
2962
2846
|
[k: string]: unknown;
|
|
2963
2847
|
};
|
|
2848
|
+
issuerDid: string;
|
|
2849
|
+
subjectDid: string;
|
|
2964
2850
|
controller?: string | undefined;
|
|
2965
2851
|
vcId?: string | undefined;
|
|
2966
2852
|
parentId?: string | undefined;
|
|
2967
2853
|
}, {
|
|
2968
|
-
issuerDid: string;
|
|
2969
|
-
subjectDid: string;
|
|
2970
2854
|
constraints: {
|
|
2855
|
+
scopes?: string[] | undefined;
|
|
2971
2856
|
notBefore?: number | undefined;
|
|
2972
2857
|
notAfter?: number | undefined;
|
|
2973
|
-
scopes?: string[] | undefined;
|
|
2974
2858
|
crisp?: z.objectInputType<{
|
|
2975
2859
|
budget: z.ZodOptional<z.ZodObject<{
|
|
2976
2860
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -3017,76 +2901,49 @@ export declare const DelegationCreationRequestSchema: z.ZodObject<{
|
|
|
3017
2901
|
} & {
|
|
3018
2902
|
[k: string]: unknown;
|
|
3019
2903
|
};
|
|
2904
|
+
issuerDid: string;
|
|
2905
|
+
subjectDid: string;
|
|
3020
2906
|
controller?: string | undefined;
|
|
3021
2907
|
vcId?: string | undefined;
|
|
3022
2908
|
parentId?: string | undefined;
|
|
3023
2909
|
}>;
|
|
3024
2910
|
export type DelegationCreationRequest = z.infer<typeof DelegationCreationRequestSchema>;
|
|
3025
|
-
/**
|
|
3026
|
-
* Delegation Verification Result
|
|
3027
|
-
*
|
|
3028
|
-
* Result of delegation verification
|
|
3029
|
-
*/
|
|
3030
2911
|
export declare const DelegationVerificationResultSchema: z.ZodObject<{
|
|
3031
|
-
/** Whether delegation is valid */
|
|
3032
2912
|
valid: z.ZodBoolean;
|
|
3033
|
-
/** Delegation ID */
|
|
3034
2913
|
delegationId: z.ZodString;
|
|
3035
|
-
/** Status */
|
|
3036
2914
|
status: z.ZodEnum<["active", "revoked", "expired"]>;
|
|
3037
|
-
/** Optional reason for invalid status */
|
|
3038
2915
|
reason: z.ZodOptional<z.ZodString>;
|
|
3039
|
-
/** Whether backing VC is valid */
|
|
3040
2916
|
credentialValid: z.ZodOptional<z.ZodBoolean>;
|
|
3041
|
-
/** Whether chain is valid (if part of chain) */
|
|
3042
2917
|
chainValid: z.ZodOptional<z.ZodBoolean>;
|
|
3043
|
-
/** Timestamp of verification */
|
|
3044
2918
|
verifiedAt: z.ZodNumber;
|
|
3045
|
-
/** Optional verification details */
|
|
3046
2919
|
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
3047
2920
|
}, "strip", z.ZodTypeAny, {
|
|
3048
2921
|
valid: boolean;
|
|
3049
2922
|
status: "active" | "revoked" | "expired";
|
|
3050
|
-
delegationId: string;
|
|
3051
2923
|
verifiedAt: number;
|
|
2924
|
+
delegationId: string;
|
|
2925
|
+
details?: Record<string, any> | undefined;
|
|
3052
2926
|
reason?: string | undefined;
|
|
3053
2927
|
credentialValid?: boolean | undefined;
|
|
3054
2928
|
chainValid?: boolean | undefined;
|
|
3055
|
-
details?: Record<string, any> | undefined;
|
|
3056
2929
|
}, {
|
|
3057
2930
|
valid: boolean;
|
|
3058
2931
|
status: "active" | "revoked" | "expired";
|
|
3059
|
-
delegationId: string;
|
|
3060
2932
|
verifiedAt: number;
|
|
2933
|
+
delegationId: string;
|
|
2934
|
+
details?: Record<string, any> | undefined;
|
|
3061
2935
|
reason?: string | undefined;
|
|
3062
2936
|
credentialValid?: boolean | undefined;
|
|
3063
2937
|
chainValid?: boolean | undefined;
|
|
3064
|
-
details?: Record<string, any> | undefined;
|
|
3065
2938
|
}>;
|
|
3066
2939
|
export type DelegationVerificationResult = z.infer<typeof DelegationVerificationResultSchema>;
|
|
3067
|
-
/**
|
|
3068
|
-
* Validation Helpers
|
|
3069
|
-
*/
|
|
3070
|
-
/**
|
|
3071
|
-
* Validate a delegation record
|
|
3072
|
-
*
|
|
3073
|
-
* @param record - The delegation record to validate
|
|
3074
|
-
* @returns Validation result
|
|
3075
|
-
*/
|
|
3076
2940
|
export declare function validateDelegationRecord(record: unknown): z.SafeParseReturnType<z.objectInputType<{
|
|
3077
|
-
/** Unique identifier for the delegation */
|
|
3078
2941
|
id: z.ZodString;
|
|
3079
|
-
/** DID of the delegator (issuer, e.g., merchant/user) */
|
|
3080
2942
|
issuerDid: z.ZodString;
|
|
3081
|
-
/** DID of the delegatee (subject, e.g., agent) */
|
|
3082
2943
|
subjectDid: z.ZodString;
|
|
3083
|
-
/** Optional controller (user account ID or DID) */
|
|
3084
2944
|
controller: z.ZodOptional<z.ZodString>;
|
|
3085
|
-
/** ID of the backing Verifiable Credential */
|
|
3086
2945
|
vcId: z.ZodString;
|
|
3087
|
-
/** Optional parent delegation ID for chain tracking */
|
|
3088
2946
|
parentId: z.ZodOptional<z.ZodString>;
|
|
3089
|
-
/** CRISP constraints on this delegation */
|
|
3090
2947
|
constraints: z.ZodObject<{
|
|
3091
2948
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
3092
2949
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -3481,32 +3338,19 @@ export declare function validateDelegationRecord(record: unknown): z.SafeParseRe
|
|
|
3481
3338
|
}>, "many">;
|
|
3482
3339
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
3483
3340
|
}, z.ZodTypeAny, "passthrough">>;
|
|
3484
|
-
/** Detached JWS signature over canonical delegation document */
|
|
3485
3341
|
signature: z.ZodString;
|
|
3486
|
-
/** Current status of the delegation */
|
|
3487
3342
|
status: z.ZodEnum<["active", "revoked", "expired"]>;
|
|
3488
|
-
/** Timestamp when created (milliseconds since epoch) */
|
|
3489
3343
|
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
3490
|
-
/** Timestamp when revoked (if status is revoked) */
|
|
3491
3344
|
revokedAt: z.ZodOptional<z.ZodNumber>;
|
|
3492
|
-
/** Optional reason for revocation */
|
|
3493
3345
|
revokedReason: z.ZodOptional<z.ZodString>;
|
|
3494
|
-
/** Optional metadata */
|
|
3495
3346
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
3496
3347
|
}, z.ZodTypeAny, "passthrough">, z.objectOutputType<{
|
|
3497
|
-
/** Unique identifier for the delegation */
|
|
3498
3348
|
id: z.ZodString;
|
|
3499
|
-
/** DID of the delegator (issuer, e.g., merchant/user) */
|
|
3500
3349
|
issuerDid: z.ZodString;
|
|
3501
|
-
/** DID of the delegatee (subject, e.g., agent) */
|
|
3502
3350
|
subjectDid: z.ZodString;
|
|
3503
|
-
/** Optional controller (user account ID or DID) */
|
|
3504
3351
|
controller: z.ZodOptional<z.ZodString>;
|
|
3505
|
-
/** ID of the backing Verifiable Credential */
|
|
3506
3352
|
vcId: z.ZodString;
|
|
3507
|
-
/** Optional parent delegation ID for chain tracking */
|
|
3508
3353
|
parentId: z.ZodOptional<z.ZodString>;
|
|
3509
|
-
/** CRISP constraints on this delegation */
|
|
3510
3354
|
constraints: z.ZodObject<{
|
|
3511
3355
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
3512
3356
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -3901,25 +3745,13 @@ export declare function validateDelegationRecord(record: unknown): z.SafeParseRe
|
|
|
3901
3745
|
}>, "many">;
|
|
3902
3746
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
3903
3747
|
}, z.ZodTypeAny, "passthrough">>;
|
|
3904
|
-
/** Detached JWS signature over canonical delegation document */
|
|
3905
3748
|
signature: z.ZodString;
|
|
3906
|
-
/** Current status of the delegation */
|
|
3907
3749
|
status: z.ZodEnum<["active", "revoked", "expired"]>;
|
|
3908
|
-
/** Timestamp when created (milliseconds since epoch) */
|
|
3909
3750
|
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
3910
|
-
/** Timestamp when revoked (if status is revoked) */
|
|
3911
3751
|
revokedAt: z.ZodOptional<z.ZodNumber>;
|
|
3912
|
-
/** Optional reason for revocation */
|
|
3913
3752
|
revokedReason: z.ZodOptional<z.ZodString>;
|
|
3914
|
-
/** Optional metadata */
|
|
3915
3753
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
3916
3754
|
}, z.ZodTypeAny, "passthrough">>;
|
|
3917
|
-
/**
|
|
3918
|
-
* Validate a delegation chain
|
|
3919
|
-
*
|
|
3920
|
-
* @param chain - The delegation chain to validate
|
|
3921
|
-
* @returns Validation result
|
|
3922
|
-
*/
|
|
3923
3755
|
export declare function validateDelegationChain(chain: unknown): z.SafeParseReturnType<{
|
|
3924
3756
|
valid: boolean;
|
|
3925
3757
|
depth: number;
|
|
@@ -3927,13 +3759,10 @@ export declare function validateDelegationChain(chain: unknown): z.SafeParseRetu
|
|
|
3927
3759
|
leafSubject: string;
|
|
3928
3760
|
chain: {
|
|
3929
3761
|
status: "active" | "revoked" | "expired";
|
|
3930
|
-
issuerDid: string;
|
|
3931
|
-
subjectDid: string;
|
|
3932
|
-
vcId: string;
|
|
3933
3762
|
constraints: {
|
|
3763
|
+
scopes?: string[] | undefined;
|
|
3934
3764
|
notBefore?: number | undefined;
|
|
3935
3765
|
notAfter?: number | undefined;
|
|
3936
|
-
scopes?: string[] | undefined;
|
|
3937
3766
|
crisp?: z.objectInputType<{
|
|
3938
3767
|
budget: z.ZodOptional<z.ZodObject<{
|
|
3939
3768
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -3980,6 +3809,9 @@ export declare function validateDelegationChain(chain: unknown): z.SafeParseRetu
|
|
|
3980
3809
|
} & {
|
|
3981
3810
|
[k: string]: unknown;
|
|
3982
3811
|
};
|
|
3812
|
+
issuerDid: string;
|
|
3813
|
+
subjectDid: string;
|
|
3814
|
+
vcId: string;
|
|
3983
3815
|
delegationId: string;
|
|
3984
3816
|
depth: number;
|
|
3985
3817
|
}[];
|
|
@@ -3991,13 +3823,10 @@ export declare function validateDelegationChain(chain: unknown): z.SafeParseRetu
|
|
|
3991
3823
|
leafSubject: string;
|
|
3992
3824
|
chain: {
|
|
3993
3825
|
status: "active" | "revoked" | "expired";
|
|
3994
|
-
issuerDid: string;
|
|
3995
|
-
subjectDid: string;
|
|
3996
|
-
vcId: string;
|
|
3997
3826
|
constraints: {
|
|
3827
|
+
scopes?: string[] | undefined;
|
|
3998
3828
|
notBefore?: number | undefined;
|
|
3999
3829
|
notAfter?: number | undefined;
|
|
4000
|
-
scopes?: string[] | undefined;
|
|
4001
3830
|
crisp?: z.objectOutputType<{
|
|
4002
3831
|
budget: z.ZodOptional<z.ZodObject<{
|
|
4003
3832
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -4044,79 +3873,29 @@ export declare function validateDelegationChain(chain: unknown): z.SafeParseRetu
|
|
|
4044
3873
|
} & {
|
|
4045
3874
|
[k: string]: unknown;
|
|
4046
3875
|
};
|
|
3876
|
+
issuerDid: string;
|
|
3877
|
+
subjectDid: string;
|
|
3878
|
+
vcId: string;
|
|
4047
3879
|
delegationId: string;
|
|
4048
3880
|
depth: number;
|
|
4049
3881
|
}[];
|
|
4050
3882
|
errors?: string[] | undefined;
|
|
4051
3883
|
}>;
|
|
4052
|
-
/**
|
|
4053
|
-
* Check if a delegation is expired based on constraints
|
|
4054
|
-
*
|
|
4055
|
-
* @param delegation - The delegation to check
|
|
4056
|
-
* @returns true if expired
|
|
4057
|
-
*/
|
|
4058
3884
|
export declare function isDelegationExpired(delegation: DelegationRecord): boolean;
|
|
4059
|
-
/**
|
|
4060
|
-
* Check if a delegation is not yet valid based on constraints
|
|
4061
|
-
*
|
|
4062
|
-
* @param delegation - The delegation to check
|
|
4063
|
-
* @returns true if not yet valid
|
|
4064
|
-
*/
|
|
4065
3885
|
export declare function isDelegationNotYetValid(delegation: DelegationRecord): boolean;
|
|
4066
|
-
/**
|
|
4067
|
-
* Check if a delegation is currently valid (active and within time bounds)
|
|
4068
|
-
*
|
|
4069
|
-
* @param delegation - The delegation to check
|
|
4070
|
-
* @returns true if currently valid
|
|
4071
|
-
*/
|
|
4072
3886
|
export declare function isDelegationCurrentlyValid(delegation: DelegationRecord): boolean;
|
|
4073
|
-
/**
|
|
4074
|
-
* Constants
|
|
4075
|
-
*/
|
|
4076
|
-
/**
|
|
4077
|
-
* Maximum reasonable delegation chain depth
|
|
4078
|
-
*/
|
|
4079
3887
|
export declare const MAX_DELEGATION_CHAIN_DEPTH = 10;
|
|
4080
|
-
/**
|
|
4081
|
-
* Default delegation status for new delegations
|
|
4082
|
-
*/
|
|
4083
3888
|
export declare const DEFAULT_DELEGATION_STATUS: DelegationStatus;
|
|
4084
|
-
/**
|
|
4085
|
-
* Supported delegation statuses
|
|
4086
|
-
*/
|
|
4087
3889
|
export declare const DELEGATION_STATUSES: DelegationStatus[];
|
|
4088
|
-
/**
|
|
4089
|
-
* Delegation Credential Context
|
|
4090
|
-
*
|
|
4091
|
-
* Additional JSON-LD context for delegation credentials
|
|
4092
|
-
*/
|
|
4093
3890
|
export declare const DELEGATION_CREDENTIAL_CONTEXT: "https://schemas.kya-os.ai/xmcp-i/credentials/delegation.v1.0.0.json";
|
|
4094
|
-
/**
|
|
4095
|
-
* Delegation Credential Subject Schema
|
|
4096
|
-
*
|
|
4097
|
-
* The credentialSubject of a DelegationCredential contains:
|
|
4098
|
-
* - id: The delegatee DID (subject of the delegation)
|
|
4099
|
-
* - delegation: The complete delegation record
|
|
4100
|
-
*
|
|
4101
|
-
* Per Python POC (Delegation-Service.md:136-146), delegations are issued AS
|
|
4102
|
-
* W3C VCs, with the delegation data embedded in the credentialSubject.
|
|
4103
|
-
*/
|
|
4104
3891
|
export declare const DelegationCredentialSubjectSchema: z.ZodObject<{
|
|
4105
|
-
/** Subject DID (delegatee) */
|
|
4106
3892
|
id: z.ZodString;
|
|
4107
|
-
/** The delegation information */
|
|
4108
3893
|
delegation: z.ZodObject<{
|
|
4109
|
-
/** Unique identifier for the delegation */
|
|
4110
3894
|
id: z.ZodString;
|
|
4111
|
-
/** DID of the delegator (issuer, e.g., merchant/user) */
|
|
4112
3895
|
issuerDid: z.ZodString;
|
|
4113
|
-
/** DID of the delegatee (subject, e.g., agent) */
|
|
4114
3896
|
subjectDid: z.ZodString;
|
|
4115
|
-
/** Optional controller (user account ID or DID) */
|
|
4116
3897
|
controller: z.ZodOptional<z.ZodString>;
|
|
4117
|
-
/** Optional parent delegation ID for chain tracking */
|
|
4118
3898
|
parentId: z.ZodOptional<z.ZodString>;
|
|
4119
|
-
/** CRISP constraints on this delegation */
|
|
4120
3899
|
constraints: z.ZodObject<{
|
|
4121
3900
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
4122
3901
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -4511,21 +4290,16 @@ export declare const DelegationCredentialSubjectSchema: z.ZodObject<{
|
|
|
4511
4290
|
}>, "many">;
|
|
4512
4291
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
4513
4292
|
}, z.ZodTypeAny, "passthrough">>;
|
|
4514
|
-
/** Current status of the delegation */
|
|
4515
4293
|
status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
|
|
4516
|
-
/** Timestamp when created (milliseconds since epoch) */
|
|
4517
4294
|
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
4518
|
-
/** Optional metadata */
|
|
4519
4295
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
4520
4296
|
}, "strip", z.ZodTypeAny, {
|
|
4521
4297
|
status: "active" | "revoked" | "expired";
|
|
4522
4298
|
id: string;
|
|
4523
|
-
issuerDid: string;
|
|
4524
|
-
subjectDid: string;
|
|
4525
4299
|
constraints: {
|
|
4300
|
+
scopes?: string[] | undefined;
|
|
4526
4301
|
notBefore?: number | undefined;
|
|
4527
4302
|
notAfter?: number | undefined;
|
|
4528
|
-
scopes?: string[] | undefined;
|
|
4529
4303
|
crisp?: z.objectOutputType<{
|
|
4530
4304
|
budget: z.ZodOptional<z.ZodObject<{
|
|
4531
4305
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -4572,18 +4346,18 @@ export declare const DelegationCredentialSubjectSchema: z.ZodObject<{
|
|
|
4572
4346
|
} & {
|
|
4573
4347
|
[k: string]: unknown;
|
|
4574
4348
|
};
|
|
4575
|
-
|
|
4576
|
-
|
|
4349
|
+
issuerDid: string;
|
|
4350
|
+
subjectDid: string;
|
|
4577
4351
|
createdAt?: number | undefined;
|
|
4578
4352
|
metadata?: Record<string, any> | undefined;
|
|
4353
|
+
controller?: string | undefined;
|
|
4354
|
+
parentId?: string | undefined;
|
|
4579
4355
|
}, {
|
|
4580
4356
|
id: string;
|
|
4581
|
-
issuerDid: string;
|
|
4582
|
-
subjectDid: string;
|
|
4583
4357
|
constraints: {
|
|
4358
|
+
scopes?: string[] | undefined;
|
|
4584
4359
|
notBefore?: number | undefined;
|
|
4585
4360
|
notAfter?: number | undefined;
|
|
4586
|
-
scopes?: string[] | undefined;
|
|
4587
4361
|
crisp?: z.objectInputType<{
|
|
4588
4362
|
budget: z.ZodOptional<z.ZodObject<{
|
|
4589
4363
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -4630,23 +4404,22 @@ export declare const DelegationCredentialSubjectSchema: z.ZodObject<{
|
|
|
4630
4404
|
} & {
|
|
4631
4405
|
[k: string]: unknown;
|
|
4632
4406
|
};
|
|
4407
|
+
issuerDid: string;
|
|
4408
|
+
subjectDid: string;
|
|
4633
4409
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
4634
|
-
controller?: string | undefined;
|
|
4635
|
-
parentId?: string | undefined;
|
|
4636
4410
|
createdAt?: number | undefined;
|
|
4637
4411
|
metadata?: Record<string, any> | undefined;
|
|
4412
|
+
controller?: string | undefined;
|
|
4413
|
+
parentId?: string | undefined;
|
|
4638
4414
|
}>;
|
|
4639
4415
|
}, "strip", z.ZodTypeAny, {
|
|
4640
|
-
id: string;
|
|
4641
4416
|
delegation: {
|
|
4642
4417
|
status: "active" | "revoked" | "expired";
|
|
4643
4418
|
id: string;
|
|
4644
|
-
issuerDid: string;
|
|
4645
|
-
subjectDid: string;
|
|
4646
4419
|
constraints: {
|
|
4420
|
+
scopes?: string[] | undefined;
|
|
4647
4421
|
notBefore?: number | undefined;
|
|
4648
4422
|
notAfter?: number | undefined;
|
|
4649
|
-
scopes?: string[] | undefined;
|
|
4650
4423
|
crisp?: z.objectOutputType<{
|
|
4651
4424
|
budget: z.ZodOptional<z.ZodObject<{
|
|
4652
4425
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -4693,21 +4466,21 @@ export declare const DelegationCredentialSubjectSchema: z.ZodObject<{
|
|
|
4693
4466
|
} & {
|
|
4694
4467
|
[k: string]: unknown;
|
|
4695
4468
|
};
|
|
4696
|
-
|
|
4697
|
-
|
|
4469
|
+
issuerDid: string;
|
|
4470
|
+
subjectDid: string;
|
|
4698
4471
|
createdAt?: number | undefined;
|
|
4699
4472
|
metadata?: Record<string, any> | undefined;
|
|
4473
|
+
controller?: string | undefined;
|
|
4474
|
+
parentId?: string | undefined;
|
|
4700
4475
|
};
|
|
4701
|
-
}, {
|
|
4702
4476
|
id: string;
|
|
4477
|
+
}, {
|
|
4703
4478
|
delegation: {
|
|
4704
4479
|
id: string;
|
|
4705
|
-
issuerDid: string;
|
|
4706
|
-
subjectDid: string;
|
|
4707
4480
|
constraints: {
|
|
4481
|
+
scopes?: string[] | undefined;
|
|
4708
4482
|
notBefore?: number | undefined;
|
|
4709
4483
|
notAfter?: number | undefined;
|
|
4710
|
-
scopes?: string[] | undefined;
|
|
4711
4484
|
crisp?: z.objectInputType<{
|
|
4712
4485
|
budget: z.ZodOptional<z.ZodObject<{
|
|
4713
4486
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -4754,37 +4527,17 @@ export declare const DelegationCredentialSubjectSchema: z.ZodObject<{
|
|
|
4754
4527
|
} & {
|
|
4755
4528
|
[k: string]: unknown;
|
|
4756
4529
|
};
|
|
4530
|
+
issuerDid: string;
|
|
4531
|
+
subjectDid: string;
|
|
4757
4532
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
4758
|
-
controller?: string | undefined;
|
|
4759
|
-
parentId?: string | undefined;
|
|
4760
4533
|
createdAt?: number | undefined;
|
|
4761
4534
|
metadata?: Record<string, any> | undefined;
|
|
4535
|
+
controller?: string | undefined;
|
|
4536
|
+
parentId?: string | undefined;
|
|
4762
4537
|
};
|
|
4538
|
+
id: string;
|
|
4763
4539
|
}>;
|
|
4764
4540
|
export type DelegationCredentialSubject = z.infer<typeof DelegationCredentialSubjectSchema>;
|
|
4765
|
-
/**
|
|
4766
|
-
* Delegation Credential Schema
|
|
4767
|
-
*
|
|
4768
|
-
* W3C Verifiable Credential for delegations.
|
|
4769
|
-
* This is the PRIMARY format for delegation issuance and verification.
|
|
4770
|
-
*
|
|
4771
|
-
* Structure:
|
|
4772
|
-
* - @context: [...W3C VC contexts, delegation context]
|
|
4773
|
-
* - type: ['VerifiableCredential', 'DelegationCredential']
|
|
4774
|
-
* - issuer: Delegator DID
|
|
4775
|
-
* - issuanceDate: When delegation was created
|
|
4776
|
-
* - expirationDate: Maps to delegation.constraints.notAfter
|
|
4777
|
-
* - credentialSubject: Contains delegatee DID + delegation data
|
|
4778
|
-
* - credentialStatus: StatusList2021Entry for revocation checking
|
|
4779
|
-
* - proof: Ed25519Signature2020
|
|
4780
|
-
*
|
|
4781
|
-
* Per Python POC design (Delegation-Service.md:136-163):
|
|
4782
|
-
* - Every delegation MUST be issued as a VC
|
|
4783
|
-
* - Verification checks BOTH the VC signature AND delegation constraints
|
|
4784
|
-
* - Revocation updates the StatusList2021
|
|
4785
|
-
*
|
|
4786
|
-
* Related Spec: MCP-I §4.1, §4.2, W3C VC Data Model 1.1
|
|
4787
|
-
*/
|
|
4788
4541
|
export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
4789
4542
|
id: z.ZodOptional<z.ZodString>;
|
|
4790
4543
|
} & {
|
|
@@ -4800,21 +4553,13 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
4800
4553
|
issuanceDate: z.ZodString;
|
|
4801
4554
|
expirationDate: z.ZodOptional<z.ZodString>;
|
|
4802
4555
|
credentialSubject: z.ZodObject<{
|
|
4803
|
-
/** Subject DID (delegatee) */
|
|
4804
4556
|
id: z.ZodString;
|
|
4805
|
-
/** The delegation information */
|
|
4806
4557
|
delegation: z.ZodObject<{
|
|
4807
|
-
/** Unique identifier for the delegation */
|
|
4808
4558
|
id: z.ZodString;
|
|
4809
|
-
/** DID of the delegator (issuer, e.g., merchant/user) */
|
|
4810
4559
|
issuerDid: z.ZodString;
|
|
4811
|
-
/** DID of the delegatee (subject, e.g., agent) */
|
|
4812
4560
|
subjectDid: z.ZodString;
|
|
4813
|
-
/** Optional controller (user account ID or DID) */
|
|
4814
4561
|
controller: z.ZodOptional<z.ZodString>;
|
|
4815
|
-
/** Optional parent delegation ID for chain tracking */
|
|
4816
4562
|
parentId: z.ZodOptional<z.ZodString>;
|
|
4817
|
-
/** CRISP constraints on this delegation */
|
|
4818
4563
|
constraints: z.ZodObject<{
|
|
4819
4564
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
4820
4565
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -5209,21 +4954,16 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
5209
4954
|
}>, "many">;
|
|
5210
4955
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
5211
4956
|
}, z.ZodTypeAny, "passthrough">>;
|
|
5212
|
-
/** Current status of the delegation */
|
|
5213
4957
|
status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
|
|
5214
|
-
/** Timestamp when created (milliseconds since epoch) */
|
|
5215
4958
|
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
5216
|
-
/** Optional metadata */
|
|
5217
4959
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
5218
4960
|
}, "strip", z.ZodTypeAny, {
|
|
5219
4961
|
status: "active" | "revoked" | "expired";
|
|
5220
4962
|
id: string;
|
|
5221
|
-
issuerDid: string;
|
|
5222
|
-
subjectDid: string;
|
|
5223
4963
|
constraints: {
|
|
4964
|
+
scopes?: string[] | undefined;
|
|
5224
4965
|
notBefore?: number | undefined;
|
|
5225
4966
|
notAfter?: number | undefined;
|
|
5226
|
-
scopes?: string[] | undefined;
|
|
5227
4967
|
crisp?: z.objectOutputType<{
|
|
5228
4968
|
budget: z.ZodOptional<z.ZodObject<{
|
|
5229
4969
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -5270,18 +5010,18 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
5270
5010
|
} & {
|
|
5271
5011
|
[k: string]: unknown;
|
|
5272
5012
|
};
|
|
5273
|
-
|
|
5274
|
-
|
|
5013
|
+
issuerDid: string;
|
|
5014
|
+
subjectDid: string;
|
|
5275
5015
|
createdAt?: number | undefined;
|
|
5276
5016
|
metadata?: Record<string, any> | undefined;
|
|
5017
|
+
controller?: string | undefined;
|
|
5018
|
+
parentId?: string | undefined;
|
|
5277
5019
|
}, {
|
|
5278
5020
|
id: string;
|
|
5279
|
-
issuerDid: string;
|
|
5280
|
-
subjectDid: string;
|
|
5281
5021
|
constraints: {
|
|
5022
|
+
scopes?: string[] | undefined;
|
|
5282
5023
|
notBefore?: number | undefined;
|
|
5283
5024
|
notAfter?: number | undefined;
|
|
5284
|
-
scopes?: string[] | undefined;
|
|
5285
5025
|
crisp?: z.objectInputType<{
|
|
5286
5026
|
budget: z.ZodOptional<z.ZodObject<{
|
|
5287
5027
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -5328,23 +5068,22 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
5328
5068
|
} & {
|
|
5329
5069
|
[k: string]: unknown;
|
|
5330
5070
|
};
|
|
5071
|
+
issuerDid: string;
|
|
5072
|
+
subjectDid: string;
|
|
5331
5073
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
5332
|
-
controller?: string | undefined;
|
|
5333
|
-
parentId?: string | undefined;
|
|
5334
5074
|
createdAt?: number | undefined;
|
|
5335
5075
|
metadata?: Record<string, any> | undefined;
|
|
5076
|
+
controller?: string | undefined;
|
|
5077
|
+
parentId?: string | undefined;
|
|
5336
5078
|
}>;
|
|
5337
5079
|
}, "strip", z.ZodTypeAny, {
|
|
5338
|
-
id: string;
|
|
5339
5080
|
delegation: {
|
|
5340
5081
|
status: "active" | "revoked" | "expired";
|
|
5341
5082
|
id: string;
|
|
5342
|
-
issuerDid: string;
|
|
5343
|
-
subjectDid: string;
|
|
5344
5083
|
constraints: {
|
|
5084
|
+
scopes?: string[] | undefined;
|
|
5345
5085
|
notBefore?: number | undefined;
|
|
5346
5086
|
notAfter?: number | undefined;
|
|
5347
|
-
scopes?: string[] | undefined;
|
|
5348
5087
|
crisp?: z.objectOutputType<{
|
|
5349
5088
|
budget: z.ZodOptional<z.ZodObject<{
|
|
5350
5089
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -5391,21 +5130,21 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
5391
5130
|
} & {
|
|
5392
5131
|
[k: string]: unknown;
|
|
5393
5132
|
};
|
|
5394
|
-
|
|
5395
|
-
|
|
5133
|
+
issuerDid: string;
|
|
5134
|
+
subjectDid: string;
|
|
5396
5135
|
createdAt?: number | undefined;
|
|
5397
5136
|
metadata?: Record<string, any> | undefined;
|
|
5137
|
+
controller?: string | undefined;
|
|
5138
|
+
parentId?: string | undefined;
|
|
5398
5139
|
};
|
|
5399
|
-
}, {
|
|
5400
5140
|
id: string;
|
|
5141
|
+
}, {
|
|
5401
5142
|
delegation: {
|
|
5402
5143
|
id: string;
|
|
5403
|
-
issuerDid: string;
|
|
5404
|
-
subjectDid: string;
|
|
5405
5144
|
constraints: {
|
|
5145
|
+
scopes?: string[] | undefined;
|
|
5406
5146
|
notBefore?: number | undefined;
|
|
5407
5147
|
notAfter?: number | undefined;
|
|
5408
|
-
scopes?: string[] | undefined;
|
|
5409
5148
|
crisp?: z.objectInputType<{
|
|
5410
5149
|
budget: z.ZodOptional<z.ZodObject<{
|
|
5411
5150
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -5452,12 +5191,15 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
5452
5191
|
} & {
|
|
5453
5192
|
[k: string]: unknown;
|
|
5454
5193
|
};
|
|
5194
|
+
issuerDid: string;
|
|
5195
|
+
subjectDid: string;
|
|
5455
5196
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
5456
|
-
controller?: string | undefined;
|
|
5457
|
-
parentId?: string | undefined;
|
|
5458
5197
|
createdAt?: number | undefined;
|
|
5459
5198
|
metadata?: Record<string, any> | undefined;
|
|
5199
|
+
controller?: string | undefined;
|
|
5200
|
+
parentId?: string | undefined;
|
|
5460
5201
|
};
|
|
5202
|
+
id: string;
|
|
5461
5203
|
}>;
|
|
5462
5204
|
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
5463
5205
|
id: z.ZodString;
|
|
@@ -5509,21 +5251,13 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
5509
5251
|
issuanceDate: z.ZodString;
|
|
5510
5252
|
expirationDate: z.ZodOptional<z.ZodString>;
|
|
5511
5253
|
credentialSubject: z.ZodObject<{
|
|
5512
|
-
/** Subject DID (delegatee) */
|
|
5513
5254
|
id: z.ZodString;
|
|
5514
|
-
/** The delegation information */
|
|
5515
5255
|
delegation: z.ZodObject<{
|
|
5516
|
-
/** Unique identifier for the delegation */
|
|
5517
5256
|
id: z.ZodString;
|
|
5518
|
-
/** DID of the delegator (issuer, e.g., merchant/user) */
|
|
5519
5257
|
issuerDid: z.ZodString;
|
|
5520
|
-
/** DID of the delegatee (subject, e.g., agent) */
|
|
5521
5258
|
subjectDid: z.ZodString;
|
|
5522
|
-
/** Optional controller (user account ID or DID) */
|
|
5523
5259
|
controller: z.ZodOptional<z.ZodString>;
|
|
5524
|
-
/** Optional parent delegation ID for chain tracking */
|
|
5525
5260
|
parentId: z.ZodOptional<z.ZodString>;
|
|
5526
|
-
/** CRISP constraints on this delegation */
|
|
5527
5261
|
constraints: z.ZodObject<{
|
|
5528
5262
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
5529
5263
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -5918,21 +5652,16 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
5918
5652
|
}>, "many">;
|
|
5919
5653
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
5920
5654
|
}, z.ZodTypeAny, "passthrough">>;
|
|
5921
|
-
/** Current status of the delegation */
|
|
5922
5655
|
status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
|
|
5923
|
-
/** Timestamp when created (milliseconds since epoch) */
|
|
5924
5656
|
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
5925
|
-
/** Optional metadata */
|
|
5926
5657
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
5927
5658
|
}, "strip", z.ZodTypeAny, {
|
|
5928
5659
|
status: "active" | "revoked" | "expired";
|
|
5929
5660
|
id: string;
|
|
5930
|
-
issuerDid: string;
|
|
5931
|
-
subjectDid: string;
|
|
5932
5661
|
constraints: {
|
|
5662
|
+
scopes?: string[] | undefined;
|
|
5933
5663
|
notBefore?: number | undefined;
|
|
5934
5664
|
notAfter?: number | undefined;
|
|
5935
|
-
scopes?: string[] | undefined;
|
|
5936
5665
|
crisp?: z.objectOutputType<{
|
|
5937
5666
|
budget: z.ZodOptional<z.ZodObject<{
|
|
5938
5667
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -5979,18 +5708,18 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
5979
5708
|
} & {
|
|
5980
5709
|
[k: string]: unknown;
|
|
5981
5710
|
};
|
|
5982
|
-
|
|
5983
|
-
|
|
5711
|
+
issuerDid: string;
|
|
5712
|
+
subjectDid: string;
|
|
5984
5713
|
createdAt?: number | undefined;
|
|
5985
5714
|
metadata?: Record<string, any> | undefined;
|
|
5715
|
+
controller?: string | undefined;
|
|
5716
|
+
parentId?: string | undefined;
|
|
5986
5717
|
}, {
|
|
5987
5718
|
id: string;
|
|
5988
|
-
issuerDid: string;
|
|
5989
|
-
subjectDid: string;
|
|
5990
5719
|
constraints: {
|
|
5720
|
+
scopes?: string[] | undefined;
|
|
5991
5721
|
notBefore?: number | undefined;
|
|
5992
5722
|
notAfter?: number | undefined;
|
|
5993
|
-
scopes?: string[] | undefined;
|
|
5994
5723
|
crisp?: z.objectInputType<{
|
|
5995
5724
|
budget: z.ZodOptional<z.ZodObject<{
|
|
5996
5725
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -6037,23 +5766,22 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
6037
5766
|
} & {
|
|
6038
5767
|
[k: string]: unknown;
|
|
6039
5768
|
};
|
|
5769
|
+
issuerDid: string;
|
|
5770
|
+
subjectDid: string;
|
|
6040
5771
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
6041
|
-
controller?: string | undefined;
|
|
6042
|
-
parentId?: string | undefined;
|
|
6043
5772
|
createdAt?: number | undefined;
|
|
6044
5773
|
metadata?: Record<string, any> | undefined;
|
|
5774
|
+
controller?: string | undefined;
|
|
5775
|
+
parentId?: string | undefined;
|
|
6045
5776
|
}>;
|
|
6046
5777
|
}, "strip", z.ZodTypeAny, {
|
|
6047
|
-
id: string;
|
|
6048
5778
|
delegation: {
|
|
6049
5779
|
status: "active" | "revoked" | "expired";
|
|
6050
5780
|
id: string;
|
|
6051
|
-
issuerDid: string;
|
|
6052
|
-
subjectDid: string;
|
|
6053
5781
|
constraints: {
|
|
5782
|
+
scopes?: string[] | undefined;
|
|
6054
5783
|
notBefore?: number | undefined;
|
|
6055
5784
|
notAfter?: number | undefined;
|
|
6056
|
-
scopes?: string[] | undefined;
|
|
6057
5785
|
crisp?: z.objectOutputType<{
|
|
6058
5786
|
budget: z.ZodOptional<z.ZodObject<{
|
|
6059
5787
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -6100,21 +5828,21 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
6100
5828
|
} & {
|
|
6101
5829
|
[k: string]: unknown;
|
|
6102
5830
|
};
|
|
6103
|
-
|
|
6104
|
-
|
|
5831
|
+
issuerDid: string;
|
|
5832
|
+
subjectDid: string;
|
|
6105
5833
|
createdAt?: number | undefined;
|
|
6106
5834
|
metadata?: Record<string, any> | undefined;
|
|
5835
|
+
controller?: string | undefined;
|
|
5836
|
+
parentId?: string | undefined;
|
|
6107
5837
|
};
|
|
6108
|
-
}, {
|
|
6109
5838
|
id: string;
|
|
5839
|
+
}, {
|
|
6110
5840
|
delegation: {
|
|
6111
5841
|
id: string;
|
|
6112
|
-
issuerDid: string;
|
|
6113
|
-
subjectDid: string;
|
|
6114
5842
|
constraints: {
|
|
5843
|
+
scopes?: string[] | undefined;
|
|
6115
5844
|
notBefore?: number | undefined;
|
|
6116
5845
|
notAfter?: number | undefined;
|
|
6117
|
-
scopes?: string[] | undefined;
|
|
6118
5846
|
crisp?: z.objectInputType<{
|
|
6119
5847
|
budget: z.ZodOptional<z.ZodObject<{
|
|
6120
5848
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -6161,12 +5889,15 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
6161
5889
|
} & {
|
|
6162
5890
|
[k: string]: unknown;
|
|
6163
5891
|
};
|
|
5892
|
+
issuerDid: string;
|
|
5893
|
+
subjectDid: string;
|
|
6164
5894
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
6165
|
-
controller?: string | undefined;
|
|
6166
|
-
parentId?: string | undefined;
|
|
6167
5895
|
createdAt?: number | undefined;
|
|
6168
5896
|
metadata?: Record<string, any> | undefined;
|
|
5897
|
+
controller?: string | undefined;
|
|
5898
|
+
parentId?: string | undefined;
|
|
6169
5899
|
};
|
|
5900
|
+
id: string;
|
|
6170
5901
|
}>;
|
|
6171
5902
|
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
6172
5903
|
id: z.ZodString;
|
|
@@ -6218,21 +5949,13 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
6218
5949
|
issuanceDate: z.ZodString;
|
|
6219
5950
|
expirationDate: z.ZodOptional<z.ZodString>;
|
|
6220
5951
|
credentialSubject: z.ZodObject<{
|
|
6221
|
-
/** Subject DID (delegatee) */
|
|
6222
5952
|
id: z.ZodString;
|
|
6223
|
-
/** The delegation information */
|
|
6224
5953
|
delegation: z.ZodObject<{
|
|
6225
|
-
/** Unique identifier for the delegation */
|
|
6226
5954
|
id: z.ZodString;
|
|
6227
|
-
/** DID of the delegator (issuer, e.g., merchant/user) */
|
|
6228
5955
|
issuerDid: z.ZodString;
|
|
6229
|
-
/** DID of the delegatee (subject, e.g., agent) */
|
|
6230
5956
|
subjectDid: z.ZodString;
|
|
6231
|
-
/** Optional controller (user account ID or DID) */
|
|
6232
5957
|
controller: z.ZodOptional<z.ZodString>;
|
|
6233
|
-
/** Optional parent delegation ID for chain tracking */
|
|
6234
5958
|
parentId: z.ZodOptional<z.ZodString>;
|
|
6235
|
-
/** CRISP constraints on this delegation */
|
|
6236
5959
|
constraints: z.ZodObject<{
|
|
6237
5960
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
6238
5961
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -6627,21 +6350,16 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
6627
6350
|
}>, "many">;
|
|
6628
6351
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
6629
6352
|
}, z.ZodTypeAny, "passthrough">>;
|
|
6630
|
-
/** Current status of the delegation */
|
|
6631
6353
|
status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
|
|
6632
|
-
/** Timestamp when created (milliseconds since epoch) */
|
|
6633
6354
|
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
6634
|
-
/** Optional metadata */
|
|
6635
6355
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
6636
6356
|
}, "strip", z.ZodTypeAny, {
|
|
6637
6357
|
status: "active" | "revoked" | "expired";
|
|
6638
6358
|
id: string;
|
|
6639
|
-
issuerDid: string;
|
|
6640
|
-
subjectDid: string;
|
|
6641
6359
|
constraints: {
|
|
6360
|
+
scopes?: string[] | undefined;
|
|
6642
6361
|
notBefore?: number | undefined;
|
|
6643
6362
|
notAfter?: number | undefined;
|
|
6644
|
-
scopes?: string[] | undefined;
|
|
6645
6363
|
crisp?: z.objectOutputType<{
|
|
6646
6364
|
budget: z.ZodOptional<z.ZodObject<{
|
|
6647
6365
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -6688,18 +6406,18 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
6688
6406
|
} & {
|
|
6689
6407
|
[k: string]: unknown;
|
|
6690
6408
|
};
|
|
6691
|
-
|
|
6692
|
-
|
|
6409
|
+
issuerDid: string;
|
|
6410
|
+
subjectDid: string;
|
|
6693
6411
|
createdAt?: number | undefined;
|
|
6694
6412
|
metadata?: Record<string, any> | undefined;
|
|
6413
|
+
controller?: string | undefined;
|
|
6414
|
+
parentId?: string | undefined;
|
|
6695
6415
|
}, {
|
|
6696
6416
|
id: string;
|
|
6697
|
-
issuerDid: string;
|
|
6698
|
-
subjectDid: string;
|
|
6699
6417
|
constraints: {
|
|
6418
|
+
scopes?: string[] | undefined;
|
|
6700
6419
|
notBefore?: number | undefined;
|
|
6701
6420
|
notAfter?: number | undefined;
|
|
6702
|
-
scopes?: string[] | undefined;
|
|
6703
6421
|
crisp?: z.objectInputType<{
|
|
6704
6422
|
budget: z.ZodOptional<z.ZodObject<{
|
|
6705
6423
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -6746,23 +6464,22 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
6746
6464
|
} & {
|
|
6747
6465
|
[k: string]: unknown;
|
|
6748
6466
|
};
|
|
6467
|
+
issuerDid: string;
|
|
6468
|
+
subjectDid: string;
|
|
6749
6469
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
6750
|
-
controller?: string | undefined;
|
|
6751
|
-
parentId?: string | undefined;
|
|
6752
6470
|
createdAt?: number | undefined;
|
|
6753
6471
|
metadata?: Record<string, any> | undefined;
|
|
6472
|
+
controller?: string | undefined;
|
|
6473
|
+
parentId?: string | undefined;
|
|
6754
6474
|
}>;
|
|
6755
6475
|
}, "strip", z.ZodTypeAny, {
|
|
6756
|
-
id: string;
|
|
6757
6476
|
delegation: {
|
|
6758
6477
|
status: "active" | "revoked" | "expired";
|
|
6759
6478
|
id: string;
|
|
6760
|
-
issuerDid: string;
|
|
6761
|
-
subjectDid: string;
|
|
6762
6479
|
constraints: {
|
|
6480
|
+
scopes?: string[] | undefined;
|
|
6763
6481
|
notBefore?: number | undefined;
|
|
6764
6482
|
notAfter?: number | undefined;
|
|
6765
|
-
scopes?: string[] | undefined;
|
|
6766
6483
|
crisp?: z.objectOutputType<{
|
|
6767
6484
|
budget: z.ZodOptional<z.ZodObject<{
|
|
6768
6485
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -6809,21 +6526,21 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
6809
6526
|
} & {
|
|
6810
6527
|
[k: string]: unknown;
|
|
6811
6528
|
};
|
|
6812
|
-
|
|
6813
|
-
|
|
6529
|
+
issuerDid: string;
|
|
6530
|
+
subjectDid: string;
|
|
6814
6531
|
createdAt?: number | undefined;
|
|
6815
6532
|
metadata?: Record<string, any> | undefined;
|
|
6533
|
+
controller?: string | undefined;
|
|
6534
|
+
parentId?: string | undefined;
|
|
6816
6535
|
};
|
|
6817
|
-
}, {
|
|
6818
6536
|
id: string;
|
|
6537
|
+
}, {
|
|
6819
6538
|
delegation: {
|
|
6820
6539
|
id: string;
|
|
6821
|
-
issuerDid: string;
|
|
6822
|
-
subjectDid: string;
|
|
6823
6540
|
constraints: {
|
|
6541
|
+
scopes?: string[] | undefined;
|
|
6824
6542
|
notBefore?: number | undefined;
|
|
6825
6543
|
notAfter?: number | undefined;
|
|
6826
|
-
scopes?: string[] | undefined;
|
|
6827
6544
|
crisp?: z.objectInputType<{
|
|
6828
6545
|
budget: z.ZodOptional<z.ZodObject<{
|
|
6829
6546
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -6870,12 +6587,15 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
6870
6587
|
} & {
|
|
6871
6588
|
[k: string]: unknown;
|
|
6872
6589
|
};
|
|
6590
|
+
issuerDid: string;
|
|
6591
|
+
subjectDid: string;
|
|
6873
6592
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
6874
|
-
controller?: string | undefined;
|
|
6875
|
-
parentId?: string | undefined;
|
|
6876
6593
|
createdAt?: number | undefined;
|
|
6877
6594
|
metadata?: Record<string, any> | undefined;
|
|
6595
|
+
controller?: string | undefined;
|
|
6596
|
+
parentId?: string | undefined;
|
|
6878
6597
|
};
|
|
6598
|
+
id: string;
|
|
6879
6599
|
}>;
|
|
6880
6600
|
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
6881
6601
|
id: z.ZodString;
|
|
@@ -6914,12 +6634,6 @@ export declare const DelegationCredentialSchema: z.ZodObject<{
|
|
|
6914
6634
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
6915
6635
|
}, z.ZodTypeAny, "passthrough">>;
|
|
6916
6636
|
export type DelegationCredential = z.infer<typeof DelegationCredentialSchema>;
|
|
6917
|
-
/**
|
|
6918
|
-
* Validate a delegation credential
|
|
6919
|
-
*
|
|
6920
|
-
* @param credential - The delegation credential to validate
|
|
6921
|
-
* @returns Validation result
|
|
6922
|
-
*/
|
|
6923
6637
|
export declare function validateDelegationCredential(credential: unknown): z.SafeParseReturnType<z.objectInputType<{
|
|
6924
6638
|
id: z.ZodOptional<z.ZodString>;
|
|
6925
6639
|
} & {
|
|
@@ -6935,21 +6649,13 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
6935
6649
|
issuanceDate: z.ZodString;
|
|
6936
6650
|
expirationDate: z.ZodOptional<z.ZodString>;
|
|
6937
6651
|
credentialSubject: z.ZodObject<{
|
|
6938
|
-
/** Subject DID (delegatee) */
|
|
6939
6652
|
id: z.ZodString;
|
|
6940
|
-
/** The delegation information */
|
|
6941
6653
|
delegation: z.ZodObject<{
|
|
6942
|
-
/** Unique identifier for the delegation */
|
|
6943
6654
|
id: z.ZodString;
|
|
6944
|
-
/** DID of the delegator (issuer, e.g., merchant/user) */
|
|
6945
6655
|
issuerDid: z.ZodString;
|
|
6946
|
-
/** DID of the delegatee (subject, e.g., agent) */
|
|
6947
6656
|
subjectDid: z.ZodString;
|
|
6948
|
-
/** Optional controller (user account ID or DID) */
|
|
6949
6657
|
controller: z.ZodOptional<z.ZodString>;
|
|
6950
|
-
/** Optional parent delegation ID for chain tracking */
|
|
6951
6658
|
parentId: z.ZodOptional<z.ZodString>;
|
|
6952
|
-
/** CRISP constraints on this delegation */
|
|
6953
6659
|
constraints: z.ZodObject<{
|
|
6954
6660
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
6955
6661
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -7344,21 +7050,16 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
7344
7050
|
}>, "many">;
|
|
7345
7051
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
7346
7052
|
}, z.ZodTypeAny, "passthrough">>;
|
|
7347
|
-
/** Current status of the delegation */
|
|
7348
7053
|
status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
|
|
7349
|
-
/** Timestamp when created (milliseconds since epoch) */
|
|
7350
7054
|
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
7351
|
-
/** Optional metadata */
|
|
7352
7055
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
7353
7056
|
}, "strip", z.ZodTypeAny, {
|
|
7354
7057
|
status: "active" | "revoked" | "expired";
|
|
7355
7058
|
id: string;
|
|
7356
|
-
issuerDid: string;
|
|
7357
|
-
subjectDid: string;
|
|
7358
7059
|
constraints: {
|
|
7060
|
+
scopes?: string[] | undefined;
|
|
7359
7061
|
notBefore?: number | undefined;
|
|
7360
7062
|
notAfter?: number | undefined;
|
|
7361
|
-
scopes?: string[] | undefined;
|
|
7362
7063
|
crisp?: z.objectOutputType<{
|
|
7363
7064
|
budget: z.ZodOptional<z.ZodObject<{
|
|
7364
7065
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -7405,18 +7106,18 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
7405
7106
|
} & {
|
|
7406
7107
|
[k: string]: unknown;
|
|
7407
7108
|
};
|
|
7408
|
-
|
|
7409
|
-
|
|
7109
|
+
issuerDid: string;
|
|
7110
|
+
subjectDid: string;
|
|
7410
7111
|
createdAt?: number | undefined;
|
|
7411
7112
|
metadata?: Record<string, any> | undefined;
|
|
7113
|
+
controller?: string | undefined;
|
|
7114
|
+
parentId?: string | undefined;
|
|
7412
7115
|
}, {
|
|
7413
7116
|
id: string;
|
|
7414
|
-
issuerDid: string;
|
|
7415
|
-
subjectDid: string;
|
|
7416
7117
|
constraints: {
|
|
7118
|
+
scopes?: string[] | undefined;
|
|
7417
7119
|
notBefore?: number | undefined;
|
|
7418
7120
|
notAfter?: number | undefined;
|
|
7419
|
-
scopes?: string[] | undefined;
|
|
7420
7121
|
crisp?: z.objectInputType<{
|
|
7421
7122
|
budget: z.ZodOptional<z.ZodObject<{
|
|
7422
7123
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -7463,23 +7164,22 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
7463
7164
|
} & {
|
|
7464
7165
|
[k: string]: unknown;
|
|
7465
7166
|
};
|
|
7167
|
+
issuerDid: string;
|
|
7168
|
+
subjectDid: string;
|
|
7466
7169
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
7467
|
-
controller?: string | undefined;
|
|
7468
|
-
parentId?: string | undefined;
|
|
7469
7170
|
createdAt?: number | undefined;
|
|
7470
7171
|
metadata?: Record<string, any> | undefined;
|
|
7172
|
+
controller?: string | undefined;
|
|
7173
|
+
parentId?: string | undefined;
|
|
7471
7174
|
}>;
|
|
7472
7175
|
}, "strip", z.ZodTypeAny, {
|
|
7473
|
-
id: string;
|
|
7474
7176
|
delegation: {
|
|
7475
7177
|
status: "active" | "revoked" | "expired";
|
|
7476
7178
|
id: string;
|
|
7477
|
-
issuerDid: string;
|
|
7478
|
-
subjectDid: string;
|
|
7479
7179
|
constraints: {
|
|
7180
|
+
scopes?: string[] | undefined;
|
|
7480
7181
|
notBefore?: number | undefined;
|
|
7481
7182
|
notAfter?: number | undefined;
|
|
7482
|
-
scopes?: string[] | undefined;
|
|
7483
7183
|
crisp?: z.objectOutputType<{
|
|
7484
7184
|
budget: z.ZodOptional<z.ZodObject<{
|
|
7485
7185
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -7526,21 +7226,21 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
7526
7226
|
} & {
|
|
7527
7227
|
[k: string]: unknown;
|
|
7528
7228
|
};
|
|
7529
|
-
|
|
7530
|
-
|
|
7229
|
+
issuerDid: string;
|
|
7230
|
+
subjectDid: string;
|
|
7531
7231
|
createdAt?: number | undefined;
|
|
7532
7232
|
metadata?: Record<string, any> | undefined;
|
|
7233
|
+
controller?: string | undefined;
|
|
7234
|
+
parentId?: string | undefined;
|
|
7533
7235
|
};
|
|
7534
|
-
}, {
|
|
7535
7236
|
id: string;
|
|
7237
|
+
}, {
|
|
7536
7238
|
delegation: {
|
|
7537
7239
|
id: string;
|
|
7538
|
-
issuerDid: string;
|
|
7539
|
-
subjectDid: string;
|
|
7540
7240
|
constraints: {
|
|
7241
|
+
scopes?: string[] | undefined;
|
|
7541
7242
|
notBefore?: number | undefined;
|
|
7542
7243
|
notAfter?: number | undefined;
|
|
7543
|
-
scopes?: string[] | undefined;
|
|
7544
7244
|
crisp?: z.objectInputType<{
|
|
7545
7245
|
budget: z.ZodOptional<z.ZodObject<{
|
|
7546
7246
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -7587,12 +7287,15 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
7587
7287
|
} & {
|
|
7588
7288
|
[k: string]: unknown;
|
|
7589
7289
|
};
|
|
7290
|
+
issuerDid: string;
|
|
7291
|
+
subjectDid: string;
|
|
7590
7292
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
7591
|
-
controller?: string | undefined;
|
|
7592
|
-
parentId?: string | undefined;
|
|
7593
7293
|
createdAt?: number | undefined;
|
|
7594
7294
|
metadata?: Record<string, any> | undefined;
|
|
7295
|
+
controller?: string | undefined;
|
|
7296
|
+
parentId?: string | undefined;
|
|
7595
7297
|
};
|
|
7298
|
+
id: string;
|
|
7596
7299
|
}>;
|
|
7597
7300
|
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
7598
7301
|
id: z.ZodString;
|
|
@@ -7644,21 +7347,13 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
7644
7347
|
issuanceDate: z.ZodString;
|
|
7645
7348
|
expirationDate: z.ZodOptional<z.ZodString>;
|
|
7646
7349
|
credentialSubject: z.ZodObject<{
|
|
7647
|
-
/** Subject DID (delegatee) */
|
|
7648
7350
|
id: z.ZodString;
|
|
7649
|
-
/** The delegation information */
|
|
7650
7351
|
delegation: z.ZodObject<{
|
|
7651
|
-
/** Unique identifier for the delegation */
|
|
7652
7352
|
id: z.ZodString;
|
|
7653
|
-
/** DID of the delegator (issuer, e.g., merchant/user) */
|
|
7654
7353
|
issuerDid: z.ZodString;
|
|
7655
|
-
/** DID of the delegatee (subject, e.g., agent) */
|
|
7656
7354
|
subjectDid: z.ZodString;
|
|
7657
|
-
/** Optional controller (user account ID or DID) */
|
|
7658
7355
|
controller: z.ZodOptional<z.ZodString>;
|
|
7659
|
-
/** Optional parent delegation ID for chain tracking */
|
|
7660
7356
|
parentId: z.ZodOptional<z.ZodString>;
|
|
7661
|
-
/** CRISP constraints on this delegation */
|
|
7662
7357
|
constraints: z.ZodObject<{
|
|
7663
7358
|
notBefore: z.ZodOptional<z.ZodNumber>;
|
|
7664
7359
|
notAfter: z.ZodOptional<z.ZodNumber>;
|
|
@@ -8053,21 +7748,16 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
8053
7748
|
}>, "many">;
|
|
8054
7749
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
8055
7750
|
}, z.ZodTypeAny, "passthrough">>;
|
|
8056
|
-
/** Current status of the delegation */
|
|
8057
7751
|
status: z.ZodDefault<z.ZodEnum<["active", "revoked", "expired"]>>;
|
|
8058
|
-
/** Timestamp when created (milliseconds since epoch) */
|
|
8059
7752
|
createdAt: z.ZodOptional<z.ZodNumber>;
|
|
8060
|
-
/** Optional metadata */
|
|
8061
7753
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
8062
7754
|
}, "strip", z.ZodTypeAny, {
|
|
8063
7755
|
status: "active" | "revoked" | "expired";
|
|
8064
7756
|
id: string;
|
|
8065
|
-
issuerDid: string;
|
|
8066
|
-
subjectDid: string;
|
|
8067
7757
|
constraints: {
|
|
7758
|
+
scopes?: string[] | undefined;
|
|
8068
7759
|
notBefore?: number | undefined;
|
|
8069
7760
|
notAfter?: number | undefined;
|
|
8070
|
-
scopes?: string[] | undefined;
|
|
8071
7761
|
crisp?: z.objectOutputType<{
|
|
8072
7762
|
budget: z.ZodOptional<z.ZodObject<{
|
|
8073
7763
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -8114,18 +7804,18 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
8114
7804
|
} & {
|
|
8115
7805
|
[k: string]: unknown;
|
|
8116
7806
|
};
|
|
8117
|
-
|
|
8118
|
-
|
|
7807
|
+
issuerDid: string;
|
|
7808
|
+
subjectDid: string;
|
|
8119
7809
|
createdAt?: number | undefined;
|
|
8120
7810
|
metadata?: Record<string, any> | undefined;
|
|
7811
|
+
controller?: string | undefined;
|
|
7812
|
+
parentId?: string | undefined;
|
|
8121
7813
|
}, {
|
|
8122
7814
|
id: string;
|
|
8123
|
-
issuerDid: string;
|
|
8124
|
-
subjectDid: string;
|
|
8125
7815
|
constraints: {
|
|
7816
|
+
scopes?: string[] | undefined;
|
|
8126
7817
|
notBefore?: number | undefined;
|
|
8127
7818
|
notAfter?: number | undefined;
|
|
8128
|
-
scopes?: string[] | undefined;
|
|
8129
7819
|
crisp?: z.objectInputType<{
|
|
8130
7820
|
budget: z.ZodOptional<z.ZodObject<{
|
|
8131
7821
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -8172,23 +7862,22 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
8172
7862
|
} & {
|
|
8173
7863
|
[k: string]: unknown;
|
|
8174
7864
|
};
|
|
7865
|
+
issuerDid: string;
|
|
7866
|
+
subjectDid: string;
|
|
8175
7867
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
8176
|
-
controller?: string | undefined;
|
|
8177
|
-
parentId?: string | undefined;
|
|
8178
7868
|
createdAt?: number | undefined;
|
|
8179
7869
|
metadata?: Record<string, any> | undefined;
|
|
7870
|
+
controller?: string | undefined;
|
|
7871
|
+
parentId?: string | undefined;
|
|
8180
7872
|
}>;
|
|
8181
7873
|
}, "strip", z.ZodTypeAny, {
|
|
8182
|
-
id: string;
|
|
8183
7874
|
delegation: {
|
|
8184
7875
|
status: "active" | "revoked" | "expired";
|
|
8185
7876
|
id: string;
|
|
8186
|
-
issuerDid: string;
|
|
8187
|
-
subjectDid: string;
|
|
8188
7877
|
constraints: {
|
|
7878
|
+
scopes?: string[] | undefined;
|
|
8189
7879
|
notBefore?: number | undefined;
|
|
8190
7880
|
notAfter?: number | undefined;
|
|
8191
|
-
scopes?: string[] | undefined;
|
|
8192
7881
|
crisp?: z.objectOutputType<{
|
|
8193
7882
|
budget: z.ZodOptional<z.ZodObject<{
|
|
8194
7883
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -8235,21 +7924,21 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
8235
7924
|
} & {
|
|
8236
7925
|
[k: string]: unknown;
|
|
8237
7926
|
};
|
|
8238
|
-
|
|
8239
|
-
|
|
7927
|
+
issuerDid: string;
|
|
7928
|
+
subjectDid: string;
|
|
8240
7929
|
createdAt?: number | undefined;
|
|
8241
7930
|
metadata?: Record<string, any> | undefined;
|
|
7931
|
+
controller?: string | undefined;
|
|
7932
|
+
parentId?: string | undefined;
|
|
8242
7933
|
};
|
|
8243
|
-
}, {
|
|
8244
7934
|
id: string;
|
|
7935
|
+
}, {
|
|
8245
7936
|
delegation: {
|
|
8246
7937
|
id: string;
|
|
8247
|
-
issuerDid: string;
|
|
8248
|
-
subjectDid: string;
|
|
8249
7938
|
constraints: {
|
|
7939
|
+
scopes?: string[] | undefined;
|
|
8250
7940
|
notBefore?: number | undefined;
|
|
8251
7941
|
notAfter?: number | undefined;
|
|
8252
|
-
scopes?: string[] | undefined;
|
|
8253
7942
|
crisp?: z.objectInputType<{
|
|
8254
7943
|
budget: z.ZodOptional<z.ZodObject<{
|
|
8255
7944
|
unit: z.ZodEnum<["USD", "ops", "points"]>;
|
|
@@ -8296,12 +7985,15 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
8296
7985
|
} & {
|
|
8297
7986
|
[k: string]: unknown;
|
|
8298
7987
|
};
|
|
7988
|
+
issuerDid: string;
|
|
7989
|
+
subjectDid: string;
|
|
8299
7990
|
status?: "active" | "revoked" | "expired" | undefined;
|
|
8300
|
-
controller?: string | undefined;
|
|
8301
|
-
parentId?: string | undefined;
|
|
8302
7991
|
createdAt?: number | undefined;
|
|
8303
7992
|
metadata?: Record<string, any> | undefined;
|
|
7993
|
+
controller?: string | undefined;
|
|
7994
|
+
parentId?: string | undefined;
|
|
8304
7995
|
};
|
|
7996
|
+
id: string;
|
|
8305
7997
|
}>;
|
|
8306
7998
|
credentialStatus: z.ZodOptional<z.ZodObject<{
|
|
8307
7999
|
id: z.ZodString;
|
|
@@ -8339,44 +8031,12 @@ export declare function validateDelegationCredential(credential: unknown): z.Saf
|
|
|
8339
8031
|
proofPurpose: z.ZodOptional<z.ZodString>;
|
|
8340
8032
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
8341
8033
|
}, z.ZodTypeAny, "passthrough">>;
|
|
8342
|
-
/**
|
|
8343
|
-
* Extract DelegationRecord from DelegationCredential
|
|
8344
|
-
*
|
|
8345
|
-
* Utility to extract the legacy DelegationRecord format from a W3C VC.
|
|
8346
|
-
* Useful for backward compatibility and internal processing.
|
|
8347
|
-
*
|
|
8348
|
-
* @param vc - The delegation credential
|
|
8349
|
-
* @returns DelegationRecord
|
|
8350
|
-
*/
|
|
8351
8034
|
export declare function extractDelegationFromVC(vc: DelegationCredential): DelegationRecord;
|
|
8352
|
-
/**
|
|
8353
|
-
* Create DelegationCredential from DelegationRecord (unsigned)
|
|
8354
|
-
*
|
|
8355
|
-
* Wraps a DelegationRecord in a W3C VC structure (without proof).
|
|
8356
|
-
* The caller must sign this to create a valid DelegationCredential.
|
|
8357
|
-
*
|
|
8358
|
-
* @param delegation - The delegation record
|
|
8359
|
-
* @param options - Optional VC options (id, issuanceDate, etc.)
|
|
8360
|
-
* @returns Unsigned DelegationCredential
|
|
8361
|
-
*/
|
|
8362
8035
|
export declare function wrapDelegationAsVC(delegation: DelegationRecord, options?: {
|
|
8363
8036
|
id?: string;
|
|
8364
8037
|
issuanceDate?: string;
|
|
8365
8038
|
expirationDate?: string;
|
|
8366
8039
|
credentialStatus?: z.infer<typeof CredentialStatusSchema>;
|
|
8367
8040
|
}): Omit<DelegationCredential, 'proof'>;
|
|
8368
|
-
/**
|
|
8369
|
-
* Check if a delegation credential is expired
|
|
8370
|
-
*
|
|
8371
|
-
* @param vc - The delegation credential
|
|
8372
|
-
* @returns true if expired
|
|
8373
|
-
*/
|
|
8374
8041
|
export declare function isDelegationCredentialExpired(vc: DelegationCredential): boolean;
|
|
8375
|
-
/**
|
|
8376
|
-
* Check if a delegation credential is not yet valid
|
|
8377
|
-
*
|
|
8378
|
-
* @param vc - The delegation credential
|
|
8379
|
-
* @returns true if not yet valid
|
|
8380
|
-
*/
|
|
8381
8042
|
export declare function isDelegationCredentialNotYetValid(vc: DelegationCredential): boolean;
|
|
8382
|
-
//# sourceMappingURL=schemas.d.ts.map
|