@logto/schemas 1.38.0 → 1.39.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.
Files changed (39) hide show
  1. package/alterations/1.39.0-1774752400-add-delete-account-url.ts +20 -0
  2. package/alterations/1.39.0-1774770686-add-account-center-custom-css.ts +20 -0
  3. package/alterations/1.39.0-1776502301-add-sign-up-profile-fields.ts +20 -0
  4. package/alterations-js/1.39.0-1774752400-add-delete-account-url.js +16 -0
  5. package/alterations-js/1.39.0-1774770686-add-account-center-custom-css.js +16 -0
  6. package/alterations-js/1.39.0-1776502301-add-sign-up-profile-fields.js +16 -0
  7. package/lib/db-entries/account-center.d.ts +9 -1
  8. package/lib/db-entries/account-center.js +8 -0
  9. package/lib/db-entries/sign-in-experience.d.ts +6 -2
  10. package/lib/db-entries/sign-in-experience.js +5 -1
  11. package/lib/foundations/jsonb-types/account-centers.d.ts +1 -0
  12. package/lib/foundations/jsonb-types/account-centers.js +8 -0
  13. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +26 -0
  14. package/lib/foundations/jsonb-types/sign-in-experience.js +4 -0
  15. package/lib/types/alteration.d.ts +5 -0
  16. package/lib/types/application.d.ts +2 -2
  17. package/lib/types/custom-profile-fields.d.ts +7 -13
  18. package/lib/types/custom-profile-fields.js +6 -13
  19. package/lib/types/logto-config/index.d.ts +55 -2
  20. package/lib/types/logto-config/index.js +22 -4
  21. package/lib/types/logto-config/index.test.d.ts +1 -0
  22. package/lib/types/logto-config/index.test.js +29 -0
  23. package/lib/types/logto-config/jwt-customizer.d.ts +9 -0
  24. package/lib/types/logto-config/jwt-customizer.js +1 -0
  25. package/lib/types/logto-config/jwt-customizer.test.js +14 -2
  26. package/lib/types/onboarding.d.ts +93 -1
  27. package/lib/types/onboarding.js +22 -1
  28. package/lib/types/sign-in-experience.d.ts +9 -2
  29. package/lib/types/user-logto-config.d.ts +11 -0
  30. package/lib/types/user-logto-config.js +6 -0
  31. package/lib/utils/index.d.ts +1 -0
  32. package/lib/utils/index.js +1 -0
  33. package/lib/utils/oidc-private-key.d.ts +88 -0
  34. package/lib/utils/oidc-private-key.js +163 -0
  35. package/lib/utils/oidc-private-key.test.d.ts +1 -0
  36. package/lib/utils/oidc-private-key.test.js +128 -0
  37. package/package.json +6 -6
  38. package/tables/account_centers.sql +4 -0
  39. package/tables/sign_in_experiences.sql +2 -0
