@kya-os/consent 0.1.4 → 0.1.7

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.
@@ -23,21 +23,21 @@ export declare const CredentialsConfigSchema: z.ZodObject<{
23
23
  showForgotPassword: z.ZodOptional<z.ZodBoolean>;
24
24
  forgotPasswordUrl: z.ZodOptional<z.ZodString>;
25
25
  }, "strip", z.ZodTypeAny, {
26
- showForgotPassword?: boolean | undefined;
27
- forgotPasswordUrl?: string | undefined;
28
26
  usernameLabel?: string | undefined;
29
27
  usernamePlaceholder?: string | undefined;
30
28
  passwordLabel?: string | undefined;
31
29
  passwordPlaceholder?: string | undefined;
32
30
  showRememberMe?: boolean | undefined;
33
- }, {
34
31
  showForgotPassword?: boolean | undefined;
35
32
  forgotPasswordUrl?: string | undefined;
33
+ }, {
36
34
  usernameLabel?: string | undefined;
37
35
  usernamePlaceholder?: string | undefined;
38
36
  passwordLabel?: string | undefined;
39
37
  passwordPlaceholder?: string | undefined;
40
38
  showRememberMe?: boolean | undefined;
39
+ showForgotPassword?: boolean | undefined;
40
+ forgotPasswordUrl?: string | undefined;
41
41
  }>;
42
42
  export type CredentialsConfigSchemaType = z.infer<typeof CredentialsConfigSchema>;
