@logto/schemas 1.9.2 → 1.10.1

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 (146) hide show
  1. package/alterations/1.10.1-1695647183-update-private-key-type.ts +108 -0
  2. package/alterations/1.10.1-1696657546-organization-tables.ts +150 -0
  3. package/alterations/1.10.1-1697683802-add-sso-connectors-table.ts +66 -0
  4. package/alterations/1.10.1-1698646271-add-organization-created-flag.ts +75 -0
  5. package/alterations/1.10.1-1698820410-add-user-sso-identities-table.ts +61 -0
  6. package/alterations/1.10.1-1698910485-user-logto-data.ts +20 -0
  7. package/alterations/1.9.2-1695198741-remove-m2m-app-admin-access-switch.ts +52 -24
  8. package/alterations-js/1.10.1-1695647183-update-private-key-type.d.ts +3 -0
  9. package/alterations-js/1.10.1-1695647183-update-private-key-type.js +50 -0
  10. package/alterations-js/1.10.1-1696657546-organization-tables.d.ts +3 -0
  11. package/alterations-js/1.10.1-1696657546-organization-tables.js +136 -0
  12. package/alterations-js/1.10.1-1697683802-add-sso-connectors-table.d.ts +3 -0
  13. package/alterations-js/1.10.1-1697683802-add-sso-connectors-table.js +58 -0
  14. package/alterations-js/1.10.1-1698646271-add-organization-created-flag.d.ts +3 -0
  15. package/alterations-js/1.10.1-1698646271-add-organization-created-flag.js +26 -0
  16. package/alterations-js/1.10.1-1698820410-add-user-sso-identities-table.d.ts +4 -0
  17. package/alterations-js/1.10.1-1698820410-add-user-sso-identities-table.js +53 -0
  18. package/alterations-js/1.10.1-1698910485-user-logto-data.d.ts +3 -0
  19. package/alterations-js/1.10.1-1698910485-user-logto-data.js +16 -0
  20. package/alterations-js/1.9.2-1695198741-remove-m2m-app-admin-access-switch.js +47 -5
  21. package/lib/db-entries/application.d.ts +7 -1
  22. package/lib/db-entries/application.js +1 -0
  23. package/lib/db-entries/applications-role.d.ts +7 -1
  24. package/lib/db-entries/applications-role.js +1 -0
  25. package/lib/db-entries/connector.d.ts +7 -1
  26. package/lib/db-entries/connector.js +1 -0
  27. package/lib/db-entries/custom-phrase.d.ts +7 -1
  28. package/lib/db-entries/custom-phrase.js +1 -0
  29. package/lib/db-entries/daily-active-user.d.ts +7 -1
  30. package/lib/db-entries/daily-active-user.js +1 -0
  31. package/lib/db-entries/domain.d.ts +7 -1
  32. package/lib/db-entries/domain.js +1 -0
  33. package/lib/db-entries/hook.d.ts +7 -1
  34. package/lib/db-entries/hook.js +1 -0
  35. package/lib/db-entries/index.d.ts +8 -0
  36. package/lib/db-entries/index.js +8 -0
  37. package/lib/db-entries/log.d.ts +7 -1
  38. package/lib/db-entries/log.js +1 -0
  39. package/lib/db-entries/logto-config.d.ts +10 -4
  40. package/lib/db-entries/logto-config.js +4 -3
  41. package/lib/db-entries/oidc-model-instance.d.ts +7 -1
  42. package/lib/db-entries/oidc-model-instance.js +1 -0
  43. package/lib/db-entries/organization-role-scope-relation.d.ts +20 -0
  44. package/lib/db-entries/organization-role-scope-relation.js +29 -0
  45. package/lib/db-entries/organization-role-user-relation.d.ts +22 -0
  46. package/lib/db-entries/organization-role-user-relation.js +33 -0
  47. package/lib/db-entries/organization-role.d.ts +28 -0
  48. package/lib/db-entries/organization-role.js +33 -0
  49. package/lib/db-entries/organization-scope.d.ts +28 -0
  50. package/lib/db-entries/organization-scope.js +33 -0
  51. package/lib/db-entries/organization-user-relation.d.ts +20 -0
  52. package/lib/db-entries/organization-user-relation.js +29 -0
  53. package/lib/db-entries/organization.d.ts +32 -0
  54. package/lib/db-entries/organization.js +37 -0
  55. package/lib/db-entries/passcode.d.ts +7 -1
  56. package/lib/db-entries/passcode.js +1 -0
  57. package/lib/db-entries/resource.d.ts +7 -1
  58. package/lib/db-entries/resource.js +1 -0
  59. package/lib/db-entries/role.d.ts +7 -1
  60. package/lib/db-entries/role.js +1 -0
  61. package/lib/db-entries/roles-scope.d.ts +7 -1
  62. package/lib/db-entries/roles-scope.js +1 -0
  63. package/lib/db-entries/scope.d.ts +7 -1
  64. package/lib/db-entries/scope.js +1 -0
  65. package/lib/db-entries/sentinel-activity.d.ts +7 -1
  66. package/lib/db-entries/sentinel-activity.js +1 -0
  67. package/lib/db-entries/service-log.d.ts +7 -1
  68. package/lib/db-entries/service-log.js +1 -0
  69. package/lib/db-entries/sign-in-experience.d.ts +7 -1
  70. package/lib/db-entries/sign-in-experience.js +1 -0
  71. package/lib/db-entries/sso-connector.d.ts +50 -0
  72. package/lib/db-entries/sso-connector.js +58 -0
  73. package/lib/db-entries/system.d.ts +7 -1
  74. package/lib/db-entries/system.js +1 -0
  75. package/lib/db-entries/user-sso-identity.d.ts +30 -0
  76. package/lib/db-entries/user-sso-identity.js +46 -0
  77. package/lib/db-entries/user.d.ts +9 -1
  78. package/lib/db-entries/user.js +5 -0
  79. package/lib/db-entries/users-role.d.ts +7 -1
  80. package/lib/db-entries/users-role.js +1 -0
  81. package/lib/db-entries/verification-status.d.ts +7 -1
  82. package/lib/db-entries/verification-status.js +1 -0
  83. package/lib/foundations/index.d.ts +1 -1
  84. package/lib/foundations/index.js +1 -1
  85. package/lib/foundations/jsonb-types/custom-domain.d.ts +134 -0
  86. package/lib/foundations/jsonb-types/custom-domain.js +36 -0
  87. package/lib/foundations/jsonb-types/hooks.d.ts +32 -0
  88. package/lib/foundations/jsonb-types/hooks.js +24 -0
  89. package/lib/foundations/jsonb-types/index.d.ts +15 -0
  90. package/lib/foundations/jsonb-types/index.js +16 -0
  91. package/lib/foundations/jsonb-types/logs.d.ts +106 -0
  92. package/lib/foundations/jsonb-types/logs.js +20 -0
  93. package/lib/foundations/jsonb-types/oidc-module.d.ts +80 -0
  94. package/lib/foundations/jsonb-types/oidc-module.js +54 -0
  95. package/lib/foundations/jsonb-types/phrases.d.ts +5 -0
  96. package/lib/foundations/jsonb-types/phrases.js +2 -0
  97. package/lib/foundations/jsonb-types/sentinel.d.ts +27 -0
  98. package/lib/foundations/jsonb-types/sentinel.js +28 -0
  99. package/lib/foundations/jsonb-types/sign-in-experience.d.ts +118 -0
  100. package/lib/foundations/jsonb-types/sign-in-experience.js +56 -0
  101. package/lib/foundations/jsonb-types/sso-connector.d.ts +14 -0
  102. package/lib/foundations/jsonb-types/sso-connector.js +6 -0
  103. package/lib/foundations/jsonb-types/users.d.ts +285 -0
  104. package/lib/foundations/jsonb-types/users.js +47 -0
  105. package/lib/foundations/schemas.d.ts +11 -13
  106. package/lib/models/tenants.d.ts +7 -11
  107. package/lib/seeds/logto-config.js +1 -0
  108. package/lib/types/application.d.ts +51 -1
  109. package/lib/types/application.js +7 -1
  110. package/lib/types/connector.d.ts +516 -2360
  111. package/lib/types/domain.d.ts +65 -27
  112. package/lib/types/hook.d.ts +15 -16
  113. package/lib/types/index.d.ts +3 -0
  114. package/lib/types/index.js +3 -0
  115. package/lib/types/interactions.d.ts +502 -10
  116. package/lib/types/interactions.js +83 -5
  117. package/lib/types/log/interaction.d.ts +4 -3
  118. package/lib/types/log/interaction.js +1 -0
  119. package/lib/types/logto-config.d.ts +50 -2
  120. package/lib/types/logto-config.js +30 -3
  121. package/lib/types/mfa.d.ts +211 -0
  122. package/lib/types/mfa.js +62 -0
  123. package/lib/types/organization.d.ts +44 -0
  124. package/lib/types/organization.js +20 -0
  125. package/lib/types/role.d.ts +5 -3
  126. package/lib/types/scope.d.ts +12 -27
  127. package/lib/types/sso-connector.d.ts +21 -0
  128. package/lib/types/sso-connector.js +10 -0
  129. package/lib/types/system.d.ts +26 -7
  130. package/lib/types/system.js +8 -0
  131. package/lib/types/user-assets.d.ts +2 -2
  132. package/lib/types/user.d.ts +209 -66
  133. package/lib/types/user.js +8 -2
  134. package/package.json +7 -7
  135. package/tables/logto_configs.sql +1 -1
  136. package/tables/organization_role_scope_relations.sql +12 -0
  137. package/tables/organization_role_user_relations.sql +14 -0
  138. package/tables/organization_roles.sql +19 -0
  139. package/tables/organization_scopes.sql +19 -0
  140. package/tables/organization_user_relations.sql +12 -0
  141. package/tables/organizations.sql +19 -0
  142. package/tables/sso_connectors.sql +29 -0
  143. package/tables/user_sso_identities.sql +17 -0
  144. package/tables/users.sql +1 -0
  145. package/lib/foundations/jsonb-types.d.ts +0 -673
  146. package/lib/foundations/jsonb-types.js +0 -260