@@ -0,0 +1,20 @@
1
+ import { sql } from '@silverhand/slonik';
2
+
3
+ import type { AlterationScript } from '../lib/types/alteration.js';
4
+
5
+ const alteration: AlterationScript = {
6
+ up: async (pool) => {
7
+ await pool.query(sql`
8
+ alter table account_centers
9
+ add column delete_account_url varchar(2048);
10
+ `);
11
+ },
12
+ down: async (pool) => {
13
+ await pool.query(sql`
14
+ alter table account_centers
15
+ drop column delete_account_url;
16
+ `);
17
+ },
18
+ };
19
+
20
+ export default alteration;
@@ -0,0 +1,20 @@
1
+ import { sql } from '@silverhand/slonik';
2
+
3
+ import type { AlterationScript } from '../lib/types/alteration.js';
4
+
5
+ const alteration: AlterationScript = {
6
+ up: async (pool) => {
7
+ await pool.query(sql`
8
+ alter table account_centers
9
+ add column custom_css text;
10
+ `);
11
+ },
12
+ down: async (pool) => {
13
+ await pool.query(sql`
14
+ alter table account_centers
15
+ drop column custom_css;
16
+ `);
17
+ },
18
+ };
19
+
20
+ export default alteration;
@@ -0,0 +1,20 @@
1
+ import { sql } from '@silverhand/slonik';
2
+
3
+ import type { AlterationScript } from '../lib/types/alteration.js';
4
+
5
+ const alteration: AlterationScript = {
6
+ up: async (pool) => {
7
+ await pool.query(sql`
8
+ alter table sign_in_experiences
9
+ add column sign_up_profile_fields jsonb;
10
+ `);
11
+ },
12
+ down: async (pool) => {
13
+ await pool.query(sql`
14
+ alter table sign_in_experiences
15
+ drop column sign_up_profile_fields;
16
+ `);
17
+ },
18
+ };
19
+
20
+ export default alteration;
@@ -0,0 +1,16 @@
1
+ import { sql } from '@silverhand/slonik';
2
+ const alteration = {
3
+ up: async (pool) => {
4
+ await pool.query(sql `
5
+ alter table account_centers
6
+ add column delete_account_url varchar(2048);
7
+ `);
8
+ },
9
+ down: async (pool) => {
10
+ await pool.query(sql `
11
+ alter table account_centers
12
+ drop column delete_account_url;
13
+ `);
14
+ },
15
+ };
16
+ export default alteration;
@@ -0,0 +1,16 @@
1
+ import { sql } from '@silverhand/slonik';
2
+ const alteration = {
3
+ up: async (pool) => {
4
+ await pool.query(sql `
5
+ alter table account_centers
6
+ add column custom_css text;
7
+ `);
8
+ },
9
+ down: async (pool) => {
10
+ await pool.query(sql `
11
+ alter table account_centers
12
+ drop column custom_css;
13
+ `);
14
+ },
15
+ };
16
+ export default alteration;
@@ -0,0 +1,16 @@
1
+ import { sql } from '@silverhand/slonik';
2
+ const alteration = {
3
+ up: async (pool) => {
4
+ await pool.query(sql `
5
+ alter table sign_in_experiences
6
+ add column sign_up_profile_fields jsonb;
7
+ `);
8
+ },
9
+ down: async (pool) => {
10
+ await pool.query(sql `
11
+ alter table sign_in_experiences
12
+ drop column sign_up_profile_fields;
13
+ `);
14
+ },
15
+ };
16
+ export default alteration;
@@ -12,6 +12,10 @@ export type CreateAccountCenter = {
12
12
  /** Control each fields */
13
13
  fields?: AccountCenterFieldControl;
14
14
  webauthnRelatedOrigins?: WebauthnRelatedOrigins;
15
+ /** URL for custom account deletion endpoint */
16
+ deleteAccountUrl?: string | null;
17
+ /** User-defined custom CSS for the account center */
18
+ customCss?: string | null;
15
19
  };
