@logto/schemas 1.37.1 → 1.39.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.38.0-1772615848-add-oidc-model-instances-grant-id-partial-index.ts +26 -0
- package/alterations/1.38.0-1772619963-tune-oidc-model-instances-autovacuum.ts +28 -0
- package/alterations/1.38.0-1772621060-add-oidc-model-instances-grant-account-id-index.ts +26 -0
- package/alterations/1.39.0-1774752400-add-delete-account-url.ts +20 -0
- package/alterations/1.39.0-1774770686-add-account-center-custom-css.ts +20 -0
- package/alterations/1.39.0-1776502301-add-sign-up-profile-fields.ts +20 -0
- package/alterations-js/1.38.0-1772615848-add-oidc-model-instances-grant-id-partial-index.js +22 -0
- package/alterations-js/1.38.0-1772619963-tune-oidc-model-instances-autovacuum.js +24 -0
- package/alterations-js/1.38.0-1772621060-add-oidc-model-instances-grant-account-id-index.js +22 -0
- package/alterations-js/1.39.0-1774752400-add-delete-account-url.js +16 -0
- package/alterations-js/1.39.0-1774770686-add-account-center-custom-css.js +16 -0
- package/alterations-js/1.39.0-1776502301-add-sign-up-profile-fields.js +16 -0
- package/lib/consts/cookie.d.ts +1 -0
- package/lib/consts/cookie.js +1 -0
- package/lib/consts/experience.d.ts +1 -0
- package/lib/consts/experience.js +1 -0
- package/lib/consts/oidc.d.ts +3 -0
- package/lib/consts/oidc.js +3 -0
- package/lib/consts/system.d.ts +4 -0
- package/lib/consts/system.js +4 -0
- package/lib/db-entries/account-center.d.ts +9 -1
- package/lib/db-entries/account-center.js +8 -0
- package/lib/db-entries/sign-in-experience.d.ts +6 -2
- package/lib/db-entries/sign-in-experience.js +5 -1
- package/lib/foundations/jsonb-types/account-centers.d.ts +1 -0
- package/lib/foundations/jsonb-types/account-centers.js +8 -0
- package/lib/foundations/jsonb-types/oidc-module.d.ts +26 -7
- package/lib/foundations/jsonb-types/oidc-module.js +16 -1
- package/lib/foundations/jsonb-types/sign-in-experience.d.ts +36 -6
- package/lib/foundations/jsonb-types/sign-in-experience.js +10 -2
- package/lib/seeds/application.d.ts +3 -1
- package/lib/seeds/application.js +26 -1
- package/lib/types/alteration.d.ts +5 -0
- package/lib/types/application.d.ts +14 -2
- package/lib/types/connector.d.ts +8 -0
- package/lib/types/consent.d.ts +11 -3
- package/lib/types/consent.js +2 -1
- package/lib/types/custom-profile-fields.d.ts +7 -13
- package/lib/types/custom-profile-fields.js +6 -13
- package/lib/types/log/interaction.d.ts +4 -2
- package/lib/types/log/interaction.js +2 -0
- package/lib/types/log/token.d.ts +5 -3
- package/lib/types/log/token.js +2 -0
- package/lib/types/logto-config/index.d.ts +331 -15
- package/lib/types/logto-config/index.js +28 -4
- package/lib/types/logto-config/index.test.d.ts +1 -0
- package/lib/types/logto-config/index.test.js +29 -0
- package/lib/types/logto-config/jwt-customizer.d.ts +787 -253
- package/lib/types/logto-config/jwt-customizer.js +8 -3
- package/lib/types/logto-config/jwt-customizer.test.js +14 -2
- package/lib/types/oidc-config.d.ts +2 -1
- package/lib/types/oidc-config.js +1 -0
- package/lib/types/onboarding.d.ts +93 -1
- package/lib/types/onboarding.js +22 -1
- package/lib/types/sign-in-experience.d.ts +15 -4
- package/lib/types/user-logto-config.d.ts +49 -0
- package/lib/types/user-logto-config.js +19 -0
- package/lib/types/user-sessions.d.ts +712 -112
- package/lib/types/user-sessions.js +33 -2
- package/lib/types/verification-records/verification-type.d.ts +1 -1
- package/lib/types/verification-records/verification-type.js +1 -1
- package/lib/types/verification-records/web-authn-verification.d.ts +11 -11
- package/lib/types/verification-records/web-authn-verification.js +3 -3
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/oidc-private-key.d.ts +88 -0
- package/lib/utils/oidc-private-key.js +163 -0
- package/lib/utils/oidc-private-key.test.d.ts +1 -0
- package/lib/utils/oidc-private-key.test.js +128 -0
- package/package.json +9 -8
- package/tables/account_centers.sql +4 -0
- package/tables/oidc_model_instances.sql +16 -0
- package/tables/sign_in_experiences.sql +2 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
const alteration: AlterationScript = {
|
|
6
|
+
beforeUp: async (pool) => {
|
|
7
|
+
await pool.query(sql`
|
|
8
|
+
create index concurrently oidc_model_instances__model_name_payload_grant_id_partial
|
|
9
|
+
on oidc_model_instances (tenant_id, model_name, (payload->>'grantId'))
|
|
10
|
+
where payload ? 'grantId';
|
|
11
|
+
`);
|
|
12
|
+
},
|
|
13
|
+
up: async () => {
|
|
14
|
+
/** `concurrently` cannot be used inside a transaction. */
|
|
15
|
+
},
|
|
16
|
+
beforeDown: async (pool) => {
|
|
17
|
+
await pool.query(sql`
|
|
18
|
+
drop index concurrently oidc_model_instances__model_name_payload_grant_id_partial;
|
|
19
|
+
`);
|
|
20
|
+
},
|
|
21
|
+
down: async () => {
|
|
22
|
+
/** `concurrently` cannot be used inside a transaction. */
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default alteration;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
const alteration: AlterationScript = {
|
|
6
|
+
up: async (pool) => {
|
|
7
|
+
await pool.query(sql`
|
|
8
|
+
alter table oidc_model_instances set (
|
|
9
|
+
autovacuum_vacuum_scale_factor = 0.05,
|
|
10
|
+
autovacuum_analyze_scale_factor = 0.02,
|
|
11
|
+
autovacuum_vacuum_threshold = 5000,
|
|
12
|
+
autovacuum_analyze_threshold = 2000
|
|
13
|
+
);
|
|
14
|
+
`);
|
|
15
|
+
},
|
|
16
|
+
down: async (pool) => {
|
|
17
|
+
await pool.query(sql`
|
|
18
|
+
alter table oidc_model_instances reset (
|
|
19
|
+
autovacuum_vacuum_scale_factor,
|
|
20
|
+
autovacuum_analyze_scale_factor,
|
|
21
|
+
autovacuum_vacuum_threshold,
|
|
22
|
+
autovacuum_analyze_threshold
|
|
23
|
+
);
|
|
24
|
+
`);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default alteration;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
const alteration: AlterationScript = {
|
|
6
|
+
beforeUp: async (pool) => {
|
|
7
|
+
await pool.query(sql`
|
|
8
|
+
create index concurrently oidc_model_instances__grant_payload_account_id_expires_at
|
|
9
|
+
on oidc_model_instances (tenant_id, (payload->>'accountId'), expires_at)
|
|
10
|
+
WHERE model_name = 'Grant';
|
|
11
|
+
`);
|
|
12
|
+
},
|
|
13
|
+
up: async () => {
|
|
14
|
+
/** 'concurrently' cannot be used inside a transaction, so this up is intentionally left empty. */
|
|
15
|
+
},
|
|
16
|
+
beforeDown: async (pool) => {
|
|
17
|
+
await pool.query(sql`
|
|
18
|
+
drop index concurrently oidc_model_instances__grant_payload_account_id_expires_at;
|
|
19
|
+
`);
|
|
20
|
+
},
|
|
21
|
+
down: async () => {
|
|
22
|
+
/** 'concurrently' cannot be used inside a transaction, so this down is intentionally left empty. */
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default alteration;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
const alteration: AlterationScript = {
|
|
6
|
+
up: async (pool) => {
|
|
7
|
+
await pool.query(sql`
|
|
8
|
+
alter table account_centers
|
|
9
|
+
add column delete_account_url varchar(2048);
|
|
10
|
+
`);
|
|
11
|
+
},
|
|
12
|
+
down: async (pool) => {
|
|
13
|
+
await pool.query(sql`
|
|
14
|
+
alter table account_centers
|
|
15
|
+
drop column delete_account_url;
|
|
16
|
+
`);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default alteration;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
const alteration: AlterationScript = {
|
|
6
|
+
up: async (pool) => {
|
|
7
|
+
await pool.query(sql`
|
|
8
|
+
alter table account_centers
|
|
9
|
+
add column custom_css text;
|
|
10
|
+
`);
|
|
11
|
+
},
|
|
12
|
+
down: async (pool) => {
|
|
13
|
+
await pool.query(sql`
|
|
14
|
+
alter table account_centers
|
|
15
|
+
drop column custom_css;
|
|
16
|
+
`);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default alteration;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
const alteration: AlterationScript = {
|
|
6
|
+
up: async (pool) => {
|
|
7
|
+
await pool.query(sql`
|
|
8
|
+
alter table sign_in_experiences
|
|
9
|
+
add column sign_up_profile_fields jsonb;
|
|
10
|
+
`);
|
|
11
|
+
},
|
|
12
|
+
down: async (pool) => {
|
|
13
|
+
await pool.query(sql`
|
|
14
|
+
alter table sign_in_experiences
|
|
15
|
+
drop column sign_up_profile_fields;
|
|
16
|
+
`);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default alteration;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
beforeUp: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
create index concurrently oidc_model_instances__model_name_payload_grant_id_partial
|
|
6
|
+
on oidc_model_instances (tenant_id, model_name, (payload->>'grantId'))
|
|
7
|
+
where payload ? 'grantId';
|
|
8
|
+
`);
|
|
9
|
+
},
|
|
10
|
+
up: async () => {
|
|
11
|
+
/** `concurrently` cannot be used inside a transaction. */
|
|
12
|
+
},
|
|
13
|
+
beforeDown: async (pool) => {
|
|
14
|
+
await pool.query(sql `
|
|
15
|
+
drop index concurrently oidc_model_instances__model_name_payload_grant_id_partial;
|
|
16
|
+
`);
|
|
17
|
+
},
|
|
18
|
+
down: async () => {
|
|
19
|
+
/** `concurrently` cannot be used inside a transaction. */
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export default alteration;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
up: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
alter table oidc_model_instances set (
|
|
6
|
+
autovacuum_vacuum_scale_factor = 0.05,
|
|
7
|
+
autovacuum_analyze_scale_factor = 0.02,
|
|
8
|
+
autovacuum_vacuum_threshold = 5000,
|
|
9
|
+
autovacuum_analyze_threshold = 2000
|
|
10
|
+
);
|
|
11
|
+
`);
|
|
12
|
+
},
|
|
13
|
+
down: async (pool) => {
|
|
14
|
+
await pool.query(sql `
|
|
15
|
+
alter table oidc_model_instances reset (
|
|
16
|
+
autovacuum_vacuum_scale_factor,
|
|
17
|
+
autovacuum_analyze_scale_factor,
|
|
18
|
+
autovacuum_vacuum_threshold,
|
|
19
|
+
autovacuum_analyze_threshold
|
|
20
|
+
);
|
|
21
|
+
`);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export default alteration;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
beforeUp: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
create index concurrently oidc_model_instances__grant_payload_account_id_expires_at
|
|
6
|
+
on oidc_model_instances (tenant_id, (payload->>'accountId'), expires_at)
|
|
7
|
+
WHERE model_name = 'Grant';
|
|
8
|
+
`);
|
|
9
|
+
},
|
|
10
|
+
up: async () => {
|
|
11
|
+
/** 'concurrently' cannot be used inside a transaction, so this up is intentionally left empty. */
|
|
12
|
+
},
|
|
13
|
+
beforeDown: async (pool) => {
|
|
14
|
+
await pool.query(sql `
|
|
15
|
+
drop index concurrently oidc_model_instances__grant_payload_account_id_expires_at;
|
|
16
|
+
`);
|
|
17
|
+
},
|
|
18
|
+
down: async () => {
|
|
19
|
+
/** 'concurrently' cannot be used inside a transaction, so this down is intentionally left empty. */
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
export default alteration;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
up: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
alter table account_centers
|
|
6
|
+
add column delete_account_url varchar(2048);
|
|
7
|
+
`);
|
|
8
|
+
},
|
|
9
|
+
down: async (pool) => {
|
|
10
|
+
await pool.query(sql `
|
|
11
|
+
alter table account_centers
|
|
12
|
+
drop column delete_account_url;
|
|
13
|
+
`);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export default alteration;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
up: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
alter table account_centers
|
|
6
|
+
add column custom_css text;
|
|
7
|
+
`);
|
|
8
|
+
},
|
|
9
|
+
down: async (pool) => {
|
|
10
|
+
await pool.query(sql `
|
|
11
|
+
alter table account_centers
|
|
12
|
+
drop column custom_css;
|
|
13
|
+
`);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export default alteration;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
up: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
alter table sign_in_experiences
|
|
6
|
+
add column sign_up_profile_fields jsonb;
|
|
7
|
+
`);
|
|
8
|
+
},
|
|
9
|
+
down: async (pool) => {
|
|
10
|
+
await pool.query(sql `
|
|
11
|
+
alter table sign_in_experiences
|
|
12
|
+
drop column sign_up_profile_fields;
|
|
13
|
+
`);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export default alteration;
|
package/lib/consts/cookie.d.ts
CHANGED
package/lib/consts/cookie.js
CHANGED
|
@@ -4,6 +4,7 @@ export declare const experience: Readonly<{
|
|
|
4
4
|
readonly register: "register";
|
|
5
5
|
readonly sso: "single-sign-on";
|
|
6
6
|
readonly consent: "consent";
|
|
7
|
+
readonly device: "device";
|
|
7
8
|
readonly resetPassword: "reset-password";
|
|
8
9
|
readonly identifierSignIn: "identifier-sign-in";
|
|
9
10
|
readonly identifierRegister: "identifier-register";
|
package/lib/consts/experience.js
CHANGED
package/lib/consts/oidc.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const tenantIdKey = "tenant_id";
|
|
3
|
+
export declare const oidcRoutes: Readonly<{
|
|
4
|
+
readonly codeVerification: "/oidc/device";
|
|
5
|
+
}>;
|
|
3
6
|
export declare const customClientMetadataDefault: Readonly<{
|
|
4
7
|
readonly idTokenTtl: number;
|
|
5
8
|
readonly refreshTokenTtlInDays: 14;
|
package/lib/consts/oidc.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { inSeconds } from './date.js';
|
|
3
3
|
export const tenantIdKey = 'tenant_id';
|
|
4
|
+
export const oidcRoutes = Object.freeze({
|
|
5
|
+
codeVerification: '/oidc/device',
|
|
6
|
+
});
|
|
4
7
|
export const customClientMetadataDefault = Object.freeze({
|
|
5
8
|
idTokenTtl: inSeconds.oneHour,
|
|
6
9
|
refreshTokenTtlInDays: 14,
|
package/lib/consts/system.d.ts
CHANGED
|
@@ -11,3 +11,7 @@
|
|
|
11
11
|
export declare const ossConsolePath = "/console";
|
|
12
12
|
/** The prefix for keys and values that need to be explicitly marked as internal. */
|
|
13
13
|
export declare const internalPrefix = "#internal:";
|
|
14
|
+
/**
|
|
15
|
+
* The timeout for WebAuthn authentication options, in milliseconds.
|
|
16
|
+
*/
|
|
17
|
+
export declare const webAuthnAuthenticationOptionsTimeout = 60000;
|
package/lib/consts/system.js
CHANGED
|
@@ -11,3 +11,7 @@
|
|
|
11
11
|
export const ossConsolePath = '/console';
|
|
12
12
|
/** The prefix for keys and values that need to be explicitly marked as internal. */
|
|
13
13
|
export const internalPrefix = '#internal:';
|
|
14
|
+
/**
|
|
15
|
+
* The timeout for WebAuthn authentication options, in milliseconds.
|
|
16
|
+
*/
|
|
17
|
+
export const webAuthnAuthenticationOptionsTimeout = 60_000;
|
|
@@ -12,6 +12,10 @@ export type CreateAccountCenter = {
|
|
|
12
12
|
/** Control each fields */
|
|
13
13
|
fields?: AccountCenterFieldControl;
|
|
14
14
|
webauthnRelatedOrigins?: WebauthnRelatedOrigins;
|
|
15
|
+
/** URL for custom account deletion endpoint */
|
|
16
|
+
deleteAccountUrl?: string | null;
|
|
17
|
+
/** User-defined custom CSS for the account center */
|
|
18
|
+
customCss?: string | null;
|
|
15
19
|
};
|
|
16
20
|
export type AccountCenter = {
|
|
17
21
|
tenantId: string;
|
|
@@ -21,6 +25,10 @@ export type AccountCenter = {
|
|
|
21
25
|
/** Control each fields */
|
|
22
26
|
fields: AccountCenterFieldControl;
|
|
23
27
|
webauthnRelatedOrigins: WebauthnRelatedOrigins;
|
|
28
|
+
/** URL for custom account deletion endpoint */
|
|
29
|
+
deleteAccountUrl: string | null;
|
|
30
|
+
/** User-defined custom CSS for the account center */
|
|
31
|
+
customCss: string | null;
|
|
24
32
|
};
|
|
25
|
-
export type AccountCenterKeys = 'tenantId' | 'id' | 'enabled' | 'fields' | 'webauthnRelatedOrigins';
|
|
33
|
+
export type AccountCenterKeys = 'tenantId' | 'id' | 'enabled' | 'fields' | 'webauthnRelatedOrigins' | 'deleteAccountUrl' | 'customCss';
|
|
26
34
|
export declare const AccountCenters: GeneratedSchema<AccountCenterKeys, CreateAccountCenter, AccountCenter, 'account_centers', 'account_center'>;
|
|
@@ -7,6 +7,8 @@ const createGuard = z.object({
|
|
|
7
7
|
enabled: z.boolean().optional(),
|
|
8
8
|
fields: accountCenterFieldControlGuard.optional(),
|
|
9
9
|
webauthnRelatedOrigins: webauthnRelatedOriginsGuard.optional(),
|
|
10
|
+
deleteAccountUrl: z.string().max(2048).nullable().optional(),
|
|
11
|
+
customCss: z.string().nullable().optional(),
|
|
10
12
|
});
|
|
11
13
|
const guard = z.object({
|
|
12
14
|
tenantId: z.string().max(21),
|
|
@@ -14,6 +16,8 @@ const guard = z.object({
|
|
|
14
16
|
enabled: z.boolean(),
|
|
15
17
|
fields: accountCenterFieldControlGuard,
|
|
16
18
|
webauthnRelatedOrigins: webauthnRelatedOriginsGuard,
|
|
19
|
+
deleteAccountUrl: z.string().max(2048).nullable(),
|
|
20
|
+
customCss: z.string().nullable(),
|
|
17
21
|
});
|
|
18
22
|
export const AccountCenters = Object.freeze({
|
|
19
23
|
table: 'account_centers',
|
|
@@ -24,6 +28,8 @@ export const AccountCenters = Object.freeze({
|
|
|
24
28
|
enabled: 'enabled',
|
|
25
29
|
fields: 'fields',
|
|
26
30
|
webauthnRelatedOrigins: 'webauthn_related_origins',
|
|
31
|
+
deleteAccountUrl: 'delete_account_url',
|
|
32
|
+
customCss: 'custom_css',
|
|
27
33
|
},
|
|
28
34
|
fieldKeys: [
|
|
29
35
|
'tenantId',
|
|
@@ -31,6 +37,8 @@ export const AccountCenters = Object.freeze({
|
|
|
31
37
|
'enabled',
|
|
32
38
|
'fields',
|
|
33
39
|
'webauthnRelatedOrigins',
|
|
40
|
+
'deleteAccountUrl',
|
|
41
|
+
'customCss',
|
|
34
42
|
],
|
|
35
43
|
createGuard,
|
|
36
44
|
guard,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, Branding, LanguageInfo, SignIn, SignUp, SocialSignIn, ConnectorTargets, CustomContent, CustomUiAssets, PartialPasswordPolicy, Mfa, AdaptiveMfa, CaptchaPolicy, SentinelPolicy, EmailBlocklistPolicy, ForgotPasswordMethods, PasskeySignIn, GeneratedSchema } from './../foundations/index.js';
|
|
1
|
+
import { Color, Branding, LanguageInfo, SignIn, SignUp, SocialSignIn, ConnectorTargets, CustomContent, CustomUiAssets, PartialPasswordPolicy, Mfa, AdaptiveMfa, CaptchaPolicy, SentinelPolicy, EmailBlocklistPolicy, ForgotPasswordMethods, PasskeySignIn, SignUpProfileFields, GeneratedSchema } from './../foundations/index.js';
|
|
2
2
|
import { AgreeToTermsPolicy, SignInMode } from './custom-types.js';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
@@ -36,6 +36,8 @@ export type CreateSignInExperience = {
|
|
|
36
36
|
emailBlocklistPolicy?: EmailBlocklistPolicy;
|
|
37
37
|
forgotPasswordMethods?: ForgotPasswordMethods | null;
|
|
38
38
|
passkeySignIn?: PasskeySignIn;
|
|
39
|
+
/** Nullable by design: null keeps legacy full-catalog behavior and [] collects no custom profile fields. */
|
|
40
|
+
signUpProfileFields?: SignUpProfileFields | null;
|
|
39
41
|
};
|
|
40
42
|
export type SignInExperience = {
|
|
41
43
|
tenantId: string;
|
|
@@ -68,6 +70,8 @@ export type SignInExperience = {
|
|
|
68
70
|
emailBlocklistPolicy: EmailBlocklistPolicy;
|
|
69
71
|
forgotPasswordMethods: ForgotPasswordMethods | null;
|
|
70
72
|
passkeySignIn: PasskeySignIn;
|
|
73
|
+
/** Nullable by design: null keeps legacy full-catalog behavior and [] collects no custom profile fields. */
|
|
74
|
+
signUpProfileFields: SignUpProfileFields | null;
|
|
71
75
|
};
|
|
72
|
-
export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'hideLogtoBranding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'agreeToTermsPolicy' | 'signIn' | 'signUp' | 'socialSignIn' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'customUiAssets' | 'passwordPolicy' | 'mfa' | 'adaptiveMfa' | 'singleSignOnEnabled' | 'supportEmail' | 'supportWebsiteUrl' | 'unknownSessionRedirectUrl' | 'captchaPolicy' | 'sentinelPolicy' | 'emailBlocklistPolicy' | 'forgotPasswordMethods' | 'passkeySignIn';
|
|
76
|
+
export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'hideLogtoBranding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'agreeToTermsPolicy' | 'signIn' | 'signUp' | 'socialSignIn' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'customUiAssets' | 'passwordPolicy' | 'mfa' | 'adaptiveMfa' | 'singleSignOnEnabled' | 'supportEmail' | 'supportWebsiteUrl' | 'unknownSessionRedirectUrl' | 'captchaPolicy' | 'sentinelPolicy' | 'emailBlocklistPolicy' | 'forgotPasswordMethods' | 'passkeySignIn' | 'signUpProfileFields';
|
|
73
77
|
export declare const SignInExperiences: GeneratedSchema<SignInExperienceKeys, CreateSignInExperience, SignInExperience, 'sign_in_experiences', 'sign_in_experience'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { colorGuard, brandingGuard, languageInfoGuard, signInGuard, signUpGuard, socialSignInGuard, connectorTargetsGuard, customContentGuard, customUiAssetsGuard, partialPasswordPolicyGuard, mfaGuard, adaptiveMfaGuard, captchaPolicyGuard, sentinelPolicyGuard, emailBlocklistPolicyGuard, forgotPasswordMethodsGuard, passkeySignInGuard } from './../foundations/index.js';
|
|
3
|
+
import { colorGuard, brandingGuard, languageInfoGuard, signInGuard, signUpGuard, socialSignInGuard, connectorTargetsGuard, customContentGuard, customUiAssetsGuard, partialPasswordPolicyGuard, mfaGuard, adaptiveMfaGuard, captchaPolicyGuard, sentinelPolicyGuard, emailBlocklistPolicyGuard, forgotPasswordMethodsGuard, passkeySignInGuard, signUpProfileFieldsGuard } from './../foundations/index.js';
|
|
4
4
|
import { AgreeToTermsPolicy, SignInMode } from './custom-types.js';
|
|
5
5
|
const createGuard = z.object({
|
|
6
6
|
tenantId: z.string().max(21).optional(),
|
|
@@ -32,6 +32,7 @@ const createGuard = z.object({
|
|
|
32
32
|
emailBlocklistPolicy: emailBlocklistPolicyGuard.optional(),
|
|
33
33
|
forgotPasswordMethods: forgotPasswordMethodsGuard.nullable().optional(),
|
|
34
34
|
passkeySignIn: passkeySignInGuard.optional(),
|
|
35
|
+
signUpProfileFields: signUpProfileFieldsGuard.nullable().optional(),
|
|
35
36
|
});
|
|
36
37
|
const guard = z.object({
|
|
37
38
|
tenantId: z.string().max(21),
|
|
@@ -63,6 +64,7 @@ const guard = z.object({
|
|
|
63
64
|
emailBlocklistPolicy: emailBlocklistPolicyGuard,
|
|
64
65
|
forgotPasswordMethods: forgotPasswordMethodsGuard.nullable(),
|
|
65
66
|
passkeySignIn: passkeySignInGuard,
|
|
67
|
+
signUpProfileFields: signUpProfileFieldsGuard.nullable(),
|
|
66
68
|
});
|
|
67
69
|
export const SignInExperiences = Object.freeze({
|
|
68
70
|
table: 'sign_in_experiences',
|
|
@@ -97,6 +99,7 @@ export const SignInExperiences = Object.freeze({
|
|
|
97
99
|
emailBlocklistPolicy: 'email_blocklist_policy',
|
|
98
100
|
forgotPasswordMethods: 'forgot_password_methods',
|
|
99
101
|
passkeySignIn: 'passkey_sign_in',
|
|
102
|
+
signUpProfileFields: 'sign_up_profile_fields',
|
|
100
103
|
},
|
|
101
104
|
fieldKeys: [
|
|
102
105
|
'tenantId',
|
|
@@ -128,6 +131,7 @@ export const SignInExperiences = Object.freeze({
|
|
|
128
131
|
'emailBlocklistPolicy',
|
|
129
132
|
'forgotPasswordMethods',
|
|
130
133
|
'passkeySignIn',
|
|
134
|
+
'signUpProfileFields',
|
|
131
135
|
],
|
|
132
136
|
createGuard,
|
|
133
137
|
guard,
|
|
@@ -49,3 +49,4 @@ export declare const accountCenterFieldControlGuard: z.ZodObject<{
|
|
|
49
49
|
export type AccountCenterFieldControl = z.infer<typeof accountCenterFieldControlGuard>;
|
|
50
50
|
export declare const webauthnRelatedOriginsGuard: z.ZodArray<z.ZodString, "many">;
|
|
51
51
|
export type WebauthnRelatedOrigins = z.infer<typeof webauthnRelatedOriginsGuard>;
|
|
52
|
+
export declare const deleteAccountUrlGuard: z.ZodEffects<z.ZodString, string, string>;
|
|
@@ -26,3 +26,11 @@ export const accountCenterFieldControlGuard = z
|
|
|
26
26
|
})
|
|
27
27
|
.partial();
|
|
28
28
|
export const webauthnRelatedOriginsGuard = z.array(z.string());
|
|
29
|
+
export const deleteAccountUrlGuard = z
|
|
30
|
+
.string()
|
|
31
|
+
.max(2048)
|
|
32
|
+
.refine((value) => value === '' ||
|
|
33
|
+
((value.startsWith('https://') || value.startsWith('http://')) &&
|
|
34
|
+
z.string().url().safeParse(value).success), {
|
|
35
|
+
message: 'deleteAccountUrl must be a valid http(s) URL',
|
|
36
|
+
});
|
|
@@ -88,7 +88,20 @@ export declare enum CustomClientMetadataKey {
|
|
|
88
88
|
*
|
|
89
89
|
* Defaults to `false` for all new applications. Users must explicitly enable it.
|
|
90
90
|
*/
|
|
91
|
-
AllowTokenExchange = "allowTokenExchange"
|
|
91
|
+
AllowTokenExchange = "allowTokenExchange",
|
|
92
|
+
/**
|
|
93
|
+
* Whether the application uses the OAuth 2.0 Device Authorization Grant (RFC 8628)
|
|
94
|
+
* instead of the standard Authorization Code flow.
|
|
95
|
+
*
|
|
96
|
+
* Only applicable to native applications. Defaults to `false`.
|
|
97
|
+
*/
|
|
98
|
+
IsDeviceFlow = "isDeviceFlow",
|
|
99
|
+
/**
|
|
100
|
+
* The maximum number of active sessions (devices) allowed per user for this application.
|
|
101
|
+
*
|
|
102
|
+
* When exceeded, old sessions should be revoked according to server policy.
|
|
103
|
+
*/
|
|
104
|
+
MaxAllowedGrants = "maxAllowedGrants"
|
|
92
105
|
}
|
|
93
106
|
export declare const customClientMetadataGuard: z.ZodObject<{
|
|
94
107
|
corsAllowedOrigins: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
@@ -99,6 +112,8 @@ export declare const customClientMetadataGuard: z.ZodObject<{
|
|
|
99
112
|
alwaysIssueRefreshToken: z.ZodOptional<z.ZodBoolean>;
|
|
100
113
|
rotateRefreshToken: z.ZodOptional<z.ZodBoolean>;
|
|
101
114
|
allowTokenExchange: z.ZodOptional<z.ZodBoolean>;
|
|
115
|
+
isDeviceFlow: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
maxAllowedGrants: z.ZodOptional<z.ZodNumber>;
|
|
102
117
|
}, "strip", z.ZodTypeAny, {
|
|
103
118
|
corsAllowedOrigins?: string[] | undefined;
|
|
104
119
|
idTokenTtl?: number | undefined;
|
|
@@ -108,6 +123,8 @@ export declare const customClientMetadataGuard: z.ZodObject<{
|
|
|
108
123
|
alwaysIssueRefreshToken?: boolean | undefined;
|
|
109
124
|
rotateRefreshToken?: boolean | undefined;
|
|
110
125
|
allowTokenExchange?: boolean | undefined;
|
|
126
|
+
isDeviceFlow?: boolean | undefined;
|
|
127
|
+
maxAllowedGrants?: number | undefined;
|
|
111
128
|
}, {
|
|
112
129
|
corsAllowedOrigins?: string[] | undefined;
|
|
113
130
|
idTokenTtl?: number | undefined;
|
|
@@ -117,6 +134,8 @@ export declare const customClientMetadataGuard: z.ZodObject<{
|
|
|
117
134
|
alwaysIssueRefreshToken?: boolean | undefined;
|
|
118
135
|
rotateRefreshToken?: boolean | undefined;
|
|
119
136
|
allowTokenExchange?: boolean | undefined;
|
|
137
|
+
isDeviceFlow?: boolean | undefined;
|
|
138
|
+
maxAllowedGrants?: number | undefined;
|
|
120
139
|
}>;
|
|
121
140
|
/**
|
|
122
141
|
* @see {@link CustomClientMetadataKey} for key descriptions.
|
|
@@ -207,7 +226,7 @@ export declare const oidcSessionInstancePayloadGuard: z.ZodObject<{
|
|
|
207
226
|
/**
|
|
208
227
|
* A map of client_id to session authorization details. @see OidcSessionAuthorizationDetails
|
|
209
228
|
*/
|
|
210
|
-
authorizations: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
229
|
+
authorizations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
211
230
|
/**
|
|
212
231
|
* The `sid` (session ID) Claim associated with the session for the current client.
|
|
213
232
|
*
|
|
@@ -279,7 +298,7 @@ export declare const oidcSessionInstancePayloadGuard: z.ZodObject<{
|
|
|
279
298
|
* Mark optional to make the guard more robust.
|
|
280
299
|
*/
|
|
281
300
|
persistsLogout: z.ZodOptional<z.ZodBoolean>;
|
|
282
|
-
}, z.ZodUnknown, "strip"
|
|
301
|
+
}, z.ZodUnknown, "strip">>>>;
|
|
283
302
|
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
284
303
|
exp: z.ZodNumber;
|
|
285
304
|
iat: z.ZodNumber;
|
|
@@ -291,7 +310,7 @@ export declare const oidcSessionInstancePayloadGuard: z.ZodObject<{
|
|
|
291
310
|
/**
|
|
292
311
|
* A map of client_id to session authorization details. @see OidcSessionAuthorizationDetails
|
|
293
312
|
*/
|
|
294
|
-
authorizations: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
313
|
+
authorizations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
295
314
|
/**
|
|
296
315
|
* The `sid` (session ID) Claim associated with the session for the current client.
|
|
297
316
|
*
|
|
@@ -363,7 +382,7 @@ export declare const oidcSessionInstancePayloadGuard: z.ZodObject<{
|
|
|
363
382
|
* Mark optional to make the guard more robust.
|
|
364
383
|
*/
|
|
365
384
|
persistsLogout: z.ZodOptional<z.ZodBoolean>;
|
|
366
|
-
}, z.ZodUnknown, "strip"
|
|
385
|
+
}, z.ZodUnknown, "strip">>>>;
|
|
367
386
|
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
368
387
|
exp: z.ZodNumber;
|
|
369
388
|
iat: z.ZodNumber;
|
|
@@ -375,7 +394,7 @@ export declare const oidcSessionInstancePayloadGuard: z.ZodObject<{
|
|
|
375
394
|
/**
|
|
376
395
|
* A map of client_id to session authorization details. @see OidcSessionAuthorizationDetails
|
|
377
396
|
*/
|
|
378
|
-
authorizations: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
397
|
+
authorizations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
379
398
|
/**
|
|
380
399
|
* The `sid` (session ID) Claim associated with the session for the current client.
|
|
381
400
|
*
|
|
@@ -447,6 +466,6 @@ export declare const oidcSessionInstancePayloadGuard: z.ZodObject<{
|
|
|
447
466
|
* Mark optional to make the guard more robust.
|
|
448
467
|
*/
|
|
449
468
|
persistsLogout: z.ZodOptional<z.ZodBoolean>;
|
|
450
|
-
}, z.ZodUnknown, "strip"
|
|
469
|
+
}, z.ZodUnknown, "strip">>>>;
|
|
451
470
|
}, z.ZodUnknown, "strip">>;
|
|
452
471
|
export type OidcSessionInstancePayload = z.infer<typeof oidcSessionInstancePayloadGuard>;
|
|
@@ -55,6 +55,19 @@ export var CustomClientMetadataKey;
|
|
|
55
55
|
* Defaults to `false` for all new applications. Users must explicitly enable it.
|
|
56
56
|
*/
|
|
57
57
|
CustomClientMetadataKey["AllowTokenExchange"] = "allowTokenExchange";
|
|
58
|
+
/**
|
|
59
|
+
* Whether the application uses the OAuth 2.0 Device Authorization Grant (RFC 8628)
|
|
60
|
+
* instead of the standard Authorization Code flow.
|
|
61
|
+
*
|
|
62
|
+
* Only applicable to native applications. Defaults to `false`.
|
|
63
|
+
*/
|
|
64
|
+
CustomClientMetadataKey["IsDeviceFlow"] = "isDeviceFlow";
|
|
65
|
+
/**
|
|
66
|
+
* The maximum number of active sessions (devices) allowed per user for this application.
|
|
67
|
+
*
|
|
68
|
+
* When exceeded, old sessions should be revoked according to server policy.
|
|
69
|
+
*/
|
|
70
|
+
CustomClientMetadataKey["MaxAllowedGrants"] = "maxAllowedGrants";
|
|
58
71
|
})(CustomClientMetadataKey || (CustomClientMetadataKey = {}));
|
|
59
72
|
export const customClientMetadataGuard = z.object({
|
|
60
73
|
[CustomClientMetadataKey.CorsAllowedOrigins]: z.string().min(1).array().optional(),
|
|
@@ -65,6 +78,8 @@ export const customClientMetadataGuard = z.object({
|
|
|
65
78
|
[CustomClientMetadataKey.AlwaysIssueRefreshToken]: z.boolean().optional(),
|
|
66
79
|
[CustomClientMetadataKey.RotateRefreshToken]: z.boolean().optional(),
|
|
67
80
|
[CustomClientMetadataKey.AllowTokenExchange]: z.boolean().optional(),
|
|
81
|
+
[CustomClientMetadataKey.IsDeviceFlow]: z.boolean().optional(),
|
|
82
|
+
[CustomClientMetadataKey.MaxAllowedGrants]: z.number().int().positive().optional(),
|
|
68
83
|
});
|
|
69
84
|
export const oidcSessionAuthorizationDetailsGuard = z
|
|
70
85
|
.object({
|
|
@@ -105,6 +120,6 @@ export const oidcSessionInstancePayloadGuard = z
|
|
|
105
120
|
/**
|
|
106
121
|
* A map of client_id to session authorization details. @see OidcSessionAuthorizationDetails
|
|
107
122
|
*/
|
|
108
|
-
authorizations: z.record(z.string(), oidcSessionAuthorizationDetailsGuard),
|
|
123
|
+
authorizations: z.record(z.string(), oidcSessionAuthorizationDetailsGuard).optional(),
|
|
109
124
|
})
|
|
110
125
|
.catchall(z.unknown());
|