@@ -0,0 +1,106 @@
1
+ import { type PasswordPolicy } from '@logto/core-kit';
2
+ import { type DeepPartial } from '@silverhand/essentials';
3
+ import { z } from 'zod';
4
+ export declare enum LogResult {
5
+ Success = "Success",
6
+ Error = "Error"
7
+ }
8
+ export declare const logContextPayloadGuard: z.ZodObject<{
9
+ key: z.ZodString;
10
+ result: z.ZodNativeEnum<typeof LogResult>;
11
+ error: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodString]>>;
12
+ ip: z.ZodOptional<z.ZodString>;
13
+ userAgent: z.ZodOptional<z.ZodString>;
14
+ userId: z.ZodOptional<z.ZodString>;
15
+ applicationId: z.ZodOptional<z.ZodString>;
16
+ sessionId: z.ZodOptional<z.ZodString>;
17
+ }, "strip", z.ZodUnknown, z.objectOutputType<{
18
+ key: z.ZodString;
19
+ result: z.ZodNativeEnum<typeof LogResult>;
20
+ error: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodString]>>;
21
+ ip: z.ZodOptional<z.ZodString>;
22
+ userAgent: z.ZodOptional<z.ZodString>;
23
+ userId: z.ZodOptional<z.ZodString>;
24
+ applicationId: z.ZodOptional<z.ZodString>;
25
+ sessionId: z.ZodOptional<z.ZodString>;
26
+ }, z.ZodUnknown, "strip">, z.objectInputType<{
27
+ key: z.ZodString;
28
+ result: z.ZodNativeEnum<typeof LogResult>;
29
+ error: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodString]>>;
30
+ ip: z.ZodOptional<z.ZodString>;
31
+ userAgent: z.ZodOptional<z.ZodString>;
32
+ userId: z.ZodOptional<z.ZodString>;
33
+ applicationId: z.ZodOptional<z.ZodString>;
34
+ sessionId: z.ZodOptional<z.ZodString>;
35
+ }, z.ZodUnknown, "strip">>;
36
+ export type PartialPasswordPolicy = DeepPartial<PasswordPolicy>;
37
+ export declare const partialPasswordPolicyGuard: z.ZodObject<{
38
+ length: z.ZodOptional<z.ZodDefault<z.ZodObject<{
39
+ min: z.ZodDefault<z.ZodNumber>;
40
+ max: z.ZodDefault<z.ZodNumber>;
41
+ }, "strip", z.ZodTypeAny, {
42
+ min: number;
43
+ max: number;
44
+ }, {
45
+ min?: number | undefined;
46
+ max?: number | undefined;
47
+ }>>>;
48
+ characterTypes: z.ZodOptional<z.ZodDefault<z.ZodObject<{
49
+ min: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ min: number;
52
+ }, {
53
+ min?: number | undefined;
54
+ }>>>;
55
+ rejects: z.ZodOptional<z.ZodDefault<z.ZodObject<{
56
+ pwned: z.ZodDefault<z.ZodBoolean>;
57
+ repetitionAndSequence: z.ZodDefault<z.ZodBoolean>;
58
+ userInfo: z.ZodDefault<z.ZodBoolean>;
59
+ words: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ pwned: boolean;
62
+ repetitionAndSequence: boolean;
63
+ userInfo: boolean;
64
+ words: string[];
65
+ }, {
66
+ pwned?: boolean | undefined;
67
+ repetitionAndSequence?: boolean | undefined;
68
+ userInfo?: boolean | undefined;
69
+ words?: string[] | undefined;
70
+ }>>>;
71
+ }, "strip", z.ZodTypeAny, {
72
+ length?: {
73
+ min: number;
74
+ max: number;
75
+ } | undefined;
76
+ characterTypes?: {
77
+ min: number;
78
+ } | undefined;
79
+ rejects?: {
80
+ pwned: boolean;
81
+ repetitionAndSequence: boolean;
82
+ userInfo: boolean;
83
+ words: string[];
84
+ } | undefined;
85
+ }, {
86
+ length?: {
87
+ min?: number | undefined;
88
+ max?: number | undefined;
89
+ } | undefined;
90
+ characterTypes?: {
91
+ min?: number | undefined;
92
+ } | undefined;
93
+ rejects?: {
94
+ pwned?: boolean | undefined;
95
+ repetitionAndSequence?: boolean | undefined;
96
+ userInfo?: boolean | undefined;
97
+ words?: string[] | undefined;
98
+ } | undefined;
99
+ }>;
100
+ /**
101
+ * The basic log context type. It's more about a type hint instead of forcing the log shape.
102
+ *
103
+ * Note when setting up a log function, the type of log key in function arguments should be `LogKey`.
104
+ * Here we use `string` to make it compatible with the Zod guard.
105
+ **/
106
+ export type LogContextPayload = z.infer<typeof logContextPayloadGuard>;
@@ -0,0 +1,20 @@
1
+ import { passwordPolicyGuard } from '@logto/core-kit';
2
+ import { z } from 'zod';
3
+ export var LogResult;
4
+ (function (LogResult) {
5
+ LogResult["Success"] = "Success";
6
+ LogResult["Error"] = "Error";
7
+ })(LogResult || (LogResult = {}));
8
+ export const logContextPayloadGuard = z
9
+ .object({
10
+ key: z.string(),
11
+ result: z.nativeEnum(LogResult),
12
+ error: z.record(z.string(), z.unknown()).or(z.string()).optional(),
13
+ ip: z.string().optional(),
14
+ userAgent: z.string().optional(),
15
+ userId: z.string().optional(),
16
+ applicationId: z.string().optional(),
17
+ sessionId: z.string().optional(),
18
+ })
19
+ .catchall(z.unknown());
20
+ export const partialPasswordPolicyGuard = passwordPolicyGuard.deepPartial();
@@ -0,0 +1,80 @@
1
+ import { z } from 'zod';
2
+ export declare const oidcModelInstancePayloadGuard: z.ZodObject<{
3
+ userCode: z.ZodOptional<z.ZodString>;
4
+ uid: z.ZodOptional<z.ZodString>;
5
+ grantId: z.ZodOptional<z.ZodString>;
6
+ }, "strip", z.ZodUnknown, z.objectOutputType<{
7
+ userCode: z.ZodOptional<z.ZodString>;
8
+ uid: z.ZodOptional<z.ZodString>;
9
+ grantId: z.ZodOptional<z.ZodString>;
10
+ }, z.ZodUnknown, "strip">, z.objectInputType<{
11
+ userCode: z.ZodOptional<z.ZodString>;
12
+ uid: z.ZodOptional<z.ZodString>;
13
+ grantId: z.ZodOptional<z.ZodString>;
14
+ }, z.ZodUnknown, "strip">>;
15
+ export type OidcModelInstancePayload = z.infer<typeof oidcModelInstancePayloadGuard>;
16
+ export declare const oidcClientMetadataGuard: z.ZodObject<{
17
+ redirectUris: z.ZodArray<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodEffects<z.ZodString, string, string>]>, "many">;
18
+ postLogoutRedirectUris: z.ZodArray<z.ZodString, "many">;
19
+ logoUri: z.ZodOptional<z.ZodString>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ redirectUris: string[];
22
+ postLogoutRedirectUris: string[];
23
+ logoUri?: string | undefined;
24
+ }, {
25
+ redirectUris: string[];
26
+ postLogoutRedirectUris: string[];
27
+ logoUri?: string | undefined;
28
+ }>;
29
+ export type OidcClientMetadata = z.infer<typeof oidcClientMetadataGuard>;
30
+ export declare enum CustomClientMetadataKey {
31
+ CorsAllowedOrigins = "corsAllowedOrigins",
32
+ IdTokenTtl = "idTokenTtl",
33
+ /** @deprecated Use {@link RefreshTokenTtlInDays} instead. */
34
+ RefreshTokenTtl = "refreshTokenTtl",
35
+ RefreshTokenTtlInDays = "refreshTokenTtlInDays",
36
+ TenantId = "tenantId",
37
+ /**
38
+ * Enabling this configuration will allow Logto to always issue Refresh Tokens, regardless of whether `prompt=consent` is presented in the authentication request.
39
+ *
40
+ * It only works for web applications when the client allowed grant types includes `refresh_token`.
41
+ *
42
+ * This config is for the third-party integrations that do not strictly follow OpenID Connect standards due to some reasons (e.g. they only know OAuth, but requires a Refresh Token to be returned anyway).
43
+ */
44
+ AlwaysIssueRefreshToken = "alwaysIssueRefreshToken",
45
+ /**
46
+ * When enabled (default), Logto will issue a new Refresh Token for token requests when 70% of the original Time to Live (TTL) has passed.
47
+ *
48
+ * It can be turned off for only traditional web apps for enhanced security.
49
+ */
50
+ RotateRefreshToken = "rotateRefreshToken"
51
+ }
52
+ export declare const customClientMetadataGuard: z.ZodObject<{
53
+ corsAllowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
54
+ idTokenTtl: z.ZodOptional<z.ZodNumber>;
55
+ refreshTokenTtl: z.ZodOptional<z.ZodNumber>;
56
+ refreshTokenTtlInDays: z.ZodOptional<z.ZodNumber>;
57
+ tenantId: z.ZodOptional<z.ZodString>;
58
+ alwaysIssueRefreshToken: z.ZodOptional<z.ZodBoolean>;
59
+ rotateRefreshToken: z.ZodOptional<z.ZodBoolean>;
60
+ }, "strip", z.ZodTypeAny, {
61
+ corsAllowedOrigins?: string[] | undefined;
62
+ idTokenTtl?: number | undefined;
63
+ refreshTokenTtl?: number | undefined;
64
+ refreshTokenTtlInDays?: number | undefined;
65
+ tenantId?: string | undefined;
66
+ alwaysIssueRefreshToken?: boolean | undefined;
67
+ rotateRefreshToken?: boolean | undefined;
68
+ }, {
69
+ corsAllowedOrigins?: string[] | undefined;
70
+ idTokenTtl?: number | undefined;
71
+ refreshTokenTtl?: number | undefined;
72
+ refreshTokenTtlInDays?: number | undefined;
73
+ tenantId?: string | undefined;
74
+ alwaysIssueRefreshToken?: boolean | undefined;
75
+ rotateRefreshToken?: boolean | undefined;
76
+ }>;
77
+ /**
78
+ * @see {@link CustomClientMetadataKey} for key descriptions.
79
+ */
80
+ export type CustomClientMetadata = z.infer<typeof customClientMetadataGuard>;
@@ -0,0 +1,54 @@
1
+ import { validateRedirectUrl } from '@logto/core-kit';
2
+ import { z } from 'zod';
3
+ export const oidcModelInstancePayloadGuard = z
4
+ .object({
5
+ userCode: z.string().optional(),
6
+ uid: z.string().optional(),
7
+ grantId: z.string().optional(),
8
+ })
9
+ /**
10
+ * Try to use `.passthrough()` if type has been fixed.
11
+ * https://github.com/colinhacks/zod/issues/452
12
+ */
13
+ .catchall(z.unknown());
14
+ export const oidcClientMetadataGuard = z.object({
15
+ redirectUris: z
16
+ .string()
17
+ .refine((url) => validateRedirectUrl(url, 'web'))
18
+ .or(z.string().refine((url) => validateRedirectUrl(url, 'mobile')))
19
+ .array(),
20
+ postLogoutRedirectUris: z.string().url().array(),
21
+ logoUri: z.string().optional(),
22
+ });
23
+ export var CustomClientMetadataKey;
24
+ (function (CustomClientMetadataKey) {
25
+ CustomClientMetadataKey["CorsAllowedOrigins"] = "corsAllowedOrigins";
26
+ CustomClientMetadataKey["IdTokenTtl"] = "idTokenTtl";
27
+ /** @deprecated Use {@link RefreshTokenTtlInDays} instead. */
28
+ CustomClientMetadataKey["RefreshTokenTtl"] = "refreshTokenTtl";
29
+ CustomClientMetadataKey["RefreshTokenTtlInDays"] = "refreshTokenTtlInDays";
30
+ CustomClientMetadataKey["TenantId"] = "tenantId";
31
+ /**
32
+ * Enabling this configuration will allow Logto to always issue Refresh Tokens, regardless of whether `prompt=consent` is presented in the authentication request.
33
+ *
34
+ * It only works for web applications when the client allowed grant types includes `refresh_token`.
35
+ *
36
+ * This config is for the third-party integrations that do not strictly follow OpenID Connect standards due to some reasons (e.g. they only know OAuth, but requires a Refresh Token to be returned anyway).
37
+ */
38
+ CustomClientMetadataKey["AlwaysIssueRefreshToken"] = "alwaysIssueRefreshToken";
39
+ /**
40
+ * When enabled (default), Logto will issue a new Refresh Token for token requests when 70% of the original Time to Live (TTL) has passed.
41
+ *
42
+ * It can be turned off for only traditional web apps for enhanced security.
43
+ */
44
+ CustomClientMetadataKey["RotateRefreshToken"] = "rotateRefreshToken";
45
+ })(CustomClientMetadataKey || (CustomClientMetadataKey = {}));
46
+ export const customClientMetadataGuard = z.object({
47
+ [CustomClientMetadataKey.CorsAllowedOrigins]: z.string().min(1).array().optional(),
48
+ [CustomClientMetadataKey.IdTokenTtl]: z.number().optional(),
49
+ [CustomClientMetadataKey.RefreshTokenTtl]: z.number().optional(),
50
+ [CustomClientMetadataKey.RefreshTokenTtlInDays]: z.number().int().min(1).max(90).optional(),
51
+ [CustomClientMetadataKey.TenantId]: z.string().optional(),
52
+ [CustomClientMetadataKey.AlwaysIssueRefreshToken]: z.boolean().optional(),
53
+ [CustomClientMetadataKey.RotateRefreshToken]: z.boolean().optional(),
54
+ });
@@ -0,0 +1,5 @@
1
+ import { z } from 'zod';
2
+ export type Translation = {
3
+ [key: string]: string | Translation;
4
+ };
5
+ export declare const translationGuard: z.ZodType<Translation>;
@@ -0,0 +1,2 @@
1
+ import { z } from 'zod';
2
+ export const translationGuard = z.lazy(() => z.record(z.string().or(translationGuard)));
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ /** The action target type of a sentinel activity. */
3
+ export declare enum SentinelActivityTargetType {
4
+ User = "User",
5
+ App = "App"
6
+ }
7
+ export declare const sentinelActivityTargetTypeGuard: z.ZodNativeEnum<typeof SentinelActivityTargetType>;
8
+ /** The action type of a sentinel activity. */
9
+ export declare enum SentinelActivityAction {
10
+ /**
11
+ * The subject tries to pass a verification by inputting a password.
12
+ *
13
+ * For example, a user (subject) who inputted a password (action) to authenticate themselves
14
+ * (target).
15
+ */
16
+ Password = "Password",
17
+ /**
18
+ * The subject tries to pass a verification by inputting a verification code.
19
+ *
20
+ * For example, a user (subject) who inputted a verification code (action) to authenticate
21
+ * themselves (target).
22
+ */
23
+ VerificationCode = "VerificationCode"
24
+ }
25
+ export declare const sentinelActivityActionGuard: z.ZodNativeEnum<typeof SentinelActivityAction>;
26
+ export type SentinelActivityPayload = Record<string, unknown>;
27
+ export declare const sentinelActivityPayloadGuard: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ /** The action target type of a sentinel activity. */
3
+ export var SentinelActivityTargetType;
4
+ (function (SentinelActivityTargetType) {
5
+ SentinelActivityTargetType["User"] = "User";
6
+ SentinelActivityTargetType["App"] = "App";
7
+ })(SentinelActivityTargetType || (SentinelActivityTargetType = {}));
8
+ export const sentinelActivityTargetTypeGuard = z.nativeEnum(SentinelActivityTargetType);
9
+ /** The action type of a sentinel activity. */
10
+ export var SentinelActivityAction;
11
+ (function (SentinelActivityAction) {
12
+ /**
13
+ * The subject tries to pass a verification by inputting a password.
14
+ *
15
+ * For example, a user (subject) who inputted a password (action) to authenticate themselves
16
+ * (target).
17
+ */
18
+ SentinelActivityAction["Password"] = "Password";
19
+ /**
20
+ * The subject tries to pass a verification by inputting a verification code.
21
+ *
22
+ * For example, a user (subject) who inputted a verification code (action) to authenticate
23
+ * themselves (target).
24
+ */
25
+ SentinelActivityAction["VerificationCode"] = "VerificationCode";
26
+ })(SentinelActivityAction || (SentinelActivityAction = {}));
27
+ export const sentinelActivityActionGuard = z.nativeEnum(SentinelActivityAction);
28
+ export const sentinelActivityPayloadGuard = z.record(z.unknown());
@@ -0,0 +1,118 @@
1
+ import { z } from 'zod';
2
+ export declare const colorGuard: z.ZodObject<{
3
+ primaryColor: z.ZodString;
4
+ isDarkModeEnabled: z.ZodBoolean;
5
+ darkPrimaryColor: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ primaryColor: string;
8
+ isDarkModeEnabled: boolean;
9
+ darkPrimaryColor: string;
10
+ }, {
11
+ primaryColor: string;
12
+ isDarkModeEnabled: boolean;
13
+ darkPrimaryColor: string;
14
+ }>;
15
+ export type Color = z.infer<typeof colorGuard>;
16
+ export declare const brandingGuard: z.ZodObject<{
17
+ logoUrl: z.ZodOptional<z.ZodString>;
18
+ darkLogoUrl: z.ZodOptional<z.ZodString>;
19
+ favicon: z.ZodOptional<z.ZodString>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ logoUrl?: string | undefined;
22
+ darkLogoUrl?: string | undefined;
23
+ favicon?: string | undefined;
24
+ }, {
25
+ logoUrl?: string | undefined;
26
+ darkLogoUrl?: string | undefined;
27
+ favicon?: string | undefined;
28
+ }>;
29
+ export type Branding = z.infer<typeof brandingGuard>;
30
+ export declare const languageInfoGuard: z.ZodObject<{
31
+ autoDetect: z.ZodBoolean;
32
+ fallbackLanguage: z.ZodType<"af-ZA" | "am-ET" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR", z.ZodTypeDef, "af-ZA" | "am-ET" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR">;
33
+ }, "strip", z.ZodTypeAny, {
34
+ autoDetect: boolean;
35
+ fallbackLanguage: "af-ZA" | "am-ET" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR";
36
+ }, {
37
+ autoDetect: boolean;
38
+ fallbackLanguage: "af-ZA" | "am-ET" | "ar-AR" | "as-IN" | "az-AZ" | "be-BY" | "bg-BG" | "bn-IN" | "br-FR" | "bs-BA" | "ca-ES" | "cb-IQ" | "co-FR" | "cs-CZ" | "cx-PH" | "cy-GB" | "da-DK" | "de" | "de-DE" | "el-GR" | "en" | "en-GB" | "en-US" | "eo-EO" | "es" | "es-ES" | "es-419" | "et-EE" | "eu-ES" | "fa-IR" | "ff-NG" | "fi-FI" | "fo-FO" | "fr" | "fr-CA" | "fr-FR" | "fy-NL" | "ga-IE" | "gl-ES" | "gn-PY" | "gu-IN" | "ha-NG" | "he-IL" | "hi-IN" | "hr-HR" | "ht-HT" | "hu-HU" | "hy-AM" | "id-ID" | "ik-US" | "is-IS" | "it" | "it-IT" | "iu-CA" | "ja" | "ja-JP" | "ja-KS" | "jv-ID" | "ka-GE" | "kk-KZ" | "km-KH" | "kn-IN" | "ko" | "ko-KR" | "ku-TR" | "ky-KG" | "lo-LA" | "lt-LT" | "lv-LV" | "mg-MG" | "mk-MK" | "ml-IN" | "mn-MN" | "mr-IN" | "ms-MY" | "mt-MT" | "my-MM" | "nb-NO" | "ne-NP" | "nl-BE" | "nl-NL" | "nn-NO" | "or-IN" | "pa-IN" | "pl-PL" | "ps-AF" | "pt" | "pt-BR" | "pt-PT" | "ro-RO" | "ru" | "ru-RU" | "rw-RW" | "sc-IT" | "si-LK" | "sk-SK" | "sl-SI" | "sn-ZW" | "sq-AL" | "sr-RS" | "sv-SE" | "sw-KE" | "sy-SY" | "sz-PL" | "ta-IN" | "te-IN" | "tg-TJ" | "th-TH" | "tl-PH" | "tr" | "tr-TR" | "tt-RU" | "tz-MA" | "uk-UA" | "ur-PK" | "uz-UZ" | "vi-VN" | "zh" | "zh-CN" | "zh-HK" | "zh-MO" | "zh-TW" | "zz-TR";
39
+ }>;
40
+ export type LanguageInfo = z.infer<typeof languageInfoGuard>;
41
+ export declare enum SignInIdentifier {
42
+ Username = "username",
43
+ Email = "email",
44
+ Phone = "phone"
45
+ }
46
+ export declare const signUpGuard: z.ZodObject<{
47
+ identifiers: z.ZodArray<z.ZodNativeEnum<typeof SignInIdentifier>, "many">;
48
+ password: z.ZodBoolean;
49
+ verify: z.ZodBoolean;
50
+ }, "strip", z.ZodTypeAny, {
51
+ identifiers: SignInIdentifier[];
52
+ password: boolean;
53
+ verify: boolean;
54
+ }, {
55
+ identifiers: SignInIdentifier[];
56
+ password: boolean;
57
+ verify: boolean;
58
+ }>;
59
+ export type SignUp = z.infer<typeof signUpGuard>;
60
+ export declare const signInGuard: z.ZodObject<{
61
+ methods: z.ZodArray<z.ZodObject<{
62
+ identifier: z.ZodNativeEnum<typeof SignInIdentifier>;
63
+ password: z.ZodBoolean;
64
+ verificationCode: z.ZodBoolean;
65
+ isPasswordPrimary: z.ZodBoolean;
66
+ }, "strip", z.ZodTypeAny, {
67
+ password: boolean;
68
+ identifier: SignInIdentifier;
69
+ verificationCode: boolean;
70
+ isPasswordPrimary: boolean;
71
+ }, {
72
+ password: boolean;
73
+ identifier: SignInIdentifier;
74
+ verificationCode: boolean;
75
+ isPasswordPrimary: boolean;
76
+ }>, "many">;
77
+ }, "strip", z.ZodTypeAny, {
78
+ methods: {
79
+ password: boolean;
80
+ identifier: SignInIdentifier;
81
+ verificationCode: boolean;
82
+ isPasswordPrimary: boolean;
83
+ }[];
84
+ }, {
85
+ methods: {
86
+ password: boolean;
87
+ identifier: SignInIdentifier;
88
+ verificationCode: boolean;
89
+ isPasswordPrimary: boolean;
90
+ }[];
91
+ }>;
92
+ export type SignIn = z.infer<typeof signInGuard>;
93
+ export declare const connectorTargetsGuard: z.ZodArray<z.ZodString, "many">;
94
+ export type ConnectorTargets = z.infer<typeof connectorTargetsGuard>;
95
+ export declare const customContentGuard: z.ZodRecord<z.ZodString, z.ZodString>;
96
+ export type CustomContent = z.infer<typeof customContentGuard>;
97
+ export declare enum MfaFactor {
98
+ TOTP = "Totp",
99
+ WebAuthn = "WebAuthn",
100
+ BackupCode = "BackupCode"
101
+ }
102
+ export declare const mfaFactorsGuard: z.ZodArray<z.ZodNativeEnum<typeof MfaFactor>, "many">;
103
+ export type MfaFactors = z.infer<typeof mfaFactorsGuard>;
104
+ export declare enum MfaPolicy {
105
+ UserControlled = "UserControlled",
106
+ Mandatory = "Mandatory"
107
+ }
108
+ export declare const mfaGuard: z.ZodObject<{
109
+ factors: z.ZodArray<z.ZodNativeEnum<typeof MfaFactor>, "many">;
110
+ policy: z.ZodNativeEnum<typeof MfaPolicy>;
111
+ }, "strip", z.ZodTypeAny, {
112
+ factors: MfaFactor[];
113
+ policy: MfaPolicy;
114
+ }, {
115
+ factors: MfaFactor[];
116
+ policy: MfaPolicy;
117
+ }>;
118
+ export type Mfa = z.infer<typeof mfaGuard>;
@@ -0,0 +1,56 @@
1
+ import { hexColorRegEx } from '@logto/core-kit';
2
+ import { languageTagGuard } from '@logto/language-kit';
3
+ import { z } from 'zod';
4
+ export const colorGuard = z.object({
5
+ primaryColor: z.string().regex(hexColorRegEx),
6
+ isDarkModeEnabled: z.boolean(),
7
+ darkPrimaryColor: z.string().regex(hexColorRegEx),
8
+ });
9
+ export const brandingGuard = z.object({
10
+ logoUrl: z.string().url().optional(),
11
+ darkLogoUrl: z.string().url().optional(),
12
+ favicon: z.string().url().optional(),
13
+ });
14
+ export const languageInfoGuard = z.object({
15
+ autoDetect: z.boolean(),
16
+ fallbackLanguage: languageTagGuard,
17
+ });
18
+ export var SignInIdentifier;
19
+ (function (SignInIdentifier) {
20
+ SignInIdentifier["Username"] = "username";
21
+ SignInIdentifier["Email"] = "email";
22
+ SignInIdentifier["Phone"] = "phone";
23
+ })(SignInIdentifier || (SignInIdentifier = {}));
24
+ export const signUpGuard = z.object({
25
+ identifiers: z.nativeEnum(SignInIdentifier).array(),
26
+ password: z.boolean(),
27
+ verify: z.boolean(),
28
+ });
29
+ export const signInGuard = z.object({
30
+ methods: z
31
+ .object({
32
+ identifier: z.nativeEnum(SignInIdentifier),
33
+ password: z.boolean(),
34
+ verificationCode: z.boolean(),
35
+ isPasswordPrimary: z.boolean(),
36
+ })
37
+ .array(),
38
+ });
39
+ export const connectorTargetsGuard = z.string().array();
40
+ export const customContentGuard = z.record(z.string());
41
+ export var MfaFactor;
42
+ (function (MfaFactor) {
43
+ MfaFactor["TOTP"] = "Totp";
44
+ MfaFactor["WebAuthn"] = "WebAuthn";
45
+ MfaFactor["BackupCode"] = "BackupCode";
46
+ })(MfaFactor || (MfaFactor = {}));
47
+ export const mfaFactorsGuard = z.nativeEnum(MfaFactor).array();
48
+ export var MfaPolicy;
49
+ (function (MfaPolicy) {
50
+ MfaPolicy["UserControlled"] = "UserControlled";
51
+ MfaPolicy["Mandatory"] = "Mandatory";
52
+ })(MfaPolicy || (MfaPolicy = {}));
53
+ export const mfaGuard = z.object({
54
+ factors: mfaFactorsGuard,
55
+ policy: z.nativeEnum(MfaPolicy),
56
+ });
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ export declare const ssoDomainsGuard: z.ZodArray<z.ZodString, "many">;
3
+ export type SsoDomains = z.infer<typeof ssoDomainsGuard>;
4
+ export declare const ssoBrandingGuard: z.ZodObject<{
5
+ logo: z.ZodOptional<z.ZodString>;
6
+ darkLogo: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ logo?: string | undefined;
9
+ darkLogo?: string | undefined;
10
+ }, {
11
+ logo?: string | undefined;
12
+ darkLogo?: string | undefined;
13
+ }>;
14
+ export type SsoBranding = z.infer<typeof ssoBrandingGuard>;
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ export const ssoDomainsGuard = z.array(z.string());
3
+ export const ssoBrandingGuard = z.object({
4
+ logo: z.string().optional(),
5
+ darkLogo: z.string().optional(),
6
+ });