@logto/schemas 1.17.0 → 1.18.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.18.0-1717567857-social-sign-in-linking.ts +18 -0
- package/alterations/1.18.0-1717597875-add-organization-email-domains-table.ts +31 -0
- package/alterations/1.18.0-1717818597-organization-mfa-requirement.ts +18 -0
- package/alterations/1.18.0-1718340884-rename-org-email-domains-and-add-jit-roles-table.ts +56 -0
- package/alterations/1.18.0-1718594164-add-agree-to-terms-policy.ts +40 -0
- package/alterations/1.18.0-1718785576-organization-application-relations.ts +37 -0
- package/alterations/1.18.0-1718786576-organization-jit-sso-connectors.ts +31 -0
- package/alterations/1.18.0-1718807616-organization-role-application-relations.ts +34 -0
- package/alterations/1.18.0-1718865814-add-subject-tokens.ts +36 -0
- package/alterations/1.18.0-1719014832-organization-role-types.ts +35 -0
- package/alterations/1.18.0-1719221205-fix-functions.ts +25 -0
- package/alterations/1.18.0-1719312694-custom-ui-assets.ts +18 -0
- package/alterations-js/1.18.0-1717567857-social-sign-in-linking.d.ts +3 -0
- package/alterations-js/1.18.0-1717567857-social-sign-in-linking.js +14 -0
- package/alterations-js/1.18.0-1717597875-add-organization-email-domains-table.d.ts +3 -0
- package/alterations-js/1.18.0-1717597875-add-organization-email-domains-table.js +26 -0
- package/alterations-js/1.18.0-1717818597-organization-mfa-requirement.d.ts +3 -0
- package/alterations-js/1.18.0-1717818597-organization-mfa-requirement.js +14 -0
- package/alterations-js/1.18.0-1718340884-rename-org-email-domains-and-add-jit-roles-table.d.ts +3 -0
- package/alterations-js/1.18.0-1718340884-rename-org-email-domains-and-add-jit-roles-table.js +51 -0
- package/alterations-js/1.18.0-1718594164-add-agree-to-terms-policy.d.ts +3 -0
- package/alterations-js/1.18.0-1718594164-add-agree-to-terms-policy.js +34 -0
- package/alterations-js/1.18.0-1718785576-organization-application-relations.d.ts +3 -0
- package/alterations-js/1.18.0-1718785576-organization-application-relations.js +32 -0
- package/alterations-js/1.18.0-1718786576-organization-jit-sso-connectors.d.ts +3 -0
- package/alterations-js/1.18.0-1718786576-organization-jit-sso-connectors.js +26 -0
- package/alterations-js/1.18.0-1718807616-organization-role-application-relations.d.ts +3 -0
- package/alterations-js/1.18.0-1718807616-organization-role-application-relations.js +29 -0
- package/alterations-js/1.18.0-1718865814-add-subject-tokens.d.ts +3 -0
- package/alterations-js/1.18.0-1718865814-add-subject-tokens.js +31 -0
- package/alterations-js/1.18.0-1719014832-organization-role-types.d.ts +3 -0
- package/alterations-js/1.18.0-1719014832-organization-role-types.js +31 -0
- package/alterations-js/1.18.0-1719221205-fix-functions.d.ts +7 -0
- package/alterations-js/1.18.0-1719221205-fix-functions.js +20 -0
- package/alterations-js/1.18.0-1719312694-custom-ui-assets.d.ts +3 -0
- package/alterations-js/1.18.0-1719312694-custom-ui-assets.js +14 -0
- package/lib/consts/subscriptions.d.ts +9 -6
- package/lib/consts/subscriptions.js +8 -5
- package/lib/db-entries/custom-types.d.ts +5 -0
- package/lib/db-entries/custom-types.js +6 -0
- package/lib/db-entries/index.d.ts +6 -0
- package/lib/db-entries/index.js +6 -0
- package/lib/db-entries/organization-application-relation.d.ts +20 -0
- package/lib/db-entries/organization-application-relation.js +29 -0
- package/lib/db-entries/organization-jit-email-domain.d.ts +24 -0
- package/lib/db-entries/organization-jit-email-domain.js +29 -0
- package/lib/db-entries/organization-jit-role.d.ts +24 -0
- package/lib/db-entries/organization-jit-role.js +29 -0
- package/lib/db-entries/organization-jit-sso-connector.d.ts +22 -0
- package/lib/db-entries/organization-jit-sso-connector.js +29 -0
- package/lib/db-entries/organization-role-application-relation.d.ts +22 -0
- package/lib/db-entries/organization-role-application-relation.js +33 -0
- package/lib/db-entries/organization-role.d.ts +6 -1
- package/lib/db-entries/organization-role.js +5 -0
- package/lib/db-entries/organization.d.ts +5 -1
- package/lib/db-entries/organization.js +4 -0
- package/lib/db-entries/sign-in-experience.d.ts +11 -3
- package/lib/db-entries/sign-in-experience.js +14 -2
- package/lib/db-entries/subject-token.d.ts +28 -0
- package/lib/db-entries/subject-token.js +50 -0
- package/lib/foundations/jsonb-types/hooks.d.ts +0 -4
- package/lib/foundations/jsonb-types/hooks.js +1 -4
- package/lib/foundations/jsonb-types/oidc-module.d.ts +33 -1
- package/lib/foundations/jsonb-types/oidc-module.js +2 -0
- package/lib/foundations/jsonb-types/sign-in-experience.d.ts +14 -0
- package/lib/foundations/jsonb-types/sign-in-experience.js +3 -0
- package/lib/seeds/sign-in-experience.js +1 -0
- package/lib/types/application.d.ts +7 -47
- package/lib/types/connector.d.ts +724 -190
- package/lib/types/consent.d.ts +1 -9
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +2 -0
- package/lib/types/interactions.d.ts +141 -6
- package/lib/types/interactions.js +62 -8
- package/lib/types/log/token.d.ts +2 -1
- package/lib/types/log/token.js +1 -0
- package/lib/types/logto-config/index.d.ts +10 -0
- package/lib/types/logto-config/jwt-customizer.d.ts +174 -137
- package/lib/types/logto-config/jwt-customizer.js +2 -1
- package/lib/types/oidc-config.d.ts +2 -1
- package/lib/types/oidc-config.js +1 -0
- package/lib/types/organization.d.ts +12 -3
- package/lib/types/organization.js +4 -1
- package/lib/types/role.d.ts +6 -1
- package/lib/types/role.js +6 -1
- package/lib/types/sign-in-experience.d.ts +1064 -0
- package/lib/types/sign-in-experience.js +21 -0
- package/lib/types/subject-token.d.ts +12 -0
- package/lib/types/subject-token.js +5 -0
- package/lib/types/system.d.ts +4 -4
- package/lib/types/tenant-organization.d.ts +1 -0
- package/lib/types/tenant-organization.js +3 -0
- package/lib/utils/zod.d.ts +1 -1
- package/package.json +4 -4
- package/tables/applications.sql +5 -0
- package/tables/organization_application_relations.sql +14 -0
- package/tables/organization_jit_email_domains.sql +13 -0
- package/tables/organization_jit_roles.sql +14 -0
- package/tables/organization_jit_sso_connectors.sql +13 -0
- package/tables/organization_role_application_relations.sql +18 -0
- package/tables/organization_role_user_relations.sql +3 -1
- package/tables/organization_roles.sql +8 -1
- package/tables/organizations.sql +2 -0
- package/tables/sign_in_experiences.sql +5 -0
- package/tables/subject_tokens.sql +16 -0
|
@@ -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 organization_role_application_relations (
|
|
7
|
+
tenant_id varchar(21) not null
|
|
8
|
+
references tenants (id) on update cascade on delete cascade,
|
|
9
|
+
organization_id varchar(21) not null,
|
|
10
|
+
organization_role_id varchar(21) not null
|
|
11
|
+
references organization_roles (id) on update cascade on delete cascade,
|
|
12
|
+
application_id varchar(21) not null,
|
|
13
|
+
primary key (tenant_id, organization_id, organization_role_id, application_id),
|
|
14
|
+
/** Application's roles in an organization should be synchronized with the application's membership in the organization. */
|
|
15
|
+
foreign key (tenant_id, organization_id, application_id)
|
|
16
|
+
references organization_application_relations (tenant_id, organization_id, application_id)
|
|
17
|
+
on update cascade on delete cascade
|
|
18
|
+
);
|
|
19
|
+
`);
|
|
20
|
+
await applyTableRls(pool, 'organization_role_application_relations');
|
|
21
|
+
},
|
|
22
|
+
down: async (pool) => {
|
|
23
|
+
await dropTableRls(pool, 'organization_role_application_relations');
|
|
24
|
+
await pool.query(sql `
|
|
25
|
+
drop table organization_role_application_relations;
|
|
26
|
+
`);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
export default alteration;
|
|
@@ -0,0 +1,31 @@
|
|
|
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 subject_tokens (
|
|
7
|
+
tenant_id varchar(21) not null
|
|
8
|
+
references tenants (id) on update cascade on delete cascade,
|
|
9
|
+
id varchar(25) not null,
|
|
10
|
+
context jsonb /* @use JsonObject */ not null default '{}'::jsonb,
|
|
11
|
+
expires_at timestamptz not null,
|
|
12
|
+
consumed_at timestamptz,
|
|
13
|
+
user_id varchar(21) not null
|
|
14
|
+
references users (id) on update cascade on delete cascade,
|
|
15
|
+
created_at timestamptz not null default(now()),
|
|
16
|
+
creator_id varchar(32) not null, /* It is intented to not reference to user or application table */
|
|
17
|
+
primary key (id)
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
create index subject_token__id on subject_tokens (tenant_id, id);
|
|
21
|
+
`);
|
|
22
|
+
await applyTableRls(pool, 'subject_tokens');
|
|
23
|
+
},
|
|
24
|
+
down: async (pool) => {
|
|
25
|
+
await dropTableRls(pool, 'subject_tokens');
|
|
26
|
+
await pool.query(sql `
|
|
27
|
+
drop table subject_tokens
|
|
28
|
+
`);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export default alteration;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { sql } from '@silverhand/slonik';
|
|
2
|
+
const alteration = {
|
|
3
|
+
up: async (pool) => {
|
|
4
|
+
await pool.query(sql `
|
|
5
|
+
alter table organization_roles
|
|
6
|
+
add column type role_type not null default 'User';
|
|
7
|
+
create function check_organization_role_type(role_id varchar(21), target_type role_type) returns boolean as
|
|
8
|
+
$$ begin
|
|
9
|
+
return (select type from organization_roles where id = role_id) = target_type;
|
|
10
|
+
end; $$ language plpgsql;
|
|
11
|
+
alter table organization_role_user_relations
|
|
12
|
+
add constraint organization_role_user_relations__role_type
|
|
13
|
+
check (check_organization_role_type(organization_role_id, 'User'));
|
|
14
|
+
alter table organization_role_application_relations
|
|
15
|
+
add constraint organization_role_application_relations__role_type
|
|
16
|
+
check (check_organization_role_type(organization_role_id, 'MachineToMachine'));
|
|
17
|
+
`);
|
|
18
|
+
},
|
|
19
|
+
down: async (pool) => {
|
|
20
|
+
await pool.query(sql `
|
|
21
|
+
alter table organization_role_application_relations
|
|
22
|
+
drop constraint organization_role_application_relations__role_type;
|
|
23
|
+
alter table organization_role_user_relations
|
|
24
|
+
drop constraint organization_role_user_relations__role_type;
|
|
25
|
+
alter table organization_roles
|
|
26
|
+
drop column type;
|
|
27
|
+
drop function check_organization_role_type;
|
|
28
|
+
`);
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
export default alteration;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In Logto Cloud, we have multiple schemas and the default search behavior will be problematic.
|
|
3
|
+
* This alteration script will fix it by setting the search path to public for the functions.
|
|
4
|
+
*/
|
|
5
|
+
import type { AlterationScript } from '../lib/types/alteration.js';
|
|
6
|
+
declare const alteration: AlterationScript;
|
|
7
|
+
export default alteration;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In Logto Cloud, we have multiple schemas and the default search behavior will be problematic.
|
|
3
|
+
* This alteration script will fix it by setting the search path to public for the functions.
|
|
4
|
+
*/
|
|
5
|
+
import { sql } from '@silverhand/slonik';
|
|
6
|
+
const alteration = {
|
|
7
|
+
up: async (pool) => {
|
|
8
|
+
await pool.query(sql `
|
|
9
|
+
alter function check_application_type set search_path = public;
|
|
10
|
+
alter function check_organization_role_type set search_path = public;
|
|
11
|
+
`);
|
|
12
|
+
},
|
|
13
|
+
down: async (pool) => {
|
|
14
|
+
await pool.query(sql `
|
|
15
|
+
alter function check_application_type reset search_path;
|
|
16
|
+
alter function check_organization_role_type reset search_path;
|
|
17
|
+
`);
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
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
|
+
alter table sign_in_experiences add column custom_ui_asset_id varchar(21);
|
|
6
|
+
`);
|
|
7
|
+
},
|
|
8
|
+
down: async (pool) => {
|
|
9
|
+
await pool.query(sql `
|
|
10
|
+
alter table sign_in_experiences drop column custom_ui_asset_id;
|
|
11
|
+
`);
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
export default alteration;
|
|
@@ -17,13 +17,16 @@ export declare enum ReservedPlanId {
|
|
|
17
17
|
* - LOG-8339: Migrate legacy Stripe data
|
|
18
18
|
*/
|
|
19
19
|
Hobby = "hobby",
|
|
20
|
+
Pro = "pro",
|
|
20
21
|
/**
|
|
21
22
|
* @deprecated
|
|
22
|
-
*
|
|
23
|
-
* Only use this `pro` value when displaying the plan ID to the user.
|
|
24
|
-
*
|
|
25
|
-
* Todo @darcyYe see `Hobby` todo
|
|
23
|
+
* Should not use this plan ID, we only use this tag as a record for the legacy `pro` plan since we will rename the `hobby` plan to be `pro`.
|
|
26
24
|
*/
|
|
27
|
-
|
|
28
|
-
Development = "dev"
|
|
25
|
+
GrandfatheredPro = "grandfathered-pro",
|
|
26
|
+
Development = "dev",
|
|
27
|
+
/**
|
|
28
|
+
* This plan ID is reserved for Admin tenant.
|
|
29
|
+
* In our new pricing model, we plan to add a special plan for Admin tenant, previously, admin tenant is using the `pro` plan, which is not suitable.
|
|
30
|
+
*/
|
|
31
|
+
Admin = "admin"
|
|
29
32
|
}
|
|
@@ -18,13 +18,16 @@ export var ReservedPlanId;
|
|
|
18
18
|
* - LOG-8339: Migrate legacy Stripe data
|
|
19
19
|
*/
|
|
20
20
|
ReservedPlanId["Hobby"] = "hobby";
|
|
21
|
+
ReservedPlanId["Pro"] = "pro";
|
|
21
22
|
/**
|
|
22
23
|
* @deprecated
|
|
23
|
-
*
|
|
24
|
-
* Only use this `pro` value when displaying the plan ID to the user.
|
|
25
|
-
*
|
|
26
|
-
* Todo @darcyYe see `Hobby` todo
|
|
24
|
+
* Should not use this plan ID, we only use this tag as a record for the legacy `pro` plan since we will rename the `hobby` plan to be `pro`.
|
|
27
25
|
*/
|
|
28
|
-
ReservedPlanId["
|
|
26
|
+
ReservedPlanId["GrandfatheredPro"] = "grandfathered-pro";
|
|
29
27
|
ReservedPlanId["Development"] = "dev";
|
|
28
|
+
/**
|
|
29
|
+
* This plan ID is reserved for Admin tenant.
|
|
30
|
+
* In our new pricing model, we plan to add a special plan for Admin tenant, previously, admin tenant is using the `pro` plan, which is not suitable.
|
|
31
|
+
*/
|
|
32
|
+
ReservedPlanId["Admin"] = "admin";
|
|
30
33
|
})(ReservedPlanId || (ReservedPlanId = {}));
|
|
@@ -30,6 +30,11 @@ export declare enum SignInMode {
|
|
|
30
30
|
Register = "Register",
|
|
31
31
|
SignInAndRegister = "SignInAndRegister"
|
|
32
32
|
}
|
|
33
|
+
export declare enum AgreeToTermsPolicy {
|
|
34
|
+
Automatic = "Automatic",
|
|
35
|
+
ManualRegistrationOnly = "ManualRegistrationOnly",
|
|
36
|
+
Manual = "Manual"
|
|
37
|
+
}
|
|
33
38
|
export declare enum UsersPasswordEncryptionMethod {
|
|
34
39
|
Argon2i = "Argon2i",
|
|
35
40
|
SHA1 = "SHA1",
|
|
@@ -37,6 +37,12 @@ export var SignInMode;
|
|
|
37
37
|
SignInMode["Register"] = "Register";
|
|
38
38
|
SignInMode["SignInAndRegister"] = "SignInAndRegister";
|
|
39
39
|
})(SignInMode || (SignInMode = {}));
|
|
40
|
+
export var AgreeToTermsPolicy;
|
|
41
|
+
(function (AgreeToTermsPolicy) {
|
|
42
|
+
AgreeToTermsPolicy["Automatic"] = "Automatic";
|
|
43
|
+
AgreeToTermsPolicy["ManualRegistrationOnly"] = "ManualRegistrationOnly";
|
|
44
|
+
AgreeToTermsPolicy["Manual"] = "Manual";
|
|
45
|
+
})(AgreeToTermsPolicy || (AgreeToTermsPolicy = {}));
|
|
40
46
|
export var UsersPasswordEncryptionMethod;
|
|
41
47
|
(function (UsersPasswordEncryptionMethod) {
|
|
42
48
|
UsersPasswordEncryptionMethod["Argon2i"] = "Argon2i";
|
|
@@ -20,8 +20,13 @@ export * from './hook.js';
|
|
|
20
20
|
export * from './log.js';
|
|
21
21
|
export * from './logto-config.js';
|
|
22
22
|
export * from './oidc-model-instance.js';
|
|
23
|
+
export * from './organization-application-relation.js';
|
|
23
24
|
export * from './organization-invitation-role-relation.js';
|
|
24
25
|
export * from './organization-invitation.js';
|
|
26
|
+
export * from './organization-jit-email-domain.js';
|
|
27
|
+
export * from './organization-jit-role.js';
|
|
28
|
+
export * from './organization-jit-sso-connector.js';
|
|
29
|
+
export * from './organization-role-application-relation.js';
|
|
25
30
|
export * from './organization-role-resource-scope-relation.js';
|
|
26
31
|
export * from './organization-role-scope-relation.js';
|
|
27
32
|
export * from './organization-role-user-relation.js';
|
|
@@ -38,6 +43,7 @@ export * from './sentinel-activity.js';
|
|
|
38
43
|
export * from './service-log.js';
|
|
39
44
|
export * from './sign-in-experience.js';
|
|
40
45
|
export * from './sso-connector.js';
|
|
46
|
+
export * from './subject-token.js';
|
|
41
47
|
export * from './system.js';
|
|
42
48
|
export * from './user-sso-identity.js';
|
|
43
49
|
export * from './user.js';
|
package/lib/db-entries/index.js
CHANGED
|
@@ -21,8 +21,13 @@ export * from './hook.js';
|
|
|
21
21
|
export * from './log.js';
|
|
22
22
|
export * from './logto-config.js';
|
|
23
23
|
export * from './oidc-model-instance.js';
|
|
24
|
+
export * from './organization-application-relation.js';
|
|
24
25
|
export * from './organization-invitation-role-relation.js';
|
|
25
26
|
export * from './organization-invitation.js';
|
|
27
|
+
export * from './organization-jit-email-domain.js';
|
|
28
|
+
export * from './organization-jit-role.js';
|
|
29
|
+
export * from './organization-jit-sso-connector.js';
|
|
30
|
+
export * from './organization-role-application-relation.js';
|
|
26
31
|
export * from './organization-role-resource-scope-relation.js';
|
|
27
32
|
export * from './organization-role-scope-relation.js';
|
|
28
33
|
export * from './organization-role-user-relation.js';
|
|
@@ -39,6 +44,7 @@ export * from './sentinel-activity.js';
|
|
|
39
44
|
export * from './service-log.js';
|
|
40
45
|
export * from './sign-in-experience.js';
|
|
41
46
|
export * from './sso-connector.js';
|
|
47
|
+
export * from './subject-token.js';
|
|
42
48
|
export * from './system.js';
|
|
43
49
|
export * from './user-sso-identity.js';
|
|
44
50
|
export * from './user.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The relations between organizations and applications. It indicates membership of applications in organizations. For now only machine-to-machine applications are supported.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link OrganizationApplicationRelation} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganizationApplicationRelation = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
organizationId: string;
|
|
11
|
+
applicationId: string;
|
|
12
|
+
};
|
|
13
|
+
/** The relations between organizations and applications. It indicates membership of applications in organizations. For now only machine-to-machine applications are supported. */
|
|
14
|
+
export type OrganizationApplicationRelation = {
|
|
15
|
+
tenantId: string;
|
|
16
|
+
organizationId: string;
|
|
17
|
+
applicationId: string;
|
|
18
|
+
};
|
|
19
|
+
export type OrganizationApplicationRelationKeys = 'tenantId' | 'organizationId' | 'applicationId';
|
|
20
|
+
export declare const OrganizationApplicationRelations: GeneratedSchema<OrganizationApplicationRelationKeys, CreateOrganizationApplicationRelation, OrganizationApplicationRelation, 'organization_application_relations', 'organization_application_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
|
+
applicationId: 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
|
+
applicationId: z.string().min(1).max(21),
|
|
12
|
+
});
|
|
13
|
+
export const OrganizationApplicationRelations = Object.freeze({
|
|
14
|
+
table: 'organization_application_relations',
|
|
15
|
+
tableSingular: 'organization_application_relation',
|
|
16
|
+
fields: {
|
|
17
|
+
tenantId: 'tenant_id',
|
|
18
|
+
organizationId: 'organization_id',
|
|
19
|
+
applicationId: 'application_id',
|
|
20
|
+
},
|
|
21
|
+
fieldKeys: [
|
|
22
|
+
'tenantId',
|
|
23
|
+
'organizationId',
|
|
24
|
+
'applicationId',
|
|
25
|
+
],
|
|
26
|
+
createGuard,
|
|
27
|
+
guard,
|
|
28
|
+
updateGuard: guard.partial(),
|
|
29
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The email domains that will automatically assign users into an organization when they sign up or are added through the Management API.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link OrganizationJitEmailDomain} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganizationJitEmailDomain = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
/** The ID of the organization. */
|
|
11
|
+
organizationId: string;
|
|
12
|
+
/** The email domain that will be automatically provisioned. */
|
|
13
|
+
emailDomain: string;
|
|
14
|
+
};
|
|
15
|
+
/** The email domains that will automatically assign users into an organization when they sign up or are added through the Management API. */
|
|
16
|
+
export type OrganizationJitEmailDomain = {
|
|
17
|
+
tenantId: string;
|
|
18
|
+
/** The ID of the organization. */
|
|
19
|
+
organizationId: string;
|
|
20
|
+
/** The email domain that will be automatically provisioned. */
|
|
21
|
+
emailDomain: string;
|
|
22
|
+
};
|
|
23
|
+
export type OrganizationJitEmailDomainKeys = 'tenantId' | 'organizationId' | 'emailDomain';
|
|
24
|
+
export declare const OrganizationJitEmailDomains: GeneratedSchema<OrganizationJitEmailDomainKeys, CreateOrganizationJitEmailDomain, OrganizationJitEmailDomain, 'organization_jit_email_domains', 'organization_jit_email_domain'>;
|
|
@@ -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
|
+
emailDomain: z.string().min(1).max(128),
|
|
7
|
+
});
|
|
8
|
+
const guard = z.object({
|
|
9
|
+
tenantId: z.string().max(21),
|
|
10
|
+
organizationId: z.string().min(1).max(21),
|
|
11
|
+
emailDomain: z.string().min(1).max(128),
|
|
12
|
+
});
|
|
13
|
+
export const OrganizationJitEmailDomains = Object.freeze({
|
|
14
|
+
table: 'organization_jit_email_domains',
|
|
15
|
+
tableSingular: 'organization_jit_email_domain',
|
|
16
|
+
fields: {
|
|
17
|
+
tenantId: 'tenant_id',
|
|
18
|
+
organizationId: 'organization_id',
|
|
19
|
+
emailDomain: 'email_domain',
|
|
20
|
+
},
|
|
21
|
+
fieldKeys: [
|
|
22
|
+
'tenantId',
|
|
23
|
+
'organizationId',
|
|
24
|
+
'emailDomain',
|
|
25
|
+
],
|
|
26
|
+
createGuard,
|
|
27
|
+
guard,
|
|
28
|
+
updateGuard: guard.partial(),
|
|
29
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The organization roles that will be automatically provisioned to users when they join an organization through JIT.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link OrganizationJitRole} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganizationJitRole = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
/** The ID of the organization. */
|
|
11
|
+
organizationId: string;
|
|
12
|
+
/** The organization role ID that will be automatically provisioned. */
|
|
13
|
+
organizationRoleId: string;
|
|
14
|
+
};
|
|
15
|
+
/** The organization roles that will be automatically provisioned to users when they join an organization through JIT. */
|
|
16
|
+
export type OrganizationJitRole = {
|
|
17
|
+
tenantId: string;
|
|
18
|
+
/** The ID of the organization. */
|
|
19
|
+
organizationId: string;
|
|
20
|
+
/** The organization role ID that will be automatically provisioned. */
|
|
21
|
+
organizationRoleId: string;
|
|
22
|
+
};
|
|
23
|
+
export type OrganizationJitRoleKeys = 'tenantId' | 'organizationId' | 'organizationRoleId';
|
|
24
|
+
export declare const OrganizationJitRoles: GeneratedSchema<OrganizationJitRoleKeys, CreateOrganizationJitRole, OrganizationJitRole, 'organization_jit_roles', 'organization_jit_role'>;
|
|
@@ -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
|
+
organizationRoleId: 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
|
+
organizationRoleId: z.string().min(1).max(21),
|
|
12
|
+
});
|
|
13
|
+
export const OrganizationJitRoles = Object.freeze({
|
|
14
|
+
table: 'organization_jit_roles',
|
|
15
|
+
tableSingular: 'organization_jit_role',
|
|
16
|
+
fields: {
|
|
17
|
+
tenantId: 'tenant_id',
|
|
18
|
+
organizationId: 'organization_id',
|
|
19
|
+
organizationRoleId: 'organization_role_id',
|
|
20
|
+
},
|
|
21
|
+
fieldKeys: [
|
|
22
|
+
'tenantId',
|
|
23
|
+
'organizationId',
|
|
24
|
+
'organizationRoleId',
|
|
25
|
+
],
|
|
26
|
+
createGuard,
|
|
27
|
+
guard,
|
|
28
|
+
updateGuard: guard.partial(),
|
|
29
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The enterprise SSO connectors that will automatically assign users into an organization when they are authenticated via the SSO connector for the first time.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link OrganizationJitSsoConnector} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganizationJitSsoConnector = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
/** The ID of the organization. */
|
|
11
|
+
organizationId: string;
|
|
12
|
+
ssoConnectorId: string;
|
|
13
|
+
};
|
|
14
|
+
/** The enterprise SSO connectors that will automatically assign users into an organization when they are authenticated via the SSO connector for the first time. */
|
|
15
|
+
export type OrganizationJitSsoConnector = {
|
|
16
|
+
tenantId: string;
|
|
17
|
+
/** The ID of the organization. */
|
|
18
|
+
organizationId: string;
|
|
19
|
+
ssoConnectorId: string;
|
|
20
|
+
};
|
|
21
|
+
export type OrganizationJitSsoConnectorKeys = 'tenantId' | 'organizationId' | 'ssoConnectorId';
|
|
22
|
+
export declare const OrganizationJitSsoConnectors: GeneratedSchema<OrganizationJitSsoConnectorKeys, CreateOrganizationJitSsoConnector, OrganizationJitSsoConnector, 'organization_jit_sso_connectors', 'organization_jit_sso_connector'>;
|
|
@@ -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
|
+
ssoConnectorId: z.string().min(1).max(128),
|
|
7
|
+
});
|
|
8
|
+
const guard = z.object({
|
|
9
|
+
tenantId: z.string().max(21),
|
|
10
|
+
organizationId: z.string().min(1).max(21),
|
|
11
|
+
ssoConnectorId: z.string().min(1).max(128),
|
|
12
|
+
});
|
|
13
|
+
export const OrganizationJitSsoConnectors = Object.freeze({
|
|
14
|
+
table: 'organization_jit_sso_connectors',
|
|
15
|
+
tableSingular: 'organization_jit_sso_connector',
|
|
16
|
+
fields: {
|
|
17
|
+
tenantId: 'tenant_id',
|
|
18
|
+
organizationId: 'organization_id',
|
|
19
|
+
ssoConnectorId: 'sso_connector_id',
|
|
20
|
+
},
|
|
21
|
+
fieldKeys: [
|
|
22
|
+
'tenantId',
|
|
23
|
+
'organizationId',
|
|
24
|
+
'ssoConnectorId',
|
|
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 applications. A relation means that an application has a role in an organization.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link OrganizationRoleApplicationRelation} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganizationRoleApplicationRelation = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
organizationId: string;
|
|
11
|
+
organizationRoleId: string;
|
|
12
|
+
applicationId: string;
|
|
13
|
+
};
|
|
14
|
+
/** The relations between organizations, organization roles, and applications. A relation means that an application has a role in an organization. */
|
|
15
|
+
export type OrganizationRoleApplicationRelation = {
|
|
16
|
+
tenantId: string;
|
|
17
|
+
organizationId: string;
|
|
18
|
+
organizationRoleId: string;
|
|
19
|
+
applicationId: string;
|
|
20
|
+
};
|
|
21
|
+
export type OrganizationRoleApplicationRelationKeys = 'tenantId' | 'organizationId' | 'organizationRoleId' | 'applicationId';
|
|
22
|
+
export declare const OrganizationRoleApplicationRelations: GeneratedSchema<OrganizationRoleApplicationRelationKeys, CreateOrganizationRoleApplicationRelation, OrganizationRoleApplicationRelation, 'organization_role_application_relations', 'organization_role_application_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
|
+
applicationId: 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
|
+
applicationId: z.string().min(1).max(21),
|
|
14
|
+
});
|
|
15
|
+
export const OrganizationRoleApplicationRelations = Object.freeze({
|
|
16
|
+
table: 'organization_role_application_relations',
|
|
17
|
+
tableSingular: 'organization_role_application_relation',
|
|
18
|
+
fields: {
|
|
19
|
+
tenantId: 'tenant_id',
|
|
20
|
+
organizationId: 'organization_id',
|
|
21
|
+
organizationRoleId: 'organization_role_id',
|
|
22
|
+
applicationId: 'application_id',
|
|
23
|
+
},
|
|
24
|
+
fieldKeys: [
|
|
25
|
+
'tenantId',
|
|
26
|
+
'organizationId',
|
|
27
|
+
'organizationRoleId',
|
|
28
|
+
'applicationId',
|
|
29
|
+
],
|
|
30
|
+
createGuard,
|
|
31
|
+
guard,
|
|
32
|
+
updateGuard: guard.partial(),
|
|
33
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
import { RoleType } from './custom-types.js';
|
|
2
3
|
/**
|
|
3
4
|
* The roles defined by the organization template.
|
|
4
5
|
*
|
|
@@ -13,6 +14,8 @@ export type CreateOrganizationRole = {
|
|
|
13
14
|
name: string;
|
|
14
15
|
/** A brief description of the organization role. */
|
|
15
16
|
description?: string | null;
|
|
17
|
+
/** The type of the organization role. Same as the `type` field in the `roles` table. */
|
|
18
|
+
type?: RoleType;
|
|
16
19
|
};
|
|
17
20
|
/** The roles defined by the organization template. */
|
|
18
21
|
export type OrganizationRole = {
|
|
@@ -23,6 +26,8 @@ export type OrganizationRole = {
|
|
|
23
26
|
name: string;
|
|
24
27
|
/** A brief description of the organization role. */
|
|
25
28
|
description: string | null;
|
|
29
|
+
/** The type of the organization role. Same as the `type` field in the `roles` table. */
|
|
30
|
+
type: RoleType;
|
|
26
31
|
};
|
|
27
|
-
export type OrganizationRoleKeys = 'tenantId' | 'id' | 'name' | 'description';
|
|
32
|
+
export type OrganizationRoleKeys = 'tenantId' | 'id' | 'name' | 'description' | 'type';
|
|
28
33
|
export declare const OrganizationRoles: GeneratedSchema<OrganizationRoleKeys, CreateOrganizationRole, OrganizationRole, 'organization_roles', 'organization_role'>;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import { RoleType } from './custom-types.js';
|
|
3
4
|
const createGuard = z.object({
|
|
4
5
|
tenantId: z.string().max(21).optional(),
|
|
5
6
|
id: z.string().min(1).max(21),
|
|
6
7
|
name: z.string().min(1).max(128),
|
|
7
8
|
description: z.string().max(256).nullable().optional(),
|
|
9
|
+
type: z.nativeEnum(RoleType).optional(),
|
|
8
10
|
});
|
|
9
11
|
const guard = z.object({
|
|
10
12
|
tenantId: z.string().max(21),
|
|
11
13
|
id: z.string().min(1).max(21),
|
|
12
14
|
name: z.string().min(1).max(128),
|
|
13
15
|
description: z.string().max(256).nullable(),
|
|
16
|
+
type: z.nativeEnum(RoleType),
|
|
14
17
|
});
|
|
15
18
|
export const OrganizationRoles = Object.freeze({
|
|
16
19
|
table: 'organization_roles',
|
|
@@ -20,12 +23,14 @@ export const OrganizationRoles = Object.freeze({
|
|
|
20
23
|
id: 'id',
|
|
21
24
|
name: 'name',
|
|
22
25
|
description: 'description',
|
|
26
|
+
type: 'type',
|
|
23
27
|
},
|
|
24
28
|
fieldKeys: [
|
|
25
29
|
'tenantId',
|
|
26
30
|
'id',
|
|
27
31
|
'name',
|
|
28
32
|
'description',
|
|
33
|
+
'type',
|
|
29
34
|
],
|
|
30
35
|
createGuard,
|
|
31
36
|
guard,
|
|
@@ -15,6 +15,8 @@ export type CreateOrganization = {
|
|
|
15
15
|
description?: string | null;
|
|
16
16
|
/** Additional data associated with the organization. */
|
|
17
17
|
customData?: JsonObject;
|
|
18
|
+
/** Whether multi-factor authentication configuration is required for the members of the organization. */
|
|
19
|
+
isMfaRequired?: boolean;
|
|
18
20
|
/** When the organization was created. */
|
|
19
21
|
createdAt?: number;
|
|
20
22
|
};
|
|
@@ -29,8 +31,10 @@ export type Organization = {
|
|
|
29
31
|
description: string | null;
|
|
30
32
|
/** Additional data associated with the organization. */
|
|
31
33
|
customData: JsonObject;
|
|
34
|
+
/** Whether multi-factor authentication configuration is required for the members of the organization. */
|
|
35
|
+
isMfaRequired: boolean;
|
|
32
36
|
/** When the organization was created. */
|
|
33
37
|
createdAt: number;
|
|
34
38
|
};
|
|
35
|
-
export type OrganizationKeys = 'tenantId' | 'id' | 'name' | 'description' | 'customData' | 'createdAt';
|
|
39
|
+
export type OrganizationKeys = 'tenantId' | 'id' | 'name' | 'description' | 'customData' | 'isMfaRequired' | 'createdAt';
|
|
36
40
|
export declare const Organizations: GeneratedSchema<OrganizationKeys, CreateOrganization, Organization, 'organizations', 'organization'>;
|