16
20
  export type AccountCenter = {
17
21
  tenantId: string;
@@ -21,6 +25,10 @@ export type AccountCenter = {
21
25
  /** Control each fields */
22
26
  fields: AccountCenterFieldControl;
23
27
  webauthnRelatedOrigins: WebauthnRelatedOrigins;
28
+ /** URL for custom account deletion endpoint */
29
+ deleteAccountUrl: string | null;
30
+ /** User-defined custom CSS for the account center */
31
+ customCss: string | null;
24
32
  };
25
- export type AccountCenterKeys = 'tenantId' | 'id' | 'enabled' | 'fields' | 'webauthnRelatedOrigins';
33
+ export type AccountCenterKeys = 'tenantId' | 'id' | 'enabled' | 'fields' | 'webauthnRelatedOrigins' | 'deleteAccountUrl' | 'customCss';
26
34
  export declare const AccountCenters: GeneratedSchema<AccountCenterKeys, CreateAccountCenter, AccountCenter, 'account_centers', 'account_center'>;
@@ -7,6 +7,8 @@ const createGuard = z.object({
7
7
  enabled: z.boolean().optional(),
8
8
  fields: accountCenterFieldControlGuard.optional(),
9
9
  webauthnRelatedOrigins: webauthnRelatedOriginsGuard.optional(),
10
+ deleteAccountUrl: z.string().max(2048).nullable().optional(),
11
+ customCss: z.string().nullable().optional(),
10
12
  });
11
13
  const guard = z.object({
12
14
  tenantId: z.string().max(21),
@@ -14,6 +16,8 @@ const guard = z.object({
14
16
  enabled: z.boolean(),
15
17
  fields: accountCenterFieldControlGuard,
16
18
  webauthnRelatedOrigins: webauthnRelatedOriginsGuard,
19
+ deleteAccountUrl: z.string().max(2048).nullable(),
20
+ customCss: z.string().nullable(),
17
21
  });
18
22
  export const AccountCenters = Object.freeze({
19
23
  table: 'account_centers',
@@ -24,6 +28,8 @@ export const AccountCenters = Object.freeze({
24
28
  enabled: 'enabled',
25
29
  fields: 'fields',
26
30
  webauthnRelatedOrigins: 'webauthn_related_origins',
31
+ deleteAccountUrl: 'delete_account_url',
32
+ customCss: 'custom_css',
27
33
  },
28
34
  fieldKeys: [
29
35
  'tenantId',
@@ -31,6 +37,8 @@ export const AccountCenters = Object.freeze({
31
37
  'enabled',
32
38
  'fields',
33
39
  'webauthnRelatedOrigins',
40
+ 'deleteAccountUrl',
41
+ 'customCss',
34
42
  ],
35
43
  createGuard,
36
44
  guard,
@@ -1,4 +1,4 @@
1
- import { Color, Branding, LanguageInfo, SignIn, SignUp, SocialSignIn, ConnectorTargets, CustomContent, CustomUiAssets, PartialPasswordPolicy, Mfa, AdaptiveMfa, CaptchaPolicy, SentinelPolicy, EmailBlocklistPolicy, ForgotPasswordMethods, PasskeySignIn, GeneratedSchema } from './../foundations/index.js';
1
+ import { Color, Branding, LanguageInfo, SignIn, SignUp, SocialSignIn, ConnectorTargets, CustomContent, CustomUiAssets, PartialPasswordPolicy, Mfa, AdaptiveMfa, CaptchaPolicy, SentinelPolicy, EmailBlocklistPolicy, ForgotPasswordMethods, PasskeySignIn, SignUpProfileFields, GeneratedSchema } from './../foundations/index.js';
2
2
  import { AgreeToTermsPolicy, SignInMode } from './custom-types.js';
3
3
  /**
4
4
  *
@@ -36,6 +36,8 @@ export type CreateSignInExperience = {
36
36
  emailBlocklistPolicy?: EmailBlocklistPolicy;
37
37
  forgotPasswordMethods?: ForgotPasswordMethods | null;
38
38
  passkeySignIn?: PasskeySignIn;
39
+ /** Nullable by design: null keeps legacy full-catalog behavior and [] collects no custom profile fields. */
40
+ signUpProfileFields?: SignUpProfileFields | null;
39
41
  };
40
42
  export type SignInExperience = {
41
43
  tenantId: string;
@@ -68,6 +70,8 @@ export type SignInExperience = {
68
70
  emailBlocklistPolicy: EmailBlocklistPolicy;
69
71
  forgotPasswordMethods: ForgotPasswordMethods | null;
70
72
  passkeySignIn: PasskeySignIn;
73
+ /** Nullable by design: null keeps legacy full-catalog behavior and [] collects no custom profile fields. */
74
+ signUpProfileFields: SignUpProfileFields | null;
71
75
  };
72
- export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'hideLogtoBranding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'agreeToTermsPolicy' | 'signIn' | 'signUp' | 'socialSignIn' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'customUiAssets' | 'passwordPolicy' | 'mfa' | 'adaptiveMfa' | 'singleSignOnEnabled' | 'supportEmail' | 'supportWebsiteUrl' | 'unknownSessionRedirectUrl' | 'captchaPolicy' | 'sentinelPolicy' | 'emailBlocklistPolicy' | 'forgotPasswordMethods' | 'passkeySignIn';
76
+ export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'hideLogtoBranding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'agreeToTermsPolicy' | 'signIn' | 'signUp' | 'socialSignIn' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'customUiAssets' | 'passwordPolicy' | 'mfa' | 'adaptiveMfa' | 'singleSignOnEnabled' | 'supportEmail' | 'supportWebsiteUrl' | 'unknownSessionRedirectUrl' | 'captchaPolicy' | 'sentinelPolicy' | 'emailBlocklistPolicy' | 'forgotPasswordMethods' | 'passkeySignIn' | 'signUpProfileFields';
73
77
  export declare const SignInExperiences: GeneratedSchema<SignInExperienceKeys, CreateSignInExperience, SignInExperience, 'sign_in_experiences', 'sign_in_experience'>;
@@ -1,6 +1,6 @@
1
1
  // THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
2
  import { z } from 'zod';
3
- import { colorGuard, brandingGuard, languageInfoGuard, signInGuard, signUpGuard, socialSignInGuard, connectorTargetsGuard, customContentGuard, customUiAssetsGuard, partialPasswordPolicyGuard, mfaGuard, adaptiveMfaGuard, captchaPolicyGuard, sentinelPolicyGuard, emailBlocklistPolicyGuard, forgotPasswordMethodsGuard, passkeySignInGuard } from './../foundations/index.js';
3
+ import { colorGuard, brandingGuard, languageInfoGuard, signInGuard, signUpGuard, socialSignInGuard, connectorTargetsGuard, customContentGuard, customUiAssetsGuard, partialPasswordPolicyGuard, mfaGuard, adaptiveMfaGuard, captchaPolicyGuard, sentinelPolicyGuard, emailBlocklistPolicyGuard, forgotPasswordMethodsGuard, passkeySignInGuard, signUpProfileFieldsGuard } from './../foundations/index.js';
4
4
  import { AgreeToTermsPolicy, SignInMode } from './custom-types.js';
5
5
  const createGuard = z.object({
6
6
  tenantId: z.string().max(21).optional(),
@@ -32,6 +32,7 @@ const createGuard = z.object({
32
32
  emailBlocklistPolicy: emailBlocklistPolicyGuard.optional(),
33
33
  forgotPasswordMethods: forgotPasswordMethodsGuard.nullable().optional(),
34
34
  passkeySignIn: passkeySignInGuard.optional(),
35
+ signUpProfileFields: signUpProfileFieldsGuard.nullable().optional(),
35
36
  });
36
37
  const guard = z.object({
37
38
  tenantId: z.string().max(21),
@@ -63,6 +64,7 @@ const guard = z.object({
63
64
  emailBlocklistPolicy: emailBlocklistPolicyGuard,
64
65
  forgotPasswordMethods: forgotPasswordMethodsGuard.nullable(),
65
66
  passkeySignIn: passkeySignInGuard,
67
+ signUpProfileFields: signUpProfileFieldsGuard.nullable(),
66
68
  });
67
69
  export const SignInExperiences = Object.freeze({
68
70
  table: 'sign_in_experiences',
@@ -97,6 +99,7 @@ export const SignInExperiences = Object.freeze({
97
99
  emailBlocklistPolicy: 'email_blocklist_policy',
98
100
  forgotPasswordMethods: 'forgot_password_methods',
99
101
  passkeySignIn: 'passkey_sign_in',
102
+ signUpProfileFields: 'sign_up_profile_fields',
100
103
  },
101
104
  fieldKeys: [
102
105
  'tenantId',
@@ -128,6 +131,7 @@ export const SignInExperiences = Object.freeze({
128
131
  'emailBlocklistPolicy',
129
132
  'forgotPasswordMethods',
130
133
  'passkeySignIn',
134
+ 'signUpProfileFields',
131
135
  ],
132
136
  createGuard,
133
137
  guard,
@@ -49,3 +49,4 @@ export declare const accountCenterFieldControlGuard: z.ZodObject<{
49
49
  export type AccountCenterFieldControl = z.infer<typeof accountCenterFieldControlGuard>;
50
50
  export declare const webauthnRelatedOriginsGuard: z.ZodArray<z.ZodString, "many">;
51
51
  export type WebauthnRelatedOrigins = z.infer<typeof webauthnRelatedOriginsGuard>;
52
+ export declare const deleteAccountUrlGuard: z.ZodEffects<z.ZodString, string, string>;
@@ -26,3 +26,11 @@ export const accountCenterFieldControlGuard = z
26
26
  })
27
27
  .partial();
28
28
  export const webauthnRelatedOriginsGuard = z.array(z.string());
29
+ export const deleteAccountUrlGuard = z
30
+ .string()
31
+ .max(2048)
32
+ .refine((value) => value === '' ||
33
+ ((value.startsWith('https://') || value.startsWith('http://')) &&
34
+ z.string().url().safeParse(value).success), {
35
+ message: 'deleteAccountUrl must be a valid http(s) URL',
36
+ });
@@ -415,4 +415,30 @@ export declare const passkeySignInGuard: z.ZodObject<{
415
415
  showPasskeyButton?: boolean | undefined;
416
416
  allowAutofill?: boolean | undefined;
417
417
  }>;
418
+ /**
419
+ * Configuration for which custom profile fields are shown on the sign-up page and in which order.
420
+ *
421
+ * The list is a pure projection over the catalog in `custom_profile_fields` — each entry references
422
+ * an existing field by name. Fields in the catalog but not in this list are not collected during
423
+ * sign-up. This enables reusing the same catalog for other surfaces (e.g. account center) without
424
+ * affecting sign-up.
425
+ */
426
+ export type SignUpProfileFieldItem = {
427
+ name: string;
428
+ };
429
+ export declare const signUpProfileFieldItemGuard: z.ZodObject<{
430
+ name: z.ZodString;
431
+ }, "strip", z.ZodTypeAny, {
432
+ name: string;
433
+ }, {
434
+ name: string;
435
+ }>;
436
+ export declare const signUpProfileFieldsGuard: z.ZodArray<z.ZodObject<{
437
+ name: z.ZodString;
438
+ }, "strip", z.ZodTypeAny, {
439
+ name: string;
440
+ }, {
441
+ name: string;
442
+ }>, "many">;
443
+ export type SignUpProfileFields = z.infer<typeof signUpProfileFieldsGuard>;
418
444
  export {};
@@ -138,3 +138,7 @@ export const passkeySignInGuard = z
138
138
  allowAutofill: z.boolean(),
139
139
  })
140
140
  .partial();
141
+ export const signUpProfileFieldItemGuard = z.object({
142
+ name: z.string(),
143
+ });
144
+ export const signUpProfileFieldsGuard = z.array(signUpProfileFieldItemGuard);
@@ -1,4 +1,9 @@
1
1
  import type { CommonQueryMethods, DatabaseTransactionConnection } from '@silverhand/slonik';
2
+ /**
3
+ * IMPORTANT: Logto Cloud has a parallel `AlterationScript` type in `@logto/cloud-alterations`
4
+ * (logto-cloud repo: `packages/cloud-alterations/src/types.ts`).
5
+ * Any changes to this type must be synchronized with the Cloud type definition.
6
+ */
2
7
  export type AlterationScript = {
3
8
  /**
4
9
  * Optional hook that runs before `up` outside of a transaction.
@@ -549,16 +549,16 @@ export declare const applicationSignInExperienceCreateGuard: z.ZodObject<Omit<{
549
549
  privacyPolicyUrl: z.ZodUnion<[z.ZodNullable<z.ZodOptional<z.ZodString>>, z.ZodLiteral<"">]>;
550
550
  }, "strip", z.ZodTypeAny, {
551
551
  displayName?: string | null;
552
+ customCss?: string | null;
552
553
  color?: import("../index.js").PartialColor;
553
554
  branding?: import("../index.js").Branding;
554
- customCss?: string | null;
555
555
  termsOfUseUrl?: string | null | undefined;
556
556
  privacyPolicyUrl?: string | null | undefined;
557
557
  }, {
558
558
  displayName?: string | null;
559
+ customCss?: string | null;
559
560
  color?: import("../index.js").PartialColor;
560
561
  branding?: import("../index.js").Branding;
561
- customCss?: string | null;
562
562
  termsOfUseUrl?: string | null | undefined;
563
563
  privacyPolicyUrl?: string | null | undefined;
564
564
  }>;
@@ -2383,11 +2383,10 @@ export declare const updateCustomProfileFieldSieOrderGuard: z.ZodObject<{
2383
2383
  sieOrder: number;
2384
2384
  }>;
2385
2385
  export type UpdateCustomProfileFieldSieOrder = z.infer<typeof updateCustomProfileFieldSieOrderGuard>;
2386
- /**
2387
- * Reserved custom data keys, which are used by the system and should not be used by custom profile fields.
2388
- */
2386
+ /** Reserved custom data keys, which are used by the system and should not be used by custom profile fields. */
2389
2387
  export declare const reservedCustomDataKeyGuard: z.ZodObject<{
2390
2388
  onboarding: z.ZodOptional<z.ZodString>;
2389
+ ossOnboarding: z.ZodOptional<z.ZodString>;
2391
2390
  guideRequests: z.ZodOptional<z.ZodString>;
2392
2391
  adminConsolePreferences: z.ZodOptional<z.ZodString>;
2393
2392
  defaultTenantId: z.ZodOptional<z.ZodString>;
@@ -2396,17 +2395,16 @@ export declare const reservedCustomDataKeyGuard: z.ZodObject<{
2396
2395
  guideRequests?: string | undefined;
2397
2396
  defaultTenantId?: string | undefined;
2398
2397
  onboarding?: string | undefined;
2398
+ ossOnboarding?: string | undefined;
2399
2399
  }, {
2400
2400
  adminConsolePreferences?: string | undefined;
2401
2401
  guideRequests?: string | undefined;
2402
2402
  defaultTenantId?: string | undefined;
2403
2403
  onboarding?: string | undefined;
2404
+ ossOnboarding?: string | undefined;
2404
2405
  }>;
2405
- export declare const reservedCustomDataKeys: readonly ["adminConsolePreferences", "guideRequests", "defaultTenantId", "onboarding"];
2406
- /**
2407
- * Disallow sign-in identifiers related field keys in custom profile fields, as this is conflicting
2408
- * with the built-in sign-in/sign-up experience flows.
2409
- */
2406
+ export declare const reservedCustomDataKeys: readonly ["adminConsolePreferences", "guideRequests", "defaultTenantId", "onboarding", "ossOnboarding"];
2407
+ /** Disallow sign-in identifier related field keys in custom profile fields to avoid conflicts with built-in sign-in/sign-up flows. */
2410
2408
  export declare const signInIdentifierKeyGuard: z.ZodObject<Pick<{
2411
2409
  tenantId: z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>;
2412
2410
  id: z.ZodType<string, z.ZodTypeDef, string>;
@@ -2544,11 +2542,7 @@ export declare const signInIdentifierKeyGuard: z.ZodObject<Pick<{
2544
2542
  primaryPhone?: string | null;
2545
2543
  }>;
2546
2544
  export declare const reservedSignInIdentifierKeys: readonly ["username", "email", "phone", "primaryEmail", "primaryPhone"];
2547
- /**
2548
- * Reserved user profile keys.
2549
- * Currently only `preferredUsername` is reserved since it is the standard username property used
2550
- * by most identity providers. Should not allow user updating this field via profile related APIs.
2551
- */
2545
+ /** Reserved user profile keys. Currently only `preferredUsername` is reserved for standard IdP usage. */
2552
2546
  export declare const reservedBuiltInProfileKeyGuard: z.ZodObject<Pick<{
2553
2547
  familyName: z.ZodOptional<z.ZodString>;
2554
2548
  givenName: z.ZodOptional<z.ZodString>;
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { Users } from '../db-entries/user.js';
3
3
  import { CustomProfileFieldType, customProfileFieldTypeGuard, fieldPartGuard, userProfileAddressKeys, userProfileGuard, } from '../foundations/index.js';
4
- import { userOnboardingDataKey } from './onboarding.js';
4
+ import { ossUserOnboardingDataKey, userOnboardingDataKey } from './onboarding.js';
5
5
  import { defaultTenantIdKey } from './tenant.js';
6
6
  import { consoleUserPreferenceKey, guideRequestsKey } from './user.js';
7
7
  const baseProfileFieldGuard = z.object({
@@ -129,22 +129,18 @@ export const updateCustomProfileFieldSieOrderGuard = z.object({
129
129
  name: z.string(),
130
130
  sieOrder: z.number(),
131
131
  });
132
- /**
133
- * Reserved custom data keys, which are used by the system and should not be used by custom profile fields.
134
- */
132
+ /** Reserved custom data keys, which are used by the system and should not be used by custom profile fields. */
135
133
  export const reservedCustomDataKeyGuard = z
136
134
  .object({
137
135
  [userOnboardingDataKey]: z.string(),
136
+ [ossUserOnboardingDataKey]: z.string(),
138
137
  [guideRequestsKey]: z.string(),
139
138
  [consoleUserPreferenceKey]: z.string(),
140
139
  [defaultTenantIdKey]: z.string(),
141
140
  })
142
141
  .partial();
143
142
  export const reservedCustomDataKeys = Object.freeze(reservedCustomDataKeyGuard.keyof().options);
144
- /**
145
- * Disallow sign-in identifiers related field keys in custom profile fields, as this is conflicting
146
- * with the built-in sign-in/sign-up experience flows.
147
- */
143
+ /** Disallow sign-in identifier related field keys in custom profile fields to avoid conflicts with built-in sign-in/sign-up flows. */
148
144
  export const signInIdentifierKeyGuard = Users.createGuard
149
145
  .pick({
150
146
  username: true,
@@ -156,11 +152,7 @@ export const signInIdentifierKeyGuard = Users.createGuard
156
152
  phone: z.string().nullable().optional(),
157
153
  });
158
154
  export const reservedSignInIdentifierKeys = Object.freeze(signInIdentifierKeyGuard.keyof().options);
159
- /**
160
- * Reserved user profile keys.
161
- * Currently only `preferredUsername` is reserved since it is the standard username property used
162
- * by most identity providers. Should not allow user updating this field via profile related APIs.
163
- */
155
+ /** Reserved user profile keys. Currently only `preferredUsername` is reserved for standard IdP usage. */
164
156
  export const reservedBuiltInProfileKeyGuard = userProfileGuard.pick({ preferredUsername: true });
165
157
  export const reservedBuiltInProfileKeys = Object.freeze(reservedBuiltInProfileKeyGuard.keyof().options);
166
158
  export var SupportedDateFormat;
@@ -176,3 +168,4 @@ export var Gender;
176
168
  Gender["Male"] = "male";
177
169
  Gender["Other"] = "prefer_not_to_say";
178
170
  })(Gender || (Gender = {}));
171
+ /* eslint-enable max-lines */
@@ -41,6 +41,29 @@ export declare const oidcConfigKeyGuard: z.ZodObject<{
41
41
  createdAt: number;
42
42
  }>;
43
43
  export type OidcConfigKey = z.infer<typeof oidcConfigKeyGuard>;
44
+ export declare enum OidcSigningKeyStatus {
45
+ Next = "Next",
46
+ Current = "Current",
47
+ Previous = "Previous"
48
+ }
49
+ export declare const oidcPrivateKeyGuard: z.ZodObject<{
50
+ id: z.ZodString;
51
+ value: z.ZodString;
52
+ createdAt: z.ZodNumber;
53
+ } & {
54
+ status: z.ZodOptional<z.ZodNativeEnum<typeof OidcSigningKeyStatus>>;
55
+ }, "strip", z.ZodTypeAny, {
56
+ value: string;
57
+ id: string;
58
+ createdAt: number;
59
+ status?: OidcSigningKeyStatus | undefined;
60
+ }, {
61
+ value: string;
62
+ id: string;
63
+ createdAt: number;
64
+ status?: OidcSigningKeyStatus | undefined;
65
+ }>;
66
+ export type OidcPrivateKey = z.infer<typeof oidcPrivateKeyGuard>;
44
67
  export declare const oidcSessionConfigGuard: z.ZodObject<{
45
68
  ttl: z.ZodOptional<z.ZodNumber>;
46
69
  }, "strip", z.ZodTypeAny, {
@@ -50,7 +73,7 @@ export declare const oidcSessionConfigGuard: z.ZodObject<{
50
73
  }>;
51
74
  export type OidcSessionConfig = z.infer<typeof oidcSessionConfigGuard>;
52
75
  export type LogtoOidcConfigType = {
53
- [LogtoOidcConfigKey.PrivateKeys]: OidcConfigKey[];
76
+ [LogtoOidcConfigKey.PrivateKeys]: OidcPrivateKey[];
54
77
  [LogtoOidcConfigKey.CookieKeys]: OidcConfigKey[];
55
78
  [LogtoOidcConfigKey.Session]: OidcSessionConfig;
56
79
  };
@@ -73,6 +96,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
73
96
  value: z.ZodObject<{
74
97
  script: z.ZodString;
75
98
  environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
99
+ blockIssuanceOnError: z.ZodOptional<z.ZodBoolean>;
76
100
  } & {
77
101
  tokenSample: z.ZodOptional<z.ZodObject<{
78
102
  accountId: z.ZodOptional<z.ZodString>;
@@ -2125,6 +2149,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
2125
2149
  signInContext?: Record<string, string> | undefined;
2126
2150
  } | undefined;
2127
2151
  } | undefined;
2152
+ blockIssuanceOnError?: boolean | undefined;
2128
2153
  tokenSample?: {
2129
2154
  grantId?: string | undefined;
2130
2155
  sid?: string | undefined;
@@ -2382,6 +2407,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
2382
2407
  signInContext?: Record<string, string> | undefined;
2383
2408
  } | undefined;
2384
2409
  } | undefined;
2410
+ blockIssuanceOnError?: boolean | undefined;
2385
2411
  tokenSample?: {
2386
2412
  grantId?: string | undefined;
2387
2413
  sid?: string | undefined;
@@ -2641,6 +2667,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
2641
2667
  signInContext?: Record<string, string> | undefined;
2642
2668
  } | undefined;
2643
2669
  } | undefined;
2670
+ blockIssuanceOnError?: boolean | undefined;
2644
2671
  tokenSample?: {
2645
2672
  grantId?: string | undefined;
2646
2673
  sid?: string | undefined;
@@ -2901,6 +2928,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
2901
2928
  signInContext?: Record<string, string> | undefined;
2902
2929
  } | undefined;
2903
2930
  } | undefined;
2931
+ blockIssuanceOnError?: boolean | undefined;
2904
2932
  tokenSample?: {
2905
2933
  grantId?: string | undefined;
2906
2934
  sid?: string | undefined;
@@ -2921,6 +2949,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
2921
2949
  value: z.ZodObject<{
2922
2950
  script: z.ZodString;
2923
2951
  environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2952
+ blockIssuanceOnError: z.ZodOptional<z.ZodBoolean>;
2924
2953
  } & {
2925
2954
  tokenSample: z.ZodOptional<z.ZodObject<{
2926
2955
  kind: z.ZodOptional<z.ZodLiteral<"ClientCredentials">>;
@@ -3299,6 +3328,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
3299
3328
  isThirdParty?: boolean | undefined;
3300
3329
  } | undefined;
3301
3330
  } | undefined;
3331
+ blockIssuanceOnError?: boolean | undefined;
3302
3332
  tokenSample?: {
3303
3333
  jti?: string | undefined;
3304
3334
  kind?: "ClientCredentials" | undefined;
@@ -3363,6 +3393,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
3363
3393
  isThirdParty?: boolean | undefined;
3364
3394
  } | undefined;
3365
3395
  } | undefined;
3396
+ blockIssuanceOnError?: boolean | undefined;
3366
3397
  tokenSample?: {
3367
3398
  jti?: string | undefined;
3368
3399
  kind?: "ClientCredentials" | undefined;
@@ -3429,6 +3460,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
3429
3460
  isThirdParty?: boolean | undefined;
3430
3461
  } | undefined;
3431
3462
  } | undefined;
3463
+ blockIssuanceOnError?: boolean | undefined;
3432
3464
  tokenSample?: {
3433
3465
  jti?: string | undefined;
3434
3466
  kind?: "ClientCredentials" | undefined;
@@ -3496,6 +3528,7 @@ export declare const jwtCustomizerConfigsGuard: z.ZodDiscriminatedUnion<"key", [
3496
3528
  isThirdParty?: boolean | undefined;
3497
3529
  } | undefined;
3498
3530
  } | undefined;
3531
+ blockIssuanceOnError?: boolean | undefined;
3499
3532
  tokenSample?: {
3500
3533
  jti?: string | undefined;
3501
3534
  kind?: "ClientCredentials" | undefined;
@@ -3597,13 +3630,26 @@ export declare const idTokenConfigGuard: z.ZodObject<{
3597
3630
  enabledExtendedClaims?: ("custom_data" | "identities" | "sso_identities" | "roles" | "organizations" | "organization_data" | "organization_roles")[] | undefined;
3598
3631
  }>;
3599
3632
  export type IdTokenConfig = z.infer<typeof idTokenConfigGuard>;
3633
+ export declare const signingKeyRotationStateGuard: z.ZodObject<{
3634
+ tenantCacheExpiresAt: z.ZodOptional<z.ZodNumber>;
3635
+ signingKeyRotationAt: z.ZodOptional<z.ZodNumber>;
3636
+ }, "strip", z.ZodTypeAny, {
3637
+ tenantCacheExpiresAt?: number | undefined;
3638
+ signingKeyRotationAt?: number | undefined;
3639
+ }, {
3640
+ tenantCacheExpiresAt?: number | undefined;
3641
+ signingKeyRotationAt?: number | undefined;
3642
+ }>;
3643
+ export type SigningKeyRotationState = z.infer<typeof signingKeyRotationStateGuard>;
3600
3644
  export declare enum LogtoTenantConfigKey {
3601
3645
  AdminConsole = "adminConsole",
3602
3646
  CloudConnection = "cloudConnection",
3603
3647
  /** The URL to redirect when session not found in Sign-in Experience. */
3604
3648
  SessionNotFoundRedirectUrl = "sessionNotFoundRedirectUrl",
3605
3649
  /** ID token configuration for extended claims. */
3606
- IdToken = "idToken"
3650
+ IdToken = "idToken",
3651
+ /** Tenant-scoped rotation state for staged private signing key activation. */
3652
+ SigningKeyRotationState = "signingKeyRotationState"
3607
3653
  }
3608
3654
  export type LogtoTenantConfigType = {
3609
3655
  [LogtoTenantConfigKey.AdminConsole]: AdminConsoleData;
@@ -3612,6 +3658,7 @@ export type LogtoTenantConfigType = {
3612
3658
  url: string;
3613
3659
  };
3614
3660
  [LogtoTenantConfigKey.IdToken]: IdTokenConfig;
3661
+ [LogtoTenantConfigKey.SigningKeyRotationState]: SigningKeyRotationState;
3615
3662
  };
3616
3663
  export declare const logtoTenantConfigGuard: Readonly<{
3617
3664
  [key in LogtoTenantConfigKey]: ZodType<LogtoTenantConfigType[key]>;
@@ -3627,13 +3674,19 @@ export declare const oidcConfigKeysResponseGuard: z.ZodObject<Omit<{
3627
3674
  createdAt: z.ZodNumber;
3628
3675
  }, "value"> & {
3629
3676
  signingKeyAlgorithm: z.ZodOptional<z.ZodNativeEnum<typeof SupportedSigningKeyAlgorithm>>;
3677
+ status: z.ZodOptional<z.ZodNativeEnum<typeof OidcSigningKeyStatus>>;
3678
+ effectiveAt: z.ZodOptional<z.ZodNumber>;
3630
3679
  }, "strip", z.ZodTypeAny, {
3631
3680
  id: string;
3632
3681
  createdAt: number;
3682
+ status?: OidcSigningKeyStatus | undefined;
3633
3683
  signingKeyAlgorithm?: SupportedSigningKeyAlgorithm | undefined;
3684
+ effectiveAt?: number | undefined;
3634
3685
  }, {
3635
3686
  id: string;
3636
3687
  createdAt: number;
3688
+ status?: OidcSigningKeyStatus | undefined;
3637
3689
  signingKeyAlgorithm?: SupportedSigningKeyAlgorithm | undefined;
3690
+ effectiveAt?: number | undefined;
3638
3691
  }>;
3639
3692
  export type OidcConfigKeysResponse = z.infer<typeof oidcConfigKeysResponseGuard>;