@logto/schemas 1.28.0 → 1.30.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.
- package/alterations/1.29.0-1748832174-add-webauthn-related-origins.ts +20 -0
- package/alterations/1.29.0-1749005587-user-sso-identities-table-add-updated-at-column.ts +31 -0
- package/alterations/1.29.0-1749026308-add-oidc-session-extension-table.ts +41 -0
- package/alterations/1.29.0-1749523818-add-custom-profile-fields.ts +58 -0
- package/alterations/1.29.0-1749724664-drop-sie-order-constraint-from-custom-profile-fields.ts +20 -0
- package/alterations/1.29.0-1750663091-change-user-password-encrypted-length.ts +18 -0
- package/alterations/1.29.0-1750744518-add-secrets-table.ts +50 -0
- package/alterations/1.29.0-1750744539-add-secret-connector-relations-table.ts +109 -0
- package/alterations/1.30.0-1750744685-add-triggers-to-delete-secrets-on-social-identities-deletion.ts +81 -0
- package/alterations/1.30.0-1750748516-add-enable-token-storage-column-to-connectors-table.ts +20 -0
- package/alterations/1.30.0-1751255436-split-secret-connector-relatioins-table.ts +359 -0
- package/alterations/1.30.0-1751337183-add-require-mfa-on-sign-in-to-users.ts +20 -0
- package/alterations/1.30.0-1751400000-move-require-mfa-on-sign-in-to-logto-config.ts +21 -0
- package/alterations/1.30.0-1751529530-add-enable-token-storage-column-to-sso-connectors-table.ts +20 -0
- package/alterations/1.30.0-1752630302-alterate-enable-column-default-value-in-account-centers-table.ts +20 -0
- package/alterations/1.30.0-1753669579-add-organization-user-relations-foreign-key.ts +46 -0
- package/alterations-js/1.29.0-1748832174-add-webauthn-related-origins.js +16 -0
- package/alterations-js/1.29.0-1749005587-user-sso-identities-table-add-updated-at-column.js +25 -0
- package/alterations-js/1.29.0-1749026308-add-oidc-session-extension-table.js +33 -0
- package/alterations-js/1.29.0-1749523818-add-custom-profile-fields.js +52 -0
- package/alterations-js/1.29.0-1749724664-drop-sie-order-constraint-from-custom-profile-fields.js +16 -0
- package/alterations-js/1.29.0-1750663091-change-user-password-encrypted-length.js +14 -0
- package/alterations-js/1.29.0-1750744518-add-secrets-table.js +42 -0
- package/alterations-js/1.29.0-1750744539-add-secret-connector-relations-table.js +99 -0
- package/alterations-js/1.30.0-1750744685-add-triggers-to-delete-secrets-on-social-identities-deletion.js +76 -0
- package/alterations-js/1.30.0-1750748516-add-enable-token-storage-column-to-connectors-table.js +16 -0
- package/alterations-js/1.30.0-1751255436-split-secret-connector-relatioins-table.js +338 -0
- package/alterations-js/1.30.0-1751337183-add-require-mfa-on-sign-in-to-users.js +16 -0
- package/alterations-js/1.30.0-1751400000-move-require-mfa-on-sign-in-to-logto-config.js +17 -0
- package/alterations-js/1.30.0-1751529530-add-enable-token-storage-column-to-sso-connectors-table.js +16 -0
- package/alterations-js/1.30.0-1752630302-alterate-enable-column-default-value-in-account-centers-table.js +16 -0
- package/alterations-js/1.30.0-1753669579-add-organization-user-relations-foreign-key.js +38 -0
- package/lib/consts/oidc.d.ts +9 -1
- package/lib/consts/oidc.js +5 -0
- package/lib/db-entries/account-center.d.ts +4 -2
- package/lib/db-entries/account-center.js +5 -1
- package/lib/db-entries/connector.d.ts +5 -1
- package/lib/db-entries/connector.js +4 -0
- package/lib/db-entries/custom-profile-field.d.ts +32 -0
- package/lib/db-entries/custom-profile-field.js +58 -0
- package/lib/db-entries/index.d.ts +5 -0
- package/lib/db-entries/index.js +5 -0
- package/lib/db-entries/oidc-session-extension.d.ts +24 -0
- package/lib/db-entries/oidc-session-extension.js +42 -0
- package/lib/db-entries/secret-enterprise-sso-connector-relation.d.ts +28 -0
- package/lib/db-entries/secret-enterprise-sso-connector-relation.js +37 -0
- package/lib/db-entries/secret-social-connector-relation.d.ts +28 -0
- package/lib/db-entries/secret-social-connector-relation.js +37 -0
- package/lib/db-entries/secret.d.ts +44 -0
- package/lib/db-entries/secret.js +62 -0
- package/lib/db-entries/sso-connector.d.ts +5 -1
- package/lib/db-entries/sso-connector.js +4 -0
- package/lib/db-entries/user-sso-identity.d.ts +5 -1
- package/lib/db-entries/user-sso-identity.js +4 -0
- package/lib/db-entries/user.js +2 -2
- package/lib/foundations/jsonb-types/account-centers.d.ts +5 -0
- package/lib/foundations/jsonb-types/account-centers.js +2 -0
- package/lib/foundations/jsonb-types/custom-profile-fields.d.ts +441 -0
- package/lib/foundations/jsonb-types/custom-profile-fields.js +44 -0
- package/lib/foundations/jsonb-types/index.d.ts +2 -1
- package/lib/foundations/jsonb-types/index.js +2 -1
- package/lib/foundations/jsonb-types/secrets.d.ts +11 -0
- package/lib/foundations/jsonb-types/secrets.js +15 -0
- package/lib/foundations/jsonb-types/sign-in-experience.d.ts +3 -1
- package/lib/foundations/jsonb-types/sign-in-experience.js +2 -0
- package/lib/foundations/jsonb-types/users.d.ts +126 -0
- package/lib/foundations/jsonb-types/users.js +22 -10
- package/lib/types/connector.d.ts +39 -0
- package/lib/types/connector.js +1 -0
- package/lib/types/consent.d.ts +44 -0
- package/lib/types/custom-profile-fields.d.ts +2587 -0
- package/lib/types/custom-profile-fields.js +159 -0
- package/lib/types/index.d.ts +4 -0
- package/lib/types/index.js +4 -0
- package/lib/types/interactions.d.ts +181 -1
- package/lib/types/interactions.js +49 -1
- package/lib/types/log/interaction.d.ts +2 -1
- package/lib/types/logto-config/index.d.ts +1139 -18
- package/lib/types/logto-config/jwt-customizer.d.ts +2529 -32
- package/lib/types/logto-config/jwt-customizer.js +55 -1
- package/lib/types/logto-config/oidc-provider.d.ts +6 -6
- package/lib/types/mfa.d.ts +10 -10
- package/lib/types/secrets.d.ts +436 -0
- package/lib/types/secrets.js +73 -0
- package/lib/types/sign-in-experience.d.ts +21 -3
- package/lib/types/sign-in-experience.js +3 -1
- package/lib/types/sso-connector.d.ts +28 -2
- package/lib/types/sso-connector.js +3 -0
- package/lib/types/tenant.d.ts +1 -0
- package/lib/types/tenant.js +1 -0
- package/lib/types/user-logto-config.d.ts +45 -0
- package/lib/types/user-logto-config.js +18 -0
- package/lib/types/user.d.ts +626 -0
- package/lib/types/user.js +17 -1
- package/lib/types/verification-records/backup-code-verification.d.ts +47 -0
- package/lib/types/verification-records/backup-code-verification.js +12 -0
- package/lib/types/verification-records/code-verification.d.ts +89 -0
- package/lib/types/verification-records/code-verification.js +22 -0
- package/lib/types/verification-records/enterprise-sso-verification.d.ts +213 -0
- package/lib/types/verification-records/enterprise-sso-verification.js +15 -0
- package/lib/types/verification-records/index.d.ts +16 -0
- package/lib/types/verification-records/index.js +16 -0
- package/lib/types/verification-records/new-password-identity-verification.d.ts +85 -0
- package/lib/types/verification-records/new-password-identity-verification.js +20 -0
- package/lib/types/verification-records/one-time-token-verification.d.ts +55 -0
- package/lib/types/verification-records/one-time-token-verification.js +13 -0
- package/lib/types/verification-records/password-verification.d.ts +40 -0
- package/lib/types/verification-records/password-verification.js +9 -0
- package/lib/types/verification-records/social-verification.d.ts +270 -0
- package/lib/types/verification-records/social-verification.js +16 -0
- package/lib/types/verification-records/totp-verification.d.ts +47 -0
- package/lib/types/verification-records/totp-verification.js +12 -0
- package/lib/types/verification-records/web-authn-verification.d.ts +124 -0
- package/lib/types/verification-records/web-authn-verification.js +17 -0
- package/package.json +6 -6
- package/tables/account_centers.sql +2 -1
- package/tables/connectors.sql +4 -0
- package/tables/custom_profile_fields.sql +31 -0
- package/tables/oidc_model_instances.sql +2 -0
- package/tables/oidc_session_extensions.sql +18 -0
- package/tables/organization_user_relations.sql +4 -1
- package/tables/secret_enterprise_sso_connector_relations.sql +60 -0
- package/tables/secret_social_connector_relations.sql +75 -0
- package/tables/secrets.sql +26 -0
- package/tables/sso_connectors.sql +2 -0
- package/tables/user_sso_identities.sql +8 -0
- package/tables/users.sql +3 -2
- /package/lib/{foundations/jsonb-types/verification-records.d.ts → types/verification-records/verification-type.d.ts} +0 -0
- /package/lib/{foundations/jsonb-types/verification-records.js → types/verification-records/verification-type.js} +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { tokenResponseGuard } from '@logto/connector-kit';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { SecretEnterpriseSsoConnectorRelations } from '../db-entries/secret-enterprise-sso-connector-relation.js';
|
|
4
|
+
import { SecretSocialConnectorRelations } from '../db-entries/secret-social-connector-relation.js';
|
|
5
|
+
import { Secrets } from '../db-entries/secret.js';
|
|
6
|
+
import { SecretType } from '../foundations/index.js';
|
|
7
|
+
export const encryptedSecretGuard = Secrets.guard.pick({
|
|
8
|
+
encryptedDek: true,
|
|
9
|
+
iv: true,
|
|
10
|
+
authTag: true,
|
|
11
|
+
ciphertext: true,
|
|
12
|
+
});
|
|
13
|
+
export const tokenSetGuard = z.object({
|
|
14
|
+
id_token: z.string().optional(),
|
|
15
|
+
access_token: z.string(),
|
|
16
|
+
refresh_token: z.string().optional(),
|
|
17
|
+
});
|
|
18
|
+
export const tokenSetMetadataGuard = z.object({
|
|
19
|
+
scope: z.string().optional(),
|
|
20
|
+
expiresAt: z.number().optional(),
|
|
21
|
+
tokenType: z.string().optional(),
|
|
22
|
+
hasRefreshToken: z.boolean(),
|
|
23
|
+
});
|
|
24
|
+
export const encryptedTokenSetGuard = z.object({
|
|
25
|
+
encryptedTokenSetBase64: z.string(),
|
|
26
|
+
metadata: tokenSetMetadataGuard,
|
|
27
|
+
});
|
|
28
|
+
export const secretSocialConnectorRelationPayloadGuard = SecretSocialConnectorRelations.createGuard.pick({
|
|
29
|
+
connectorId: true,
|
|
30
|
+
target: true,
|
|
31
|
+
identityId: true,
|
|
32
|
+
});
|
|
33
|
+
export const secretEnterpriseSsoConnectorRelationPayloadGuard = SecretEnterpriseSsoConnectorRelations.createGuard.pick({
|
|
34
|
+
ssoConnectorId: true,
|
|
35
|
+
issuer: true,
|
|
36
|
+
identityId: true,
|
|
37
|
+
});
|
|
38
|
+
export const socialTokenSetSecretGuard = Secrets.guard.extend({
|
|
39
|
+
type: z.literal(SecretType.FederatedTokenSet),
|
|
40
|
+
metadata: tokenSetMetadataGuard,
|
|
41
|
+
connectorId: z.string(),
|
|
42
|
+
identityId: z.string(),
|
|
43
|
+
target: z.string(),
|
|
44
|
+
});
|
|
45
|
+
export const desensitizedSocialTokenSetSecretGuard = socialTokenSetSecretGuard.omit({
|
|
46
|
+
encryptedDek: true,
|
|
47
|
+
iv: true,
|
|
48
|
+
authTag: true,
|
|
49
|
+
ciphertext: true,
|
|
50
|
+
});
|
|
51
|
+
export const enterpriseSsoTokenSetSecretGuard = Secrets.guard.extend({
|
|
52
|
+
type: z.literal(SecretType.FederatedTokenSet),
|
|
53
|
+
metadata: tokenSetMetadataGuard,
|
|
54
|
+
ssoConnectorId: z.string(),
|
|
55
|
+
issuer: z.string(),
|
|
56
|
+
identityId: z.string(),
|
|
57
|
+
});
|
|
58
|
+
export const desensitizedEnterpriseSsoTokenSetSecretGuard = enterpriseSsoTokenSetSecretGuard.omit({
|
|
59
|
+
encryptedDek: true,
|
|
60
|
+
iv: true,
|
|
61
|
+
authTag: true,
|
|
62
|
+
ciphertext: true,
|
|
63
|
+
});
|
|
64
|
+
export const getThirdPartyAccessTokenResponseGuard = tokenResponseGuard
|
|
65
|
+
.pick({
|
|
66
|
+
access_token: true,
|
|
67
|
+
scope: true,
|
|
68
|
+
token_type: true,
|
|
69
|
+
expires_in: true,
|
|
70
|
+
})
|
|
71
|
+
.extend({
|
|
72
|
+
access_token: z.string(),
|
|
73
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ConnectorMetadata, type GoogleOneTapConfig } from '@logto/connector-kit';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { type SignInExperience } from '../db-entries/index.js';
|
|
3
|
+
import { type CustomProfileField, type SignInExperience } from '../db-entries/index.js';
|
|
4
4
|
import { CaptchaType } from '../foundations/jsonb-types/index.js';
|
|
5
5
|
import { type SsoConnectorMetadata } from './sso-connector.js';
|
|
6
6
|
type ForgotPassword = {
|
|
@@ -33,6 +33,7 @@ export type FullSignInExperience = SignInExperience & {
|
|
|
33
33
|
type: CaptchaType;
|
|
34
34
|
siteKey: string;
|
|
35
35
|
};
|
|
36
|
+
customProfileFields?: Readonly<CustomProfileField[]>;
|
|
36
37
|
};
|
|
37
38
|
export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
38
39
|
tenantId: z.ZodType<string, z.ZodTypeDef, string>;
|
|
@@ -165,6 +166,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
165
166
|
description: z.ZodOptional<z.ZodString>;
|
|
166
167
|
tooltip: z.ZodOptional<z.ZodString>;
|
|
167
168
|
isConfidential: z.ZodOptional<z.ZodBoolean>;
|
|
169
|
+
isDevFeature: z.ZodOptional<z.ZodBoolean>;
|
|
168
170
|
type: z.ZodLiteral<import("@logto/connector-kit").ConnectorConfigFormItemType.Select>;
|
|
169
171
|
selectItems: z.ZodArray<z.ZodObject<{
|
|
170
172
|
value: z.ZodString;
|
|
@@ -194,6 +196,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
194
196
|
description?: string | undefined;
|
|
195
197
|
tooltip?: string | undefined;
|
|
196
198
|
isConfidential?: boolean | undefined;
|
|
199
|
+
isDevFeature?: boolean | undefined;
|
|
197
200
|
}, {
|
|
198
201
|
type: import("@logto/connector-kit").ConnectorConfigFormItemType.Select;
|
|
199
202
|
selectItems: {
|
|
@@ -212,6 +215,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
212
215
|
description?: string | undefined;
|
|
213
216
|
tooltip?: string | undefined;
|
|
214
217
|
isConfidential?: boolean | undefined;
|
|
218
|
+
isDevFeature?: boolean | undefined;
|
|
215
219
|
}>, z.ZodObject<{
|
|
216
220
|
key: z.ZodString;
|
|
217
221
|
label: z.ZodString;
|
|
@@ -231,6 +235,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
231
235
|
description: z.ZodOptional<z.ZodString>;
|
|
232
236
|
tooltip: z.ZodOptional<z.ZodString>;
|
|
233
237
|
isConfidential: z.ZodOptional<z.ZodBoolean>;
|
|
238
|
+
isDevFeature: z.ZodOptional<z.ZodBoolean>;
|
|
234
239
|
type: z.ZodLiteral<import("@logto/connector-kit").ConnectorConfigFormItemType.MultiSelect>;
|
|
235
240
|
selectItems: z.ZodArray<z.ZodObject<{
|
|
236
241
|
value: z.ZodString;
|
|
@@ -256,6 +261,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
256
261
|
description?: string | undefined;
|
|
257
262
|
tooltip?: string | undefined;
|
|
258
263
|
isConfidential?: boolean | undefined;
|
|
264
|
+
isDevFeature?: boolean | undefined;
|
|
259
265
|
}, {
|
|
260
266
|
type: import("@logto/connector-kit").ConnectorConfigFormItemType.MultiSelect;
|
|
261
267
|
selectItems: {
|
|
@@ -273,6 +279,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
273
279
|
description?: string | undefined;
|
|
274
280
|
tooltip?: string | undefined;
|
|
275
281
|
isConfidential?: boolean | undefined;
|
|
282
|
+
isDevFeature?: boolean | undefined;
|
|
276
283
|
}>, z.ZodObject<{
|
|
277
284
|
key: z.ZodString;
|
|
278
285
|
label: z.ZodString;
|
|
@@ -292,6 +299,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
292
299
|
description: z.ZodOptional<z.ZodString>;
|
|
293
300
|
tooltip: z.ZodOptional<z.ZodString>;
|
|
294
301
|
isConfidential: z.ZodOptional<z.ZodBoolean>;
|
|
302
|
+
isDevFeature: z.ZodOptional<z.ZodBoolean>;
|
|
295
303
|
type: z.ZodEnum<[import("@logto/connector-kit").ConnectorConfigFormItemType.Text, import("@logto/connector-kit").ConnectorConfigFormItemType.Number, import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText, import("@logto/connector-kit").ConnectorConfigFormItemType.Switch, import("@logto/connector-kit").ConnectorConfigFormItemType.Json]>;
|
|
296
304
|
}, "strip", z.ZodTypeAny, {
|
|
297
305
|
type: import("@logto/connector-kit").ConnectorConfigFormItemType.Text | import("@logto/connector-kit").ConnectorConfigFormItemType.Number | import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText | import("@logto/connector-kit").ConnectorConfigFormItemType.Switch | import("@logto/connector-kit").ConnectorConfigFormItemType.Json;
|
|
@@ -307,6 +315,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
307
315
|
description?: string | undefined;
|
|
308
316
|
tooltip?: string | undefined;
|
|
309
317
|
isConfidential?: boolean | undefined;
|
|
318
|
+
isDevFeature?: boolean | undefined;
|
|
310
319
|
}, {
|
|
311
320
|
type: import("@logto/connector-kit").ConnectorConfigFormItemType.Text | import("@logto/connector-kit").ConnectorConfigFormItemType.Number | import("@logto/connector-kit").ConnectorConfigFormItemType.MultilineText | import("@logto/connector-kit").ConnectorConfigFormItemType.Switch | import("@logto/connector-kit").ConnectorConfigFormItemType.Json;
|
|
312
321
|
key: string;
|
|
@@ -321,12 +330,14 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
321
330
|
description?: string | undefined;
|
|
322
331
|
tooltip?: string | undefined;
|
|
323
332
|
isConfidential?: boolean | undefined;
|
|
333
|
+
isDevFeature?: boolean | undefined;
|
|
324
334
|
}>]>, "many">>;
|
|
325
335
|
customData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
326
336
|
fromEmail: z.ZodOptional<z.ZodString>;
|
|
327
337
|
} & {
|
|
328
338
|
platform: z.ZodNullable<z.ZodNativeEnum<typeof import("@logto/connector-kit").ConnectorPlatform>>;
|
|
329
339
|
isStandard: z.ZodOptional<z.ZodBoolean>;
|
|
340
|
+
isTokenStorageSupported: z.ZodOptional<z.ZodBoolean>;
|
|
330
341
|
}, "customData" | "description" | "readme" | "configTemplate" | "formItems">, "strip", z.ZodTypeAny, {
|
|
331
342
|
name: {
|
|
332
343
|
en: string;
|
|
@@ -466,6 +477,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
466
477
|
platform: import("@logto/connector-kit").ConnectorPlatform | null;
|
|
467
478
|
fromEmail?: string | undefined;
|
|
468
479
|
isStandard?: boolean | undefined;
|
|
480
|
+
isTokenStorageSupported?: boolean | undefined;
|
|
469
481
|
}, {
|
|
470
482
|
name: {
|
|
471
483
|
en: string;
|
|
@@ -605,6 +617,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
605
617
|
platform: import("@logto/connector-kit").ConnectorPlatform | null;
|
|
606
618
|
fromEmail?: string | undefined;
|
|
607
619
|
isStandard?: boolean | undefined;
|
|
620
|
+
isTokenStorageSupported?: boolean | undefined;
|
|
608
621
|
}>, "many">;
|
|
609
622
|
ssoConnectors: z.ZodArray<z.ZodObject<{
|
|
610
623
|
id: z.ZodString;
|
|
@@ -666,9 +679,11 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
666
679
|
type: CaptchaType;
|
|
667
680
|
siteKey: string;
|
|
668
681
|
}>>;
|
|
682
|
+
customProfileFields: z.ZodOptional<z.ZodArray<import("../index.js").Guard<CustomProfileField>, "many">>;
|
|
669
683
|
}, "strip", z.ZodTypeAny, {
|
|
670
684
|
id: string;
|
|
671
685
|
tenantId: string;
|
|
686
|
+
mfa: import("../foundations/jsonb-types/sign-in-experience.js").Mfa;
|
|
672
687
|
color: import("../foundations/jsonb-types/sign-in-experience.js").Color;
|
|
673
688
|
branding: import("../foundations/jsonb-types/sign-in-experience.js").Branding;
|
|
674
689
|
termsOfUseUrl: string | null;
|
|
@@ -684,7 +699,6 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
684
699
|
customContent: import("../foundations/jsonb-types/sign-in-experience.js").CustomContent;
|
|
685
700
|
customUiAssets: import("../foundations/jsonb-types/sign-in-experience.js").CustomUiAssets | null;
|
|
686
701
|
passwordPolicy: import("../foundations/jsonb-types/logs.js").PartialPasswordPolicy;
|
|
687
|
-
mfa: import("../foundations/jsonb-types/sign-in-experience.js").Mfa;
|
|
688
702
|
singleSignOnEnabled: boolean;
|
|
689
703
|
supportEmail: string | null;
|
|
690
704
|
supportWebsiteUrl: string | null;
|
|
@@ -831,6 +845,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
831
845
|
platform: import("@logto/connector-kit").ConnectorPlatform | null;
|
|
832
846
|
fromEmail?: string | undefined;
|
|
833
847
|
isStandard?: boolean | undefined;
|
|
848
|
+
isTokenStorageSupported?: boolean | undefined;
|
|
834
849
|
}[];
|
|
835
850
|
ssoConnectors: {
|
|
836
851
|
id: string;
|
|
@@ -855,9 +870,11 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
855
870
|
type: CaptchaType;
|
|
856
871
|
siteKey: string;
|
|
857
872
|
} | undefined;
|
|
873
|
+
customProfileFields?: CustomProfileField[] | undefined;
|
|
858
874
|
}, {
|
|
859
875
|
id: string;
|
|
860
876
|
tenantId: string;
|
|
877
|
+
mfa: import("../foundations/jsonb-types/sign-in-experience.js").Mfa;
|
|
861
878
|
color: import("../foundations/jsonb-types/sign-in-experience.js").Color;
|
|
862
879
|
branding: import("../foundations/jsonb-types/sign-in-experience.js").Branding;
|
|
863
880
|
termsOfUseUrl: string | null;
|
|
@@ -873,7 +890,6 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
873
890
|
customContent: import("../foundations/jsonb-types/sign-in-experience.js").CustomContent;
|
|
874
891
|
customUiAssets: import("../foundations/jsonb-types/sign-in-experience.js").CustomUiAssets | null;
|
|
875
892
|
passwordPolicy: import("../foundations/jsonb-types/logs.js").PartialPasswordPolicy;
|
|
876
|
-
mfa: import("../foundations/jsonb-types/sign-in-experience.js").Mfa;
|
|
877
893
|
singleSignOnEnabled: boolean;
|
|
878
894
|
supportEmail: string | null;
|
|
879
895
|
supportWebsiteUrl: string | null;
|
|
@@ -1020,6 +1036,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
1020
1036
|
platform: import("@logto/connector-kit").ConnectorPlatform | null;
|
|
1021
1037
|
fromEmail?: string | undefined;
|
|
1022
1038
|
isStandard?: boolean | undefined;
|
|
1039
|
+
isTokenStorageSupported?: boolean | undefined;
|
|
1023
1040
|
}[];
|
|
1024
1041
|
ssoConnectors: {
|
|
1025
1042
|
id: string;
|
|
@@ -1044,5 +1061,6 @@ export declare const fullSignInExperienceGuard: z.ZodObject<{
|
|
|
1044
1061
|
type: CaptchaType;
|
|
1045
1062
|
siteKey: string;
|
|
1046
1063
|
} | undefined;
|
|
1064
|
+
customProfileFields?: CustomProfileField[] | undefined;
|
|
1047
1065
|
}>;
|
|
1048
1066
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { connectorMetadataGuard, googleOneTapConfigGuard, } from '@logto/connector-kit';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { SignInExperiences } from '../db-entries/index.js';
|
|
3
|
+
import { CustomProfileFields, SignInExperiences, } from '../db-entries/index.js';
|
|
4
4
|
import { CaptchaType } from '../foundations/jsonb-types/index.js';
|
|
5
5
|
import { ssoConnectorMetadataGuard } from './sso-connector.js';
|
|
6
6
|
export const fullSignInExperienceGuard = SignInExperiences.guard.extend({
|
|
@@ -25,4 +25,6 @@ export const fullSignInExperienceGuard = SignInExperiences.guard.extend({
|
|
|
25
25
|
siteKey: z.string(),
|
|
26
26
|
})
|
|
27
27
|
.optional(),
|
|
28
|
+
// @charles TODO: Remove `optional` before release
|
|
29
|
+
customProfileFields: CustomProfileFields.guard.array().optional(),
|
|
28
30
|
});
|
|
@@ -98,6 +98,7 @@ export declare const ssoConnectorWithProviderConfigGuard: z.ZodObject<{
|
|
|
98
98
|
darkLogo?: string | undefined;
|
|
99
99
|
}>;
|
|
100
100
|
syncProfile: z.ZodType<boolean, z.ZodTypeDef, boolean>;
|
|
101
|
+
enableTokenStorage: z.ZodType<boolean, z.ZodTypeDef, boolean>;
|
|
101
102
|
createdAt: z.ZodType<number, z.ZodTypeDef, number>;
|
|
102
103
|
} & {
|
|
103
104
|
providerName: z.ZodNativeEnum<typeof SsoProviderName>;
|
|
@@ -112,9 +113,10 @@ export declare const ssoConnectorWithProviderConfigGuard: z.ZodObject<{
|
|
|
112
113
|
id: string;
|
|
113
114
|
tenantId: string;
|
|
114
115
|
createdAt: number;
|
|
115
|
-
branding: import("../index.js").SsoBranding;
|
|
116
116
|
config: import("@withtyped/server").JsonObject;
|
|
117
|
+
branding: import("../index.js").SsoBranding;
|
|
117
118
|
syncProfile: boolean;
|
|
119
|
+
enableTokenStorage: boolean;
|
|
118
120
|
domains: import("../index.js").SsoDomains;
|
|
119
121
|
providerName: SsoProviderName;
|
|
120
122
|
connectorName: string;
|
|
@@ -127,9 +129,10 @@ export declare const ssoConnectorWithProviderConfigGuard: z.ZodObject<{
|
|
|
127
129
|
id: string;
|
|
128
130
|
tenantId: string;
|
|
129
131
|
createdAt: number;
|
|
130
|
-
branding: import("../index.js").SsoBranding;
|
|
131
132
|
config: import("@withtyped/server").JsonObject;
|
|
133
|
+
branding: import("../index.js").SsoBranding;
|
|
132
134
|
syncProfile: boolean;
|
|
135
|
+
enableTokenStorage: boolean;
|
|
133
136
|
domains: import("../index.js").SsoDomains;
|
|
134
137
|
providerName: SsoProviderName;
|
|
135
138
|
connectorName: string;
|
|
@@ -142,4 +145,27 @@ export type SsoConnectorWithProviderConfig = z.infer<typeof ssoConnectorWithProv
|
|
|
142
145
|
export declare enum SsoAuthenticationQueryKey {
|
|
143
146
|
SsoConnectorId = "ssoConnectorId"
|
|
144
147
|
}
|
|
148
|
+
export declare const extendedSocialUserInfoGuard: z.ZodObject<{
|
|
149
|
+
id: z.ZodString;
|
|
150
|
+
email: z.ZodOptional<z.ZodString>;
|
|
151
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
152
|
+
name: z.ZodOptional<z.ZodString>;
|
|
153
|
+
avatar: z.ZodOptional<z.ZodString>;
|
|
154
|
+
rawData: z.ZodOptional<z.ZodType<import("@withtyped/server").Json, z.ZodTypeDef, import("@withtyped/server").Json>>;
|
|
155
|
+
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
email: z.ZodOptional<z.ZodString>;
|
|
158
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
159
|
+
name: z.ZodOptional<z.ZodString>;
|
|
160
|
+
avatar: z.ZodOptional<z.ZodString>;
|
|
161
|
+
rawData: z.ZodOptional<z.ZodType<import("@withtyped/server").Json, z.ZodTypeDef, import("@withtyped/server").Json>>;
|
|
162
|
+
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
163
|
+
id: z.ZodString;
|
|
164
|
+
email: z.ZodOptional<z.ZodString>;
|
|
165
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
166
|
+
name: z.ZodOptional<z.ZodString>;
|
|
167
|
+
avatar: z.ZodOptional<z.ZodString>;
|
|
168
|
+
rawData: z.ZodOptional<z.ZodType<import("@withtyped/server").Json, z.ZodTypeDef, import("@withtyped/server").Json>>;
|
|
169
|
+
}, z.ZodUnknown, "strip">>;
|
|
170
|
+
export type ExtendedSocialUserInfo = z.infer<typeof extendedSocialUserInfoGuard>;
|
|
145
171
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { socialUserInfoGuard } from '@logto/connector-kit';
|
|
1
2
|
import { z } from 'zod';
|
|
2
3
|
import { SsoConnectors } from '../db-entries/sso-connector.js';
|
|
3
4
|
/**
|
|
@@ -73,3 +74,5 @@ export var SsoAuthenticationQueryKey;
|
|
|
73
74
|
(function (SsoAuthenticationQueryKey) {
|
|
74
75
|
SsoAuthenticationQueryKey["SsoConnectorId"] = "ssoConnectorId";
|
|
75
76
|
})(SsoAuthenticationQueryKey || (SsoAuthenticationQueryKey = {}));
|
|
77
|
+
// Saml assertion returned user attribute value
|
|
78
|
+
export const extendedSocialUserInfoGuard = socialUserInfoGuard.catchall(z.unknown());
|
package/lib/types/tenant.d.ts
CHANGED
package/lib/types/tenant.js
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The key for MFA-related data in user's logto_config
|
|
4
|
+
*/
|
|
5
|
+
export declare const userMfaDataKey = "mfa";
|
|
6
|
+
/**
|
|
7
|
+
* Schema for MFA-related data stored in user's logto_config
|
|
8
|
+
*/
|
|
9
|
+
export declare const userMfaDataGuard: z.ZodObject<{
|
|
10
|
+
skipped: z.ZodOptional<z.ZodBoolean>;
|
|
11
|
+
skipMfaOnSignIn: z.ZodOptional<z.ZodBoolean>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
skipped?: boolean | undefined;
|
|
14
|
+
skipMfaOnSignIn?: boolean | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
skipped?: boolean | undefined;
|
|
17
|
+
skipMfaOnSignIn?: boolean | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export type UserMfaData = z.infer<typeof userMfaDataGuard>;
|
|
20
|
+
/**
|
|
21
|
+
* Schema for user's logto_config field
|
|
22
|
+
*/
|
|
23
|
+
export declare const userLogtoConfigGuard: z.ZodObject<{
|
|
24
|
+
mfa: z.ZodOptional<z.ZodObject<{
|
|
25
|
+
skipped: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
skipMfaOnSignIn: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
skipped?: boolean | undefined;
|
|
29
|
+
skipMfaOnSignIn?: boolean | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
skipped?: boolean | undefined;
|
|
32
|
+
skipMfaOnSignIn?: boolean | undefined;
|
|
33
|
+
}>>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
mfa?: {
|
|
36
|
+
skipped?: boolean | undefined;
|
|
37
|
+
skipMfaOnSignIn?: boolean | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
}, {
|
|
40
|
+
mfa?: {
|
|
41
|
+
skipped?: boolean | undefined;
|
|
42
|
+
skipMfaOnSignIn?: boolean | undefined;
|
|
43
|
+
} | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
export type UserLogtoConfig = z.infer<typeof userLogtoConfigGuard>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The key for MFA-related data in user's logto_config
|
|
4
|
+
*/
|
|
5
|
+
export const userMfaDataKey = 'mfa';
|
|
6
|
+
/**
|
|
7
|
+
* Schema for MFA-related data stored in user's logto_config
|
|
8
|
+
*/
|
|
9
|
+
export const userMfaDataGuard = z.object({
|
|
10
|
+
skipped: z.boolean().optional(),
|
|
11
|
+
skipMfaOnSignIn: z.boolean().optional(),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Schema for user's logto_config field
|
|
15
|
+
*/
|
|
16
|
+
export const userLogtoConfigGuard = z.object({
|
|
17
|
+
[userMfaDataKey]: userMfaDataGuard.optional(),
|
|
18
|
+
});
|