43
43
  /**
@@ -67,17 +67,17 @@ export declare const MagicLinkConfigSchema: z.ZodObject<{
67
67
  buttonText: z.ZodOptional<z.ZodString>;
68
68
  resendCooldown: z.ZodOptional<z.ZodNumber>;
69
69
  }, "strip", z.ZodTypeAny, {
70
- resendCooldown?: number | undefined;
71
70
  buttonText?: string | undefined;
72
71
  enabled?: boolean | undefined;
73
72
  emailLabel?: string | undefined;
74
73
  emailPlaceholder?: string | undefined;
75
- }, {
76
74
  resendCooldown?: number | undefined;
75
+ }, {
77
76
  buttonText?: string | undefined;
78
77
  enabled?: boolean | undefined;
79
78
  emailLabel?: string | undefined;
80
79
  emailPlaceholder?: string | undefined;
80
+ resendCooldown?: number | undefined;
81
81
  }>;
82
82
  export type MagicLinkConfigSchemaType = z.infer<typeof MagicLinkConfigSchema>;
83
83
  /**
@@ -91,19 +91,19 @@ export declare const OTPConfigSchema: z.ZodObject<{
91
91
  digits: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<4>, z.ZodLiteral<6>, z.ZodLiteral<8>]>>;
92
92
  resendCooldown: z.ZodOptional<z.ZodNumber>;
93
93
  }, "strip", z.ZodTypeAny, {
94
- resendCooldown?: number | undefined;
95
94
  enabled?: boolean | undefined;
95
+ resendCooldown?: number | undefined;
96
96
  phoneLabel?: string | undefined;
97
97
  phonePlaceholder?: string | undefined;
98
98
  instructions?: string | undefined;
99
- digits?: 4 | 6 | 8 | undefined;
99
+ digits?: 8 | 4 | 6 | undefined;
100
100
  }, {
101
- resendCooldown?: number | undefined;
102
101
  enabled?: boolean | undefined;
102
+ resendCooldown?: number | undefined;
103
103
  phoneLabel?: string | undefined;
104
104
  phonePlaceholder?: string | undefined;
105
105
  instructions?: string | undefined;
106
- digits?: 4 | 6 | 8 | undefined;
106
+ digits?: 8 | 4 | 6 | undefined;
107
107
  }>;
108
108
  export type OTPConfigSchemaType = z.infer<typeof OTPConfigSchema>;
109
109
  /**
@@ -182,21 +182,21 @@ export declare const ModeConfigsSchema: z.ZodObject<{
182
182
  showForgotPassword: z.ZodOptional<z.ZodBoolean>;
183
183
  forgotPasswordUrl: z.ZodOptional<z.ZodString>;
184
184
  }, "strip", z.ZodTypeAny, {
185
- showForgotPassword?: boolean | undefined;
186
- forgotPasswordUrl?: string | undefined;
187
185
  usernameLabel?: string | undefined;
188
186
  usernamePlaceholder?: string | undefined;
189
187
  passwordLabel?: string | undefined;
190
188
  passwordPlaceholder?: string | undefined;
191
189
  showRememberMe?: boolean | undefined;
192
- }, {
193
190
  showForgotPassword?: boolean | undefined;
194
191
  forgotPasswordUrl?: string | undefined;
192
+ }, {
195
193
  usernameLabel?: string | undefined;
196
194
  usernamePlaceholder?: string | undefined;
197
195
  passwordLabel?: string | undefined;
198
196
  passwordPlaceholder?: string | undefined;
199
197
  showRememberMe?: boolean | undefined;
198
+ showForgotPassword?: boolean | undefined;
199
+ forgotPasswordUrl?: string | undefined;
200
200
  }>>;
201
201
  oauth: z.ZodOptional<z.ZodObject<{
202
202
  providerId: z.ZodOptional<z.ZodString>;
@@ -218,17 +218,17 @@ export declare const ModeConfigsSchema: z.ZodObject<{
218
218
  buttonText: z.ZodOptional<z.ZodString>;
219
219
  resendCooldown: z.ZodOptional<z.ZodNumber>;
220
220
  }, "strip", z.ZodTypeAny, {
221
- resendCooldown?: number | undefined;
222
221
  buttonText?: string | undefined;
223
222
  enabled?: boolean | undefined;
224
223
  emailLabel?: string | undefined;
225
224
  emailPlaceholder?: string | undefined;
226
- }, {
227
225
  resendCooldown?: number | undefined;
226
+ }, {
228
227
  buttonText?: string | undefined;
229
228
  enabled?: boolean | undefined;
230
229
  emailLabel?: string | undefined;
231
230
  emailPlaceholder?: string | undefined;
231
+ resendCooldown?: number | undefined;
232
232
  }>>;
233
233
  otp: z.ZodOptional<z.ZodObject<{
234
234
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -238,19 +238,19 @@ export declare const ModeConfigsSchema: z.ZodObject<{
238
238
  digits: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<4>, z.ZodLiteral<6>, z.ZodLiteral<8>]>>;
239
239
  resendCooldown: z.ZodOptional<z.ZodNumber>;
240
240
  }, "strip", z.ZodTypeAny, {
241
- resendCooldown?: number | undefined;
242
241
  enabled?: boolean | undefined;
242
+ resendCooldown?: number | undefined;
243
243
  phoneLabel?: string | undefined;
244
244
  phonePlaceholder?: string | undefined;
245
245
  instructions?: string | undefined;
246
- digits?: 4 | 6 | 8 | undefined;
246
+ digits?: 8 | 4 | 6 | undefined;
247
247
  }, {
248
- resendCooldown?: number | undefined;
249
248
  enabled?: boolean | undefined;
249
+ resendCooldown?: number | undefined;
250
250
  phoneLabel?: string | undefined;
251
251
  phonePlaceholder?: string | undefined;
252
252
  instructions?: string | undefined;
253
- digits?: 4 | 6 | 8 | undefined;
253
+ digits?: 8 | 4 | 6 | undefined;
254
254
  }>>;
255
255
  qrCode: z.ZodOptional<z.ZodObject<{
256
256
  enabled: z.ZodOptional<z.ZodBoolean>;
@@ -305,13 +305,13 @@ export declare const ModeConfigsSchema: z.ZodObject<{
305
305
  }>>;
306
306
  }, "strip", z.ZodTypeAny, {
307
307
  credentials?: {
308
- showForgotPassword?: boolean | undefined;
309
- forgotPasswordUrl?: string | undefined;
310
308
  usernameLabel?: string | undefined;
311
309
  usernamePlaceholder?: string | undefined;
312
310
  passwordLabel?: string | undefined;
313
311
  passwordPlaceholder?: string | undefined;
314
312
  showRememberMe?: boolean | undefined;
313
+ showForgotPassword?: boolean | undefined;
314
+ forgotPasswordUrl?: string | undefined;
315
315
  } | undefined;
316
316
  oauth?: {
317
317
  providerId?: string | undefined;
@@ -319,12 +319,12 @@ export declare const ModeConfigsSchema: z.ZodObject<{
319
319
  buttonText?: string | undefined;
320
320
  } | undefined;
321
321
  otp?: {
322
- resendCooldown?: number | undefined;
323
322
  enabled?: boolean | undefined;
323
+ resendCooldown?: number | undefined;
324
324
  phoneLabel?: string | undefined;
325
325
  phonePlaceholder?: string | undefined;
326
326
  instructions?: string | undefined;
327
- digits?: 4 | 6 | 8 | undefined;
327
+ digits?: 8 | 4 | 6 | undefined;
328
328
  } | undefined;
329
329
  passkey?: {
330
330
  buttonText?: string | undefined;
@@ -340,11 +340,11 @@ export declare const ModeConfigsSchema: z.ZodObject<{
340
340
  estimatedTime?: string | undefined;
341
341
  } | undefined;
342
342
  magicLink?: {
343
- resendCooldown?: number | undefined;
344
343
  buttonText?: string | undefined;
345
344
  enabled?: boolean | undefined;
346
345
  emailLabel?: string | undefined;
347
346
  emailPlaceholder?: string | undefined;
347
+ resendCooldown?: number | undefined;
348
348
  } | undefined;
349
349
  qrCode?: {
350
350
  enabled?: boolean | undefined;
@@ -354,13 +354,13 @@ export declare const ModeConfigsSchema: z.ZodObject<{
354
354
  } | undefined;
355
355
  }, {
356
356
  credentials?: {
357
- showForgotPassword?: boolean | undefined;
358
- forgotPasswordUrl?: string | undefined;
359
357
  usernameLabel?: string | undefined;
360
358
  usernamePlaceholder?: string | undefined;
361
359
  passwordLabel?: string | undefined;
362
360
  passwordPlaceholder?: string | undefined;
363
361
  showRememberMe?: boolean | undefined;
362
+ showForgotPassword?: boolean | undefined;
363
+ forgotPasswordUrl?: string | undefined;
364
364
  } | undefined;
365
365
  oauth?: {
366
366
  providerId?: string | undefined;
@@ -368,12 +368,12 @@ export declare const ModeConfigsSchema: z.ZodObject<{
368
368
  buttonText?: string | undefined;
369
369
  } | undefined;
370
370
  otp?: {
371
- resendCooldown?: number | undefined;
372
371
  enabled?: boolean | undefined;
372
+ resendCooldown?: number | undefined;
373
373
  phoneLabel?: string | undefined;
374
374
  phonePlaceholder?: string | undefined;
375
375
  instructions?: string | undefined;
376
- digits?: 4 | 6 | 8 | undefined;
376
+ digits?: 8 | 4 | 6 | undefined;
377
377
  } | undefined;
378
378
  passkey?: {
379
379
  buttonText?: string | undefined;
@@ -389,11 +389,11 @@ export declare const ModeConfigsSchema: z.ZodObject<{
389
389
  estimatedTime?: string | undefined;
390
390
  } | undefined;
391
391
  magicLink?: {
392
- resendCooldown?: number | undefined;
393
392
  buttonText?: string | undefined;
394
393
  enabled?: boolean | undefined;
395
394
  emailLabel?: string | undefined;
396
395
  emailPlaceholder?: string | undefined;
396
+ resendCooldown?: number | undefined;
397
397
  } | undefined;
398
398
  qrCode?: {
399
399
  enabled?: boolean | undefined;
@@ -3,6 +3,39 @@
3
3
  *
4
4
  * Canonical type definitions for authentication modes and their configurations.
5
5
  *
6
+ * ## Consent Flow Architecture
7
+ *
8
+ * The consent flow has two patterns based on the auth mode:
9
+ *
10
+ * ### Flow 1: Consent Only (CONSENT_ONLY mode) - 2 Screens
11
+ * ```
12
+ * [Consent Screen] → [Success Screen]
13
+ * ↓
14
+ * User confirms → DelegationCredential (VC) created
15
+ * ```
16
+ *
17
+ * ### Flow 2: Auth First (CREDENTIALS, OAUTH, etc.) - 3 Screens
18
+ * ```
19
+ * [Auth Screen] → [Consent Screen] → [Success Screen]
20
+ * ↓ ↓
21
+ * Verify identity User confirms → DelegationCredential (VC) created
22
+ * ```
23
+ *
24
+ * ## Relationship to AuthorizationRequirement
25
+ *
26
+ * - `AUTH_MODES` here define what UI to render for authentication
27
+ * - `AuthorizationRequirement` in @kya-os/contracts defines what a TOOL requires
28
+ *
29
+ * Mapping:
30
+ * | AUTH_MODE | AuthorizationRequirement.type |
31
+ * |-----------|-------------------------------|
32
+ * | CONSENT_ONLY | 'none' |
33
+ * | CREDENTIALS | 'password' |
34
+ * | OAUTH | 'oauth' |
35
+ * | IDV | 'idv' |
36
+ * | MAGIC_LINK | (future) |
37
+ * | OTP | (future) |
38
+ *
6
39
  * @module @kya-os/consent/types/modes
7
40
  */
