@logto/schemas 1.41.0 → 1.42.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.42.0-1783916980-add-domain-verification-files.ts +20 -0
- package/alterations/1.42.0-1784619793-add-service-logs-created-at-index.ts +33 -0
- package/alterations/1.42.0-1784620000-add-saml-sso-connector-signing-keys-table.ts +38 -0
- package/alterations/utils/1704934999-tables.ts +22 -1
- package/alterations-js/1.42.0-1783916980-add-domain-verification-files.js +16 -0
- package/alterations-js/1.42.0-1784619793-add-service-logs-created-at-index.js +29 -0
- package/alterations-js/1.42.0-1784620000-add-saml-sso-connector-signing-keys-table.js +33 -0
- package/alterations-js/utils/1704934999-tables.js +19 -1
- package/lib/consts/experience.d.ts +1 -0
- package/lib/consts/experience.js +1 -0
- package/lib/db-entries/domain.d.ts +4 -2
- package/lib/db-entries/domain.js +5 -1
- package/lib/db-entries/index.d.ts +1 -0
- package/lib/db-entries/index.js +1 -0
- package/lib/db-entries/saml-sso-connector-signing-key.d.ts +32 -0
- package/lib/db-entries/saml-sso-connector-signing-key.js +49 -0
- package/lib/foundations/jsonb-types/custom-domain.d.ts +57 -0
- package/lib/foundations/jsonb-types/custom-domain.js +51 -0
- package/lib/foundations/jsonb-types/custom-domain.test.d.ts +1 -0
- package/lib/foundations/jsonb-types/custom-domain.test.js +38 -0
- package/lib/foundations/jsonb-types/hooks.d.ts +4 -4
- package/lib/foundations/jsonb-types/hooks.js +1 -0
- package/lib/foundations/jsonb-types/one-time-tokens.d.ts +5 -0
- package/lib/foundations/jsonb-types/one-time-tokens.js +2 -0
- package/lib/foundations/jsonb-types/sign-in-experience.d.ts +16 -1
- package/lib/foundations/jsonb-types/sign-in-experience.js +1 -0
- package/lib/types/application.d.ts +131 -1
- package/lib/types/application.js +8 -0
- package/lib/types/custom-profile-fields.d.ts +1 -1
- package/lib/types/domain.d.ts +9 -0
- package/lib/types/hook.d.ts +9 -2
- package/lib/types/interaction-event.d.ts +11 -0
- package/lib/types/interaction-event.js +12 -0
- package/lib/types/interactions.d.ts +2 -11
- package/lib/types/interactions.js +2 -11
- package/lib/types/log/action.d.ts +7 -0
- package/lib/types/log/action.js +6 -0
- package/lib/types/log/index.d.ts +5 -2
- package/lib/types/log/index.js +1 -0
- package/lib/types/logto-config/action.d.ts +963 -0
- package/lib/types/logto-config/action.js +77 -0
- package/lib/types/logto-config/index.d.ts +32 -19
- package/lib/types/logto-config/index.js +7 -7
- package/lib/types/logto-config/index.test.js +9 -9
- package/lib/types/logto-config/jwt-customizer.d.ts +29 -0
- package/lib/types/organization.d.ts +136 -1
- package/lib/types/organization.js +3 -2
- package/lib/types/sign-in-experience.d.ts +2 -4
- package/lib/types/sign-in-experience.js +1 -1
- package/lib/types/sso-connector.d.ts +58 -0
- package/lib/types/sso-connector.js +12 -0
- package/lib/types/user-sessions.d.ts +78 -29
- package/lib/types/verification-records/one-time-token-verification.d.ts +5 -0
- package/package.json +5 -5
- package/tables/domains.sql +1 -0
- package/tables/saml_sso_connector_signing_keys.sql +21 -0
- package/tables/service_logs.sql +5 -0
- package/lib/types/logto-config/inline-hook.d.ts +0 -76
- package/lib/types/logto-config/inline-hook.js +0 -25
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
1
2
|
import { type OrganizationRole, type Organization, type OrganizationInvitation, type Application } from '../db-entries/index.js';
|
|
2
3
|
import { type ToZodObject } from '../utils/zod.js';
|
|
3
4
|
import { type UserInfo, type FeaturedUser } from './user.js';
|
|
@@ -66,7 +67,141 @@ export type ApplicationWithOrganizationRoles = Application & {
|
|
|
66
67
|
/** The roles of the application in the organization. */
|
|
67
68
|
organizationRoles: OrganizationRoleEntity[];
|
|
68
69
|
};
|
|
69
|
-
export declare const applicationWithOrganizationRolesGuard:
|
|
70
|
+
export declare const applicationWithOrganizationRolesGuard: z.ZodObject<{
|
|
71
|
+
tenantId: z.ZodType<string, z.ZodTypeDef, string>;
|
|
72
|
+
id: z.ZodType<string, z.ZodTypeDef, string>;
|
|
73
|
+
name: z.ZodType<string, z.ZodTypeDef, string>;
|
|
74
|
+
description: z.ZodType<string | null, z.ZodTypeDef, string | null>;
|
|
75
|
+
type: z.ZodType<import("../db-entries/custom-types.js").ApplicationType, z.ZodTypeDef, import("../db-entries/custom-types.js").ApplicationType>;
|
|
76
|
+
oidcClientMetadata: z.ZodType<import("../index.js").OidcClientMetadata, z.ZodTypeDef, import("../index.js").OidcClientMetadata>;
|
|
77
|
+
customClientMetadata: z.ZodType<{
|
|
78
|
+
corsAllowedOrigins?: string[] | undefined;
|
|
79
|
+
idTokenTtl?: number | undefined;
|
|
80
|
+
refreshTokenTtl?: number | undefined;
|
|
81
|
+
refreshTokenTtlInDays?: number | undefined;
|
|
82
|
+
tenantId?: string | undefined;
|
|
83
|
+
alwaysIssueRefreshToken?: boolean | undefined;
|
|
84
|
+
rotateRefreshToken?: boolean | undefined;
|
|
85
|
+
allowTokenExchange?: boolean | undefined;
|
|
86
|
+
isDeviceFlow?: boolean | undefined;
|
|
87
|
+
maxAllowedGrants?: number | undefined;
|
|
88
|
+
}, z.ZodTypeDef, {
|
|
89
|
+
corsAllowedOrigins?: string[] | undefined;
|
|
90
|
+
idTokenTtl?: number | undefined;
|
|
91
|
+
refreshTokenTtl?: number | undefined;
|
|
92
|
+
refreshTokenTtlInDays?: number | undefined;
|
|
93
|
+
tenantId?: string | undefined;
|
|
94
|
+
alwaysIssueRefreshToken?: boolean | undefined;
|
|
95
|
+
rotateRefreshToken?: boolean | undefined;
|
|
96
|
+
allowTokenExchange?: boolean | undefined;
|
|
97
|
+
isDeviceFlow?: boolean | undefined;
|
|
98
|
+
maxAllowedGrants?: number | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
protectedAppMetadata: z.ZodType<{
|
|
101
|
+
host: string;
|
|
102
|
+
origin: string;
|
|
103
|
+
sessionDuration: number;
|
|
104
|
+
pageRules: {
|
|
105
|
+
path: string;
|
|
106
|
+
}[];
|
|
107
|
+
additionalScopes?: (import("@logto/core-kit").UserScope.CustomData | import("@logto/core-kit").UserScope.Identities | import("@logto/core-kit").UserScope.Roles | import("@logto/core-kit").UserScope.Organizations | import("@logto/core-kit").UserScope.OrganizationRoles)[] | undefined;
|
|
108
|
+
customDomains?: {
|
|
109
|
+
status: import("../index.js").DomainStatus;
|
|
110
|
+
domain: string;
|
|
111
|
+
errorMessage: string | null;
|
|
112
|
+
dnsRecords: {
|
|
113
|
+
value: string;
|
|
114
|
+
type: string;
|
|
115
|
+
name: string;
|
|
116
|
+
}[];
|
|
117
|
+
cloudflareData: {
|
|
118
|
+
status: string;
|
|
119
|
+
id: string;
|
|
120
|
+
ssl: {
|
|
121
|
+
status: string;
|
|
122
|
+
validation_errors?: {
|
|
123
|
+
message: string;
|
|
124
|
+
}[] | undefined;
|
|
125
|
+
};
|
|
126
|
+
verification_errors?: string[] | undefined;
|
|
127
|
+
} | null;
|
|
128
|
+
}[] | undefined;
|
|
129
|
+
} | null, z.ZodTypeDef, {
|
|
130
|
+
host: string;
|
|
131
|
+
origin: string;
|
|
132
|
+
sessionDuration: number;
|
|
133
|
+
pageRules: {
|
|
134
|
+
path: string;
|
|
135
|
+
}[];
|
|
136
|
+
additionalScopes?: (import("@logto/core-kit").UserScope.CustomData | import("@logto/core-kit").UserScope.Identities | import("@logto/core-kit").UserScope.Roles | import("@logto/core-kit").UserScope.Organizations | import("@logto/core-kit").UserScope.OrganizationRoles)[] | undefined;
|
|
137
|
+
customDomains?: {
|
|
138
|
+
status: import("../index.js").DomainStatus;
|
|
139
|
+
domain: string;
|
|
140
|
+
errorMessage: string | null;
|
|
141
|
+
dnsRecords: {
|
|
142
|
+
value: string;
|
|
143
|
+
type: string;
|
|
144
|
+
name: string;
|
|
145
|
+
}[];
|
|
146
|
+
cloudflareData: {
|
|
147
|
+
status: string;
|
|
148
|
+
id: string;
|
|
149
|
+
ssl: {
|
|
150
|
+
status: string;
|
|
151
|
+
validation_errors?: {
|
|
152
|
+
message: string;
|
|
153
|
+
}[] | undefined;
|
|
154
|
+
};
|
|
155
|
+
verification_errors?: string[] | undefined;
|
|
156
|
+
} | null;
|
|
157
|
+
}[] | undefined;
|
|
158
|
+
} | null>;
|
|
159
|
+
customData: z.ZodType<import("@withtyped/server").JsonObject, z.ZodTypeDef, import("@withtyped/server").JsonObject>;
|
|
160
|
+
isThirdParty: z.ZodType<boolean, z.ZodTypeDef, boolean>;
|
|
161
|
+
appLevelAccessControlEnabled: z.ZodType<boolean, z.ZodTypeDef, boolean>;
|
|
162
|
+
createdAt: z.ZodType<number, z.ZodTypeDef, number>;
|
|
163
|
+
} & {
|
|
164
|
+
secret: z.ZodOptional<z.ZodType<string, z.ZodTypeDef, string>>;
|
|
165
|
+
} & {
|
|
166
|
+
organizationRoles: z.ZodArray<ToZodObject<OrganizationRoleEntity>, "many">;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
type: import("../db-entries/custom-types.js").ApplicationType;
|
|
169
|
+
name: string;
|
|
170
|
+
id: string;
|
|
171
|
+
tenantId: string;
|
|
172
|
+
createdAt: number;
|
|
173
|
+
customData: import("@withtyped/server").JsonObject;
|
|
174
|
+
description: string | null;
|
|
175
|
+
oidcClientMetadata: import("../index.js").OidcClientMetadata;
|
|
176
|
+
customClientMetadata: import("../index.js").CustomClientMetadata;
|
|
177
|
+
protectedAppMetadata: import("../index.js").ProtectedAppMetadata | null;
|
|
178
|
+
isThirdParty: boolean;
|
|
179
|
+
appLevelAccessControlEnabled: boolean;
|
|
180
|
+
organizationRoles: {
|
|
181
|
+
name: string;
|
|
182
|
+
id: string;
|
|
183
|
+
}[];
|
|
184
|
+
secret?: string | undefined;
|
|
185
|
+
}, {
|
|
186
|
+
type: import("../db-entries/custom-types.js").ApplicationType;
|
|
187
|
+
name: string;
|
|
188
|
+
id: string;
|
|
189
|
+
tenantId: string;
|
|
190
|
+
createdAt: number;
|
|
191
|
+
customData: import("@withtyped/server").JsonObject;
|
|
192
|
+
description: string | null;
|
|
193
|
+
oidcClientMetadata: import("../index.js").OidcClientMetadata;
|
|
194
|
+
customClientMetadata: import("../index.js").CustomClientMetadata;
|
|
195
|
+
protectedAppMetadata: import("../index.js").ProtectedAppMetadata | null;
|
|
196
|
+
isThirdParty: boolean;
|
|
197
|
+
appLevelAccessControlEnabled: boolean;
|
|
198
|
+
organizationRoles: {
|
|
199
|
+
name: string;
|
|
200
|
+
id: string;
|
|
201
|
+
}[];
|
|
202
|
+
secret?: string | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
export type ApplicationWithOrganizationRolesResponse = z.infer<typeof applicationWithOrganizationRolesGuard>;
|
|
70
205
|
/**
|
|
71
206
|
* The organization invitation with additional fields:
|
|
72
207
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { OrganizationRoles, Organizations, OrganizationInvitations,
|
|
2
|
+
import { OrganizationRoles, Organizations, OrganizationInvitations, } from '../db-entries/index.js';
|
|
3
|
+
import { applicationResponseGuard } from './application.js';
|
|
3
4
|
import { userInfoGuard } from './user.js';
|
|
4
5
|
export const organizationRoleWithScopesGuard = OrganizationRoles.guard.extend({
|
|
5
6
|
scopes: z
|
|
@@ -29,7 +30,7 @@ export const organizationWithOrganizationRolesGuard = Organizations.guard.extend
|
|
|
29
30
|
export const userWithOrganizationRolesGuard = userInfoGuard.extend({
|
|
30
31
|
organizationRoles: organizationRoleEntityGuard.array(),
|
|
31
32
|
});
|
|
32
|
-
export const applicationWithOrganizationRolesGuard =
|
|
33
|
+
export const applicationWithOrganizationRolesGuard = applicationResponseGuard.extend({
|
|
33
34
|
organizationRoles: organizationRoleEntityGuard.array(),
|
|
34
35
|
});
|
|
35
36
|
export const organizationInvitationEntityGuard = OrganizationInvitations.guard.extend({
|
|
@@ -12,7 +12,7 @@ type ForgotPassword = {
|
|
|
12
12
|
* the need to load the full connector metadata that is not needed for rendering.
|
|
13
13
|
*/
|
|
14
14
|
export type ExperienceSocialConnector = Omit<ConnectorMetadata, 'description' | 'configTemplate' | 'formItems' | 'readme' | 'customData'>;
|
|
15
|
-
export type FullSignInExperience = Omit<SignInExperience, 'forgotPasswordMethods'> & {
|
|
15
|
+
export type FullSignInExperience = Omit<SignInExperience, 'emailBlocklistPolicy' | 'forgotPasswordMethods'> & {
|
|
16
16
|
socialConnectors: ExperienceSocialConnector[];
|
|
17
17
|
ssoConnectors: SsoConnectorMetadata[];
|
|
18
18
|
forgotPassword: ForgotPassword;
|
|
@@ -160,7 +160,7 @@ export declare const fullSignInExperienceGuard: z.ZodObject<Omit<{
|
|
|
160
160
|
}[] | null>;
|
|
161
161
|
passwordExpiration: z.ZodType<import("../foundations/jsonb-types/sign-in-experience.js").PasswordExpirationPolicy, z.ZodTypeDef, import("../foundations/jsonb-types/sign-in-experience.js").PasswordExpirationPolicy>;
|
|
162
162
|
usernamePolicy: z.ZodType<import("../foundations/jsonb-types/index.js").UsernamePolicy, z.ZodTypeDef, import("../foundations/jsonb-types/index.js").UsernamePolicy>;
|
|
163
|
-
}, "forgotPasswordMethods"> & {
|
|
163
|
+
}, "emailBlocklistPolicy" | "forgotPasswordMethods"> & {
|
|
164
164
|
socialConnectors: z.ZodArray<z.ZodObject<Omit<{
|
|
165
165
|
id: z.ZodString;
|
|
166
166
|
target: z.ZodString;
|
|
@@ -740,7 +740,6 @@ export declare const fullSignInExperienceGuard: z.ZodObject<Omit<{
|
|
|
740
740
|
unknownSessionRedirectUrl: string | null;
|
|
741
741
|
captchaPolicy: import("../foundations/jsonb-types/sign-in-experience.js").CaptchaPolicy;
|
|
742
742
|
sentinelPolicy: import("../foundations/jsonb-types/sign-in-experience.js").SentinelPolicy;
|
|
743
|
-
emailBlocklistPolicy: import("../foundations/jsonb-types/sign-in-experience.js").EmailBlocklistPolicy;
|
|
744
743
|
verificationCodePolicy: import("../foundations/jsonb-types/sign-in-experience.js").VerificationCodePolicy;
|
|
745
744
|
passkeySignIn: import("../foundations/jsonb-types/sign-in-experience.js").PasskeySignIn;
|
|
746
745
|
signUpProfileFields: import("../foundations/jsonb-types/sign-in-experience.js").SignUpProfileFields | null;
|
|
@@ -943,7 +942,6 @@ export declare const fullSignInExperienceGuard: z.ZodObject<Omit<{
|
|
|
943
942
|
unknownSessionRedirectUrl: string | null;
|
|
944
943
|
captchaPolicy: import("../foundations/jsonb-types/sign-in-experience.js").CaptchaPolicy;
|
|
945
944
|
sentinelPolicy: import("../foundations/jsonb-types/sign-in-experience.js").SentinelPolicy;
|
|
946
|
-
emailBlocklistPolicy: import("../foundations/jsonb-types/sign-in-experience.js").EmailBlocklistPolicy;
|
|
947
945
|
verificationCodePolicy: import("../foundations/jsonb-types/sign-in-experience.js").VerificationCodePolicy;
|
|
948
946
|
passkeySignIn: import("../foundations/jsonb-types/sign-in-experience.js").PasskeySignIn;
|
|
949
947
|
signUpProfileFields: import("../foundations/jsonb-types/sign-in-experience.js").SignUpProfileFields | null;
|
|
@@ -4,7 +4,7 @@ import { CustomProfileFields, SignInExperiences, } from '../db-entries/index.js'
|
|
|
4
4
|
import { CaptchaType, RecaptchaEnterpriseMode } from '../foundations/jsonb-types/index.js';
|
|
5
5
|
import { ssoConnectorMetadataGuard } from './sso-connector.js';
|
|
6
6
|
export const fullSignInExperienceGuard = SignInExperiences.guard
|
|
7
|
-
.omit({ forgotPasswordMethods: true })
|
|
7
|
+
.omit({ emailBlocklistPolicy: true, forgotPasswordMethods: true })
|
|
8
8
|
.extend({
|
|
9
9
|
socialConnectors: connectorMetadataGuard
|
|
10
10
|
.omit({
|
|
@@ -168,4 +168,62 @@ export declare const extendedSocialUserInfoGuard: z.ZodObject<{
|
|
|
168
168
|
rawData: z.ZodOptional<z.ZodType<import("@withtyped/server").Json, z.ZodTypeDef, import("@withtyped/server").Json>>;
|
|
169
169
|
}, z.ZodUnknown, "strip">>;
|
|
170
170
|
export type ExtendedSocialUserInfo = z.infer<typeof extendedSocialUserInfoGuard>;
|
|
171
|
+
export declare const samlSsoConnectorSigningKeyResponseGuard: z.ZodObject<Omit<{
|
|
172
|
+
id: z.ZodType<string, z.ZodTypeDef, string>;
|
|
173
|
+
tenantId: z.ZodType<string, z.ZodTypeDef, string>;
|
|
174
|
+
ssoConnectorId: z.ZodType<string, z.ZodTypeDef, string>;
|
|
175
|
+
privateKey: z.ZodType<string, z.ZodTypeDef, string>;
|
|
176
|
+
certificate: z.ZodType<string, z.ZodTypeDef, string>;
|
|
177
|
+
createdAt: z.ZodType<number, z.ZodTypeDef, number>;
|
|
178
|
+
expiresAt: z.ZodType<number, z.ZodTypeDef, number>;
|
|
179
|
+
active: z.ZodType<boolean, z.ZodTypeDef, boolean>;
|
|
180
|
+
}, "tenantId" | "ssoConnectorId" | "privateKey"> & {
|
|
181
|
+
fingerprints: z.ZodObject<{
|
|
182
|
+
sha256: z.ZodObject<{
|
|
183
|
+
formatted: z.ZodString;
|
|
184
|
+
unformatted: z.ZodString;
|
|
185
|
+
}, "strip", z.ZodTypeAny, {
|
|
186
|
+
formatted: string;
|
|
187
|
+
unformatted: string;
|
|
188
|
+
}, {
|
|
189
|
+
formatted: string;
|
|
190
|
+
unformatted: string;
|
|
191
|
+
}>;
|
|
192
|
+
}, "strip", z.ZodTypeAny, {
|
|
193
|
+
sha256: {
|
|
194
|
+
formatted: string;
|
|
195
|
+
unformatted: string;
|
|
196
|
+
};
|
|
197
|
+
}, {
|
|
198
|
+
sha256: {
|
|
199
|
+
formatted: string;
|
|
200
|
+
unformatted: string;
|
|
201
|
+
};
|
|
202
|
+
}>;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
id: string;
|
|
205
|
+
createdAt: number;
|
|
206
|
+
certificate: string;
|
|
207
|
+
active: boolean;
|
|
208
|
+
expiresAt: number;
|
|
209
|
+
fingerprints: {
|
|
210
|
+
sha256: {
|
|
211
|
+
formatted: string;
|
|
212
|
+
unformatted: string;
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
}, {
|
|
216
|
+
id: string;
|
|
217
|
+
createdAt: number;
|
|
218
|
+
certificate: string;
|
|
219
|
+
active: boolean;
|
|
220
|
+
expiresAt: number;
|
|
221
|
+
fingerprints: {
|
|
222
|
+
sha256: {
|
|
223
|
+
formatted: string;
|
|
224
|
+
unformatted: string;
|
|
225
|
+
};
|
|
226
|
+
};
|
|
227
|
+
}>;
|
|
228
|
+
export type SamlSsoConnectorSigningKeyResponse = z.infer<typeof samlSsoConnectorSigningKeyResponseGuard>;
|
|
171
229
|
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { socialUserInfoGuard } from '@logto/connector-kit';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { SamlSsoConnectorSigningKeys } from '../db-entries/saml-sso-connector-signing-key.js';
|
|
3
4
|
import { SsoConnectors } from '../db-entries/sso-connector.js';
|
|
5
|
+
import { certificateFingerprintsGuard } from './saml-application.js';
|
|
4
6
|
/**
|
|
5
7
|
* SSO Connector data type that are returned to the experience client for sign-in use.
|
|
6
8
|
*/
|
|
@@ -76,3 +78,13 @@ export var SsoAuthenticationQueryKey;
|
|
|
76
78
|
})(SsoAuthenticationQueryKey || (SsoAuthenticationQueryKey = {}));
|
|
77
79
|
// Saml assertion returned user attribute value
|
|
78
80
|
export const extendedSocialUserInfoGuard = socialUserInfoGuard.catchall(z.unknown());
|
|
81
|
+
// Make sure the `privateKey` is not exposed in the response.
|
|
82
|
+
export const samlSsoConnectorSigningKeyResponseGuard = SamlSsoConnectorSigningKeys.guard
|
|
83
|
+
.omit({
|
|
84
|
+
tenantId: true,
|
|
85
|
+
ssoConnectorId: true,
|
|
86
|
+
privateKey: true,
|
|
87
|
+
})
|
|
88
|
+
.extend({
|
|
89
|
+
fingerprints: certificateFingerprintsGuard,
|
|
90
|
+
});
|