@kya-os/contracts 1.5.3-canary.21 → 1.5.3-canary.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/consent/schemas.d.ts +149 -77
- package/dist/consent/schemas.js +29 -2
- package/package.json +23 -1
- package/.turbo/turbo-build.log +0 -17
- package/.turbo/turbo-test$colon$coverage.log +0 -85
- package/.turbo/turbo-test.log +0 -32
- package/coverage/coverage-final.json +0 -38
- package/schemas/cli/register-output/v1.0.0.json +0 -69
- package/schemas/identity/v1.0.0.json +0 -46
- package/schemas/proof/v1.0.0.json +0 -80
- package/schemas/registry/receipt-v1.0.0.json +0 -60
- package/schemas/verifier/verify-page/v1.0.0.json +0 -94
- package/schemas/well-known/agent/v1.0.0.json +0 -67
- package/schemas/well-known/did/v1.0.0.json +0 -174
- package/scripts/emit-schemas.js +0 -11
- package/src/agentshield-api/admin-schemas.ts +0 -31
- package/src/agentshield-api/admin-types.ts +0 -47
- package/src/agentshield-api/endpoints.ts +0 -60
- package/src/agentshield-api/index.ts +0 -70
- package/src/agentshield-api/schemas.ts +0 -304
- package/src/agentshield-api/types.ts +0 -317
- package/src/audit/index.ts +0 -128
- package/src/cli.ts +0 -156
- package/src/config/base.ts +0 -107
- package/src/config/builder.ts +0 -97
- package/src/config/delegation.ts +0 -232
- package/src/config/identity.ts +0 -252
- package/src/config/index.ts +0 -78
- package/src/config/proofing.ts +0 -138
- package/src/config/tool-context.ts +0 -41
- package/src/config/tool-protection.ts +0 -174
- package/src/consent/index.ts +0 -32
- package/src/consent/schemas.ts +0 -334
- package/src/consent/types.ts +0 -199
- package/src/dashboard-config/default-config.json +0 -86
- package/src/dashboard-config/default-config.ts +0 -266
- package/src/dashboard-config/index.ts +0 -48
- package/src/dashboard-config/schemas.ts +0 -286
- package/src/dashboard-config/types.ts +0 -404
- package/src/delegation/constraints.ts +0 -267
- package/src/delegation/index.ts +0 -8
- package/src/delegation/schemas.ts +0 -595
- package/src/did/index.ts +0 -9
- package/src/did/resolve-contract.ts +0 -255
- package/src/did/schemas.ts +0 -190
- package/src/did/types.ts +0 -224
- package/src/env/constants.ts +0 -70
- package/src/env/index.ts +0 -5
- package/src/handshake.ts +0 -125
- package/src/index.ts +0 -45
- package/src/proof/index.ts +0 -31
- package/src/proof/proof-record.ts +0 -163
- package/src/proof/signing-spec.ts +0 -146
- package/src/proof.ts +0 -99
- package/src/registry.ts +0 -146
- package/src/runtime/errors.ts +0 -153
- package/src/runtime/headers.ts +0 -136
- package/src/runtime/index.ts +0 -6
- package/src/test.ts +0 -143
- package/src/tlkrc/index.ts +0 -5
- package/src/tlkrc/rotation.ts +0 -153
- package/src/tool-protection/index.ts +0 -406
- package/src/utils/validation.ts +0 -93
- package/src/vc/index.ts +0 -8
- package/src/vc/schemas.ts +0 -277
- package/src/vc/statuslist.ts +0 -279
- package/src/verifier/index.ts +0 -2
- package/src/verifier.ts +0 -92
- package/src/well-known/index.ts +0 -237
|
@@ -37,14 +37,14 @@ export declare const consentTermsSchema: z.ZodObject<{
|
|
|
37
37
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
38
38
|
}, "strip", z.ZodTypeAny, {
|
|
39
39
|
required: boolean;
|
|
40
|
-
version?: string | undefined;
|
|
41
|
-
url?: string | undefined;
|
|
42
40
|
text?: string | undefined;
|
|
43
|
-
|
|
41
|
+
url?: string | undefined;
|
|
44
42
|
version?: string | undefined;
|
|
43
|
+
}, {
|
|
44
|
+
text?: string | undefined;
|
|
45
45
|
url?: string | undefined;
|
|
46
|
+
version?: string | undefined;
|
|
46
47
|
required?: boolean | undefined;
|
|
47
|
-
text?: string | undefined;
|
|
48
48
|
}>;
|
|
49
49
|
export type ConsentTerms = z.infer<typeof consentTermsSchema>;
|
|
50
50
|
/**
|
|
@@ -82,9 +82,9 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
82
82
|
pattern: z.ZodOptional<z.ZodString>;
|
|
83
83
|
}, "strip", z.ZodTypeAny, {
|
|
84
84
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
85
|
-
name: string;
|
|
86
85
|
required: boolean;
|
|
87
86
|
label: string;
|
|
87
|
+
name: string;
|
|
88
88
|
options?: {
|
|
89
89
|
value: string;
|
|
90
90
|
label: string;
|
|
@@ -93,9 +93,9 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
93
93
|
pattern?: string | undefined;
|
|
94
94
|
}, {
|
|
95
95
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
96
|
-
name: string;
|
|
97
96
|
required: boolean;
|
|
98
97
|
label: string;
|
|
98
|
+
name: string;
|
|
99
99
|
options?: {
|
|
100
100
|
value: string;
|
|
101
101
|
label: string;
|
|
@@ -104,9 +104,9 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
104
104
|
pattern?: string | undefined;
|
|
105
105
|
}>, {
|
|
106
106
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
107
|
-
name: string;
|
|
108
107
|
required: boolean;
|
|
109
108
|
label: string;
|
|
109
|
+
name: string;
|
|
110
110
|
options?: {
|
|
111
111
|
value: string;
|
|
112
112
|
label: string;
|
|
@@ -115,9 +115,9 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
115
115
|
pattern?: string | undefined;
|
|
116
116
|
}, {
|
|
117
117
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
118
|
-
name: string;
|
|
119
118
|
required: boolean;
|
|
120
119
|
label: string;
|
|
120
|
+
name: string;
|
|
121
121
|
options?: {
|
|
122
122
|
value: string;
|
|
123
123
|
label: string;
|
|
@@ -151,13 +151,13 @@ export declare const oauthIdentitySchema: z.ZodObject<{
|
|
|
151
151
|
*/
|
|
152
152
|
name: z.ZodOptional<z.ZodString>;
|
|
153
153
|
}, "strip", z.ZodTypeAny, {
|
|
154
|
-
subject: string;
|
|
155
154
|
provider: string;
|
|
155
|
+
subject: string;
|
|
156
156
|
name?: string | undefined;
|
|
157
157
|
email?: string | undefined;
|
|
158
158
|
}, {
|
|
159
|
-
subject: string;
|
|
160
159
|
provider: string;
|
|
160
|
+
subject: string;
|
|
161
161
|
name?: string | undefined;
|
|
162
162
|
email?: string | undefined;
|
|
163
163
|
}>;
|
|
@@ -165,7 +165,7 @@ export type OAuthIdentity = z.infer<typeof oauthIdentitySchema>;
|
|
|
165
165
|
/**
|
|
166
166
|
* Consent Page Config Schema
|
|
167
167
|
*/
|
|
168
|
-
export declare const consentPageConfigSchema: z.ZodObject<{
|
|
168
|
+
export declare const consentPageConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
169
169
|
tool: z.ZodString;
|
|
170
170
|
toolDescription: z.ZodString;
|
|
171
171
|
scopes: z.ZodArray<z.ZodString, "many">;
|
|
@@ -196,14 +196,14 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
196
196
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
197
197
|
}, "strip", z.ZodTypeAny, {
|
|
198
198
|
required: boolean;
|
|
199
|
-
version?: string | undefined;
|
|
200
|
-
url?: string | undefined;
|
|
201
199
|
text?: string | undefined;
|
|
202
|
-
|
|
200
|
+
url?: string | undefined;
|
|
203
201
|
version?: string | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
text?: string | undefined;
|
|
204
204
|
url?: string | undefined;
|
|
205
|
+
version?: string | undefined;
|
|
205
206
|
required?: boolean | undefined;
|
|
206
|
-
text?: string | undefined;
|
|
207
207
|
}>>;
|
|
208
208
|
customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
209
209
|
name: z.ZodString;
|
|
@@ -224,9 +224,9 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
224
224
|
pattern: z.ZodOptional<z.ZodString>;
|
|
225
225
|
}, "strip", z.ZodTypeAny, {
|
|
226
226
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
227
|
-
name: string;
|
|
228
227
|
required: boolean;
|
|
229
228
|
label: string;
|
|
229
|
+
name: string;
|
|
230
230
|
options?: {
|
|
231
231
|
value: string;
|
|
232
232
|
label: string;
|
|
@@ -235,9 +235,9 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
235
235
|
pattern?: string | undefined;
|
|
236
236
|
}, {
|
|
237
237
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
238
|
-
name: string;
|
|
239
238
|
required: boolean;
|
|
240
239
|
label: string;
|
|
240
|
+
name: string;
|
|
241
241
|
options?: {
|
|
242
242
|
value: string;
|
|
243
243
|
label: string;
|
|
@@ -246,9 +246,9 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
246
246
|
pattern?: string | undefined;
|
|
247
247
|
}>, {
|
|
248
248
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
249
|
-
name: string;
|
|
250
249
|
required: boolean;
|
|
251
250
|
label: string;
|
|
251
|
+
name: string;
|
|
252
252
|
options?: {
|
|
253
253
|
value: string;
|
|
254
254
|
label: string;
|
|
@@ -257,9 +257,9 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
257
257
|
pattern?: string | undefined;
|
|
258
258
|
}, {
|
|
259
259
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
260
|
-
name: string;
|
|
261
260
|
required: boolean;
|
|
262
261
|
label: string;
|
|
262
|
+
name: string;
|
|
263
263
|
options?: {
|
|
264
264
|
value: string;
|
|
265
265
|
label: string;
|
|
@@ -278,14 +278,14 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
278
278
|
* The OAuth authorization URL to redirect to
|
|
279
279
|
* Required if oauthRequired is true
|
|
280
280
|
*/
|
|
281
|
-
oauthUrl: z.ZodOptional<z.ZodString
|
|
281
|
+
oauthUrl: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">]>>;
|
|
282
282
|
}, "strip", z.ZodTypeAny, {
|
|
283
|
-
agentDid: string;
|
|
284
|
-
sessionId: string;
|
|
285
283
|
tool: string;
|
|
284
|
+
toolDescription: string;
|
|
286
285
|
scopes: string[];
|
|
286
|
+
agentDid: string;
|
|
287
|
+
sessionId: string;
|
|
287
288
|
projectId: string;
|
|
288
|
-
toolDescription: string;
|
|
289
289
|
serverUrl: string;
|
|
290
290
|
provider?: string | undefined;
|
|
291
291
|
branding?: {
|
|
@@ -296,15 +296,15 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
296
296
|
} | undefined;
|
|
297
297
|
terms?: {
|
|
298
298
|
required: boolean;
|
|
299
|
-
version?: string | undefined;
|
|
300
|
-
url?: string | undefined;
|
|
301
299
|
text?: string | undefined;
|
|
300
|
+
url?: string | undefined;
|
|
301
|
+
version?: string | undefined;
|
|
302
302
|
} | undefined;
|
|
303
303
|
customFields?: {
|
|
304
304
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
305
|
-
name: string;
|
|
306
305
|
required: boolean;
|
|
307
306
|
label: string;
|
|
307
|
+
name: string;
|
|
308
308
|
options?: {
|
|
309
309
|
value: string;
|
|
310
310
|
label: string;
|
|
@@ -316,12 +316,48 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
316
316
|
oauthRequired?: boolean | undefined;
|
|
317
317
|
oauthUrl?: string | undefined;
|
|
318
318
|
}, {
|
|
319
|
+
tool: string;
|
|
320
|
+
toolDescription: string;
|
|
321
|
+
scopes: string[];
|
|
319
322
|
agentDid: string;
|
|
320
323
|
sessionId: string;
|
|
324
|
+
projectId: string;
|
|
325
|
+
serverUrl: string;
|
|
326
|
+
provider?: string | undefined;
|
|
327
|
+
branding?: {
|
|
328
|
+
primaryColor?: string | undefined;
|
|
329
|
+
logoUrl?: string | undefined;
|
|
330
|
+
companyName?: string | undefined;
|
|
331
|
+
theme?: "light" | "dark" | "auto" | undefined;
|
|
332
|
+
} | undefined;
|
|
333
|
+
terms?: {
|
|
334
|
+
text?: string | undefined;
|
|
335
|
+
url?: string | undefined;
|
|
336
|
+
version?: string | undefined;
|
|
337
|
+
required?: boolean | undefined;
|
|
338
|
+
} | undefined;
|
|
339
|
+
customFields?: {
|
|
340
|
+
type: "text" | "textarea" | "checkbox" | "select";
|
|
341
|
+
required: boolean;
|
|
342
|
+
label: string;
|
|
343
|
+
name: string;
|
|
344
|
+
options?: {
|
|
345
|
+
value: string;
|
|
346
|
+
label: string;
|
|
347
|
+
}[] | undefined;
|
|
348
|
+
placeholder?: string | undefined;
|
|
349
|
+
pattern?: string | undefined;
|
|
350
|
+
}[] | undefined;
|
|
351
|
+
autoClose?: boolean | undefined;
|
|
352
|
+
oauthRequired?: boolean | undefined;
|
|
353
|
+
oauthUrl?: string | undefined;
|
|
354
|
+
}>, {
|
|
321
355
|
tool: string;
|
|
356
|
+
toolDescription: string;
|
|
322
357
|
scopes: string[];
|
|
358
|
+
agentDid: string;
|
|
359
|
+
sessionId: string;
|
|
323
360
|
projectId: string;
|
|
324
|
-
toolDescription: string;
|
|
325
361
|
serverUrl: string;
|
|
326
362
|
provider?: string | undefined;
|
|
327
363
|
branding?: {
|
|
@@ -331,16 +367,52 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
331
367
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
332
368
|
} | undefined;
|
|
333
369
|
terms?: {
|
|
370
|
+
required: boolean;
|
|
371
|
+
text?: string | undefined;
|
|
372
|
+
url?: string | undefined;
|
|
334
373
|
version?: string | undefined;
|
|
374
|
+
} | undefined;
|
|
375
|
+
customFields?: {
|
|
376
|
+
type: "text" | "textarea" | "checkbox" | "select";
|
|
377
|
+
required: boolean;
|
|
378
|
+
label: string;
|
|
379
|
+
name: string;
|
|
380
|
+
options?: {
|
|
381
|
+
value: string;
|
|
382
|
+
label: string;
|
|
383
|
+
}[] | undefined;
|
|
384
|
+
placeholder?: string | undefined;
|
|
385
|
+
pattern?: string | undefined;
|
|
386
|
+
}[] | undefined;
|
|
387
|
+
autoClose?: boolean | undefined;
|
|
388
|
+
oauthRequired?: boolean | undefined;
|
|
389
|
+
oauthUrl?: string | undefined;
|
|
390
|
+
}, {
|
|
391
|
+
tool: string;
|
|
392
|
+
toolDescription: string;
|
|
393
|
+
scopes: string[];
|
|
394
|
+
agentDid: string;
|
|
395
|
+
sessionId: string;
|
|
396
|
+
projectId: string;
|
|
397
|
+
serverUrl: string;
|
|
398
|
+
provider?: string | undefined;
|
|
399
|
+
branding?: {
|
|
400
|
+
primaryColor?: string | undefined;
|
|
401
|
+
logoUrl?: string | undefined;
|
|
402
|
+
companyName?: string | undefined;
|
|
403
|
+
theme?: "light" | "dark" | "auto" | undefined;
|
|
404
|
+
} | undefined;
|
|
405
|
+
terms?: {
|
|
406
|
+
text?: string | undefined;
|
|
335
407
|
url?: string | undefined;
|
|
408
|
+
version?: string | undefined;
|
|
336
409
|
required?: boolean | undefined;
|
|
337
|
-
text?: string | undefined;
|
|
338
410
|
} | undefined;
|
|
339
411
|
customFields?: {
|
|
340
412
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
341
|
-
name: string;
|
|
342
413
|
required: boolean;
|
|
343
414
|
label: string;
|
|
415
|
+
name: string;
|
|
344
416
|
options?: {
|
|
345
417
|
value: string;
|
|
346
418
|
label: string;
|
|
@@ -397,13 +469,13 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
397
469
|
*/
|
|
398
470
|
name: z.ZodOptional<z.ZodString>;
|
|
399
471
|
}, "strip", z.ZodTypeAny, {
|
|
400
|
-
subject: string;
|
|
401
472
|
provider: string;
|
|
473
|
+
subject: string;
|
|
402
474
|
name?: string | undefined;
|
|
403
475
|
email?: string | undefined;
|
|
404
476
|
}, {
|
|
405
|
-
subject: string;
|
|
406
477
|
provider: string;
|
|
478
|
+
subject: string;
|
|
407
479
|
name?: string | undefined;
|
|
408
480
|
email?: string | undefined;
|
|
409
481
|
}>>>;
|
|
@@ -415,32 +487,32 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
415
487
|
user_did: z.ZodOptional<z.ZodString>;
|
|
416
488
|
}, "strip", z.ZodTypeAny, {
|
|
417
489
|
tool: string;
|
|
418
|
-
session_id: string;
|
|
419
490
|
scopes: string[];
|
|
420
491
|
agent_did: string;
|
|
492
|
+
session_id: string;
|
|
421
493
|
project_id: string;
|
|
422
494
|
termsAccepted: boolean;
|
|
423
495
|
customFields?: Record<string, string | boolean> | undefined;
|
|
424
496
|
termsVersion?: string | undefined;
|
|
425
497
|
oauth_identity?: {
|
|
426
|
-
subject: string;
|
|
427
498
|
provider: string;
|
|
499
|
+
subject: string;
|
|
428
500
|
name?: string | undefined;
|
|
429
501
|
email?: string | undefined;
|
|
430
502
|
} | null | undefined;
|
|
431
503
|
user_did?: string | undefined;
|
|
432
504
|
}, {
|
|
433
505
|
tool: string;
|
|
434
|
-
session_id: string;
|
|
435
506
|
scopes: string[];
|
|
436
507
|
agent_did: string;
|
|
508
|
+
session_id: string;
|
|
437
509
|
project_id: string;
|
|
438
510
|
termsAccepted: boolean;
|
|
439
511
|
customFields?: Record<string, string | boolean> | undefined;
|
|
440
512
|
termsVersion?: string | undefined;
|
|
441
513
|
oauth_identity?: {
|
|
442
|
-
subject: string;
|
|
443
514
|
provider: string;
|
|
515
|
+
subject: string;
|
|
444
516
|
name?: string | undefined;
|
|
445
517
|
email?: string | undefined;
|
|
446
518
|
} | null | undefined;
|
|
@@ -458,27 +530,27 @@ export declare const consentApprovalResponseSchema: z.ZodEffects<z.ZodObject<{
|
|
|
458
530
|
error_code: z.ZodOptional<z.ZodString>;
|
|
459
531
|
}, "strip", z.ZodTypeAny, {
|
|
460
532
|
success: boolean;
|
|
461
|
-
error?: string | undefined;
|
|
462
533
|
delegation_id?: string | undefined;
|
|
463
534
|
delegation_token?: string | undefined;
|
|
535
|
+
error?: string | undefined;
|
|
464
536
|
error_code?: string | undefined;
|
|
465
537
|
}, {
|
|
466
538
|
success: boolean;
|
|
467
|
-
error?: string | undefined;
|
|
468
539
|
delegation_id?: string | undefined;
|
|
469
540
|
delegation_token?: string | undefined;
|
|
541
|
+
error?: string | undefined;
|
|
470
542
|
error_code?: string | undefined;
|
|
471
543
|
}>, {
|
|
472
544
|
success: boolean;
|
|
473
|
-
error?: string | undefined;
|
|
474
545
|
delegation_id?: string | undefined;
|
|
475
546
|
delegation_token?: string | undefined;
|
|
547
|
+
error?: string | undefined;
|
|
476
548
|
error_code?: string | undefined;
|
|
477
549
|
}, {
|
|
478
550
|
success: boolean;
|
|
479
|
-
error?: string | undefined;
|
|
480
551
|
delegation_id?: string | undefined;
|
|
481
552
|
delegation_token?: string | undefined;
|
|
553
|
+
error?: string | undefined;
|
|
482
554
|
error_code?: string | undefined;
|
|
483
555
|
}>;
|
|
484
556
|
export type ConsentApprovalResponse = z.infer<typeof consentApprovalResponseSchema>;
|
|
@@ -509,14 +581,14 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
509
581
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
510
582
|
}, "strip", z.ZodTypeAny, {
|
|
511
583
|
required: boolean;
|
|
512
|
-
version?: string | undefined;
|
|
513
|
-
url?: string | undefined;
|
|
514
584
|
text?: string | undefined;
|
|
515
|
-
|
|
585
|
+
url?: string | undefined;
|
|
516
586
|
version?: string | undefined;
|
|
587
|
+
}, {
|
|
588
|
+
text?: string | undefined;
|
|
517
589
|
url?: string | undefined;
|
|
590
|
+
version?: string | undefined;
|
|
518
591
|
required?: boolean | undefined;
|
|
519
|
-
text?: string | undefined;
|
|
520
592
|
}>>;
|
|
521
593
|
customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
522
594
|
name: z.ZodString;
|
|
@@ -537,9 +609,9 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
537
609
|
pattern: z.ZodOptional<z.ZodString>;
|
|
538
610
|
}, "strip", z.ZodTypeAny, {
|
|
539
611
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
540
|
-
name: string;
|
|
541
612
|
required: boolean;
|
|
542
613
|
label: string;
|
|
614
|
+
name: string;
|
|
543
615
|
options?: {
|
|
544
616
|
value: string;
|
|
545
617
|
label: string;
|
|
@@ -548,9 +620,9 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
548
620
|
pattern?: string | undefined;
|
|
549
621
|
}, {
|
|
550
622
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
551
|
-
name: string;
|
|
552
623
|
required: boolean;
|
|
553
624
|
label: string;
|
|
625
|
+
name: string;
|
|
554
626
|
options?: {
|
|
555
627
|
value: string;
|
|
556
628
|
label: string;
|
|
@@ -559,9 +631,9 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
559
631
|
pattern?: string | undefined;
|
|
560
632
|
}>, {
|
|
561
633
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
562
|
-
name: string;
|
|
563
634
|
required: boolean;
|
|
564
635
|
label: string;
|
|
636
|
+
name: string;
|
|
565
637
|
options?: {
|
|
566
638
|
value: string;
|
|
567
639
|
label: string;
|
|
@@ -570,9 +642,9 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
570
642
|
pattern?: string | undefined;
|
|
571
643
|
}, {
|
|
572
644
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
573
|
-
name: string;
|
|
574
645
|
required: boolean;
|
|
575
646
|
label: string;
|
|
647
|
+
name: string;
|
|
576
648
|
options?: {
|
|
577
649
|
value: string;
|
|
578
650
|
label: string;
|
|
@@ -605,15 +677,15 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
605
677
|
} | undefined;
|
|
606
678
|
terms?: {
|
|
607
679
|
required: boolean;
|
|
608
|
-
version?: string | undefined;
|
|
609
|
-
url?: string | undefined;
|
|
610
680
|
text?: string | undefined;
|
|
681
|
+
url?: string | undefined;
|
|
682
|
+
version?: string | undefined;
|
|
611
683
|
} | undefined;
|
|
612
684
|
customFields?: {
|
|
613
685
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
614
|
-
name: string;
|
|
615
686
|
required: boolean;
|
|
616
687
|
label: string;
|
|
688
|
+
name: string;
|
|
617
689
|
options?: {
|
|
618
690
|
value: string;
|
|
619
691
|
label: string;
|
|
@@ -635,16 +707,16 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
635
707
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
636
708
|
} | undefined;
|
|
637
709
|
terms?: {
|
|
638
|
-
|
|
710
|
+
text?: string | undefined;
|
|
639
711
|
url?: string | undefined;
|
|
712
|
+
version?: string | undefined;
|
|
640
713
|
required?: boolean | undefined;
|
|
641
|
-
text?: string | undefined;
|
|
642
714
|
} | undefined;
|
|
643
715
|
customFields?: {
|
|
644
716
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
645
|
-
name: string;
|
|
646
717
|
required: boolean;
|
|
647
718
|
label: string;
|
|
719
|
+
name: string;
|
|
648
720
|
options?: {
|
|
649
721
|
value: string;
|
|
650
722
|
label: string;
|
|
@@ -670,12 +742,12 @@ export type ConsentConfig = z.infer<typeof consentConfigSchema>;
|
|
|
670
742
|
* @returns Validation result
|
|
671
743
|
*/
|
|
672
744
|
export declare function validateConsentPageConfig(config: unknown): z.SafeParseReturnType<{
|
|
673
|
-
agentDid: string;
|
|
674
|
-
sessionId: string;
|
|
675
745
|
tool: string;
|
|
746
|
+
toolDescription: string;
|
|
676
747
|
scopes: string[];
|
|
748
|
+
agentDid: string;
|
|
749
|
+
sessionId: string;
|
|
677
750
|
projectId: string;
|
|
678
|
-
toolDescription: string;
|
|
679
751
|
serverUrl: string;
|
|
680
752
|
provider?: string | undefined;
|
|
681
753
|
branding?: {
|
|
@@ -685,16 +757,16 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
685
757
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
686
758
|
} | undefined;
|
|
687
759
|
terms?: {
|
|
688
|
-
|
|
760
|
+
text?: string | undefined;
|
|
689
761
|
url?: string | undefined;
|
|
762
|
+
version?: string | undefined;
|
|
690
763
|
required?: boolean | undefined;
|
|
691
|
-
text?: string | undefined;
|
|
692
764
|
} | undefined;
|
|
693
765
|
customFields?: {
|
|
694
766
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
695
|
-
name: string;
|
|
696
767
|
required: boolean;
|
|
697
768
|
label: string;
|
|
769
|
+
name: string;
|
|
698
770
|
options?: {
|
|
699
771
|
value: string;
|
|
700
772
|
label: string;
|
|
@@ -706,12 +778,12 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
706
778
|
oauthRequired?: boolean | undefined;
|
|
707
779
|
oauthUrl?: string | undefined;
|
|
708
780
|
}, {
|
|
709
|
-
agentDid: string;
|
|
710
|
-
sessionId: string;
|
|
711
781
|
tool: string;
|
|
782
|
+
toolDescription: string;
|
|
712
783
|
scopes: string[];
|
|
784
|
+
agentDid: string;
|
|
785
|
+
sessionId: string;
|
|
713
786
|
projectId: string;
|
|
714
|
-
toolDescription: string;
|
|
715
787
|
serverUrl: string;
|
|
716
788
|
provider?: string | undefined;
|
|
717
789
|
branding?: {
|
|
@@ -722,15 +794,15 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
722
794
|
} | undefined;
|
|
723
795
|
terms?: {
|
|
724
796
|
required: boolean;
|
|
725
|
-
version?: string | undefined;
|
|
726
|
-
url?: string | undefined;
|
|
727
797
|
text?: string | undefined;
|
|
798
|
+
url?: string | undefined;
|
|
799
|
+
version?: string | undefined;
|
|
728
800
|
} | undefined;
|
|
729
801
|
customFields?: {
|
|
730
802
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
731
|
-
name: string;
|
|
732
803
|
required: boolean;
|
|
733
804
|
label: string;
|
|
805
|
+
name: string;
|
|
734
806
|
options?: {
|
|
735
807
|
value: string;
|
|
736
808
|
label: string;
|
|
@@ -750,32 +822,32 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
750
822
|
*/
|
|
751
823
|
export declare function validateConsentApprovalRequest(request: unknown): z.SafeParseReturnType<{
|
|
752
824
|
tool: string;
|
|
753
|
-
session_id: string;
|
|
754
825
|
scopes: string[];
|
|
755
826
|
agent_did: string;
|
|
827
|
+
session_id: string;
|
|
756
828
|
project_id: string;
|
|
757
829
|
termsAccepted: boolean;
|
|
758
830
|
customFields?: Record<string, string | boolean> | undefined;
|
|
759
831
|
termsVersion?: string | undefined;
|
|
760
832
|
oauth_identity?: {
|
|
761
|
-
subject: string;
|
|
762
833
|
provider: string;
|
|
834
|
+
subject: string;
|
|
763
835
|
name?: string | undefined;
|
|
764
836
|
email?: string | undefined;
|
|
765
837
|
} | null | undefined;
|
|
766
838
|
user_did?: string | undefined;
|
|
767
839
|
}, {
|
|
768
840
|
tool: string;
|
|
769
|
-
session_id: string;
|
|
770
841
|
scopes: string[];
|
|
771
842
|
agent_did: string;
|
|
843
|
+
session_id: string;
|
|
772
844
|
project_id: string;
|
|
773
845
|
termsAccepted: boolean;
|
|
774
846
|
customFields?: Record<string, string | boolean> | undefined;
|
|
775
847
|
termsVersion?: string | undefined;
|
|
776
848
|
oauth_identity?: {
|
|
777
|
-
subject: string;
|
|
778
849
|
provider: string;
|
|
850
|
+
subject: string;
|
|
779
851
|
name?: string | undefined;
|
|
780
852
|
email?: string | undefined;
|
|
781
853
|
} | null | undefined;
|
|
@@ -789,15 +861,15 @@ export declare function validateConsentApprovalRequest(request: unknown): z.Safe
|
|
|
789
861
|
*/
|
|
790
862
|
export declare function validateConsentApprovalResponse(response: unknown): z.SafeParseReturnType<{
|
|
791
863
|
success: boolean;
|
|
792
|
-
error?: string | undefined;
|
|
793
864
|
delegation_id?: string | undefined;
|
|
794
865
|
delegation_token?: string | undefined;
|
|
866
|
+
error?: string | undefined;
|
|
795
867
|
error_code?: string | undefined;
|
|
796
868
|
}, {
|
|
797
869
|
success: boolean;
|
|
798
|
-
error?: string | undefined;
|
|
799
870
|
delegation_id?: string | undefined;
|
|
800
871
|
delegation_token?: string | undefined;
|
|
872
|
+
error?: string | undefined;
|
|
801
873
|
error_code?: string | undefined;
|
|
802
874
|
}>;
|
|
803
875
|
/**
|
|
@@ -814,16 +886,16 @@ export declare function validateConsentConfig(config: unknown): z.SafeParseRetur
|
|
|
814
886
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
815
887
|
} | undefined;
|
|
816
888
|
terms?: {
|
|
817
|
-
|
|
889
|
+
text?: string | undefined;
|
|
818
890
|
url?: string | undefined;
|
|
891
|
+
version?: string | undefined;
|
|
819
892
|
required?: boolean | undefined;
|
|
820
|
-
text?: string | undefined;
|
|
821
893
|
} | undefined;
|
|
822
894
|
customFields?: {
|
|
823
895
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
824
|
-
name: string;
|
|
825
896
|
required: boolean;
|
|
826
897
|
label: string;
|
|
898
|
+
name: string;
|
|
827
899
|
options?: {
|
|
828
900
|
value: string;
|
|
829
901
|
label: string;
|
|
@@ -846,15 +918,15 @@ export declare function validateConsentConfig(config: unknown): z.SafeParseRetur
|
|
|
846
918
|
} | undefined;
|
|
847
919
|
terms?: {
|
|
848
920
|
required: boolean;
|
|
849
|
-
version?: string | undefined;
|
|
850
|
-
url?: string | undefined;
|
|
851
921
|
text?: string | undefined;
|
|
922
|
+
url?: string | undefined;
|
|
923
|
+
version?: string | undefined;
|
|
852
924
|
} | undefined;
|
|
853
925
|
customFields?: {
|
|
854
926
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
855
|
-
name: string;
|
|
856
927
|
required: boolean;
|
|
857
928
|
label: string;
|
|
929
|
+
name: string;
|
|
858
930
|
options?: {
|
|
859
931
|
value: string;
|
|
860
932
|
label: string;
|
package/dist/consent/schemas.js
CHANGED
|
@@ -132,7 +132,8 @@ exports.oauthIdentitySchema = zod_1.z.object({
|
|
|
132
132
|
/**
|
|
133
133
|
* Consent Page Config Schema
|
|
134
134
|
*/
|
|
135
|
-
exports.consentPageConfigSchema = zod_1.z
|
|
135
|
+
exports.consentPageConfigSchema = zod_1.z
|
|
136
|
+
.object({
|
|
136
137
|
tool: zod_1.z.string().min(1, "Tool name is required"),
|
|
137
138
|
toolDescription: zod_1.z
|
|
138
139
|
.string()
|
|
@@ -159,7 +160,33 @@ exports.consentPageConfigSchema = zod_1.z.object({
|
|
|
159
160
|
* The OAuth authorization URL to redirect to
|
|
160
161
|
* Required if oauthRequired is true
|
|
161
162
|
*/
|
|
162
|
-
oauthUrl: zod_1.z
|
|
163
|
+
oauthUrl: zod_1.z
|
|
164
|
+
.union([
|
|
165
|
+
zod_1.z.string().url(),
|
|
166
|
+
zod_1.z.literal(""), // Allow empty string to catch it in refine with better error
|
|
167
|
+
])
|
|
168
|
+
.optional(),
|
|
169
|
+
})
|
|
170
|
+
.superRefine((data, ctx) => {
|
|
171
|
+
// If oauthRequired is true, oauthUrl must be provided and non-empty
|
|
172
|
+
if (data.oauthRequired === true) {
|
|
173
|
+
if (data.oauthUrl === undefined || data.oauthUrl === "") {
|
|
174
|
+
ctx.addIssue({
|
|
175
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
176
|
+
message: "oauthUrl is required when oauthRequired is true",
|
|
177
|
+
path: ["oauthUrl"],
|
|
178
|
+
});
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
// If oauthUrl is provided (not undefined), it must be a valid URL (not empty)
|
|
183
|
+
if (data.oauthUrl !== undefined && data.oauthUrl === "") {
|
|
184
|
+
ctx.addIssue({
|
|
185
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
186
|
+
message: "oauthUrl must be a valid URL",
|
|
187
|
+
path: ["oauthUrl"],
|
|
188
|
+
});
|
|
189
|
+
}
|
|
163
190
|
});
|
|
164
191
|
/**
|
|
165
192
|
* Consent Approval Request Schema
|