@logto/schemas 1.43.0 → 1.45.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 (106) hide show
  1. package/alterations/1.44.0-1788946735-add-saml-authn-request-config.ts +18 -0
  2. package/alterations/1.44.0-1789000000-extend-user-id-length.ts +61 -0
  3. package/alterations/1.45.0-1791531333-add-tenant-viewer-role.ts +38 -0
  4. package/alterations-js/1.44.0-1788946735-add-saml-authn-request-config.js +14 -0
  5. package/alterations-js/1.44.0-1789000000-extend-user-id-length.js +47 -0
  6. package/alterations-js/1.45.0-1791531333-add-tenant-viewer-role.js +32 -0
  7. package/lib/consts/experience.d.ts +3 -0
  8. package/lib/consts/experience.js +3 -0
  9. package/lib/consts/index.d.ts +1 -0
  10. package/lib/consts/index.js +1 -0
  11. package/lib/consts/license.d.ts +222 -0
  12. package/lib/consts/license.js +81 -0
  13. package/lib/consts/license.test.d.ts +1 -0
  14. package/lib/consts/license.test.js +96 -0
  15. package/lib/consts/oidc.d.ts +15 -1
  16. package/lib/consts/oidc.js +11 -0
  17. package/lib/consts/oidc.test.d.ts +1 -0
  18. package/lib/consts/oidc.test.js +15 -0
  19. package/lib/consts/subscriptions.d.ts +13 -1
  20. package/lib/consts/subscriptions.js +12 -0
  21. package/lib/db-entries/aggregated-daily-active-user.js +2 -2
  22. package/lib/db-entries/application-access-control-user-relation.js +2 -2
  23. package/lib/db-entries/application-user-consent-organization.js +2 -2
  24. package/lib/db-entries/cimd-grant-organization.js +2 -2
  25. package/lib/db-entries/daily-active-user.js +2 -2
  26. package/lib/db-entries/oidc-session-extension.js +2 -2
  27. package/lib/db-entries/organization-invitation.js +4 -4
  28. package/lib/db-entries/organization-role-user-relation.js +2 -2
  29. package/lib/db-entries/organization-user-relation.js +2 -2
  30. package/lib/db-entries/personal-access-token.js +2 -2
  31. package/lib/db-entries/saml-application-config.d.ts +4 -2
  32. package/lib/db-entries/saml-application-config.js +5 -1
  33. package/lib/db-entries/secret.js +2 -2
  34. package/lib/db-entries/subject-token.js +2 -2
  35. package/lib/db-entries/trusted-device.js +2 -2
  36. package/lib/db-entries/user-geo-location.js +2 -2
  37. package/lib/db-entries/user-sign-in-country.js +2 -2
  38. package/lib/db-entries/user-sso-identity.js +2 -2
  39. package/lib/db-entries/user.js +2 -2
  40. package/lib/db-entries/users-role.js +2 -2
  41. package/lib/db-entries/verification-record.js +2 -2
  42. package/lib/db-entries/verification-status.js +2 -2
  43. package/lib/foundations/jsonb-types/captcha.d.ts +47 -1
  44. package/lib/foundations/jsonb-types/captcha.js +20 -0
  45. package/lib/foundations/jsonb-types/hooks.d.ts +0 -3
  46. package/lib/foundations/jsonb-types/hooks.js +2 -6
  47. package/lib/foundations/jsonb-types/saml-application-configs.d.ts +23 -0
  48. package/lib/foundations/jsonb-types/saml-application-configs.js +16 -0
  49. package/lib/foundations/jsonb-types/saml-application-configs.test.js +24 -1
  50. package/lib/types/authentication-context.d.ts +224 -0
  51. package/lib/types/authentication-context.js +238 -0
  52. package/lib/types/authentication-context.test.d.ts +1 -0
  53. package/lib/types/authentication-context.test.js +186 -0
  54. package/lib/types/cookie.d.ts +4 -0
  55. package/lib/types/cookie.js +6 -1
  56. package/lib/types/index.d.ts +1 -0
  57. package/lib/types/index.js +1 -0
  58. package/lib/types/interactions.d.ts +161 -0
  59. package/lib/types/interactions.js +23 -0
  60. package/lib/types/log/interaction.d.ts +15 -2
  61. package/lib/types/log/interaction.js +5 -0
  62. package/lib/types/logto-config/index.d.ts +47 -0
  63. package/lib/types/logto-config/index.js +1 -0
  64. package/lib/types/logto-config/jwt-customizer.d.ts +92 -0
  65. package/lib/types/saml-application.d.ts +55 -1
  66. package/lib/types/saml-application.js +7 -1
  67. package/lib/types/sign-in-experience.d.ts +11 -7
  68. package/lib/types/sign-in-experience.js +2 -2
  69. package/lib/types/ssr.d.ts +2 -0
  70. package/lib/types/system.d.ts +57 -5
  71. package/lib/types/system.js +36 -0
  72. package/lib/types/system.test.d.ts +1 -0
  73. package/lib/types/system.test.js +26 -0
  74. package/lib/types/tenant-organization.d.ts +4 -2
  75. package/lib/types/tenant-organization.js +6 -2
  76. package/lib/types/tenant-organization.test.d.ts +1 -0
  77. package/lib/types/tenant-organization.test.js +16 -0
  78. package/lib/types/user-sessions.d.ts +156 -0
  79. package/lib/types/verification-records/code-verification.d.ts +17 -0
  80. package/lib/types/verification-records/code-verification.js +1 -0
  81. package/lib/utils/management-api.d.ts +5 -0
  82. package/lib/utils/management-api.js +7 -1
  83. package/lib/utils/oidc-private-key.test.js +44 -0
  84. package/package.json +7 -7
  85. package/tables/aggregated_daily_active_users.sql +1 -1
  86. package/tables/application_access_control_user_relations.sql +1 -1
  87. package/tables/application_user_consent_organizations.sql +1 -1
  88. package/tables/cimd_grant_organizations.sql +1 -1
  89. package/tables/daily_active_users.sql +1 -1
  90. package/tables/oidc_session_extensions.sql +1 -1
  91. package/tables/organization_invitations.sql +2 -2
  92. package/tables/organization_role_user_relations.sql +1 -1
  93. package/tables/organization_user_relations.sql +1 -1
  94. package/tables/personal_access_tokens.sql +1 -1
  95. package/tables/saml_application_configs.sql +1 -0
  96. package/tables/secrets.sql +1 -1
  97. package/tables/subject_tokens.sql +1 -1
  98. package/tables/trusted_devices.sql +1 -1
  99. package/tables/user_geo_locations.sql +1 -1
  100. package/tables/user_sign_in_countries.sql +1 -1
  101. package/tables/user_sso_identities.sql +1 -1
  102. package/tables/users.sql +1 -1
  103. package/tables/users_roles.sql +1 -1
  104. package/tables/verification_records.sql +1 -1
  105. package/tables/verification_statuses.sql +1 -1
  106. package/LICENSE +0 -373