8
41
  /**
@@ -10,23 +43,27 @@
10
43
  *
11
44
  * Constants for all supported auth modes in consent pages.
12
45
  * Matches AgentShield's AUTH_MODES constant.
46
+ *
47
+ * The mode determines the screen flow:
48
+ * - CONSENT_ONLY: Consent → Success (2 screens) - Direct to consent, no auth
49
+ * - All others: Auth → Consent → Success (3 screens) - Auth first, then consent
13
50
  */
14
51
  export declare const AUTH_MODES: {
15
- /** Simple consent with no authentication */
52
+ /** Simple consent with no authentication - Consent → Success (2 screens) */
16
53
  readonly CONSENT_ONLY: "consent-only";
17
- /** Username/password authentication */
54
+ /** Username/password authentication - Auth → Consent → Success (3 screens) */
18
55
  readonly CREDENTIALS: "credentials";
19
- /** OAuth provider authentication */
56
+ /** OAuth provider authentication - Auth → Consent → Success (3 screens) */
20
57
  readonly OAUTH: "oauth";
21
- /** Email magic link authentication */
58
+ /** Email magic link authentication - Auth → Consent → Success (3 screens) */
22
59
  readonly MAGIC_LINK: "magic-link";
23
- /** One-time password (SMS/TOTP) authentication */
60
+ /** One-time password (SMS/TOTP) authentication - Auth → Consent → Success (3 screens) */
24
61
  readonly OTP: "otp";
25
- /** QR code scanning authentication (future) */
62
+ /** QR code scanning authentication (future) - Auth → Consent → Success (3 screens) */
26
63
  readonly QR_CODE: "qr-code";
27
- /** Passkey/WebAuthn authentication (future) */
64
+ /** Passkey/WebAuthn authentication (future) - Auth → Consent → Success (3 screens) */
28
65
  readonly PASSKEY: "passkey";
29
- /** Identity verification (future) */
66
+ /** Identity verification (future) - Auth → Consent → Success (3 screens) */
30
67
  readonly IDV: "idv";
31
68
  };
