import * as _descope_core_js_sdk from '@descope/core-js-sdk'; import _descope_core_js_sdk__default, { DeliveryMethod, UserResponse, LoginOptions, SdkResponse, JWTResponse, AccessKeyLoginOptions, ExchangeAccessKeyResponse } from '@descope/core-js-sdk'; export { DeliveryMethod, JWTResponse, OAuthProvider, ResponseData, SdkResponse } from '@descope/core-js-sdk'; import { JWTHeaderParameters, KeyLike } from 'jose'; /** Parsed JWT token */ interface Token { sub?: string; exp?: number; iss?: string; [claim: string]: unknown; } /** IDP response containing groups, SAML attributes, and OIDC claims from SSO authentication */ interface IDPResponse { idpGroups?: string[]; idpSAMLAttributes?: Record; idpOIDCClaims?: Record; } /** All information regarding token including the raw JWT, parsed JWT and cookies */ interface AuthenticationInfo { jwt: string; token: Token; cookies?: string[]; idpResponse?: IDPResponse; } interface RefreshAuthenticationInfo extends AuthenticationInfo { refreshJwt?: string; } /** Options for token verification (extensible). For now only audience. */ interface VerifyOptions { audience?: string | string[]; } declare type DeliveryMethodForTestUser = DeliveryMethod | 'Embedded'; declare type ExpirationUnit = 'minutes' | 'hours' | 'days' | 'weeks'; /** * Represents a tenant association for a User or Access Key. The tenantId is required to denote * which tenant the user or access key belongs to. The roleNames array is an optional list of * roles for the user or access key in this specific tenant. */ declare type AssociatedTenant = { tenantId: string; roleNames: string[]; }; /** The tenantId of a newly created tenant */ declare type CreateTenantResponse = { id: string; }; declare type GenerateSSOConfigurationLinkResponse = { adminSSOConfigurationLink: string; }; /** * Options to create or update an OIDC application. * * **Note:** When updating, `id` will be required to perform the operation */ declare type OidcApplicationOptions = { name: string; loginPageUrl: string; id?: string; description?: string; logo?: string; enabled?: boolean; forceAuthentication?: boolean; }; /** * Options to create or update a SAML application. * * **Note:** When updating, `id` will be required to perform the operation */ declare type SamlApplicationOptions = { name: string; loginPageUrl: string; id?: string; description?: string; logo?: string; enabled?: boolean; useMetadataInfo?: boolean; metadataUrl?: string; entityId?: string; acsUrl?: string; certificate?: string; attributeMapping?: SamlIdpAttributeMappingInfo[]; groupsMapping?: SamlIdpGroupsMappingInfo[]; acsAllowedCallbacks?: string[]; subjectNameIdType?: string; subjectNameIdFormat?: string; defaultRelayState?: string; forceAuthentication?: boolean; logoutRedirectUrl?: string; /** The signature algorithm used to sign SAML responses. Only applies to IdP-initiated flows — * SP-initiated flows use the algorithm from the SP's SAML request. * Use "sha256" for SHA-256; leave empty for the default (SHA-1). */ defaultSignatureAlgorithm?: string; }; /** * Options to create or update a WS-Fed application. * * **Note:** When updating, `id` will be required to perform the operation */ declare type WsFedApplicationOptions = { name: string; loginPageUrl: string; id?: string; description?: string; logo?: string; enabled?: boolean; realm: string; replyUrl: string; attributeMapping?: SamlIdpAttributeMappingInfo[]; groupsMapping?: SamlIdpGroupsMappingInfo[]; forceAuthentication?: boolean; logoutRedirectUrl?: string; errorRedirectUrl?: string; }; /** * Represents a SAML IDP attribute mapping object. Use this class for mapping Descope attribute * to the relevant SAML Assertion attributes matching your expected SP attributes names. */ declare type SamlIdpAttributeMappingInfo = { name: string; type: string; value: string; }; /** Represents a SAML IDP Role Group mapping object. */ declare type SAMLIDPRoleGroupMappingInfo = { id: string; name: string; }; /** * Represents a SAML IDP groups mapping object. Use this class for mapping Descope roles * to the relevant SAML Assertion groups attributes that matching your expected SP groups attributes names. */ declare type SamlIdpGroupsMappingInfo = { name: string; type: string; filterType: string; value: string; roles: SAMLIDPRoleGroupMappingInfo[]; }; /** The ID of a newly created SSO application */ declare type CreateSSOApplicationResponse = { id: string; }; /** An access key that can be used to access descope */ declare type AccessKey = { id: string; name: string; expiredTime: number; roleNames: string[]; keyTenants?: AssociatedTenant[]; status: string; createdTime: number; expiresTime: number; createdBy: string; clientId: string; boundUserId?: string; description?: string; permittedIps?: string[]; }; /** Access Key extended details including created key cleartext */ declare type CreatedAccessKeyResponse = { key: AccessKey; cleartext: string; }; /** Represents a mapping between a set of groups of users and a role that will be assigned to them */ declare type RoleMapping = { groups: string[]; roleName: string; }; declare type RoleMappings = RoleMapping[]; /** Represents a mapping between Descope and IDP user attributes */ declare type AttributeMapping = { name?: string; email?: string; username?: string; phoneNumber?: string; givenName?: string; middleName?: string; familyName?: string; picture?: string; verifiedEmail?: string; verifiedPhone?: string; group?: string; customAttributes?: Record; }; /** Cross-App Access (XAA / ID-JAG) trusted-issuer settings, including per-issuer JIT provisioning and * user attribute mapping (parity with the SSO login JIT). Group-to-role mapping reuses the tenant's * shared SSO group mapping. */ declare type XAAIssuerSettings = { jwksUri?: string; signAlgorithm?: string; userInfoUri?: string; externalIdFieldName?: string; /** When true, the exchange only signs in an already-provisioned user (no JIT creation). */ jitDisabled?: boolean; /** Maps assertion claims to Descope user fields. */ attributeMapping?: AttributeMapping; }; /** Cross-App Access (XAA / ID-JAG) trust config: the set of trusted issuers, keyed by issuer URL. */ declare type JWTBearerSettings = { issuers?: Record; jwtBearerGrantTypeAudienceToUse?: string; jwtBearerGrantTypeScopeToUse?: string; jwtBearerGrantTypeCustomClaimsToUse?: string; }; /** A single ReBAC/FGA relation grant. */ declare type XAAFGAGroupMappingRelation = { resource: string; relationDefinition: string; namespace: string; }; /** ReBAC/FGA group grants for a single group. */ declare type XAAFGAGroupMapping = { relations: XAAFGAGroupMappingRelation[]; }; /** Cross-App Access (XAA / ID-JAG) write payload for a single SSO configuration of a tenant. * `settings` holds the trusted issuers (keyed by issuer URL) and jwt-bearer grant configuration; the * remaining fields are the config-level shared group/role mapping, which is shared across * SAML / OIDC / SCIM / XAA for the sso_id (NOT a per-issuer mapping). Role references are by name. */ declare type XAASettings = { enabled?: boolean; settings?: JWTBearerSettings; roleMappings?: RoleMappings; defaultSSORoles?: string[]; fgaMappings?: Record; groupsPriority?: string[]; groupPriorityEnabled?: boolean; allowOverrideRoles?: boolean; providerID?: string; }; /** Load-shape of a single SSO configuration's XAA (ID-JAG) settings. `groupsMapping` is normalized on * load to `{ roleName, groups }` (matching the SAML settings load transform) so it round-trips back * into `configureXAASettings`. */ declare type XAASettingsResponse = { ssoId?: string; enabled?: boolean; settings?: JWTBearerSettings; groupsMapping?: RoleMappings; defaultSSORoles?: string[]; fgaMappings?: Record; groupsPriority?: string[]; groupPriorityEnabled?: boolean; allowOverrideRoles?: boolean; providerID?: string; }; /** UpdateJWT response with a new JWT value with the added custom claims */ declare type UpdateJWTResponse = { jwt: string; }; /** Client assertion JWT response for OAuth flows */ declare type ClientAssertionResponse = { jwt: string; }; /** Represents a tenant in a project. It has an id, a name and an array of * self provisioning domains used to associate users with that tenant. */ /** Authentication type of an SSO configuration. `none` means the configuration is disabled: it * keeps its stored settings, mappings and domains, and serves no logins until it is set back to * `saml` or `oidc`. */ declare type SSOAuthType = 'none' | 'saml' | 'oidc'; declare type Tenant = { id: string; name: string; selfProvisioningDomains: string[]; createdTime: number; customAttributes?: Record; domains?: string[]; authType?: SSOAuthType; enforceSSO?: boolean; disabled?: boolean; defaultRoles?: string[]; }; declare type SSOSetupSuiteSettingsDisabledFeatures = { saml?: boolean; oidc?: boolean; scim?: boolean; ssoDomains?: boolean; groupMapping?: boolean; }; declare type SSOSetupSuiteSettings = { enabled?: boolean; styleId?: string; disabledFeatures?: SSOSetupSuiteSettingsDisabledFeatures; }; /** Represents settings of a tenant in a project. It has an id, a name and an array of * self provisioning domains used to associate users with that tenant. */ declare type TenantSettings = { selfProvisioningDomains: string[]; domains?: string[]; authType?: SSOAuthType; enabled?: boolean; refreshTokenExpiration?: number; refreshTokenExpirationUnit?: ExpirationUnit; sessionTokenExpiration?: number; sessionTokenExpirationUnit?: ExpirationUnit; stepupTokenExpiration?: number; stepupTokenExpirationUnit?: ExpirationUnit; enableInactivity?: boolean; InactivityTime?: number; InactivityTimeUnit?: ExpirationUnit; JITDisabled?: boolean; ssoSetupSuiteSettings?: SSOSetupSuiteSettings; }; /** Represents password settings of a tenant in a project. It has the password policy details. */ declare type PasswordSettings = { enabled: boolean; minLength: number; lowercase: boolean; uppercase: boolean; number: boolean; nonAlphaNumeric: boolean; expiration: boolean; expirationWeeks: number; reuse: boolean; reuseAmount: number; lock: boolean; lockAttempts: number; }; /** Represents OIDC settings of an SSO application in a project. */ declare type SSOApplicationOIDCSettings = { loginPageUrl: string; issuer: string; discoveryUrl: string; forceAuthentication: boolean; }; /** Represents SAML settings of an SSO application in a project. */ declare type SSOApplicationSAMLSettings = { loginPageUrl: string; idpCert: string; useMetadataInfo: boolean; metadataUrl: string; entityId: string; acsUrl: string; certificate: string; attributeMapping: SamlIdpAttributeMappingInfo[]; groupsMapping: SamlIdpGroupsMappingInfo[]; idpMetadataUrl: string; idpEntityId: string; idpSsoUrl: string; acsAllowedCallbacks: string[]; subjectNameIdType: string; subjectNameIdFormat: string; defaultRelayState: string; forceAuthentication: boolean; idpLogoutUrl: string; logoutRedirectUrl: string; /** The signature algorithm used to sign SAML responses. Only applies to IdP-initiated flows — * SP-initiated flows use the algorithm from the SP's SAML request. * "sha256" means SHA-256; empty string means the default (SHA-1). */ defaultSignatureAlgorithm?: string; }; /** Represents WS-Fed settings of an SSO application in a project. */ declare type SSOApplicationWSFedSettings = { loginPageUrl: string; realm: string; replyUrl: string; attributeMapping: SamlIdpAttributeMappingInfo[]; groupsMapping: SamlIdpGroupsMappingInfo[]; forceAuthentication: boolean; logoutRedirectUrl: string; errorRedirectUrl: string; idpInitiatedUrl?: string; idpMetadataUrl?: string; idpEntityId?: string; idpSsoUrl?: string; idpCert?: string; }; /** Represents an SSO application in a project. */ declare type SSOApplication = { id: string; name: string; description: string; enabled: boolean; logo: string; appType: string; samlSettings: SSOApplicationSAMLSettings; oidcSettings: SSOApplicationOIDCSettings; wsfedSettings?: SSOApplicationWSFedSettings; }; declare type SSOApplicationSecretResponse = { cleartext: string; }; /** Represents a permission in a project. It has a name and optionally a description. * It also has a flag indicating whether it is system default or not. */ declare type Permission = { name: string; description?: string; systemDefault: boolean; }; /** Represents a role in a project. It has a name and optionally a description and * a list of permissions it grants. */ declare type Role = { name: string; description?: string; permissionNames: string[]; createdTime: number; tenantId?: string; default?: boolean; private?: boolean; id?: string; }; /** Search roles based on the parameters */ declare type RoleSearchOptions = { tenantIds?: string[]; roleNames?: string[]; roleNameLike?: string; permissionNames?: string[]; includeProjectRoles?: boolean; }; /** Represents a group in a project. It has an id and display name and a list of group members. */ declare type Group = { id: string; display: string; members?: GroupMember[]; /** Origin of the group: "scim" (default) or "jit" (SSO SAML/OIDC assertion groups). */ source?: string; /** * The SSO configuration the group came from (the ssoId bound to the SCIM token that created it, * or the SSO configuration used at the JIT login that persisted it). Groups from the tenant's * default SSO configuration report the reserved id "default_ssoid". */ ssoId?: string; }; /** Represents a group member. It has loginId, userId and display. */ declare type GroupMember = { loginId: string; userId: string; display: string; }; declare type Flow = { id: string; name: string; description?: string; dsl: any; disabled: boolean; etag?: string; }; declare type FlowMetadata = { id: string; name: string; description?: string; disabled: boolean; }; declare type Screen = { id: string; flowId: string; inputs?: any; interactions?: any; htmlTemplate: any; }; declare type FlowsResponse = { flows: FlowMetadata[]; total: number; }; declare type FlowResponse = { flow: Flow; screens: Screen[]; }; declare type RunManagementFlowResponse = { output: Record; }; declare type Theme = { id: string; cssTemplate?: any; }; declare type ThemeResponse = { theme: Theme; }; declare type GenerateOTPForTestResponse = { loginId: string; code: string; }; declare type GenerateMagicLinkForTestResponse = { loginId: string; link: string; }; declare type GenerateEnchantedLinkForTestResponse = { loginId: string; link: string; pendingRef: string; }; declare type GenerateEmbeddedLinkResponse = { token: string; }; declare type AttributesTypes = string | boolean | number | string[] | null; declare type TemplateOptions = Record; declare type User = { email?: string; phone?: string; displayName?: string; roles?: string[]; userTenants?: AssociatedTenant[]; customAttributes?: Record; picture?: string; verifiedEmail?: boolean; verifiedPhone?: boolean; test?: boolean; additionalLoginIds?: string[]; password?: string; hashedPassword?: UserPasswordHashed; seed?: string; status?: UserStatus; createdTime?: number; } & ({ /** The login ID or user ID of the user. When a userId is provided, the user must * already exist — no new user is created, and the invite is sent to the existing * user (useful for re-inviting). */ loginIdOrUserId: string; /** @deprecated Use loginIdOrUserId instead */ loginId?: string; } | { /** @deprecated Use loginIdOrUserId instead */ loginId: string; loginIdOrUserId?: string; }); declare type UserPasswordHashed = { bcrypt?: UserPasswordBcrypt; pbkdf2?: UserPasswordPbkdf2; firebase?: UserPasswordFirebase; django?: UserPasswordDjango; phpass?: UserPasswordPhpass; md5?: UserPasswordMd5; }; declare type UserPasswordBcrypt = { hash: string; }; declare type UserPasswordPbkdf2 = { hash: string; salt: string; iterations: number; type: 'sha1' | 'sha256' | 'sha512'; }; declare type UserPasswordFirebase = { hash: string; salt: string; saltSeparator: string; signerKey: string; memory: number; rounds: number; }; declare type UserPasswordDjango = { hash: string; }; declare type UserPasswordPhpass = { hash: string; salt: string; iterations: number; type: 'md5' | 'sha512'; }; declare type UserPasswordMd5 = { hash: string; }; declare type UserMapping = { name: string; email: string; username: string; phoneNumber: string; }; declare type RoleItem = { id: string; name: string; }; declare type GroupsMapping = { role: RoleItem; groups: string[]; }; declare type SSOSettingsResponse = { tenantId: string; idpEntityId: string; idpSSOUrl: string; idpCertificate: string; idpMetadataUrl: string; spEntityId: string; spACSUrl: string; spCertificate: string; userMapping: UserMapping; groupsMapping: GroupsMapping[]; redirectUrl: string; domains: string[]; domain: string; }; declare type SSOSAMLSettingsResponse = { idpEntityId: string; idpSSOUrl: string; idpCertificate: string; idpMetadataUrl: string; spEntityId: string; spACSUrl: string; spCertificate: string; attributeMapping: AttributeMapping; groupsMapping: RoleMappings; defaultSSORoles: string[]; redirectUrl: string; providerID?: string; scimProviderID?: string; /** Epoch seconds of the last successful SSO test login on this configuration (read-only) */ lastSuccessTestTime?: number; }; declare type SSOSettings = { tenant: Tenant; saml?: SSOSAMLSettingsResponse; oidc?: SSOOIDCSettings; ssoId?: string; }; declare type OIDCAttributeMapping = { loginId?: string; name?: string; email?: string; username?: string; phoneNumber?: string; givenName?: string; middleName?: string; familyName?: string; picture?: string; group?: string; verifiedEmail?: string; verifiedPhone?: string; customAttributes?: Record; }; declare type OIDCRoleMapping = Array<{ roleName: string; groups: string[]; }>; declare type Prompt = 'none' | 'login' | 'consent' | 'select_account'; declare type SSOOIDCSettings = { name: string; clientId: string; clientSecret?: string; redirectUrl?: string; authUrl?: string; tokenUrl?: string; userDataUrl?: string; scope?: string[]; JWKsUrl?: string; attributeMapping?: OIDCAttributeMapping; manageProviderTokens?: boolean; callbackDomain?: string; prompt?: Prompt[]; grantType?: 'authorization_code' | 'implicit'; issuer?: string; roleMappings?: OIDCRoleMapping; providerID?: string; scimProviderID?: string; /** Epoch seconds of the last successful SSO test login on this configuration (read-only, ignored on configure) */ lastSuccessTestTime?: number; }; declare type SSOSAMLSettings = { idpUrl: string; idpCert: string; entityId: string; roleMappings?: RoleMappings; attributeMapping?: AttributeMapping; defaultSSORoles?: string[]; spACSUrl?: string; spEntityId?: string; }; declare type SSOSAMLByMetadataSettings = { idpMetadataUrl: string; /** IdP entity ID - set so IdP-initiated login can resolve the tenant by the SAML response issuer */ entityId?: string; roleMappings?: RoleMappings; attributeMapping?: AttributeMapping; defaultSSORoles?: string[]; spACSUrl?: string; spEntityId?: string; }; declare type ProviderTokenOptions = { withRefreshToken?: boolean; forceRefresh?: boolean; }; declare type ProviderTokenResponse = { provider: string; providerUserId: string; accessToken: string; expiration: number; scopes: string[]; }; declare type UserFailedResponse = { failure: string; user: UserResponse; }; declare type CreateOrInviteBatchResponse = { createdUsers: UserResponse[]; failedUsers: UserFailedResponse[]; additionalErrors: Record; }; declare type PatchUserBatchResponse = { patchedUsers: UserResponse[]; failedUsers: UserFailedResponse[]; additionalErrors: Record; }; declare type UserSearchResponse = { users: UserResponse[]; total: number; }; /** * Search options to filter which audit records we should retrieve. * All parameters are optional. `From` is currently limited to 30 days. */ declare type AuditSearchOptions = { userIds?: string[]; actions?: string[]; excludedActions?: string[]; devices?: string[]; methods?: string[]; geos?: string[]; remoteAddresses?: string[]; loginIds?: string[]; tenants?: string[]; noTenants?: boolean; text?: string; from?: number; to?: number; }; declare type AuditType = 'info' | 'warn' | 'error'; /** Audit create options for creating audit event */ declare type AuditCreateOptions = { userId?: string; action: string; type: AuditType; actorId: string; tenantId: string; data?: Record; }; /** Audit record response from the audit trail. Occurred is in milliseconds. */ declare type AuditRecord = { projectId: string; userId: string; action: string; occurred: number; device: string; method: string; geo: string; remoteAddress: string; loginIds: string[]; tenants: string[]; data: Record; }; /** Response for the searchAll audit method, including the total number of matching records. */ declare type AuditSearchAllResponse = { audits: AuditRecord[]; total: number; }; /** Basic authentication for an HTTP connector. */ declare type ConnectorHTTPBasicAuthentication = { username?: string; password?: string; }; /** API key authentication for an HTTP connector. */ declare type ConnectorHTTPAPIKeyAuthentication = { key?: string; token?: string; }; /** Authentication configuration for an HTTP connector. */ declare type ConnectorHTTPAuthentication = { bearerToken?: string; basic?: ConnectorHTTPBasicAuthentication; apiKey?: ConnectorHTTPAPIKeyAuthentication; }; /** Filters that determine which audit events are streamed by an audit webhook. */ declare type AuditFilters = { key?: string; operator?: string; values?: string[]; }; /** Configuration for an audit webhook connector. */ declare type AuditWebhook = { name: string; description?: string; url?: string; authentication?: ConnectorHTTPAuthentication; hmacSecret?: string; headers?: Record; insecure?: boolean; filters?: AuditFilters[]; }; declare type UserStatus = 'enabled' | 'disabled' | 'invited' | 'expired'; declare type AuthzNodeExpressionType = 'self' | 'targetSet' | 'relationLeft' | 'relationRight'; /** * AuthzNodeExpression holds the definition of a child node */ declare type AuthzNodeExpression = { neType: AuthzNodeExpressionType; relationDefinition?: string; relationDefinitionNamespace?: string; targetRelationDefinition?: string; targetRelationDefinitionNamespace?: string; }; declare type AuthzNodeType = 'child' | 'union' | 'intersect' | 'sub'; /** * AuthzNode holds the definition of a complex relation definition */ declare type AuthzNode = { nType: AuthzNodeType; children?: AuthzNode[]; expression?: AuthzNodeExpression; }; /** * AuthzRelationDefinition defines a relation within a namespace */ declare type AuthzRelationDefinition = { name: string; complexDefinition?: AuthzNode; }; /** * AuthzNamespace defines an entity in the authorization schema */ declare type AuthzNamespace = { name: string; relationDefinitions: AuthzRelationDefinition[]; }; /** * AuthzSchema holds the full schema (all namespaces) for a project */ declare type AuthzSchema = { name?: string; namespaces: AuthzNamespace[]; }; /** * AuthzUserQuery represents a target of a relation for ABAC (query on users) */ declare type AuthzUserQuery = { tenants?: string[]; roles?: string[]; text?: string; statuses?: UserStatus[]; ssoOnly?: boolean; withTestUser?: boolean; customAttributes?: Record; }; declare type AuthzResource = { resource: string; }; /** * AuthzRelation defines a relation between resource and target */ declare type AuthzRelation = { resource: string; relationDefinition: string; namespace: string; target?: string; targetSetResource?: string; targetSetRelationDefinition?: string; targetSetRelationDefinitionNamespace?: string; query?: AuthzUserQuery; }; /** * AuthzRelationQuery queries the service if a given relation exists */ declare type AuthzRelationQuery = { resource: string; relationDefinition: string; namespace: string; target: string; hasRelation?: boolean; }; /** * AuthzModified has the list of resources and targets that were modified since given time returned from GetModified */ declare type AuthzModified = { resources: string[]; targets: string[]; schemaChanged: boolean; }; declare type ProjectEnvironment = 'production'; declare type ExportSnapshotResponse = { /** All project settings and configurations represented as JSON files */ files: Record; }; declare type ImportSnapshotRequest = { /** All project settings and configurations represented as JSON files */ files: Record; /** * An optional map of project entities and their secrets that will be * injected into the snapshot before import (see below) */ inputSecrets?: SnapshotSecrets; }; declare type ValidateSnapshotRequest = { /** All project settings and configurations represented as JSON files */ files: Record; /** * An optional map of project entities and their secrets that will be * injected into the snapshot before validation (see below) */ inputSecrets?: SnapshotSecrets; }; declare type ValidateSnapshotResponse = { /** Whether the validation passed or not (true if and only if `failures` is empty) */ ok: boolean; /** An array with `string` representations of any validation failures that were found */ failures?: string[]; /** * An optional object that lists which if any secret values need to be provided in * the request for an `importSnapshot` call so it doesn't fail (see below) */ missingSecrets?: SnapshotSecrets; }; declare type SnapshotSecrets = { /** Any missing or input secrets for connectors in a snapshot */ connectors?: SnapshotSecret[]; /** Any missing or input secrets for OAuth providers in a snapshot */ oauthProviders?: SnapshotSecret[]; }; declare type SnapshotSecret = { /** The id of the project entity that requires this secret */ id: string; /** The name of the project entity that requires this secret */ name: string; /** The type of secret, e.g., "bearertoken", "password" */ type: string; /** * The cleartext value of the secret. This value must not be empty when used in * request objects when calling ValidateSnapshot and ImportSnapshot. Conversely, * this value is an empty string when returned in ValidateSnapshotResponse to * signify that this is a missing secret. */ value: string; }; declare type CloneProjectResponse = { projectId: string; projectName: string; environment?: string; tags?: string[]; }; declare type Project = { id: string; name: string; environment?: string; tags?: string[]; }; declare type FGASchema = { dsl: string; }; declare type FGARelation = { resource: string; resourceType?: string; relation: string; target: string; targetType?: string; }; declare type CheckResponseRelation = { allowed: boolean; tuple: FGARelation; }; interface FGAResourceIdentifier { resourceId: string; resourceType: string; } interface FGAResourceDetails { resourceId: string; resourceType: string; displayName: string; } declare type FGASchemaDryRunResponse = { deletesPreview?: { hasDeletes: boolean; relations?: string[]; types?: string[]; }; }; declare type FGAMappableResource = { resource: string; }; declare type FGAMappableResources = { type: string; resources: FGAMappableResource[]; }; declare type FGAMappableSchema = { schema?: AuthzSchema | null; mappableResources?: FGAMappableResources[]; }; declare type FGAMappableResourcesQuery = { type: string; queries: string[]; }; declare type FGAMappableResourcesOptions = { resourcesLimit?: number; }; /** * Configuration for FGA cache proxy support. * When fgaCacheUrl is provided along with managementKey, certain FGA operations * will be routed through the cache proxy for improved performance. */ declare type FGAConfig = { fgaCacheUrl?: string; fgaCacheTimeoutMs?: number; managementKey?: string; projectId: string; headers: Record; }; declare type MgmtLoginOptions = Omit & { jwt?: string; refreshDuration?: number; }; declare type MgmtSignUpOptions = { customClaims?: Record; refreshDuration?: number; }; interface UserOptions { email?: string; phone?: string; displayName?: string; roles?: string[]; userTenants?: AssociatedTenant[]; customAttributes?: Record; picture?: string; verifiedEmail?: boolean; verifiedPhone?: boolean; givenName?: string; middleName?: string; familyName?: string; additionalLoginIds?: string[]; ssoAppIds?: string[]; } declare type MgmtUserOptions = Omit & { name?: string; }; declare type InboundApplicationScope = { name: string; description: string; values?: string[]; optional?: boolean; }; /** * Represents an inbound application request in a project. * This type is used to create a new inbound application in a project. */ declare type InboundApplicationOptions = { name: string; description?: string; logo?: string; loginPageUrl?: string; approvedCallbackUrls?: string[]; permissionsScopes: InboundApplicationScope[]; attributesScopes?: InboundApplicationScope[]; }; /** * Represents an inbound application in a project. */ declare type InboundApplication = InboundApplicationOptions & { id: string; clientId: string; }; declare type InboundApplicationSecretResponse = { cleartext: string; }; declare type CreateInboundApplicationResponse = { id: string; clientId: string; } & InboundApplicationSecretResponse; /** * Represents an inbound application consent for a single application * for a specific user within the project. */ declare type InboundApplicationConsent = { id: string; appId: string; userId: string; scopes: string[]; grantedBy: string; createdTime: number; }; declare type InboundApplicationConsentSearchOptions = { appId?: string; userId?: string; consentId?: string; page?: number; }; declare type InboundApplicationConsentDeleteOptions = { consentIds?: string[]; appId?: string; userIds?: string[]; }; declare type InboundApplicationTenantConsentDeleteOptions = { consentIds?: string[]; appId?: string; tenantId?: string; }; declare type PromptType = 'none' | 'login' | 'consent' | 'select_account'; declare type AccessType = 'offline' | 'online'; declare type OutboundApplication = { id: string; name: string; description?: string; clientId?: string; logo?: string; discoveryUrl?: string; authorizationUrl?: string; authorizationUrlParams?: URLParam[]; tokenUrl?: string; tokenUrlParams?: URLParam[]; revocationUrl?: string; defaultScopes?: string[]; defaultRedirectUrl?: string; callbackDomain?: string; pkce?: boolean; accessType?: AccessType; prompt?: Array; useDcr?: boolean; dcrUrl?: string; }; declare type OutboundAppTemplateOverrides = { name?: string; description?: string; logo?: string; discoveryUrl?: string; authorizationUrl?: string; authorizationUrlParams?: URLParam[]; tokenUrl?: string; tokenUrlParams?: URLParam[]; revocationUrl?: string; defaultScopes?: string[]; defaultRedirectUrl?: string; callbackDomain?: string; pkce?: boolean; accessType?: AccessType; prompt?: Array; useDcr?: boolean; dcrUrl?: string; }; declare type CreateOutboundAppByTemplateOptions = { templateId: string; id?: string; clientId?: string; clientSecret?: string; tenantId?: string; overrides?: OutboundAppTemplateOverrides; }; declare type URLParam = { key: string; value: string; }; declare type FetchOutboundAppTokenOptions = { withRefreshToken?: boolean; forceRefresh?: boolean; }; declare type OutboundAppToken = { id: string; appId: string; userId: string; tenantId?: string; accessToken: string; accessTokenExpiry?: number; refreshToken?: string; hasRefreshToken?: boolean; scopes?: string[]; grantedBy?: string; }; declare type FetchOutboundAppUserTokenRequest = { appId: string; userId: string; scopes: string[]; options?: FetchOutboundAppTokenOptions; tenantId?: string; }; declare type OutboundAppTokenResponse = { token: OutboundAppToken; }; declare type FetchLatestOutboundAppUserTokenRequest = { appId: string; userId: string; tenantId?: string; options?: FetchOutboundAppTokenOptions; }; declare type FetchOutboundAppTenantTokenRequest = { appId: string; tenantId: string; scopes: string[]; options?: FetchOutboundAppTokenOptions; }; declare type FetchLatestOutboundAppTenantTokenRequest = { appId: string; tenantId: string; options?: FetchOutboundAppTokenOptions; }; /** * A single OAuth token to upload (migrate) for a user. At least one of `refreshToken` or * `accessToken` must be provided. `accessTokenExpiry` is in epoch seconds (0/absent means unknown). * Used both as a single-upload payload and as a batch item. */ declare type OutboundAppUserTokenToUpload = { appId: string; userId: string; tenantId?: string; refreshToken?: string; accessToken?: string; accessTokenExpiry?: number; accessTokenType?: string; scopes?: string[]; externalIdentifier?: string; idToken?: string; grantedBy?: string; }; /** * A single OAuth token to upload (migrate) for a tenant. At least one of `refreshToken` or * `accessToken` must be provided. */ declare type OutboundAppTenantTokenToUpload = { appId: string; tenantId: string; refreshToken?: string; accessToken?: string; accessTokenExpiry?: number; accessTokenType?: string; scopes?: string[]; externalIdentifier?: string; idToken?: string; grantedBy?: string; }; /** * Single-upload payload for a user OAuth token. When `verifyRefresh` is true, the refresh token is * verified against the provider before persisting; nothing is written if verification fails. */ declare type UploadOutboundAppUserTokenRequest = OutboundAppUserTokenToUpload & { verifyRefresh?: boolean; }; /** * Single-upload payload for a tenant OAuth token. See `UploadOutboundAppUserTokenRequest`. */ declare type UploadOutboundAppTenantTokenRequest = OutboundAppTenantTokenToUpload & { verifyRefresh?: boolean; }; /** A single per-item failure returned by the batch upload endpoints. */ declare type OutboundAppTokenUploadFailure = { appId: string; userId?: string; tenantId?: string; errorCode: string; reason: string; }; /** * Response from the batch upload endpoints. Batch upload is all-or-nothing: a non-empty `failures` * array means no tokens were committed. */ declare type BatchUploadOutboundAppTokensResponse = { failures: OutboundAppTokenUploadFailure[]; }; declare type ManagementFlowOptions = { input?: Record; preview?: boolean; tenant?: string; }; declare type DescoperRole = 'admin' | 'developer' | 'support' | 'auditor'; declare type DescoperAttributes = { displayName?: string; email?: string; phone?: string; }; declare type DescoperTagRole = { tags?: string[]; role?: DescoperRole; }; declare type DescoperProjectRole = { projectIds?: string[]; role?: DescoperRole; }; declare type DescoperRBAC = { isCompanyAdmin?: boolean; tags?: DescoperTagRole[]; projects?: DescoperProjectRole[]; }; declare type Descoper = { id?: string; loginIds?: string[]; attributes?: DescoperAttributes; rbac?: DescoperRBAC; status?: string; }; declare type DescoperCreate = { loginId?: string; attributes?: DescoperAttributes; sendInvite?: boolean; rbac?: DescoperRBAC; }; declare type MgmtKeyStatus = 'active' | 'inactive'; declare type MgmtKeyReBac = { companyRoles?: string[]; projectRoles?: MgmtKeyProjectRole[]; tagRoles?: MgmtKeyTagRole[]; }; declare type MgmtKeyTagRole = { tags: string[]; roles: string[]; }; declare type MgmtKeyProjectRole = { projectIds: string[]; roles: string[]; }; declare type MgmtKey = { id: string; name: string; description?: string; status: MgmtKeyStatus; createdTime: number; expireTime: number; permittedIps?: string[]; reBac?: MgmtKeyReBac; version?: number; authzVersion?: number; }; declare type MgmtKeyCreateResponse = { key: MgmtKey; cleartext: string; }; declare type License = { rateLimitTier: string; }; /** Represents an engine in a project. `secret` is populated only on create and * rotateSecret; it is always empty on load/loadAll. */ declare type Engine = { id: string; name: string; secret?: string; createdTime?: number; }; /** Response of an engine secret rotation. */ declare type EngineSecretResponse = { secret: string; }; /** A single option for a custom attribute of type "select". */ declare type CustomAttributeOption = { value?: string; label?: string; }; /** Represents a custom attribute definition in the project schema. */ declare type CustomAttribute = { name?: string; type?: number; options?: CustomAttributeOption[]; displayName?: string; defaultValue?: any; viewPermissions?: string[]; editPermissions?: string[]; }; /** A registered passkey (WebAuthn credential) for a user. */ declare type UserPasskey = { id?: string; rpId?: string; kind?: string; displayName?: string; createdTime?: number; }; /** A trusted device associated with a user. */ declare type UserTrustedDevice = { id?: string; name?: string; deviceType?: string; lastLoginTime?: number; expirationTime?: number; lastLocation?: string; }; /** A single failure entry returned from a user import. */ declare type UserImportFailure = { user: string; reason: string; }; /** Response of a user import operation. */ declare type UserImportResponse = { users?: UserResponse[]; failures?: UserImportFailure[]; }; /** Request to update an existing permission by its ID as part of a batch update. */ declare type PermissionUpdateRequest = { id: string; newName: string; description?: string; }; /** Request to update an existing role by its ID as part of a batch update. */ declare type RoleUpdateRequest = { id: string; newName: string; description?: string; permissionNames?: string[]; tenantId?: string; default?: boolean; }; /** The type of a project list (currently "ip" or "text"). */ declare type ListType = string; /** Represents a project list of IPs or texts. */ declare type List = { id?: string; name?: string; description?: string; type?: ListType; data?: any; }; /** Request payload for creating or updating a list. */ declare type ListRequest = { name: string; description?: string; type: ListType; data?: any; }; /** Represents a JWT template configuration. */ declare type JWTTemplate = { id?: string; name?: string; description?: string; template?: Record; source?: string; tags?: string[]; authSchema?: string; type?: string; conformanceIssuer?: boolean; autoDCT?: boolean; enforceIssuer?: boolean; emptyClaimPolicy?: string; overrideSubject?: boolean; issuerType?: string; omitCustomClaimsFromDSR?: boolean; addJti?: boolean; excludePermissions?: boolean; }; /** A single validation issue found while validating a JWT template. */ declare type JWTTemplateValidationIssue = { message?: string; severity?: string; path?: string; }; /** Result of validating a JWT template. */ declare type JWTTemplateValidationResult = { valid: boolean; issues?: JWTTemplateValidationIssue[]; }; /** A JWT template entry available in the shared template library. */ declare type JWTTemplateLibraryEntry = JWTTemplate & { experimental?: boolean; logoLight?: string; logoDark?: string; }; /** Request payload for applying a JWT template from the library. */ declare type ApplyJWTTemplateFromLibraryRequest = { libraryEntryId: string; nameOverride?: string; descriptionOverride?: string; tagsOverride?: string[]; templateOverride?: Record; }; /** A single scope-to-claims mapping entry. */ declare type ScopeClaimMappingEntry = { scope?: string; claims?: Record; description?: string; }; /** Options for searching analytics records. Time fields are epoch milliseconds. */ declare type AnalyticsSearchOptions = { actions?: string[]; excludedActions?: string[]; from?: number; to?: number; devices?: string[]; methods?: string[]; geos?: string[]; tenants?: string[]; groupByAction?: boolean; groupByDevice?: boolean; groupByMethod?: boolean; groupByGeo?: boolean; groupByTenant?: boolean; groupByReferrer?: boolean; groupByCreated?: string; }; /** A single analytics record returned from an analytics search. */ declare type AnalyticRecord = { projectId?: string; action?: string; created?: string; device?: string; method?: string; geo?: string; tenant?: string; referrer?: string; cnt?: string; }; interface PatchUserOptions { email?: string; phone?: string; displayName?: string; roles?: string[]; userTenants?: AssociatedTenant[]; customAttributes?: Record; picture?: string; verifiedEmail?: boolean; verifiedPhone?: boolean; givenName?: string; middleName?: string; familyName?: string; ssoAppIds?: string[]; scim?: boolean; status?: UserStatus; additionalIdentifiers?: string[]; } /** User options for batch patch operations, identifying the user by loginIdOrUserId or loginId */ declare type PatchUserOptionsUsingIdentifier = PatchUserOptions & ({ loginIdOrUserId: string; /** @deprecated Use loginIdOrUserId instead */ loginId?: string; } | { /** @deprecated Use loginIdOrUserId instead */ loginId: string; loginIdOrUserId?: string; }); /** Configuration arguments which include the Descope core SDK args and an optional management key */ declare type NodeSdkArgs = Parameters[0] & { managementKey?: string; authManagementKey?: string; publicKey?: string; fgaCacheUrl?: string; }; declare const nodeSdk: { ({ authManagementKey, managementKey, publicKey, fgaCacheUrl, ...config }: NodeSdkArgs): { refresh: (token?: string, externalToken?: string) => Promise>; management: { user: { create: { (loginId: string, options?: UserOptions & { templateId?: string; }): Promise>; (loginId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[], templateId?: string): Promise>; }; createTestUser: { (loginId: string, options?: UserOptions): Promise>; (loginId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[]): Promise>; }; invite: { (loginIdOrUserId: string, options?: UserOptions & { inviteUrl?: string; sendMail?: boolean; sendSMS?: boolean; templateOptions?: TemplateOptions; templateId?: string; locale?: string; }): Promise>; (loginIdOrUserId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, inviteUrl?: string, sendMail?: boolean, sendSMS?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[], templateId?: string, locale?: string): Promise>; }; inviteBatch: (users: User[], inviteUrl?: string, sendMail?: boolean, sendSMS?: boolean, templateOptions?: TemplateOptions, templateId?: string, locale?: string) => Promise>; createBatch: (users: User[]) => Promise>; deleteBatch: (userIds: string[]) => Promise>; update: { (loginIdOrUserId: string, options?: UserOptions): Promise>; (loginIdOrUserId: string, email?: string, phone?: string, displayName?: string, roles?: string[], userTenants?: AssociatedTenant[], customAttributes?: Record, picture?: string, verifiedEmail?: boolean, verifiedPhone?: boolean, givenName?: string, middleName?: string, familyName?: string, additionalLoginIds?: string[]): Promise>; }; patch: (loginIdOrUserId: string, options: PatchUserOptions) => Promise>; patchBatch: (users: PatchUserOptionsUsingIdentifier[]) => Promise>; delete: (loginIdOrUserId: string) => Promise>; deleteByUserId: (userId: string) => Promise>; deleteAllTestUsers: () => Promise>; load: (loginIdOrUserId: string) => Promise>; loadByUserId: (userId: string) => Promise>; logoutUser: (loginId: string) => Promise>; logoutUserByUserId: (userId: string) => Promise>; loadUsers: (userIds: string[], includeInvalidUsers?: boolean) => Promise>; searchAll: (tenantIds?: string[], roles?: string[], limit?: number, page?: number, testUsersOnly?: boolean, withTestUser?: boolean, customAttributes?: Record, statuses?: UserStatus[], emails?: string[], phones?: string[]) => Promise>; searchTestUsers: (searchReq: { page?: number; limit?: number; sort?: { field: string; desc?: boolean; }[]; text?: string; emails?: string[]; phones?: string[]; statuses?: UserStatus[]; roles?: string[]; tenantIds?: string[]; customAttributes?: Record; withTestUser?: boolean; testUsersOnly?: boolean; ssoAppIds?: string[]; loginIds?: string[]; userIds?: string[]; fromCreatedTime?: number; toCreatedTime?: number; fromModifiedTime?: number; toModifiedTime?: number; tenantRoleIds?: Record; tenantRoleNames?: Record; verifiedEmail?: boolean; verifiedPhone?: boolean; }) => Promise>; search: (searchReq: { page?: number; limit?: number; sort?: { field: string; desc?: boolean; }[]; text?: string; emails?: string[]; phones?: string[]; statuses?: UserStatus[]; roles?: string[]; tenantIds?: string[]; customAttributes?: Record; withTestUser?: boolean; testUsersOnly?: boolean; ssoAppIds?: string[]; loginIds?: string[]; userIds?: string[]; fromCreatedTime?: number; toCreatedTime?: number; fromModifiedTime?: number; toModifiedTime?: number; tenantRoleIds?: Record; tenantRoleNames?: Record; verifiedEmail?: boolean; verifiedPhone?: boolean; }) => Promise>; getProviderToken: (loginId: string, provider: string, providerTokenOptions?: ProviderTokenOptions) => Promise>; activate: (loginIdOrUserId: string) => Promise>; deactivate: (loginIdOrUserId: string) => Promise>; updateLoginId: (loginId: string, newLoginId?: string) => Promise>; updateEmail: (loginIdOrUserId: string, email: string, isVerified: boolean, failOnConflict?: boolean) => Promise>; updatePhone: (loginIdOrUserId: string, phone: string, isVerified: boolean, failOnConflict?: boolean) => Promise>; updateDisplayName: (loginIdOrUserId: string, displayName?: string, givenName?: string, middleName?: string, familyName?: string) => Promise>; updatePicture: (loginIdOrUserId: string, picture: string) => Promise>; updateCustomAttribute: (loginIdOrUserId: string, attributeKey: string, attributeValue: AttributesTypes) => Promise>; setRoles: (loginIdOrUserId: string, roles: string[]) => Promise>; addRoles: (loginIdOrUserId: string, roles: string[]) => Promise>; removeRoles: (loginIdOrUserId: string, roles: string[]) => Promise>; addTenant: (loginIdOrUserId: string, tenantId: string) => Promise>; removeTenant: (loginIdOrUserId: string, tenantId: string) => Promise>; setTenantRoles: (loginIdOrUserId: string, tenantId: string, roles: string[]) => Promise>; addTenantRoles: (loginIdOrUserId: string, tenantId: string, roles: string[]) => Promise>; removeTenantRoles: (loginIdOrUserId: string, tenantId: string, roles: string[]) => Promise>; addSSOapps: (loginIdOrUserId: string, ssoAppIds: string[]) => Promise>; setSSOapps: (loginIdOrUserId: string, ssoAppIds: string[]) => Promise>; removeSSOapps: (loginIdOrUserId: string, ssoAppIds: string[]) => Promise>; generateOTPForTestUser: (deliveryMethod: DeliveryMethodForTestUser, loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise>; generateMagicLinkForTestUser: (deliveryMethod: DeliveryMethodForTestUser, loginId: string, uri: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise>; generateEnchantedLinkForTestUser: (loginId: string, uri: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise>; generateEmbeddedLink: (loginId: string, customClaims?: Record, timeout?: number) => Promise>; generateSignUpEmbeddedLink: (loginId: string, user?: { name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; email?: string; }, emailVerified?: boolean, phoneVerified?: boolean, loginOptions?: _descope_core_js_sdk.LoginOptions, timeout?: number) => Promise>; setTemporaryPassword: (loginId: string, password: string) => Promise>; setActivePassword: (loginId: string, password: string) => Promise>; setPassword: (loginId: string, password: string) => Promise>; expirePassword: (loginId: string) => Promise>; removeAllPasskeys: (loginId: string) => Promise>; removeTOTPSeed: (loginId: string) => Promise>; removeRecoveryCodes: (loginIdOrUserId: string) => Promise>; history: (userIds: string[]) => Promise>; import: (source: string, users?: string | Uint8Array, hashes?: string | Uint8Array, dryrun?: boolean) => Promise>; updateRecoveryEmail: (loginIdOrUserId: string, email: string, isVerified?: boolean) => Promise>; updateRecoveryPhone: (loginIdOrUserId: string, phone: string, isVerified?: boolean) => Promise>; updateUserNames: (loginIdOrUserId: string, givenName?: string, middleName?: string, familyName?: string) => Promise>; getCustomAttributes: () => Promise>; createCustomAttributes: (attributes: CustomAttribute[]) => Promise>; deleteCustomAttributes: (names: string[]) => Promise>; removePasskey: (loginId: string, credentialId: string) => Promise>; listPasskeys: (loginId: string) => Promise>; listTrustedDevices: (loginIdsOrUserIds: string[]) => Promise>; removeTrustedDevices: (loginIdOrUserId: string, deviceIds: string[]) => Promise>; }; project: { updateName: (name: string) => Promise>; updateTags: (tags: string[]) => Promise>; delete: () => Promise>; clone: (name: string, environment?: "production", tags?: string[]) => Promise>; listProjects: () => Promise>; exportSnapshot: () => Promise>; importSnapshot: (request: ImportSnapshotRequest) => Promise>; validateSnapshot: (request: ValidateSnapshotRequest) => Promise>; export: () => Promise>>; import: (files: Record) => Promise>; }; accessKey: { create: (name: string, expireTime: number, roles?: string[], tenants?: AssociatedTenant[], userId?: string, customClaims?: Record, description?: string, permittedIps?: string[], customAttributes?: Record) => Promise>; load: (id: string) => Promise>; searchAll: (tenantIds?: string[], boundUserId?: string, creatingUser?: string, customAttributes?: Record) => Promise>; update: (id: string, name: string, description?: string, roles?: string[], tenants?: AssociatedTenant[], customClaims?: Record, permittedIps?: string[], customAttributes?: Record) => Promise>; deactivate: (id: string) => Promise>; deactivateBatch: (ids: string[]) => Promise>; activate: (id: string) => Promise>; activateBatch: (ids: string[]) => Promise>; delete: (id: string) => Promise>; deleteBatch: (ids: string[]) => Promise>; rotate: (id: string) => Promise>; }; tenant: { create: (name: string, selfProvisioningDomains?: string[], customAttributes?: Record, enforceSSO?: boolean, disabled?: boolean, parent?: string, roleInheritance?: "" | "none" | "userOnly") => Promise>; createWithId: (id: string, name: string, selfProvisioningDomains?: string[], customAttributes?: Record, enforceSSO?: boolean, disabled?: boolean, parent?: string, roleInheritance?: "" | "none" | "userOnly") => Promise>; update: (id: string, name: string, selfProvisioningDomains?: string[], customAttributes?: Record, enforceSSO?: boolean, disabled?: boolean, roleInheritance?: "" | "none" | "userOnly") => Promise>; updateDefaultRoles: (id: string, defaultRoles: string[]) => Promise>; delete: (id: string, cascade?: boolean) => Promise>; load: (id: string) => Promise>; loadAll: () => Promise>; searchAll: (ids?: string[], names?: string[], selfProvisioningDomains?: string[], customAttributes?: Record, parentTenantId?: string) => Promise>; getSettings: (tenantId: string) => Promise>; configureSettings: (tenantId: string, settings: TenantSettings) => Promise>; generateSSOConfigurationLink: (tenantId: string, expireDuration: number, ssoId?: string, email?: string, templateId?: string, actorId?: string) => Promise>; revokeSSOConfigurationLink: (tenantId: string, ssoId?: string) => Promise>; }; ssoApplication: { createOidcApplication: (options: OidcApplicationOptions) => Promise>; createSamlApplication: (options: SamlApplicationOptions) => Promise>; updateOidcApplication: (options: OidcApplicationOptions & { id: string; }) => Promise>; updateSamlApplication: (options: SamlApplicationOptions & { id: string; }) => Promise>; createWsFedApplication: (options: WsFedApplicationOptions) => Promise>; updateWsFedApplication: (options: WsFedApplicationOptions & { id: string; }) => Promise>; delete: (id: string) => Promise>; load: (id: string) => Promise>; loadAll: () => Promise>; getApplicationSecret: (id: string) => Promise>; rotateApplicationSecret: (id: string) => Promise>; }; inboundApplication: { createApplication: (options: InboundApplicationOptions) => Promise>; updateApplication: (options: InboundApplicationOptions & { id: string; }) => Promise>; patchApplication: (options: Partial & { id: string; }) => Promise>; deleteApplication: (id: string) => Promise>; deleteApplicationBatch: (ids: string[]) => Promise>; loadApplication: (id: string) => Promise>; loadAllApplications: () => Promise>; getApplicationSecret: (id: string) => Promise>; rotateApplicationSecret: (id: string) => Promise>; searchConsents: (options?: InboundApplicationConsentSearchOptions) => Promise>; deleteConsents: (options: InboundApplicationConsentDeleteOptions) => Promise>; deleteTenantConsents: (options: InboundApplicationTenantConsentDeleteOptions) => Promise>; }; outboundApplication: { createApplication: (app: Omit & Partial> & { clientSecret?: string; }) => Promise>; createApplicationByTemplate: (options: CreateOutboundAppByTemplateOptions) => Promise>; updateApplication: (app: OutboundApplication & { clientSecret?: string; }) => Promise>; deleteApplication: (id: string) => Promise>; loadApplication: (id: string) => Promise>; loadAllApplications: () => Promise>; fetchTokenByScopes: (appId: string, userId: string, scopes: string[], options?: FetchOutboundAppTokenOptions, tenantId?: string) => Promise>; fetchToken: (appId: string, userId: string, tenantId?: string, options?: FetchOutboundAppTokenOptions) => Promise>; fetchTenantTokenByScopes: (appId: string, tenantId: string, scopes: string[], options?: FetchOutboundAppTokenOptions) => Promise>; fetchTenantToken: (appId: string, tenantId: string, options?: FetchOutboundAppTokenOptions) => Promise>; deleteUserTokens: (appId?: string, userId?: string) => Promise>; deleteTokenById: (id: string) => Promise>; listAppsWithUserToken: (userId: string, tenantId?: string) => Promise>; uploadUserApiKey: (appId: string, userId: string, apiKey: string, tenantId?: string) => Promise>; uploadTenantApiKey: (appId: string, tenantId: string, apiKey: string) => Promise>; uploadUserToken: (token: UploadOutboundAppUserTokenRequest) => Promise>; uploadTenantToken: (token: UploadOutboundAppTenantTokenRequest) => Promise>; batchUploadUserTokens: (tokens: OutboundAppUserTokenToUpload[]) => Promise>; batchUploadTenantTokens: (tokens: OutboundAppTenantTokenToUpload[]) => Promise>; }; sso: { getSettings: (tenantId: string) => Promise>; newSettings: (tenantId: string, ssoId: string, displayName: string) => Promise>; deleteSettings: (tenantId: string, ssoId?: string) => Promise>; configureSettings: (tenantId: string, idpURL: string, idpCert: string, entityId: string, redirectURL: string, domains: string[]) => Promise>; configureMetadata: (tenantId: string, idpMetadataURL: string, redirectURL: string, domains: string[]) => Promise>; configureMapping: (tenantId: string, roleMappings?: RoleMappings, attributeMapping?: AttributeMapping, defaultSSORoles?: string[]) => Promise>; configureOIDCSettings: (tenantId: string, settings: SSOOIDCSettings, domains?: string[], ssoId?: string) => Promise>; configureAuthType: (tenantId: string, authType: SSOAuthType, ssoId?: string) => Promise>; configureSAMLSettings: (tenantId: string, settings: SSOSAMLSettings, redirectUrl?: string, domains?: string[], ssoId?: string) => Promise>; configureSAMLByMetadata: (tenantId: string, settings: SSOSAMLByMetadataSettings, redirectUrl?: string, domains?: string[], ssoId?: string) => Promise>; configureSSORedirectURL: (tenantId: string, samlRedirectUrl?: string, oauthRedirectUrl?: string, ssoId?: string) => Promise>; recalculateSSOMappings: (tenantId: string, ssoId?: string) => Promise>; loadSettings: (tenantId: string, ssoId?: string) => Promise>; loadAllSettings: (tenantId: string) => Promise>; configureXAASettings: (tenantId: string, settings: XAASettings, ssoId?: string) => Promise>; loadXAASettings: (tenantId: string, ssoId?: string) => Promise>; loadAllXAASettings: (tenantId: string) => Promise>; deleteXAASettings: (tenantId: string, ssoId?: string) => Promise>; }; jwt: { update: (jwt: string, customClaims?: Record, refreshDuration?: number) => Promise>; impersonate: (impersonatorId: string, loginId: string, validateConsent: boolean, customClaims?: Record, selectedTenant?: string, refreshDuration?: number) => Promise>; impersonateStepup: (impersonatorId: string, loginId: string, validateConsent: boolean, customClaims?: Record, selectedTenant?: string, refreshDuration?: number) => Promise>; stopImpersonation: (jwt: string, customClaims?: Record, selectedTenant?: string, refreshDuration?: number) => Promise>; signIn: (loginId: string, loginOptions?: MgmtLoginOptions) => Promise>; signUp: (loginId: string, user?: MgmtUserOptions, signUpOptions?: MgmtSignUpOptions) => Promise>; signUpOrIn: (loginId: string, user?: MgmtUserOptions, signUpOptions?: MgmtSignUpOptions) => Promise>; anonymous: (customClaims?: Record, selectedTenant?: string, refreshDuration?: number) => Promise>; generateClientAssertionJwt: (issuer: string, subject: string, audience: string[], expiresIn: number, flattenAudience?: boolean, algorithm?: "RS256" | "RS384" | "ES384") => Promise>; }; permission: { create: (name: string, description?: string) => Promise>; createBatch: (permissions: Permission[]) => Promise>; update: (name: string, newName: string, description?: string) => Promise>; updateWithId: (id: string, newName: string, description?: string) => Promise>; updateBatch: (permissions: PermissionUpdateRequest[]) => Promise>; delete: (name: string) => Promise>; deleteWithId: (id: string) => Promise>; deleteBatch: (names?: string[], ids?: string[]) => Promise>; loadAll: () => Promise>; }; password: { getSettings: (tenantId: string) => Promise>; configureSettings: (tenantId: string, settings: PasswordSettings) => Promise>; }; role: { create: (name: string, description?: string, permissionNames?: string[], tenantId?: string, defaultRole?: boolean) => Promise>; createBatch: (roles: Role[]) => Promise>; /** Configuration arguments which include the Descope core SDK args and an optional management key */ update: (name: string, newName: string, description?: string, permissionNames?: string[], tenantId?: string, defaultRole?: boolean) => Promise>; updateWithId: (id: string, newName: string, description?: string, permissionNames?: string[], tenantId?: string, defaultRole?: boolean) => Promise>; updateBatch: (roles: RoleUpdateRequest[]) => Promise>; delete: (name: string, tenantId?: string) => Promise>; deleteWithId: (id: string, tenantId?: string) => Promise>; deleteBatch: (roleNames?: string[], tenantId?: string, roleIds?: string[]) => Promise>; loadAll: () => Promise>; search: (options: RoleSearchOptions) => Promise>; }; group: { loadAllGroups: (tenantId: string, ssoId?: string) => Promise>; loadAllGroupsForMember: (tenantId: string, userIds: string[], loginIds: string[], ssoId?: string) => Promise>; loadAllGroupMembers: (tenantId: string, groupId: string, ssoId?: string) => Promise>; }; flow: { list: () => Promise>; delete: (flowIds: string[]) => Promise>; export: (flowId: string) => Promise>; import: (flowId: string, flow: Flow, screens?: Screen[]) => Promise>; run: (flowId: string, options?: ManagementFlowOptions) => Promise>>; }; theme: { export: () => Promise>; import: (theme: Theme) => Promise>; }; audit: { search: (searchOptions: AuditSearchOptions) => Promise>; searchAll: (searchOptions: AuditSearchOptions) => Promise>; createEvent: (createOptions: AuditCreateOptions) => Promise>; createAuditWebhook: (options: AuditWebhook) => Promise>; }; authz: { saveSchema: (schema: AuthzSchema, upgrade: boolean) => Promise>; deleteSchema: () => Promise>; loadSchema: () => Promise>; saveNamespace: (namespace: AuthzNamespace, oldName?: string, schemaName?: string) => Promise>; deleteNamespace: (name: string, schemaName?: string) => Promise>; saveRelationDefinition: (relationDefinition: AuthzRelationDefinition, namespace: string, oldName?: string, schemaName?: string) => Promise>; deleteRelationDefinition: (name: string, namespace: string, schemaName?: string) => Promise>; createRelations: (relations: AuthzRelation[]) => Promise>; deleteRelations: (relations: AuthzRelation[]) => Promise>; deleteRelationsForResources: (resources: string[]) => Promise>; deleteResourceRelationsForResources: (resources: string[]) => Promise>; deleteRelationsForIds: (ids: string[]) => Promise>; hasRelations: (relationQueries: AuthzRelationQuery[]) => Promise>; whoCanAccess: (resource: string, relationDefinition: string, namespace: string) => Promise>; resourceRelations: (resource: string, ignoreTargetSetRelations?: boolean) => Promise>; resourceRelationsWithTargetSetsFilter: (resource: string, includeTargetSetRelations?: boolean) => Promise>; targetsRelations: (targets: string[], includeTargetSetRelations?: boolean) => Promise>; targetsRelationsWithTargetSetsFilter: (targets: string[], includeTargetSetRelations?: boolean) => Promise>; whatCanTargetAccess: (target: string) => Promise>; whatCanTargetAccessWithRelation: (target: string, relationDefinition: string, namespace: string) => Promise>; getModified: (since: Date) => Promise>; }; fga: { saveSchema: (schema: FGASchema) => Promise>; loadSchema: () => Promise>; dryRunSchema: (schema: FGASchema) => Promise>; deleteSchema: () => Promise>; createRelations: (relations: FGARelation[]) => Promise>; deleteRelations: (relations: FGARelation[]) => Promise>; check: (relations: FGARelation[]) => Promise>; checkWithContext: (relations: FGARelation[], context?: Record) => Promise>; loadResourcesDetails: (resourceIdentifiers: FGAResourceIdentifier[]) => Promise>; saveResourcesDetails: (resourcesDetails: FGAResourceDetails[]) => Promise>; loadMappableSchema: (tenantId: string, options?: FGAMappableResourcesOptions) => Promise>; searchMappableResources: (tenantId: string, resourcesQueries: FGAMappableResourcesQuery[], options?: FGAMappableResourcesOptions) => Promise>; deleteAllRelations: () => Promise>; }; descoper: { create: (descopers: DescoperCreate[]) => Promise>; update: (id: string, attributes?: DescoperAttributes, rbac?: DescoperRBAC) => Promise>; load: (id: string) => Promise>; delete: (id: string) => Promise>; list: () => Promise>; }; managementKey: { create: (name: string, reBac: MgmtKeyReBac, description?: string, expiresIn?: number, permittedIps?: string[]) => Promise>; update: (id: string, name: string, description: string, status: MgmtKeyStatus, permittedIps?: string[]) => Promise>; delete: (ids: string[]) => Promise>; load: (id: string) => Promise>; search: () => Promise>; }; engine: { create: (name: string) => Promise>; update: (id: string, name: string) => Promise>; delete: (id: string) => Promise>; load: (id: string) => Promise>; loadAll: () => Promise>; rotateSecret: (id: string) => Promise>; }; list: { create: (request: ListRequest) => Promise>; update: (id: string, request: ListRequest) => Promise>; delete: (id: string) => Promise>; load: (id: string) => Promise>; loadByName: (name: string) => Promise>; loadAll: () => Promise>; import: (lists: List[]) => Promise>; addIPs: (id: string, ips: string[]) => Promise>; removeIPs: (id: string, ips: string[]) => Promise>; checkIP: (id: string, ip: string) => Promise>; addTexts: (id: string, texts: string[]) => Promise>; removeTexts: (id: string, texts: string[]) => Promise>; checkText: (id: string, text: string) => Promise>; clear: (id: string) => Promise>; }; jwtTemplate: { create: (template: JWTTemplate) => Promise>; update: (template: JWTTemplate) => Promise>; delete: (id: string) => Promise>; list: () => Promise>; load: (id: string) => Promise>; validate: (id: string, template?: JWTTemplate) => Promise>; listLibrary: () => Promise>; loadLibraryEntry: (id: string) => Promise>; applyFromLibrary: (request: ApplyJWTTemplateFromLibraryRequest) => Promise>; }; scopeClaimMapping: { get: () => Promise>; set: (mappings: ScopeClaimMappingEntry[]) => Promise>; delete: () => Promise>; }; analytics: { search: (options: AnalyticsSearchOptions) => Promise>; }; }; getKey: (header: JWTHeaderParameters) => Promise; validateJwt: (jwt: string, options?: VerifyOptions) => Promise; validateSession: (sessionToken: string, options?: VerifyOptions) => Promise; refreshSession: (refreshToken: string, options?: VerifyOptions) => Promise; validateAndRefreshSession: (sessionToken?: string, refreshToken?: string, options?: VerifyOptions) => Promise; exchangeAccessKey: (accessKey: string, loginOptions?: AccessKeyLoginOptions, options?: VerifyOptions) => Promise; validatePermissions: (authInfo: AuthenticationInfo, permissions: string[]) => boolean; getMatchedPermissions: (authInfo: AuthenticationInfo, permissions: string[]) => string[]; validateTenantPermissions: (authInfo: AuthenticationInfo, tenant: string, permissions: string[]) => boolean; getMatchedTenantPermissions: (authInfo: AuthenticationInfo, tenant: string, permissions: string[]) => string[]; validateRoles: (authInfo: AuthenticationInfo, roles: string[]) => boolean; getMatchedRoles: (authInfo: AuthenticationInfo, roles: string[]) => string[]; validateTenantRoles: (authInfo: AuthenticationInfo, tenant: string, roles: string[]) => boolean; getMatchedTenantRoles: (authInfo: AuthenticationInfo, tenant: string, roles: string[]) => string[]; accessKey: { exchange: (accessKey: string, loginOptions?: AccessKeyLoginOptions) => Promise>; }; otp: { verify: { sms: (loginId: string, code: string) => Promise>; voice: (loginId: string, code: string) => Promise>; whatsapp: (loginId: string, code: string) => Promise>; im: (loginId: string, code: string) => Promise>; email: (loginId: string, code: string) => Promise>; }; signIn: { sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; im: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; }; signUp: { sms: (loginId: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; voice: (loginId: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; whatsapp: (loginId: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; im: (loginId: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; email: (loginId: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; }; signUpOrIn: { sms: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; voice: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; whatsapp: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; im: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; email: (loginId: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; }; update: { email: (loginId: string, email: string, token?: string, updateOptions?: { addToLoginIDs?: T; onMergeUseExisting?: T extends true ? boolean : never; templateOptions?: { [x: string]: string; }; templateId?: string; providerId?: string; mfa?: boolean; }) => Promise>; phone: { sms: (loginId: string, phone: string, token?: string, updateOptions?: { addToLoginIDs?: T_1; onMergeUseExisting?: T_1 extends true ? boolean : never; templateOptions?: { [x: string]: string; }; templateId?: string; providerId?: string; mfa?: boolean; }) => Promise>; voice: (loginId: string, phone: string, token?: string, updateOptions?: { addToLoginIDs?: T_1; onMergeUseExisting?: T_1 extends true ? boolean : never; templateOptions?: { [x: string]: string; }; templateId?: string; providerId?: string; mfa?: boolean; }) => Promise>; whatsapp: (loginId: string, phone: string, token?: string, updateOptions?: { addToLoginIDs?: T_1; onMergeUseExisting?: T_1 extends true ? boolean : never; templateOptions?: { [x: string]: string; }; templateId?: string; providerId?: string; mfa?: boolean; }) => Promise>; im: (loginId: string, phone: string, token?: string, updateOptions?: { addToLoginIDs?: T_1; onMergeUseExisting?: T_1 extends true ? boolean : never; templateOptions?: { [x: string]: string; }; templateId?: string; providerId?: string; mfa?: boolean; }) => Promise>; }; }; }; magicLink: { verify: (token: string) => Promise>; signIn: { sms: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; voice: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; whatsapp: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; im: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; email: (loginId: string, URI: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; }; signUp: { sms: (loginId: string, URI: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; voice: (loginId: string, URI: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; whatsapp: (loginId: string, URI: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; im: (loginId: string, URI: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; email: (loginId: string, URI: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; }; signUpOrIn: { sms: (loginId: string, URI?: string, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; voice: (loginId: string, URI?: string, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; whatsapp: (loginId: string, URI?: string, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; im: (loginId: string, URI?: string, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; email: (loginId: string, URI?: string, signUpOptions?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; }) => Promise>; }; update: { email: (loginId: string, email: string, URI?: string, token?: string, updateOptions?: { addToLoginIDs?: T_2; onMergeUseExisting?: T_2 extends true ? boolean : never; templateOptions?: { [x: string]: string; }; templateId?: string; providerId?: string; mfa?: boolean; }) => Promise>; phone: { sms: (loginId: string, phone: string, URI?: string, token?: string, updateOptions?: { addToLoginIDs?: T_3; onMergeUseExisting?: T_3 extends true ? boolean : never; templateOptions?: { [x: string]: string; }; templateId?: string; providerId?: string; mfa?: boolean; }) => Promise>; voice: (loginId: string, phone: string, URI?: string, token?: string, updateOptions?: { addToLoginIDs?: T_3; onMergeUseExisting?: T_3 extends true ? boolean : never; templateOptions?: { [x: string]: string; }; templateId?: string; providerId?: string; mfa?: boolean; }) => Promise>; whatsapp: (loginId: string, phone: string, URI?: string, token?: string, updateOptions?: { addToLoginIDs?: T_3; onMergeUseExisting?: T_3 extends true ? boolean : never; templateOptions?: { [x: string]: string; }; templateId?: string; providerId?: string; mfa?: boolean; }) => Promise>; im: (loginId: string, phone: string, URI?: string, token?: string, updateOptions?: { addToLoginIDs?: T_3; onMergeUseExisting?: T_3 extends true ? boolean : never; templateOptions?: { [x: string]: string; }; templateId?: string; providerId?: string; mfa?: boolean; }) => Promise>; }; }; }; enchantedLink: { verify: (token: string) => Promise>; signIn: (loginId: string, URI?: string, args_2?: _descope_core_js_sdk.LoginOptions & { providerId?: string; }, token?: string) => Promise>; signUpOrIn: (loginId: string, URI?: string, args_2?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; } & { providerId?: string; }) => Promise>; signUp: (loginId: string, URI?: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, args_3?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; } & { providerId?: string; }) => Promise>; waitForSession: (pendingRef: string, config?: { pollingIntervalMs: number; timeoutMs: number; }) => Promise>; update: { email: (loginId: string, email: string, URI?: string, token?: string, updateOptions?: { addToLoginIDs?: T_4; onMergeUseExisting?: T_4 extends true ? boolean : never; templateOptions?: { [x: string]: string; }; templateId?: string; providerId?: string; mfa?: boolean; }) => Promise>; }; }; oauth: { start: ((provider: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, loginHint?: string) => Promise>) & { facebook: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; github: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; google: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; microsoft: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; gitlab: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; apple: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; discord: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; linkedin: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; slack: (redirectURL?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; }; exchange: (code: string) => Promise>; startNative: (provider: string, loginOptions?: _descope_core_js_sdk.LoginOptions, implicit?: boolean) => Promise>; finishNative: (provider: string, stateId: string, user?: string, code?: string, idToken?: string) => Promise>; getOneTapClientId: (provider: string) => Promise>; verifyOneTapIDToken: (provider: string, idToken: string, nonce: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise>; exchangeOneTapIDToken: (provider: string, idToken: string, nonce: string, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise>; }; outbound: { connect: (appId: string, options?: { redirectUrl?: string; scopes?: string[]; tenantId?: string; tenantLevel?: boolean; externalIdentifier?: string; }, token?: string) => Promise>; }; sso: { start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, ssoId?: string, forceAuthn?: boolean, loginHint?: string, enforceInitiatedEmail?: boolean) => Promise>; exchange: (code: string) => Promise>; }; saml: { start: (tenantIdOrEmail: string, redirectUrl?: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, ssoId?: string, forceAuthn?: boolean, loginHint?: string, enforceInitiatedEmail?: boolean) => Promise>; exchange: (code: string) => Promise>; }; totp: { signUp: (loginId: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }) => Promise>; verify: (loginId: string, code: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string) => Promise>; update: (loginId: string, token?: string) => Promise>; }; notp: { signUpOrIn: (loginId?: string, args_1?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; } & { providerId?: string; }) => Promise>; signUp: (loginId?: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, args_2?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; } & { providerId?: string; }) => Promise>; signIn: (loginId?: string, args_1?: _descope_core_js_sdk.LoginOptions & { providerId?: string; }, token?: string) => Promise>; waitForSession: (pendingRef: string, config?: { pollingIntervalMs: number; timeoutMs: number; }) => Promise>; }; webauthn: { signUp: { start: (loginId: string, origin: string, name: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise>; finish: (transactionId: string, response: string) => Promise>; }; signIn: { start: (loginId: string, origin: string, loginOptions?: _descope_core_js_sdk.LoginOptions, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions) => Promise>; finish: (transactionId: string, response: string) => Promise>; }; signUpOrIn: { start: (loginId: string, origin: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions, loginOptions?: _descope_core_js_sdk.LoginOptions) => Promise>; }; update: { start: (loginId: string, origin: string, token?: string, passkeyOptions?: _descope_core_js_sdk.PasskeyOptions, mfa?: boolean) => Promise>; finish: (transactionId: string, response: string) => Promise>; }; }; password: { signUp: (loginId: string, password: string, user?: { email?: string; name?: string; givenName?: string; middleName?: string; familyName?: string; phone?: string; }, args_3?: { customClaims?: Record; templateId?: string; templateOptions?: { [x: string]: string; }; tenantId?: string; } & { providerId?: string; }) => Promise>; signIn: (loginId: string, password: string, args_2?: _descope_core_js_sdk.LoginOptions & { providerId?: string; }) => Promise>; sendReset: (loginId: string, redirectUrl?: string, templateOptions?: { [x: string]: string; }) => Promise>; update: (loginId: string, newPassword: string, token?: string) => Promise>; replace: (loginId: string, oldPassword: string, newPassword: string) => Promise>; policy: () => Promise>; }; flow: { start: (flowId: string, options?: { redirectUrl?: string; location?: string; tenant?: string; deviceInfo?: { webAuthnSupport?: boolean; }; lastAuth?: { authMethod?: "saml" | "otp" | "oauth" | "sso" | "totp" | "webauthn" | "magiclink" | "enchantedlink"; oauthProvider?: string; name?: string; loginId?: string; }; redirectAuth?: { callbackUrl: string; codeChallenge: string; }; oidcIdpStateId?: string; preview?: boolean; samlIdpStateId?: string; wsfedIdpStateId?: string; samlIdpUsername?: string; ssoAppId?: string; customAppId?: string; thirdPartyAppId?: string; oidcLoginHint?: string; abTestingKey?: number; startOptionsVersion?: number; client?: Record; locale?: string; oidcPrompt?: string; oidcErrorRedirectUri?: string; oidcResource?: string; nativeOptions?: { platform: "ios" | "android"; oauthProvider?: string; oauthRedirect?: string; externalAuthRedirect?: string; }; thirdPartyAppStateId?: string; applicationScopes?: string; outboundAppId?: string; outboundAppScopes?: string[]; }, conditionInteractionId?: string, interactionId?: string, componentsVersion?: string, flowVersions?: Record, input?: { [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[]; }, isCustomScreen?: any) => Promise>; next: (executionId: string, stepId: string, interactionId: string, version?: number, componentsVersion?: string, input?: { [x: string]: string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any)[])[])[])[])[])[])[])[])[])[])[]; }, isCustomScreen?: any) => Promise>; }; selectTenant: (tenantId: string, token?: string) => Promise>; logout: (token?: string) => Promise>; logoutAll: (token?: string) => Promise>; me: (token?: string) => Promise>; myTenants: (tenants: true | string[], token?: string) => Promise; }[]; }>>; history: (token?: string) => Promise>; isJwtExpired: (token: string) => boolean; getTenants: (token: string) => string[]; getJwtPermissions: (token: string, tenant?: string) => string[]; getJwtRoles: (token: string, tenant?: string) => string[]; getCurrentTenant: (token: string) => string; httpClient: _descope_core_js_sdk.HttpClient; }; /** Descope SDK client with delivery methods enum. * * Please see full documentation at {@link https://docs.descope.com/guides Descope Docs} * @example Usage * * ```js * import descopeSdk from '@descope/node-sdk'; * * const myProjectId = 'xxx'; * const sdk = descopeSdk({ projectId: myProjectId }); * * const userLoginId = 'loginId'; * sdk.otp.signIn.email(userLoginId); * const jwtResponse = sdk.otp.verify.email(userLoginId, codeFromEmail); * ``` */ RefreshTokenCookieName: string; SessionTokenCookieName: string; DescopeErrors: { badRequest: string; missingArguments: string; invalidRequest: string; invalidArguments: string; wrongOTPCode: string; tooManyOTPAttempts: string; enchantedLinkPending: string; userNotFound: string; }; }; export { AccessKey, AccessType, AnalyticRecord, AnalyticsSearchOptions, ApplyJWTTemplateFromLibraryRequest, AssociatedTenant, AttributeMapping, AttributesTypes, AuditCreateOptions, AuditFilters, AuditRecord, AuditSearchAllResponse, AuditSearchOptions, AuditType, AuditWebhook, AuthenticationInfo, AuthzModified, AuthzNamespace, AuthzNode, AuthzNodeExpression, AuthzNodeExpressionType, AuthzNodeType, AuthzRelation, AuthzRelationDefinition, AuthzRelationQuery, AuthzResource, AuthzSchema, AuthzUserQuery, BatchUploadOutboundAppTokensResponse, CheckResponseRelation, ClientAssertionResponse, CloneProjectResponse, ConnectorHTTPAPIKeyAuthentication, ConnectorHTTPAuthentication, ConnectorHTTPBasicAuthentication, CreateInboundApplicationResponse, CreateOrInviteBatchResponse, CreateOutboundAppByTemplateOptions, CreateSSOApplicationResponse, CreateTenantResponse, CreatedAccessKeyResponse, CustomAttribute, CustomAttributeOption, Descoper, DescoperAttributes, DescoperCreate, DescoperProjectRole, DescoperRBAC, DescoperRole, DescoperTagRole, Engine, EngineSecretResponse, ExpirationUnit, ExportSnapshotResponse, FGAConfig, FGAMappableResource, FGAMappableResources, FGAMappableResourcesOptions, FGAMappableResourcesQuery, FGAMappableSchema, FGARelation, FGAResourceDetails, FGAResourceIdentifier, FGASchema, FGASchemaDryRunResponse, FetchLatestOutboundAppTenantTokenRequest, FetchLatestOutboundAppUserTokenRequest, FetchOutboundAppTenantTokenRequest, FetchOutboundAppTokenOptions, FetchOutboundAppUserTokenRequest, Flow, FlowMetadata, FlowResponse, FlowsResponse, GenerateEmbeddedLinkResponse, GenerateEnchantedLinkForTestResponse, GenerateMagicLinkForTestResponse, GenerateOTPForTestResponse, GenerateSSOConfigurationLinkResponse, Group, GroupMember, GroupsMapping, IDPResponse, ImportSnapshotRequest, InboundApplication, InboundApplicationConsent, InboundApplicationConsentDeleteOptions, InboundApplicationConsentSearchOptions, InboundApplicationOptions, InboundApplicationScope, InboundApplicationSecretResponse, InboundApplicationTenantConsentDeleteOptions, JWTBearerSettings, JWTTemplate, JWTTemplateLibraryEntry, JWTTemplateValidationIssue, JWTTemplateValidationResult, License, List, ListRequest, ListType, ManagementFlowOptions, MgmtKey, MgmtKeyCreateResponse, MgmtKeyProjectRole, MgmtKeyReBac, MgmtKeyStatus, MgmtKeyTagRole, MgmtLoginOptions, MgmtSignUpOptions, MgmtUserOptions, OIDCAttributeMapping, OIDCRoleMapping, OidcApplicationOptions, OutboundAppTemplateOverrides, OutboundAppTenantTokenToUpload, OutboundAppToken, OutboundAppTokenResponse, OutboundAppTokenUploadFailure, OutboundAppUserTokenToUpload, OutboundApplication, PasswordSettings, PatchUserBatchResponse, PatchUserOptions, Permission, PermissionUpdateRequest, Project, ProjectEnvironment, Prompt, PromptType, ProviderTokenOptions, ProviderTokenResponse, RefreshAuthenticationInfo, Role, RoleItem, RoleMapping, RoleMappings, RoleSearchOptions, RoleUpdateRequest, RunManagementFlowResponse, SAMLIDPRoleGroupMappingInfo, SSOApplication, SSOApplicationOIDCSettings, SSOApplicationSAMLSettings, SSOApplicationSecretResponse, SSOApplicationWSFedSettings, SSOAuthType, SSOOIDCSettings, SSOSAMLByMetadataSettings, SSOSAMLSettings, SSOSAMLSettingsResponse, SSOSettings, SSOSettingsResponse, SSOSetupSuiteSettings, SSOSetupSuiteSettingsDisabledFeatures, SamlApplicationOptions, SamlIdpAttributeMappingInfo, SamlIdpGroupsMappingInfo, ScopeClaimMappingEntry, Screen, SnapshotSecret, SnapshotSecrets, TemplateOptions, Tenant, TenantSettings, Theme, ThemeResponse, URLParam, UpdateJWTResponse, UploadOutboundAppTenantTokenRequest, UploadOutboundAppUserTokenRequest, User, UserFailedResponse, UserImportFailure, UserImportResponse, UserMapping, UserOptions, UserPasskey, UserPasswordBcrypt, UserPasswordDjango, UserPasswordFirebase, UserPasswordHashed, UserPasswordMd5, UserPasswordPbkdf2, UserPasswordPhpass, UserSearchResponse, UserStatus, UserTrustedDevice, ValidateSnapshotRequest, ValidateSnapshotResponse, VerifyOptions, WsFedApplicationOptions, XAAFGAGroupMapping, XAAFGAGroupMappingRelation, XAAIssuerSettings, XAASettings, XAASettingsResponse, nodeSdk as default };