@logto/schemas 1.10.0 → 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-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/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 +6 -6
- 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,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,50 @@
|
|
|
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
|
+
/** Determines whether SSO is the restricted sign-in method for users with the SSO registered email domains */
|
|
24
|
+
ssoOnly?: boolean;
|
|
25
|
+
/** When the SSO connector was created. */
|
|
26
|
+
createdAt?: number;
|
|
27
|
+
};
|
|
28
|
+
export type SsoConnector = {
|
|
29
|
+
tenantId: string;
|
|
30
|
+
/** The globally unique identifier of the SSO connector. */
|
|
31
|
+
id: string;
|
|
32
|
+
/** The connector factory name of the SSO provider. */
|
|
33
|
+
providerName: string;
|
|
34
|
+
/** The name of the SSO provider for display. */
|
|
35
|
+
connectorName: string;
|
|
36
|
+
/** The connector configuration. Different schemas for different provide type */
|
|
37
|
+
config: JsonObject;
|
|
38
|
+
/** The SSO email domains. */
|
|
39
|
+
domains: SsoDomains;
|
|
40
|
+
/** The SSO branding. */
|
|
41
|
+
branding: SsoBranding;
|
|
42
|
+
/** Determines whether to synchronize the user's profile on each login. */
|
|
43
|
+
syncProfile: boolean;
|
|
44
|
+
/** Determines whether SSO is the restricted sign-in method for users with the SSO registered email domains */
|
|
45
|
+
ssoOnly: boolean;
|
|
46
|
+
/** When the SSO connector was created. */
|
|
47
|
+
createdAt: number;
|
|
48
|
+
};
|
|
49
|
+
export type SsoConnectorKeys = 'tenantId' | 'id' | 'providerName' | 'connectorName' | 'config' | 'domains' | 'branding' | 'syncProfile' | 'ssoOnly' | 'createdAt';
|
|
50
|
+
export declare const SsoConnectors: GeneratedSchema<SsoConnectorKeys, CreateSsoConnector, SsoConnector, 'sso_connectors', 'sso_connector'>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { jsonObjectGuard, ssoDomainsGuard, ssoBrandingGuard } 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
|
+
providerName: z.string().min(1).max(128),
|
|
8
|
+
connectorName: z.string().min(1).max(128),
|
|
9
|
+
config: jsonObjectGuard.optional(),
|
|
10
|
+
domains: ssoDomainsGuard.optional(),
|
|
11
|
+
branding: ssoBrandingGuard.optional(),
|
|
12
|
+
syncProfile: z.boolean().optional(),
|
|
13
|
+
ssoOnly: z.boolean().optional(),
|
|
14
|
+
createdAt: z.number().optional(),
|
|
15
|
+
});
|
|
16
|
+
const guard = z.object({
|
|
17
|
+
tenantId: z.string().max(21),
|
|
18
|
+
id: z.string().min(1).max(128),
|
|
19
|
+
providerName: z.string().min(1).max(128),
|
|
20
|
+
connectorName: z.string().min(1).max(128),
|
|
21
|
+
config: jsonObjectGuard,
|
|
22
|
+
domains: ssoDomainsGuard,
|
|
23
|
+
branding: ssoBrandingGuard,
|
|
24
|
+
syncProfile: z.boolean(),
|
|
25
|
+
ssoOnly: z.boolean(),
|
|
26
|
+
createdAt: z.number(),
|
|
27
|
+
});
|
|
28
|
+
export const SsoConnectors = Object.freeze({
|
|
29
|
+
table: 'sso_connectors',
|
|
30
|
+
tableSingular: 'sso_connector',
|
|
31
|
+
fields: {
|
|
32
|
+
tenantId: 'tenant_id',
|
|
33
|
+
id: 'id',
|
|
34
|
+
providerName: 'provider_name',
|
|
35
|
+
connectorName: 'connector_name',
|
|
36
|
+
config: 'config',
|
|
37
|
+
domains: 'domains',
|
|
38
|
+
branding: 'branding',
|
|
39
|
+
syncProfile: 'sync_profile',
|
|
40
|
+
ssoOnly: 'sso_only',
|
|
41
|
+
createdAt: 'created_at',
|
|
42
|
+
},
|
|
43
|
+
fieldKeys: [
|
|
44
|
+
'tenantId',
|
|
45
|
+
'id',
|
|
46
|
+
'providerName',
|
|
47
|
+
'connectorName',
|
|
48
|
+
'config',
|
|
49
|
+
'domains',
|
|
50
|
+
'branding',
|
|
51
|
+
'syncProfile',
|
|
52
|
+
'ssoOnly',
|
|
53
|
+
'createdAt',
|
|
54
|
+
],
|
|
55
|
+
createGuard,
|
|
56
|
+
guard,
|
|
57
|
+
updateGuard: guard.partial(),
|
|
58
|
+
});
|
|
@@ -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 System} for the original type.
|
|
6
|
+
*/
|
|
2
7
|
export type CreateSystem = {
|
|
3
8
|
key: string;
|
|
4
9
|
value?: JsonObject;
|
|
@@ -7,4 +12,5 @@ export type System = {
|
|
|
7
12
|
key: string;
|
|
8
13
|
value: JsonObject;
|
|
9
14
|
};
|
|
10
|
-
export
|
|
15
|
+
export type SystemKeys = 'key' | 'value';
|
|
16
|
+
export declare const Systems: GeneratedSchema<SystemKeys, CreateSystem, System, 'systems', 'system'>;
|
package/lib/db-entries/system.js
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { JsonObject, GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link UserSsoIdentity} for the original type.
|
|
6
|
+
*/
|
|
7
|
+
export type CreateUserSsoIdentity = {
|
|
8
|
+
tenantId?: string;
|
|
9
|
+
id: string;
|
|
10
|
+
userId: string;
|
|
11
|
+
/** Unique provider identifier. Issuer of the OIDC connectors, entityId of the SAML providers */
|
|
12
|
+
issuer: string;
|
|
13
|
+
/** Provider user identity id */
|
|
14
|
+
identityId: string;
|
|
15
|
+
detail?: JsonObject;
|
|
16
|
+
createdAt?: number;
|
|
17
|
+
};
|
|
18
|
+
export type UserSsoIdentity = {
|
|
19
|
+
tenantId: string;
|
|
20
|
+
id: string;
|
|
21
|
+
userId: string;
|
|
22
|
+
/** Unique provider identifier. Issuer of the OIDC connectors, entityId of the SAML providers */
|
|
23
|
+
issuer: string;
|
|
24
|
+
/** Provider user identity id */
|
|
25
|
+
identityId: string;
|
|
26
|
+
detail: JsonObject;
|
|
27
|
+
createdAt: number;
|
|
28
|
+
};
|
|
29
|
+
export type UserSsoIdentityKeys = 'tenantId' | 'id' | 'userId' | 'issuer' | 'identityId' | 'detail' | 'createdAt';
|
|
30
|
+
export declare const UserSsoIdentities: GeneratedSchema<UserSsoIdentityKeys, CreateUserSsoIdentity, UserSsoIdentity, 'user_sso_identities', 'user_sso_identity'>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { jsonObjectGuard } 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
|
+
userId: z.string().min(1).max(12),
|
|
8
|
+
issuer: z.string().min(1).max(256),
|
|
9
|
+
identityId: z.string().min(1).max(128),
|
|
10
|
+
detail: jsonObjectGuard.optional(),
|
|
11
|
+
createdAt: z.number().optional(),
|
|
12
|
+
});
|
|
13
|
+
const guard = z.object({
|
|
14
|
+
tenantId: z.string().max(21),
|
|
15
|
+
id: z.string().min(1).max(21),
|
|
16
|
+
userId: z.string().min(1).max(12),
|
|
17
|
+
issuer: z.string().min(1).max(256),
|
|
18
|
+
identityId: z.string().min(1).max(128),
|
|
19
|
+
detail: jsonObjectGuard,
|
|
20
|
+
createdAt: z.number(),
|
|
21
|
+
});
|
|
22
|
+
export const UserSsoIdentities = Object.freeze({
|
|
23
|
+
table: 'user_sso_identities',
|
|
24
|
+
tableSingular: 'user_sso_identity',
|
|
25
|
+
fields: {
|
|
26
|
+
tenantId: 'tenant_id',
|
|
27
|
+
id: 'id',
|
|
28
|
+
userId: 'user_id',
|
|
29
|
+
issuer: 'issuer',
|
|
30
|
+
identityId: 'identity_id',
|
|
31
|
+
detail: 'detail',
|
|
32
|
+
createdAt: 'created_at',
|
|
33
|
+
},
|
|
34
|
+
fieldKeys: [
|
|
35
|
+
'tenantId',
|
|
36
|
+
'id',
|
|
37
|
+
'userId',
|
|
38
|
+
'issuer',
|
|
39
|
+
'identityId',
|
|
40
|
+
'detail',
|
|
41
|
+
'createdAt',
|
|
42
|
+
],
|
|
43
|
+
createGuard,
|
|
44
|
+
guard,
|
|
45
|
+
updateGuard: guard.partial(),
|
|
46
|
+
});
|