@logto/schemas 1.25.0 → 1.27.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.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/1.27.0-1744013256-add-sentinel-policy-column-to-sie-table.ts +20 -0
- package/alterations/1.27.0-1744357867-add-sentinel-activities-hash-index.ts +19 -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/alterations-js/1.27.0-1744013256-add-sentinel-policy-column-to-sie-table.js +16 -0
- package/alterations-js/1.27.0-1744357867-add-sentinel-activities-hash-index.js +15 -0
- package/lib/consts/experience.d.ts +2 -0
- package/lib/consts/experience.js +2 -0
- package/lib/consts/index.d.ts +1 -0
- package/lib/consts/index.js +1 -0
- package/lib/consts/oidc.d.ts +9 -1
- package/lib/consts/oidc.js +5 -0
- package/lib/consts/sentinel.d.ts +10 -0
- package/lib/consts/sentinel.js +10 -0
- package/lib/db-entries/captcha-provider.d.ts +22 -0
- package/lib/db-entries/captcha-provider.js +38 -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 +6 -2
- package/lib/db-entries/sign-in-experience.js +9 -1
- package/lib/foundations/jsonb-types/applications.d.ts +14 -14
- package/lib/foundations/jsonb-types/captcha.d.ts +65 -0
- package/lib/foundations/jsonb-types/captcha.js +21 -0
- package/lib/foundations/jsonb-types/custom-domain.d.ts +4 -4
- 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 +142 -5
- package/lib/foundations/jsonb-types/sign-in-experience.js +26 -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/application.d.ts +8 -8
- package/lib/types/connector.d.ts +35 -3
- package/lib/types/consent.d.ts +4 -4
- package/lib/types/domain.d.ts +2 -2
- package/lib/types/interactions.d.ts +70 -17
- package/lib/types/interactions.js +10 -0
- package/lib/types/log/interaction.d.ts +3 -2
- package/lib/types/log/interaction.js +1 -0
- package/lib/types/logto-config/jwt-customizer.d.ts +23 -23
- package/lib/types/saml-application.d.ts +17 -17
- package/lib/types/sign-in-experience.d.ts +78 -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 +5 -22
- package/lib/types/system.js +0 -13
- package/package.json +13 -13
- package/tables/captcha_providers.sql +13 -0
- package/tables/one_time_tokens.sql +18 -0
- package/tables/sentinel_activities.sql +3 -0
- package/tables/sign_in_experiences.sql +2 -0
|
@@ -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,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 sentinel_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 sentinel_policy;
|
|
16
|
+
`);
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default alteration;
|
|
@@ -0,0 +1,19 @@
|
|
|
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 index sentinel_activities__target_type_target_hash
|
|
9
|
+
on sentinel_activities (tenant_id, target_type, target_hash);
|
|
10
|
+
`);
|
|
11
|
+
},
|
|
12
|
+
down: async (pool) => {
|
|
13
|
+
await pool.query(sql`
|
|
14
|
+
drop index sentinel_activities__target_type_target_hash;
|
|
15
|
+
`);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
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;
|
|
@@ -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 sentinel_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 sentinel_policy;
|
|
13
|
+
`);
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
export default alteration;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
up: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
create index sentinel_activities__target_type_target_hash
|
|
6
|
+
on sentinel_activities (tenant_id, target_type, target_hash);
|
|
7
|
+
`);
|
|
8
|
+
},
|
|
9
|
+
down: async (pool) => {
|
|
10
|
+
await pool.query(sql `
|
|
11
|
+
drop index sentinel_activities__target_type_target_hash;
|
|
12
|
+
`);
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
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 oneTimeToken: "one-time-token";
|
|
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
|
+
oneTimeToken: 'one-time-token',
|
|
9
11
|
});
|
|
10
12
|
export const experience = Object.freeze({
|
|
11
13
|
routes,
|
package/lib/consts/index.d.ts
CHANGED
package/lib/consts/index.js
CHANGED
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
|
+
});
|
|
@@ -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, SentinelPolicy, GeneratedSchema } from './../foundations/index.js';
|
|
2
2
|
import { AgreeToTermsPolicy, SignInMode } from './custom-types.js';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
@@ -29,6 +29,8 @@ export type CreateSignInExperience = {
|
|
|
29
29
|
supportEmail?: string | null;
|
|
30
30
|
supportWebsiteUrl?: string | null;
|
|
31
31
|
unknownSessionRedirectUrl?: string | null;
|
|
32
|
+
captchaPolicy?: CaptchaPolicy;
|
|
33
|
+
sentinelPolicy?: SentinelPolicy;
|
|
32
34
|
};
|
|
33
35
|
export type SignInExperience = {
|
|
34
36
|
tenantId: string;
|
|
@@ -54,6 +56,8 @@ export type SignInExperience = {
|
|
|
54
56
|
supportEmail: string | null;
|
|
55
57
|
supportWebsiteUrl: string | null;
|
|
56
58
|
unknownSessionRedirectUrl: string | null;
|
|
59
|
+
captchaPolicy: CaptchaPolicy;
|
|
60
|
+
sentinelPolicy: SentinelPolicy;
|
|
57
61
|
};
|
|
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';
|
|
62
|
+
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' | 'sentinelPolicy';
|
|
59
63
|
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, sentinelPolicyGuard } 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,8 @@ 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(),
|
|
29
|
+
sentinelPolicy: sentinelPolicyGuard.optional(),
|
|
28
30
|
});
|
|
29
31
|
const guard = z.object({
|
|
30
32
|
tenantId: z.string().max(21),
|
|
@@ -49,6 +51,8 @@ const guard = z.object({
|
|
|
49
51
|
supportEmail: z.string().nullable(),
|
|
50
52
|
supportWebsiteUrl: z.string().nullable(),
|
|
51
53
|
unknownSessionRedirectUrl: z.string().nullable(),
|
|
54
|
+
captchaPolicy: captchaPolicyGuard,
|
|
55
|
+
sentinelPolicy: sentinelPolicyGuard,
|
|
52
56
|
});
|
|
53
57
|
export const SignInExperiences = Object.freeze({
|
|
54
58
|
table: 'sign_in_experiences',
|
|
@@ -76,6 +80,8 @@ export const SignInExperiences = Object.freeze({
|
|
|
76
80
|
supportEmail: 'support_email',
|
|
77
81
|
supportWebsiteUrl: 'support_website_url',
|
|
78
82
|
unknownSessionRedirectUrl: 'unknown_session_redirect_url',
|
|
83
|
+
captchaPolicy: 'captcha_policy',
|
|
84
|
+
sentinelPolicy: 'sentinel_policy',
|
|
79
85
|
},
|
|
80
86
|
fieldKeys: [
|
|
81
87
|
'tenantId',
|
|
@@ -100,6 +106,8 @@ export const SignInExperiences = Object.freeze({
|
|
|
100
106
|
'supportEmail',
|
|
101
107
|
'supportWebsiteUrl',
|
|
102
108
|
'unknownSessionRedirectUrl',
|
|
109
|
+
'captchaPolicy',
|
|
110
|
+
'sentinelPolicy',
|
|
103
111
|
],
|
|
104
112
|
createGuard,
|
|
105
113
|
guard,
|