@kya-os/contracts 1.5.2 → 1.5.3-canary.10
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/agentshield-api/admin-schemas.d.ts +49 -0
- package/dist/agentshield-api/admin-schemas.js +30 -0
- package/dist/agentshield-api/admin-types.d.ts +37 -0
- package/dist/agentshield-api/admin-types.js +10 -0
- package/dist/agentshield-api/index.d.ts +7 -5
- package/dist/agentshield-api/index.js +4 -1
- package/dist/agentshield-api/schemas.d.ts +204 -76
- package/dist/agentshield-api/schemas.js +31 -3
- package/dist/agentshield-api/types.d.ts +30 -3
- package/dist/consent/schemas.d.ts +66 -63
- package/dist/consent/schemas.js +100 -64
- package/package.json +1 -1
|
@@ -48,6 +48,32 @@ const toolCallContextSchema = zod_1.z.object({
|
|
|
48
48
|
scopeId: zod_1.z.string().min(1, "scopeId is required to link context to proof"),
|
|
49
49
|
userIdentifier: zod_1.z.string().optional(),
|
|
50
50
|
});
|
|
51
|
+
/**
|
|
52
|
+
* Consent Event Context Schema
|
|
53
|
+
* Represents consent-related events for audit tracking
|
|
54
|
+
*/
|
|
55
|
+
const consentEventContextSchema = zod_1.z.object({
|
|
56
|
+
eventType: zod_1.z.enum([
|
|
57
|
+
"consent:page_viewed",
|
|
58
|
+
"consent:approved",
|
|
59
|
+
"consent:delegation_created",
|
|
60
|
+
"consent:credential_required"
|
|
61
|
+
]),
|
|
62
|
+
timestamp: zod_1.z.number().int().positive(),
|
|
63
|
+
sessionId: zod_1.z.string().min(1),
|
|
64
|
+
userDid: zod_1.z.string().optional(),
|
|
65
|
+
agentDid: zod_1.z.string().min(1),
|
|
66
|
+
targetTools: zod_1.z.array(zod_1.z.string()).min(1), // ALWAYS array
|
|
67
|
+
scopes: zod_1.z.array(zod_1.z.string()).min(0),
|
|
68
|
+
delegationId: zod_1.z.string().uuid().optional(),
|
|
69
|
+
projectId: zod_1.z.string().uuid(),
|
|
70
|
+
termsAccepted: zod_1.z.boolean().optional(),
|
|
71
|
+
credentialStatus: zod_1.z.enum(["present", "required", "obtained"]).optional(),
|
|
72
|
+
oauthIdentity: zod_1.z.object({
|
|
73
|
+
provider: zod_1.z.string(),
|
|
74
|
+
identifier: zod_1.z.string(),
|
|
75
|
+
}).optional(),
|
|
76
|
+
});
|
|
51
77
|
/**
|
|
52
78
|
* Proof submission request schema
|
|
53
79
|
*/
|
|
@@ -59,6 +85,7 @@ exports.proofSubmissionRequestSchema = zod_1.z.object({
|
|
|
59
85
|
context: zod_1.z
|
|
60
86
|
.object({
|
|
61
87
|
toolCalls: zod_1.z.array(toolCallContextSchema).optional(),
|
|
88
|
+
consentEvents: zod_1.z.array(consentEventContextSchema).optional(), // NEW: Consent events for audit tracking
|
|
62
89
|
mcpServerUrl: zod_1.z.string().url().optional(), // MCP server URL for tool discovery
|
|
63
90
|
})
|
|
64
91
|
.optional(),
|
|
@@ -172,7 +199,7 @@ exports.toolProtectionConfigAPIResponseSchema = (0, exports.agentShieldAPIRespon
|
|
|
172
199
|
* Create delegation request schema
|
|
173
200
|
*
|
|
174
201
|
* Note: AgentShield API accepts a simplified format, not the full DelegationRecord.
|
|
175
|
-
* The API accepts: agent_did, scopes, expires_in_days, expires_at, session_id, project_id, custom_fields
|
|
202
|
+
* The API accepts: agent_did, scopes, expires_in_days, expires_at, session_id, project_id, user_identifier, custom_fields
|
|
176
203
|
*
|
|
177
204
|
* IMPORTANT: expires_in_days and expires_at are mutually exclusive - use one or the other, not both.
|
|
178
205
|
*/
|
|
@@ -184,6 +211,7 @@ exports.createDelegationRequestSchema = zod_1.z
|
|
|
184
211
|
expires_at: zod_1.z.string().datetime().optional(),
|
|
185
212
|
session_id: zod_1.z.string().optional(),
|
|
186
213
|
project_id: zod_1.z.string().uuid().optional(),
|
|
214
|
+
user_identifier: zod_1.z.string().max(200).optional(), // Matches AgentShield's max(200)
|
|
187
215
|
custom_fields: zod_1.z.record(zod_1.z.unknown()).optional(),
|
|
188
216
|
})
|
|
189
217
|
.passthrough()
|
|
@@ -211,9 +239,9 @@ exports.createDelegationResponseSchema = zod_1.z.object({
|
|
|
211
239
|
user_id: zod_1.z.string().optional(),
|
|
212
240
|
user_identifier: zod_1.z.string().optional(),
|
|
213
241
|
scopes: zod_1.z.array(zod_1.z.string()),
|
|
214
|
-
status: zod_1.z.
|
|
242
|
+
status: zod_1.z.enum(['active', 'expired', 'revoked']), // Matches AgentShield's actual API behavior
|
|
215
243
|
issued_at: zod_1.z.string().datetime(),
|
|
216
|
-
expires_at: zod_1.z.string().datetime().optional(),
|
|
244
|
+
expires_at: zod_1.z.string().datetime().nullable().optional(), // AgentShield allows null values
|
|
217
245
|
created_at: zod_1.z.string().datetime(),
|
|
218
246
|
});
|
|
219
247
|
/**
|
|
@@ -41,6 +41,30 @@ export interface ToolCallContext {
|
|
|
41
41
|
scopeId: string;
|
|
42
42
|
userIdentifier?: string;
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Consent Event Context
|
|
46
|
+
*
|
|
47
|
+
* Represents consent-related events that occur during the consent flow.
|
|
48
|
+
* These events are logged separately from tool executions and allow
|
|
49
|
+
* multiple events per session (unlike regular audit logs).
|
|
50
|
+
*/
|
|
51
|
+
export interface ConsentEventContext {
|
|
52
|
+
eventType: "consent:page_viewed" | "consent:approved" | "consent:delegation_created" | "consent:credential_required";
|
|
53
|
+
timestamp: number;
|
|
54
|
+
sessionId: string;
|
|
55
|
+
userDid?: string;
|
|
56
|
+
agentDid: string;
|
|
57
|
+
targetTools: string[];
|
|
58
|
+
scopes: string[];
|
|
59
|
+
delegationId?: string;
|
|
60
|
+
projectId: string;
|
|
61
|
+
termsAccepted?: boolean;
|
|
62
|
+
credentialStatus?: "present" | "required" | "obtained";
|
|
63
|
+
oauthIdentity?: {
|
|
64
|
+
provider: string;
|
|
65
|
+
identifier: string;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
44
68
|
/**
|
|
45
69
|
* Request body for proof submission endpoint
|
|
46
70
|
* POST /api/v1/bouncer/proofs
|
|
@@ -55,6 +79,7 @@ export interface ProofSubmissionRequest {
|
|
|
55
79
|
/** AgentShield extension: Optional context for dashboard enrichment */
|
|
56
80
|
context?: {
|
|
57
81
|
toolCalls?: ToolCallContext[];
|
|
82
|
+
consentEvents?: ConsentEventContext[];
|
|
58
83
|
mcpServerUrl?: string;
|
|
59
84
|
};
|
|
60
85
|
}
|
|
@@ -163,7 +188,7 @@ export type ToolProtectionConfigAPIResponse = AgentShieldAPIResponse<ToolProtect
|
|
|
163
188
|
* POST /api/v1/bouncer/delegations
|
|
164
189
|
*
|
|
165
190
|
* Note: AgentShield API accepts a simplified format, not the full DelegationRecord.
|
|
166
|
-
* The API accepts: agent_did, scopes, expires_in_days, expires_at, session_id, project_id, custom_fields
|
|
191
|
+
* The API accepts: agent_did, scopes, expires_in_days, expires_at, session_id, project_id, user_identifier, custom_fields
|
|
167
192
|
*
|
|
168
193
|
* IMPORTANT: expires_in_days and expires_at are mutually exclusive - use one or the other, not both.
|
|
169
194
|
*/
|
|
@@ -176,6 +201,8 @@ export interface CreateDelegationRequest {
|
|
|
176
201
|
expires_at?: string;
|
|
177
202
|
session_id?: string;
|
|
178
203
|
project_id?: string;
|
|
204
|
+
/** User identifier string, max 200 chars, optional */
|
|
205
|
+
user_identifier?: string;
|
|
179
206
|
custom_fields?: Record<string, unknown>;
|
|
180
207
|
}
|
|
181
208
|
/**
|
|
@@ -193,9 +220,9 @@ export interface CreateDelegationResponse {
|
|
|
193
220
|
user_id?: string;
|
|
194
221
|
user_identifier?: string;
|
|
195
222
|
scopes: string[];
|
|
196
|
-
status: "active";
|
|
223
|
+
status: "active" | "expired" | "revoked";
|
|
197
224
|
issued_at: string;
|
|
198
|
-
expires_at?: string;
|
|
225
|
+
expires_at?: string | null;
|
|
199
226
|
created_at: string;
|
|
200
227
|
}
|
|
201
228
|
/**
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Related Spec: MCP-I Phase 0 Implementation Plan
|
|
8
8
|
*/
|
|
9
|
-
import { z } from
|
|
9
|
+
import { z } from "zod";
|
|
10
10
|
/**
|
|
11
11
|
* Consent Branding Schema
|
|
12
12
|
*/
|
|
@@ -37,13 +37,13 @@ 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
|
-
}, {
|
|
44
|
-
version?: string | undefined;
|
|
45
41
|
url?: string | undefined;
|
|
42
|
+
version?: string | undefined;
|
|
43
|
+
}, {
|
|
46
44
|
text?: string | undefined;
|
|
45
|
+
url?: string | undefined;
|
|
46
|
+
version?: string | undefined;
|
|
47
47
|
required?: boolean | undefined;
|
|
48
48
|
}>;
|
|
49
49
|
export type ConsentTerms = z.infer<typeof consentTermsSchema>;
|
|
@@ -81,10 +81,10 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
81
81
|
}>, "many">>;
|
|
82
82
|
pattern: z.ZodOptional<z.ZodString>;
|
|
83
83
|
}, "strip", z.ZodTypeAny, {
|
|
84
|
-
name: string;
|
|
85
84
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
86
85
|
required: boolean;
|
|
87
86
|
label: string;
|
|
87
|
+
name: string;
|
|
88
88
|
options?: {
|
|
89
89
|
value: string;
|
|
90
90
|
label: string;
|
|
@@ -92,10 +92,10 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
92
92
|
placeholder?: string | undefined;
|
|
93
93
|
pattern?: string | undefined;
|
|
94
94
|
}, {
|
|
95
|
-
name: string;
|
|
96
95
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
97
96
|
required: boolean;
|
|
98
97
|
label: string;
|
|
98
|
+
name: string;
|
|
99
99
|
options?: {
|
|
100
100
|
value: string;
|
|
101
101
|
label: string;
|
|
@@ -103,10 +103,10 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
103
103
|
placeholder?: string | undefined;
|
|
104
104
|
pattern?: string | undefined;
|
|
105
105
|
}>, {
|
|
106
|
-
name: string;
|
|
107
106
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
108
107
|
required: boolean;
|
|
109
108
|
label: string;
|
|
109
|
+
name: string;
|
|
110
110
|
options?: {
|
|
111
111
|
value: string;
|
|
112
112
|
label: string;
|
|
@@ -114,10 +114,10 @@ export declare const consentCustomFieldSchema: z.ZodEffects<z.ZodObject<{
|
|
|
114
114
|
placeholder?: string | undefined;
|
|
115
115
|
pattern?: string | undefined;
|
|
116
116
|
}, {
|
|
117
|
-
name: string;
|
|
118
117
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
119
118
|
required: boolean;
|
|
120
119
|
label: string;
|
|
120
|
+
name: string;
|
|
121
121
|
options?: {
|
|
122
122
|
value: string;
|
|
123
123
|
label: string;
|
|
@@ -195,13 +195,13 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
195
195
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
196
196
|
}, "strip", z.ZodTypeAny, {
|
|
197
197
|
required: boolean;
|
|
198
|
-
version?: string | undefined;
|
|
199
|
-
url?: string | undefined;
|
|
200
198
|
text?: string | undefined;
|
|
201
|
-
}, {
|
|
202
|
-
version?: string | undefined;
|
|
203
199
|
url?: string | undefined;
|
|
200
|
+
version?: string | undefined;
|
|
201
|
+
}, {
|
|
204
202
|
text?: string | undefined;
|
|
203
|
+
url?: string | undefined;
|
|
204
|
+
version?: string | undefined;
|
|
205
205
|
required?: boolean | undefined;
|
|
206
206
|
}>>;
|
|
207
207
|
customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
@@ -222,10 +222,10 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
222
222
|
}>, "many">>;
|
|
223
223
|
pattern: z.ZodOptional<z.ZodString>;
|
|
224
224
|
}, "strip", z.ZodTypeAny, {
|
|
225
|
-
name: string;
|
|
226
225
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
227
226
|
required: boolean;
|
|
228
227
|
label: string;
|
|
228
|
+
name: string;
|
|
229
229
|
options?: {
|
|
230
230
|
value: string;
|
|
231
231
|
label: string;
|
|
@@ -233,10 +233,10 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
233
233
|
placeholder?: string | undefined;
|
|
234
234
|
pattern?: string | undefined;
|
|
235
235
|
}, {
|
|
236
|
-
name: string;
|
|
237
236
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
238
237
|
required: boolean;
|
|
239
238
|
label: string;
|
|
239
|
+
name: string;
|
|
240
240
|
options?: {
|
|
241
241
|
value: string;
|
|
242
242
|
label: string;
|
|
@@ -244,10 +244,10 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
244
244
|
placeholder?: string | undefined;
|
|
245
245
|
pattern?: string | undefined;
|
|
246
246
|
}>, {
|
|
247
|
-
name: string;
|
|
248
247
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
249
248
|
required: boolean;
|
|
250
249
|
label: string;
|
|
250
|
+
name: string;
|
|
251
251
|
options?: {
|
|
252
252
|
value: string;
|
|
253
253
|
label: string;
|
|
@@ -255,10 +255,10 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
255
255
|
placeholder?: string | undefined;
|
|
256
256
|
pattern?: string | undefined;
|
|
257
257
|
}, {
|
|
258
|
-
name: string;
|
|
259
258
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
260
259
|
required: boolean;
|
|
261
260
|
label: string;
|
|
261
|
+
name: string;
|
|
262
262
|
options?: {
|
|
263
263
|
value: string;
|
|
264
264
|
label: string;
|
|
@@ -269,11 +269,11 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
269
269
|
serverUrl: z.ZodString;
|
|
270
270
|
autoClose: z.ZodOptional<z.ZodBoolean>;
|
|
271
271
|
}, "strip", z.ZodTypeAny, {
|
|
272
|
-
agentDid: string;
|
|
273
|
-
sessionId: string;
|
|
274
272
|
tool: string;
|
|
275
273
|
toolDescription: string;
|
|
276
274
|
scopes: string[];
|
|
275
|
+
agentDid: string;
|
|
276
|
+
sessionId: string;
|
|
277
277
|
projectId: string;
|
|
278
278
|
serverUrl: string;
|
|
279
279
|
branding?: {
|
|
@@ -284,15 +284,15 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
284
284
|
} | undefined;
|
|
285
285
|
terms?: {
|
|
286
286
|
required: boolean;
|
|
287
|
-
version?: string | undefined;
|
|
288
|
-
url?: string | undefined;
|
|
289
287
|
text?: string | undefined;
|
|
288
|
+
url?: string | undefined;
|
|
289
|
+
version?: string | undefined;
|
|
290
290
|
} | undefined;
|
|
291
291
|
customFields?: {
|
|
292
|
-
name: string;
|
|
293
292
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
294
293
|
required: boolean;
|
|
295
294
|
label: string;
|
|
295
|
+
name: string;
|
|
296
296
|
options?: {
|
|
297
297
|
value: string;
|
|
298
298
|
label: string;
|
|
@@ -302,11 +302,11 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
302
302
|
}[] | undefined;
|
|
303
303
|
autoClose?: boolean | undefined;
|
|
304
304
|
}, {
|
|
305
|
-
agentDid: string;
|
|
306
|
-
sessionId: string;
|
|
307
305
|
tool: string;
|
|
308
306
|
toolDescription: string;
|
|
309
307
|
scopes: string[];
|
|
308
|
+
agentDid: string;
|
|
309
|
+
sessionId: string;
|
|
310
310
|
projectId: string;
|
|
311
311
|
serverUrl: string;
|
|
312
312
|
branding?: {
|
|
@@ -316,16 +316,16 @@ export declare const consentPageConfigSchema: z.ZodObject<{
|
|
|
316
316
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
317
317
|
} | undefined;
|
|
318
318
|
terms?: {
|
|
319
|
-
version?: string | undefined;
|
|
320
|
-
url?: string | undefined;
|
|
321
319
|
text?: string | undefined;
|
|
320
|
+
url?: string | undefined;
|
|
321
|
+
version?: string | undefined;
|
|
322
322
|
required?: boolean | undefined;
|
|
323
323
|
} | undefined;
|
|
324
324
|
customFields?: {
|
|
325
|
-
name: string;
|
|
326
325
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
327
326
|
required: boolean;
|
|
328
327
|
label: string;
|
|
328
|
+
name: string;
|
|
329
329
|
options?: {
|
|
330
330
|
value: string;
|
|
331
331
|
label: string;
|
|
@@ -357,8 +357,11 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
357
357
|
/**
|
|
358
358
|
* OAuth provider identity information (optional)
|
|
359
359
|
* Used to link OAuth accounts to persistent User DIDs
|
|
360
|
+
*
|
|
361
|
+
* CRITICAL: Uses .nullish() to accept null, undefined, or OAuthIdentity
|
|
362
|
+
* This matches JSON parsing behavior where missing fields become null
|
|
360
363
|
*/
|
|
361
|
-
oauth_identity: z.ZodOptional<z.ZodObject<{
|
|
364
|
+
oauth_identity: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
362
365
|
/**
|
|
363
366
|
* OAuth provider name (e.g., "google", "github", "microsoft")
|
|
364
367
|
*/
|
|
@@ -386,7 +389,7 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
386
389
|
subject: string;
|
|
387
390
|
name?: string | undefined;
|
|
388
391
|
email?: string | undefined;
|
|
389
|
-
}
|
|
392
|
+
}>>>;
|
|
390
393
|
/**
|
|
391
394
|
* User DID (optional)
|
|
392
395
|
* If provided, represents the persistent User DID for this user
|
|
@@ -407,7 +410,7 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
407
410
|
subject: string;
|
|
408
411
|
name?: string | undefined;
|
|
409
412
|
email?: string | undefined;
|
|
410
|
-
} | undefined;
|
|
413
|
+
} | null | undefined;
|
|
411
414
|
user_did?: string | undefined;
|
|
412
415
|
}, {
|
|
413
416
|
tool: string;
|
|
@@ -423,7 +426,7 @@ export declare const consentApprovalRequestSchema: z.ZodObject<{
|
|
|
423
426
|
subject: string;
|
|
424
427
|
name?: string | undefined;
|
|
425
428
|
email?: string | undefined;
|
|
426
|
-
} | undefined;
|
|
429
|
+
} | null | undefined;
|
|
427
430
|
user_did?: string | undefined;
|
|
428
431
|
}>;
|
|
429
432
|
export type ConsentApprovalRequest = z.infer<typeof consentApprovalRequestSchema>;
|
|
@@ -489,13 +492,13 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
489
492
|
required: z.ZodDefault<z.ZodBoolean>;
|
|
490
493
|
}, "strip", z.ZodTypeAny, {
|
|
491
494
|
required: boolean;
|
|
492
|
-
version?: string | undefined;
|
|
493
|
-
url?: string | undefined;
|
|
494
495
|
text?: string | undefined;
|
|
495
|
-
}, {
|
|
496
|
-
version?: string | undefined;
|
|
497
496
|
url?: string | undefined;
|
|
497
|
+
version?: string | undefined;
|
|
498
|
+
}, {
|
|
498
499
|
text?: string | undefined;
|
|
500
|
+
url?: string | undefined;
|
|
501
|
+
version?: string | undefined;
|
|
499
502
|
required?: boolean | undefined;
|
|
500
503
|
}>>;
|
|
501
504
|
customFields: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
@@ -516,10 +519,10 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
516
519
|
}>, "many">>;
|
|
517
520
|
pattern: z.ZodOptional<z.ZodString>;
|
|
518
521
|
}, "strip", z.ZodTypeAny, {
|
|
519
|
-
name: string;
|
|
520
522
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
521
523
|
required: boolean;
|
|
522
524
|
label: string;
|
|
525
|
+
name: string;
|
|
523
526
|
options?: {
|
|
524
527
|
value: string;
|
|
525
528
|
label: string;
|
|
@@ -527,10 +530,10 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
527
530
|
placeholder?: string | undefined;
|
|
528
531
|
pattern?: string | undefined;
|
|
529
532
|
}, {
|
|
530
|
-
name: string;
|
|
531
533
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
532
534
|
required: boolean;
|
|
533
535
|
label: string;
|
|
536
|
+
name: string;
|
|
534
537
|
options?: {
|
|
535
538
|
value: string;
|
|
536
539
|
label: string;
|
|
@@ -538,10 +541,10 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
538
541
|
placeholder?: string | undefined;
|
|
539
542
|
pattern?: string | undefined;
|
|
540
543
|
}>, {
|
|
541
|
-
name: string;
|
|
542
544
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
543
545
|
required: boolean;
|
|
544
546
|
label: string;
|
|
547
|
+
name: string;
|
|
545
548
|
options?: {
|
|
546
549
|
value: string;
|
|
547
550
|
label: string;
|
|
@@ -549,10 +552,10 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
549
552
|
placeholder?: string | undefined;
|
|
550
553
|
pattern?: string | undefined;
|
|
551
554
|
}, {
|
|
552
|
-
name: string;
|
|
553
555
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
554
556
|
required: boolean;
|
|
555
557
|
label: string;
|
|
558
|
+
name: string;
|
|
556
559
|
options?: {
|
|
557
560
|
value: string;
|
|
558
561
|
label: string;
|
|
@@ -585,15 +588,15 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
585
588
|
} | undefined;
|
|
586
589
|
terms?: {
|
|
587
590
|
required: boolean;
|
|
588
|
-
version?: string | undefined;
|
|
589
|
-
url?: string | undefined;
|
|
590
591
|
text?: string | undefined;
|
|
592
|
+
url?: string | undefined;
|
|
593
|
+
version?: string | undefined;
|
|
591
594
|
} | undefined;
|
|
592
595
|
customFields?: {
|
|
593
|
-
name: string;
|
|
594
596
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
595
597
|
required: boolean;
|
|
596
598
|
label: string;
|
|
599
|
+
name: string;
|
|
597
600
|
options?: {
|
|
598
601
|
value: string;
|
|
599
602
|
label: string;
|
|
@@ -615,16 +618,16 @@ export declare const consentConfigSchema: z.ZodObject<{
|
|
|
615
618
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
616
619
|
} | undefined;
|
|
617
620
|
terms?: {
|
|
618
|
-
version?: string | undefined;
|
|
619
|
-
url?: string | undefined;
|
|
620
621
|
text?: string | undefined;
|
|
622
|
+
url?: string | undefined;
|
|
623
|
+
version?: string | undefined;
|
|
621
624
|
required?: boolean | undefined;
|
|
622
625
|
} | undefined;
|
|
623
626
|
customFields?: {
|
|
624
|
-
name: string;
|
|
625
627
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
626
628
|
required: boolean;
|
|
627
629
|
label: string;
|
|
630
|
+
name: string;
|
|
628
631
|
options?: {
|
|
629
632
|
value: string;
|
|
630
633
|
label: string;
|
|
@@ -650,11 +653,11 @@ export type ConsentConfig = z.infer<typeof consentConfigSchema>;
|
|
|
650
653
|
* @returns Validation result
|
|
651
654
|
*/
|
|
652
655
|
export declare function validateConsentPageConfig(config: unknown): z.SafeParseReturnType<{
|
|
653
|
-
agentDid: string;
|
|
654
|
-
sessionId: string;
|
|
655
656
|
tool: string;
|
|
656
657
|
toolDescription: string;
|
|
657
658
|
scopes: string[];
|
|
659
|
+
agentDid: string;
|
|
660
|
+
sessionId: string;
|
|
658
661
|
projectId: string;
|
|
659
662
|
serverUrl: string;
|
|
660
663
|
branding?: {
|
|
@@ -664,16 +667,16 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
664
667
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
665
668
|
} | undefined;
|
|
666
669
|
terms?: {
|
|
667
|
-
version?: string | undefined;
|
|
668
|
-
url?: string | undefined;
|
|
669
670
|
text?: string | undefined;
|
|
671
|
+
url?: string | undefined;
|
|
672
|
+
version?: string | undefined;
|
|
670
673
|
required?: boolean | undefined;
|
|
671
674
|
} | undefined;
|
|
672
675
|
customFields?: {
|
|
673
|
-
name: string;
|
|
674
676
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
675
677
|
required: boolean;
|
|
676
678
|
label: string;
|
|
679
|
+
name: string;
|
|
677
680
|
options?: {
|
|
678
681
|
value: string;
|
|
679
682
|
label: string;
|
|
@@ -683,11 +686,11 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
683
686
|
}[] | undefined;
|
|
684
687
|
autoClose?: boolean | undefined;
|
|
685
688
|
}, {
|
|
686
|
-
agentDid: string;
|
|
687
|
-
sessionId: string;
|
|
688
689
|
tool: string;
|
|
689
690
|
toolDescription: string;
|
|
690
691
|
scopes: string[];
|
|
692
|
+
agentDid: string;
|
|
693
|
+
sessionId: string;
|
|
691
694
|
projectId: string;
|
|
692
695
|
serverUrl: string;
|
|
693
696
|
branding?: {
|
|
@@ -698,15 +701,15 @@ export declare function validateConsentPageConfig(config: unknown): z.SafeParseR
|
|
|
698
701
|
} | undefined;
|
|
699
702
|
terms?: {
|
|
700
703
|
required: boolean;
|
|
701
|
-
version?: string | undefined;
|
|
702
|
-
url?: string | undefined;
|
|
703
704
|
text?: string | undefined;
|
|
705
|
+
url?: string | undefined;
|
|
706
|
+
version?: string | undefined;
|
|
704
707
|
} | undefined;
|
|
705
708
|
customFields?: {
|
|
706
|
-
name: string;
|
|
707
709
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
708
710
|
required: boolean;
|
|
709
711
|
label: string;
|
|
712
|
+
name: string;
|
|
710
713
|
options?: {
|
|
711
714
|
value: string;
|
|
712
715
|
label: string;
|
|
@@ -736,7 +739,7 @@ export declare function validateConsentApprovalRequest(request: unknown): z.Safe
|
|
|
736
739
|
subject: string;
|
|
737
740
|
name?: string | undefined;
|
|
738
741
|
email?: string | undefined;
|
|
739
|
-
} | undefined;
|
|
742
|
+
} | null | undefined;
|
|
740
743
|
user_did?: string | undefined;
|
|
741
744
|
}, {
|
|
742
745
|
tool: string;
|
|
@@ -752,7 +755,7 @@ export declare function validateConsentApprovalRequest(request: unknown): z.Safe
|
|
|
752
755
|
subject: string;
|
|
753
756
|
name?: string | undefined;
|
|
754
757
|
email?: string | undefined;
|
|
755
|
-
} | undefined;
|
|
758
|
+
} | null | undefined;
|
|
756
759
|
user_did?: string | undefined;
|
|
757
760
|
}>;
|
|
758
761
|
/**
|
|
@@ -788,16 +791,16 @@ export declare function validateConsentConfig(config: unknown): z.SafeParseRetur
|
|
|
788
791
|
theme?: "light" | "dark" | "auto" | undefined;
|
|
789
792
|
} | undefined;
|
|
790
793
|
terms?: {
|
|
791
|
-
version?: string | undefined;
|
|
792
|
-
url?: string | undefined;
|
|
793
794
|
text?: string | undefined;
|
|
795
|
+
url?: string | undefined;
|
|
796
|
+
version?: string | undefined;
|
|
794
797
|
required?: boolean | undefined;
|
|
795
798
|
} | undefined;
|
|
796
799
|
customFields?: {
|
|
797
|
-
name: string;
|
|
798
800
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
799
801
|
required: boolean;
|
|
800
802
|
label: string;
|
|
803
|
+
name: string;
|
|
801
804
|
options?: {
|
|
802
805
|
value: string;
|
|
803
806
|
label: string;
|
|
@@ -820,15 +823,15 @@ export declare function validateConsentConfig(config: unknown): z.SafeParseRetur
|
|
|
820
823
|
} | undefined;
|
|
821
824
|
terms?: {
|
|
822
825
|
required: boolean;
|
|
823
|
-
version?: string | undefined;
|
|
824
|
-
url?: string | undefined;
|
|
825
826
|
text?: string | undefined;
|
|
827
|
+
url?: string | undefined;
|
|
828
|
+
version?: string | undefined;
|
|
826
829
|
} | undefined;
|
|
827
830
|
customFields?: {
|
|
828
|
-
name: string;
|
|
829
831
|
type: "text" | "textarea" | "checkbox" | "select";
|
|
830
832
|
required: boolean;
|
|
831
833
|
label: string;
|
|
834
|
+
name: string;
|
|
832
835
|
options?: {
|
|
833
836
|
value: string;
|
|
834
837
|
label: string;
|