@@ -67,7 +67,17 @@ export declare enum ExtraParamsKey {
67
67
  /**
68
68
  * The Google One Tap credential JWT token for external website integration.
69
69
  */
70
- GoogleOneTapCredential = "google_one_tap_credential"
70
+ GoogleOneTapCredential = "google_one_tap_credential",
71
+ /**
72
+ * Overrides the theme that the sign-in experience would otherwise resolve from the end-user's
73
+ * OS settings, so an application with its own light / dark toggle can keep Logto in sync.
74
+ *
75
+ * The parameter is ignored when dark mode is disabled in the sign-in experience configuration,
76
+ * and an unrecognized value is ignored without affecting the other parameters.
77
+ *
78
+ * The available values are `light` and `dark`.
79
+ */
80
+ Theme = "theme"
71
81
  }
72
82
  /** @deprecated Use {@link FirstScreen} instead. */
73
83
  export declare enum InteractionMode {
@@ -94,6 +104,7 @@ export declare const extraParamsObjectGuard: z.ZodObject<{
94
104
  identifier: z.ZodOptional<z.ZodString>;
95
105
  one_time_token: z.ZodOptional<z.ZodString>;
96
106
  google_one_tap_credential: z.ZodOptional<z.ZodString>;
107
+ theme: z.ZodOptional<z.ZodString>;
97
108
  }, "strip", z.ZodTypeAny, {
98
109
  interaction_mode?: InteractionMode | undefined;
99
110
  first_screen?: FirstScreen | undefined;
@@ -104,6 +115,7 @@ export declare const extraParamsObjectGuard: z.ZodObject<{
104
115
  identifier?: string | undefined;
105
116
  one_time_token?: string | undefined;
106
117
  google_one_tap_credential?: string | undefined;
118
+ theme?: string | undefined;
107
119
  }, {
108
120
  interaction_mode?: InteractionMode | undefined;
109
121
  first_screen?: FirstScreen | undefined;
@@ -114,6 +126,7 @@ export declare const extraParamsObjectGuard: z.ZodObject<{
114
126
  identifier?: string | undefined;
115
127
  one_time_token?: string | undefined;
116
128
  google_one_tap_credential?: string | undefined;
129
+ theme?: string | undefined;
117
130
  }>;
118
131
  export type ExtraParamsObject = Partial<{
119
132
  [ExtraParamsKey.InteractionMode]: InteractionMode;
@@ -125,4 +138,5 @@ export type ExtraParamsObject = Partial<{
125
138
  [ExtraParamsKey.Identifier]: string;
126
139
  [ExtraParamsKey.OneTimeToken]: string;
127
140
  [ExtraParamsKey.GoogleOneTapCredential]: string;
141
+ [ExtraParamsKey.Theme]: string;
128
142
  }>;
@@ -70,6 +70,16 @@ export var ExtraParamsKey;
70
70
  * The Google One Tap credential JWT token for external website integration.
71
71
  */
72
72
  ExtraParamsKey["GoogleOneTapCredential"] = "google_one_tap_credential";
73
+ /**
74
+ * Overrides the theme that the sign-in experience would otherwise resolve from the end-user's
75
+ * OS settings, so an application with its own light / dark toggle can keep Logto in sync.
76
+ *
77
+ * The parameter is ignored when dark mode is disabled in the sign-in experience configuration,
78
+ * and an unrecognized value is ignored without affecting the other parameters.
79
+ *
80
+ * The available values are `light` and `dark`.
81
+ */
82
+ ExtraParamsKey["Theme"] = "theme";
73
83
  })(ExtraParamsKey || (ExtraParamsKey = {}));
74
84
  /** @deprecated Use {@link FirstScreen} instead. */
75
85
  export var InteractionMode;
@@ -99,5 +109,6 @@ export const extraParamsObjectGuard = z
99
109
  [ExtraParamsKey.Identifier]: z.string(),
100
110
  [ExtraParamsKey.OneTimeToken]: z.string(),
101
111
  [ExtraParamsKey.GoogleOneTapCredential]: z.string(),
112
+ [ExtraParamsKey.Theme]: z.string(),
102
113
  })
