@logto/schemas 1.42.0 → 1.44.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.43.0-1785393731-add-oidc-model-instances-account-id-partial-index.ts +33 -0
- package/alterations/1.43.0-1785481546-add-tenant-aware-scope-indexes.ts +33 -0
- package/alterations/1.43.0-1785488115-add-cimd-permission-ceiling-tables.ts +77 -0
- package/alterations/1.43.0-1785722831-add-oidc-session-extensions-account-id-index.ts +27 -0
- package/alterations/1.43.0-1785835991-add-cimd-client-identifier-columns.ts +31 -0
- package/alterations/1.43.0-1786325989-add-cimd-grant-organizations-table.ts +54 -0
- package/alterations/1.43.0-1786333495-add-trusted-devices.ts +57 -0
- package/alterations/1.43.0-1786373004-tighten-cimd-grant-organizations-pkey.ts +28 -0
- package/alterations/1.43.0-1786414712-add-service-logs-email-indexes.ts +34 -0
- package/alterations/1.43.0-1786431364-add-cimd-grant-client-snapshots-table.ts +43 -0
- package/alterations/1.44.0-1788946735-add-saml-authn-request-config.ts +18 -0
- package/alterations/1.44.0-1789000000-extend-user-id-length.ts +61 -0
- package/alterations-js/1.43.0-1785393731-add-oidc-model-instances-account-id-partial-index.js +28 -0
- package/alterations-js/1.43.0-1785481546-add-tenant-aware-scope-indexes.js +28 -0
- package/alterations-js/1.43.0-1785488115-add-cimd-permission-ceiling-tables.js +69 -0
- package/alterations-js/1.43.0-1785722831-add-oidc-session-extensions-account-id-index.js +23 -0
- package/alterations-js/1.43.0-1785835991-add-cimd-client-identifier-columns.js +27 -0
- package/alterations-js/1.43.0-1786325989-add-cimd-grant-organizations-table.js +49 -0
- package/alterations-js/1.43.0-1786333495-add-trusted-devices.js +50 -0
- package/alterations-js/1.43.0-1786373004-tighten-cimd-grant-organizations-pkey.js +24 -0
- package/alterations-js/1.43.0-1786414712-add-service-logs-email-indexes.js +30 -0
- package/alterations-js/1.43.0-1786431364-add-cimd-grant-client-snapshots-table.js +38 -0
- package/alterations-js/1.44.0-1788946735-add-saml-authn-request-config.js +14 -0
- package/alterations-js/1.44.0-1789000000-extend-user-id-length.js +47 -0
- package/lib/consts/experience.d.ts +3 -0
- package/lib/consts/experience.js +3 -0
- package/lib/consts/index.d.ts +2 -0
- package/lib/consts/index.js +2 -0
- package/lib/consts/license.d.ts +222 -0
- package/lib/consts/license.js +81 -0
- package/lib/consts/license.test.d.ts +1 -0
- package/lib/consts/license.test.js +96 -0
- package/lib/consts/oidc.d.ts +15 -1
- package/lib/consts/oidc.js +11 -0
- package/lib/consts/oidc.test.d.ts +1 -0
- package/lib/consts/oidc.test.js +15 -0
- package/lib/consts/product-event.d.ts +5 -1
- package/lib/consts/product-event.js +4 -0
- package/lib/consts/social-state.d.ts +12 -0
- package/lib/consts/social-state.js +12 -0
- package/lib/consts/subscriptions.d.ts +13 -1
- package/lib/consts/subscriptions.js +12 -0
- package/lib/db-entries/aggregated-daily-active-user.js +2 -2
- package/lib/db-entries/application-access-control-user-relation.js +2 -2
- package/lib/db-entries/application-user-consent-organization.js +2 -2
- package/lib/db-entries/cimd-grant-client-snapshot.d.ts +32 -0
- package/lib/db-entries/cimd-grant-client-snapshot.js +45 -0
- package/lib/db-entries/cimd-grant-organization.d.ts +30 -0
- package/lib/db-entries/cimd-grant-organization.js +37 -0
- package/lib/db-entries/cimd-organization-resource-scope.d.ts +20 -0
- package/lib/db-entries/cimd-organization-resource-scope.js +25 -0
- package/lib/db-entries/cimd-organization-scope.d.ts +20 -0
- package/lib/db-entries/cimd-organization-scope.js +25 -0
- package/lib/db-entries/cimd-resource-scope.d.ts +20 -0
- package/lib/db-entries/cimd-resource-scope.js +25 -0
- package/lib/db-entries/cimd-user-scope.d.ts +20 -0
- package/lib/db-entries/cimd-user-scope.js +25 -0
- package/lib/db-entries/daily-active-user.js +2 -2
- package/lib/db-entries/index.d.ts +7 -0
- package/lib/db-entries/index.js +7 -0
- package/lib/db-entries/oidc-session-extension.d.ts +3 -1
- package/lib/db-entries/oidc-session-extension.js +6 -2
- package/lib/db-entries/organization-invitation.js +4 -4
- package/lib/db-entries/organization-role-user-relation.js +2 -2
- package/lib/db-entries/organization-user-relation.js +2 -2
- package/lib/db-entries/organization.d.ts +5 -1
- package/lib/db-entries/organization.js +4 -0
- package/lib/db-entries/personal-access-token.js +2 -2
- package/lib/db-entries/saml-application-config.d.ts +4 -2
- package/lib/db-entries/saml-application-config.js +5 -1
- package/lib/db-entries/secret.js +2 -2
- package/lib/db-entries/sign-in-experience.d.ts +4 -2
- package/lib/db-entries/sign-in-experience.js +5 -1
- package/lib/db-entries/subject-token.js +2 -2
- package/lib/db-entries/trusted-device.d.ts +36 -0
- package/lib/db-entries/trusted-device.js +62 -0
- package/lib/db-entries/user-geo-location.js +2 -2
- package/lib/db-entries/user-sign-in-country.js +2 -2
- package/lib/db-entries/user-sso-identity.js +2 -2
- package/lib/db-entries/user.d.ts +3 -1
- package/lib/db-entries/user.js +6 -2
- package/lib/db-entries/users-role.js +2 -2
- package/lib/db-entries/verification-record.js +2 -2
- package/lib/db-entries/verification-status.js +2 -2
- package/lib/foundations/jsonb-types/account-centers.d.ts +3 -0
- package/lib/foundations/jsonb-types/account-centers.js +1 -0
- package/lib/foundations/jsonb-types/account-centers.test.d.ts +1 -0
- package/lib/foundations/jsonb-types/account-centers.test.js +13 -0
- package/lib/foundations/jsonb-types/captcha.d.ts +47 -1
- package/lib/foundations/jsonb-types/captcha.js +20 -0
- package/lib/foundations/jsonb-types/hooks.d.ts +5 -4
- package/lib/foundations/jsonb-types/hooks.js +3 -0
- package/lib/foundations/jsonb-types/logs.d.ts +18 -0
- package/lib/foundations/jsonb-types/logs.js +6 -0
- package/lib/foundations/jsonb-types/saml-application-configs.d.ts +23 -0
- package/lib/foundations/jsonb-types/saml-application-configs.js +16 -0
- package/lib/foundations/jsonb-types/saml-application-configs.test.js +24 -1
- package/lib/foundations/jsonb-types/sign-in-experience.d.ts +23 -3
- package/lib/foundations/jsonb-types/sign-in-experience.js +9 -0
- package/lib/foundations/jsonb-types/sign-in-experience.test.js +17 -1
- package/lib/types/authentication-context.d.ts +224 -0
- package/lib/types/authentication-context.js +238 -0
- package/lib/types/authentication-context.test.d.ts +1 -0
- package/lib/types/authentication-context.test.js +186 -0
- package/lib/types/connector.d.ts +8 -0
- package/lib/types/consent.d.ts +16 -190
- package/lib/types/consent.js +10 -1
- package/lib/types/cookie.d.ts +4 -0
- package/lib/types/cookie.js +6 -1
- package/lib/types/custom-profile-fields.d.ts +1 -0
- package/lib/types/hook.d.ts +31 -6
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +2 -0
- package/lib/types/interactions.d.ts +161 -0
- package/lib/types/interactions.js +23 -0
- package/lib/types/log/index.d.ts +5 -2
- package/lib/types/log/index.js +1 -0
- package/lib/types/log/interaction.d.ts +15 -2
- package/lib/types/log/interaction.js +5 -0
- package/lib/types/log/trusted-device.d.ts +7 -0
- package/lib/types/log/trusted-device.js +6 -0
- package/lib/types/logto-config/action.d.ts +1 -1
- package/lib/types/logto-config/action.js +1 -1
- package/lib/types/logto-config/index.d.ts +83 -7
- package/lib/types/logto-config/index.js +14 -0
- package/lib/types/logto-config/index.test.js +23 -0
- package/lib/types/logto-config/jwt-customizer.d.ts +123 -10
- package/lib/types/logto-config/jwt-customizer.js +1 -1
- package/lib/types/logto-config/oidc-provider.d.ts +2 -2
- package/lib/types/saml-application.d.ts +55 -1
- package/lib/types/saml-application.js +7 -1
- package/lib/types/service-log.d.ts +14 -1
- package/lib/types/service-log.js +13 -0
- package/lib/types/sign-in-experience.d.ts +20 -6
- package/lib/types/sign-in-experience.js +1 -0
- package/lib/types/ssr.d.ts +2 -0
- package/lib/types/system.d.ts +59 -7
- package/lib/types/system.js +36 -0
- package/lib/types/system.test.d.ts +1 -0
- package/lib/types/system.test.js +26 -0
- package/lib/types/trusted-device.d.ts +67 -0
- package/lib/types/trusted-device.js +16 -0
- package/lib/types/user-sessions.d.ts +195 -209
- package/lib/types/user-sessions.js +9 -4
- package/lib/types/user.d.ts +10 -3
- package/lib/types/user.js +1 -0
- package/lib/types/verification-records/code-verification.d.ts +17 -0
- package/lib/types/verification-records/code-verification.js +1 -0
- package/lib/utils/cimd.d.ts +14 -0
- package/lib/utils/cimd.js +14 -0
- package/lib/utils/cimd.test.d.ts +1 -0
- package/lib/utils/cimd.test.js +9 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/oidc-private-key.test.js +44 -0
- package/package.json +9 -9
- package/tables/aggregated_daily_active_users.sql +1 -1
- package/tables/application_access_control_user_relations.sql +1 -1
- package/tables/application_user_consent_organizations.sql +1 -1
- package/tables/cimd_grant_client_snapshots.sql +27 -0
- package/tables/cimd_grant_organizations.sql +38 -0
- package/tables/cimd_organization_resource_scopes.sql +16 -0
- package/tables/cimd_organization_scopes.sql +15 -0
- package/tables/cimd_resource_scopes.sql +15 -0
- package/tables/cimd_user_scopes.sql +13 -0
- package/tables/daily_active_users.sql +1 -1
- package/tables/oidc_model_instances.sql +5 -0
- package/tables/oidc_session_extensions.sql +6 -1
- package/tables/organization_invitations.sql +2 -2
- package/tables/organization_role_user_relations.sql +1 -1
- package/tables/organization_scopes.sql +4 -0
- package/tables/organization_user_relations.sql +1 -1
- package/tables/organizations.sql +2 -0
- package/tables/personal_access_tokens.sql +1 -1
- package/tables/saml_application_configs.sql +1 -0
- package/tables/scopes.sql +4 -0
- package/tables/secrets.sql +1 -1
- package/tables/service_logs.sql +14 -0
- package/tables/sign_in_experiences.sql +1 -0
- package/tables/subject_tokens.sql +1 -1
- package/tables/trusted_devices.sql +25 -0
- package/tables/user_geo_locations.sql +1 -1
- package/tables/user_sign_in_countries.sql +1 -1
- package/tables/user_sso_identities.sql +1 -1
- package/tables/users.sql +2 -1
- package/tables/users_roles.sql +1 -1
- package/tables/verification_records.sql +1 -1
- package/tables/verification_statuses.sql +1 -1
- package/LICENSE +0 -373
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
userScope: z.string().min(1).max(64),
|
|
6
|
+
});
|
|
7
|
+
const guard = z.object({
|
|
8
|
+
tenantId: z.string().max(21),
|
|
9
|
+
userScope: z.string().min(1).max(64),
|
|
10
|
+
});
|
|
11
|
+
export const CimdUserScopes = Object.freeze({
|
|
12
|
+
table: 'cimd_user_scopes',
|
|
13
|
+
tableSingular: 'cimd_user_scope',
|
|
14
|
+
fields: {
|
|
15
|
+
tenantId: 'tenant_id',
|
|
16
|
+
userScope: 'user_scope',
|
|
17
|
+
},
|
|
18
|
+
fieldKeys: [
|
|
19
|
+
'tenantId',
|
|
20
|
+
'userScope',
|
|
21
|
+
],
|
|
22
|
+
createGuard,
|
|
23
|
+
guard,
|
|
24
|
+
updateGuard: guard.partial(),
|
|
25
|
+
});
|
|
@@ -3,13 +3,13 @@ import { z } from 'zod';
|
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
id: z.string().min(1).max(21),
|
|
5
5
|
tenantId: z.string().max(21).optional(),
|
|
6
|
-
userId: z.string().min(1).max(
|
|
6
|
+
userId: z.string().min(1).max(128),
|
|
7
7
|
date: z.number().optional(),
|
|
8
8
|
});
|
|
9
9
|
const guard = z.object({
|
|
10
10
|
id: z.string().min(1).max(21),
|
|
11
11
|
tenantId: z.string().max(21),
|
|
12
|
-
userId: z.string().min(1).max(
|
|
12
|
+
userId: z.string().min(1).max(128),
|
|
13
13
|
date: z.number(),
|
|
14
14
|
});
|
|
15
15
|
export const DailyActiveUsers = Object.freeze({
|
|
@@ -19,6 +19,12 @@ export * from './application-user-consent-user-scope.js';
|
|
|
19
19
|
export * from './application.js';
|
|
20
20
|
export * from './applications-role.js';
|
|
21
21
|
export * from './captcha-provider.js';
|
|
22
|
+
export * from './cimd-grant-client-snapshot.js';
|
|
23
|
+
export * from './cimd-grant-organization.js';
|
|
24
|
+
export * from './cimd-organization-resource-scope.js';
|
|
25
|
+
export * from './cimd-organization-scope.js';
|
|
26
|
+
export * from './cimd-resource-scope.js';
|
|
27
|
+
export * from './cimd-user-scope.js';
|
|
22
28
|
export * from './connector.js';
|
|
23
29
|
export * from './custom-phrase.js';
|
|
24
30
|
export * from './custom-profile-field.js';
|
|
@@ -67,6 +73,7 @@ export * from './sso-connector-idp-initiated-auth-config.js';
|
|
|
67
73
|
export * from './sso-connector.js';
|
|
68
74
|
export * from './subject-token.js';
|
|
69
75
|
export * from './system.js';
|
|
76
|
+
export * from './trusted-device.js';
|
|
70
77
|
export * from './user-geo-location.js';
|
|
71
78
|
export * from './user-sign-in-country.js';
|
|
72
79
|
export * from './user-sso-identity.js';
|
package/lib/db-entries/index.js
CHANGED
|
@@ -20,6 +20,12 @@ export * from './application-user-consent-user-scope.js';
|
|
|
20
20
|
export * from './application.js';
|
|
21
21
|
export * from './applications-role.js';
|
|
22
22
|
export * from './captcha-provider.js';
|
|
23
|
+
export * from './cimd-grant-client-snapshot.js';
|
|
24
|
+
export * from './cimd-grant-organization.js';
|
|
25
|
+
export * from './cimd-organization-resource-scope.js';
|
|
26
|
+
export * from './cimd-organization-scope.js';
|
|
27
|
+
export * from './cimd-resource-scope.js';
|
|
28
|
+
export * from './cimd-user-scope.js';
|
|
23
29
|
export * from './connector.js';
|
|
24
30
|
export * from './custom-phrase.js';
|
|
25
31
|
export * from './custom-profile-field.js';
|
|
@@ -68,6 +74,7 @@ export * from './sso-connector-idp-initiated-auth-config.js';
|
|
|
68
74
|
export * from './sso-connector.js';
|
|
69
75
|
export * from './subject-token.js';
|
|
70
76
|
export * from './system.js';
|
|
77
|
+
export * from './trusted-device.js';
|
|
71
78
|
export * from './user-geo-location.js';
|
|
72
79
|
export * from './user-sign-in-country.js';
|
|
73
80
|
export * from './user-sso-identity.js';
|
|
@@ -10,6 +10,7 @@ export type CreateOidcSessionExtension = {
|
|
|
10
10
|
accountId: string;
|
|
11
11
|
lastSubmission?: JsonObject;
|
|
12
12
|
clientId?: string | null;
|
|
13
|
+
cimdClientId?: string | null;
|
|
13
14
|
createdAt?: number;
|
|
14
15
|
updatedAt?: number;
|
|
15
16
|
};
|
|
@@ -19,8 +20,9 @@ export type OidcSessionExtension = {
|
|
|
19
20
|
accountId: string;
|
|
20
21
|
lastSubmission: JsonObject;
|
|
21
22
|
clientId: string | null;
|
|
23
|
+
cimdClientId: string | null;
|
|
22
24
|
createdAt: number;
|
|
23
25
|
updatedAt: number;
|
|
24
26
|
};
|
|
25
|
-
export type OidcSessionExtensionKeys = 'tenantId' | 'sessionUid' | 'accountId' | 'lastSubmission' | 'clientId' | 'createdAt' | 'updatedAt';
|
|
27
|
+
export type OidcSessionExtensionKeys = 'tenantId' | 'sessionUid' | 'accountId' | 'lastSubmission' | 'clientId' | 'cimdClientId' | 'createdAt' | 'updatedAt';
|
|
26
28
|
export declare const OidcSessionExtensions: GeneratedSchema<OidcSessionExtensionKeys, CreateOidcSessionExtension, OidcSessionExtension, 'oidc_session_extensions', 'oidc_session_extension'>;
|
|
@@ -4,18 +4,20 @@ import { jsonObjectGuard } from './../foundations/index.js';
|
|
|
4
4
|
const createGuard = z.object({
|
|
5
5
|
tenantId: z.string().max(21).optional(),
|
|
6
6
|
sessionUid: z.string().min(1).max(128),
|
|
7
|
-
accountId: z.string().min(1).max(
|
|
7
|
+
accountId: z.string().min(1).max(128),
|
|
8
8
|
lastSubmission: jsonObjectGuard.optional(),
|
|
9
9
|
clientId: z.string().max(21).nullable().optional(),
|
|
10
|
+
cimdClientId: z.string().max(2048).nullable().optional(),
|
|
10
11
|
createdAt: z.number().optional(),
|
|
11
12
|
updatedAt: z.number().optional(),
|
|
12
13
|
});
|
|
13
14
|
const guard = z.object({
|
|
14
15
|
tenantId: z.string().max(21),
|
|
15
16
|
sessionUid: z.string().min(1).max(128),
|
|
16
|
-
accountId: z.string().min(1).max(
|
|
17
|
+
accountId: z.string().min(1).max(128),
|
|
17
18
|
lastSubmission: jsonObjectGuard,
|
|
18
19
|
clientId: z.string().max(21).nullable(),
|
|
20
|
+
cimdClientId: z.string().max(2048).nullable(),
|
|
19
21
|
createdAt: z.number(),
|
|
20
22
|
updatedAt: z.number(),
|
|
21
23
|
});
|
|
@@ -28,6 +30,7 @@ export const OidcSessionExtensions = Object.freeze({
|
|
|
28
30
|
accountId: 'account_id',
|
|
29
31
|
lastSubmission: 'last_submission',
|
|
30
32
|
clientId: 'client_id',
|
|
33
|
+
cimdClientId: 'cimd_client_id',
|
|
31
34
|
createdAt: 'created_at',
|
|
32
35
|
updatedAt: 'updated_at',
|
|
33
36
|
},
|
|
@@ -37,6 +40,7 @@ export const OidcSessionExtensions = Object.freeze({
|
|
|
37
40
|
'accountId',
|
|
38
41
|
'lastSubmission',
|
|
39
42
|
'clientId',
|
|
43
|
+
'cimdClientId',
|
|
40
44
|
'createdAt',
|
|
41
45
|
'updatedAt',
|
|
42
46
|
],
|
|
@@ -4,9 +4,9 @@ import { OrganizationInvitationStatus } from './custom-types.js';
|
|
|
4
4
|
const createGuard = z.object({
|
|
5
5
|
tenantId: z.string().max(21).optional(),
|
|
6
6
|
id: z.string().min(1).max(21),
|
|
7
|
-
inviterId: z.string().max(
|
|
7
|
+
inviterId: z.string().max(128).nullable().optional(),
|
|
8
8
|
invitee: z.string().min(1).max(256),
|
|
9
|
-
acceptedUserId: z.string().max(
|
|
9
|
+
acceptedUserId: z.string().max(128).nullable().optional(),
|
|
10
10
|
organizationId: z.string().min(1).max(21),
|
|
11
11
|
status: z.nativeEnum(OrganizationInvitationStatus),
|
|
12
12
|
createdAt: z.number().optional(),
|
|
@@ -16,9 +16,9 @@ const createGuard = z.object({
|
|
|
16
16
|
const guard = z.object({
|
|
17
17
|
tenantId: z.string().max(21),
|
|
18
18
|
id: z.string().min(1).max(21),
|
|
19
|
-
inviterId: z.string().max(
|
|
19
|
+
inviterId: z.string().max(128).nullable(),
|
|
20
20
|
invitee: z.string().min(1).max(256),
|
|
21
|
-
acceptedUserId: z.string().max(
|
|
21
|
+
acceptedUserId: z.string().max(128).nullable(),
|
|
22
22
|
organizationId: z.string().min(1).max(21),
|
|
23
23
|
status: z.nativeEnum(OrganizationInvitationStatus),
|
|
24
24
|
createdAt: z.number(),
|
|
@@ -4,13 +4,13 @@ const createGuard = z.object({
|
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
5
|
organizationId: z.string().min(1).max(21),
|
|
6
6
|
organizationRoleId: z.string().min(1).max(21),
|
|
7
|
-
userId: z.string().min(1).max(
|
|
7
|
+
userId: z.string().min(1).max(128),
|
|
8
8
|
});
|
|
9
9
|
const guard = z.object({
|
|
10
10
|
tenantId: z.string().max(21),
|
|
11
11
|
organizationId: z.string().min(1).max(21),
|
|
12
12
|
organizationRoleId: z.string().min(1).max(21),
|
|
13
|
-
userId: z.string().min(1).max(
|
|
13
|
+
userId: z.string().min(1).max(128),
|
|
14
14
|
});
|
|
15
15
|
export const OrganizationRoleUserRelations = Object.freeze({
|
|
16
16
|
table: 'organization_role_user_relations',
|
|
@@ -3,12 +3,12 @@ import { z } from 'zod';
|
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
5
|
organizationId: z.string().min(1).max(21),
|
|
6
|
-
userId: z.string().min(1).max(
|
|
6
|
+
userId: z.string().min(1).max(128),
|
|
7
7
|
});
|
|
8
8
|
const guard = z.object({
|
|
9
9
|
tenantId: z.string().max(21),
|
|
10
10
|
organizationId: z.string().min(1).max(21),
|
|
11
|
-
userId: z.string().min(1).max(
|
|
11
|
+
userId: z.string().min(1).max(128),
|
|
12
12
|
});
|
|
13
13
|
export const OrganizationUserRelations = Object.freeze({
|
|
14
14
|
table: 'organization_user_relations',
|
|
@@ -17,6 +17,8 @@ export type CreateOrganization = {
|
|
|
17
17
|
customData?: JsonObject;
|
|
18
18
|
/** Whether multi-factor authentication configuration is required for the members of the organization. */
|
|
19
19
|
isMfaRequired?: boolean;
|
|
20
|
+
/** Whether trusted devices are allowed for members of the organization. */
|
|
21
|
+
isTrustedDeviceAllowed?: boolean;
|
|
20
22
|
/** The organization's branding color configuration. */
|
|
21
23
|
color?: PartialColor;
|
|
22
24
|
/** The organization's branding configuration. */
|
|
@@ -39,6 +41,8 @@ export type Organization = {
|
|
|
39
41
|
customData: JsonObject;
|
|
40
42
|
/** Whether multi-factor authentication configuration is required for the members of the organization. */
|
|
41
43
|
isMfaRequired: boolean;
|
|
44
|
+
/** Whether trusted devices are allowed for members of the organization. */
|
|
45
|
+
isTrustedDeviceAllowed: boolean;
|
|
42
46
|
/** The organization's branding color configuration. */
|
|
43
47
|
color: PartialColor;
|
|
44
48
|
/** The organization's branding configuration. */
|
|
@@ -48,5 +52,5 @@ export type Organization = {
|
|
|
48
52
|
/** When the organization was created. */
|
|
49
53
|
createdAt: number;
|
|
50
54
|
};
|
|
51
|
-
export type OrganizationKeys = 'tenantId' | 'id' | 'name' | 'description' | 'customData' | 'isMfaRequired' | 'color' | 'branding' | 'customCss' | 'createdAt';
|
|
55
|
+
export type OrganizationKeys = 'tenantId' | 'id' | 'name' | 'description' | 'customData' | 'isMfaRequired' | 'isTrustedDeviceAllowed' | 'color' | 'branding' | 'customCss' | 'createdAt';
|
|
52
56
|
export declare const Organizations: GeneratedSchema<OrganizationKeys, CreateOrganization, Organization, 'organizations', 'organization'>;
|
|
@@ -8,6 +8,7 @@ const createGuard = z.object({
|
|
|
8
8
|
description: z.string().max(256).nullable().optional(),
|
|
9
9
|
customData: jsonObjectGuard.optional(),
|
|
10
10
|
isMfaRequired: z.boolean().optional(),
|
|
11
|
+
isTrustedDeviceAllowed: z.boolean().optional(),
|
|
11
12
|
color: partialColorGuard.optional(),
|
|
12
13
|
branding: brandingGuard.optional(),
|
|
13
14
|
customCss: z.string().nullable().optional(),
|
|
@@ -20,6 +21,7 @@ const guard = z.object({
|
|
|
20
21
|
description: z.string().max(256).nullable(),
|
|
21
22
|
customData: jsonObjectGuard,
|
|
22
23
|
isMfaRequired: z.boolean(),
|
|
24
|
+
isTrustedDeviceAllowed: z.boolean(),
|
|
23
25
|
color: partialColorGuard,
|
|
24
26
|
branding: brandingGuard,
|
|
25
27
|
customCss: z.string().nullable(),
|
|
@@ -35,6 +37,7 @@ export const Organizations = Object.freeze({
|
|
|
35
37
|
description: 'description',
|
|
36
38
|
customData: 'custom_data',
|
|
37
39
|
isMfaRequired: 'is_mfa_required',
|
|
40
|
+
isTrustedDeviceAllowed: 'is_trusted_device_allowed',
|
|
38
41
|
color: 'color',
|
|
39
42
|
branding: 'branding',
|
|
40
43
|
customCss: 'custom_css',
|
|
@@ -47,6 +50,7 @@ export const Organizations = Object.freeze({
|
|
|
47
50
|
'description',
|
|
48
51
|
'customData',
|
|
49
52
|
'isMfaRequired',
|
|
53
|
+
'isTrustedDeviceAllowed',
|
|
50
54
|
'color',
|
|
51
55
|
'branding',
|
|
52
56
|
'customCss',
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
|
-
userId: z.string().min(1).max(
|
|
5
|
+
userId: z.string().min(1).max(128),
|
|
6
6
|
name: z.string().min(1).max(256),
|
|
7
7
|
value: z.string().min(1).max(64),
|
|
8
8
|
createdAt: z.number().optional(),
|
|
@@ -10,7 +10,7 @@ const createGuard = z.object({
|
|
|
10
10
|
});
|
|
11
11
|
const guard = z.object({
|
|
12
12
|
tenantId: z.string().max(21),
|
|
13
|
-
userId: z.string().min(1).max(
|
|
13
|
+
userId: z.string().min(1).max(128),
|
|
14
14
|
name: z.string().min(1).max(256),
|
|
15
15
|
value: z.string().min(1).max(64),
|
|
16
16
|
createdAt: z.number(),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SamlAttributeMapping, SamlAcsUrl, SamlEncryption, NameIdFormat, GeneratedSchema } from './../foundations/index.js';
|
|
1
|
+
import { SamlAttributeMapping, SamlAcsUrl, SamlEncryption, SamlAuthnRequestConfig, NameIdFormat, GeneratedSchema } from './../foundations/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* The SAML application config and SAML-type application have a one-to-one correspondence: 1. a SAML-type application can only have one SAML application config. (CANNOT use "semicolon" in comments, since it indicates the end of query.) 2. a SAML application config can only configure one SAML-type application.
|
|
4
4
|
*
|
|
@@ -12,6 +12,7 @@ export type CreateSamlApplicationConfig = {
|
|
|
12
12
|
entityId?: string | null;
|
|
13
13
|
acsUrl?: SamlAcsUrl | null;
|
|
14
14
|
encryption?: SamlEncryption | null;
|
|
15
|
+
authnRequestConfig?: SamlAuthnRequestConfig | null;
|
|
15
16
|
nameIdFormat: NameIdFormat;
|
|
16
17
|
};
|
|
17
18
|
/** The SAML application config and SAML-type application have a one-to-one correspondence: 1. a SAML-type application can only have one SAML application config. (CANNOT use "semicolon" in comments, since it indicates the end of query.) 2. a SAML application config can only configure one SAML-type application. */
|
|
@@ -22,7 +23,8 @@ export type SamlApplicationConfig = {
|
|
|
22
23
|
entityId: string | null;
|
|
23
24
|
acsUrl: SamlAcsUrl | null;
|
|
24
25
|
encryption: SamlEncryption | null;
|
|
26
|
+
authnRequestConfig: SamlAuthnRequestConfig | null;
|
|
25
27
|
nameIdFormat: NameIdFormat;
|
|
26
28
|
};
|
|
27
|
-
export type SamlApplicationConfigKeys = 'applicationId' | 'tenantId' | 'attributeMapping' | 'entityId' | 'acsUrl' | 'encryption' | 'nameIdFormat';
|
|
29
|
+
export type SamlApplicationConfigKeys = 'applicationId' | 'tenantId' | 'attributeMapping' | 'entityId' | 'acsUrl' | 'encryption' | 'authnRequestConfig' | 'nameIdFormat';
|
|
28
30
|
export declare const SamlApplicationConfigs: GeneratedSchema<SamlApplicationConfigKeys, CreateSamlApplicationConfig, SamlApplicationConfig, 'saml_application_configs', 'saml_application_config'>;
|
|
@@ -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 { samlAttributeMappingGuard, samlAcsUrlGuard, samlEncryptionGuard, nameIdFormatGuard } from './../foundations/index.js';
|
|
3
|
+
import { samlAttributeMappingGuard, samlAcsUrlGuard, samlEncryptionGuard, samlAuthnRequestConfigGuard, nameIdFormatGuard } from './../foundations/index.js';
|
|
4
4
|
const createGuard = z.object({
|
|
5
5
|
applicationId: z.string().min(1).max(21),
|
|
6
6
|
tenantId: z.string().max(21).optional(),
|
|
@@ -8,6 +8,7 @@ const createGuard = z.object({
|
|
|
8
8
|
entityId: z.string().max(128).nullable().optional(),
|
|
9
9
|
acsUrl: samlAcsUrlGuard.nullable().optional(),
|
|
10
10
|
encryption: samlEncryptionGuard.nullable().optional(),
|
|
11
|
+
authnRequestConfig: samlAuthnRequestConfigGuard.nullable().optional(),
|
|
11
12
|
nameIdFormat: nameIdFormatGuard,
|
|
12
13
|
});
|
|
13
14
|
const guard = z.object({
|
|
@@ -17,6 +18,7 @@ const guard = z.object({
|
|
|
17
18
|
entityId: z.string().max(128).nullable(),
|
|
18
19
|
acsUrl: samlAcsUrlGuard.nullable(),
|
|
19
20
|
encryption: samlEncryptionGuard.nullable(),
|
|
21
|
+
authnRequestConfig: samlAuthnRequestConfigGuard.nullable(),
|
|
20
22
|
nameIdFormat: nameIdFormatGuard,
|
|
21
23
|
});
|
|
22
24
|
export const SamlApplicationConfigs = Object.freeze({
|
|
@@ -29,6 +31,7 @@ export const SamlApplicationConfigs = Object.freeze({
|
|
|
29
31
|
entityId: 'entity_id',
|
|
30
32
|
acsUrl: 'acs_url',
|
|
31
33
|
encryption: 'encryption',
|
|
34
|
+
authnRequestConfig: 'authn_request_config',
|
|
32
35
|
nameIdFormat: 'name_id_format',
|
|
33
36
|
},
|
|
34
37
|
fieldKeys: [
|
|
@@ -38,6 +41,7 @@ export const SamlApplicationConfigs = Object.freeze({
|
|
|
38
41
|
'entityId',
|
|
39
42
|
'acsUrl',
|
|
40
43
|
'encryption',
|
|
44
|
+
'authnRequestConfig',
|
|
41
45
|
'nameIdFormat',
|
|
42
46
|
],
|
|
43
47
|
createGuard,
|
package/lib/db-entries/secret.js
CHANGED
|
@@ -4,7 +4,7 @@ import { secretTypeGuard, bufferLikeGuard, jsonObjectGuard } from './../foundati
|
|
|
4
4
|
const createGuard = z.object({
|
|
5
5
|
tenantId: z.string().max(21).optional(),
|
|
6
6
|
id: z.string().min(1).max(21),
|
|
7
|
-
userId: z.string().min(1).max(
|
|
7
|
+
userId: z.string().min(1).max(128),
|
|
8
8
|
type: secretTypeGuard,
|
|
9
9
|
encryptedDek: bufferLikeGuard,
|
|
10
10
|
iv: bufferLikeGuard,
|
|
@@ -17,7 +17,7 @@ const createGuard = z.object({
|
|
|
17
17
|
const guard = z.object({
|
|
18
18
|
tenantId: z.string().max(21),
|
|
19
19
|
id: z.string().min(1).max(21),
|
|
20
|
-
userId: z.string().min(1).max(
|
|
20
|
+
userId: z.string().min(1).max(128),
|
|
21
21
|
type: secretTypeGuard,
|
|
22
22
|
encryptedDek: bufferLikeGuard,
|
|
23
23
|
iv: bufferLikeGuard,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Color, Branding, LanguageInfo, SignIn, SignUp, SocialSignIn, ConnectorTargets, CustomContent, CustomUiAssets, CustomUiCsp, PartialPasswordPolicy, Mfa, AdaptiveMfa, CaptchaPolicy, SentinelPolicy, EmailBlocklistPolicy, VerificationCodePolicy, ForgotPasswordMethods, PasskeySignIn, SignUpProfileFields, PasswordExpirationPolicy, UsernamePolicy, GeneratedSchema } from './../foundations/index.js';
|
|
1
|
+
import { Color, Branding, LanguageInfo, SignIn, SignUp, SocialSignIn, ConnectorTargets, CustomContent, CustomUiAssets, CustomUiCsp, PartialPasswordPolicy, Mfa, AdaptiveMfa, TrustedDevicePolicy, CaptchaPolicy, SentinelPolicy, EmailBlocklistPolicy, VerificationCodePolicy, ForgotPasswordMethods, PasskeySignIn, SignUpProfileFields, PasswordExpirationPolicy, UsernamePolicy, GeneratedSchema } from './../foundations/index.js';
|
|
2
2
|
import { AgreeToTermsPolicy, SignInMode } from './custom-types.js';
|
|
3
3
|
/**
|
|
4
4
|
*
|
|
@@ -28,6 +28,7 @@ export type CreateSignInExperience = {
|
|
|
28
28
|
passwordPolicy?: PartialPasswordPolicy;
|
|
29
29
|
mfa?: Mfa;
|
|
30
30
|
adaptiveMfa?: AdaptiveMfa;
|
|
31
|
+
trustedDevice?: TrustedDevicePolicy;
|
|
31
32
|
singleSignOnEnabled?: boolean;
|
|
32
33
|
supportEmail?: string | null;
|
|
33
34
|
supportWebsiteUrl?: string | null;
|
|
@@ -66,6 +67,7 @@ export type SignInExperience = {
|
|
|
66
67
|
passwordPolicy: PartialPasswordPolicy;
|
|
67
68
|
mfa: Mfa;
|
|
68
69
|
adaptiveMfa: AdaptiveMfa;
|
|
70
|
+
trustedDevice: TrustedDevicePolicy;
|
|
69
71
|
singleSignOnEnabled: boolean;
|
|
70
72
|
supportEmail: string | null;
|
|
71
73
|
supportWebsiteUrl: string | null;
|
|
@@ -81,5 +83,5 @@ export type SignInExperience = {
|
|
|
81
83
|
passwordExpiration: PasswordExpirationPolicy;
|
|
82
84
|
usernamePolicy: UsernamePolicy;
|
|
83
85
|
};
|
|
84
|
-
export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'hideLogtoBranding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'agreeToTermsPolicy' | 'signIn' | 'signUp' | 'socialSignIn' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'customUiAssets' | 'customUiCsp' | 'passwordPolicy' | 'mfa' | 'adaptiveMfa' | 'singleSignOnEnabled' | 'supportEmail' | 'supportWebsiteUrl' | 'unknownSessionRedirectUrl' | 'captchaPolicy' | 'sentinelPolicy' | 'emailBlocklistPolicy' | 'verificationCodePolicy' | 'forgotPasswordMethods' | 'passkeySignIn' | 'signUpProfileFields' | 'passwordExpiration' | 'usernamePolicy';
|
|
86
|
+
export type SignInExperienceKeys = 'tenantId' | 'id' | 'color' | 'branding' | 'hideLogtoBranding' | 'languageInfo' | 'termsOfUseUrl' | 'privacyPolicyUrl' | 'agreeToTermsPolicy' | 'signIn' | 'signUp' | 'socialSignIn' | 'socialSignInConnectorTargets' | 'signInMode' | 'customCss' | 'customContent' | 'customUiAssets' | 'customUiCsp' | 'passwordPolicy' | 'mfa' | 'adaptiveMfa' | 'trustedDevice' | 'singleSignOnEnabled' | 'supportEmail' | 'supportWebsiteUrl' | 'unknownSessionRedirectUrl' | 'captchaPolicy' | 'sentinelPolicy' | 'emailBlocklistPolicy' | 'verificationCodePolicy' | 'forgotPasswordMethods' | 'passkeySignIn' | 'signUpProfileFields' | 'passwordExpiration' | 'usernamePolicy';
|
|
85
87
|
export declare const SignInExperiences: GeneratedSchema<SignInExperienceKeys, CreateSignInExperience, SignInExperience, 'sign_in_experiences', 'sign_in_experience'>;
|
|
@@ -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 { colorGuard, brandingGuard, languageInfoGuard, signInGuard, signUpGuard, socialSignInGuard, connectorTargetsGuard, customContentGuard, customUiAssetsGuard, customUiCspGuard, partialPasswordPolicyGuard, mfaGuard, adaptiveMfaGuard, captchaPolicyGuard, sentinelPolicyGuard, emailBlocklistPolicyGuard, verificationCodePolicyGuard, forgotPasswordMethodsGuard, passkeySignInGuard, signUpProfileFieldsGuard, passwordExpirationPolicyGuard, usernamePolicyGuard } from './../foundations/index.js';
|
|
3
|
+
import { colorGuard, brandingGuard, languageInfoGuard, signInGuard, signUpGuard, socialSignInGuard, connectorTargetsGuard, customContentGuard, customUiAssetsGuard, customUiCspGuard, partialPasswordPolicyGuard, mfaGuard, adaptiveMfaGuard, trustedDevicePolicyGuard, captchaPolicyGuard, sentinelPolicyGuard, emailBlocklistPolicyGuard, verificationCodePolicyGuard, forgotPasswordMethodsGuard, passkeySignInGuard, signUpProfileFieldsGuard, passwordExpirationPolicyGuard, usernamePolicyGuard } from './../foundations/index.js';
|
|
4
4
|
import { AgreeToTermsPolicy, SignInMode } from './custom-types.js';
|
|
5
5
|
const createGuard = z.object({
|
|
6
6
|
tenantId: z.string().max(21).optional(),
|
|
@@ -24,6 +24,7 @@ const createGuard = z.object({
|
|
|
24
24
|
passwordPolicy: partialPasswordPolicyGuard.optional(),
|
|
25
25
|
mfa: mfaGuard.optional(),
|
|
26
26
|
adaptiveMfa: adaptiveMfaGuard.optional(),
|
|
27
|
+
trustedDevice: trustedDevicePolicyGuard.optional(),
|
|
27
28
|
singleSignOnEnabled: z.boolean().optional(),
|
|
28
29
|
supportEmail: z.string().nullable().optional(),
|
|
29
30
|
supportWebsiteUrl: z.string().nullable().optional(),
|
|
@@ -60,6 +61,7 @@ const guard = z.object({
|
|
|
60
61
|
passwordPolicy: partialPasswordPolicyGuard,
|
|
61
62
|
mfa: mfaGuard,
|
|
62
63
|
adaptiveMfa: adaptiveMfaGuard,
|
|
64
|
+
trustedDevice: trustedDevicePolicyGuard,
|
|
63
65
|
singleSignOnEnabled: z.boolean(),
|
|
64
66
|
supportEmail: z.string().nullable(),
|
|
65
67
|
supportWebsiteUrl: z.string().nullable(),
|
|
@@ -99,6 +101,7 @@ export const SignInExperiences = Object.freeze({
|
|
|
99
101
|
passwordPolicy: 'password_policy',
|
|
100
102
|
mfa: 'mfa',
|
|
101
103
|
adaptiveMfa: 'adaptive_mfa',
|
|
104
|
+
trustedDevice: 'trusted_device',
|
|
102
105
|
singleSignOnEnabled: 'single_sign_on_enabled',
|
|
103
106
|
supportEmail: 'support_email',
|
|
104
107
|
supportWebsiteUrl: 'support_website_url',
|
|
@@ -135,6 +138,7 @@ export const SignInExperiences = Object.freeze({
|
|
|
135
138
|
'passwordPolicy',
|
|
136
139
|
'mfa',
|
|
137
140
|
'adaptiveMfa',
|
|
141
|
+
'trustedDevice',
|
|
138
142
|
'singleSignOnEnabled',
|
|
139
143
|
'supportEmail',
|
|
140
144
|
'supportWebsiteUrl',
|
|
@@ -7,7 +7,7 @@ const createGuard = z.object({
|
|
|
7
7
|
context: jsonObjectGuard.optional(),
|
|
8
8
|
expiresAt: z.number(),
|
|
9
9
|
consumedAt: z.number().nullable().optional(),
|
|
10
|
-
userId: z.string().min(1).max(
|
|
10
|
+
userId: z.string().min(1).max(128),
|
|
11
11
|
createdAt: z.number().optional(),
|
|
12
12
|
creatorId: z.string().min(1).max(32),
|
|
13
13
|
});
|
|
@@ -17,7 +17,7 @@ const guard = z.object({
|
|
|
17
17
|
context: jsonObjectGuard,
|
|
18
18
|
expiresAt: z.number(),
|
|
19
19
|
consumedAt: z.number().nullable(),
|
|
20
|
-
userId: z.string().min(1).max(
|
|
20
|
+
userId: z.string().min(1).max(128),
|
|
21
21
|
createdAt: z.number(),
|
|
22
22
|
creatorId: z.string().min(1).max(32),
|
|
23
23
|
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { BufferLike, GeneratedSchema } from './../foundations/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* A revocable server-side credential that can fulfill sign-in MFA for a user.
|
|
4
|
+
*
|
|
5
|
+
* @remarks This is a type for database creation.
|
|
6
|
+
* @see {@link TrustedDevice} for the original type.
|
|
7
|
+
*/
|
|
8
|
+
export type CreateTrustedDevice = {
|
|
9
|
+
tenantId?: string;
|
|
10
|
+
id: string;
|
|
11
|
+
userId: string;
|
|
12
|
+
secretHash: BufferLike;
|
|
13
|
+
userAgent?: string | null;
|
|
14
|
+
ip?: string | null;
|
|
15
|
+
country?: string | null;
|
|
16
|
+
city?: string | null;
|
|
17
|
+
createdAt?: number;
|
|
18
|
+
lastUsedAt?: number;
|
|
19
|
+
expiresAt: number;
|
|
20
|
+
};
|
|
21
|
+
/** A revocable server-side credential that can fulfill sign-in MFA for a user. */
|
|
22
|
+
export type TrustedDevice = {
|
|
23
|
+
tenantId: string;
|
|
24
|
+
id: string;
|
|
25
|
+
userId: string;
|
|
26
|
+
secretHash: BufferLike;
|
|
27
|
+
userAgent: string | null;
|
|
28
|
+
ip: string | null;
|
|
29
|
+
country: string | null;
|
|
30
|
+
city: string | null;
|
|
31
|
+
createdAt: number;
|
|
32
|
+
lastUsedAt: number;
|
|
33
|
+
expiresAt: number;
|
|
34
|
+
};
|
|
35
|
+
export type TrustedDeviceKeys = 'tenantId' | 'id' | 'userId' | 'secretHash' | 'userAgent' | 'ip' | 'country' | 'city' | 'createdAt' | 'lastUsedAt' | 'expiresAt';
|
|
36
|
+
export declare const TrustedDevices: GeneratedSchema<TrustedDeviceKeys, CreateTrustedDevice, TrustedDevice, 'trusted_devices', 'trusted_device'>;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { bufferLikeGuard } 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(128),
|
|
8
|
+
secretHash: bufferLikeGuard,
|
|
9
|
+
userAgent: z.string().nullable().optional(),
|
|
10
|
+
ip: z.string().nullable().optional(),
|
|
11
|
+
country: z.string().max(16).nullable().optional(),
|
|
12
|
+
city: z.string().nullable().optional(),
|
|
13
|
+
createdAt: z.number().optional(),
|
|
14
|
+
lastUsedAt: z.number().optional(),
|
|
15
|
+
expiresAt: z.number(),
|
|
16
|
+
});
|
|
17
|
+
const guard = z.object({
|
|
18
|
+
tenantId: z.string().max(21),
|
|
19
|
+
id: z.string().min(1).max(21),
|
|
20
|
+
userId: z.string().min(1).max(128),
|
|
21
|
+
secretHash: bufferLikeGuard,
|
|
22
|
+
userAgent: z.string().nullable(),
|
|
23
|
+
ip: z.string().nullable(),
|
|
24
|
+
country: z.string().max(16).nullable(),
|
|
25
|
+
city: z.string().nullable(),
|
|
26
|
+
createdAt: z.number(),
|
|
27
|
+
lastUsedAt: z.number(),
|
|
28
|
+
expiresAt: z.number(),
|
|
29
|
+
});
|
|
30
|
+
export const TrustedDevices = Object.freeze({
|
|
31
|
+
table: 'trusted_devices',
|
|
32
|
+
tableSingular: 'trusted_device',
|
|
33
|
+
fields: {
|
|
34
|
+
tenantId: 'tenant_id',
|
|
35
|
+
id: 'id',
|
|
36
|
+
userId: 'user_id',
|
|
37
|
+
secretHash: 'secret_hash',
|
|
38
|
+
userAgent: 'user_agent',
|
|
39
|
+
ip: 'ip',
|
|
40
|
+
country: 'country',
|
|
41
|
+
city: 'city',
|
|
42
|
+
createdAt: 'created_at',
|
|
43
|
+
lastUsedAt: 'last_used_at',
|
|
44
|
+
expiresAt: 'expires_at',
|
|
45
|
+
},
|
|
46
|
+
fieldKeys: [
|
|
47
|
+
'tenantId',
|
|
48
|
+
'id',
|
|
49
|
+
'userId',
|
|
50
|
+
'secretHash',
|
|
51
|
+
'userAgent',
|
|
52
|
+
'ip',
|
|
53
|
+
'country',
|
|
54
|
+
'city',
|
|
55
|
+
'createdAt',
|
|
56
|
+
'lastUsedAt',
|
|
57
|
+
'expiresAt',
|
|
58
|
+
],
|
|
59
|
+
createGuard,
|
|
60
|
+
guard,
|
|
61
|
+
updateGuard: guard.partial(),
|
|
62
|
+
});
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
|
-
userId: z.string().min(1).max(
|
|
5
|
+
userId: z.string().min(1).max(128),
|
|
6
6
|
latitude: z.number().nullable().optional(),
|
|
7
7
|
longitude: z.number().nullable().optional(),
|
|
8
8
|
updatedAt: z.number().optional(),
|
|
9
9
|
});
|
|
10
10
|
const guard = z.object({
|
|
11
11
|
tenantId: z.string().max(21),
|
|
12
|
-
userId: z.string().min(1).max(
|
|
12
|
+
userId: z.string().min(1).max(128),
|
|
13
13
|
latitude: z.number().nullable(),
|
|
14
14
|
longitude: z.number().nullable(),
|
|
15
15
|
updatedAt: z.number(),
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
const createGuard = z.object({
|
|
4
4
|
tenantId: z.string().max(21).optional(),
|
|
5
|
-
userId: z.string().min(1).max(
|
|
5
|
+
userId: z.string().min(1).max(128),
|
|
6
6
|
country: z.string().min(1).max(16),
|
|
7
7
|
lastSignInAt: z.number().optional(),
|
|
8
8
|
});
|
|
9
9
|
const guard = z.object({
|
|
10
10
|
tenantId: z.string().max(21),
|
|
11
|
-
userId: z.string().min(1).max(
|
|
11
|
+
userId: z.string().min(1).max(128),
|
|
12
12
|
country: z.string().min(1).max(16),
|
|
13
13
|
lastSignInAt: z.number(),
|
|
14
14
|
});
|
|
@@ -4,7 +4,7 @@ import { jsonObjectGuard } from './../foundations/index.js';
|
|
|
4
4
|
const createGuard = z.object({
|
|
5
5
|
tenantId: z.string().max(21).optional(),
|
|
6
6
|
id: z.string().min(1).max(21),
|
|
7
|
-
userId: z.string().min(1).max(
|
|
7
|
+
userId: z.string().min(1).max(128),
|
|
8
8
|
issuer: z.string().min(1).max(256),
|
|
9
9
|
identityId: z.string().min(1).max(128),
|
|
10
10
|
detail: jsonObjectGuard.optional(),
|
|
@@ -15,7 +15,7 @@ const createGuard = z.object({
|
|
|
15
15
|
const guard = z.object({
|
|
16
16
|
tenantId: z.string().max(21),
|
|
17
17
|
id: z.string().min(1).max(21),
|
|
18
|
-
userId: z.string().min(1).max(
|
|
18
|
+
userId: z.string().min(1).max(128),
|
|
19
19
|
issuer: z.string().min(1).max(256),
|
|
20
20
|
identityId: z.string().min(1).max(128),
|
|
21
21
|
detail: jsonObjectGuard,
|
package/lib/db-entries/user.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type CreateUser = {
|
|
|
19
19
|
/** Additional OpenID Connect standard claims that are not included in user's properties. */
|
|
20
20
|
profile?: UserProfile;
|
|
21
21
|
applicationId?: string | null;
|
|
22
|
+
cimdClientId?: string | null;
|
|
22
23
|
identities?: Identities;
|
|
23
24
|
customData?: JsonObject;
|
|
24
25
|
logtoConfig?: JsonObject;
|
|
@@ -44,6 +45,7 @@ export type User = {
|
|
|
44
45
|
/** Additional OpenID Connect standard claims that are not included in user's properties. */
|
|
45
46
|
profile: UserProfile;
|
|
46
47
|
applicationId: string | null;
|
|
48
|
+
cimdClientId: string | null;
|
|
47
49
|
identities: Identities;
|
|
48
50
|
customData: JsonObject;
|
|
49
51
|
logtoConfig: JsonObject;
|
|
@@ -55,5 +57,5 @@ export type User = {
|
|
|
55
57
|
createdAt: number;
|
|
56
58
|
updatedAt: number;
|
|
57
59
|
};
|
|
58
|
-
export type UserKeys = 'tenantId' | 'id' | 'username' | 'primaryEmail' | 'primaryPhone' | 'passwordEncrypted' | 'passwordEncryptionMethod' | 'name' | 'avatar' | 'profile' | 'applicationId' | 'identities' | 'customData' | 'logtoConfig' | 'mfaVerifications' | 'isSuspended' | 'isPasswordExpired' | 'lastSignInAt' | 'passwordUpdatedAt' | 'createdAt' | 'updatedAt';
|
|
60
|
+
export type UserKeys = 'tenantId' | 'id' | 'username' | 'primaryEmail' | 'primaryPhone' | 'passwordEncrypted' | 'passwordEncryptionMethod' | 'name' | 'avatar' | 'profile' | 'applicationId' | 'cimdClientId' | 'identities' | 'customData' | 'logtoConfig' | 'mfaVerifications' | 'isSuspended' | 'isPasswordExpired' | 'lastSignInAt' | 'passwordUpdatedAt' | 'createdAt' | 'updatedAt';
|
|
59
61
|
export declare const Users: GeneratedSchema<UserKeys, CreateUser, User, 'users', 'user'>;
|