32
69
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"modes.types.d.ts","sourceRoot":"","sources":["../../src/types/modes.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,UAAU;IACrB,4CAA4C;;IAG5C,uCAAuC;;IAGvC,oCAAoC;;IAGpC,sCAAsC;;IAGtC,kDAAkD;;IAGlD,+CAA+C;;IAG/C,+CAA+C;;IAG/C,qCAAqC;;CAE7B,CAAC;AAEX;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEpE;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,2BAA2B;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,iCAAiC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,2BAA2B;IAC3B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,iCAAiC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAE7B,6CAA6C;IAC7C,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,6CAA6C;IAC7C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B,mCAAmC;IACnC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,0CAA0C;IAC1C,YAAY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,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAEhC,wBAAwB;IACxB,KAAK,CAAC,EAAE,WAAW,CAAC;IAEpB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B,sBAAsB;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;IAEhB,0BAA0B;IAC1B,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB,sBAAsB;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,sBAAsB;IACtB,EAAE,EAAE,QAAQ,CAAC;IAEb,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IAEpB,wBAAwB;IACxB,WAAW,EAAE,MAAM,CAAC;IAEpB,uBAAuB;IACvB,QAAQ,EAAE,MAAM,CAAC;IAEjB,2CAA2C;IAC3C,cAAc,EAAE,OAAO,CAAC;IAExB,uCAAuC;IACvC,WAAW,EAAE,OAAO,CAAC;IAErB,wCAAwC;IACxC,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB"}
@@ -3,6 +3,39 @@
3
3
  *
