@kya-os/provider-registry 0.1.0

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.
@@ -0,0 +1,780 @@
1
+ /**
2
+ * Provider Registry Zod Schemas
3
+ *
4
+ * Runtime validation schemas for provider definitions and configuration.
5
+ */
6
+ import { z } from 'zod';
7
+ import type { ProviderDefinition, ProviderConfig } from './types';
8
+ /**
9
+ * Zod schema for OAuth provider configuration
10
+ */
11
+ export declare const OAuthProviderConfigSchema: z.ZodObject<{
12
+ authorizationEndpoint: z.ZodString;
13
+ tokenEndpoint: z.ZodString;
14
+ userInfoEndpoint: z.ZodOptional<z.ZodString>;
15
+ defaultScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
16
+ supportsPKCE: z.ZodOptional<z.ZodBoolean>;
17
+ requiresClientSecret: z.ZodOptional<z.ZodBoolean>;
18
+ tokenEndpointAuthMethod: z.ZodOptional<z.ZodEnum<["client_secret_post", "client_secret_basic"]>>;
19
+ responseType: z.ZodOptional<z.ZodString>;
20
+ grantType: z.ZodOptional<z.ZodString>;
21
+ customParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
22
+ authUrlTemplate: z.ZodOptional<z.ZodString>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ authorizationEndpoint: string;
25
+ tokenEndpoint: string;
26
+ userInfoEndpoint?: string | undefined;
27
+ defaultScopes?: string[] | undefined;
28
+ supportsPKCE?: boolean | undefined;
29
+ requiresClientSecret?: boolean | undefined;
30
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
31
+ responseType?: string | undefined;
32
+ grantType?: string | undefined;
33
+ customParams?: Record<string, string> | undefined;
34
+ authUrlTemplate?: string | undefined;
35
+ }, {
36
+ authorizationEndpoint: string;
37
+ tokenEndpoint: string;
38
+ userInfoEndpoint?: string | undefined;
39
+ defaultScopes?: string[] | undefined;
40
+ supportsPKCE?: boolean | undefined;
41
+ requiresClientSecret?: boolean | undefined;
42
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
43
+ responseType?: string | undefined;
44
+ grantType?: string | undefined;
45
+ customParams?: Record<string, string> | undefined;
46
+ authUrlTemplate?: string | undefined;
47
+ }>;
48
+ /**
49
+ * Zod schema for credential provider configuration
50
+ */
51
+ export declare const CredentialProviderConfigSchema: z.ZodObject<{
52
+ authEndpoint: z.ZodString;
53
+ httpMethod: z.ZodOptional<z.ZodEnum<["POST", "PUT"]>>;
54
+ contentType: z.ZodOptional<z.ZodEnum<["application/json", "application/x-www-form-urlencoded"]>>;
55
+ requestBodyTemplate: z.ZodOptional<z.ZodObject<{
56
+ identityField: z.ZodOptional<z.ZodString>;
57
+ passwordField: z.ZodOptional<z.ZodString>;
58
+ additionalFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ identityField?: string | undefined;
61
+ passwordField?: string | undefined;
62
+ additionalFields?: Record<string, string> | undefined;
63
+ }, {
64
+ identityField?: string | undefined;
65
+ passwordField?: string | undefined;
66
+ additionalFields?: Record<string, string> | undefined;
67
+ }>>;
68
+ responseFields: z.ZodOptional<z.ZodObject<{
69
+ sessionTokenPath: z.ZodOptional<z.ZodString>;
70
+ userIdPath: z.ZodOptional<z.ZodString>;
71
+ userEmailPath: z.ZodOptional<z.ZodString>;
72
+ userDisplayNamePath: z.ZodOptional<z.ZodString>;
73
+ expiresInPath: z.ZodOptional<z.ZodString>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ sessionTokenPath?: string | undefined;
76
+ userIdPath?: string | undefined;
77
+ userEmailPath?: string | undefined;
78
+ userDisplayNamePath?: string | undefined;
79
+ expiresInPath?: string | undefined;
80
+ }, {
81
+ sessionTokenPath?: string | undefined;
82
+ userIdPath?: string | undefined;
83
+ userEmailPath?: string | undefined;
84
+ userDisplayNamePath?: string | undefined;
85
+ expiresInPath?: string | undefined;
86
+ }>>;
87
+ successCheck: z.ZodOptional<z.ZodObject<{
88
+ path: z.ZodOptional<z.ZodString>;
89
+ expectedValue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ path?: string | undefined;
92
+ expectedValue?: string | boolean | undefined;
93
+ }, {
94
+ path?: string | undefined;
95
+ expectedValue?: string | boolean | undefined;
96
+ }>>;
97
+ useCookieSession: z.ZodOptional<z.ZodBoolean>;
98
+ cookieNames: z.ZodOptional<z.ZodString>;
99
+ customHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
100
+ requiresCsrf: z.ZodOptional<z.ZodBoolean>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ authEndpoint: string;
103
+ httpMethod?: "POST" | "PUT" | undefined;
104
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
105
+ requestBodyTemplate?: {
106
+ identityField?: string | undefined;
107
+ passwordField?: string | undefined;
108
+ additionalFields?: Record<string, string> | undefined;
109
+ } | undefined;
110
+ responseFields?: {
111
+ sessionTokenPath?: string | undefined;
112
+ userIdPath?: string | undefined;
113
+ userEmailPath?: string | undefined;
114
+ userDisplayNamePath?: string | undefined;
115
+ expiresInPath?: string | undefined;
116
+ } | undefined;
117
+ successCheck?: {
118
+ path?: string | undefined;
119
+ expectedValue?: string | boolean | undefined;
120
+ } | undefined;
121
+ useCookieSession?: boolean | undefined;
122
+ cookieNames?: string | undefined;
123
+ customHeaders?: Record<string, string> | undefined;
124
+ requiresCsrf?: boolean | undefined;
125
+ }, {
126
+ authEndpoint: string;
127
+ httpMethod?: "POST" | "PUT" | undefined;
128
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
129
+ requestBodyTemplate?: {
130
+ identityField?: string | undefined;
131
+ passwordField?: string | undefined;
132
+ additionalFields?: Record<string, string> | undefined;
133
+ } | undefined;
134
+ responseFields?: {
135
+ sessionTokenPath?: string | undefined;
136
+ userIdPath?: string | undefined;
137
+ userEmailPath?: string | undefined;
138
+ userDisplayNamePath?: string | undefined;
139
+ expiresInPath?: string | undefined;
140
+ } | undefined;
141
+ successCheck?: {
142
+ path?: string | undefined;
143
+ expectedValue?: string | boolean | undefined;
144
+ } | undefined;
145
+ useCookieSession?: boolean | undefined;
146
+ cookieNames?: string | undefined;
147
+ customHeaders?: Record<string, string> | undefined;
148
+ requiresCsrf?: boolean | undefined;
149
+ }>;
150
+ /**
151
+ * Zod schema for ProviderDefinition
152
+ */
153
+ export declare const ProviderDefinitionSchema: z.ZodObject<{
154
+ id: z.ZodString;
155
+ displayName: z.ZodOptional<z.ZodString>;
156
+ authType: z.ZodEnum<["oauth2", "password", "verifiable_credential", "passkey", "magic_link", "otp", "none"]>;
157
+ oauthProviderId: z.ZodOptional<z.ZodString>;
158
+ defaultScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
159
+ oauthConfig: z.ZodOptional<z.ZodObject<{
160
+ authorizationEndpoint: z.ZodString;
161
+ tokenEndpoint: z.ZodString;
162
+ userInfoEndpoint: z.ZodOptional<z.ZodString>;
163
+ defaultScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
164
+ supportsPKCE: z.ZodOptional<z.ZodBoolean>;
165
+ requiresClientSecret: z.ZodOptional<z.ZodBoolean>;
166
+ tokenEndpointAuthMethod: z.ZodOptional<z.ZodEnum<["client_secret_post", "client_secret_basic"]>>;
167
+ responseType: z.ZodOptional<z.ZodString>;
168
+ grantType: z.ZodOptional<z.ZodString>;
169
+ customParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
170
+ authUrlTemplate: z.ZodOptional<z.ZodString>;
171
+ }, "strip", z.ZodTypeAny, {
172
+ authorizationEndpoint: string;
173
+ tokenEndpoint: string;
174
+ userInfoEndpoint?: string | undefined;
175
+ defaultScopes?: string[] | undefined;
176
+ supportsPKCE?: boolean | undefined;
177
+ requiresClientSecret?: boolean | undefined;
178
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
179
+ responseType?: string | undefined;
180
+ grantType?: string | undefined;
181
+ customParams?: Record<string, string> | undefined;
182
+ authUrlTemplate?: string | undefined;
183
+ }, {
184
+ authorizationEndpoint: string;
185
+ tokenEndpoint: string;
186
+ userInfoEndpoint?: string | undefined;
187
+ defaultScopes?: string[] | undefined;
188
+ supportsPKCE?: boolean | undefined;
189
+ requiresClientSecret?: boolean | undefined;
190
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
191
+ responseType?: string | undefined;
192
+ grantType?: string | undefined;
193
+ customParams?: Record<string, string> | undefined;
194
+ authUrlTemplate?: string | undefined;
195
+ }>>;
196
+ credentialConfig: z.ZodOptional<z.ZodObject<{
197
+ authEndpoint: z.ZodString;
198
+ httpMethod: z.ZodOptional<z.ZodEnum<["POST", "PUT"]>>;
199
+ contentType: z.ZodOptional<z.ZodEnum<["application/json", "application/x-www-form-urlencoded"]>>;
200
+ requestBodyTemplate: z.ZodOptional<z.ZodObject<{
201
+ identityField: z.ZodOptional<z.ZodString>;
202
+ passwordField: z.ZodOptional<z.ZodString>;
203
+ additionalFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
204
+ }, "strip", z.ZodTypeAny, {
205
+ identityField?: string | undefined;
206
+ passwordField?: string | undefined;
207
+ additionalFields?: Record<string, string> | undefined;
208
+ }, {
209
+ identityField?: string | undefined;
210
+ passwordField?: string | undefined;
211
+ additionalFields?: Record<string, string> | undefined;
212
+ }>>;
213
+ responseFields: z.ZodOptional<z.ZodObject<{
214
+ sessionTokenPath: z.ZodOptional<z.ZodString>;
215
+ userIdPath: z.ZodOptional<z.ZodString>;
216
+ userEmailPath: z.ZodOptional<z.ZodString>;
217
+ userDisplayNamePath: z.ZodOptional<z.ZodString>;
218
+ expiresInPath: z.ZodOptional<z.ZodString>;
219
+ }, "strip", z.ZodTypeAny, {
220
+ sessionTokenPath?: string | undefined;
221
+ userIdPath?: string | undefined;
222
+ userEmailPath?: string | undefined;
223
+ userDisplayNamePath?: string | undefined;
224
+ expiresInPath?: string | undefined;
225
+ }, {
226
+ sessionTokenPath?: string | undefined;
227
+ userIdPath?: string | undefined;
228
+ userEmailPath?: string | undefined;
229
+ userDisplayNamePath?: string | undefined;
230
+ expiresInPath?: string | undefined;
231
+ }>>;
232
+ successCheck: z.ZodOptional<z.ZodObject<{
233
+ path: z.ZodOptional<z.ZodString>;
234
+ expectedValue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
235
+ }, "strip", z.ZodTypeAny, {
236
+ path?: string | undefined;
237
+ expectedValue?: string | boolean | undefined;
238
+ }, {
239
+ path?: string | undefined;
240
+ expectedValue?: string | boolean | undefined;
241
+ }>>;
242
+ useCookieSession: z.ZodOptional<z.ZodBoolean>;
243
+ cookieNames: z.ZodOptional<z.ZodString>;
244
+ customHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
245
+ requiresCsrf: z.ZodOptional<z.ZodBoolean>;
246
+ }, "strip", z.ZodTypeAny, {
247
+ authEndpoint: string;
248
+ httpMethod?: "POST" | "PUT" | undefined;
249
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
250
+ requestBodyTemplate?: {
251
+ identityField?: string | undefined;
252
+ passwordField?: string | undefined;
253
+ additionalFields?: Record<string, string> | undefined;
254
+ } | undefined;
255
+ responseFields?: {
256
+ sessionTokenPath?: string | undefined;
257
+ userIdPath?: string | undefined;
258
+ userEmailPath?: string | undefined;
259
+ userDisplayNamePath?: string | undefined;
260
+ expiresInPath?: string | undefined;
261
+ } | undefined;
262
+ successCheck?: {
263
+ path?: string | undefined;
264
+ expectedValue?: string | boolean | undefined;
265
+ } | undefined;
266
+ useCookieSession?: boolean | undefined;
267
+ cookieNames?: string | undefined;
268
+ customHeaders?: Record<string, string> | undefined;
269
+ requiresCsrf?: boolean | undefined;
270
+ }, {
271
+ authEndpoint: string;
272
+ httpMethod?: "POST" | "PUT" | undefined;
273
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
274
+ requestBodyTemplate?: {
275
+ identityField?: string | undefined;
276
+ passwordField?: string | undefined;
277
+ additionalFields?: Record<string, string> | undefined;
278
+ } | undefined;
279
+ responseFields?: {
280
+ sessionTokenPath?: string | undefined;
281
+ userIdPath?: string | undefined;
282
+ userEmailPath?: string | undefined;
283
+ userDisplayNamePath?: string | undefined;
284
+ expiresInPath?: string | undefined;
285
+ } | undefined;
286
+ successCheck?: {
287
+ path?: string | undefined;
288
+ expectedValue?: string | boolean | undefined;
289
+ } | undefined;
290
+ useCookieSession?: boolean | undefined;
291
+ cookieNames?: string | undefined;
292
+ customHeaders?: Record<string, string> | undefined;
293
+ requiresCsrf?: boolean | undefined;
294
+ }>>;
295
+ ui: z.ZodOptional<z.ZodObject<{
296
+ icon: z.ZodOptional<z.ZodString>;
297
+ description: z.ZodOptional<z.ZodString>;
298
+ }, "strip", z.ZodTypeAny, {
299
+ icon?: string | undefined;
300
+ description?: string | undefined;
301
+ }, {
302
+ icon?: string | undefined;
303
+ description?: string | undefined;
304
+ }>>;
305
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
306
+ }, "strip", z.ZodTypeAny, {
307
+ id: string;
308
+ authType: "oauth2" | "password" | "verifiable_credential" | "passkey" | "magic_link" | "otp" | "none";
309
+ defaultScopes?: string[] | undefined;
310
+ displayName?: string | undefined;
311
+ oauthProviderId?: string | undefined;
312
+ oauthConfig?: {
313
+ authorizationEndpoint: string;
314
+ tokenEndpoint: string;
315
+ userInfoEndpoint?: string | undefined;
316
+ defaultScopes?: string[] | undefined;
317
+ supportsPKCE?: boolean | undefined;
318
+ requiresClientSecret?: boolean | undefined;
319
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
320
+ responseType?: string | undefined;
321
+ grantType?: string | undefined;
322
+ customParams?: Record<string, string> | undefined;
323
+ authUrlTemplate?: string | undefined;
324
+ } | undefined;
325
+ credentialConfig?: {
326
+ authEndpoint: string;
327
+ httpMethod?: "POST" | "PUT" | undefined;
328
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
329
+ requestBodyTemplate?: {
330
+ identityField?: string | undefined;
331
+ passwordField?: string | undefined;
332
+ additionalFields?: Record<string, string> | undefined;
333
+ } | undefined;
334
+ responseFields?: {
335
+ sessionTokenPath?: string | undefined;
336
+ userIdPath?: string | undefined;
337
+ userEmailPath?: string | undefined;
338
+ userDisplayNamePath?: string | undefined;
339
+ expiresInPath?: string | undefined;
340
+ } | undefined;
341
+ successCheck?: {
342
+ path?: string | undefined;
343
+ expectedValue?: string | boolean | undefined;
344
+ } | undefined;
345
+ useCookieSession?: boolean | undefined;
346
+ cookieNames?: string | undefined;
347
+ customHeaders?: Record<string, string> | undefined;
348
+ requiresCsrf?: boolean | undefined;
349
+ } | undefined;
350
+ ui?: {
351
+ icon?: string | undefined;
352
+ description?: string | undefined;
353
+ } | undefined;
354
+ metadata?: Record<string, unknown> | undefined;
355
+ }, {
356
+ id: string;
357
+ authType: "oauth2" | "password" | "verifiable_credential" | "passkey" | "magic_link" | "otp" | "none";
358
+ defaultScopes?: string[] | undefined;
359
+ displayName?: string | undefined;
360
+ oauthProviderId?: string | undefined;
361
+ oauthConfig?: {
362
+ authorizationEndpoint: string;
363
+ tokenEndpoint: string;
364
+ userInfoEndpoint?: string | undefined;
365
+ defaultScopes?: string[] | undefined;
366
+ supportsPKCE?: boolean | undefined;
367
+ requiresClientSecret?: boolean | undefined;
368
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
369
+ responseType?: string | undefined;
370
+ grantType?: string | undefined;
371
+ customParams?: Record<string, string> | undefined;
372
+ authUrlTemplate?: string | undefined;
373
+ } | undefined;
374
+ credentialConfig?: {
375
+ authEndpoint: string;
376
+ httpMethod?: "POST" | "PUT" | undefined;
377
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
378
+ requestBodyTemplate?: {
379
+ identityField?: string | undefined;
380
+ passwordField?: string | undefined;
381
+ additionalFields?: Record<string, string> | undefined;
382
+ } | undefined;
383
+ responseFields?: {
384
+ sessionTokenPath?: string | undefined;
385
+ userIdPath?: string | undefined;
386
+ userEmailPath?: string | undefined;
387
+ userDisplayNamePath?: string | undefined;
388
+ expiresInPath?: string | undefined;
389
+ } | undefined;
390
+ successCheck?: {
391
+ path?: string | undefined;
392
+ expectedValue?: string | boolean | undefined;
393
+ } | undefined;
394
+ useCookieSession?: boolean | undefined;
395
+ cookieNames?: string | undefined;
396
+ customHeaders?: Record<string, string> | undefined;
397
+ requiresCsrf?: boolean | undefined;
398
+ } | undefined;
399
+ ui?: {
400
+ icon?: string | undefined;
401
+ description?: string | undefined;
402
+ } | undefined;
403
+ metadata?: Record<string, unknown> | undefined;
404
+ }>;
405
+ /**
406
+ * Zod schema for ProviderConfig (used for loadFromConfig)
407
+ */
408
+ export declare const ProviderConfigSchema: z.ZodObject<{
409
+ providers: z.ZodArray<z.ZodObject<{
410
+ id: z.ZodString;
411
+ displayName: z.ZodOptional<z.ZodString>;
412
+ authType: z.ZodEnum<["oauth2", "password", "verifiable_credential", "passkey", "magic_link", "otp", "none"]>;
413
+ oauthProviderId: z.ZodOptional<z.ZodString>;
414
+ defaultScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
415
+ oauthConfig: z.ZodOptional<z.ZodObject<{
416
+ authorizationEndpoint: z.ZodString;
417
+ tokenEndpoint: z.ZodString;
418
+ userInfoEndpoint: z.ZodOptional<z.ZodString>;
419
+ defaultScopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
420
+ supportsPKCE: z.ZodOptional<z.ZodBoolean>;
421
+ requiresClientSecret: z.ZodOptional<z.ZodBoolean>;
422
+ tokenEndpointAuthMethod: z.ZodOptional<z.ZodEnum<["client_secret_post", "client_secret_basic"]>>;
423
+ responseType: z.ZodOptional<z.ZodString>;
424
+ grantType: z.ZodOptional<z.ZodString>;
425
+ customParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
426
+ authUrlTemplate: z.ZodOptional<z.ZodString>;
427
+ }, "strip", z.ZodTypeAny, {
428
+ authorizationEndpoint: string;
429
+ tokenEndpoint: string;
430
+ userInfoEndpoint?: string | undefined;
431
+ defaultScopes?: string[] | undefined;
432
+ supportsPKCE?: boolean | undefined;
433
+ requiresClientSecret?: boolean | undefined;
434
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
435
+ responseType?: string | undefined;
436
+ grantType?: string | undefined;
437
+ customParams?: Record<string, string> | undefined;
438
+ authUrlTemplate?: string | undefined;
439
+ }, {
440
+ authorizationEndpoint: string;
441
+ tokenEndpoint: string;
442
+ userInfoEndpoint?: string | undefined;
443
+ defaultScopes?: string[] | undefined;
444
+ supportsPKCE?: boolean | undefined;
445
+ requiresClientSecret?: boolean | undefined;
446
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
447
+ responseType?: string | undefined;
448
+ grantType?: string | undefined;
449
+ customParams?: Record<string, string> | undefined;
450
+ authUrlTemplate?: string | undefined;
451
+ }>>;
452
+ credentialConfig: z.ZodOptional<z.ZodObject<{
453
+ authEndpoint: z.ZodString;
454
+ httpMethod: z.ZodOptional<z.ZodEnum<["POST", "PUT"]>>;
455
+ contentType: z.ZodOptional<z.ZodEnum<["application/json", "application/x-www-form-urlencoded"]>>;
456
+ requestBodyTemplate: z.ZodOptional<z.ZodObject<{
457
+ identityField: z.ZodOptional<z.ZodString>;
458
+ passwordField: z.ZodOptional<z.ZodString>;
459
+ additionalFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
460
+ }, "strip", z.ZodTypeAny, {
461
+ identityField?: string | undefined;
462
+ passwordField?: string | undefined;
463
+ additionalFields?: Record<string, string> | undefined;
464
+ }, {
465
+ identityField?: string | undefined;
466
+ passwordField?: string | undefined;
467
+ additionalFields?: Record<string, string> | undefined;
468
+ }>>;
469
+ responseFields: z.ZodOptional<z.ZodObject<{
470
+ sessionTokenPath: z.ZodOptional<z.ZodString>;
471
+ userIdPath: z.ZodOptional<z.ZodString>;
472
+ userEmailPath: z.ZodOptional<z.ZodString>;
473
+ userDisplayNamePath: z.ZodOptional<z.ZodString>;
474
+ expiresInPath: z.ZodOptional<z.ZodString>;
475
+ }, "strip", z.ZodTypeAny, {
476
+ sessionTokenPath?: string | undefined;
477
+ userIdPath?: string | undefined;
478
+ userEmailPath?: string | undefined;
479
+ userDisplayNamePath?: string | undefined;
480
+ expiresInPath?: string | undefined;
481
+ }, {
482
+ sessionTokenPath?: string | undefined;
483
+ userIdPath?: string | undefined;
484
+ userEmailPath?: string | undefined;
485
+ userDisplayNamePath?: string | undefined;
486
+ expiresInPath?: string | undefined;
487
+ }>>;
488
+ successCheck: z.ZodOptional<z.ZodObject<{
489
+ path: z.ZodOptional<z.ZodString>;
490
+ expectedValue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
491
+ }, "strip", z.ZodTypeAny, {
492
+ path?: string | undefined;
493
+ expectedValue?: string | boolean | undefined;
494
+ }, {
495
+ path?: string | undefined;
496
+ expectedValue?: string | boolean | undefined;
497
+ }>>;
498
+ useCookieSession: z.ZodOptional<z.ZodBoolean>;
499
+ cookieNames: z.ZodOptional<z.ZodString>;
500
+ customHeaders: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
501
+ requiresCsrf: z.ZodOptional<z.ZodBoolean>;
502
+ }, "strip", z.ZodTypeAny, {
503
+ authEndpoint: string;
504
+ httpMethod?: "POST" | "PUT" | undefined;
505
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
506
+ requestBodyTemplate?: {
507
+ identityField?: string | undefined;
508
+ passwordField?: string | undefined;
509
+ additionalFields?: Record<string, string> | undefined;
510
+ } | undefined;
511
+ responseFields?: {
512
+ sessionTokenPath?: string | undefined;
513
+ userIdPath?: string | undefined;
514
+ userEmailPath?: string | undefined;
515
+ userDisplayNamePath?: string | undefined;
516
+ expiresInPath?: string | undefined;
517
+ } | undefined;
518
+ successCheck?: {
519
+ path?: string | undefined;
520
+ expectedValue?: string | boolean | undefined;
521
+ } | undefined;
522
+ useCookieSession?: boolean | undefined;
523
+ cookieNames?: string | undefined;
524
+ customHeaders?: Record<string, string> | undefined;
525
+ requiresCsrf?: boolean | undefined;
526
+ }, {
527
+ authEndpoint: string;
528
+ httpMethod?: "POST" | "PUT" | undefined;
529
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
530
+ requestBodyTemplate?: {
531
+ identityField?: string | undefined;
532
+ passwordField?: string | undefined;
533
+ additionalFields?: Record<string, string> | undefined;
534
+ } | undefined;
535
+ responseFields?: {
536
+ sessionTokenPath?: string | undefined;
537
+ userIdPath?: string | undefined;
538
+ userEmailPath?: string | undefined;
539
+ userDisplayNamePath?: string | undefined;
540
+ expiresInPath?: string | undefined;
541
+ } | undefined;
542
+ successCheck?: {
543
+ path?: string | undefined;
544
+ expectedValue?: string | boolean | undefined;
545
+ } | undefined;
546
+ useCookieSession?: boolean | undefined;
547
+ cookieNames?: string | undefined;
548
+ customHeaders?: Record<string, string> | undefined;
549
+ requiresCsrf?: boolean | undefined;
550
+ }>>;
551
+ ui: z.ZodOptional<z.ZodObject<{
552
+ icon: z.ZodOptional<z.ZodString>;
553
+ description: z.ZodOptional<z.ZodString>;
554
+ }, "strip", z.ZodTypeAny, {
555
+ icon?: string | undefined;
556
+ description?: string | undefined;
557
+ }, {
558
+ icon?: string | undefined;
559
+ description?: string | undefined;
560
+ }>>;
561
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
562
+ }, "strip", z.ZodTypeAny, {
563
+ id: string;
564
+ authType: "oauth2" | "password" | "verifiable_credential" | "passkey" | "magic_link" | "otp" | "none";
565
+ defaultScopes?: string[] | undefined;
566
+ displayName?: string | undefined;
567
+ oauthProviderId?: string | undefined;
568
+ oauthConfig?: {
569
+ authorizationEndpoint: string;
570
+ tokenEndpoint: string;
571
+ userInfoEndpoint?: string | undefined;
572
+ defaultScopes?: string[] | undefined;
573
+ supportsPKCE?: boolean | undefined;
574
+ requiresClientSecret?: boolean | undefined;
575
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
576
+ responseType?: string | undefined;
577
+ grantType?: string | undefined;
578
+ customParams?: Record<string, string> | undefined;
579
+ authUrlTemplate?: string | undefined;
580
+ } | undefined;
581
+ credentialConfig?: {
582
+ authEndpoint: string;
583
+ httpMethod?: "POST" | "PUT" | undefined;
584
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
585
+ requestBodyTemplate?: {
586
+ identityField?: string | undefined;
587
+ passwordField?: string | undefined;
588
+ additionalFields?: Record<string, string> | undefined;
589
+ } | undefined;
590
+ responseFields?: {
591
+ sessionTokenPath?: string | undefined;
592
+ userIdPath?: string | undefined;
593
+ userEmailPath?: string | undefined;
594
+ userDisplayNamePath?: string | undefined;
595
+ expiresInPath?: string | undefined;
596
+ } | undefined;
597
+ successCheck?: {
598
+ path?: string | undefined;
599
+ expectedValue?: string | boolean | undefined;
600
+ } | undefined;
601
+ useCookieSession?: boolean | undefined;
602
+ cookieNames?: string | undefined;
603
+ customHeaders?: Record<string, string> | undefined;
604
+ requiresCsrf?: boolean | undefined;
605
+ } | undefined;
606
+ ui?: {
607
+ icon?: string | undefined;
608
+ description?: string | undefined;
609
+ } | undefined;
610
+ metadata?: Record<string, unknown> | undefined;
611
+ }, {
612
+ id: string;
613
+ authType: "oauth2" | "password" | "verifiable_credential" | "passkey" | "magic_link" | "otp" | "none";
614
+ defaultScopes?: string[] | undefined;
615
+ displayName?: string | undefined;
616
+ oauthProviderId?: string | undefined;
617
+ oauthConfig?: {
618
+ authorizationEndpoint: string;
619
+ tokenEndpoint: string;
620
+ userInfoEndpoint?: string | undefined;
621
+ defaultScopes?: string[] | undefined;
622
+ supportsPKCE?: boolean | undefined;
623
+ requiresClientSecret?: boolean | undefined;
624
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
625
+ responseType?: string | undefined;
626
+ grantType?: string | undefined;
627
+ customParams?: Record<string, string> | undefined;
628
+ authUrlTemplate?: string | undefined;
629
+ } | undefined;
630
+ credentialConfig?: {
631
+ authEndpoint: string;
632
+ httpMethod?: "POST" | "PUT" | undefined;
633
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
634
+ requestBodyTemplate?: {
635
+ identityField?: string | undefined;
636
+ passwordField?: string | undefined;
637
+ additionalFields?: Record<string, string> | undefined;
638
+ } | undefined;
639
+ responseFields?: {
640
+ sessionTokenPath?: string | undefined;
641
+ userIdPath?: string | undefined;
642
+ userEmailPath?: string | undefined;
643
+ userDisplayNamePath?: string | undefined;
644
+ expiresInPath?: string | undefined;
645
+ } | undefined;
646
+ successCheck?: {
647
+ path?: string | undefined;
648
+ expectedValue?: string | boolean | undefined;
649
+ } | undefined;
650
+ useCookieSession?: boolean | undefined;
651
+ cookieNames?: string | undefined;
652
+ customHeaders?: Record<string, string> | undefined;
653
+ requiresCsrf?: boolean | undefined;
654
+ } | undefined;
655
+ ui?: {
656
+ icon?: string | undefined;
657
+ description?: string | undefined;
658
+ } | undefined;
659
+ metadata?: Record<string, unknown> | undefined;
660
+ }>, "many">;
661
+ }, "strip", z.ZodTypeAny, {
662
+ providers: {
663
+ id: string;
664
+ authType: "oauth2" | "password" | "verifiable_credential" | "passkey" | "magic_link" | "otp" | "none";
665
+ defaultScopes?: string[] | undefined;
666
+ displayName?: string | undefined;
667
+ oauthProviderId?: string | undefined;
668
+ oauthConfig?: {
669
+ authorizationEndpoint: string;
670
+ tokenEndpoint: string;
671
+ userInfoEndpoint?: string | undefined;
672
+ defaultScopes?: string[] | undefined;
673
+ supportsPKCE?: boolean | undefined;
674
+ requiresClientSecret?: boolean | undefined;
675
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
676
+ responseType?: string | undefined;
677
+ grantType?: string | undefined;
678
+ customParams?: Record<string, string> | undefined;
679
+ authUrlTemplate?: string | undefined;
680
+ } | undefined;
681
+ credentialConfig?: {
682
+ authEndpoint: string;
683
+ httpMethod?: "POST" | "PUT" | undefined;
684
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
685
+ requestBodyTemplate?: {
686
+ identityField?: string | undefined;
687
+ passwordField?: string | undefined;
688
+ additionalFields?: Record<string, string> | undefined;
689
+ } | undefined;
690
+ responseFields?: {
691
+ sessionTokenPath?: string | undefined;
692
+ userIdPath?: string | undefined;
693
+ userEmailPath?: string | undefined;
694
+ userDisplayNamePath?: string | undefined;
695
+ expiresInPath?: string | undefined;
696
+ } | undefined;
697
+ successCheck?: {
698
+ path?: string | undefined;
699
+ expectedValue?: string | boolean | undefined;
700
+ } | undefined;
701
+ useCookieSession?: boolean | undefined;
702
+ cookieNames?: string | undefined;
703
+ customHeaders?: Record<string, string> | undefined;
704
+ requiresCsrf?: boolean | undefined;
705
+ } | undefined;
706
+ ui?: {
707
+ icon?: string | undefined;
708
+ description?: string | undefined;
709
+ } | undefined;
710
+ metadata?: Record<string, unknown> | undefined;
711
+ }[];
712
+ }, {
713
+ providers: {
714
+ id: string;
715
+ authType: "oauth2" | "password" | "verifiable_credential" | "passkey" | "magic_link" | "otp" | "none";
716
+ defaultScopes?: string[] | undefined;
717
+ displayName?: string | undefined;
718
+ oauthProviderId?: string | undefined;
719
+ oauthConfig?: {
720
+ authorizationEndpoint: string;
721
+ tokenEndpoint: string;
722
+ userInfoEndpoint?: string | undefined;
723
+ defaultScopes?: string[] | undefined;
724
+ supportsPKCE?: boolean | undefined;
725
+ requiresClientSecret?: boolean | undefined;
726
+ tokenEndpointAuthMethod?: "client_secret_post" | "client_secret_basic" | undefined;
727
+ responseType?: string | undefined;
728
+ grantType?: string | undefined;
729
+ customParams?: Record<string, string> | undefined;
730
+ authUrlTemplate?: string | undefined;
731
+ } | undefined;
732
+ credentialConfig?: {
733
+ authEndpoint: string;
734
+ httpMethod?: "POST" | "PUT" | undefined;
735
+ contentType?: "application/json" | "application/x-www-form-urlencoded" | undefined;
736
+ requestBodyTemplate?: {
737
+ identityField?: string | undefined;
738
+ passwordField?: string | undefined;
739
+ additionalFields?: Record<string, string> | undefined;
740
+ } | undefined;
741
+ responseFields?: {
742
+ sessionTokenPath?: string | undefined;
743
+ userIdPath?: string | undefined;
744
+ userEmailPath?: string | undefined;
745
+ userDisplayNamePath?: string | undefined;
746
+ expiresInPath?: string | undefined;
747
+ } | undefined;
748
+ successCheck?: {
749
+ path?: string | undefined;
750
+ expectedValue?: string | boolean | undefined;
751
+ } | undefined;
752
+ useCookieSession?: boolean | undefined;
753
+ cookieNames?: string | undefined;
754
+ customHeaders?: Record<string, string> | undefined;
755
+ requiresCsrf?: boolean | undefined;
756
+ } | undefined;
757
+ ui?: {
758
+ icon?: string | undefined;
759
+ description?: string | undefined;
760
+ } | undefined;
761
+ metadata?: Record<string, unknown> | undefined;
762
+ }[];
763
+ }>;
764
+ /**
765
+ * Validate a provider definition
766
+ *
767
+ * @param def - Provider definition to validate
768
+ * @returns Validated provider definition
769
+ * @throws ZodError if validation fails
770
+ */
771
+ export declare function validateProviderDefinition(def: unknown): ProviderDefinition;
772
+ /**
773
+ * Validate provider configuration
774
+ *
775
+ * @param config - Configuration object to validate
776
+ * @returns Validated provider configuration
777
+ * @throws ZodError if validation fails
778
+ */
779
+ export declare function validateProviderConfig(config: unknown): ProviderConfig;
780
+ //# sourceMappingURL=schemas.d.ts.map