103
114
  .partial();
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,15 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { ExtraParamsKey, FirstScreen, extraParamsObjectGuard } from './oidc.js';
3
+ describe('extraParamsObjectGuard', () => {
4
+ it('should keep the other parameters when the theme is not a supported value', () => {
5
+ // Core parses every extra param in one call and falls back to an empty object when the
6
+ // parse throws, so a loose value here must never discard the parameters next to it.
7
+ const params = extraParamsObjectGuard.parse({
8
+ [ExtraParamsKey.Theme]: 'sepia',
9
+ [ExtraParamsKey.FirstScreen]: FirstScreen.Register,
10
+ [ExtraParamsKey.LoginHint]: 'foo@logto.io',
11
+ });
12
+ expect(params[ExtraParamsKey.FirstScreen]).toBe(FirstScreen.Register);
13
+ expect(params[ExtraParamsKey.LoginHint]).toBe('foo@logto.io');
14
+ });
15
+ });
@@ -27,7 +27,19 @@ export declare enum ReservedPlanId {
27
27
  /**
28
28
  * Latest Pro plan ID applied from 2025-09.
29
29
  */
30
- Pro202509 = "pro-202509"
30
+ Pro202509 = "pro-202509",
31
+ /**
32
+ * Self-hosted Pro plan, unlocked by installing a license key on a self-hosted instance.
33
+ *
34
+ * Unlike the plans above, this one is never returned by the Cloud subscription API: it is carried
35
+ * in the signed license payload and resolved locally. See `licensePayloadGuard`.
36
+ */
37
+ SelfHostedPro = "self-hosted-pro",
38
+ /**
39
+ * Self-hosted Enterprise plan, unlocked by installing a license key on a self-hosted instance.
40
+ * See {@link SelfHostedPro}.
41
+ */
42
+ SelfHostedEnterprise = "self-hosted-enterprise"
31
43
  }
32
44
  /**
33
45
  * Tenant subscription related Redis cache keys.
@@ -29,6 +29,18 @@ export var ReservedPlanId;
29
29
  * Latest Pro plan ID applied from 2025-09.
30
30
  */
31
31
  ReservedPlanId["Pro202509"] = "pro-202509";
32
+ /**
33
+ * Self-hosted Pro plan, unlocked by installing a license key on a self-hosted instance.
34
+ *
35
+ * Unlike the plans above, this one is never returned by the Cloud subscription API: it is carried
36
+ * in the signed license payload and resolved locally. See `licensePayloadGuard`.
37
+ */
38
+ ReservedPlanId["SelfHostedPro"] = "self-hosted-pro";
39
+ /**
40
+ * Self-hosted Enterprise plan, unlocked by installing a license key on a self-hosted instance.
41
+ * See {@link SelfHostedPro}.
42
+ */
43
+ ReservedPlanId["SelfHostedEnterprise"] = "self-hosted-enterprise";
32
44
  })(ReservedPlanId || (ReservedPlanId = {}));
