@logto/schemas 1.19.0 → 1.21.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.20.0-1723448981-personal-access-tokens.ts +35 -0
- package/alterations/1.20.0-1724229102-add-report-sub-updates-cloud-scope.ts +102 -0
- package/alterations/1.20.0-1724316971-add-verified-identifier-to-verification-statuses.ts +18 -0
- package/alterations/1.20.0-1725971571-add-verification-record.ts +35 -0
- package/alterations/1.21.0-1728357690-add-sso-connector-idp-initated-auth-configs-table.ts +40 -0
- package/alterations/1.21.0-1728526649-add-idp-initiated-saml-sso-sessions-table.ts +36 -0
- package/alterations/1.21.0-1728887713-add-client-idp-initiated-auth-callback-uri-columns.ts +40 -0
- package/alterations-js/1.20.0-1723448981-personal-access-tokens.js +30 -0
- package/alterations-js/1.20.0-1724229102-add-report-sub-updates-cloud-scope.js +59 -0
- package/alterations-js/1.20.0-1724316971-add-verified-identifier-to-verification-statuses.js +14 -0
- package/alterations-js/1.20.0-1725971571-add-verification-record.js +30 -0
- package/alterations-js/1.21.0-1728357690-add-sso-connector-idp-initated-auth-configs-table.js +35 -0
- package/alterations-js/1.21.0-1728526649-add-idp-initiated-saml-sso-sessions-table.js +31 -0
- package/alterations-js/1.21.0-1728887713-add-client-idp-initiated-auth-callback-uri-columns.js +36 -0
- package/lib/consts/experience.d.ts +8 -5
- package/lib/consts/experience.js +3 -0
- package/lib/consts/oidc.d.ts +34 -3
- package/lib/consts/oidc.js +26 -1
- package/lib/consts/subscriptions.d.ts +1 -0
- package/lib/consts/subscriptions.js +1 -0
- package/lib/db-entries/idp-initiated-saml-sso-session.d.ts +32 -0
- package/lib/db-entries/idp-initiated-saml-sso-session.js +42 -0
- package/lib/db-entries/index.d.ts +4 -0
- package/lib/db-entries/index.js +4 -0
- package/lib/db-entries/personal-access-token.d.ts +26 -0
- package/lib/db-entries/personal-access-token.js +41 -0
- package/lib/db-entries/sso-connector-idp-initiated-auth-config.d.ts +42 -0
- package/lib/db-entries/sso-connector-idp-initiated-auth-config.js +50 -0
- package/lib/db-entries/verification-record.d.ts +26 -0
- package/lib/db-entries/verification-record.js +42 -0
- package/lib/db-entries/verification-status.d.ts +3 -1
- package/lib/db-entries/verification-status.js +4 -0
- package/lib/foundations/jsonb-types/index.d.ts +1 -0
- package/lib/foundations/jsonb-types/index.js +1 -0
- package/lib/foundations/jsonb-types/logs.d.ts +3 -0
- package/lib/foundations/jsonb-types/logs.js +1 -0
- package/lib/foundations/jsonb-types/sign-in-experience.d.ts +7 -3
- package/lib/foundations/jsonb-types/sign-in-experience.js +5 -0
- package/lib/foundations/jsonb-types/sso-connector.d.ts +49 -0
- package/lib/foundations/jsonb-types/sso-connector.js +17 -0
- package/lib/foundations/jsonb-types/verification-records.d.ts +13 -0
- package/lib/foundations/jsonb-types/verification-records.js +14 -0
- package/lib/seeds/cloud-api.d.ts +4 -0
- package/lib/seeds/cloud-api.js +5 -0
- package/lib/types/connector.d.ts +8 -0
- package/lib/types/consent.d.ts +2 -2
- package/lib/types/interactions.d.ts +17 -15
- package/lib/types/interactions.js +5 -14
- package/lib/types/log/interaction.d.ts +3 -3
- package/lib/types/logto-config/jwt-customizer.d.ts +48 -0
- package/lib/types/logto-config/jwt-customizer.js +17 -0
- package/lib/types/sign-in-experience.d.ts +6 -2
- package/lib/types/sso-connector.d.ts +3 -0
- package/lib/types/sso-connector.js +4 -0
- package/lib/types/system.d.ts +20 -3
- package/lib/types/system.js +13 -0
- package/package.json +5 -5
- package/tables/idp_initiated_saml_sso_sessions.sql +16 -0
- package/tables/personal_access_tokens.sql +16 -0
- package/tables/sso_connector_idp_initiated_auth_configs.sql +24 -0
- package/tables/verification_records.sql +15 -0
- package/tables/verification_statuses.sql +1 -0
|
@@ -15,3 +15,52 @@ export declare const ssoBrandingGuard: z.ZodObject<{
|
|
|
15
15
|
darkLogo?: string | undefined;
|
|
16
16
|
}>;
|
|
17
17
|
export type SsoBranding = z.infer<typeof ssoBrandingGuard>;
|
|
18
|
+
export declare const idpInitiatedAuthParamsGuard: z.ZodObject<{
|
|
19
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, "strip", z.ZodString, z.objectOutputType<{
|
|
21
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.ZodString, "strip">, z.objectInputType<{
|
|
23
|
+
scope: z.ZodOptional<z.ZodString>;
|
|
24
|
+
}, z.ZodString, "strip">>;
|
|
25
|
+
export type IdpInitiatedAuthParams = z.infer<typeof idpInitiatedAuthParamsGuard>;
|
|
26
|
+
export declare const ssoSamlAssertionContentGuard: z.ZodObject<{
|
|
27
|
+
nameID: z.ZodOptional<z.ZodString>;
|
|
28
|
+
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
29
|
+
conditions: z.ZodOptional<z.ZodObject<{
|
|
30
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
31
|
+
notOnOrAfter: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
notBefore?: string | undefined;
|
|
34
|
+
notOnOrAfter?: string | undefined;
|
|
35
|
+
}, {
|
|
36
|
+
notBefore?: string | undefined;
|
|
37
|
+
notOnOrAfter?: string | undefined;
|
|
38
|
+
}>>;
|
|
39
|
+
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
40
|
+
nameID: z.ZodOptional<z.ZodString>;
|
|
41
|
+
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
42
|
+
conditions: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
44
|
+
notOnOrAfter: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
notBefore?: string | undefined;
|
|
47
|
+
notOnOrAfter?: string | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
notBefore?: string | undefined;
|
|
50
|
+
notOnOrAfter?: string | undefined;
|
|
51
|
+
}>>;
|
|
52
|
+
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
53
|
+
nameID: z.ZodOptional<z.ZodString>;
|
|
54
|
+
attributes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
55
|
+
conditions: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
notBefore: z.ZodOptional<z.ZodString>;
|
|
57
|
+
notOnOrAfter: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
notBefore?: string | undefined;
|
|
60
|
+
notOnOrAfter?: string | undefined;
|
|
61
|
+
}, {
|
|
62
|
+
notBefore?: string | undefined;
|
|
63
|
+
notOnOrAfter?: string | undefined;
|
|
64
|
+
}>>;
|
|
65
|
+
}, z.ZodUnknown, "strip">>;
|
|
66
|
+
export type SsoSamlAssertionContent = z.infer<typeof ssoSamlAssertionContentGuard>;
|
|
@@ -5,3 +5,20 @@ export const ssoBrandingGuard = z.object({
|
|
|
5
5
|
logo: z.string().optional(),
|
|
6
6
|
darkLogo: z.string().optional(),
|
|
7
7
|
});
|
|
8
|
+
export const idpInitiatedAuthParamsGuard = z
|
|
9
|
+
.object({
|
|
10
|
+
scope: z.string().optional(),
|
|
11
|
+
})
|
|
12
|
+
.catchall(z.string());
|
|
13
|
+
export const ssoSamlAssertionContentGuard = z
|
|
14
|
+
.object({
|
|
15
|
+
nameID: z.string().optional(),
|
|
16
|
+
attributes: z.record(z.string().or(z.array(z.string()))).optional(),
|
|
17
|
+
conditions: z
|
|
18
|
+
.object({
|
|
19
|
+
notBefore: z.string().optional(),
|
|
20
|
+
notOnOrAfter: z.string().optional(),
|
|
21
|
+
})
|
|
22
|
+
.optional(),
|
|
23
|
+
})
|
|
24
|
+
.catchall(z.unknown());
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare enum VerificationType {
|
|
3
|
+
Password = "Password",
|
|
4
|
+
EmailVerificationCode = "EmailVerificationCode",
|
|
5
|
+
PhoneVerificationCode = "PhoneVerificationCode",
|
|
6
|
+
Social = "Social",
|
|
7
|
+
EnterpriseSso = "EnterpriseSso",
|
|
8
|
+
TOTP = "Totp",
|
|
9
|
+
WebAuthn = "WebAuthn",
|
|
10
|
+
BackupCode = "BackupCode",
|
|
11
|
+
NewPasswordIdentity = "NewPasswordIdentity"
|
|
12
|
+
}
|
|
13
|
+
export declare const verificationTypeGuard: z.ZodNativeEnum<typeof VerificationType>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export var VerificationType;
|
|
3
|
+
(function (VerificationType) {
|
|
4
|
+
VerificationType["Password"] = "Password";
|
|
5
|
+
VerificationType["EmailVerificationCode"] = "EmailVerificationCode";
|
|
6
|
+
VerificationType["PhoneVerificationCode"] = "PhoneVerificationCode";
|
|
7
|
+
VerificationType["Social"] = "Social";
|
|
8
|
+
VerificationType["EnterpriseSso"] = "EnterpriseSso";
|
|
9
|
+
VerificationType["TOTP"] = "Totp";
|
|
10
|
+
VerificationType["WebAuthn"] = "WebAuthn";
|
|
11
|
+
VerificationType["BackupCode"] = "BackupCode";
|
|
12
|
+
VerificationType["NewPasswordIdentity"] = "NewPasswordIdentity";
|
|
13
|
+
})(VerificationType || (VerificationType = {}));
|
|
14
|
+
export const verificationTypeGuard = z.nativeEnum(VerificationType);
|
package/lib/seeds/cloud-api.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ export declare enum CloudScope {
|
|
|
14
14
|
* scripts and fetch the parsed token payload.
|
|
15
15
|
*/
|
|
16
16
|
FetchCustomJwt = "fetch:custom:jwt",
|
|
17
|
+
/**
|
|
18
|
+
* The entity can report changes on Stripe subscription to Logto Cloud.
|
|
19
|
+
*/
|
|
20
|
+
ReportSubscriptionUpdates = "report:subscription:updates",
|
|
17
21
|
/** The user can see and manage affiliates, including create, update, and delete. */
|
|
18
22
|
ManageAffiliate = "manage:affiliate",
|
|
19
23
|
/** The user can create new affiliates and logs. */
|
package/lib/seeds/cloud-api.js
CHANGED
|
@@ -17,6 +17,10 @@ export var CloudScope;
|
|
|
17
17
|
* scripts and fetch the parsed token payload.
|
|
18
18
|
*/
|
|
19
19
|
CloudScope["FetchCustomJwt"] = "fetch:custom:jwt";
|
|
20
|
+
/**
|
|
21
|
+
* The entity can report changes on Stripe subscription to Logto Cloud.
|
|
22
|
+
*/
|
|
23
|
+
CloudScope["ReportSubscriptionUpdates"] = "report:subscription:updates";
|
|
20
24
|
/** The user can see and manage affiliates, including create, update, and delete. */
|
|
21
25
|
CloudScope["ManageAffiliate"] = "manage:affiliate";
|
|
22
26
|
/** The user can create new affiliates and logs. */
|
|
@@ -51,6 +55,7 @@ export const createCloudApi = () => {
|
|
|
51
55
|
buildScope(CloudScope.SendEmail, 'Allow sending emails. This scope is only available to M2M application.'),
|
|
52
56
|
buildScope(CloudScope.SendSms, 'Allow sending SMS. This scope is only available to M2M application.'),
|
|
53
57
|
buildScope(CloudScope.FetchCustomJwt, 'Allow accessing external resource to execute JWT payload customizer script and fetch the parsed token payload.'),
|
|
58
|
+
buildScope(CloudScope.ReportSubscriptionUpdates, 'Allow reporting changes on Stripe subscription to Logto Cloud.'),
|
|
54
59
|
buildScope(CloudScope.CreateAffiliate, 'Allow creating new affiliates and logs.'),
|
|
55
60
|
buildScope(CloudScope.ManageAffiliate, 'Allow managing affiliates, including create, update, and delete.'),
|
|
56
61
|
]);
|
package/lib/types/connector.d.ts
CHANGED
|
@@ -222,6 +222,7 @@ export declare const connectorResponseGuard: z.ZodObject<z.objectUtil.extendShap
|
|
|
222
222
|
} & {
|
|
223
223
|
"af-ZA"?: string | undefined;
|
|
224
224
|
"am-ET"?: string | undefined;
|
|
225
|
+
ar?: string | undefined;
|
|
225
226
|
"ar-AR"?: string | undefined;
|
|
226
227
|
"as-IN"?: string | undefined;
|
|
227
228
|
"az-AZ"?: string | undefined;
|
|
@@ -350,6 +351,7 @@ export declare const connectorResponseGuard: z.ZodObject<z.objectUtil.extendShap
|
|
|
350
351
|
} & {
|
|
351
352
|
"af-ZA"?: string | undefined;
|
|
352
353
|
"am-ET"?: string | undefined;
|
|
354
|
+
ar?: string | undefined;
|
|
353
355
|
"ar-AR"?: string | undefined;
|
|
354
356
|
"as-IN"?: string | undefined;
|
|
355
357
|
"az-AZ"?: string | undefined;
|
|
@@ -543,6 +545,7 @@ export declare const connectorResponseGuard: z.ZodObject<z.objectUtil.extendShap
|
|
|
543
545
|
} & {
|
|
544
546
|
"af-ZA"?: string | undefined;
|
|
545
547
|
"am-ET"?: string | undefined;
|
|
548
|
+
ar?: string | undefined;
|
|
546
549
|
"ar-AR"?: string | undefined;
|
|
547
550
|
"as-IN"?: string | undefined;
|
|
548
551
|
"az-AZ"?: string | undefined;
|
|
@@ -671,6 +674,7 @@ export declare const connectorResponseGuard: z.ZodObject<z.objectUtil.extendShap
|
|
|
671
674
|
} & {
|
|
672
675
|
"af-ZA"?: string | undefined;
|
|
673
676
|
"am-ET"?: string | undefined;
|
|
677
|
+
ar?: string | undefined;
|
|
674
678
|
"ar-AR"?: string | undefined;
|
|
675
679
|
"as-IN"?: string | undefined;
|
|
676
680
|
"az-AZ"?: string | undefined;
|
|
@@ -1059,6 +1063,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<z.objectUtil.ext
|
|
|
1059
1063
|
} & {
|
|
1060
1064
|
"af-ZA"?: string | undefined;
|
|
1061
1065
|
"am-ET"?: string | undefined;
|
|
1066
|
+
ar?: string | undefined;
|
|
1062
1067
|
"ar-AR"?: string | undefined;
|
|
1063
1068
|
"as-IN"?: string | undefined;
|
|
1064
1069
|
"az-AZ"?: string | undefined;
|
|
@@ -1187,6 +1192,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<z.objectUtil.ext
|
|
|
1187
1192
|
} & {
|
|
1188
1193
|
"af-ZA"?: string | undefined;
|
|
1189
1194
|
"am-ET"?: string | undefined;
|
|
1195
|
+
ar?: string | undefined;
|
|
1190
1196
|
"ar-AR"?: string | undefined;
|
|
1191
1197
|
"as-IN"?: string | undefined;
|
|
1192
1198
|
"az-AZ"?: string | undefined;
|
|
@@ -1374,6 +1380,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<z.objectUtil.ext
|
|
|
1374
1380
|
} & {
|
|
1375
1381
|
"af-ZA"?: string | undefined;
|
|
1376
1382
|
"am-ET"?: string | undefined;
|
|
1383
|
+
ar?: string | undefined;
|
|
1377
1384
|
"ar-AR"?: string | undefined;
|
|
1378
1385
|
"as-IN"?: string | undefined;
|
|
1379
1386
|
"az-AZ"?: string | undefined;
|
|
@@ -1502,6 +1509,7 @@ export declare const connectorFactoryResponseGuard: z.ZodObject<z.objectUtil.ext
|
|
|
1502
1509
|
} & {
|
|
1503
1510
|
"af-ZA"?: string | undefined;
|
|
1504
1511
|
"am-ET"?: string | undefined;
|
|
1512
|
+
ar?: string | undefined;
|
|
1505
1513
|
"ar-AR"?: string | undefined;
|
|
1506
1514
|
"as-IN"?: string | undefined;
|
|
1507
1515
|
"az-AZ"?: string | undefined;
|
package/lib/types/consent.d.ts
CHANGED
|
@@ -882,6 +882,7 @@ export declare const consentInfoResponseGuard: z.ZodObject<{
|
|
|
882
882
|
termsOfUseUrl?: string | null | undefined;
|
|
883
883
|
privacyPolicyUrl?: string | null | undefined;
|
|
884
884
|
};
|
|
885
|
+
redirectUri: string;
|
|
885
886
|
user: {
|
|
886
887
|
name: string | null;
|
|
887
888
|
id: string;
|
|
@@ -890,7 +891,6 @@ export declare const consentInfoResponseGuard: z.ZodObject<{
|
|
|
890
891
|
primaryPhone: string | null;
|
|
891
892
|
avatar: string | null;
|
|
892
893
|
};
|
|
893
|
-
redirectUri: string;
|
|
894
894
|
organizations?: {
|
|
895
895
|
name: string;
|
|
896
896
|
id: string;
|
|
@@ -934,6 +934,7 @@ export declare const consentInfoResponseGuard: z.ZodObject<{
|
|
|
934
934
|
termsOfUseUrl?: string | null | undefined;
|
|
935
935
|
privacyPolicyUrl?: string | null | undefined;
|
|
936
936
|
};
|
|
937
|
+
redirectUri: string;
|
|
937
938
|
user: {
|
|
938
939
|
name: string | null;
|
|
939
940
|
id: string;
|
|
@@ -942,7 +943,6 @@ export declare const consentInfoResponseGuard: z.ZodObject<{
|
|
|
942
943
|
primaryPhone: string | null;
|
|
943
944
|
avatar: string | null;
|
|
944
945
|
};
|
|
945
|
-
redirectUri: string;
|
|
946
946
|
organizations?: {
|
|
947
947
|
name: string;
|
|
948
948
|
id: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { MfaFactor, SignInIdentifier } from '../foundations/index.js';
|
|
2
|
+
import { AdditionalIdentifier, MfaFactor, SignInIdentifier } from '../foundations/index.js';
|
|
3
3
|
import type { EmailVerificationCodePayload, PhoneVerificationCodePayload } from './verification-code.js';
|
|
4
4
|
/**
|
|
5
5
|
* User interaction events defined in Logto RFC 0004.
|
|
@@ -10,6 +10,20 @@ export declare enum InteractionEvent {
|
|
|
10
10
|
Register = "Register",
|
|
11
11
|
ForgotPassword = "ForgotPassword"
|
|
12
12
|
}
|
|
13
|
+
export type VerificationIdentifier = {
|
|
14
|
+
type: SignInIdentifier | AdditionalIdentifier;
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const verificationIdentifierGuard: z.ZodObject<{
|
|
18
|
+
type: z.ZodUnion<[z.ZodNativeEnum<typeof SignInIdentifier>, z.ZodNativeEnum<typeof AdditionalIdentifier>]>;
|
|
19
|
+
value: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
type: SignInIdentifier | AdditionalIdentifier;
|
|
22
|
+
value: string;
|
|
23
|
+
}, {
|
|
24
|
+
type: SignInIdentifier | AdditionalIdentifier;
|
|
25
|
+
value: string;
|
|
26
|
+
}>;
|
|
13
27
|
/** Identifiers that can be used to uniquely identify a user. */
|
|
14
28
|
export type InteractionIdentifier<T extends SignInIdentifier = SignInIdentifier> = {
|
|
15
29
|
type: T;
|
|
@@ -41,18 +55,6 @@ export declare const verificationCodeIdentifierGuard: z.ZodObject<{
|
|
|
41
55
|
type: SignInIdentifier.Email | SignInIdentifier.Phone;
|
|
42
56
|
value: string;
|
|
43
57
|
}>;
|
|
44
|
-
/** Logto supported interaction verification types. */
|
|
45
|
-
export declare enum VerificationType {
|
|
46
|
-
Password = "Password",
|
|
47
|
-
EmailVerificationCode = "EmailVerificationCode",
|
|
48
|
-
PhoneVerificationCode = "PhoneVerificationCode",
|
|
49
|
-
Social = "Social",
|
|
50
|
-
EnterpriseSso = "EnterpriseSso",
|
|
51
|
-
TOTP = "Totp",
|
|
52
|
-
WebAuthn = "WebAuthn",
|
|
53
|
-
BackupCode = "BackupCode",
|
|
54
|
-
NewPasswordIdentity = "NewPasswordIdentity"
|
|
55
|
-
}
|
|
56
58
|
/** Payload type for `POST /api/experience/verification/{social|sso}/:connectorId/authorization-uri`. */
|
|
57
59
|
export type SocialAuthorizationUrlPayload = {
|
|
58
60
|
state: string;
|
|
@@ -62,11 +64,11 @@ export declare const socialAuthorizationUrlPayloadGuard: z.ZodObject<{
|
|
|
62
64
|
state: z.ZodString;
|
|
63
65
|
redirectUri: z.ZodString;
|
|
64
66
|
}, "strip", z.ZodTypeAny, {
|
|
65
|
-
state: string;
|
|
66
67
|
redirectUri: string;
|
|
67
|
-
}, {
|
|
68
68
|
state: string;
|
|
69
|
+
}, {
|
|
69
70
|
redirectUri: string;
|
|
71
|
+
state: string;
|
|
70
72
|
}>;
|
|
71
73
|
/** Payload type for `POST /api/experience/verification/{social|sso}/:connectorId/verify`. */
|
|
72
74
|
export type SocialVerificationCallbackPayload = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { emailRegEx, phoneRegEx, usernameRegEx } from '@logto/core-kit';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { MfaFactor, SignInIdentifier, jsonObjectGuard, webAuthnTransportGuard, } from '../foundations/index.js';
|
|
3
|
+
import { AdditionalIdentifier, MfaFactor, SignInIdentifier, jsonObjectGuard, webAuthnTransportGuard, } from '../foundations/index.js';
|
|
4
4
|
import { emailVerificationCodePayloadGuard, phoneVerificationCodePayloadGuard, } from './verification-code.js';
|
|
5
5
|
/**
|
|
6
6
|
* User interaction events defined in Logto RFC 0004.
|
|
@@ -12,6 +12,10 @@ export var InteractionEvent;
|
|
|
12
12
|
InteractionEvent["Register"] = "Register";
|
|
13
13
|
InteractionEvent["ForgotPassword"] = "ForgotPassword";
|
|
14
14
|
})(InteractionEvent || (InteractionEvent = {}));
|
|
15
|
+
export const verificationIdentifierGuard = z.object({
|
|
16
|
+
type: z.union([z.nativeEnum(SignInIdentifier), z.nativeEnum(AdditionalIdentifier)]),
|
|
17
|
+
value: z.string(),
|
|
18
|
+
});
|
|
15
19
|
export const interactionIdentifierGuard = z.object({
|
|
16
20
|
type: z.nativeEnum(SignInIdentifier),
|
|
17
21
|
value: z.string(),
|
|
@@ -20,19 +24,6 @@ export const verificationCodeIdentifierGuard = z.object({
|
|
|
20
24
|
type: z.enum([SignInIdentifier.Email, SignInIdentifier.Phone]),
|
|
21
25
|
value: z.string(),
|
|
22
26
|
});
|
|
23
|
-
/** Logto supported interaction verification types. */
|
|
24
|
-
export var VerificationType;
|
|
25
|
-
(function (VerificationType) {
|
|
26
|
-
VerificationType["Password"] = "Password";
|
|
27
|
-
VerificationType["EmailVerificationCode"] = "EmailVerificationCode";
|
|
28
|
-
VerificationType["PhoneVerificationCode"] = "PhoneVerificationCode";
|
|
29
|
-
VerificationType["Social"] = "Social";
|
|
30
|
-
VerificationType["EnterpriseSso"] = "EnterpriseSso";
|
|
31
|
-
VerificationType["TOTP"] = "Totp";
|
|
32
|
-
VerificationType["WebAuthn"] = "WebAuthn";
|
|
33
|
-
VerificationType["BackupCode"] = "BackupCode";
|
|
34
|
-
VerificationType["NewPasswordIdentity"] = "NewPasswordIdentity";
|
|
35
|
-
})(VerificationType || (VerificationType = {}));
|
|
36
27
|
export const socialAuthorizationUrlPayloadGuard = z.object({
|
|
37
28
|
state: z.string(),
|
|
38
29
|
redirectUri: z.string(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type MfaFactor } from '../../foundations/index.js';
|
|
2
|
-
import type { InteractionEvent
|
|
1
|
+
import { type VerificationType, type MfaFactor } from '../../foundations/index.js';
|
|
2
|
+
import type { InteractionEvent } from '../interactions.js';
|
|
3
3
|
export type Prefix = 'Interaction';
|
|
4
4
|
export declare const prefix: Prefix;
|
|
5
5
|
/** The interaction field to update. This is valid based on we only allow users update one field at a time. */
|
|
@@ -67,4 +67,4 @@ export declare enum Action {
|
|
|
67
67
|
* - When {@link Method} is `VerificationCode`, {@link Action} can be `Create` (generate and send a code) or `Submit` (verify and submit to the identifiers);
|
|
68
68
|
* - Otherwise, {@link Action} is fixed to `Submit` (other methods can be verified on submitting).
|
|
69
69
|
*/
|
|
70
|
-
export type LogKey = `${Prefix}.${Action.Create | Action.End}` | `${Prefix}.${InteractionEvent}.${Action.Create | Action.Update | Action.Submit}` | `${Prefix}.${InteractionEvent}.${Field.Profile}.${Action.Update | Action.Create | Action.Delete}` | `${Prefix}.${Exclude<InteractionEvent, InteractionEvent.ForgotPassword>}.${Field.Identifier}.${Exclude<Method, Method.Password>}.${Action.Create | Action.Submit}` | `${Prefix}.${Exclude<InteractionEvent, InteractionEvent.ForgotPassword>}.${Field.Identifier}.${Method.Password}.${Action.Submit}` | `${Prefix}.${InteractionEvent.ForgotPassword}.${Field.Identifier}.${Method.VerificationCode}.${Action.Create | Action.Submit}` | `${Prefix}.${InteractionEvent}.${Field.BindMfa}.${MfaFactor}.${Action.Submit | Action.Create}` | `${Prefix}.${InteractionEvent.SignIn}.${Field.Mfa}.${MfaFactor}.${Action.Submit | Action.Create}` | `${Prefix}.${InteractionEvent}.${Field.Verification}.${VerificationType}.${Action}` | `${Prefix}.${InteractionEvent}.${Field.Identifier}.${Action.Submit}`;
|
|
70
|
+
export type LogKey = `${Prefix}.${Action.Create | Action.End}` | `${Prefix}.${InteractionEvent}.${Action.Create | Action.Update | Action.Submit}` | `${Prefix}.${InteractionEvent}.${Field.Profile}.${Action.Update | Action.Create | Action.Delete}` | `${Prefix}.${Exclude<InteractionEvent, InteractionEvent.ForgotPassword>}.${Field.Identifier}.${Exclude<Method, Method.Password>}.${Action.Create | Action.Submit}` | `${Prefix}.${Exclude<InteractionEvent, InteractionEvent.ForgotPassword>}.${Field.Identifier}.${Method.Password}.${Action.Submit}` | `${Prefix}.${InteractionEvent.ForgotPassword}.${Field.Identifier}.${Method.VerificationCode}.${Action.Create | Action.Submit}` | `${Prefix}.${InteractionEvent}.${Field.BindMfa}.${MfaFactor}.${Action.Submit | Action.Create}` | `${Prefix}.${InteractionEvent.SignIn}.${Field.Mfa}.${MfaFactor}.${Action.Submit | Action.Create}` | `${Prefix}.${InteractionEvent}.${Field.Verification}.${VerificationType}.${Action}` | `${Prefix}.${InteractionEvent}.${Field.Identifier}.${Action.Submit}` | `${Prefix}.${InteractionEvent.SignIn}.${Field.Verification}.IdpInitiatedSso.${Action.Create}`;
|
|
@@ -1890,3 +1890,51 @@ export declare const customJwtFetcherGuard: z.ZodDiscriminatedUnion<"tokenType",
|
|
|
1890
1890
|
environmentVariables?: Record<string, string> | undefined;
|
|
1891
1891
|
}>]>;
|
|
1892
1892
|
export type CustomJwtFetcher = z.infer<typeof customJwtFetcherGuard>;
|
|
1893
|
+
export declare enum CustomJwtErrorCode {
|
|
1894
|
+
/**
|
|
1895
|
+
* The `AccessDenied` error explicitly thrown
|
|
1896
|
+
* by calling the `api.denyAccess` function in the custom JWT script.
|
|
1897
|
+
*/
|
|
1898
|
+
AccessDenied = "AccessDenied",
|
|
1899
|
+
/** General JWT customizer error,
|
|
1900
|
+
* this is the fallback custom jwt error code
|
|
1901
|
+
* for any internal error thrown by the JWT customizer (localVM, azure function, or CF worker).
|
|
1902
|
+
*/
|
|
1903
|
+
General = "General"
|
|
1904
|
+
}
|
|
1905
|
+
export declare const customJwtErrorBodyGuard: z.ZodObject<{
|
|
1906
|
+
code: z.ZodNativeEnum<typeof CustomJwtErrorCode>;
|
|
1907
|
+
message: z.ZodString;
|
|
1908
|
+
}, "strip", z.ZodTypeAny, {
|
|
1909
|
+
code: CustomJwtErrorCode;
|
|
1910
|
+
message: string;
|
|
1911
|
+
}, {
|
|
1912
|
+
code: CustomJwtErrorCode;
|
|
1913
|
+
message: string;
|
|
1914
|
+
}>;
|
|
1915
|
+
export type CustomJwtErrorBody = z.infer<typeof customJwtErrorBodyGuard>;
|
|
1916
|
+
export type CustomJwtApiContext = {
|
|
1917
|
+
/**
|
|
1918
|
+
* Reject the the current token request.
|
|
1919
|
+
*
|
|
1920
|
+
* @remarks
|
|
1921
|
+
* By calling this function, the current token request will be rejected,
|
|
1922
|
+
* and a OIDC `AccessDenied` error will be thrown to the client with the given message.
|
|
1923
|
+
*
|
|
1924
|
+
* @param message The message to be shown to the user.
|
|
1925
|
+
* @throws {ResponseError} with `CustomJwtErrorBody`
|
|
1926
|
+
*/
|
|
1927
|
+
denyAccess: (message?: string) => never;
|
|
1928
|
+
};
|
|
1929
|
+
/**
|
|
1930
|
+
* The payload type for the custom JWT script.
|
|
1931
|
+
*
|
|
1932
|
+
* @remarks
|
|
1933
|
+
* We use this type to guard the input payload for the custom JWT script.
|
|
1934
|
+
*/
|
|
1935
|
+
export type CustomJwtScriptPayload = {
|
|
1936
|
+
token: Record<string, unknown>;
|
|
1937
|
+
context?: Record<string, unknown>;
|
|
1938
|
+
environmentVariables?: Record<string, string>;
|
|
1939
|
+
api: CustomJwtApiContext;
|
|
1940
|
+
};
|
|
@@ -101,3 +101,20 @@ export const customJwtFetcherGuard = z.discriminatedUnion('tokenType', [
|
|
|
101
101
|
tokenType: z.literal(LogtoJwtTokenKeyType.ClientCredentials),
|
|
102
102
|
}),
|
|
103
103
|
]);
|
|
104
|
+
export var CustomJwtErrorCode;
|
|
105
|
+
(function (CustomJwtErrorCode) {
|
|
106
|
+
/**
|
|
107
|
+
* The `AccessDenied` error explicitly thrown
|
|
108
|
+
* by calling the `api.denyAccess` function in the custom JWT script.
|
|
109
|
+
*/
|
|
110
|
+
CustomJwtErrorCode["AccessDenied"] = "AccessDenied";
|
|
111
|
+
/** General JWT customizer error,
|
|
112
|
+
* this is the fallback custom jwt error code
|
|
113
|
+
* for any internal error thrown by the JWT customizer (localVM, azure function, or CF worker).
|
|
114
|
+
*/
|
|
115
|
+
CustomJwtErrorCode["General"] = "General";
|
|
116
|
+
})(CustomJwtErrorCode || (CustomJwtErrorCode = {}));
|
|
117
|
+
export const customJwtErrorBodyGuard = z.object({
|
|
118
|
+
code: z.nativeEnum(CustomJwtErrorCode),
|
|
119
|
+
message: z.string(),
|
|
120
|
+
});
|
|
@@ -54,10 +54,10 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
|
|
|
54
54
|
}>;
|
|
55
55
|
languageInfo: z.ZodType<{
|
|
56
56
|
autoDetect: boolean;
|
|
57
|
-
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";
|
|
57
|
+
fallbackLanguage: "af-ZA" | "am-ET" | "ar" | "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";
|
|
58
58
|
}, z.ZodTypeDef, {
|
|
59
59
|
autoDetect: boolean;
|
|
60
|
-
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";
|
|
60
|
+
fallbackLanguage: "af-ZA" | "am-ET" | "ar" | "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";
|
|
61
61
|
}>;
|
|
62
62
|
termsOfUseUrl: z.ZodType<string | null, z.ZodTypeDef, string | null>;
|
|
63
63
|
privacyPolicyUrl: z.ZodType<string | null, z.ZodTypeDef, string | null>;
|
|
@@ -332,6 +332,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
|
|
|
332
332
|
} & {
|
|
333
333
|
"af-ZA"?: string | undefined;
|
|
334
334
|
"am-ET"?: string | undefined;
|
|
335
|
+
ar?: string | undefined;
|
|
335
336
|
"ar-AR"?: string | undefined;
|
|
336
337
|
"as-IN"?: string | undefined;
|
|
337
338
|
"az-AZ"?: string | undefined;
|
|
@@ -466,6 +467,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
|
|
|
466
467
|
} & {
|
|
467
468
|
"af-ZA"?: string | undefined;
|
|
468
469
|
"am-ET"?: string | undefined;
|
|
470
|
+
ar?: string | undefined;
|
|
469
471
|
"ar-AR"?: string | undefined;
|
|
470
472
|
"as-IN"?: string | undefined;
|
|
471
473
|
"az-AZ"?: string | undefined;
|
|
@@ -671,6 +673,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
|
|
|
671
673
|
} & {
|
|
672
674
|
"af-ZA"?: string | undefined;
|
|
673
675
|
"am-ET"?: string | undefined;
|
|
676
|
+
ar?: string | undefined;
|
|
674
677
|
"ar-AR"?: string | undefined;
|
|
675
678
|
"as-IN"?: string | undefined;
|
|
676
679
|
"az-AZ"?: string | undefined;
|
|
@@ -845,6 +848,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<z.objectUtil.extendS
|
|
|
845
848
|
} & {
|
|
846
849
|
"af-ZA"?: string | undefined;
|
|
847
850
|
"am-ET"?: string | undefined;
|
|
851
|
+
ar?: string | undefined;
|
|
848
852
|
"ar-AR"?: string | undefined;
|
|
849
853
|
"as-IN"?: string | undefined;
|
|
850
854
|
"az-AZ"?: string | undefined;
|
|
@@ -140,4 +140,7 @@ export declare const ssoConnectorWithProviderConfigGuard: z.ZodObject<z.objectUt
|
|
|
140
140
|
providerConfig?: Record<string, unknown> | undefined;
|
|
141
141
|
}>;
|
|
142
142
|
export type SsoConnectorWithProviderConfig = z.infer<typeof ssoConnectorWithProviderConfigGuard>;
|
|
143
|
+
export declare enum SsoAuthenticationQueryKey {
|
|
144
|
+
SsoConnectorId = "ssoConnectorId"
|
|
145
|
+
}
|
|
143
146
|
export {};
|
|
@@ -69,3 +69,7 @@ z.object({
|
|
|
69
69
|
// - SAML: connection config fetched from the metadata url or metadata file.
|
|
70
70
|
providerConfig: z.record(z.unknown()).optional(),
|
|
71
71
|
}));
|
|
72
|
+
export var SsoAuthenticationQueryKey;
|
|
73
|
+
(function (SsoAuthenticationQueryKey) {
|
|
74
|
+
SsoAuthenticationQueryKey["SsoConnectorId"] = "ssoConnectorId";
|
|
75
|
+
})(SsoAuthenticationQueryKey || (SsoAuthenticationQueryKey = {}));
|
package/lib/types/system.d.ts
CHANGED
|
@@ -250,8 +250,25 @@ export type CloudflareType = {
|
|
|
250
250
|
export declare const cloudflareGuard: Readonly<{
|
|
251
251
|
[key in CloudflareKey]: ZodType<CloudflareType[key]>;
|
|
252
252
|
}>;
|
|
253
|
-
export
|
|
254
|
-
|
|
255
|
-
|
|
253
|
+
export declare enum FeatureFlagConfigKey {
|
|
254
|
+
NewExperienceFeatureFlag = "newExperienceFeatureFlag"
|
|
255
|
+
}
|
|
256
|
+
export declare const featureFlagConfigGuard: z.ZodObject<{
|
|
257
|
+
percentage: z.ZodNumber;
|
|
258
|
+
}, "strip", z.ZodTypeAny, {
|
|
259
|
+
percentage: number;
|
|
260
|
+
}, {
|
|
261
|
+
percentage: number;
|
|
262
|
+
}>;
|
|
263
|
+
export type FeatureFlagConfig = z.infer<typeof featureFlagConfigGuard>;
|
|
264
|
+
export type FeatureFlagConfigType = {
|
|
265
|
+
[FeatureFlagConfigKey.NewExperienceFeatureFlag]: FeatureFlagConfig;
|
|
266
|
+
};
|
|
267
|
+
export declare const featureFlagConfigsGuard: Readonly<{
|
|
268
|
+
[key in FeatureFlagConfigKey]: ZodType<FeatureFlagConfigType[key]>;
|
|
269
|
+
}>;
|
|
270
|
+
export type SystemKey = AlterationStateKey | StorageProviderKey | DemoSocialKey | CloudflareKey | EmailServiceProviderKey | FeatureFlagConfigKey;
|
|
271
|
+
export type SystemType = AlterationStateType | StorageProviderType | DemoSocialType | CloudflareType | EmailServiceProviderType | FeatureFlagConfigType;
|
|
272
|
+
export type SystemGuard = typeof alterationStateGuard & typeof storageProviderGuard & typeof demoSocialGuard & typeof cloudflareGuard & typeof emailServiceProviderGuard & typeof featureFlagConfigsGuard;
|
|
256
273
|
export declare const systemKeys: readonly SystemKey[];
|
|
257
274
|
export declare const systemGuards: SystemGuard;
|
package/lib/types/system.js
CHANGED
|
@@ -145,12 +145,24 @@ export const cloudflareGuard = Object.freeze({
|
|
|
145
145
|
[CloudflareKey.ProtectedAppHostnameProvider]: hostnameProviderDataGuard,
|
|
146
146
|
[CloudflareKey.CustomJwtWorkerConfig]: customJwtWorkerConfigGuard,
|
|
147
147
|
});
|
|
148
|
+
// A/B Test settings
|
|
149
|
+
export var FeatureFlagConfigKey;
|
|
150
|
+
(function (FeatureFlagConfigKey) {
|
|
151
|
+
FeatureFlagConfigKey["NewExperienceFeatureFlag"] = "newExperienceFeatureFlag";
|
|
152
|
+
})(FeatureFlagConfigKey || (FeatureFlagConfigKey = {}));
|
|
153
|
+
export const featureFlagConfigGuard = z.object({
|
|
154
|
+
percentage: z.number().min(0).max(1),
|
|
155
|
+
});
|
|
156
|
+
export const featureFlagConfigsGuard = Object.freeze({
|
|
157
|
+
[FeatureFlagConfigKey.NewExperienceFeatureFlag]: featureFlagConfigGuard,
|
|
158
|
+
});
|
|
148
159
|
export const systemKeys = Object.freeze([
|
|
149
160
|
...Object.values(AlterationStateKey),
|
|
150
161
|
...Object.values(StorageProviderKey),
|
|
151
162
|
...Object.values(DemoSocialKey),
|
|
152
163
|
...Object.values(CloudflareKey),
|
|
153
164
|
...Object.values(EmailServiceProviderKey),
|
|
165
|
+
...Object.values(FeatureFlagConfigKey),
|
|
154
166
|
]);
|
|
155
167
|
export const systemGuards = Object.freeze({
|
|
156
168
|
...alterationStateGuard,
|
|
@@ -158,4 +170,5 @@ export const systemGuards = Object.freeze({
|
|
|
158
170
|
...demoSocialGuard,
|
|
159
171
|
...cloudflareGuard,
|
|
160
172
|
...emailServiceProviderGuard,
|
|
173
|
+
...featureFlagConfigsGuard,
|
|
161
174
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logto/schemas",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"author": "Silverhand Inc. <contact@silverhand.io>",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -66,10 +66,10 @@
|
|
|
66
66
|
"@logto/connector-kit": "^4.0.0",
|
|
67
67
|
"@logto/core-kit": "^2.5.0",
|
|
68
68
|
"@logto/language-kit": "^1.1.0",
|
|
69
|
-
"@logto/phrases": "^1.
|
|
70
|
-
"@logto/phrases-experience": "^1.
|
|
71
|
-
"@logto/shared": "^3.1.
|
|
72
|
-
"@withtyped/server": "^0.
|
|
69
|
+
"@logto/phrases": "^1.14.1",
|
|
70
|
+
"@logto/phrases-experience": "^1.8.0",
|
|
71
|
+
"@logto/shared": "^3.1.2",
|
|
72
|
+
"@withtyped/server": "^0.14.0",
|
|
73
73
|
"nanoid": "^5.0.1"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* init_order = 2 */
|
|
2
|
+
create table idp_initiated_saml_sso_sessions (
|
|
3
|
+
tenant_id varchar(21) not null
|
|
4
|
+
references tenants (id) on update cascade on delete cascade,
|
|
5
|
+
/** The globally unique identifier of the assertion record. */
|
|
6
|
+
id varchar(21) not null,
|
|
7
|
+
/** The identifier of the SAML SSO connector. */
|
|
8
|
+
connector_id varchar(128) not null
|
|
9
|
+
references sso_connectors (id) on update cascade on delete cascade,
|
|
10
|
+
/** The SAML assertion. */
|
|
11
|
+
assertion_content jsonb /* @use SsoSamlAssertionContent */ not null default '{}'::jsonb,
|
|
12
|
+
created_at timestamptz not null default(now()),
|
|
13
|
+
/** The expiration time of the assertion. */
|
|
14
|
+
expires_at timestamptz not null,
|
|
15
|
+
primary key (tenant_id, id)
|
|
16
|
+
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* init_order = 2 */
|
|
2
|
+
|
|
3
|
+
create table personal_access_tokens (
|
|
4
|
+
tenant_id varchar(21) not null
|
|
5
|
+
references tenants (id) on update cascade on delete cascade,
|
|
6
|
+
user_id varchar(21) not null
|
|
7
|
+
references users (id) on update cascade on delete cascade,
|
|
8
|
+
/** The name of the secret. Should be unique within the user. */
|
|
9
|
+
name varchar(256) not null,
|
|
10
|
+
value varchar(64) not null,
|
|
11
|
+
created_at timestamptz not null default now(),
|
|
12
|
+
expires_at timestamptz,
|
|
13
|
+
primary key (tenant_id, user_id, name)
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
create index personal_access_token__value on personal_access_tokens (tenant_id, value);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** init_order = 2 */
|
|
2
|
+
create table sso_connector_idp_initiated_auth_configs (
|
|
3
|
+
tenant_id varchar(21) not null
|
|
4
|
+
references tenants (id) on update cascade on delete cascade,
|
|
5
|
+
/** The globally unique identifier of the SSO connector. */
|
|
6
|
+
connector_id varchar(128) not null
|
|
7
|
+
references sso_connectors (id) on update cascade on delete cascade,
|
|
8
|
+
/** The default Logto application id. */
|
|
9
|
+
default_application_id varchar(21) not null
|
|
10
|
+
references applications (id) on update cascade on delete cascade,
|
|
11
|
+
/** OIDC sign-in redirect URI. */
|
|
12
|
+
redirect_uri text,
|
|
13
|
+
/** Additional OIDC auth parameters. */
|
|
14
|
+
auth_parameters jsonb /* @use IdpInitiatedAuthParams */ not null default '{}'::jsonb,
|
|
15
|
+
/** Whether to auto-trigger the auth flow on an IdP-initiated auth request. */
|
|
16
|
+
auto_send_authorization_request boolean not null default false,
|
|
17
|
+
/** The client side callback URI for handling IdP-initiated auth request. */
|
|
18
|
+
client_idp_initiated_auth_callback_uri text,
|
|
19
|
+
created_at timestamptz not null default(now()),
|
|
20
|
+
primary key (tenant_id, connector_id),
|
|
21
|
+
/** Insure the application type is Traditional or SPA. */
|
|
22
|
+
constraint application_type
|
|
23
|
+
check (check_application_type(default_application_id, 'Traditional', 'SPA'))
|
|
24
|
+
);
|