@logto/schemas 1.10.0 → 1.11.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.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.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.ts +18 -0
- package/alterations/1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.ts +18 -0
- 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.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.d.ts +3 -0
- package/alterations-js/1.11.0-1699422979-add-sso-connector-id-col-to-user-sso-identities-table.js +14 -0
- package/alterations-js/1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.d.ts +3 -0
- package/alterations-js/1.11.0-1699598903-remove-sso-only-column-in-sso-connectors-table.js +14 -0
- 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 +46 -0
- package/lib/db-entries/sso-connector.js +54 -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 +32 -0
- package/lib/db-entries/user-sso-identity.js +50 -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 +8 -16
- package/lib/models/tenants.js +1 -6
- 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 +4 -0
- package/lib/types/index.js +4 -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 +74 -2
- package/lib/types/logto-config.js +38 -3
- package/lib/types/mfa.d.ts +211 -0
- package/lib/types/mfa.js +62 -0
- package/lib/types/organization.d.ts +48 -0
- package/lib/types/organization.js +21 -0
- package/lib/types/role.d.ts +5 -3
- package/lib/types/scope.d.ts +12 -27
- package/lib/types/sso-connector.d.ts +137 -0
- package/lib/types/sso-connector.js +24 -0
- package/lib/types/system.d.ts +26 -7
- package/lib/types/system.js +8 -0
- package/lib/types/tenant.d.ts +5 -0
- package/lib/types/tenant.js +6 -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 +28 -0
- package/tables/user_sso_identities.sql +20 -0
- package/tables/users.sql +1 -0
- package/lib/foundations/jsonb-types.d.ts +0 -673
- package/lib/foundations/jsonb-types.js +0 -260
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { OidcModelInstancePayload, GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link OidcModelInstance} for the original type.
|
|
6
|
+
*/
|
|
2
7
|
export type CreateOidcModelInstance = {
|
|
3
8
|
tenantId?: string;
|
|
4
9
|
modelName: string;
|
|
@@ -15,4 +20,5 @@ export type OidcModelInstance = {
|
|
|
15
20
|
expiresAt: number;
|
|
16
21
|
consumedAt: number | null;
|
|
17
22
|
};
|
|
18
|
-
export
|
|
23
|
+
export type OidcModelInstanceKeys = 'tenantId' | 'modelName' | 'id' | 'payload' | 'expiresAt' | 'consumedAt';
|
|
24
|
+
export declare const OidcModelInstances: GeneratedSchema<OidcModelInstanceKeys, CreateOidcModelInstance, OidcModelInstance, 'oidc_model_instances', 'oidc_model_instance'>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The relations between organization roles and organization scopes. It indicates which organization scopes are available to which organization roles.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link OrganizationRoleScopeRelation} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganizationRoleScopeRelation = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
organizationRoleId: string;
|
|
11
|
+
organizationScopeId: string;
|
|
12
|
+
};
|
|
13
|
+
/** The relations between organization roles and organization scopes. It indicates which organization scopes are available to which organization roles. */
|
|
14
|
+
export type OrganizationRoleScopeRelation = {
|
|
15
|
+
tenantId: string;
|
|
16
|
+
organizationRoleId: string;
|
|
17
|
+
organizationScopeId: string;
|
|
18
|
+
};
|
|
19
|
+
export type OrganizationRoleScopeRelationKeys = 'tenantId' | 'organizationRoleId' | 'organizationScopeId';
|
|
20
|
+
export declare const OrganizationRoleScopeRelations: GeneratedSchema<OrganizationRoleScopeRelationKeys, CreateOrganizationRoleScopeRelation, OrganizationRoleScopeRelation, 'organization_role_scope_relations', 'organization_role_scope_relation'>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const createGuard = z.object({
|
|
4
|
+
tenantId: z.string().max(21).optional(),
|
|
5
|
+
organizationRoleId: z.string().min(1).max(21),
|
|
6
|
+
organizationScopeId: z.string().min(1).max(21),
|
|
7
|
+
});
|
|
8
|
+
const guard = z.object({
|
|
9
|
+
tenantId: z.string().max(21),
|
|
10
|
+
organizationRoleId: z.string().min(1).max(21),
|
|
11
|
+
organizationScopeId: z.string().min(1).max(21),
|
|
12
|
+
});
|
|
13
|
+
export const OrganizationRoleScopeRelations = Object.freeze({
|
|
14
|
+
table: 'organization_role_scope_relations',
|
|
15
|
+
tableSingular: 'organization_role_scope_relation',
|
|
16
|
+
fields: {
|
|
17
|
+
tenantId: 'tenant_id',
|
|
18
|
+
organizationRoleId: 'organization_role_id',
|
|
19
|
+
organizationScopeId: 'organization_scope_id',
|
|
20
|
+
},
|
|
21
|
+
fieldKeys: [
|
|
22
|
+
'tenantId',
|
|
23
|
+
'organizationRoleId',
|
|
24
|
+
'organizationScopeId',
|
|
25
|
+
],
|
|
26
|
+
createGuard,
|
|
27
|
+
guard,
|
|
28
|
+
updateGuard: guard.partial(),
|
|
29
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The relations between organizations, organization roles, and users. A relation means that a user has a role in an organization.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link OrganizationRoleUserRelation} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganizationRoleUserRelation = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
organizationId: string;
|
|
11
|
+
organizationRoleId: string;
|
|
12
|
+
userId: string;
|
|
13
|
+
};
|
|
14
|
+
/** The relations between organizations, organization roles, and users. A relation means that a user has a role in an organization. */
|
|
15
|
+
export type OrganizationRoleUserRelation = {
|
|
16
|
+
tenantId: string;
|
|
17
|
+
organizationId: string;
|
|
18
|
+
organizationRoleId: string;
|
|
19
|
+
userId: string;
|
|
20
|
+
};
|
|
21
|
+
export type OrganizationRoleUserRelationKeys = 'tenantId' | 'organizationId' | 'organizationRoleId' | 'userId';
|
|
22
|
+
export declare const OrganizationRoleUserRelations: GeneratedSchema<OrganizationRoleUserRelationKeys, CreateOrganizationRoleUserRelation, OrganizationRoleUserRelation, 'organization_role_user_relations', 'organization_role_user_relation'>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const createGuard = z.object({
|
|
4
|
+
tenantId: z.string().max(21).optional(),
|
|
5
|
+
organizationId: z.string().min(1).max(21),
|
|
6
|
+
organizationRoleId: z.string().min(1).max(21),
|
|
7
|
+
userId: z.string().min(1).max(21),
|
|
8
|
+
});
|
|
9
|
+
const guard = z.object({
|
|
10
|
+
tenantId: z.string().max(21),
|
|
11
|
+
organizationId: z.string().min(1).max(21),
|
|
12
|
+
organizationRoleId: z.string().min(1).max(21),
|
|
13
|
+
userId: z.string().min(1).max(21),
|
|
14
|
+
});
|
|
15
|
+
export const OrganizationRoleUserRelations = Object.freeze({
|
|
16
|
+
table: 'organization_role_user_relations',
|
|
17
|
+
tableSingular: 'organization_role_user_relation',
|
|
18
|
+
fields: {
|
|
19
|
+
tenantId: 'tenant_id',
|
|
20
|
+
organizationId: 'organization_id',
|
|
21
|
+
organizationRoleId: 'organization_role_id',
|
|
22
|
+
userId: 'user_id',
|
|
23
|
+
},
|
|
24
|
+
fieldKeys: [
|
|
25
|
+
'tenantId',
|
|
26
|
+
'organizationId',
|
|
27
|
+
'organizationRoleId',
|
|
28
|
+
'userId',
|
|
29
|
+
],
|
|
30
|
+
createGuard,
|
|
31
|
+
guard,
|
|
32
|
+
updateGuard: guard.partial(),
|
|
33
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The roles defined by the organization template.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link OrganizationRole} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganizationRole = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
/** The globally unique identifier of the organization role. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** The organization role's name, unique within the organization template. */
|
|
13
|
+
name: string;
|
|
14
|
+
/** A brief description of the organization role. */
|
|
15
|
+
description?: string | null;
|
|
16
|
+
};
|
|
17
|
+
/** The roles defined by the organization template. */
|
|
18
|
+
export type OrganizationRole = {
|
|
19
|
+
tenantId: string;
|
|
20
|
+
/** The globally unique identifier of the organization role. */
|
|
21
|
+
id: string;
|
|
22
|
+
/** The organization role's name, unique within the organization template. */
|
|
23
|
+
name: string;
|
|
24
|
+
/** A brief description of the organization role. */
|
|
25
|
+
description: string | null;
|
|
26
|
+
};
|
|
27
|
+
export type OrganizationRoleKeys = 'tenantId' | 'id' | 'name' | 'description';
|
|
28
|
+
export declare const OrganizationRoles: GeneratedSchema<OrganizationRoleKeys, CreateOrganizationRole, OrganizationRole, 'organization_roles', 'organization_role'>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const createGuard = z.object({
|
|
4
|
+
tenantId: z.string().max(21).optional(),
|
|
5
|
+
id: z.string().min(1).max(21),
|
|
6
|
+
name: z.string().min(1).max(128),
|
|
7
|
+
description: z.string().max(256).nullable().optional(),
|
|
8
|
+
});
|
|
9
|
+
const guard = z.object({
|
|
10
|
+
tenantId: z.string().max(21),
|
|
11
|
+
id: z.string().min(1).max(21),
|
|
12
|
+
name: z.string().min(1).max(128),
|
|
13
|
+
description: z.string().max(256).nullable(),
|
|
14
|
+
});
|
|
15
|
+
export const OrganizationRoles = Object.freeze({
|
|
16
|
+
table: 'organization_roles',
|
|
17
|
+
tableSingular: 'organization_role',
|
|
18
|
+
fields: {
|
|
19
|
+
tenantId: 'tenant_id',
|
|
20
|
+
id: 'id',
|
|
21
|
+
name: 'name',
|
|
22
|
+
description: 'description',
|
|
23
|
+
},
|
|
24
|
+
fieldKeys: [
|
|
25
|
+
'tenantId',
|
|
26
|
+
'id',
|
|
27
|
+
'name',
|
|
28
|
+
'description',
|
|
29
|
+
],
|
|
30
|
+
createGuard,
|
|
31
|
+
guard,
|
|
32
|
+
updateGuard: guard.partial(),
|
|
33
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The scopes (permissions) defined by the organization template.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link OrganizationScope} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganizationScope = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
/** The globally unique identifier of the organization scope. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** The organization scope's name, unique within the organization template. */
|
|
13
|
+
name: string;
|
|
14
|
+
/** A brief description of the organization scope. */
|
|
15
|
+
description?: string | null;
|
|
16
|
+
};
|
|
17
|
+
/** The scopes (permissions) defined by the organization template. */
|
|
18
|
+
export type OrganizationScope = {
|
|
19
|
+
tenantId: string;
|
|
20
|
+
/** The globally unique identifier of the organization scope. */
|
|
21
|
+
id: string;
|
|
22
|
+
/** The organization scope's name, unique within the organization template. */
|
|
23
|
+
name: string;
|
|
24
|
+
/** A brief description of the organization scope. */
|
|
25
|
+
description: string | null;
|
|
26
|
+
};
|
|
27
|
+
export type OrganizationScopeKeys = 'tenantId' | 'id' | 'name' | 'description';
|
|
28
|
+
export declare const OrganizationScopes: GeneratedSchema<OrganizationScopeKeys, CreateOrganizationScope, OrganizationScope, 'organization_scopes', 'organization_scope'>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const createGuard = z.object({
|
|
4
|
+
tenantId: z.string().max(21).optional(),
|
|
5
|
+
id: z.string().min(1).max(21),
|
|
6
|
+
name: z.string().min(1).max(128),
|
|
7
|
+
description: z.string().max(256).nullable().optional(),
|
|
8
|
+
});
|
|
9
|
+
const guard = z.object({
|
|
10
|
+
tenantId: z.string().max(21),
|
|
11
|
+
id: z.string().min(1).max(21),
|
|
12
|
+
name: z.string().min(1).max(128),
|
|
13
|
+
description: z.string().max(256).nullable(),
|
|
14
|
+
});
|
|
15
|
+
export const OrganizationScopes = Object.freeze({
|
|
16
|
+
table: 'organization_scopes',
|
|
17
|
+
tableSingular: 'organization_scope',
|
|
18
|
+
fields: {
|
|
19
|
+
tenantId: 'tenant_id',
|
|
20
|
+
id: 'id',
|
|
21
|
+
name: 'name',
|
|
22
|
+
description: 'description',
|
|
23
|
+
},
|
|
24
|
+
fieldKeys: [
|
|
25
|
+
'tenantId',
|
|
26
|
+
'id',
|
|
27
|
+
'name',
|
|
28
|
+
'description',
|
|
29
|
+
],
|
|
30
|
+
createGuard,
|
|
31
|
+
guard,
|
|
32
|
+
updateGuard: guard.partial(),
|
|
33
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The relations between organizations and users. It indicates membership of users in organizations.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link OrganizationUserRelation} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganizationUserRelation = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
organizationId: string;
|
|
11
|
+
userId: string;
|
|
12
|
+
};
|
|
13
|
+
/** The relations between organizations and users. It indicates membership of users in organizations. */
|
|
14
|
+
export type OrganizationUserRelation = {
|
|
15
|
+
tenantId: string;
|
|
16
|
+
organizationId: string;
|
|
17
|
+
userId: string;
|
|
18
|
+
};
|
|
19
|
+
export type OrganizationUserRelationKeys = 'tenantId' | 'organizationId' | 'userId';
|
|
20
|
+
export declare const OrganizationUserRelations: GeneratedSchema<OrganizationUserRelationKeys, CreateOrganizationUserRelation, OrganizationUserRelation, 'organization_user_relations', 'organization_user_relation'>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const createGuard = z.object({
|
|
4
|
+
tenantId: z.string().max(21).optional(),
|
|
5
|
+
organizationId: z.string().min(1).max(21),
|
|
6
|
+
userId: z.string().min(1).max(21),
|
|
7
|
+
});
|
|
8
|
+
const guard = z.object({
|
|
9
|
+
tenantId: z.string().max(21),
|
|
10
|
+
organizationId: z.string().min(1).max(21),
|
|
11
|
+
userId: z.string().min(1).max(21),
|
|
12
|
+
});
|
|
13
|
+
export const OrganizationUserRelations = Object.freeze({
|
|
14
|
+
table: 'organization_user_relations',
|
|
15
|
+
tableSingular: 'organization_user_relation',
|
|
16
|
+
fields: {
|
|
17
|
+
tenantId: 'tenant_id',
|
|
18
|
+
organizationId: 'organization_id',
|
|
19
|
+
userId: 'user_id',
|
|
20
|
+
},
|
|
21
|
+
fieldKeys: [
|
|
22
|
+
'tenantId',
|
|
23
|
+
'organizationId',
|
|
24
|
+
'userId',
|
|
25
|
+
],
|
|
26
|
+
createGuard,
|
|
27
|
+
guard,
|
|
28
|
+
updateGuard: guard.partial(),
|
|
29
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Organizations defined by [RFC 0001](https://github.com/logto-io/rfcs/blob/HEAD/active/0001-organization.md).
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link Organization} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganization = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
/** The globally unique identifier of the organization. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** The organization's name for display. */
|
|
13
|
+
name: string;
|
|
14
|
+
/** A brief description of the organization. */
|
|
15
|
+
description?: string | null;
|
|
16
|
+
/** When the organization was created. */
|
|
17
|
+
createdAt?: number;
|
|
18
|
+
};
|
|
19
|
+
/** Organizations defined by [RFC 0001](https://github.com/logto-io/rfcs/blob/HEAD/active/0001-organization.md). */
|
|
20
|
+
export type Organization = {
|
|
21
|
+
tenantId: string;
|
|
22
|
+
/** The globally unique identifier of the organization. */
|
|
23
|
+
id: string;
|
|
24
|
+
/** The organization's name for display. */
|
|
25
|
+
name: string;
|
|
26
|
+
/** A brief description of the organization. */
|
|
27
|
+
description: string | null;
|
|
28
|
+
/** When the organization was created. */
|
|
29
|
+
createdAt: number;
|
|
30
|
+
};
|
|
31
|
+
export type OrganizationKeys = 'tenantId' | 'id' | 'name' | 'description' | 'createdAt';
|
|
32
|
+
export declare const Organizations: GeneratedSchema<OrganizationKeys, CreateOrganization, Organization, 'organizations', 'organization'>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
const createGuard = z.object({
|
|
4
|
+
tenantId: z.string().max(21).optional(),
|
|
5
|
+
id: z.string().min(1).max(21),
|
|
6
|
+
name: z.string().min(1).max(128),
|
|
7
|
+
description: z.string().max(256).nullable().optional(),
|
|
8
|
+
createdAt: z.number().optional(),
|
|
9
|
+
});
|
|
10
|
+
const guard = z.object({
|
|
11
|
+
tenantId: z.string().max(21),
|
|
12
|
+
id: z.string().min(1).max(21),
|
|
13
|
+
name: z.string().min(1).max(128),
|
|
14
|
+
description: z.string().max(256).nullable(),
|
|
15
|
+
createdAt: z.number(),
|
|
16
|
+
});
|
|
17
|
+
export const Organizations = Object.freeze({
|
|
18
|
+
table: 'organizations',
|
|
19
|
+
tableSingular: 'organization',
|
|
20
|
+
fields: {
|
|
21
|
+
tenantId: 'tenant_id',
|
|
22
|
+
id: 'id',
|
|
23
|
+
name: 'name',
|
|
24
|
+
description: 'description',
|
|
25
|
+
createdAt: 'created_at',
|
|
26
|
+
},
|
|
27
|
+
fieldKeys: [
|
|
28
|
+
'tenantId',
|
|
29
|
+
'id',
|
|
30
|
+
'name',
|
|
31
|
+
'description',
|
|
32
|
+
'createdAt',
|
|
33
|
+
],
|
|
34
|
+
createGuard,
|
|
35
|
+
guard,
|
|
36
|
+
updateGuard: guard.partial(),
|
|
37
|
+
});
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link Passcode} for the original type.
|
|
6
|
+
*/
|
|
2
7
|
export type CreatePasscode = {
|
|
3
8
|
tenantId?: string;
|
|
4
9
|
id: string;
|
|
@@ -23,4 +28,5 @@ export type Passcode = {
|
|
|
23
28
|
tryCount: number;
|
|
24
29
|
createdAt: number;
|
|
25
30
|
};
|
|
26
|
-
export
|
|
31
|
+
export type PasscodeKeys = 'tenantId' | 'id' | 'interactionJti' | 'phone' | 'email' | 'type' | 'code' | 'consumed' | 'tryCount' | 'createdAt';
|
|
32
|
+
export declare const Passcodes: GeneratedSchema<PasscodeKeys, CreatePasscode, Passcode, 'passcodes', 'passcode'>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link Resource} for the original type.
|
|
6
|
+
*/
|
|
2
7
|
export type CreateResource = {
|
|
3
8
|
tenantId?: string;
|
|
4
9
|
id: string;
|
|
@@ -15,4 +20,5 @@ export type Resource = {
|
|
|
15
20
|
isDefault: boolean;
|
|
16
21
|
accessTokenTtl: number;
|
|
17
22
|
};
|
|
18
|
-
export
|
|
23
|
+
export type ResourceKeys = 'tenantId' | 'id' | 'name' | 'indicator' | 'isDefault' | 'accessTokenTtl';
|
|
24
|
+
export declare const Resources: GeneratedSchema<ResourceKeys, CreateResource, Resource, 'resources', 'resource'>;
|
package/lib/db-entries/role.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
2
|
import { RoleType } from './custom-types.js';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link Role} for the original type.
|
|
7
|
+
*/
|
|
3
8
|
export type CreateRole = {
|
|
4
9
|
tenantId?: string;
|
|
5
10
|
id: string;
|
|
@@ -14,4 +19,5 @@ export type Role = {
|
|
|
14
19
|
description: string;
|
|
15
20
|
type: RoleType;
|
|
16
21
|
};
|
|
17
|
-
export
|
|
22
|
+
export type RoleKeys = 'tenantId' | 'id' | 'name' | 'description' | 'type';
|
|
23
|
+
export declare const Roles: GeneratedSchema<RoleKeys, CreateRole, Role, 'roles', 'role'>;
|
package/lib/db-entries/role.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link RolesScope} for the original type.
|
|
6
|
+
*/
|
|
2
7
|
export type CreateRolesScope = {
|
|
3
8
|
tenantId?: string;
|
|
4
9
|
id: string;
|
|
@@ -11,4 +16,5 @@ export type RolesScope = {
|
|
|
11
16
|
roleId: string;
|
|
12
17
|
scopeId: string;
|
|
13
18
|
};
|
|
14
|
-
export
|
|
19
|
+
export type RolesScopeKeys = 'tenantId' | 'id' | 'roleId' | 'scopeId';
|
|
20
|
+
export declare const RolesScopes: GeneratedSchema<RolesScopeKeys, CreateRolesScope, RolesScope, 'roles_scopes', 'roles_scope'>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link Scope} for the original type.
|
|
6
|
+
*/
|
|
2
7
|
export type CreateScope = {
|
|
3
8
|
tenantId?: string;
|
|
4
9
|
id: string;
|
|
@@ -15,4 +20,5 @@ export type Scope = {
|
|
|
15
20
|
description: string;
|
|
16
21
|
createdAt: number;
|
|
17
22
|
};
|
|
18
|
-
export
|
|
23
|
+
export type ScopeKeys = 'tenantId' | 'id' | 'resourceId' | 'name' | 'description' | 'createdAt';
|
|
24
|
+
export declare const Scopes: GeneratedSchema<ScopeKeys, CreateScope, Scope, 'scopes', 'scope'>;
|
package/lib/db-entries/scope.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { SentinelActivityTargetType, SentinelActivityAction, SentinelActivityPayload, GeneratedSchema } from './../foundations/index.js';
|
|
2
2
|
import { SentinelActionResult, SentinelDecision } from './custom-types.js';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link SentinelActivity} for the original type.
|
|
7
|
+
*/
|
|
3
8
|
export type CreateSentinelActivity = {
|
|
4
9
|
tenantId?: string;
|
|
5
10
|
id: string;
|
|
@@ -40,4 +45,5 @@ export type SentinelActivity = {
|
|
|
40
45
|
/** The time the activity was created. */
|
|
41
46
|
createdAt: number;
|
|
42
47
|
};
|
|
43
|
-
export
|
|
48
|
+
export type SentinelActivityKeys = 'tenantId' | 'id' | 'targetType' | 'targetHash' | 'action' | 'actionResult' | 'payload' | 'decision' | 'decisionExpiresAt' | 'createdAt';
|
|
49
|
+
export declare const SentinelActivities: GeneratedSchema<SentinelActivityKeys, CreateSentinelActivity, SentinelActivity, 'sentinel_activities', 'sentinel_activity'>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { JsonObject, GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link ServiceLog} for the original type.
|
|
6
|
+
*/
|
|
2
7
|
export type CreateServiceLog = {
|
|
3
8
|
id: string;
|
|
4
9
|
tenantId?: string;
|
|
@@ -13,4 +18,5 @@ export type ServiceLog = {
|
|
|
13
18
|
payload: JsonObject;
|
|
14
19
|
createdAt: number;
|
|
15
20
|
};
|
|
16
|
-
export
|
|
21
|
+
export type ServiceLogKeys = 'id' | 'tenantId' | 'type' | 'payload' | 'createdAt';
|
|
22
|
+
export declare const ServiceLogs: GeneratedSchema<ServiceLogKeys, CreateServiceLog, ServiceLog, 'service_logs', 'service_log'>;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Color, Branding, LanguageInfo, SignIn, SignUp, ConnectorTargets, CustomContent, PartialPasswordPolicy, Mfa, GeneratedSchema } from './../foundations/index.js';
|
|
2
2
|
import { SignInMode } from './custom-types.js';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link SignInExperience} for the original type.
|
|
7
|
+
*/
|
|
3
8
|
export type CreateSignInExperience = {
|
|
4
9
|
tenantId?: string;
|
|
5
10
|
id: string;
|
|
@@ -34,4 +39,5 @@ export type SignInExperience = {
|
|
|
34
39
|
passwordPolicy: PartialPasswordPolicy;
|
|
35
40
|
mfa: Mfa;
|
|
36
41
|
};
|
|
37
|
-
export
|
|
42
|
+
export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'signIn' | 'signUp' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'passwordPolicy' | 'mfa';
|
|
43
|
+
export declare const SignInExperiences: GeneratedSchema<SignInExperienceKeys, CreateSignInExperience, SignInExperience, 'sign_in_experiences', 'sign_in_experience'>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { JsonObject, SsoDomains, SsoBranding, GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link SsoConnector} for the original type.
|
|
6
|
+
*/
|
|
7
|
+
export type CreateSsoConnector = {
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
/** The globally unique identifier of the SSO connector. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** The connector factory name of the SSO provider. */
|
|
12
|
+
providerName: string;
|
|
13
|
+
/** The name of the SSO provider for display. */
|
|
14
|
+
connectorName: string;
|
|
15
|
+
/** The connector configuration. Different schemas for different provide type */
|
|
16
|
+
config?: JsonObject;
|
|
17
|
+
/** The SSO email domains. */
|
|
18
|
+
domains?: SsoDomains;
|
|
19
|
+
/** The SSO branding. */
|
|
20
|
+
branding?: SsoBranding;
|
|
21
|
+
/** Determines whether to synchronize the user's profile on each login. */
|
|
22
|
+
syncProfile?: boolean;
|
|
23
|
+
/** When the SSO connector was created. */
|
|
24
|
+
createdAt?: number;
|
|
25
|
+
};
|
|
26
|
+
export type SsoConnector = {
|
|
27
|
+
tenantId: string;
|
|
28
|
+
/** The globally unique identifier of the SSO connector. */
|
|
29
|
+
id: string;
|
|
30
|
+
/** The connector factory name of the SSO provider. */
|
|
31
|
+
providerName: string;
|
|
32
|
+
/** The name of the SSO provider for display. */
|
|
33
|
+
connectorName: string;
|
|
34
|
+
/** The connector configuration. Different schemas for different provide type */
|
|
35
|
+
config: JsonObject;
|
|
36
|
+
/** The SSO email domains. */
|
|
37
|
+
domains: SsoDomains;
|
|
38
|
+
/** The SSO branding. */
|
|
39
|
+
branding: SsoBranding;
|
|
40
|
+
/** Determines whether to synchronize the user's profile on each login. */
|
|
41
|
+
syncProfile: boolean;
|
|
42
|
+
/** When the SSO connector was created. */
|
|
43
|
+
createdAt: number;
|
|
44
|
+
};
|
|
45
|
+
export type SsoConnectorKeys = 'tenantId' | 'id' | 'providerName' | 'connectorName' | 'config' | 'domains' | 'branding' | 'syncProfile' | 'createdAt';
|
|
46
|
+
export declare const SsoConnectors: GeneratedSchema<SsoConnectorKeys, CreateSsoConnector, SsoConnector, 'sso_connectors', 'sso_connector'>;
|