@logto/schemas 1.24.1 → 1.26.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.25.0-1739429593-add-legacy-password-encryption.ts +35 -0
- package/alterations/1.26.0-1740982044-add-one-time-tokens-table.ts +36 -0
- package/alterations/1.26.0-1741240284-add-captcha-policy.ts +20 -0
- package/alterations/1.26.0-1741318144-add-one-time-token-unique-index.ts +18 -0
- package/alterations/1.26.0-1741572426-add-captcha-providers.ts +34 -0
- package/alterations-js/1.25.0-1739429593-add-legacy-password-encryption.js +30 -0
- package/alterations-js/1.26.0-1740982044-add-one-time-tokens-table.js +30 -0
- package/alterations-js/1.26.0-1741240284-add-captcha-policy.js +16 -0
- package/alterations-js/1.26.0-1741318144-add-one-time-token-unique-index.js +14 -0
- package/alterations-js/1.26.0-1741572426-add-captcha-providers.js +29 -0
- package/lib/consts/experience.d.ts +2 -0
- package/lib/consts/experience.js +2 -0
- package/lib/consts/oidc.d.ts +9 -1
- package/lib/consts/oidc.js +5 -0
- package/lib/db-entries/captcha-provider.d.ts +22 -0
- package/lib/db-entries/captcha-provider.js +38 -0
- package/lib/db-entries/custom-types.d.ts +2 -1
- package/lib/db-entries/custom-types.js +1 -0
- package/lib/db-entries/index.d.ts +2 -0
- package/lib/db-entries/index.js +2 -0
- package/lib/db-entries/one-time-token.d.ts +28 -0
- package/lib/db-entries/one-time-token.js +50 -0
- package/lib/db-entries/sign-in-experience.d.ts +4 -2
- package/lib/db-entries/sign-in-experience.js +5 -1
- package/lib/foundations/jsonb-types/captcha.d.ts +63 -0
- package/lib/foundations/jsonb-types/captcha.js +21 -0
- package/lib/foundations/jsonb-types/email-templates.d.ts +1 -48
- package/lib/foundations/jsonb-types/email-templates.js +1 -9
- package/lib/foundations/jsonb-types/index.d.ts +2 -0
- package/lib/foundations/jsonb-types/index.js +2 -0
- package/lib/foundations/jsonb-types/one-time-tokens.d.ts +18 -0
- package/lib/foundations/jsonb-types/one-time-tokens.js +14 -0
- package/lib/foundations/jsonb-types/saml-application-configs.d.ts +1 -1
- package/lib/foundations/jsonb-types/sentinel.d.ts +8 -1
- package/lib/foundations/jsonb-types/sentinel.js +7 -0
- package/lib/foundations/jsonb-types/sign-in-experience.d.ts +122 -5
- package/lib/foundations/jsonb-types/sign-in-experience.js +22 -0
- package/lib/foundations/jsonb-types/verification-records.d.ts +2 -1
- package/lib/foundations/jsonb-types/verification-records.js +1 -0
- package/lib/types/connector.d.ts +35 -3
- package/lib/types/interactions.d.ts +56 -3
- package/lib/types/interactions.js +10 -0
- package/lib/types/logto-config/jwt-customizer.d.ts +23 -23
- package/lib/types/saml-application.d.ts +9 -9
- package/lib/types/sign-in-experience.d.ts +75 -43
- package/lib/types/sign-in-experience.js +7 -0
- package/lib/types/sso-connector.d.ts +2 -2
- package/lib/types/system.d.ts +2 -2
- package/package.json +3 -3
- package/tables/captcha_providers.sql +13 -0
- package/tables/one_time_tokens.sql +18 -0
- package/tables/sign_in_experiences.sql +1 -0
- package/tables/users.sql +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
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 type users_password_encryption_method add value 'Legacy';
|
|
9
|
+
`);
|
|
10
|
+
},
|
|
11
|
+
down: async (pool) => {
|
|
12
|
+
const { rows } = await pool.query(sql`
|
|
13
|
+
select id from users
|
|
14
|
+
where password_encryption_method = ${'Legacy'}
|
|
15
|
+
`);
|
|
16
|
+
if (rows.length > 0) {
|
|
17
|
+
throw new Error('There are users with password encryption method Legacy.');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
await pool.query(sql`
|
|
21
|
+
create type users_password_encryption_method_revised as enum (
|
|
22
|
+
'Argon2i', 'Argon2id', 'Argon2d', 'SHA1', 'SHA256', 'MD5', 'Bcrypt'
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
alter table users
|
|
26
|
+
alter column password_encryption_method type users_password_encryption_method_revised
|
|
27
|
+
using password_encryption_method::text::users_password_encryption_method_revised;
|
|
28
|
+
|
|
29
|
+
drop type users_password_encryption_method;
|
|
30
|
+
alter type users_password_encryption_method_revised rename to users_password_encryption_method;
|
|
31
|
+
`);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default alteration;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
import { applyTableRls, dropTableRls } from './utils/1704934999-tables.js';
|
|
6
|
+
|
|
7
|
+
const alteration: AlterationScript = {
|
|
8
|
+
up: async (pool) => {
|
|
9
|
+
await pool.query(sql`
|
|
10
|
+
create table one_time_tokens (
|
|
11
|
+
tenant_id varchar(21) not null
|
|
12
|
+
references tenants (id) on update cascade on delete cascade,
|
|
13
|
+
id varchar(21) not null,
|
|
14
|
+
email varchar(128) not null,
|
|
15
|
+
token varchar(256) not null,
|
|
16
|
+
context jsonb not null default '{}'::jsonb,
|
|
17
|
+
status varchar(64) not null default 'active',
|
|
18
|
+
created_at timestamptz not null default(now()),
|
|
19
|
+
expires_at timestamptz not null,
|
|
20
|
+
primary key (id)
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
create index one_time_token__email_status on one_time_tokens (tenant_id, email, status);
|
|
24
|
+
`);
|
|
25
|
+
|
|
26
|
+
await applyTableRls(pool, 'one_time_tokens');
|
|
27
|
+
},
|
|
28
|
+
down: async (pool) => {
|
|
29
|
+
await dropTableRls(pool, 'one_time_tokens');
|
|
30
|
+
await pool.query(sql`
|
|
31
|
+
drop table if exists one_time_tokens;
|
|
32
|
+
`);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
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 captcha_policy jsonb not null default '{}'::jsonb;
|
|
10
|
+
`);
|
|
11
|
+
},
|
|
12
|
+
down: async (pool) => {
|
|
13
|
+
await pool.query(sql`
|
|
14
|
+
alter table sign_in_experiences
|
|
15
|
+
drop column captcha_policy;
|
|
16
|
+
`);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default alteration;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
create unique index one_time_token__token on one_time_tokens (tenant_id, token);
|
|
9
|
+
`);
|
|
10
|
+
},
|
|
11
|
+
down: async (pool) => {
|
|
12
|
+
await pool.query(sql`
|
|
13
|
+
drop index if exists one_time_token__token;
|
|
14
|
+
`);
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default alteration;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
|
|
3
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
4
|
+
|
|
5
|
+
import { applyTableRls, dropTableRls } from './utils/1704934999-tables.js';
|
|
6
|
+
|
|
7
|
+
const alteration: AlterationScript = {
|
|
8
|
+
up: async (pool) => {
|
|
9
|
+
await pool.query(sql`
|
|
10
|
+
create table captcha_providers (
|
|
11
|
+
tenant_id varchar(21) not null
|
|
12
|
+
references tenants (id) on update cascade on delete cascade,
|
|
13
|
+
id varchar(128) not null,
|
|
14
|
+
config jsonb /* @use CaptchaConfig */ not null default '{}'::jsonb,
|
|
15
|
+
created_at timestamptz not null default(now()),
|
|
16
|
+
updated_at timestamptz not null default(now()),
|
|
17
|
+
primary key (id),
|
|
18
|
+
unique (tenant_id)
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
create index captcha_providers__id
|
|
22
|
+
on captcha_providers (tenant_id, id);
|
|
23
|
+
`);
|
|
24
|
+
await applyTableRls(pool, 'captcha_providers');
|
|
25
|
+
},
|
|
26
|
+
down: async (pool) => {
|
|
27
|
+
await dropTableRls(pool, 'captcha_providers');
|
|
28
|
+
await pool.query(sql`
|
|
29
|
+
drop table captcha_providers;
|
|
30
|
+
`);
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default alteration;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
up: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
alter type users_password_encryption_method add value 'Legacy';
|
|
6
|
+
`);
|
|
7
|
+
},
|
|
8
|
+
down: async (pool) => {
|
|
9
|
+
const { rows } = await pool.query(sql `
|
|
10
|
+
select id from users
|
|
11
|
+
where password_encryption_method = ${'Legacy'}
|
|
12
|
+
`);
|
|
13
|
+
if (rows.length > 0) {
|
|
14
|
+
throw new Error('There are users with password encryption method Legacy.');
|
|
15
|
+
}
|
|
16
|
+
await pool.query(sql `
|
|
17
|
+
create type users_password_encryption_method_revised as enum (
|
|
18
|
+
'Argon2i', 'Argon2id', 'Argon2d', 'SHA1', 'SHA256', 'MD5', 'Bcrypt'
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
alter table users
|
|
22
|
+
alter column password_encryption_method type users_password_encryption_method_revised
|
|
23
|
+
using password_encryption_method::text::users_password_encryption_method_revised;
|
|
24
|
+
|
|
25
|
+
drop type users_password_encryption_method;
|
|
26
|
+
alter type users_password_encryption_method_revised rename to users_password_encryption_method;
|
|
27
|
+
`);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export default alteration;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
import { applyTableRls, dropTableRls } from './utils/1704934999-tables.js';
|
|
3
|
+
const alteration = {
|
|
4
|
+
up: async (pool) => {
|
|
5
|
+
await pool.query(sql `
|
|
6
|
+
create table one_time_tokens (
|
|
7
|
+
tenant_id varchar(21) not null
|
|
8
|
+
references tenants (id) on update cascade on delete cascade,
|
|
9
|
+
id varchar(21) not null,
|
|
10
|
+
email varchar(128) not null,
|
|
11
|
+
token varchar(256) not null,
|
|
12
|
+
context jsonb not null default '{}'::jsonb,
|
|
13
|
+
status varchar(64) not null default 'active',
|
|
14
|
+
created_at timestamptz not null default(now()),
|
|
15
|
+
expires_at timestamptz not null,
|
|
16
|
+
primary key (id)
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
create index one_time_token__email_status on one_time_tokens (tenant_id, email, status);
|
|
20
|
+
`);
|
|
21
|
+
await applyTableRls(pool, 'one_time_tokens');
|
|
22
|
+
},
|
|
23
|
+
down: async (pool) => {
|
|
24
|
+
await dropTableRls(pool, 'one_time_tokens');
|
|
25
|
+
await pool.query(sql `
|
|
26
|
+
drop table if exists one_time_tokens;
|
|
27
|
+
`);
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
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 captcha_policy jsonb not null default '{}'::jsonb;
|
|
7
|
+
`);
|
|
8
|
+
},
|
|
9
|
+
down: async (pool) => {
|
|
10
|
+
await pool.query(sql `
|
|
11
|
+
alter table sign_in_experiences
|
|
12
|
+
drop column captcha_policy;
|
|
13
|
+
`);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export default alteration;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
up: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
create unique index one_time_token__token on one_time_tokens (tenant_id, token);
|
|
6
|
+
`);
|
|
7
|
+
},
|
|
8
|
+
down: async (pool) => {
|
|
9
|
+
await pool.query(sql `
|
|
10
|
+
drop index if exists one_time_token__token;
|
|
11
|
+
`);
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export default alteration;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
import { applyTableRls, dropTableRls } from './utils/1704934999-tables.js';
|
|
3
|
+
const alteration = {
|
|
4
|
+
up: async (pool) => {
|
|
5
|
+
await pool.query(sql `
|
|
6
|
+
create table captcha_providers (
|
|
7
|
+
tenant_id varchar(21) not null
|
|
8
|
+
references tenants (id) on update cascade on delete cascade,
|
|
9
|
+
id varchar(128) not null,
|
|
10
|
+
config jsonb /* @use CaptchaConfig */ not null default '{}'::jsonb,
|
|
11
|
+
created_at timestamptz not null default(now()),
|
|
12
|
+
updated_at timestamptz not null default(now()),
|
|
13
|
+
primary key (id),
|
|
14
|
+
unique (tenant_id)
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
create index captcha_providers__id
|
|
18
|
+
on captcha_providers (tenant_id, id);
|
|
19
|
+
`);
|
|
20
|
+
await applyTableRls(pool, 'captcha_providers');
|
|
21
|
+
},
|
|
22
|
+
down: async (pool) => {
|
|
23
|
+
await dropTableRls(pool, 'captcha_providers');
|
|
24
|
+
await pool.query(sql `
|
|
25
|
+
drop table captcha_providers;
|
|
26
|
+
`);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export default alteration;
|
|
@@ -7,5 +7,7 @@ export declare const experience: Readonly<{
|
|
|
7
7
|
readonly resetPassword: "reset-password";
|
|
8
8
|
readonly identifierSignIn: "identifier-sign-in";
|
|
9
9
|
readonly identifierRegister: "identifier-register";
|
|
10
|
+
readonly switchAccount: "switch-account";
|
|
11
|
+
readonly error: "error";
|
|
10
12
|
}>;
|
|
11
13
|
}>;
|
package/lib/consts/experience.js
CHANGED
|
@@ -6,6 +6,8 @@ const routes = Object.freeze({
|
|
|
6
6
|
resetPassword: 'reset-password',
|
|
7
7
|
identifierSignIn: 'identifier-sign-in',
|
|
8
8
|
identifierRegister: 'identifier-register',
|
|
9
|
+
switchAccount: 'switch-account',
|
|
10
|
+
error: 'error',
|
|
9
11
|
});
|
|
10
12
|
export const experience = Object.freeze({
|
|
11
13
|
routes,
|
package/lib/consts/oidc.d.ts
CHANGED
|
@@ -49,7 +49,11 @@ export declare enum ExtraParamsKey {
|
|
|
49
49
|
*
|
|
50
50
|
* @see {@link SignInIdentifier} for available values.
|
|
51
51
|
*/
|
|
52
|
-
Identifier = "identifier"
|
|
52
|
+
Identifier = "identifier",
|
|
53
|
+
/**
|
|
54
|
+
* The one-time token used as a proof for the user's identity. Example use case: Magic link.
|
|
55
|
+
*/
|
|
56
|
+
OneTimeToken = "one_time_token"
|
|
53
57
|
}
|
|
54
58
|
/** @deprecated Use {@link FirstScreen} instead. */
|
|
55
59
|
export declare enum InteractionMode {
|
|
@@ -73,6 +77,7 @@ export declare const extraParamsObjectGuard: z.ZodObject<{
|
|
|
73
77
|
organization_id: z.ZodOptional<z.ZodString>;
|
|
74
78
|
login_hint: z.ZodOptional<z.ZodString>;
|
|
75
79
|
identifier: z.ZodOptional<z.ZodString>;
|
|
80
|
+
one_time_token: z.ZodOptional<z.ZodString>;
|
|
76
81
|
}, "strip", z.ZodTypeAny, {
|
|
77
82
|
interaction_mode?: InteractionMode | undefined;
|
|
78
83
|
first_screen?: FirstScreen | undefined;
|
|
@@ -80,6 +85,7 @@ export declare const extraParamsObjectGuard: z.ZodObject<{
|
|
|
80
85
|
organization_id?: string | undefined;
|
|
81
86
|
login_hint?: string | undefined;
|
|
82
87
|
identifier?: string | undefined;
|
|
88
|
+
one_time_token?: string | undefined;
|
|
83
89
|
}, {
|
|
84
90
|
interaction_mode?: InteractionMode | undefined;
|
|
85
91
|
first_screen?: FirstScreen | undefined;
|
|
@@ -87,6 +93,7 @@ export declare const extraParamsObjectGuard: z.ZodObject<{
|
|
|
87
93
|
organization_id?: string | undefined;
|
|
88
94
|
login_hint?: string | undefined;
|
|
89
95
|
identifier?: string | undefined;
|
|
96
|
+
one_time_token?: string | undefined;
|
|
90
97
|
}>;
|
|
91
98
|
export type ExtraParamsObject = Partial<{
|
|
92
99
|
[ExtraParamsKey.InteractionMode]: InteractionMode;
|
|
@@ -95,4 +102,5 @@ export type ExtraParamsObject = Partial<{
|
|
|
95
102
|
[ExtraParamsKey.OrganizationId]: string;
|
|
96
103
|
[ExtraParamsKey.LoginHint]: string;
|
|
97
104
|
[ExtraParamsKey.Identifier]: string;
|
|
105
|
+
[ExtraParamsKey.OneTimeToken]: string;
|
|
98
106
|
}>;
|
package/lib/consts/oidc.js
CHANGED
|
@@ -52,6 +52,10 @@ export var ExtraParamsKey;
|
|
|
52
52
|
* @see {@link SignInIdentifier} for available values.
|
|
53
53
|
*/
|
|
54
54
|
ExtraParamsKey["Identifier"] = "identifier";
|
|
55
|
+
/**
|
|
56
|
+
* The one-time token used as a proof for the user's identity. Example use case: Magic link.
|
|
57
|
+
*/
|
|
58
|
+
ExtraParamsKey["OneTimeToken"] = "one_time_token";
|
|
55
59
|
})(ExtraParamsKey || (ExtraParamsKey = {}));
|
|
56
60
|
/** @deprecated Use {@link FirstScreen} instead. */
|
|
57
61
|
export var InteractionMode;
|
|
@@ -78,5 +82,6 @@ export const extraParamsObjectGuard = z
|
|
|
78
82
|
[ExtraParamsKey.OrganizationId]: z.string(),
|
|
79
83
|
[ExtraParamsKey.LoginHint]: z.string(),
|
|
80
84
|
[ExtraParamsKey.Identifier]: z.string(),
|
|
85
|
+
[ExtraParamsKey.OneTimeToken]: z.string(),
|
|
81
86
|
})
|
|
82
87
|
.partial();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CaptchaConfig, GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link CaptchaProvider} for the original type.
|
|
6
|
+
*/
|
|
7
|
+
export type CreateCaptchaProvider = {
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
id: string;
|
|
10
|
+
config?: CaptchaConfig;
|
|
11
|
+
createdAt?: number;
|
|
12
|
+
updatedAt?: number;
|
|
13
|
+
};
|
|
14
|
+
export type CaptchaProvider = {
|
|
15
|
+
tenantId: string;
|
|
16
|
+
id: string;
|
|
17
|
+
config: CaptchaConfig;
|
|
18
|
+
createdAt: number;
|
|
19
|
+
updatedAt: number;
|
|
20
|
+
};
|
|
21
|
+
export type CaptchaProviderKeys = 'tenantId' | 'id' | 'config' | 'createdAt' | 'updatedAt';
|
|
22
|
+
export declare const CaptchaProviders: GeneratedSchema<CaptchaProviderKeys, CreateCaptchaProvider, CaptchaProvider, 'captcha_providers', 'captcha_provider'>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { captchaConfigGuard } from './../foundations/index.js';
|
|
4
|
+
const createGuard = z.object({
|
|
5
|
+
tenantId: z.string().max(21).optional(),
|
|
6
|
+
id: z.string().min(1).max(128),
|
|
7
|
+
config: captchaConfigGuard.optional(),
|
|
8
|
+
createdAt: z.number().optional(),
|
|
9
|
+
updatedAt: z.number().optional(),
|
|
10
|
+
});
|
|
11
|
+
const guard = z.object({
|
|
12
|
+
tenantId: z.string().max(21),
|
|
13
|
+
id: z.string().min(1).max(128),
|
|
14
|
+
config: captchaConfigGuard,
|
|
15
|
+
createdAt: z.number(),
|
|
16
|
+
updatedAt: z.number(),
|
|
17
|
+
});
|
|
18
|
+
export const CaptchaProviders = Object.freeze({
|
|
19
|
+
table: 'captcha_providers',
|
|
20
|
+
tableSingular: 'captcha_provider',
|
|
21
|
+
fields: {
|
|
22
|
+
tenantId: 'tenant_id',
|
|
23
|
+
id: 'id',
|
|
24
|
+
config: 'config',
|
|
25
|
+
createdAt: 'created_at',
|
|
26
|
+
updatedAt: 'updated_at',
|
|
27
|
+
},
|
|
28
|
+
fieldKeys: [
|
|
29
|
+
'tenantId',
|
|
30
|
+
'id',
|
|
31
|
+
'config',
|
|
32
|
+
'createdAt',
|
|
33
|
+
'updatedAt',
|
|
34
|
+
],
|
|
35
|
+
createGuard,
|
|
36
|
+
guard,
|
|
37
|
+
updateGuard: guard.partial(),
|
|
38
|
+
});
|
|
@@ -53,4 +53,5 @@ export var UsersPasswordEncryptionMethod;
|
|
|
53
53
|
UsersPasswordEncryptionMethod["SHA256"] = "SHA256";
|
|
54
54
|
UsersPasswordEncryptionMethod["MD5"] = "MD5";
|
|
55
55
|
UsersPasswordEncryptionMethod["Bcrypt"] = "Bcrypt";
|
|
56
|
+
UsersPasswordEncryptionMethod["Legacy"] = "Legacy";
|
|
56
57
|
})(UsersPasswordEncryptionMethod || (UsersPasswordEncryptionMethod = {}));
|
|
@@ -13,6 +13,7 @@ export * from './application-user-consent-resource-scope.js';
|
|
|
13
13
|
export * from './application-user-consent-user-scope.js';
|
|
14
14
|
export * from './application.js';
|
|
15
15
|
export * from './applications-role.js';
|
|
16
|
+
export * from './captcha-provider.js';
|
|
16
17
|
export * from './connector.js';
|
|
17
18
|
export * from './custom-phrase.js';
|
|
18
19
|
export * from './daily-active-user.js';
|
|
@@ -24,6 +25,7 @@ export * from './idp-initiated-saml-sso-session.js';
|
|
|
24
25
|
export * from './log.js';
|
|
25
26
|
export * from './logto-config.js';
|
|
26
27
|
export * from './oidc-model-instance.js';
|
|
28
|
+
export * from './one-time-token.js';
|
|
27
29
|
export * from './organization-application-relation.js';
|
|
28
30
|
export * from './organization-invitation-role-relation.js';
|
|
29
31
|
export * from './organization-invitation.js';
|
package/lib/db-entries/index.js
CHANGED
|
@@ -14,6 +14,7 @@ export * from './application-user-consent-resource-scope.js';
|
|
|
14
14
|
export * from './application-user-consent-user-scope.js';
|
|
15
15
|
export * from './application.js';
|
|
16
16
|
export * from './applications-role.js';
|
|
17
|
+
export * from './captcha-provider.js';
|
|
17
18
|
export * from './connector.js';
|
|
18
19
|
export * from './custom-phrase.js';
|
|
19
20
|
export * from './daily-active-user.js';
|
|
@@ -25,6 +26,7 @@ export * from './idp-initiated-saml-sso-session.js';
|
|
|
25
26
|
export * from './log.js';
|
|
26
27
|
export * from './logto-config.js';
|
|
27
28
|
export * from './oidc-model-instance.js';
|
|
29
|
+
export * from './one-time-token.js';
|
|
28
30
|
export * from './organization-application-relation.js';
|
|
29
31
|
export * from './organization-invitation-role-relation.js';
|
|
30
32
|
export * from './organization-invitation.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OneTimeTokenContext, OneTimeTokenStatus, GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link OneTimeToken} for the original type.
|
|
6
|
+
*/
|
|
7
|
+
export type CreateOneTimeToken = {
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
id: string;
|
|
10
|
+
email: string;
|
|
11
|
+
token: string;
|
|
12
|
+
context?: OneTimeTokenContext;
|
|
13
|
+
status?: OneTimeTokenStatus;
|
|
14
|
+
createdAt?: number;
|
|
15
|
+
expiresAt: number;
|
|
16
|
+
};
|
|
17
|
+
export type OneTimeToken = {
|
|
18
|
+
tenantId: string;
|
|
19
|
+
id: string;
|
|
20
|
+
email: string;
|
|
21
|
+
token: string;
|
|
22
|
+
context: OneTimeTokenContext;
|
|
23
|
+
status: OneTimeTokenStatus;
|
|
24
|
+
createdAt: number;
|
|
25
|
+
expiresAt: number;
|
|
26
|
+
};
|
|
27
|
+
export type OneTimeTokenKeys = 'tenantId' | 'id' | 'email' | 'token' | 'context' | 'status' | 'createdAt' | 'expiresAt';
|
|
28
|
+
export declare const OneTimeTokens: GeneratedSchema<OneTimeTokenKeys, CreateOneTimeToken, OneTimeToken, 'one_time_tokens', 'one_time_token'>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { oneTimeTokenContextGuard, oneTimeTokenStatusGuard } from './../foundations/index.js';
|
|
4
|
+
const createGuard = z.object({
|
|
5
|
+
tenantId: z.string().max(21).optional(),
|
|
6
|
+
id: z.string().min(1).max(21),
|
|
7
|
+
email: z.string().min(1).max(128),
|
|
8
|
+
token: z.string().min(1).max(256),
|
|
9
|
+
context: oneTimeTokenContextGuard.optional(),
|
|
10
|
+
status: oneTimeTokenStatusGuard.optional(),
|
|
11
|
+
createdAt: z.number().optional(),
|
|
12
|
+
expiresAt: z.number(),
|
|
13
|
+
});
|
|
14
|
+
const guard = z.object({
|
|
15
|
+
tenantId: z.string().max(21),
|
|
16
|
+
id: z.string().min(1).max(21),
|
|
17
|
+
email: z.string().min(1).max(128),
|
|
18
|
+
token: z.string().min(1).max(256),
|
|
19
|
+
context: oneTimeTokenContextGuard,
|
|
20
|
+
status: oneTimeTokenStatusGuard,
|
|
21
|
+
createdAt: z.number(),
|
|
22
|
+
expiresAt: z.number(),
|
|
23
|
+
});
|
|
24
|
+
export const OneTimeTokens = Object.freeze({
|
|
25
|
+
table: 'one_time_tokens',
|
|
26
|
+
tableSingular: 'one_time_token',
|
|
27
|
+
fields: {
|
|
28
|
+
tenantId: 'tenant_id',
|
|
29
|
+
id: 'id',
|
|
30
|
+
email: 'email',
|
|
31
|
+
token: 'token',
|
|
32
|
+
context: 'context',
|
|
33
|
+
status: 'status',
|
|
34
|
+
createdAt: 'created_at',
|
|
35
|
+
expiresAt: 'expires_at',
|
|
36
|
+
},
|
|
37
|
+
fieldKeys: [
|
|
38
|
+
'tenantId',
|
|
39
|
+
'id',
|
|
40
|
+
'email',
|
|
41
|
+
'token',
|
|
42
|
+
'context',
|
|
43
|
+
'status',
|
|
44
|
+
'createdAt',
|
|
45
|
+
'expiresAt',
|
|
46
|
+
],
|
|
47
|
+
createGuard,
|
|
48
|
+
guard,
|
|
49
|
+
updateGuard: guard.partial(),
|
|
50
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, Branding, LanguageInfo, SignIn, SignUp, SocialSignIn, ConnectorTargets, CustomContent, CustomUiAssets, PartialPasswordPolicy, Mfa, GeneratedSchema } from './../foundations/index.js';
|
|
1
|
+
import { Color, Branding, LanguageInfo, SignIn, SignUp, SocialSignIn, ConnectorTargets, CustomContent, CustomUiAssets, PartialPasswordPolicy, Mfa, CaptchaPolicy, GeneratedSchema } from './../foundations/index.js';
|
|
2
2
|
import { AgreeToTermsPolicy, SignInMode } from './custom-types.js';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
@@ -29,6 +29,7 @@ export type CreateSignInExperience = {
|
|
|
29
29
|
supportEmail?: string | null;
|
|
30
30
|
supportWebsiteUrl?: string | null;
|
|
31
31
|
unknownSessionRedirectUrl?: string | null;
|
|
32
|
+
captchaPolicy?: CaptchaPolicy;
|
|
32
33
|
};
|
|
33
34
|
export type SignInExperience = {
|
|
34
35
|
tenantId: string;
|
|
@@ -54,6 +55,7 @@ export type SignInExperience = {
|
|
|
54
55
|
supportEmail: string | null;
|
|
55
56
|
supportWebsiteUrl: string | null;
|
|
56
57
|
unknownSessionRedirectUrl: string | null;
|
|
58
|
+
captchaPolicy: CaptchaPolicy;
|
|
57
59
|
};
|
|
58
|
-
export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'agreeToTermsPolicy' | 'signIn' | 'signUp' | 'socialSignIn' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'customUiAssets' | 'passwordPolicy' | 'mfa' | 'singleSignOnEnabled' | 'supportEmail' | 'supportWebsiteUrl' | 'unknownSessionRedirectUrl';
|
|
60
|
+
export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'agreeToTermsPolicy' | 'signIn' | 'signUp' | 'socialSignIn' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'customUiAssets' | 'passwordPolicy' | 'mfa' | 'singleSignOnEnabled' | 'supportEmail' | 'supportWebsiteUrl' | 'unknownSessionRedirectUrl' | 'captchaPolicy';
|
|
59
61
|
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 } from './../foundations/index.js';
|
|
3
|
+
import { colorGuard, brandingGuard, languageInfoGuard, signInGuard, signUpGuard, socialSignInGuard, connectorTargetsGuard, customContentGuard, customUiAssetsGuard, partialPasswordPolicyGuard, mfaGuard, captchaPolicyGuard } 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(),
|
|
@@ -25,6 +25,7 @@ const createGuard = z.object({
|
|
|
25
25
|
supportEmail: z.string().nullable().optional(),
|
|
26
26
|
supportWebsiteUrl: z.string().nullable().optional(),
|
|
27
27
|
unknownSessionRedirectUrl: z.string().nullable().optional(),
|
|
28
|
+
captchaPolicy: captchaPolicyGuard.optional(),
|
|
28
29
|
});
|
|
29
30
|
const guard = z.object({
|
|
30
31
|
tenantId: z.string().max(21),
|
|
@@ -49,6 +50,7 @@ const guard = z.object({
|
|
|
49
50
|
supportEmail: z.string().nullable(),
|
|
50
51
|
supportWebsiteUrl: z.string().nullable(),
|
|
51
52
|
unknownSessionRedirectUrl: z.string().nullable(),
|
|
53
|
+
captchaPolicy: captchaPolicyGuard,
|
|
52
54
|
});
|
|
53
55
|
export const SignInExperiences = Object.freeze({
|
|
54
56
|
table: 'sign_in_experiences',
|
|
@@ -76,6 +78,7 @@ export const SignInExperiences = Object.freeze({
|
|
|
76
78
|
supportEmail: 'support_email',
|
|
77
79
|
supportWebsiteUrl: 'support_website_url',
|
|
78
80
|
unknownSessionRedirectUrl: 'unknown_session_redirect_url',
|
|
81
|
+
captchaPolicy: 'captcha_policy',
|
|
79
82
|
},
|
|
80
83
|
fieldKeys: [
|
|
81
84
|
'tenantId',
|
|
@@ -100,6 +103,7 @@ export const SignInExperiences = Object.freeze({
|
|
|
100
103
|
'supportEmail',
|
|
101
104
|
'supportWebsiteUrl',
|
|
102
105
|
'unknownSessionRedirectUrl',
|
|
106
|
+
'captchaPolicy',
|
|
103
107
|
],
|
|
104
108
|
createGuard,
|
|
105
109
|
guard,
|