33
45
  /**
34
46
  * Tenant subscription related Redis cache keys.
@@ -3,13 +3,13 @@ import { z } from 'zod';
3
3
  const createGuard = z.object({
4
4
  tenantId: z.string().max(21).optional(),
5
5
  activityDate: z.number(),
6
- userId: z.string().min(1).max(21),
6
+ userId: z.string().min(1).max(128),
7
7
  activityCount: z.number(),
8
8
  });
9
9
  const guard = z.object({
10
10
  tenantId: z.string().max(21),
11
11
  activityDate: z.number(),
12
- userId: z.string().min(1).max(21),
12
+ userId: z.string().min(1).max(128),
13
13
  activityCount: z.number(),
14
14
  });
15
15
  export const AggregatedDailyActiveUsers = Object.freeze({
@@ -3,12 +3,12 @@ import { z } from 'zod';
3
3
  const createGuard = z.object({
4
4
  tenantId: z.string().max(21).optional(),
5
5
  applicationId: z.string().min(1).max(21),
6
- userId: z.string().min(1).max(21),
6
+ userId: z.string().min(1).max(128),
7
7
  });
8
8
  const guard = z.object({
9
9
  tenantId: z.string().max(21),
10
10
  applicationId: z.string().min(1).max(21),
11
- userId: z.string().min(1).max(21),
11
+ userId: z.string().min(1).max(128),
12
12
  });
13
13
  export const ApplicationAccessControlUserRelations = Object.freeze({
14
14
  table: 'application_access_control_user_relations',
@@ -4,13 +4,13 @@ const createGuard = z.object({
4
4
  tenantId: z.string().max(21).optional(),
5
5
  applicationId: z.string().min(1).max(21),
6
6
  organizationId: z.string().min(1).max(21),
7
- userId: z.string().min(1).max(21),
7
+ userId: z.string().min(1).max(128),
8
8
  });
9
9
  const guard = z.object({
10
10
  tenantId: z.string().max(21),
11
11
  applicationId: z.string().min(1).max(21),
12
12
  organizationId: z.string().min(1).max(21),
13
- userId: z.string().min(1).max(21),
13
+ userId: z.string().min(1).max(128),
14
14
  });
15
15
  export const ApplicationUserConsentOrganizations = Object.freeze({
16
16
  table: 'application_user_consent_organizations',
@@ -5,14 +5,14 @@ const createGuard = z.object({
5
5
  grantId: z.string().min(1).max(128),
6
6
  grantModelName: z.string().min(1).max(64).optional(),
7
7
  organizationId: z.string().min(1).max(21),
8
- userId: z.string().min(1).max(21),
8
+ userId: z.string().min(1).max(128),
9
9
  });
10
10
  const guard = z.object({
11
11
  tenantId: z.string().max(21),
12
12
  grantId: z.string().min(1).max(128),
13
13
  grantModelName: z.string().max(64),
14
14
  organizationId: z.string().min(1).max(21),
15
- userId: z.string().min(1).max(21),
15
+ userId: z.string().min(1).max(128),
16
16
  });
17
17
  export const CimdGrantOrganizations = Object.freeze({
18
18
  table: 'cimd_grant_organizations',
@@ -3,13 +3,13 @@ import { z } from 'zod';
3
3
  const createGuard = z.object({
4
4
  id: z.string().min(1).max(21),
5
5
  tenantId: z.string().max(21).optional(),
6
- userId: z.string().min(1).max(21),
6
+ userId: z.string().min(1).max(128),
7
7
  date: z.number().optional(),
8
8
  });
9
9
  const guard = z.object({
10
10
  id: z.string().min(1).max(21),
11
11
  tenantId: z.string().max(21),
12
- userId: z.string().min(1).max(21),
12
+ userId: z.string().min(1).max(128),
13
13
  date: z.number(),
14
14
  });
15
15
  export const DailyActiveUsers = Object.freeze({
@@ -4,7 +4,7 @@ import { jsonObjectGuard } from './../foundations/index.js';
4
4
  const createGuard = z.object({
5
5
  tenantId: z.string().max(21).optional(),
6
6
  sessionUid: z.string().min(1).max(128),
7
- accountId: z.string().min(1).max(12),
7
+ accountId: z.string().min(1).max(128),
8
8
  lastSubmission: jsonObjectGuard.optional(),
9
9
  clientId: z.string().max(21).nullable().optional(),
10
10
  cimdClientId: z.string().max(2048).nullable().optional(),
@@ -14,7 +14,7 @@ const createGuard = z.object({
14
14
  const guard = z.object({
15
15
  tenantId: z.string().max(21),
16
16
  sessionUid: z.string().min(1).max(128),
17
- accountId: z.string().min(1).max(12),
17
+ accountId: z.string().min(1).max(128),
18
18
  lastSubmission: jsonObjectGuard,
19
19
  clientId: z.string().max(21).nullable(),
20
20
  cimdClientId: z.string().max(2048).nullable(),
@@ -4,9 +4,9 @@ import { OrganizationInvitationStatus } from './custom-types.js';
4
4
  const createGuard = z.object({
5
5
  tenantId: z.string().max(21).optional(),
6
6
  id: z.string().min(1).max(21),
7
- inviterId: z.string().max(21).nullable().optional(),
7
+ inviterId: z.string().max(128).nullable().optional(),
8
8
  invitee: z.string().min(1).max(256),
9
- acceptedUserId: z.string().max(21).nullable().optional(),
9
+ acceptedUserId: z.string().max(128).nullable().optional(),
10
10
  organizationId: z.string().min(1).max(21),
11
11
  status: z.nativeEnum(OrganizationInvitationStatus),
12
12
  createdAt: z.number().optional(),
@@ -16,9 +16,9 @@ const createGuard = z.object({
16
16
  const guard = z.object({
17
17
  tenantId: z.string().max(21),
18
18
  id: z.string().min(1).max(21),
19
- inviterId: z.string().max(21).nullable(),
19
+ inviterId: z.string().max(128).nullable(),
20
20
  invitee: z.string().min(1).max(256),
21
- acceptedUserId: z.string().max(21).nullable(),
21
+ acceptedUserId: z.string().max(128).nullable(),
22
22
  organizationId: z.string().min(1).max(21),
23
23
  status: z.nativeEnum(OrganizationInvitationStatus),
24
24
  createdAt: z.number(),
@@ -4,13 +4,13 @@ const createGuard = z.object({
4
4
  tenantId: z.string().max(21).optional(),
5
5
  organizationId: z.string().min(1).max(21),
6
6
  organizationRoleId: z.string().min(1).max(21),
7
- userId: z.string().min(1).max(21),
7
+ userId: z.string().min(1).max(128),
8
8
  });
9
9
  const guard = z.object({
10
10
  tenantId: z.string().max(21),
11
11
  organizationId: z.string().min(1).max(21),
12
12
  organizationRoleId: z.string().min(1).max(21),
13
- userId: z.string().min(1).max(21),
13
+ userId: z.string().min(1).max(128),
14
14
  });
15
15
  export const OrganizationRoleUserRelations = Object.freeze({
16
16
  table: 'organization_role_user_relations',
@@ -3,12 +3,12 @@ import { z } from 'zod';
3
3
  const createGuard = z.object({
4
4
  tenantId: z.string().max(21).optional(),
5
5
  organizationId: z.string().min(1).max(21),
6
- userId: z.string().min(1).max(21),
6
+ userId: z.string().min(1).max(128),
7
7
  });
8
8
  const guard = z.object({
9
9
  tenantId: z.string().max(21),
10
10
  organizationId: z.string().min(1).max(21),
11
- userId: z.string().min(1).max(21),
11
+ userId: z.string().min(1).max(128),
12
12
  });
13
13
  export const OrganizationUserRelations = Object.freeze({
14
14
  table: 'organization_user_relations',
@@ -2,7 +2,7 @@
2
2
  import { z } from 'zod';
3
3
  const createGuard = z.object({
4
4
  tenantId: z.string().max(21).optional(),
5
- userId: z.string().min(1).max(21),
5
+ userId: z.string().min(1).max(128),
6
6
  name: z.string().min(1).max(256),
7
7
  value: z.string().min(1).max(64),
8
8
  createdAt: z.number().optional(),
@@ -10,7 +10,7 @@ const createGuard = z.object({
10
10
  });
11
11
  const guard = z.object({
12
12
  tenantId: z.string().max(21),
13
- userId: z.string().min(1).max(21),
13
+ userId: z.string().min(1).max(128),
14
14
  name: z.string().min(1).max(256),
15
15
  value: z.string().min(1).max(64),
16
16
  createdAt: z.number(),
@@ -1,4 +1,4 @@
1
- import { SamlAttributeMapping, SamlAcsUrl, SamlEncryption, NameIdFormat, GeneratedSchema } from './../foundations/index.js';
1
+ import { SamlAttributeMapping, SamlAcsUrl, SamlEncryption, SamlAuthnRequestConfig, NameIdFormat, GeneratedSchema } from './../foundations/index.js';
2
2
  /**
3
3
  * The SAML application config and SAML-type application have a one-to-one correspondence: 1. a SAML-type application can only have one SAML application config. (CANNOT use "semicolon" in comments, since it indicates the end of query.) 2. a SAML application config can only configure one SAML-type application.
4
4
  *
@@ -12,6 +12,7 @@ export type CreateSamlApplicationConfig = {
12
12
  entityId?: string | null;
13
13
  acsUrl?: SamlAcsUrl | null;
14
14
  encryption?: SamlEncryption | null;
15
+ authnRequestConfig?: SamlAuthnRequestConfig | null;
15
16
  nameIdFormat: NameIdFormat;
16
17
  };
17
18
  /** The SAML application config and SAML-type application have a one-to-one correspondence: 1. a SAML-type application can only have one SAML application config. (CANNOT use "semicolon" in comments, since it indicates the end of query.) 2. a SAML application config can only configure one SAML-type application. */