4
4
  * Canonical type definitions for authentication modes and their configurations.
5
5
  *
6
+ * ## Consent Flow Architecture
7
+ *
8
+ * The consent flow has two patterns based on the auth mode:
9
+ *
10
+ * ### Flow 1: Consent Only (CONSENT_ONLY mode) - 2 Screens
11
+ * ```
12
+ * [Consent Screen] → [Success Screen]
13
+ * ↓
14
+ * User confirms → DelegationCredential (VC) created
15
+ * ```
16
+ *
17
+ * ### Flow 2: Auth First (CREDENTIALS, OAUTH, etc.) - 3 Screens
18
+ * ```
19
+ * [Auth Screen] → [Consent Screen] → [Success Screen]
20
+ * ↓ ↓
21
+ * Verify identity User confirms → DelegationCredential (VC) created
22
+ * ```
23
+ *
24
+ * ## Relationship to AuthorizationRequirement
25
+ *
26
+ * - `AUTH_MODES` here define what UI to render for authentication
27
+ * - `AuthorizationRequirement` in @kya-os/contracts defines what a TOOL requires
28
+ *
29
+ * Mapping:
30
+ * | AUTH_MODE | AuthorizationRequirement.type |
31
+ * |-----------|-------------------------------|
32
+ * | CONSENT_ONLY | 'none' |
33
+ * | CREDENTIALS | 'password' |
34
+ * | OAUTH | 'oauth' |
35
+ * | IDV | 'idv' |
36
+ * | MAGIC_LINK | (future) |
37
+ * | OTP | (future) |
38
+ *
6
39
  * @module @kya-os/consent/types/modes
7
40
  */
8
41
  /**
@@ -10,23 +43,27 @@
10
43
  *
11
44
  * Constants for all supported auth modes in consent pages.
12
45
  * Matches AgentShield's AUTH_MODES constant.
46
+ *
47
+ * The mode determines the screen flow:
48
+ * - CONSENT_ONLY: Consent → Success (2 screens) - Direct to consent, no auth
49
+ * - All others: Auth → Consent → Success (3 screens) - Auth first, then consent
13
50
  */
14
51
  export const AUTH_MODES = {
15
- /** Simple consent with no authentication */
52
+ /** Simple consent with no authentication - Consent → Success (2 screens) */
16
53
  CONSENT_ONLY: "consent-only",
17
- /** Username/password authentication */
54
+ /** Username/password authentication - Auth → Consent → Success (3 screens) */
18
55
  CREDENTIALS: "credentials",
19
- /** OAuth provider authentication */
56
+ /** OAuth provider authentication - Auth → Consent → Success (3 screens) */
20
57
  OAUTH: "oauth",
21
- /** Email magic link authentication */
58
+ /** Email magic link authentication - Auth → Consent → Success (3 screens) */
22
59
  MAGIC_LINK: "magic-link",
23
- /** One-time password (SMS/TOTP) authentication */
60
+ /** One-time password (SMS/TOTP) authentication - Auth → Consent → Success (3 screens) */
24
61
  OTP: "otp",
25
- /** QR code scanning authentication (future) */
62
+ /** QR code scanning authentication (future) - Auth → Consent → Success (3 screens) */
26
63
  QR_CODE: "qr-code",
27
- /** Passkey/WebAuthn authentication (future) */
64
+ /** Passkey/WebAuthn authentication (future) - Auth → Consent → Success (3 screens) */
28
65
  PASSKEY: "passkey",
29
- /** Identity verification (future) */
66
+ /** Identity verification (future) - Auth → Consent → Success (3 screens) */
30
67
  IDV: "idv",
31
68
  };
