@logto/schemas 1.9.2 → 1.10.1
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.10.1-1695647183-update-private-key-type.ts +108 -0
- package/alterations/1.10.1-1696657546-organization-tables.ts +150 -0
- package/alterations/1.10.1-1697683802-add-sso-connectors-table.ts +66 -0
- package/alterations/1.10.1-1698646271-add-organization-created-flag.ts +75 -0
- package/alterations/1.10.1-1698820410-add-user-sso-identities-table.ts +61 -0
- package/alterations/1.10.1-1698910485-user-logto-data.ts +20 -0
- package/alterations/1.9.2-1695198741-remove-m2m-app-admin-access-switch.ts +52 -24
- package/alterations-js/1.10.1-1695647183-update-private-key-type.d.ts +3 -0
- package/alterations-js/1.10.1-1695647183-update-private-key-type.js +50 -0
- package/alterations-js/1.10.1-1696657546-organization-tables.d.ts +3 -0
- package/alterations-js/1.10.1-1696657546-organization-tables.js +136 -0
- package/alterations-js/1.10.1-1697683802-add-sso-connectors-table.d.ts +3 -0
- package/alterations-js/1.10.1-1697683802-add-sso-connectors-table.js +58 -0
- package/alterations-js/1.10.1-1698646271-add-organization-created-flag.d.ts +3 -0
- package/alterations-js/1.10.1-1698646271-add-organization-created-flag.js +26 -0
- package/alterations-js/1.10.1-1698820410-add-user-sso-identities-table.d.ts +4 -0
- package/alterations-js/1.10.1-1698820410-add-user-sso-identities-table.js +53 -0
- package/alterations-js/1.10.1-1698910485-user-logto-data.d.ts +3 -0
- package/alterations-js/1.10.1-1698910485-user-logto-data.js +16 -0
- package/alterations-js/1.9.2-1695198741-remove-m2m-app-admin-access-switch.js +47 -5
- package/lib/db-entries/application.d.ts +7 -1
- package/lib/db-entries/application.js +1 -0
- package/lib/db-entries/applications-role.d.ts +7 -1
- package/lib/db-entries/applications-role.js +1 -0
- package/lib/db-entries/connector.d.ts +7 -1
- package/lib/db-entries/connector.js +1 -0
- package/lib/db-entries/custom-phrase.d.ts +7 -1
- package/lib/db-entries/custom-phrase.js +1 -0
- package/lib/db-entries/daily-active-user.d.ts +7 -1
- package/lib/db-entries/daily-active-user.js +1 -0
- package/lib/db-entries/domain.d.ts +7 -1
- package/lib/db-entries/domain.js +1 -0
- package/lib/db-entries/hook.d.ts +7 -1
- package/lib/db-entries/hook.js +1 -0
- package/lib/db-entries/index.d.ts +8 -0
- package/lib/db-entries/index.js +8 -0
- package/lib/db-entries/log.d.ts +7 -1
- package/lib/db-entries/log.js +1 -0
- package/lib/db-entries/logto-config.d.ts +10 -4
- package/lib/db-entries/logto-config.js +4 -3
- package/lib/db-entries/oidc-model-instance.d.ts +7 -1
- package/lib/db-entries/oidc-model-instance.js +1 -0
- package/lib/db-entries/organization-role-scope-relation.d.ts +20 -0
- package/lib/db-entries/organization-role-scope-relation.js +29 -0
- package/lib/db-entries/organization-role-user-relation.d.ts +22 -0
- package/lib/db-entries/organization-role-user-relation.js +33 -0
- package/lib/db-entries/organization-role.d.ts +28 -0
- package/lib/db-entries/organization-role.js +33 -0
- package/lib/db-entries/organization-scope.d.ts +28 -0
- package/lib/db-entries/organization-scope.js +33 -0
- package/lib/db-entries/organization-user-relation.d.ts +20 -0
- package/lib/db-entries/organization-user-relation.js +29 -0
- package/lib/db-entries/organization.d.ts +32 -0
- package/lib/db-entries/organization.js +37 -0
- package/lib/db-entries/passcode.d.ts +7 -1
- package/lib/db-entries/passcode.js +1 -0
- package/lib/db-entries/resource.d.ts +7 -1
- package/lib/db-entries/resource.js +1 -0
- package/lib/db-entries/role.d.ts +7 -1
- package/lib/db-entries/role.js +1 -0
- package/lib/db-entries/roles-scope.d.ts +7 -1
- package/lib/db-entries/roles-scope.js +1 -0
- package/lib/db-entries/scope.d.ts +7 -1
- package/lib/db-entries/scope.js +1 -0
- package/lib/db-entries/sentinel-activity.d.ts +7 -1
- package/lib/db-entries/sentinel-activity.js +1 -0
- package/lib/db-entries/service-log.d.ts +7 -1
- package/lib/db-entries/service-log.js +1 -0
- package/lib/db-entries/sign-in-experience.d.ts +7 -1
- package/lib/db-entries/sign-in-experience.js +1 -0
- package/lib/db-entries/sso-connector.d.ts +50 -0
- package/lib/db-entries/sso-connector.js +58 -0
- package/lib/db-entries/system.d.ts +7 -1
- package/lib/db-entries/system.js +1 -0
- package/lib/db-entries/user-sso-identity.d.ts +30 -0
- package/lib/db-entries/user-sso-identity.js +46 -0
- package/lib/db-entries/user.d.ts +9 -1
- package/lib/db-entries/user.js +5 -0
- package/lib/db-entries/users-role.d.ts +7 -1
- package/lib/db-entries/users-role.js +1 -0
- package/lib/db-entries/verification-status.d.ts +7 -1
- package/lib/db-entries/verification-status.js +1 -0
- package/lib/foundations/index.d.ts +1 -1
- package/lib/foundations/index.js +1 -1
- package/lib/foundations/jsonb-types/custom-domain.d.ts +134 -0
- package/lib/foundations/jsonb-types/custom-domain.js +36 -0
- package/lib/foundations/jsonb-types/hooks.d.ts +32 -0
- package/lib/foundations/jsonb-types/hooks.js +24 -0
- package/lib/foundations/jsonb-types/index.d.ts +15 -0
- package/lib/foundations/jsonb-types/index.js +16 -0
- package/lib/foundations/jsonb-types/logs.d.ts +106 -0
- package/lib/foundations/jsonb-types/logs.js +20 -0
- package/lib/foundations/jsonb-types/oidc-module.d.ts +80 -0
- package/lib/foundations/jsonb-types/oidc-module.js +54 -0
- package/lib/foundations/jsonb-types/phrases.d.ts +5 -0
- package/lib/foundations/jsonb-types/phrases.js +2 -0
- package/lib/foundations/jsonb-types/sentinel.d.ts +27 -0
- package/lib/foundations/jsonb-types/sentinel.js +28 -0
- package/lib/foundations/jsonb-types/sign-in-experience.d.ts +118 -0
- package/lib/foundations/jsonb-types/sign-in-experience.js +56 -0
- package/lib/foundations/jsonb-types/sso-connector.d.ts +14 -0
- package/lib/foundations/jsonb-types/sso-connector.js +6 -0
- package/lib/foundations/jsonb-types/users.d.ts +285 -0
- package/lib/foundations/jsonb-types/users.js +47 -0
- package/lib/foundations/schemas.d.ts +11 -13
- package/lib/models/tenants.d.ts +7 -11
- package/lib/seeds/logto-config.js +1 -0
- package/lib/types/application.d.ts +51 -1
- package/lib/types/application.js +7 -1
- package/lib/types/connector.d.ts +516 -2360
- package/lib/types/domain.d.ts +65 -27
- package/lib/types/hook.d.ts +15 -16
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.js +3 -0
- package/lib/types/interactions.d.ts +502 -10
- package/lib/types/interactions.js +83 -5
- package/lib/types/log/interaction.d.ts +4 -3
- package/lib/types/log/interaction.js +1 -0
- package/lib/types/logto-config.d.ts +50 -2
- package/lib/types/logto-config.js +30 -3
- package/lib/types/mfa.d.ts +211 -0
- package/lib/types/mfa.js +62 -0
- package/lib/types/organization.d.ts +44 -0
- package/lib/types/organization.js +20 -0
- package/lib/types/role.d.ts +5 -3
- package/lib/types/scope.d.ts +12 -27
- package/lib/types/sso-connector.d.ts +21 -0
- package/lib/types/sso-connector.js +10 -0
- package/lib/types/system.d.ts +26 -7
- package/lib/types/system.js +8 -0
- package/lib/types/user-assets.d.ts +2 -2
- package/lib/types/user.d.ts +209 -66
- package/lib/types/user.js +8 -2
- package/package.json +7 -7
- package/tables/logto_configs.sql +1 -1
- package/tables/organization_role_scope_relations.sql +12 -0
- package/tables/organization_role_user_relations.sql +14 -0
- package/tables/organization_roles.sql +19 -0
- package/tables/organization_scopes.sql +19 -0
- package/tables/organization_user_relations.sql +12 -0
- package/tables/organizations.sql +19 -0
- package/tables/sso_connectors.sql +29 -0
- package/tables/user_sso_identities.sql +17 -0
- package/tables/users.sql +1 -0
- package/lib/foundations/jsonb-types.d.ts +0 -673
- package/lib/foundations/jsonb-types.js +0 -260
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* init_order = 1 */
|
|
2
|
+
|
|
3
|
+
/** The scopes (permissions) defined by the organization template. */
|
|
4
|
+
create table organization_scopes (
|
|
5
|
+
tenant_id varchar(21) not null
|
|
6
|
+
references tenants (id) on update cascade on delete cascade,
|
|
7
|
+
/** The globally unique identifier of the organization scope. */
|
|
8
|
+
id varchar(21) not null,
|
|
9
|
+
/** The organization scope's name, unique within the organization template. */
|
|
10
|
+
name varchar(128) not null,
|
|
11
|
+
/** A brief description of the organization scope. */
|
|
12
|
+
description varchar(256),
|
|
13
|
+
primary key (id),
|
|
14
|
+
constraint organization_scopes__name
|
|
15
|
+
unique (tenant_id, name)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
create index organization_scopes__id
|
|
19
|
+
on organization_scopes (tenant_id, id);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* init_order = 2 */
|
|
2
|
+
|
|
3
|
+
/** The relations between organizations and users. It indicates membership of users in organizations. */
|
|
4
|
+
create table organization_user_relations (
|
|
5
|
+
tenant_id varchar(21) not null
|
|
6
|
+
references tenants (id) on update cascade on delete cascade,
|
|
7
|
+
organization_id varchar(21) not null
|
|
8
|
+
references organizations (id) on update cascade on delete cascade,
|
|
9
|
+
user_id varchar(21) not null
|
|
10
|
+
references users (id) on update cascade on delete cascade,
|
|
11
|
+
primary key (tenant_id, organization_id, user_id)
|
|
12
|
+
);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* init_order = 1 */
|
|
2
|
+
|
|
3
|
+
/** Organizations defined by [RFC 0001](https://github.com/logto-io/rfcs/blob/HEAD/active/0001-organization.md). */
|
|
4
|
+
create table organizations (
|
|
5
|
+
tenant_id varchar(21) not null
|
|
6
|
+
references tenants (id) on update cascade on delete cascade,
|
|
7
|
+
/** The globally unique identifier of the organization. */
|
|
8
|
+
id varchar(21) not null,
|
|
9
|
+
/** The organization's name for display. */
|
|
10
|
+
name varchar(128) not null,
|
|
11
|
+
/** A brief description of the organization. */
|
|
12
|
+
description varchar(256),
|
|
13
|
+
/** When the organization was created. */
|
|
14
|
+
created_at timestamptz not null default(now()),
|
|
15
|
+
primary key (id)
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
create index organizations__id
|
|
19
|
+
on organizations (tenant_id, id);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
create table sso_connectors (
|
|
2
|
+
tenant_id varchar(21) not null
|
|
3
|
+
references tenants (id) on update cascade on delete cascade,
|
|
4
|
+
/** The globally unique identifier of the SSO connector. */
|
|
5
|
+
id varchar(128) not null,
|
|
6
|
+
/** The connector factory name of the SSO provider. */
|
|
7
|
+
provider_name varchar(128) not null,
|
|
8
|
+
/** The name of the SSO provider for display. */
|
|
9
|
+
connector_name varchar(128) not null,
|
|
10
|
+
/** The connector configuration. Different schemas for different provide type */
|
|
11
|
+
config jsonb /* @use JsonObject */ not null default '{}'::jsonb,
|
|
12
|
+
/** The SSO email domains. */
|
|
13
|
+
domains jsonb /* @use SsoDomains */ not null default '[]'::jsonb,
|
|
14
|
+
/** The SSO branding. */
|
|
15
|
+
branding jsonb /* @use SsoBranding */ not null default '{}'::jsonb,
|
|
16
|
+
/** Determines whether to synchronize the user's profile on each login. */
|
|
17
|
+
sync_profile boolean not null default FALSE,
|
|
18
|
+
/** Determines whether SSO is the restricted sign-in method for users with the SSO registered email domains */
|
|
19
|
+
sso_only boolean not null default FALSE,
|
|
20
|
+
/** When the SSO connector was created. */
|
|
21
|
+
created_at timestamptz not null default(now()),
|
|
22
|
+
primary key (id)
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
create index sso_connectors__id
|
|
26
|
+
on sso_connectors (tenant_id, id);
|
|
27
|
+
|
|
28
|
+
create index sso_connectors__id__provider_name
|
|
29
|
+
on sso_connectors (tenant_id, id, provider_name);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* init_order = 2 */
|
|
2
|
+
|
|
3
|
+
create table user_sso_identities (
|
|
4
|
+
tenant_id varchar(21) not null
|
|
5
|
+
references tenants (id) on update cascade on delete cascade,
|
|
6
|
+
id varchar(21) not null,
|
|
7
|
+
user_id varchar(12) not null references users (id) on update cascade on delete cascade,
|
|
8
|
+
/** Unique provider identifier. Issuer of the OIDC connectors, entityId of the SAML providers */
|
|
9
|
+
issuer varchar(256) not null,
|
|
10
|
+
/** Provider user identity id*/
|
|
11
|
+
identity_id varchar(128) not null,
|
|
12
|
+
detail jsonb /* @use JsonObject */ not null default '{}'::jsonb,
|
|
13
|
+
created_at timestamp not null default(now()),
|
|
14
|
+
primary key (id),
|
|
15
|
+
constraint user_sso_identities__issuer__identity_id
|
|
16
|
+
unique (tenant_id, issuer, identity_id)
|
|
17
|
+
);
|
package/tables/users.sql
CHANGED
|
@@ -16,6 +16,7 @@ create table users (
|
|
|
16
16
|
application_id varchar(21),
|
|
17
17
|
identities jsonb /* @use Identities */ not null default '{}'::jsonb,
|
|
18
18
|
custom_data jsonb /* @use JsonObject */ not null default '{}'::jsonb,
|
|
19
|
+
logto_config jsonb /* @use JsonObject */ not null default '{}'::jsonb,
|
|
19
20
|
mfa_verifications jsonb /* @use MfaVerifications */ not null default '[]'::jsonb,
|
|
20
21
|
is_suspended boolean not null default false,
|
|
21
22
|
last_sign_in_at timestamptz,
|