@logto/schemas 1.12.0 → 1.13.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.13.0-1702274830-add-new-third-party-column-to-applications-table.ts +20 -0
- package/alterations/1.13.0-1702372401-add-application-permissions-tables.ts +93 -0
- package/alterations/1.13.0-1702544178-sync-tenant-orgs.ts +296 -0
- package/alterations/1.13.0-1702871078-protected-application-type.ts +24 -0
- package/alterations/1.13.0-1702877515-protected-app-configs.ts +18 -0
- package/alterations/1.13.0-1702978120-application-sign-in-experience-table.ts +61 -0
- package/alterations/1.13.0-1703229996-daily-token-usage.ts +62 -0
- package/alterations/1.13.0-1703230000-update-tenant-roles.ts +94 -0
- package/alterations/1.13.0-1704692973-remove-legacy-resources.ts +147 -0
- package/alterations/1.13.0-1704934999-add-magic-links-table.ts +37 -0
- package/alterations/1.13.0-1704935001-add-organization-invitation-tables.ts +78 -0
- package/alterations/1.13.0-1705288654-add-application-user-consent-organizations-table.ts +62 -0
- package/alterations/1.13.0-1705991158-update-invitation-indices.ts +32 -0
- package/alterations/1.13.0-1706449174-update-organization-invitation-column.ts +24 -0
- package/alterations/1.13.0-1706510290-protected-app-host-index.ts +21 -0
- package/alterations/1.13.0-1706512952-restore-get-started-page.ts +17 -0
- package/alterations/1.13.0-1706528755-remove-magic-links.ts +46 -0
- package/alterations/1.13.0-1706585206-protected-app-custom-domain-unique.ts +21 -0
- package/alterations/1.13.1-1707360939-grant-is-suspended-read-permission.ts +39 -0
- package/alterations/utils/1704934999-tables.ts +49 -0
- package/alterations/utils/README.md +9 -0
- package/alterations-js/1.13.0-1702274830-add-new-third-party-column-to-applications-table.d.ts +3 -0
- package/alterations-js/1.13.0-1702274830-add-new-third-party-column-to-applications-table.js +16 -0
- package/alterations-js/1.13.0-1702372401-add-application-permissions-tables.d.ts +3 -0
- package/alterations-js/1.13.0-1702372401-add-application-permissions-tables.js +79 -0
- package/alterations-js/1.13.0-1702544178-sync-tenant-orgs.d.ts +18 -0
- package/alterations-js/1.13.0-1702544178-sync-tenant-orgs.js +225 -0
- package/alterations-js/1.13.0-1702871078-protected-application-type.d.ts +3 -0
- package/alterations-js/1.13.0-1702871078-protected-application-type.js +20 -0
- package/alterations-js/1.13.0-1702877515-protected-app-configs.d.ts +3 -0
- package/alterations-js/1.13.0-1702877515-protected-app-configs.js +14 -0
- package/alterations-js/1.13.0-1702978120-application-sign-in-experience-table.d.ts +3 -0
- package/alterations-js/1.13.0-1702978120-application-sign-in-experience-table.js +51 -0
- package/alterations-js/1.13.0-1703229996-daily-token-usage.d.ts +3 -0
- package/alterations-js/1.13.0-1703229996-daily-token-usage.js +51 -0
- package/alterations-js/1.13.0-1703230000-update-tenant-roles.d.ts +11 -0
- package/alterations-js/1.13.0-1703230000-update-tenant-roles.js +87 -0
- package/alterations-js/1.13.0-1704692973-remove-legacy-resources.d.ts +3 -0
- package/alterations-js/1.13.0-1704692973-remove-legacy-resources.js +124 -0
- package/alterations-js/1.13.0-1704934999-add-magic-links-table.d.ts +3 -0
- package/alterations-js/1.13.0-1704934999-add-magic-links-table.js +32 -0
- package/alterations-js/1.13.0-1704935001-add-organization-invitation-tables.d.ts +3 -0
- package/alterations-js/1.13.0-1704935001-add-organization-invitation-tables.js +72 -0
- package/alterations-js/1.13.0-1705288654-add-application-user-consent-organizations-table.d.ts +3 -0
- package/alterations-js/1.13.0-1705288654-add-application-user-consent-organizations-table.js +52 -0
- package/alterations-js/1.13.0-1705991158-update-invitation-indices.d.ts +7 -0
- package/alterations-js/1.13.0-1705991158-update-invitation-indices.js +27 -0
- package/alterations-js/1.13.0-1706449174-update-organization-invitation-column.d.ts +3 -0
- package/alterations-js/1.13.0-1706449174-update-organization-invitation-column.js +20 -0
- package/alterations-js/1.13.0-1706510290-protected-app-host-index.d.ts +3 -0
- package/alterations-js/1.13.0-1706510290-protected-app-host-index.js +17 -0
- package/alterations-js/1.13.0-1706512952-restore-get-started-page.d.ts +3 -0
- package/alterations-js/1.13.0-1706512952-restore-get-started-page.js +13 -0
- package/alterations-js/1.13.0-1706528755-remove-magic-links.d.ts +3 -0
- package/alterations-js/1.13.0-1706528755-remove-magic-links.js +41 -0
- package/alterations-js/1.13.0-1706585206-protected-app-custom-domain-unique.d.ts +3 -0
- package/alterations-js/1.13.0-1706585206-protected-app-custom-domain-unique.js +17 -0
- package/alterations-js/1.13.1-1707360939-grant-is-suspended-read-permission.d.ts +6 -0
- package/alterations-js/1.13.1-1707360939-grant-is-suspended-read-permission.js +31 -0
- package/alterations-js/utils/1704934999-tables.d.ts +11 -0
- package/alterations-js/utils/1704934999-tables.js +43 -0
- package/lib/db-entries/application-sign-in-experience.d.ts +26 -0
- package/lib/db-entries/application-sign-in-experience.js +42 -0
- package/lib/db-entries/application-user-consent-organization-scope.d.ts +24 -0
- package/lib/db-entries/application-user-consent-organization-scope.js +29 -0
- package/lib/db-entries/application-user-consent-organization.d.ts +22 -0
- package/lib/db-entries/application-user-consent-organization.js +33 -0
- package/lib/db-entries/application-user-consent-resource-scope.d.ts +24 -0
- package/lib/db-entries/application-user-consent-resource-scope.js +29 -0
- package/lib/db-entries/application-user-consent-user-scope.d.ts +24 -0
- package/lib/db-entries/application-user-consent-user-scope.js +29 -0
- package/lib/db-entries/application.d.ts +6 -2
- package/lib/db-entries/application.js +9 -1
- package/lib/db-entries/custom-types.d.ts +8 -1
- package/lib/db-entries/custom-types.js +8 -0
- package/lib/db-entries/daily-token-usage.d.ts +20 -0
- package/lib/db-entries/daily-token-usage.js +33 -0
- package/lib/db-entries/index.d.ts +8 -0
- package/lib/db-entries/index.js +8 -0
- package/lib/db-entries/organization-invitation-role-relation.d.ts +24 -0
- package/lib/db-entries/organization-invitation-role-relation.js +29 -0
- package/lib/db-entries/organization-invitation.d.ts +53 -0
- package/lib/db-entries/organization-invitation.js +58 -0
- package/lib/foundations/jsonb-types/applications.d.ts +380 -0
- package/lib/foundations/jsonb-types/applications.js +29 -0
- package/lib/foundations/jsonb-types/custom-domain.d.ts +37 -89
- package/lib/foundations/jsonb-types/custom-domain.js +4 -9
- package/lib/foundations/jsonb-types/index.d.ts +1 -0
- package/lib/foundations/jsonb-types/index.js +1 -0
- package/lib/foundations/jsonb-types/users.d.ts +1 -2
- package/lib/foundations/jsonb-types/users.js +1 -1
- package/lib/models/tenants.d.ts +1 -1
- package/lib/seeds/application.d.ts +1 -1
- package/lib/seeds/application.js +3 -1
- package/lib/seeds/cloud-api.d.ts +3 -3
- package/lib/seeds/cloud-api.js +2 -3
- package/lib/seeds/management-api.d.ts +77 -6
- package/lib/seeds/management-api.js +14 -10
- package/lib/types/application.d.ts +576 -1
- package/lib/types/application.js +42 -1
- package/lib/types/connector.js +1 -1
- package/lib/types/consent.d.ts +568 -0
- package/lib/types/consent.js +47 -0
- package/lib/types/domain.d.ts +21 -65
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.js +3 -0
- package/lib/types/interactions.d.ts +6 -6
- package/lib/types/logto-config.d.ts +32 -6
- package/lib/types/logto-config.js +12 -2
- package/lib/types/mapi-proxy.d.ts +30 -0
- package/lib/types/mapi-proxy.js +49 -0
- package/lib/types/organization.d.ts +10 -1
- package/lib/types/organization.js +4 -1
- package/lib/types/sso-connector.d.ts +9 -9
- package/lib/types/sso-connector.js +1 -1
- package/lib/types/system.d.ts +28 -1
- package/lib/types/system.js +17 -0
- package/lib/types/tenant-organization.d.ts +107 -0
- package/lib/types/tenant-organization.js +145 -0
- package/lib/types/tenant.d.ts +0 -1
- package/lib/types/tenant.js +2 -4
- package/lib/types/user-assets.d.ts +5 -5
- package/lib/types/user-assets.js +1 -0
- package/lib/types/user.d.ts +14 -15
- package/lib/types/user.js +0 -1
- package/package.json +14 -14
- package/tables/_after_all.sql +1 -1
- package/tables/application_sign_in_experiences.sql +15 -0
- package/tables/application_user_consent_organization_scopes.sql +14 -0
- package/tables/application_user_consent_organizations.sql +16 -0
- package/tables/application_user_consent_resource_scopes.sql +14 -0
- package/tables/application_user_consent_user_scopes.sql +13 -0
- package/tables/applications.sql +16 -1
- package/tables/daily_token_usage.sql +11 -0
- package/tables/organization_invitation_role_relations.sql +14 -0
- package/tables/organization_invitations.sql +36 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The organization scopes (permissions) assigned to an application.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link ApplicationUserConsentOrganizationScope} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateApplicationUserConsentOrganizationScope = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
/** The globally unique identifier of the application. */
|
|
11
|
+
applicationId: string;
|
|
12
|
+
/** The globally unique identifier of the organization scope. */
|
|
13
|
+
organizationScopeId: string;
|
|
14
|
+
};
|
|
15
|
+
/** The organization scopes (permissions) assigned to an application. */
|
|
16
|
+
export type ApplicationUserConsentOrganizationScope = {
|
|
17
|
+
tenantId: string;
|
|
18
|
+
/** The globally unique identifier of the application. */
|
|
19
|
+
applicationId: string;
|
|
20
|
+
/** The globally unique identifier of the organization scope. */
|
|
21
|
+
organizationScopeId: string;
|
|
22
|
+
};
|
|
23
|
+
export type ApplicationUserConsentOrganizationScopeKeys = 'tenantId' | 'applicationId' | 'organizationScopeId';
|
|
24
|
+
export declare const ApplicationUserConsentOrganizationScopes: GeneratedSchema<ApplicationUserConsentOrganizationScopeKeys, CreateApplicationUserConsentOrganizationScope, ApplicationUserConsentOrganizationScope, 'application_user_consent_organization_scopes', 'application_user_consent_organization_scope'>;
|
|
@@ -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
|
+
applicationId: 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
|
+
applicationId: z.string().min(1).max(21),
|
|
11
|
+
organizationScopeId: z.string().min(1).max(21),
|
|
12
|
+
});
|
|
13
|
+
export const ApplicationUserConsentOrganizationScopes = Object.freeze({
|
|
14
|
+
table: 'application_user_consent_organization_scopes',
|
|
15
|
+
tableSingular: 'application_user_consent_organization_scope',
|
|
16
|
+
fields: {
|
|
17
|
+
tenantId: 'tenant_id',
|
|
18
|
+
applicationId: 'application_id',
|
|
19
|
+
organizationScopeId: 'organization_scope_id',
|
|
20
|
+
},
|
|
21
|
+
fieldKeys: [
|
|
22
|
+
'tenantId',
|
|
23
|
+
'applicationId',
|
|
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 applications, users and organizations. A relation means that a user has consented to an application to access data in an organization.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link ApplicationUserConsentOrganization} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateApplicationUserConsentOrganization = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
applicationId: string;
|
|
11
|
+
organizationId: string;
|
|
12
|
+
userId: string;
|
|
13
|
+
};
|
|
14
|
+
/** The relations between applications, users and organizations. A relation means that a user has consented to an application to access data in an organization. */
|
|
15
|
+
export type ApplicationUserConsentOrganization = {
|
|
16
|
+
tenantId: string;
|
|
17
|
+
applicationId: string;
|
|
18
|
+
organizationId: string;
|
|
19
|
+
userId: string;
|
|
20
|
+
};
|
|
21
|
+
export type ApplicationUserConsentOrganizationKeys = 'tenantId' | 'applicationId' | 'organizationId' | 'userId';
|
|
22
|
+
export declare const ApplicationUserConsentOrganizations: GeneratedSchema<ApplicationUserConsentOrganizationKeys, CreateApplicationUserConsentOrganization, ApplicationUserConsentOrganization, 'application_user_consent_organizations', 'application_user_consent_organization'>;
|
|
@@ -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
|
+
applicationId: z.string().min(1).max(21),
|
|
6
|
+
organizationId: 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
|
+
applicationId: z.string().min(1).max(21),
|
|
12
|
+
organizationId: z.string().min(1).max(21),
|
|
13
|
+
userId: z.string().min(1).max(21),
|
|
14
|
+
});
|
|
15
|
+
export const ApplicationUserConsentOrganizations = Object.freeze({
|
|
16
|
+
table: 'application_user_consent_organizations',
|
|
17
|
+
tableSingular: 'application_user_consent_organization',
|
|
18
|
+
fields: {
|
|
19
|
+
tenantId: 'tenant_id',
|
|
20
|
+
applicationId: 'application_id',
|
|
21
|
+
organizationId: 'organization_id',
|
|
22
|
+
userId: 'user_id',
|
|
23
|
+
},
|
|
24
|
+
fieldKeys: [
|
|
25
|
+
'tenantId',
|
|
26
|
+
'applicationId',
|
|
27
|
+
'organizationId',
|
|
28
|
+
'userId',
|
|
29
|
+
],
|
|
30
|
+
createGuard,
|
|
31
|
+
guard,
|
|
32
|
+
updateGuard: guard.partial(),
|
|
33
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The resource scopes (permissions) assigned to an application's consent request.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link ApplicationUserConsentResourceScope} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateApplicationUserConsentResourceScope = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
/** The globally unique identifier of the application. */
|
|
11
|
+
applicationId: string;
|
|
12
|
+
/** The globally unique identifier of the resource scope. */
|
|
13
|
+
scopeId: string;
|
|
14
|
+
};
|
|
15
|
+
/** The resource scopes (permissions) assigned to an application's consent request. */
|
|
16
|
+
export type ApplicationUserConsentResourceScope = {
|
|
17
|
+
tenantId: string;
|
|
18
|
+
/** The globally unique identifier of the application. */
|
|
19
|
+
applicationId: string;
|
|
20
|
+
/** The globally unique identifier of the resource scope. */
|
|
21
|
+
scopeId: string;
|
|
22
|
+
};
|
|
23
|
+
export type ApplicationUserConsentResourceScopeKeys = 'tenantId' | 'applicationId' | 'scopeId';
|
|
24
|
+
export declare const ApplicationUserConsentResourceScopes: GeneratedSchema<ApplicationUserConsentResourceScopeKeys, CreateApplicationUserConsentResourceScope, ApplicationUserConsentResourceScope, 'application_user_consent_resource_scopes', 'application_user_consent_resource_scope'>;
|
|
@@ -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
|
+
applicationId: z.string().min(1).max(21),
|
|
6
|
+
scopeId: z.string().min(1).max(21),
|
|
7
|
+
});
|
|
8
|
+
const guard = z.object({
|
|
9
|
+
tenantId: z.string().max(21),
|
|
10
|
+
applicationId: z.string().min(1).max(21),
|
|
11
|
+
scopeId: z.string().min(1).max(21),
|
|
12
|
+
});
|
|
13
|
+
export const ApplicationUserConsentResourceScopes = Object.freeze({
|
|
14
|
+
table: 'application_user_consent_resource_scopes',
|
|
15
|
+
tableSingular: 'application_user_consent_resource_scope',
|
|
16
|
+
fields: {
|
|
17
|
+
tenantId: 'tenant_id',
|
|
18
|
+
applicationId: 'application_id',
|
|
19
|
+
scopeId: 'scope_id',
|
|
20
|
+
},
|
|
21
|
+
fieldKeys: [
|
|
22
|
+
'tenantId',
|
|
23
|
+
'applicationId',
|
|
24
|
+
'scopeId',
|
|
25
|
+
],
|
|
26
|
+
createGuard,
|
|
27
|
+
guard,
|
|
28
|
+
updateGuard: guard.partial(),
|
|
29
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The user scopes (permissions) assigned to an application
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link ApplicationUserConsentUserScope} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateApplicationUserConsentUserScope = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
/** The globally unique identifier of the application. */
|
|
11
|
+
applicationId: string;
|
|
12
|
+
/** The unique UserScope enum value @see (@logto/core-kit/open-id.js) for more details */
|
|
13
|
+
userScope: string;
|
|
14
|
+
};
|
|
15
|
+
/** The user scopes (permissions) assigned to an application */
|
|
16
|
+
export type ApplicationUserConsentUserScope = {
|
|
17
|
+
tenantId: string;
|
|
18
|
+
/** The globally unique identifier of the application. */
|
|
19
|
+
applicationId: string;
|
|
20
|
+
/** The unique UserScope enum value @see (@logto/core-kit/open-id.js) for more details */
|
|
21
|
+
userScope: string;
|
|
22
|
+
};
|
|
23
|
+
export type ApplicationUserConsentUserScopeKeys = 'tenantId' | 'applicationId' | 'userScope';
|
|
24
|
+
export declare const ApplicationUserConsentUserScopes: GeneratedSchema<ApplicationUserConsentUserScopeKeys, CreateApplicationUserConsentUserScope, ApplicationUserConsentUserScope, 'application_user_consent_user_scopes', 'application_user_consent_user_scope'>;
|
|
@@ -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
|
+
applicationId: z.string().min(1).max(21),
|
|
6
|
+
userScope: z.string().min(1).max(64),
|
|
7
|
+
});
|
|
8
|
+
const guard = z.object({
|
|
9
|
+
tenantId: z.string().max(21),
|
|
10
|
+
applicationId: z.string().min(1).max(21),
|
|
11
|
+
userScope: z.string().min(1).max(64),
|
|
12
|
+
});
|
|
13
|
+
export const ApplicationUserConsentUserScopes = Object.freeze({
|
|
14
|
+
table: 'application_user_consent_user_scopes',
|
|
15
|
+
tableSingular: 'application_user_consent_user_scope',
|
|
16
|
+
fields: {
|
|
17
|
+
tenantId: 'tenant_id',
|
|
18
|
+
applicationId: 'application_id',
|
|
19
|
+
userScope: 'user_scope',
|
|
20
|
+
},
|
|
21
|
+
fieldKeys: [
|
|
22
|
+
'tenantId',
|
|
23
|
+
'applicationId',
|
|
24
|
+
'userScope',
|
|
25
|
+
],
|
|
26
|
+
createGuard,
|
|
27
|
+
guard,
|
|
28
|
+
updateGuard: guard.partial(),
|
|
29
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OidcClientMetadata, CustomClientMetadata, GeneratedSchema } from './../foundations/index.js';
|
|
1
|
+
import { OidcClientMetadata, CustomClientMetadata, ProtectedAppMetadata, GeneratedSchema } from './../foundations/index.js';
|
|
2
2
|
import { ApplicationType } from './custom-types.js';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
@@ -14,6 +14,8 @@ export type CreateApplication = {
|
|
|
14
14
|
type: ApplicationType;
|
|
15
15
|
oidcClientMetadata: OidcClientMetadata;
|
|
16
16
|
customClientMetadata?: CustomClientMetadata;
|
|
17
|
+
protectedAppMetadata?: ProtectedAppMetadata | null;
|
|
18
|
+
isThirdParty?: boolean;
|
|
17
19
|
createdAt?: number;
|
|
18
20
|
};
|
|
19
21
|
export type Application = {
|
|
@@ -25,7 +27,9 @@ export type Application = {
|
|
|
25
27
|
type: ApplicationType;
|
|
26
28
|
oidcClientMetadata: OidcClientMetadata;
|
|
27
29
|
customClientMetadata: CustomClientMetadata;
|
|
30
|
+
protectedAppMetadata: ProtectedAppMetadata | null;
|
|
31
|
+
isThirdParty: boolean;
|
|
28
32
|
createdAt: number;
|
|
29
33
|
};
|
|
30
|
-
export type ApplicationKeys = 'tenantId' | 'id' | 'name' | 'secret' | 'description' | 'type' | 'oidcClientMetadata' | 'customClientMetadata' | 'createdAt';
|
|
34
|
+
export type ApplicationKeys = 'tenantId' | 'id' | 'name' | 'secret' | 'description' | 'type' | 'oidcClientMetadata' | 'customClientMetadata' | 'protectedAppMetadata' | 'isThirdParty' | 'createdAt';
|
|
31
35
|
export declare const Applications: GeneratedSchema<ApplicationKeys, CreateApplication, Application, 'applications', 'application'>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import { oidcClientMetadataGuard, customClientMetadataGuard } from './../foundations/index.js';
|
|
3
|
+
import { oidcClientMetadataGuard, customClientMetadataGuard, protectedAppMetadataGuard } from './../foundations/index.js';
|
|
4
4
|
import { ApplicationType } from './custom-types.js';
|
|
5
5
|
const createGuard = z.object({
|
|
6
6
|
tenantId: z.string().max(21).optional(),
|
|
@@ -11,6 +11,8 @@ const createGuard = z.object({
|
|
|
11
11
|
type: z.nativeEnum(ApplicationType),
|
|
12
12
|
oidcClientMetadata: oidcClientMetadataGuard,
|
|
13
13
|
customClientMetadata: customClientMetadataGuard.optional(),
|
|
14
|
+
protectedAppMetadata: protectedAppMetadataGuard.nullable().optional(),
|
|
15
|
+
isThirdParty: z.boolean().optional(),
|
|
14
16
|
createdAt: z.number().optional(),
|
|
15
17
|
});
|
|
16
18
|
const guard = z.object({
|
|
@@ -22,6 +24,8 @@ const guard = z.object({
|
|
|
22
24
|
type: z.nativeEnum(ApplicationType),
|
|
23
25
|
oidcClientMetadata: oidcClientMetadataGuard,
|
|
24
26
|
customClientMetadata: customClientMetadataGuard,
|
|
27
|
+
protectedAppMetadata: protectedAppMetadataGuard.nullable(),
|
|
28
|
+
isThirdParty: z.boolean(),
|
|
25
29
|
createdAt: z.number(),
|
|
26
30
|
});
|
|
27
31
|
export const Applications = Object.freeze({
|
|
@@ -36,6 +40,8 @@ export const Applications = Object.freeze({
|
|
|
36
40
|
type: 'type',
|
|
37
41
|
oidcClientMetadata: 'oidc_client_metadata',
|
|
38
42
|
customClientMetadata: 'custom_client_metadata',
|
|
43
|
+
protectedAppMetadata: 'protected_app_metadata',
|
|
44
|
+
isThirdParty: 'is_third_party',
|
|
39
45
|
createdAt: 'created_at',
|
|
40
46
|
},
|
|
41
47
|
fieldKeys: [
|
|
@@ -47,6 +53,8 @@ export const Applications = Object.freeze({
|
|
|
47
53
|
'type',
|
|
48
54
|
'oidcClientMetadata',
|
|
49
55
|
'customClientMetadata',
|
|
56
|
+
'protectedAppMetadata',
|
|
57
|
+
'isThirdParty',
|
|
50
58
|
'createdAt',
|
|
51
59
|
],
|
|
52
60
|
createGuard,
|
|
@@ -2,7 +2,14 @@ export declare enum ApplicationType {
|
|
|
2
2
|
Native = "Native",
|
|
3
3
|
SPA = "SPA",
|
|
4
4
|
Traditional = "Traditional",
|
|
5
|
-
MachineToMachine = "MachineToMachine"
|
|
5
|
+
MachineToMachine = "MachineToMachine",
|
|
6
|
+
Protected = "Protected"
|
|
7
|
+
}
|
|
8
|
+
export declare enum OrganizationInvitationStatus {
|
|
9
|
+
Pending = "Pending",
|
|
10
|
+
Accepted = "Accepted",
|
|
11
|
+
Expired = "Expired",
|
|
12
|
+
Revoked = "Revoked"
|
|
6
13
|
}
|
|
7
14
|
export declare enum RoleType {
|
|
8
15
|
User = "User",
|
|
@@ -5,7 +5,15 @@ export var ApplicationType;
|
|
|
5
5
|
ApplicationType["SPA"] = "SPA";
|
|
6
6
|
ApplicationType["Traditional"] = "Traditional";
|
|
7
7
|
ApplicationType["MachineToMachine"] = "MachineToMachine";
|
|
8
|
+
ApplicationType["Protected"] = "Protected";
|
|
8
9
|
})(ApplicationType || (ApplicationType = {}));
|
|
10
|
+
export var OrganizationInvitationStatus;
|
|
11
|
+
(function (OrganizationInvitationStatus) {
|
|
12
|
+
OrganizationInvitationStatus["Pending"] = "Pending";
|
|
13
|
+
OrganizationInvitationStatus["Accepted"] = "Accepted";
|
|
14
|
+
OrganizationInvitationStatus["Expired"] = "Expired";
|
|
15
|
+
OrganizationInvitationStatus["Revoked"] = "Revoked";
|
|
16
|
+
})(OrganizationInvitationStatus || (OrganizationInvitationStatus = {}));
|
|
9
17
|
export var RoleType;
|
|
10
18
|
(function (RoleType) {
|
|
11
19
|
RoleType["User"] = "User";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @remarks This is a type for database creation.
|
|
5
|
+
* @see {@link DailyTokenUsage} for the original type.
|
|
6
|
+
*/
|
|
7
|
+
export type CreateDailyTokenUsage = {
|
|
8
|
+
id: string;
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
usage?: number;
|
|
11
|
+
date: number;
|
|
12
|
+
};
|
|
13
|
+
export type DailyTokenUsage = {
|
|
14
|
+
id: string;
|
|
15
|
+
tenantId: string;
|
|
16
|
+
usage: number;
|
|
17
|
+
date: number;
|
|
18
|
+
};
|
|
19
|
+
export type DailyTokenUsageKeys = 'id' | 'tenantId' | 'usage' | 'date';
|
|
20
|
+
export declare const DailyTokenUsage: GeneratedSchema<DailyTokenUsageKeys, CreateDailyTokenUsage, DailyTokenUsage, 'daily_token_usage', 'daily_token_usage'>;
|
|
@@ -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
|
+
id: z.string().min(1).max(21),
|
|
5
|
+
tenantId: z.string().max(21).optional(),
|
|
6
|
+
usage: z.number().optional(),
|
|
7
|
+
date: z.number(),
|
|
8
|
+
});
|
|
9
|
+
const guard = z.object({
|
|
10
|
+
id: z.string().min(1).max(21),
|
|
11
|
+
tenantId: z.string().max(21),
|
|
12
|
+
usage: z.number(),
|
|
13
|
+
date: z.number(),
|
|
14
|
+
});
|
|
15
|
+
export const DailyTokenUsage = Object.freeze({
|
|
16
|
+
table: 'daily_token_usage',
|
|
17
|
+
tableSingular: 'daily_token_usage',
|
|
18
|
+
fields: {
|
|
19
|
+
id: 'id',
|
|
20
|
+
tenantId: 'tenant_id',
|
|
21
|
+
usage: 'usage',
|
|
22
|
+
date: 'date',
|
|
23
|
+
},
|
|
24
|
+
fieldKeys: [
|
|
25
|
+
'id',
|
|
26
|
+
'tenantId',
|
|
27
|
+
'usage',
|
|
28
|
+
'date',
|
|
29
|
+
],
|
|
30
|
+
createGuard,
|
|
31
|
+
guard,
|
|
32
|
+
updateGuard: guard.partial(),
|
|
33
|
+
});
|
|
@@ -3,16 +3,24 @@ export * from './-after-all.js';
|
|
|
3
3
|
export * from './-after-each.js';
|
|
4
4
|
export * from './-before-all.js';
|
|
5
5
|
export * from './-function.js';
|
|
6
|
+
export * from './application-sign-in-experience.js';
|
|
7
|
+
export * from './application-user-consent-organization-scope.js';
|
|
8
|
+
export * from './application-user-consent-organization.js';
|
|
9
|
+
export * from './application-user-consent-resource-scope.js';
|
|
10
|
+
export * from './application-user-consent-user-scope.js';
|
|
6
11
|
export * from './application.js';
|
|
7
12
|
export * from './applications-role.js';
|
|
8
13
|
export * from './connector.js';
|
|
9
14
|
export * from './custom-phrase.js';
|
|
10
15
|
export * from './daily-active-user.js';
|
|
16
|
+
export * from './daily-token-usage.js';
|
|
11
17
|
export * from './domain.js';
|
|
12
18
|
export * from './hook.js';
|
|
13
19
|
export * from './log.js';
|
|
14
20
|
export * from './logto-config.js';
|
|
15
21
|
export * from './oidc-model-instance.js';
|
|
22
|
+
export * from './organization-invitation-role-relation.js';
|
|
23
|
+
export * from './organization-invitation.js';
|
|
16
24
|
export * from './organization-role-scope-relation.js';
|
|
17
25
|
export * from './organization-role-user-relation.js';
|
|
18
26
|
export * from './organization-role.js';
|
package/lib/db-entries/index.js
CHANGED
|
@@ -4,16 +4,24 @@ export * from './-after-all.js';
|
|
|
4
4
|
export * from './-after-each.js';
|
|
5
5
|
export * from './-before-all.js';
|
|
6
6
|
export * from './-function.js';
|
|
7
|
+
export * from './application-sign-in-experience.js';
|
|
8
|
+
export * from './application-user-consent-organization-scope.js';
|
|
9
|
+
export * from './application-user-consent-organization.js';
|
|
10
|
+
export * from './application-user-consent-resource-scope.js';
|
|
11
|
+
export * from './application-user-consent-user-scope.js';
|
|
7
12
|
export * from './application.js';
|
|
8
13
|
export * from './applications-role.js';
|
|
9
14
|
export * from './connector.js';
|
|
10
15
|
export * from './custom-phrase.js';
|
|
11
16
|
export * from './daily-active-user.js';
|
|
17
|
+
export * from './daily-token-usage.js';
|
|
12
18
|
export * from './domain.js';
|
|
13
19
|
export * from './hook.js';
|
|
14
20
|
export * from './log.js';
|
|
15
21
|
export * from './logto-config.js';
|
|
16
22
|
export * from './oidc-model-instance.js';
|
|
23
|
+
export * from './organization-invitation-role-relation.js';
|
|
24
|
+
export * from './organization-invitation.js';
|
|
17
25
|
export * from './organization-role-scope-relation.js';
|
|
18
26
|
export * from './organization-role-user-relation.js';
|
|
19
27
|
export * from './organization-role.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* The organization roles that will be assigned to a user when they accept an invitation.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link OrganizationInvitationRoleRelation} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateOrganizationInvitationRoleRelation = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
/** The ID of the invitation. */
|
|
11
|
+
organizationInvitationId: string;
|
|
12
|
+
/** The ID of the organization role. */
|
|
13
|
+
organizationRoleId: string;
|
|
14
|
+
};
|
|
15
|
+
/** The organization roles that will be assigned to a user when they accept an invitation. */
|
|
16
|
+
export type OrganizationInvitationRoleRelation = {
|
|
17
|
+
tenantId: string;
|
|
18
|
+
/** The ID of the invitation. */
|
|
19
|
+
organizationInvitationId: string;
|
|
20
|
+
/** The ID of the organization role. */
|
|
21
|
+
organizationRoleId: string;
|
|
22
|
+
};
|
|
23
|
+
export type OrganizationInvitationRoleRelationKeys = 'tenantId' | 'organizationInvitationId' | 'organizationRoleId';
|
|
24
|
+
export declare const OrganizationInvitationRoleRelations: GeneratedSchema<OrganizationInvitationRoleRelationKeys, CreateOrganizationInvitationRoleRelation, OrganizationInvitationRoleRelation, 'organization_invitation_role_relations', 'organization_invitation_role_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
|
+
organizationInvitationId: 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
|
+
organizationInvitationId: z.string().min(1).max(21),
|
|
11
|
+
organizationRoleId: z.string().min(1).max(21),
|
|
12
|
+
});
|
|
13
|
+
export const OrganizationInvitationRoleRelations = Object.freeze({
|
|
14
|
+
table: 'organization_invitation_role_relations',
|
|
15
|
+
tableSingular: 'organization_invitation_role_relation',
|
|
16
|
+
fields: {
|
|
17
|
+
tenantId: 'tenant_id',
|
|
18
|
+
organizationInvitationId: 'organization_invitation_id',
|
|
19
|
+
organizationRoleId: 'organization_role_id',
|
|
20
|
+
},
|
|
21
|
+
fieldKeys: [
|
|
22
|
+
'tenantId',
|
|
23
|
+
'organizationInvitationId',
|
|
24
|
+
'organizationRoleId',
|
|
25
|
+
],
|
|
26
|
+
createGuard,
|
|
27
|
+
guard,
|
|
28
|
+
updateGuard: guard.partial(),
|
|
29
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
import { OrganizationInvitationStatus } from './custom-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The invitation entry defined in RFC 0003. It stores the invitation information for a user to join an organization.
|
|
5
|
+
*
|
|
6
|
+
* @remarks This is a type for database creation.
|
|
7
|
+
* @see {@link OrganizationInvitation} for the original type.
|
|
8
|
+
*/
|
|
9
|
+
export type CreateOrganizationInvitation = {
|
|
10
|
+
tenantId?: string;
|
|
11
|
+
/** The unique identifier of the invitation. */
|
|
12
|
+
id: string;
|
|
13
|
+
/** The user ID who sent the invitation. */
|
|
14
|
+
inviterId?: string | null;
|
|
15
|
+
/** The email address or other identifier of the invitee. */
|
|
16
|
+
invitee: string;
|
|
17
|
+
/** The user ID of who accepted the invitation. */
|
|
18
|
+
acceptedUserId?: string | null;
|
|
19
|
+
/** The ID of the organization to which the invitee is invited. */
|
|
20
|
+
organizationId: string;
|
|
21
|
+
/** The status of the invitation. */
|
|
22
|
+
status: OrganizationInvitationStatus;
|
|
23
|
+
/** The time when the invitation was created. */
|
|
24
|
+
createdAt?: number;
|
|
25
|
+
/** The time when the invitation status was last updated. */
|
|
26
|
+
updatedAt?: number;
|
|
27
|
+
/** The time when the invitation expires. */
|
|
28
|
+
expiresAt: number;
|
|
29
|
+
};
|
|
30
|
+
/** The invitation entry defined in RFC 0003. It stores the invitation information for a user to join an organization. */
|
|
31
|
+
export type OrganizationInvitation = {
|
|
32
|
+
tenantId: string;
|
|
33
|
+
/** The unique identifier of the invitation. */
|
|
34
|
+
id: string;
|
|
35
|
+
/** The user ID who sent the invitation. */
|
|
36
|
+
inviterId: string | null;
|
|
37
|
+
/** The email address or other identifier of the invitee. */
|
|
38
|
+
invitee: string;
|
|
39
|
+
/** The user ID of who accepted the invitation. */
|
|
40
|
+
acceptedUserId: string | null;
|
|
41
|
+
/** The ID of the organization to which the invitee is invited. */
|
|
42
|
+
organizationId: string;
|
|
43
|
+
/** The status of the invitation. */
|
|
44
|
+
status: OrganizationInvitationStatus;
|
|
45
|
+
/** The time when the invitation was created. */
|
|
46
|
+
createdAt: number;
|
|
47
|
+
/** The time when the invitation status was last updated. */
|
|
48
|
+
updatedAt: number;
|
|
49
|
+
/** The time when the invitation expires. */
|
|
50
|
+
expiresAt: number;
|
|
51
|
+
};
|
|
52
|
+
export type OrganizationInvitationKeys = 'tenantId' | 'id' | 'inviterId' | 'invitee' | 'acceptedUserId' | 'organizationId' | 'status' | 'createdAt' | 'updatedAt' | 'expiresAt';
|
|
53
|
+
export declare const OrganizationInvitations: GeneratedSchema<OrganizationInvitationKeys, CreateOrganizationInvitation, OrganizationInvitation, 'organization_invitations', 'organization_invitation'>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { OrganizationInvitationStatus } from './custom-types.js';
|
|
4
|
+
const createGuard = z.object({
|
|
5
|
+
tenantId: z.string().max(21).optional(),
|
|
6
|
+
id: z.string().min(1).max(21),
|
|
7
|
+
inviterId: z.string().max(21).nullable().optional(),
|
|
8
|
+
invitee: z.string().min(1).max(256),
|
|
9
|
+
acceptedUserId: z.string().max(21).nullable().optional(),
|
|
10
|
+
organizationId: z.string().min(1).max(21),
|
|
11
|
+
status: z.nativeEnum(OrganizationInvitationStatus),
|
|
12
|
+
createdAt: z.number().optional(),
|
|
13
|
+
updatedAt: z.number().optional(),
|
|
14
|
+
expiresAt: z.number(),
|
|
15
|
+
});
|
|
16
|
+
const guard = z.object({
|
|
17
|
+
tenantId: z.string().max(21),
|
|
18
|
+
id: z.string().min(1).max(21),
|
|
19
|
+
inviterId: z.string().max(21).nullable(),
|
|
20
|
+
invitee: z.string().min(1).max(256),
|
|
21
|
+
acceptedUserId: z.string().max(21).nullable(),
|
|
22
|
+
organizationId: z.string().min(1).max(21),
|
|
23
|
+
status: z.nativeEnum(OrganizationInvitationStatus),
|
|
24
|
+
createdAt: z.number(),
|
|
25
|
+
updatedAt: z.number(),
|
|
26
|
+
expiresAt: z.number(),
|
|
27
|
+
});
|
|
28
|
+
export const OrganizationInvitations = Object.freeze({
|
|
29
|
+
table: 'organization_invitations',
|
|
30
|
+
tableSingular: 'organization_invitation',
|
|
31
|
+
fields: {
|
|
32
|
+
tenantId: 'tenant_id',
|
|
33
|
+
id: 'id',
|
|
34
|
+
inviterId: 'inviter_id',
|
|
35
|
+
invitee: 'invitee',
|
|
36
|
+
acceptedUserId: 'accepted_user_id',
|
|
37
|
+
organizationId: 'organization_id',
|
|
38
|
+
status: 'status',
|
|
39
|
+
createdAt: 'created_at',
|
|
40
|
+
updatedAt: 'updated_at',
|
|
41
|
+
expiresAt: 'expires_at',
|
|
42
|
+
},
|
|
43
|
+
fieldKeys: [
|
|
44
|
+
'tenantId',
|
|
45
|
+
'id',
|
|
46
|
+
'inviterId',
|
|
47
|
+
'invitee',
|
|
48
|
+
'acceptedUserId',
|
|
49
|
+
'organizationId',
|
|
50
|
+
'status',
|
|
51
|
+
'createdAt',
|
|
52
|
+
'updatedAt',
|
|
53
|
+
'expiresAt',
|
|
54
|
+
],
|
|
55
|
+
createGuard,
|
|
56
|
+
guard,
|
|
57
|
+
updateGuard: guard.partial(),
|
|
58
|
+
});
|