32
69
  //# sourceMappingURL=modes.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"modes.types.js","sourceRoot":"","sources":["../../src/types/modes.types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,4CAA4C;IAC5C,YAAY,EAAE,cAAc;IAE5B,uCAAuC;IACvC,WAAW,EAAE,aAAa;IAE1B,oCAAoC;IACpC,KAAK,EAAE,OAAO;IAEd,sCAAsC;IACtC,UAAU,EAAE,YAAY;IAExB,kDAAkD;IAClD,GAAG,EAAE,KAAK;IAEV,+CAA+C;IAC/C,OAAO,EAAE,SAAS;IAElB,+CAA+C;IAC/C,OAAO,EAAE,SAAS;IAElB,qCAAqC;IACrC,GAAG,EAAE,KAAK;CACF,CAAC"}
1
+ {"version":3,"file":"modes.types.js","sourceRoot":"","sources":["../../src/types/modes.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,4EAA4E;IAC5E,YAAY,EAAE,cAAc;IAE5B,8EAA8E;IAC9E,WAAW,EAAE,aAAa;IAE1B,2EAA2E;IAC3E,KAAK,EAAE,OAAO;IAEd,6EAA6E;IAC7E,UAAU,EAAE,YAAY;IAExB,yFAAyF;IACzF,GAAG,EAAE,KAAK;IAEV,sFAAsF;IACtF,OAAO,EAAE,SAAS;IAElB,sFAAsF;IACtF,OAAO,EAAE,SAAS;IAElB,4EAA4E;IAC5E,GAAG,EAAE,KAAK;CACF,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Credential Form Field Utilities
3
+ *
4
+ * Utilities for parsing and rendering dynamic credential form fields
5
+ * based on the provider's requestBodyTemplate configuration.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const template = { email: '{{email}}', password: '{{password}}' };
10
+ * const fields = parseCredentialFields(template);
11
+ * // Returns:
12
+ * // [
13
+ * // { name: 'email', apiName: 'email', type: 'email', label: 'Email', required: true },
14
+ * // { name: 'password', apiName: 'password', type: 'password', label: 'Password', required: true }
15
+ * // ]
16
+ * ```
17
+ */
18
+ /**
19
+ * Credential form field metadata for dynamic form rendering
20
+ */
21
+ export interface CredentialField {
22
+ /** Form field name (used in FormData submission) */
23
+ name: string;
24
+ /** API field name in requestBodyTemplate (may differ from form name) */
25
+ apiName: string;
26
+ /** Human-readable label for the input */
27
+ label: string;
28
+ /** Placeholder text for the input */
29
+ placeholder: string;
30
+ /** HTML input type */
31
+ type: "text" | "password" | "email" | "tel" | "date" | "number";
32
+ /** HTML autocomplete attribute */
33
+ autocomplete: string;
34
+ /** Whether field is required */
35
+ required: boolean;
36
+ }
37
+ /**
38
+ * Parse credential fields from a requestBodyTemplate.
39
+ *
40
+ * Extracts field definitions from template placeholders like `{{fieldName}}`
41
+ * and infers appropriate input types, labels, and autocomplete attributes.
42
+ *
43
+ * @param requestBodyTemplate - Template object with API field names as keys and `{{fieldName}}` as values
44
+ * @returns Array of CredentialField objects for form rendering
45
+ */
46
+ export declare function parseCredentialFields(requestBodyTemplate: Record<string, string>): CredentialField[];
47
+ /**
48
+ * Infer HTML input type from field name
49
+ */
50
+ export declare function inferInputType(fieldName: string): "text" | "password" | "email" | "tel" | "date" | "number";
51
+ /**
52
+ * Convert field name to human-readable label
53
+ */
54
+ export declare function humanizeFieldName(name: string): string;
55
+ /**
56
+ * Get appropriate placeholder text for a field
57
+ */
58
+ export declare function getPlaceholder(fieldName: string, inputType: string): string;
59
+ /**
60
+ * Get appropriate autocomplete attribute for a field
61
+ */
62
+ export declare function getAutocomplete(fieldName: string, inputType: string): string;
63
+ //# sourceMappingURL=credential-fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-fields.d.ts","sourceRoot":"","sources":["../../src/utils/credential-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IAChE,kCAAkC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,gCAAgC;IAChC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC1C,eAAe,EAAE,CA6BnB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAkD3D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMtD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CAeR;AAED;;GAEG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CAwCR"}
@@ -0,0 +1,166 @@
1
+ /**
2
+ * Credential Form Field Utilities
3
+ *
4
+ * Utilities for parsing and rendering dynamic credential form fields
5
+ * based on the provider's requestBodyTemplate configuration.
6
+ *
7
+ * @example
8
+ * ```typescript
9
+ * const template = { email: '{{email}}', password: '{{password}}' };
10
+ * const fields = parseCredentialFields(template);
11
+ * // Returns:
12
+ * // [
13
+ * // { name: 'email', apiName: 'email', type: 'email', label: 'Email', required: true },
14
+ * // { name: 'password', apiName: 'password', type: 'password', label: 'Password', required: true }
15
+ * // ]
16
+ * ```
17
+ */
18
+ /**
19
+ * Parse credential fields from a requestBodyTemplate.
20
+ *
21
+ * Extracts field definitions from template placeholders like `{{fieldName}}`
22
+ * and infers appropriate input types, labels, and autocomplete attributes.
23
+ *
24
+ * @param requestBodyTemplate - Template object with API field names as keys and `{{fieldName}}` as values
25
+ * @returns Array of CredentialField objects for form rendering
26
+ */
27
+ export function parseCredentialFields(requestBodyTemplate) {
28
+ const fields = [];
29
+ for (const [apiFieldName, template] of Object.entries(requestBodyTemplate)) {
30
+ const match = template.match(/\{\{(\w+)\}\}/);
31
+ if (match && match[1]) {
32
+ const formFieldName = match[1];
33
+ const inputType = inferInputType(formFieldName);
34
+ fields.push({
35
+ name: formFieldName,
36
+ apiName: apiFieldName,
37
+ label: humanizeFieldName(formFieldName),
38
+ placeholder: getPlaceholder(formFieldName, inputType),
39
+ type: inputType,
40
+ autocomplete: getAutocomplete(formFieldName, inputType),
41
+ required: true,
42
+ });
43
+ }
44
+ }
45
+ // Sort fields: non-password fields first, password fields last
46
+ return fields.sort((a, b) => {
47
+ const aIsPassword = a.type === "password";
48
+ const bIsPassword = b.type === "password";
49
+ if (aIsPassword && !bIsPassword)
50
+ return 1;
51
+ if (!aIsPassword && bIsPassword)
52
+ return -1;
53
+ return 0;
54
+ });
55
+ }
56
+ /**
57
+ * Infer HTML input type from field name
58
+ */
59
+ export function inferInputType(fieldName) {
60
+ const lower = fieldName.toLowerCase();
61
+ // Password-like fields
62
+ if (lower.includes("password") ||
63
+ lower.includes("pass") ||
64
+ lower.includes("secret") ||
65
+ lower.includes("pin")) {
66
+ return "password";
67
+ }
68
+ // Email fields
69
+ if (lower.includes("email") || lower.includes("mail")) {
70
+ return "email";
71
+ }
72
+ // Phone fields
73
+ if (lower.includes("phone") ||
74
+ lower.includes("tel") ||
75
+ lower.includes("mobile") ||
76
+ lower.includes("cell")) {
77
+ return "tel";
78
+ }
79
+ // Date fields
80
+ if (lower.includes("date") ||
81
+ lower.includes("dob") ||
82
+ lower.includes("birthday") ||
83
+ lower.includes("birth")) {
84
+ return "date";
85
+ }
86
+ // Number fields
87
+ if (lower.includes("age") ||
88
+ lower.includes("zip") ||
89
+ lower.includes("ssn") ||
90
+ lower.includes("code") ||
91
+ lower.includes("otp")) {
92
+ return "number";
93
+ }
94
+ return "text";
95
+ }
96
+ /**
97
+ * Convert field name to human-readable label
98
+ */
99
+ export function humanizeFieldName(name) {
100
+ return name
101
+ .replace(/([A-Z])/g, " $1") // Add space before capitals (camelCase)
102
+ .replace(/[_-]/g, " ") // Replace underscores/hyphens with spaces
103
+ .replace(/^\w/, (c) => c.toUpperCase()) // Capitalize first letter
104
+ .trim();
105
+ }
106
+ /**
107
+ * Get appropriate placeholder text for a field
108
+ */
109
+ export function getPlaceholder(fieldName, inputType) {
110
+ const label = humanizeFieldName(fieldName);
111
+ switch (inputType) {
112
+ case "email":
113
+ return "you@example.com";
114
+ case "password":
115
+ return "••••••••";
116
+ case "tel":
117
+ return "+1 (555) 123-4567";
118
+ case "date":
119
+ return "YYYY-MM-DD";
120
+ default:
121
+ return `Enter your ${label.toLowerCase()}`;
122
+ }
123
+ }
124
+ /**
125
+ * Get appropriate autocomplete attribute for a field
126
+ */
127
+ export function getAutocomplete(fieldName, inputType) {
128
+ const lower = fieldName.toLowerCase();
129
+ // Explicit mappings
130
+ if (lower.includes("username") || lower.includes("user")) {
131
+ return "username";
132
+ }
133
+ if (lower.includes("email")) {
134
+ return "email";
135
+ }
136
+ if (lower.includes("phone") || lower.includes("tel") || lower.includes("mobile")) {
137
+ return "tel";
138
+ }
139
+ if (lower.includes("password") || lower.includes("pass")) {
140
+ return "current-password";
141
+ }
142
+ if (lower.includes("dob") || lower.includes("birthday") || lower.includes("birth")) {
143
+ return "bday";
144
+ }
145
+ if (lower.includes("name") && lower.includes("first")) {
146
+ return "given-name";
147
+ }
148
+ if (lower.includes("name") && lower.includes("last")) {
149
+ return "family-name";
150
+ }
151
+ if (lower.includes("name")) {
152
+ return "name";
153
+ }
154
+ // Fallback based on type
155
+ switch (inputType) {
156
+ case "email":
157
+ return "email";
158
+ case "password":
159
+ return "current-password";
160
+ case "tel":
161
+ return "tel";
162
+ default:
163
+ return "off";
164
+ }
165
+ }
166
+ //# sourceMappingURL=credential-fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-fields.js","sourceRoot":"","sources":["../../src/utils/credential-fields.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAsBH;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CACnC,mBAA2C;IAE3C,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,KAAK,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,EAAE,CAAC;QAC3E,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAC9C,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACtB,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,SAAS,GAAG,cAAc,CAAC,aAAa,CAAC,CAAC;YAEhD,MAAM,CAAC,IAAI,CAAC;gBACV,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,YAAY;gBACrB,KAAK,EAAE,iBAAiB,CAAC,aAAa,CAAC;gBACvC,WAAW,EAAE,cAAc,CAAC,aAAa,EAAE,SAAS,CAAC;gBACrD,IAAI,EAAE,SAAS;gBACf,YAAY,EAAE,eAAe,CAAC,aAAa,EAAE,SAAS,CAAC;gBACvD,QAAQ,EAAE,IAAI;aACf,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,+DAA+D;IAC/D,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC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B,KAAK,UAAU;YACb,OAAO,kBAAkB,CAAC;QAC5B,KAAK,KAAK;YACR,OAAO,KAAK,CAAC;QACf;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Utility functions for consent components
3
+ */
4
+ export { parseCredentialFields, inferInputType, humanizeFieldName, getPlaceholder, getAutocomplete, type CredentialField, } from "./credential-fields.js";
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,KAAK,eAAe,GACrB,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Utility functions for consent components
3
+ */
4
+ export { parseCredentialFields, inferInputType, humanizeFieldName, getPlaceholder, getAutocomplete, } from "./credential-fields.js";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,eAAe,GAEhB,MAAM,wBAAwB,CAAC"}