import { z } from 'zod'; import { type User } from '../db-entries/index.js'; import { MfaFactor } from '../foundations/index.js'; export declare const userInfoSelectFields: readonly ("name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "identities" | "updatedAt" | "lastSignInAt" | "primaryEmail" | "primaryPhone" | "isSuspended")[]; export declare const userInfoGuard: z.ZodObject; id: z.ZodType; username: z.ZodType; primaryEmail: z.ZodType; primaryPhone: z.ZodType; passwordEncrypted: z.ZodType; passwordEncryptionMethod: z.ZodType; name: z.ZodType; avatar: z.ZodType; profile: z.ZodType; }>, z.ZodTypeDef, Partial<{ familyName: string; givenName: string; middleName: string; nickname: string; preferredUsername: string; profile: string; website: string; gender: string; birthdate: string; zoneinfo: string; locale: string; address: Partial<{ formatted: string; streetAddress: string; locality: string; region: string; postalCode: string; country: string; }>; }>>; applicationId: z.ZodType; identities: z.ZodType | undefined; }>, z.ZodTypeDef, Record | undefined; }>>; customData: z.ZodType; logtoConfig: z.ZodType; mfaVerifications: z.ZodType<({ type: MfaFactor.TOTP; id: string; key: string; createdAt: string; lastUsedAt?: string | undefined; } | { type: MfaFactor.WebAuthn; id: string; createdAt: string; credentialId: string; publicKey: string; counter: number; agent: string; name?: string | undefined; lastUsedAt?: string | undefined; rpId?: string | undefined; transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined; } | { type: MfaFactor.BackupCode; id: string; createdAt: string; codes: { code: string; usedAt?: string | undefined; }[]; lastUsedAt?: string | undefined; })[], z.ZodTypeDef, ({ type: MfaFactor.TOTP; id: string; key: string; createdAt: string; lastUsedAt?: string | undefined; } | { type: MfaFactor.WebAuthn; id: string; createdAt: string; credentialId: string; publicKey: string; counter: number; agent: string; name?: string | undefined; lastUsedAt?: string | undefined; rpId?: string | undefined; transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined; } | { type: MfaFactor.BackupCode; id: string; createdAt: string; codes: { code: string; usedAt?: string | undefined; }[]; lastUsedAt?: string | undefined; })[]>; isSuspended: z.ZodType; lastSignInAt: z.ZodType; createdAt: z.ZodType; updatedAt: z.ZodType; }, "name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "identities" | "updatedAt" | "lastSignInAt" | "primaryEmail" | "primaryPhone" | "isSuspended">, "strip", z.ZodTypeAny, { name: string | null; id: string; applicationId: string | null; username: string | null; createdAt: number; profile: import("../foundations/index.js").UserProfile; avatar: string | null; customData: import("@withtyped/server/lib/types.js").JsonObject; identities: import("../foundations/index.js").Identities; updatedAt: number; lastSignInAt: number | null; primaryEmail: string | null; primaryPhone: string | null; isSuspended: boolean; }, { name: string | null; id: string; applicationId: string | null; username: string | null; createdAt: number; profile: import("../foundations/index.js").UserProfile; avatar: string | null; customData: import("@withtyped/server/lib/types.js").JsonObject; identities: import("../foundations/index.js").Identities; updatedAt: number; lastSignInAt: number | null; primaryEmail: string | null; primaryPhone: string | null; isSuspended: boolean; }>; export type UserInfo = z.infer; export declare const userProfileResponseGuard: z.ZodObject; id: z.ZodType; username: z.ZodType; primaryEmail: z.ZodType; primaryPhone: z.ZodType; passwordEncrypted: z.ZodType; passwordEncryptionMethod: z.ZodType; name: z.ZodType; avatar: z.ZodType; profile: z.ZodType; }>, z.ZodTypeDef, Partial<{ familyName: string; givenName: string; middleName: string; nickname: string; preferredUsername: string; profile: string; website: string; gender: string; birthdate: string; zoneinfo: string; locale: string; address: Partial<{ formatted: string; streetAddress: string; locality: string; region: string; postalCode: string; country: string; }>; }>>; applicationId: z.ZodType; identities: z.ZodType | undefined; }>, z.ZodTypeDef, Record | undefined; }>>; customData: z.ZodType; logtoConfig: z.ZodType; mfaVerifications: z.ZodType<({ type: MfaFactor.TOTP; id: string; key: string; createdAt: string; lastUsedAt?: string | undefined; } | { type: MfaFactor.WebAuthn; id: string; createdAt: string; credentialId: string; publicKey: string; counter: number; agent: string; name?: string | undefined; lastUsedAt?: string | undefined; rpId?: string | undefined; transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined; } | { type: MfaFactor.BackupCode; id: string; createdAt: string; codes: { code: string; usedAt?: string | undefined; }[]; lastUsedAt?: string | undefined; })[], z.ZodTypeDef, ({ type: MfaFactor.TOTP; id: string; key: string; createdAt: string; lastUsedAt?: string | undefined; } | { type: MfaFactor.WebAuthn; id: string; createdAt: string; credentialId: string; publicKey: string; counter: number; agent: string; name?: string | undefined; lastUsedAt?: string | undefined; rpId?: string | undefined; transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined; } | { type: MfaFactor.BackupCode; id: string; createdAt: string; codes: { code: string; usedAt?: string | undefined; }[]; lastUsedAt?: string | undefined; })[]>; isSuspended: z.ZodType; lastSignInAt: z.ZodType; createdAt: z.ZodType; updatedAt: z.ZodType; }, "name" | "id" | "applicationId" | "username" | "createdAt" | "profile" | "avatar" | "customData" | "identities" | "updatedAt" | "lastSignInAt" | "primaryEmail" | "primaryPhone" | "isSuspended"> & { hasPassword: z.ZodOptional; ssoIdentities: z.ZodOptional, "many">>; }, "strip", z.ZodTypeAny, { name: string | null; id: string; applicationId: string | null; username: string | null; createdAt: number; profile: import("../foundations/index.js").UserProfile; avatar: string | null; customData: import("@withtyped/server/lib/types.js").JsonObject; identities: import("../foundations/index.js").Identities; updatedAt: number; lastSignInAt: number | null; primaryEmail: string | null; primaryPhone: string | null; isSuspended: boolean; hasPassword?: boolean | undefined; ssoIdentities?: import("../db-entries/user-sso-identity.js").UserSsoIdentity[] | undefined; }, { name: string | null; id: string; applicationId: string | null; username: string | null; createdAt: number; profile: import("../foundations/index.js").UserProfile; avatar: string | null; customData: import("@withtyped/server/lib/types.js").JsonObject; identities: import("../foundations/index.js").Identities; updatedAt: number; lastSignInAt: number | null; primaryEmail: string | null; primaryPhone: string | null; isSuspended: boolean; hasPassword?: boolean | undefined; ssoIdentities?: import("../db-entries/user-sso-identity.js").UserSsoIdentity[] | undefined; }>; export type UserProfileResponse = z.infer; export declare const userMfaVerificationResponseGuard: z.ZodArray; type: z.ZodNativeEnum; agent: z.ZodOptional; name: z.ZodOptional; remainCodes: z.ZodOptional; }, "strip", z.ZodTypeAny, { type: MfaFactor; id: string; createdAt: string; name?: string | undefined; lastUsedAt?: string | undefined; agent?: string | undefined; remainCodes?: number | undefined; }, { type: MfaFactor; id: string; createdAt: string; name?: string | undefined; lastUsedAt?: string | undefined; agent?: string | undefined; remainCodes?: number | undefined; }>, "many">; export type UserMfaVerificationResponse = z.infer; /** * Internal read-only roles for user tenants. * * @deprecated We don't use internal roles anymore. */ export declare enum InternalRole { /** * Internal admin role for Machine-to-Machine apps in Logto user tenants. * * It should NOT be assigned to any user. */ Admin = "#internal:admin" } export declare enum AdminTenantRole { /** Common user role in admin tenant. */ User = "user", /** The role for machine to machine applications that represent a user tenant and send requests to Logto Cloud. */ TenantApplication = "tenantApplication" } export declare enum PredefinedScope { All = "all" } /** * A user that is featured for display. Usually used in a list of resources that are related to * a group of users. */ export type FeaturedUser = Pick; /** The guard for {@link FeaturedUser}. */ export declare const featuredUserGuard: z.ZodObject; id: z.ZodType; username: z.ZodType; primaryEmail: z.ZodType; primaryPhone: z.ZodType; passwordEncrypted: z.ZodType; passwordEncryptionMethod: z.ZodType; name: z.ZodType; avatar: z.ZodType; profile: z.ZodType; }>, z.ZodTypeDef, Partial<{ familyName: string; givenName: string; middleName: string; nickname: string; preferredUsername: string; profile: string; website: string; gender: string; birthdate: string; zoneinfo: string; locale: string; address: Partial<{ formatted: string; streetAddress: string; locality: string; region: string; postalCode: string; country: string; }>; }>>; applicationId: z.ZodType; identities: z.ZodType | undefined; }>, z.ZodTypeDef, Record | undefined; }>>; customData: z.ZodType; logtoConfig: z.ZodType; mfaVerifications: z.ZodType<({ type: MfaFactor.TOTP; id: string; key: string; createdAt: string; lastUsedAt?: string | undefined; } | { type: MfaFactor.WebAuthn; id: string; createdAt: string; credentialId: string; publicKey: string; counter: number; agent: string; name?: string | undefined; lastUsedAt?: string | undefined; rpId?: string | undefined; transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined; } | { type: MfaFactor.BackupCode; id: string; createdAt: string; codes: { code: string; usedAt?: string | undefined; }[]; lastUsedAt?: string | undefined; })[], z.ZodTypeDef, ({ type: MfaFactor.TOTP; id: string; key: string; createdAt: string; lastUsedAt?: string | undefined; } | { type: MfaFactor.WebAuthn; id: string; createdAt: string; credentialId: string; publicKey: string; counter: number; agent: string; name?: string | undefined; lastUsedAt?: string | undefined; rpId?: string | undefined; transports?: ("usb" | "nfc" | "ble" | "internal" | "cable" | "hybrid" | "smart-card")[] | undefined; } | { type: MfaFactor.BackupCode; id: string; createdAt: string; codes: { code: string; usedAt?: string | undefined; }[]; lastUsedAt?: string | undefined; })[]>; isSuspended: z.ZodType; lastSignInAt: z.ZodType; createdAt: z.ZodType; updatedAt: z.ZodType; }, "name" | "id" | "avatar">, "strip", z.ZodTypeAny, { name: string | null; id: string; avatar: string | null; }, { name: string | null; id: string; avatar: string | null; }>; export declare const consoleUserPreferenceKey = "adminConsolePreferences"; export declare const guideRequestsKey = "guideRequests"; export declare const getUserSocialIdentityResponseGuard: z.ZodObject<{ identity: z.ZodObject<{ userId: z.ZodString; details: z.ZodOptional>>; }, "strip", z.ZodTypeAny, { userId: string; details?: Record | undefined; }, { userId: string; details?: Record | undefined; }>; tokenSecret: z.ZodOptional; id: z.ZodType; userId: z.ZodType; encryptedDek: z.ZodType; iv: z.ZodType; authTag: z.ZodType; ciphertext: z.ZodType; createdAt: z.ZodType; updatedAt: z.ZodType; } & { type: z.ZodLiteral; metadata: z.ZodObject<{ scope: z.ZodOptional; expiresAt: z.ZodOptional; tokenType: z.ZodOptional; hasRefreshToken: z.ZodBoolean; }, "strip", z.ZodTypeAny, { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }, { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }>; connectorId: z.ZodString; identityId: z.ZodString; target: z.ZodString; }, "encryptedDek" | "iv" | "authTag" | "ciphertext">, "strip", z.ZodTypeAny, { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; updatedAt: number; connectorId: string; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; target: string; identityId: string; }, { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; updatedAt: number; connectorId: string; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; target: string; identityId: string; }>>; }, "strip", z.ZodTypeAny, { identity: { userId: string; details?: Record | undefined; }; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; updatedAt: number; connectorId: string; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; target: string; identityId: string; } | undefined; }, { identity: { userId: string; details?: Record | undefined; }; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; updatedAt: number; connectorId: string; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; target: string; identityId: string; } | undefined; }>; export type GetUserSocialIdentityResponse = z.infer; export declare const getUserSsoIdentityResponseGuard: z.ZodObject<{ ssoIdentity: import("../foundations/schemas.js").Guard; tokenSecret: z.ZodOptional; id: z.ZodType; userId: z.ZodType; encryptedDek: z.ZodType; iv: z.ZodType; authTag: z.ZodType; ciphertext: z.ZodType; createdAt: z.ZodType; updatedAt: z.ZodType; } & { type: z.ZodLiteral; metadata: z.ZodObject<{ scope: z.ZodOptional; expiresAt: z.ZodOptional; tokenType: z.ZodOptional; hasRefreshToken: z.ZodBoolean; }, "strip", z.ZodTypeAny, { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }, { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }>; ssoConnectorId: z.ZodString; issuer: z.ZodString; identityId: z.ZodString; }, "encryptedDek" | "iv" | "authTag" | "ciphertext">, "strip", z.ZodTypeAny, { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; issuer: string; updatedAt: number; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; ssoConnectorId: string; identityId: string; }, { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; issuer: string; updatedAt: number; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; ssoConnectorId: string; identityId: string; }>>; }, "strip", z.ZodTypeAny, { ssoIdentity: import("../db-entries/user-sso-identity.js").UserSsoIdentity; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; issuer: string; updatedAt: number; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; ssoConnectorId: string; identityId: string; } | undefined; }, { ssoIdentity: import("../db-entries/user-sso-identity.js").UserSsoIdentity; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; issuer: string; updatedAt: number; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; ssoConnectorId: string; identityId: string; } | undefined; }>; export type GetUserSsoIdentityResponse = z.infer; export declare const getUserAllIdentitiesResponseGuard: z.ZodObject<{ socialIdentities: z.ZodArray>>; }, "strip", z.ZodTypeAny, { userId: string; details?: Record | undefined; }, { userId: string; details?: Record | undefined; }>; tokenSecret: z.ZodOptional; id: z.ZodType; userId: z.ZodType; encryptedDek: z.ZodType; iv: z.ZodType; authTag: z.ZodType; ciphertext: z.ZodType; createdAt: z.ZodType; updatedAt: z.ZodType; } & { type: z.ZodLiteral; metadata: z.ZodObject<{ scope: z.ZodOptional; expiresAt: z.ZodOptional; tokenType: z.ZodOptional; hasRefreshToken: z.ZodBoolean; }, "strip", z.ZodTypeAny, { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }, { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }>; connectorId: z.ZodString; identityId: z.ZodString; target: z.ZodString; }, "encryptedDek" | "iv" | "authTag" | "ciphertext">, "strip", z.ZodTypeAny, { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; updatedAt: number; connectorId: string; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; target: string; identityId: string; }, { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; updatedAt: number; connectorId: string; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; target: string; identityId: string; }>>; } & { target: z.ZodString; }, "strip", z.ZodTypeAny, { target: string; identity: { userId: string; details?: Record | undefined; }; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; updatedAt: number; connectorId: string; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; target: string; identityId: string; } | undefined; }, { target: string; identity: { userId: string; details?: Record | undefined; }; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; updatedAt: number; connectorId: string; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; target: string; identityId: string; } | undefined; }>, "many">; ssoIdentities: z.ZodArray; tokenSecret: z.ZodOptional; id: z.ZodType; userId: z.ZodType; encryptedDek: z.ZodType; iv: z.ZodType; authTag: z.ZodType; ciphertext: z.ZodType; createdAt: z.ZodType; updatedAt: z.ZodType; } & { type: z.ZodLiteral; metadata: z.ZodObject<{ scope: z.ZodOptional; expiresAt: z.ZodOptional; tokenType: z.ZodOptional; hasRefreshToken: z.ZodBoolean; }, "strip", z.ZodTypeAny, { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }, { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }>; ssoConnectorId: z.ZodString; issuer: z.ZodString; identityId: z.ZodString; }, "encryptedDek" | "iv" | "authTag" | "ciphertext">, "strip", z.ZodTypeAny, { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; issuer: string; updatedAt: number; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; ssoConnectorId: string; identityId: string; }, { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; issuer: string; updatedAt: number; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; ssoConnectorId: string; identityId: string; }>>; } & { ssoConnectorId: z.ZodString; }, "strip", z.ZodTypeAny, { ssoConnectorId: string; ssoIdentity: import("../db-entries/user-sso-identity.js").UserSsoIdentity; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; issuer: string; updatedAt: number; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; ssoConnectorId: string; identityId: string; } | undefined; }, { ssoConnectorId: string; ssoIdentity: import("../db-entries/user-sso-identity.js").UserSsoIdentity; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; issuer: string; updatedAt: number; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; ssoConnectorId: string; identityId: string; } | undefined; }>, "many">; }, "strip", z.ZodTypeAny, { ssoIdentities: { ssoConnectorId: string; ssoIdentity: import("../db-entries/user-sso-identity.js").UserSsoIdentity; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; issuer: string; updatedAt: number; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; ssoConnectorId: string; identityId: string; } | undefined; }[]; socialIdentities: { target: string; identity: { userId: string; details?: Record | undefined; }; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; updatedAt: number; connectorId: string; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; target: string; identityId: string; } | undefined; }[]; }, { ssoIdentities: { ssoConnectorId: string; ssoIdentity: import("../db-entries/user-sso-identity.js").UserSsoIdentity; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; issuer: string; updatedAt: number; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; ssoConnectorId: string; identityId: string; } | undefined; }[]; socialIdentities: { target: string; identity: { userId: string; details?: Record | undefined; }; tokenSecret?: { type: import("../foundations/index.js").SecretType; id: string; userId: string; tenantId: string; createdAt: number; updatedAt: number; connectorId: string; metadata: { hasRefreshToken: boolean; scope?: string | undefined; expiresAt?: number | undefined; tokenType?: string | undefined; }; target: string; identityId: string; } | undefined; }[]; }>; export type GetUserAllIdentitiesResponse = z.infer;