@@ -22,7 +23,8 @@ export type SamlApplicationConfig = {
22
23
  entityId: string | null;
23
24
  acsUrl: SamlAcsUrl | null;
24
25
  encryption: SamlEncryption | null;
26
+ authnRequestConfig: SamlAuthnRequestConfig | null;
25
27
  nameIdFormat: NameIdFormat;
26
28
  };
27
- export type SamlApplicationConfigKeys = 'applicationId' | 'tenantId' | 'attributeMapping' | 'entityId' | 'acsUrl' | 'encryption' | 'nameIdFormat';
29
+ export type SamlApplicationConfigKeys = 'applicationId' | 'tenantId' | 'attributeMapping' | 'entityId' | 'acsUrl' | 'encryption' | 'authnRequestConfig' | 'nameIdFormat';
28
30
  export declare const SamlApplicationConfigs: GeneratedSchema<SamlApplicationConfigKeys, CreateSamlApplicationConfig, SamlApplicationConfig, 'saml_application_configs', 'saml_application_config'>;
@@ -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 { samlAttributeMappingGuard, samlAcsUrlGuard, samlEncryptionGuard, nameIdFormatGuard } from './../foundations/index.js';
3
+ import { samlAttributeMappingGuard, samlAcsUrlGuard, samlEncryptionGuard, samlAuthnRequestConfigGuard, nameIdFormatGuard } from './../foundations/index.js';
4
4
  const createGuard = z.object({
5
5
  applicationId: z.string().min(1).max(21),
6
6
  tenantId: z.string().max(21).optional(),
@@ -8,6 +8,7 @@ const createGuard = z.object({
8
8
  entityId: z.string().max(128).nullable().optional(),
9
9
  acsUrl: samlAcsUrlGuard.nullable().optional(),
10
10
  encryption: samlEncryptionGuard.nullable().optional(),
11
+ authnRequestConfig: samlAuthnRequestConfigGuard.nullable().optional(),
11
12
  nameIdFormat: nameIdFormatGuard,
12
13
  });
13
14
  const guard = z.object({
@@ -17,6 +18,7 @@ const guard = z.object({
17
18
  entityId: z.string().max(128).nullable(),
18
19
  acsUrl: samlAcsUrlGuard.nullable(),
19
20
  encryption: samlEncryptionGuard.nullable(),
21
+ authnRequestConfig: samlAuthnRequestConfigGuard.nullable(),
20
22
  nameIdFormat: nameIdFormatGuard,
21
23
  });
22
24
  export const SamlApplicationConfigs = Object.freeze({
@@ -29,6 +31,7 @@ export const SamlApplicationConfigs = Object.freeze({
29
31
  entityId: 'entity_id',
30
32
  acsUrl: 'acs_url',
31
33
  encryption: 'encryption',
34
+ authnRequestConfig: 'authn_request_config',
32
35
  nameIdFormat: 'name_id_format',
33
36
  },
34
37
  fieldKeys: [
@@ -38,6 +41,7 @@ export const SamlApplicationConfigs = Object.freeze({
38
41
  'entityId',
39
42
  'acsUrl',
40
43
  'encryption',
44
+ 'authnRequestConfig',
41
45
  'nameIdFormat',
42
46
  ],
43
47
  createGuard,
@@ -4,7 +4,7 @@ import { secretTypeGuard, bufferLikeGuard, jsonObjectGuard } from './../foundati
4
4
  const createGuard = z.object({
5
5
  tenantId: z.string().max(21).optional(),
6
6
  id: z.string().min(1).max(21),
7
- userId: z.string().min(1).max(21),
7
+ userId: z.string().min(1).max(128),
8
8
  type: secretTypeGuard,
9
9
  encryptedDek: bufferLikeGuard,
10
10
  iv: bufferLikeGuard,
@@ -17,7 +17,7 @@ const createGuard = z.object({
17
17
  const guard = z.object({
18
18
  tenantId: z.string().max(21),
19
19
  id: z.string().min(1).max(21),
20
- userId: z.string().min(1).max(21),
20
+ userId: z.string().min(1).max(128),
21
21
  type: secretTypeGuard,
22
22
  encryptedDek: bufferLikeGuard,
23
23
  iv: bufferLikeGuard,
@@ -7,7 +7,7 @@ const createGuard = z.object({
7
7
  context: jsonObjectGuard.optional(),
8
8
  expiresAt: z.number(),
9
9
  consumedAt: z.number().nullable().optional(),
10
- userId: z.string().min(1).max(21),
10
+ userId: z.string().min(1).max(128),
11
11
  createdAt: z.number().optional(),
12
12
  creatorId: z.string().min(1).max(32),
13
13
  });
@@ -17,7 +17,7 @@ const guard = z.object({
17
17
  context: jsonObjectGuard,
18
18
  expiresAt: z.number(),
19
19
  consumedAt: z.number().nullable(),
20
- userId: z.string().min(1).max(21),
20
+ userId: z.string().min(1).max(128),
21
21
  createdAt: z.number(),
22
22
  creatorId: z.string().min(1).max(32),
23
23
  });
@@ -4,7 +4,7 @@ import { bufferLikeGuard } from './../foundations/index.js';
4
4
  const createGuard = z.object({
5
5
  tenantId: z.string().max(21).optional(),
6
6
  id: z.string().min(1).max(21),
7
- userId: z.string().min(1).max(12),
7
+ userId: z.string().min(1).max(128),
8
8
  secretHash: bufferLikeGuard,
9
9
  userAgent: z.string().nullable().optional(),
10
10
  ip: z.string().nullable().optional(),
@@ -17,7 +17,7 @@ const createGuard = z.object({
17
17
  const guard = z.object({
18
18
  tenantId: z.string().max(21),
19
19
  id: z.string().min(1).max(21),
20
- userId: z.string().min(1).max(12),
20
+ userId: z.string().min(1).max(128),
21
21
  secretHash: bufferLikeGuard,
22
22
  userAgent: z.string().nullable(),
23
23
  ip: z.string().nullable(),
@@ -2,14 +2,14 @@
2
2
  import { z } from 'zod';
3
3
  const createGuard = z.object({
4
4
  tenantId: z.string().max(21).optional(),
5
- userId: z.string().min(1).max(12),
5
+ userId: z.string().min(1).max(128),
6
6
  latitude: z.number().nullable().optional(),
7
7
  longitude: z.number().nullable().optional(),
8
8
  updatedAt: z.number().optional(),
9
9
  });
10
10
  const guard = z.object({
11
11
  tenantId: z.string().max(21),
12
- userId: z.string().min(1).max(12),
12
+ userId: z.string().min(1).max(128),
13
13
  latitude: z.number().nullable(),
14
14
  longitude: z.number().nullable(),
15
15
  updatedAt: z.number(),
@@ -2,13 +2,13 @@
2
2
  import { z } from 'zod';
3
3
  const createGuard = z.object({
4
4
  tenantId: z.string().max(21).optional(),
5
- userId: z.string().min(1).max(12),
5
+ userId: z.string().min(1).max(128),
6
6
  country: z.string().min(1).max(16),
7
7
  lastSignInAt: z.number().optional(),
8
8
  });
9
9
  const guard = z.object({
10
10
  tenantId: z.string().max(21),
11
- userId: z.string().min(1).max(12),
11
+ userId: z.string().min(1).max(128),
12
12
  country: z.string().min(1).max(16),
13
13
  lastSignInAt: z.number(),
14
14
  });
@@ -4,7 +4,7 @@ import { jsonObjectGuard } from './../foundations/index.js';
4
4
  const createGuard = z.object({
5
5
  tenantId: z.string().max(21).optional(),
6
6
  id: z.string().min(1).max(21),
7
- userId: z.string().min(1).max(12),
7
+ userId: z.string().min(1).max(128),
8
8
  issuer: z.string().min(1).max(256),
9
9
  identityId: z.string().min(1).max(128),
10
10
  detail: jsonObjectGuard.optional(),
@@ -15,7 +15,7 @@ const createGuard = z.object({
15
15
  const guard = z.object({
16
16
  tenantId: z.string().max(21),
17
17
  id: z.string().min(1).max(21),
18
- userId: z.string().min(1).max(12),
18
+ userId: z.string().min(1).max(128),
19
19
  issuer: z.string().min(1).max(256),
20
20
  identityId: z.string().min(1).max(128),
21
21
  detail: jsonObjectGuard,
@@ -4,7 +4,7 @@ import { userProfileGuard, identitiesGuard, jsonObjectGuard, mfaVerificationsGua
4
4
  import { UsersPasswordEncryptionMethod } from './custom-types.js';
5
5
  const createGuard = z.object({
6
6
  tenantId: z.string().max(21).optional(),
7
- id: z.string().min(1).max(12),
7
+ id: z.string().min(1).max(128),
8
8
  username: z.string().max(128).nullable().optional(),
9
9
  primaryEmail: z.string().max(128).nullable().optional(),
10
10
  primaryPhone: z.string().max(128).nullable().optional(),
@@ -28,7 +28,7 @@ const createGuard = z.object({
28
28
  });
29
29
  const guard = z.object({
30
30
  tenantId: z.string().max(21),
31
- id: z.string().min(1).max(12),
31
+ id: z.string().min(1).max(128),
32
32
  username: z.string().max(128).nullable(),
33
33
  primaryEmail: z.string().max(128).nullable(),
34
34
  primaryPhone: z.string().max(128).nullable(),
@@ -3,13 +3,13 @@ import { z } from 'zod';
3
3
  const createGuard = z.object({
4
4
  tenantId: z.string().max(21).optional(),
5
5
  id: z.string().min(1).max(21),
6
- userId: z.string().min(1).max(21),
6
+ userId: z.string().min(1).max(128),
7
7
  roleId: z.string().min(1).max(21),
8
8
  });
9
9
  const guard = z.object({
10
10
  tenantId: z.string().max(21),
11
11
  id: z.string().min(1).max(21),
12
- userId: z.string().min(1).max(21),
12
+ userId: z.string().min(1).max(128),
13
13
  roleId: z.string().min(1).max(21),
14
14
  });
15
15
  export const UsersRoles = Object.freeze({
@@ -4,7 +4,7 @@ import { jsonObjectGuard } from './../foundations/index.js';
4
4
  const createGuard = z.object({
5
5
  tenantId: z.string().max(21).optional(),
6
6
  id: z.string().min(1).max(21),
7
- userId: z.string().max(21).nullable().optional(),
7
+ userId: z.string().max(128).nullable().optional(),
8
8
  createdAt: z.number().optional(),
9
9
  expiresAt: z.number(),
10
10
  data: jsonObjectGuard.optional(),
@@ -12,7 +12,7 @@ const createGuard = z.object({
12
12
  const guard = z.object({
13
13
  tenantId: z.string().max(21),
14
14
  id: z.string().min(1).max(21),
15
- userId: z.string().max(21).nullable(),
15
+ userId: z.string().max(128).nullable(),
16
16
  createdAt: z.number(),
17
17
  expiresAt: z.number(),
18
18
  data: jsonObjectGuard,
@@ -3,14 +3,14 @@ import { z } from 'zod';
3
3
  const createGuard = z.object({
4
4
  tenantId: z.string().max(21).optional(),
5
5
  id: z.string().min(1).max(21),
6
- userId: z.string().min(1).max(21),
6
+ userId: z.string().min(1).max(128),
7
7
  createdAt: z.number().optional(),
8
8
  verifiedIdentifier: z.string().max(255).nullable().optional(),
9
9
  });
10
10
  const guard = z.object({
11
11
  tenantId: z.string().max(21),
12
12
  id: z.string().min(1).max(21),
13
- userId: z.string().min(1).max(21),
13
+ userId: z.string().min(1).max(128),
14
14
  createdAt: z.number(),
15
15
  verifiedIdentifier: z.string().max(255).nullable(),
16
16
  });
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  export declare enum CaptchaType {
3
3
  RecaptchaEnterprise = "RecaptchaEnterprise",
4
- Turnstile = "Turnstile"
4
+ Turnstile = "Turnstile",
5
+ Cap = "Cap"
5
6
  }
6
7
  export declare enum RecaptchaEnterpriseMode {
7
8
  Invisible = "invisible",
@@ -28,6 +29,7 @@ export declare const recaptchaEnterpriseConfigGuard: z.ZodObject<{
28
29
  projectId: z.ZodString;
29
30
  domain: z.ZodOptional<z.ZodString>;
30
31
  mode: z.ZodOptional<z.ZodNativeEnum<typeof RecaptchaEnterpriseMode>>;
32
+ scoreThreshold: z.ZodOptional<z.ZodNumber>;
31
33
  }, "strip", z.ZodTypeAny, {
32
34
  type: CaptchaType.RecaptchaEnterprise;
33
35
  siteKey: string;
@@ -35,6 +37,7 @@ export declare const recaptchaEnterpriseConfigGuard: z.ZodObject<{
35
37
  projectId: string;
36
38
  domain?: string | undefined;
37
39
  mode?: RecaptchaEnterpriseMode | undefined;
40
+ scoreThreshold?: number | undefined;
38
41
  }, {
39
42
  type: CaptchaType.RecaptchaEnterprise;
40
43
  siteKey: string;
@@ -42,8 +45,32 @@ export declare const recaptchaEnterpriseConfigGuard: z.ZodObject<{
42
45
  projectId: string;
43
46
  domain?: string | undefined;
44
47
  mode?: RecaptchaEnterpriseMode | undefined;
48
+ scoreThreshold?: number | undefined;
45
49
  }>;
46
50
  export type RecaptchaEnterpriseConfig = z.infer<typeof recaptchaEnterpriseConfigGuard>;
51
+ /**
52
+ * Config of a self-hosted Cap Standalone instance.
53
+ *
54
+ * @see https://capjs.js.org/guide/standalone/
55
+ */
56
+ export declare const capConfigGuard: z.ZodObject<{
57
+ type: z.ZodLiteral<CaptchaType.Cap>;
58
+ /** The public base URL of the Cap Standalone instance, e.g. `https://cap.example.com`. */
59
+ endpoint: z.ZodEffects<z.ZodString, string, string>;
60
+ siteKey: z.ZodString;
61
+ secretKey: z.ZodString;
62
+ }, "strip", z.ZodTypeAny, {
63
+ type: CaptchaType.Cap;
64
+ siteKey: string;
65
+ secretKey: string;
66
+ endpoint: string;
67
+ }, {
68
+ type: CaptchaType.Cap;
69
+ siteKey: string;
70
+ secretKey: string;
71
+ endpoint: string;
72
+ }>;
73
+ export type CapConfig = z.infer<typeof capConfigGuard>;
47
74
  export declare const captchaConfigGuard: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
48
75
  type: z.ZodLiteral<CaptchaType.Turnstile>;
49
76
  siteKey: z.ZodString;
@@ -63,6 +90,7 @@ export declare const captchaConfigGuard: z.ZodDiscriminatedUnion<"type", [z.ZodO
63
90
  projectId: z.ZodString;
64
91
  domain: z.ZodOptional<z.ZodString>;
65
92
  mode: z.ZodOptional<z.ZodNativeEnum<typeof RecaptchaEnterpriseMode>>;
93
+ scoreThreshold: z.ZodOptional<z.ZodNumber>;
66
94
  }, "strip", z.ZodTypeAny, {
67
95
  type: CaptchaType.RecaptchaEnterprise;
68
96
  siteKey: string;
@@ -70,6 +98,7 @@ export declare const captchaConfigGuard: z.ZodDiscriminatedUnion<"type", [z.ZodO
70
98
  projectId: string;
71
99
  domain?: string | undefined;
72
100
  mode?: RecaptchaEnterpriseMode | undefined;
101
+ scoreThreshold?: number | undefined;
73
102
  }, {
74
103
  type: CaptchaType.RecaptchaEnterprise;
75
104
  siteKey: string;
@@ -77,5 +106,22 @@ export declare const captchaConfigGuard: z.ZodDiscriminatedUnion<"type", [z.ZodO
77
106
  projectId: string;
78
107
  domain?: string | undefined;
79
108
  mode?: RecaptchaEnterpriseMode | undefined;
109
+ scoreThreshold?: number | undefined;
110
+ }>, z.ZodObject<{
111
+ type: z.ZodLiteral<CaptchaType.Cap>;
112
+ /** The public base URL of the Cap Standalone instance, e.g. `https://cap.example.com`. */
113
+ endpoint: z.ZodEffects<z.ZodString, string, string>;
114
+ siteKey: z.ZodString;
115
+ secretKey: z.ZodString;
116
+ }, "strip", z.ZodTypeAny, {
117
+ type: CaptchaType.Cap;
118
+ siteKey: string;
119
+ secretKey: string;
120
+ endpoint: string;
121
+ }, {
122
+ type: CaptchaType.Cap;
123
+ siteKey: string;
124
+ secretKey: string;
125
+ endpoint: string;
80
126
  }>]>;
81
127
  export type CaptchaConfig = z.infer<typeof captchaConfigGuard>;