From 3f4f5ec2e7d3130a2dbf0f06da6c52f1cc016a6f Mon Sep 17 00:00:00 2001 From: rishabhpoddar Date: Fri, 1 Mar 2024 17:17:51 +0530 Subject: [PATCH] adding dev-v16.7.4 tag to this commit to ensure building --- docs/classes/framework.BaseRequest.html | 2 +- docs/classes/framework.BaseResponse.html | 2 +- .../framework_custom.CollectingResponse.html | 2 +- .../framework_custom.PreParsedRequest.html | 2 +- docs/classes/index.RecipeUserId.html | 2 +- docs/classes/index.User.html | 2 +- docs/classes/index.default.html | 2 +- .../ingredients_emaildelivery.default.html | 2 +- .../ingredients_smsdelivery.default.html | 2 +- .../recipe_accountlinking.default.html | 6 +- docs/classes/recipe_dashboard.default.html | 2 +- .../classes/recipe_emailpassword.default.html | 4 +- .../recipe_emailverification.default.html | 2 +- docs/classes/recipe_jwt.default.html | 2 +- docs/classes/recipe_multitenancy.default.html | 2 +- docs/classes/recipe_openid.default.html | 2 +- docs/classes/recipe_passwordless.default.html | 2 +- docs/classes/recipe_session.default.html | 4 +- docs/classes/recipe_thirdparty.default.html | 2 +- ...ecipe_thirdpartyemailpassword.default.html | 2 +- ...recipe_thirdpartypasswordless.default.html | 2 +- docs/classes/recipe_usermetadata.default.html | 2 +- docs/classes/recipe_userroles.default.html | 2 +- .../framework_awsLambda.SessionEvent.html | 2 +- .../framework_awsLambda.SessionEventV2.html | 2 +- .../framework_express.SessionRequest.html | 252 +++++++++++++----- .../framework_hapi.SessionRequest.html | 2 +- .../framework_koa.SessionContext.html | 102 +++---- .../framework_loopback.SessionContext.html | 46 ++-- .../recipe_session.SessionContainer.html | 2 +- .../recipe_session.VerifySessionOptions.html | 2 +- docs/modules/framework.html | 2 +- docs/modules/framework_awsLambda.html | 2 +- docs/modules/framework_custom.html | 2 +- docs/modules/framework_express.html | 2 +- docs/modules/framework_fastify.html | 2 +- docs/modules/framework_hapi.html | 2 +- docs/modules/framework_koa.html | 2 +- docs/modules/framework_loopback.html | 2 +- docs/modules/index.html | 2 +- docs/modules/recipe_accountlinking.html | 2 +- docs/modules/recipe_dashboard.html | 2 +- docs/modules/recipe_emailpassword.html | 4 +- docs/modules/recipe_emailverification.html | 2 +- docs/modules/recipe_jwt.html | 2 +- docs/modules/recipe_multitenancy.html | 2 +- docs/modules/recipe_openid.html | 2 +- docs/modules/recipe_passwordless.html | 2 +- docs/modules/recipe_session.html | 8 +- docs/modules/recipe_thirdparty.html | 2 +- .../recipe_thirdpartyemailpassword.html | 2 +- .../recipe_thirdpartypasswordless.html | 2 +- docs/modules/recipe_usermetadata.html | 4 +- docs/modules/recipe_userroles.html | 2 +- 54 files changed, 316 insertions(+), 204 deletions(-) diff --git a/docs/classes/framework.BaseRequest.html b/docs/classes/framework.BaseRequest.html index 2befcc021..16fe02d90 100644 --- a/docs/classes/framework.BaseRequest.html +++ b/docs/classes/framework.BaseRequest.html @@ -1 +1 @@ -BaseRequest | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseRequest Abstract

Hierarchy

Index

Constructors

Properties

getCookieValue: ((key_: string) => undefined | string)

Type declaration

    • (key_: string): undefined | string
    • Parameters

      • key_: string

      Returns undefined | string

getHeaderValue: ((key: string) => undefined | string)

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getKeyValueFromQuery: ((key: string) => undefined | string)

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getMethod: (() => HTTPMethod)

Type declaration

    • (): HTTPMethod
    • Returns HTTPMethod

getOriginalURL: (() => string)

Type declaration

    • (): string
    • Returns string

original: any
parsedJSONBody: any
parsedUrlEncodedFormData: any
wrapperUsed: boolean

Methods

  • getFormData(): Promise<any>
  • getFormDataFromRequestBody(): Promise<any>
  • getJSONBody(): Promise<any>
  • getJSONFromRequestBody(): Promise<any>

Generated using TypeDoc

\ No newline at end of file +BaseRequest | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseRequest Abstract

Hierarchy

Index

Constructors

Properties

getCookieValue: ((key_: string) => undefined | string)

Type declaration

    • (key_: string): undefined | string
    • Parameters

      • key_: string

      Returns undefined | string

getHeaderValue: ((key: string) => undefined | string)

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getKeyValueFromQuery: ((key: string) => undefined | string)

Type declaration

    • (key: string): undefined | string
    • Parameters

      • key: string

      Returns undefined | string

getMethod: (() => HTTPMethod)

Type declaration

    • (): HTTPMethod
    • Returns HTTPMethod

getOriginalURL: (() => string)

Type declaration

    • (): string
    • Returns string

original: any
parsedJSONBody: any
parsedUrlEncodedFormData: any
wrapperUsed: boolean

Methods

  • getFormData(): Promise<any>
  • getFormDataFromRequestBody(): Promise<any>
  • getJSONBody(): Promise<any>
  • getJSONFromRequestBody(): Promise<any>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/framework.BaseResponse.html b/docs/classes/framework.BaseResponse.html index 8cfbf765e..50b1943da 100644 --- a/docs/classes/framework.BaseResponse.html +++ b/docs/classes/framework.BaseResponse.html @@ -1 +1 @@ -BaseResponse | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseResponse Abstract

Hierarchy

Index

Constructors

Properties

original: any
removeHeader: ((key: string) => void)

Type declaration

    • (key: string): void
    • Parameters

      • key: string

      Returns void

sendHTMLResponse: ((html: string) => void)

Type declaration

    • (html: string): void
    • Parameters

      • html: string

      Returns void

sendJSONResponse: ((content: any) => void)

Type declaration

    • (content: any): void
    • Parameters

      • content: any

      Returns void

setCookie: ((key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none") => void)

Type declaration

    • (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none"): void
    • Parameters

      • key: string
      • value: string
      • domain: undefined | string
      • secure: boolean
      • httpOnly: boolean
      • expires: number
      • path: string
      • sameSite: "strict" | "lax" | "none"

      Returns void

setHeader: ((key: string, value: string, allowDuplicateKey: boolean) => void)

Type declaration

    • (key: string, value: string, allowDuplicateKey: boolean): void
    • Parameters

      • key: string
      • value: string
      • allowDuplicateKey: boolean

      Returns void

setStatusCode: ((statusCode: number) => void)

Type declaration

    • (statusCode: number): void
    • Parameters

      • statusCode: number

      Returns void

wrapperUsed: boolean

Generated using TypeDoc

\ No newline at end of file +BaseResponse | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseResponse Abstract

Hierarchy

Index

Constructors

Properties

original: any
removeHeader: ((key: string) => void)

Type declaration

    • (key: string): void
    • Parameters

      • key: string

      Returns void

sendHTMLResponse: ((html: string) => void)

Type declaration

    • (html: string): void
    • Parameters

      • html: string

      Returns void

sendJSONResponse: ((content: any) => void)

Type declaration

    • (content: any): void
    • Parameters

      • content: any

      Returns void

setCookie: ((key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none") => void)

Type declaration

    • (key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none"): void
    • Parameters

      • key: string
      • value: string
      • domain: undefined | string
      • secure: boolean
      • httpOnly: boolean
      • expires: number
      • path: string
      • sameSite: "strict" | "lax" | "none"

      Returns void

setHeader: ((key: string, value: string, allowDuplicateKey: boolean) => void)

Type declaration

    • (key: string, value: string, allowDuplicateKey: boolean): void
    • Parameters

      • key: string
      • value: string
      • allowDuplicateKey: boolean

      Returns void

setStatusCode: ((statusCode: number) => void)

Type declaration

    • (statusCode: number): void
    • Parameters

      • statusCode: number

      Returns void

wrapperUsed: boolean

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/framework_custom.CollectingResponse.html b/docs/classes/framework_custom.CollectingResponse.html index 95e63c519..6e7f4834f 100644 --- a/docs/classes/framework_custom.CollectingResponse.html +++ b/docs/classes/framework_custom.CollectingResponse.html @@ -1,2 +1,2 @@ -CollectingResponse | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

Properties

body?: string
cookies: CookieInfo[]
headers: Headers
original: any
statusCode: number
wrapperUsed: boolean

Methods

  • removeHeader(key: string): void
  • sendHTMLResponse(html: string): void
  • sendJSONResponse(content: any): void
  • setCookie(key: string, value: string, domain: undefined | string, secure: boolean, httpOnly: boolean, expires: number, path: string, sameSite: "strict" | "lax" | "none"): void
  • Parameters

    • key: string
    • value: string
    • domain: undefined | string
    • secure: boolean
    • httpOnly: boolean
    • expires: number
    • path: string
    • sameSite: "strict" | "lax" | "none"

    Returns void

  • setHeader(key: string, value: string, allowDuplicateKey: boolean): void
  • setStatusCode(statusCode: number): void
  • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
  • Parameters

    • tenantId: string
    • token: string
    • newPassword: string
    • Optional userContext: any

    Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

  • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
  • signIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
  • signUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
  • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
  • Parameters

    • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
      • Optional applyPasswordPolicy?: boolean
      • Optional email?: string
      • Optional password?: string
      • recipeUserId: RecipeUserId
      • Optional tenantIdForPasswordPolicy?: string
      • Optional userContext?: any

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_emailverification.default.html b/docs/classes/recipe_emailverification.default.html index eae88e983..4d59ce65e 100644 --- a/docs/classes/recipe_emailverification.default.html +++ b/docs/classes/recipe_emailverification.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationClaim
Error: typeof default = SuperTokensError
init: ((config: TypeInput) => RecipeListFunction) = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
  • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
  • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
  • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

EmailVerificationClaim: EmailVerificationClaimClass = EmailVerificationClaim
Error: typeof default = SuperTokensError
init: ((config: TypeInput) => RecipeListFunction) = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
  • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
  • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
  • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
  • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_jwt.default.html b/docs/classes/recipe_jwt.default.html index 0ff3c0598..f3dbbe5b2 100644 --- a/docs/classes/recipe_jwt.default.html +++ b/docs/classes/recipe_jwt.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Methods

Constructors

Properties

init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
  • Parameters

    • payload: any
    • Optional validitySeconds: number
    • Optional useStaticSigningKey: boolean
    • Optional userContext: any

    Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Methods

Constructors

Properties

init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
  • Parameters

    • payload: any
    • Optional validitySeconds: number
    • Optional useStaticSigningKey: boolean
    • Optional userContext: any

    Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_multitenancy.default.html b/docs/classes/recipe_multitenancy.default.html index d06d762c4..6f2234d97 100644 --- a/docs/classes/recipe_multitenancy.default.html +++ b/docs/classes/recipe_multitenancy.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
  • Parameters

    • tenantId: string
    • recipeUserId: RecipeUserId
    • Optional userContext: any

    Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

  • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
  • Parameters

    • tenantId: string
    • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
      • Optional coreConfig?: {}
        • [key: string]: any
      • Optional emailPasswordEnabled?: boolean
      • Optional passwordlessEnabled?: boolean
      • Optional thirdPartyEnabled?: boolean
    • Optional userContext: any

    Returns Promise<{ createdNew: boolean; status: "OK" }>

  • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
  • Parameters

    • tenantId: string
    • config: ProviderConfig
    • Optional skipValidation: boolean
    • Optional userContext: any

    Returns Promise<{ createdNew: boolean; status: "OK" }>

  • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
  • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
  • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
  • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
  • Parameters

    • tenantId: string
    • Optional userContext: any

    Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

  • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
  • Parameters

    • Optional userContext: any

    Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
  • Parameters

    • tenantId: string
    • recipeUserId: RecipeUserId
    • Optional userContext: any

    Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

  • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
  • Parameters

    • tenantId: string
    • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
      • Optional coreConfig?: {}
        • [key: string]: any
      • Optional emailPasswordEnabled?: boolean
      • Optional passwordlessEnabled?: boolean
      • Optional thirdPartyEnabled?: boolean
    • Optional userContext: any

    Returns Promise<{ createdNew: boolean; status: "OK" }>

  • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
  • Parameters

    • tenantId: string
    • config: ProviderConfig
    • Optional skipValidation: boolean
    • Optional userContext: any

    Returns Promise<{ createdNew: boolean; status: "OK" }>

  • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
  • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
  • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
  • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
  • Parameters

    • tenantId: string
    • Optional userContext: any

    Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

  • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
  • Parameters

    • Optional userContext: any

    Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_openid.default.html b/docs/classes/recipe_openid.default.html index 50b8e4265..14f251d1b 100644 --- a/docs/classes/recipe_openid.default.html +++ b/docs/classes/recipe_openid.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: ((config?: TypeInput) => RecipeListFunction) = OpenIdRecipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
  • Parameters

    • Optional payload: any
    • Optional validitySeconds: number
    • Optional useStaticSigningKey: boolean
    • Optional userContext: any

    Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

init: ((config?: TypeInput) => RecipeListFunction) = OpenIdRecipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
  • Parameters

    • Optional payload: any
    • Optional validitySeconds: number
    • Optional useStaticSigningKey: boolean
    • Optional userContext: any

    Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_passwordless.default.html b/docs/classes/recipe_passwordless.default.html index 1855a2d1d..ab0193de4 100644 --- a/docs/classes/recipe_passwordless.default.html +++ b/docs/classes/recipe_passwordless.default.html @@ -1 +1 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: ((config: TypeInput) => RecipeListFunction) = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
  • Parameters

    • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

    Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode(input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
  • Parameters

    • input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<string>

  • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
  • Parameters

    • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
      • deviceId: string
      • tenantId: string
      • Optional userContext?: any
      • Optional userInputCode?: string

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { deviceId: string; tenantId: string; userContext?: any }
      • deviceId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any }
      • email: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<DeviceType[]>

  • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
  • Parameters

    • input: { phoneNumber: string; tenantId: string; userContext?: any }
      • phoneNumber: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<DeviceType[]>

  • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
      • preAuthSessionId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<{ status: "OK" }>

  • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
  • Parameters

    • input: { codeId: string; tenantId: string; userContext?: any }
      • codeId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<{ status: "OK" }>

  • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
  • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

  • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
  • Parameters

    • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
      • Optional email?: null | string
      • Optional phoneNumber?: null | string
      • recipeUserId: RecipeUserId
      • Optional userContext?: any

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

Generated using TypeDoc

\ No newline at end of file +default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: ((config: TypeInput) => RecipeListFunction) = Recipe.init

Type declaration

    • (config: TypeInput): RecipeListFunction
    • Parameters

      • config: TypeInput

      Returns RecipeListFunction

Methods

  • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
  • Parameters

    • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

    Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

  • createCode(input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
  • Parameters

    • input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

  • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<string>

  • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
  • Parameters

    • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
      • deviceId: string
      • tenantId: string
      • Optional userContext?: any
      • Optional userInputCode?: string

    Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

  • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { deviceId: string; tenantId: string; userContext?: any }
      • deviceId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any }
      • email: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<DeviceType[]>

  • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
  • Parameters

    • input: { phoneNumber: string; tenantId: string; userContext?: any }
      • phoneNumber: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<DeviceType[]>

  • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
  • Parameters

    • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
      • preAuthSessionId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<undefined | DeviceType>

  • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<{ status: "OK" }>

  • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
  • Parameters

    • input: { codeId: string; tenantId: string; userContext?: any }
      • codeId: string
      • tenantId: string
      • Optional userContext?: any

    Returns Promise<{ status: "OK" }>

  • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
  • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
  • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
  • Parameters

    • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

    Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

  • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
  • Parameters

    • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
      • Optional email?: null | string
      • Optional phoneNumber?: null | string
      • recipeUserId: RecipeUserId
      • Optional userContext?: any

    Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/classes/recipe_session.default.html b/docs/classes/recipe_session.default.html index 69de969f0..667fa6ea6 100644 --- a/docs/classes/recipe_session.default.html +++ b/docs/classes/recipe_session.default.html @@ -1,4 +1,4 @@ -default | supertokens-node
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • default

Index

Constructors

Properties

Error: typeof default = SuperTokensError
init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

Type declaration

    • (config?: TypeInput): RecipeListFunction
    • Parameters

      • Optional config: TypeInput

      Returns RecipeListFunction

Methods

  • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
  • Parameters

    • Optional payload: any
    • Optional validitySeconds: number
    • Optional useStaticSigningKey: boolean
    • userContext: any = {}

    Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

  • createNewSession(req: any, res: any, tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, userContext?: any): Promise<SessionContainer>
  • createNewSessionWithoutRequestResponse(tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, disableAntiCsrf?: boolean, userContext?: any): Promise<SessionContainer>
  • fetchAndSetClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
  • getAllSessionHandlesForUser(userId: string, fetchSessionsForAllLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
  • Parameters

    • userId: string
    • fetchSessionsForAllLinkedAccounts: boolean = true
    • Optional tenantId: string
    • userContext: any = {}

    Returns Promise<string[]>

  • getClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, userContext?: any): Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
  • Type Parameters

    • T

    Parameters

    • sessionHandle: string
    • claim: SessionClaim<T>
    • userContext: any = {}

    Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>

  • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[] }>
  • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
  • getSessionInformation(sessionHandle: string, userContext?: any): Promise<undefined | SessionInformation>
  • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string): Promise<SessionContainer>
  • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired?: true }, userContext?: any): Promise<SessionContainer>
  • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired: false }, userContext?: any): Promise<undefined | SessionContainer>
  • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions, userContext?: any): Promise<undefined | SessionContainer>
  • mergeIntoAccessTokenPayload(sessionHandle: string, accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<boolean>
  • refreshSession(req: any, res: any, userContext?: any): Promise<SessionContainer>
  • refreshSessionWithoutRequestResponse(refreshToken: string, disableAntiCsrf?: boolean, antiCsrfToken?: string, userContext?: any): Promise<SessionContainer>
  • removeClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
  • revokeAllSessionsForUser(userId: string, revokeSessionsForLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
  • Parameters

    • userId: string
    • revokeSessionsForLinkedAccounts: boolean = true
    • Optional tenantId: string
    • userContext: any = {}

    Returns Promise<string[]>

  • revokeMultipleSessions(sessionHandles: string[], userContext?: any): Promise<string[]>
  • revokeSession(sessionHandle: string, userContext?: any): Promise<boolean>
  • setClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, value: T, userContext?: any): Promise<boolean>
  • updateSessionDataInDatabase(sessionHandle: string, newSessionData: any, userContext?: any): Promise<boolean>

Generated using TypeDoc

\ No newline at end of file +

Returns Promise<SessionContainer>

  • Parameters

    Returns Promise<SessionContainer>

  • Parameters

    Returns Promise<undefined | SessionContainer>

  • Parameters

    Returns Promise<undefined | SessionContainer>

  • Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_thirdparty.default.html b/docs/classes/recipe_thirdparty.default.html index ef519759f..97478411a 100644 --- a/docs/classes/recipe_thirdparty.default.html +++ b/docs/classes/recipe_thirdparty.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_thirdpartyemailpassword.default.html b/docs/classes/recipe_thirdpartyemailpassword.default.html index f962f2b0b..4c000f5ed 100644 --- a/docs/classes/recipe_thirdpartyemailpassword.default.html +++ b/docs/classes/recipe_thirdpartyemailpassword.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
    • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
    • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
    • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
    • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • tenantId: string
      • token: string
      • newPassword: string
      • Optional userContext: any

      Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
    • Parameters

      • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
        • Optional applyPasswordPolicy?: boolean
        • Optional email?: string
        • Optional password?: string
        • recipeUserId: RecipeUserId
        • Optional tenantIdForPasswordPolicy?: string
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_thirdpartypasswordless.default.html b/docs/classes/recipe_thirdpartypasswordless.default.html index 93136aaaf..6dd9b0672 100644 --- a/docs/classes/recipe_thirdpartypasswordless.default.html +++ b/docs/classes/recipe_thirdpartypasswordless.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: ((config: TypeInput) => RecipeListFunction) = Recipe.init

    Type declaration

      • (config: TypeInput): RecipeListFunction
      • Parameters

        • config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    Error: typeof default = SuperTokensError
    init: ((config: TypeInput) => RecipeListFunction) = Recipe.init

    Type declaration

      • (config: TypeInput): RecipeListFunction
      • Parameters

        • config: TypeInput

        Returns RecipeListFunction

    Methods

    • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
    • Parameters

      • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

    • createCode(input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
    • Parameters

      • input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

    • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
    • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
    • Parameters

      • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
        • deviceId: string
        • tenantId: string
        • Optional userContext?: any
        • Optional userInputCode?: string

      Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

    • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
    • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
    • Parameters

      • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
        • preAuthSessionId: string
        • tenantId: string
        • Optional userContext?: any

      Returns Promise<undefined | DeviceType>

    • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
    • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
    • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
    • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
    • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
    • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
    • Parameters

      • tenantId: string
      • thirdPartyId: string
      • thirdPartyUserId: string
      • email: string
      • isVerified: boolean
      • userContext: any = {}

      Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

    • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
    • Parameters

      • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
        • Optional email?: null | string
        • Optional phoneNumber?: null | string
        • recipeUserId: RecipeUserId
        • Optional userContext?: any

      Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_usermetadata.default.html b/docs/classes/recipe_usermetadata.default.html index 3d3415afa..319114a01 100644 --- a/docs/classes/recipe_usermetadata.default.html +++ b/docs/classes/recipe_usermetadata.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
    • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
    • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
    • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
    • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/classes/recipe_userroles.default.html b/docs/classes/recipe_userroles.default.html index c4c9a7a6f..d6bf7520a 100644 --- a/docs/classes/recipe_userroles.default.html +++ b/docs/classes/recipe_userroles.default.html @@ -1 +1 @@ -default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    PermissionClaim: PermissionClaimClass = PermissionClaim
    UserRoleClaim: UserRoleClaimClass = UserRoleClaim
    init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file +default | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • default

    Index

    Constructors

    Properties

    PermissionClaim: PermissionClaimClass = PermissionClaim
    UserRoleClaim: UserRoleClaimClass = UserRoleClaim
    init: ((config?: TypeInput) => RecipeListFunction) = Recipe.init

    Type declaration

      • (config?: TypeInput): RecipeListFunction
      • Parameters

        • Optional config: TypeInput

        Returns RecipeListFunction

    Methods

    • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
    • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
    • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • role: string
      • Optional userContext: any

      Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
    • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

    • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
    • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
    • Parameters

      • tenantId: string
      • userId: string
      • role: string
      • Optional userContext: any

      Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_awsLambda.SessionEvent.html b/docs/interfaces/framework_awsLambda.SessionEvent.html index 26dcbc1a3..e0fe1851a 100644 --- a/docs/interfaces/framework_awsLambda.SessionEvent.html +++ b/docs/interfaces/framework_awsLambda.SessionEvent.html @@ -1 +1 @@ -SessionEvent | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEvent
      • SessionEvent

    Index

    Properties

    body: null | string
    headers: APIGatewayProxyEventHeaders
    httpMethod: string
    isBase64Encoded: boolean
    multiValueHeaders: APIGatewayProxyEventMultiValueHeaders
    multiValueQueryStringParameters: null | APIGatewayProxyEventMultiValueQueryStringParameters
    path: string
    pathParameters: null | APIGatewayProxyEventPathParameters
    queryStringParameters: null | APIGatewayProxyEventQueryStringParameters
    requestContext: APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext>
    resource: string
    stageVariables: null | APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]

    Generated using TypeDoc

    \ No newline at end of file +SessionEvent | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEvent
      • SessionEvent

    Index

    Properties

    body: null | string
    headers: APIGatewayProxyEventHeaders
    httpMethod: string
    isBase64Encoded: boolean
    multiValueHeaders: APIGatewayProxyEventMultiValueHeaders
    multiValueQueryStringParameters: null | APIGatewayProxyEventMultiValueQueryStringParameters
    path: string
    pathParameters: null | APIGatewayProxyEventPathParameters
    queryStringParameters: null | APIGatewayProxyEventQueryStringParameters
    requestContext: APIGatewayEventRequestContextWithAuthorizer<APIGatewayEventDefaultAuthorizerContext>
    resource: string
    stageVariables: null | APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_awsLambda.SessionEventV2.html b/docs/interfaces/framework_awsLambda.SessionEventV2.html index 4dc43c746..51dc7856f 100644 --- a/docs/interfaces/framework_awsLambda.SessionEventV2.html +++ b/docs/interfaces/framework_awsLambda.SessionEventV2.html @@ -1 +1 @@ -SessionEventV2 | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEventV2
      • SessionEventV2

    Index

    Properties

    body?: string
    cookies?: string[]
    headers: APIGatewayProxyEventHeaders
    isBase64Encoded: boolean
    pathParameters?: APIGatewayProxyEventPathParameters
    queryStringParameters?: APIGatewayProxyEventQueryStringParameters
    rawPath: string
    rawQueryString: string
    requestContext: { accountId: string; apiId: string; authorizer?: { jwt: { claims: {}; scopes: string[] } }; domainName: string; domainPrefix: string; http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }; requestId: string; routeKey: string; stage: string; time: string; timeEpoch: number }

    Type declaration

    • accountId: string
    • apiId: string
    • Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
      • jwt: { claims: {}; scopes: string[] }
        • claims: {}
          • [name: string]: string | number | boolean | string[]
        • scopes: string[]
    • domainName: string
    • domainPrefix: string
    • http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
      • method: string
      • path: string
      • protocol: string
      • sourceIp: string
      • userAgent: string
    • requestId: string
    • routeKey: string
    • stage: string
    • time: string
    • timeEpoch: number
    routeKey: string
    stageVariables?: APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
    version: string

    Generated using TypeDoc

    \ No newline at end of file +SessionEventV2 | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • SupertokensLambdaEventV2
      • SessionEventV2

    Index

    Properties

    body?: string
    cookies?: string[]
    headers: APIGatewayProxyEventHeaders
    isBase64Encoded: boolean
    pathParameters?: APIGatewayProxyEventPathParameters
    queryStringParameters?: APIGatewayProxyEventQueryStringParameters
    rawPath: string
    rawQueryString: string
    requestContext: { accountId: string; apiId: string; authorizer?: { jwt: { claims: {}; scopes: string[] } }; domainName: string; domainPrefix: string; http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }; requestId: string; routeKey: string; stage: string; time: string; timeEpoch: number }

    Type declaration

    • accountId: string
    • apiId: string
    • Optional authorizer?: { jwt: { claims: {}; scopes: string[] } }
      • jwt: { claims: {}; scopes: string[] }
        • claims: {}
          • [name: string]: string | number | boolean | string[]
        • scopes: string[]
    • domainName: string
    • domainPrefix: string
    • http: { method: string; path: string; protocol: string; sourceIp: string; userAgent: string }
      • method: string
      • path: string
      • protocol: string
      • sourceIp: string
      • userAgent: string
    • requestId: string
    • routeKey: string
    • stage: string
    • time: string
    • timeEpoch: number
    routeKey: string
    stageVariables?: APIGatewayProxyEventStageVariables
    supertokens: { response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] } }

    Type declaration

    • response: { cookies: string[]; headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[] }
      • cookies: string[]
      • headers: { allowDuplicateKey: boolean; key: string; value: string | number | boolean }[]
    version: string

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_express.SessionRequest.html b/docs/interfaces/framework_express.SessionRequest.html index b70dc3146..52da94bb4 100644 --- a/docs/interfaces/framework_express.SessionRequest.html +++ b/docs/interfaces/framework_express.SessionRequest.html @@ -1,15 +1,15 @@ -SessionRequest | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • Request
      • SessionRequest

    Index

    Properties

    aborted: boolean
    +SessionRequest | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • Request
      • SessionRequest

    Index

    Properties

    aborted: boolean

    The message.aborted property will be true if the request has been aborted.

    since

    v10.1.0

    deprecated

    Since v17.0.0,v16.12.0 - Check message.destroyed from stream.Readable.

    -
    accepted: MediaType[]
    +
    accepted: MediaType[]

    Return an array of Accepted media types ordered from highest quality to lowest.

    -
    app: Application<Record<string, any>>
    baseUrl: string
    body: any
    closed: boolean
    +
    app: Application<Record<string, any>>
    baseUrl: string
    body: any
    closed: boolean

    Is true after 'close' has been emitted.

    since

    v18.0.0

    -
    complete: boolean
    +
    complete: boolean

    The message.complete property will be true if a complete HTTP message has been received and successfully parsed.

    This property is particularly useful as a means of determining if a client or @@ -17,21 +17,21 @@

    const req = http.request({
    host: '127.0.0.1',
    port: 8080,
    method: 'POST',
    }, (res) => {
    res.resume();
    res.on('end', () => {
    if (!res.complete)
    console.error(
    'The connection was terminated while the message was still being sent');
    });
    });
    since

    v0.3.0

    -
    connection: Socket
    +
    connection: Socket

    Alias for message.socket.

    since

    v0.1.90

    deprecated

    Since v16.0.0 - Use socket.

    -
    cookies: any
    destroyed: boolean
    +
    cookies: any
    destroyed: boolean

    Is true after readable.destroy() has been called.

    since

    v8.0.0

    -
    errored: null | Error
    +
    errored: null | Error

    Returns error if the stream has been destroyed with an error.

    since

    v18.0.0

    -
    fresh: boolean
    +
    fresh: boolean

    Check if the request is fresh, aka Last-Modified and/or the ETag still match.

    -
    headers: IncomingHttpHeaders
    +
    headers: IncomingHttpHeaders

    The request/response headers object.

    Key-value pairs of header names and values. Header names are lower-cased.

    // Prints something like:
    //
    // { 'user-agent': 'curl/7.22.0',
    // host: '127.0.0.1:8000',
    // accept: '*' }
    console.log(request.headers); @@ -49,41 +49,43 @@
  • For all other headers, the values are joined together with , .
  • since

    v0.1.5

    -
    headersDistinct: Dict<string[]>
    +
    headersDistinct: Dict<string[]>

    Similar to message.headers, but there is no join logic and the values are always arrays of strings, even for headers received just once.

    // Prints something like:
    //
    // { 'user-agent': ['curl/7.22.0'],
    // host: ['127.0.0.1:8000'],
    // accept: ['*'] }
    console.log(request.headersDistinct);
    since

    v18.3.0, v16.17.0

    -
    host: string
    deprecated

    Use hostname instead.

    -
    hostname: string
    +
    host: string
    deprecated

    Use hostname instead.

    +
    hostname: string

    Parse the "Host" header field hostname.

    -
    httpVersion: string
    +
    httpVersion: string

    In case of server request, the HTTP version sent by the client. In the case of client response, the HTTP version of the connected-to server. Probably either '1.1' or '1.0'.

    Also message.httpVersionMajor is the first integer andmessage.httpVersionMinor is the second.

    since

    v0.1.1

    -
    httpVersionMajor: number
    httpVersionMinor: number
    ip: string
    +
    httpVersionMajor: number
    httpVersionMinor: number
    ip: undefined | string

    Return the remote address, or when "trust proxy" is true return the upstream addr.

    -
    ips: string[]
    +

    Value may be undefined if the req.socket is destroyed +(for example, if the client disconnected).

    +
    ips: string[]

    When "trust proxy" is true, parse the "X-Forwarded-For" ip address list.

    For example if the value were "client, proxy1, proxy2" you would receive the array ["client", "proxy1", "proxy2"] where "proxy2" is the furthest down-stream.

    -
    method: string
    next?: NextFunction
    originalUrl: string
    params: ParamsDictionary
    path: string
    +
    method: string
    next?: NextFunction
    originalUrl: string
    params: ParamsDictionary
    path: string

    Short-hand for url.parse(req.url).pathname.

    -
    protocol: string
    +
    protocol: string

    Return the protocol string "http" or "https" when requested with TLS. When the "trust proxy" setting is enabled the "X-Forwarded-Proto" header field will be trusted. If you're running behind a reverse proxy that supplies https for you this may be enabled.

    -
    query: ParsedQs
    rawHeaders: string[]
    +
    query: ParsedQs
    rawHeaders: string[]

    The raw request/response headers list exactly as they were received.

    The keys and values are in the same list. It is not a list of tuples. So, the even-numbered offsets are key values, and the @@ -92,48 +94,48 @@

    // Prints something like:
    //
    // [ 'user-agent',
    // 'this is invalid because there can be only one',
    // 'User-Agent',
    // 'curl/7.22.0',
    // 'Host',
    // '127.0.0.1:8000',
    // 'ACCEPT',
    // '*' ]
    console.log(request.rawHeaders);
    since

    v0.11.6

    -
    rawTrailers: string[]
    +
    rawTrailers: string[]

    The raw request/response trailer keys and values exactly as they were received. Only populated at the 'end' event.

    since

    v0.11.6

    -
    readable: boolean
    +
    readable: boolean

    Is true if it is safe to call readable.read(), which means the stream has not been destroyed or emitted 'error' or 'end'.

    since

    v11.4.0

    -
    readableAborted: boolean
    +
    readableAborted: boolean

    Returns whether the stream was destroyed or errored before emitting 'end'.

    since

    v16.8.0

    -
    experimental
    readableDidRead: boolean
    +
    experimental
    readableDidRead: boolean

    Returns whether 'data' has been emitted.

    since

    v16.7.0, v14.18.0

    -
    experimental
    readableEncoding: null | BufferEncoding
    +
    experimental
    readableEncoding: null | BufferEncoding

    Getter for the property encoding of a given Readable stream. The encodingproperty can be set using the readable.setEncoding() method.

    since

    v12.7.0

    -
    readableEnded: boolean
    +
    readableEnded: boolean

    Becomes true when 'end' event is emitted.

    since

    v12.9.0

    -
    readableFlowing: null | boolean
    +
    readableFlowing: null | boolean

    This property reflects the current state of a Readable stream as described in the Three states section.

    since

    v9.4.0

    -
    readableHighWaterMark: number
    +
    readableHighWaterMark: number

    Returns the value of highWaterMark passed when creating this Readable.

    since

    v9.3.0

    -
    readableLength: number
    +
    readableLength: number

    This property contains the number of bytes (or objects) in the queue ready to be read. The value provides introspection data regarding the status of the highWaterMark.

    since

    v9.4.0

    -
    readableObjectMode: boolean
    +
    readableObjectMode: boolean

    Getter for the property objectMode of a given Readable stream.

    since

    v12.3.0

    -
    res?: Response<any, Record<string, any>, number>
    +
    res?: Response<any, Record<string, any>, number>

    After middleware.init executed, Request will contain res and next properties See: express/lib/middleware/init.js

    -
    route: any
    secure: boolean
    +
    route: any
    secure: boolean

    Short-hand for:

    req.protocol == 'https'

    -
    signedCookies: any
    socket: Socket
    +
    signedCookies: any
    socket: Socket

    The net.Socket object associated with the connection.

    With HTTPS support, use request.socket.getPeerCertificate() to obtain the client's authentication details.

    @@ -141,19 +143,19 @@ a subclass of stream.Duplex, unless the user specified a socket type other than net.Socket or internally nulled.

    since

    v0.3.0

    -
    stale: boolean
    +
    stale: boolean

    Check if the request is stale, aka "Last-Modified" and / or the "ETag" for the resource has changed.

    -
    statusCode?: number
    +
    statusCode?: number

    Only valid for response obtained from {@link ClientRequest}.

    The 3-digit HTTP response status code. E.G. 404.

    since

    v0.1.1

    -
    statusMessage?: string
    +
    statusMessage?: string

    Only valid for response obtained from {@link ClientRequest}.

    The HTTP response status message (reason phrase). E.G. OK or Internal Server Error.

    since

    v0.11.10

    -
    subdomains: string[]
    +
    subdomains: string[]

    Return subdomains as an array.

    Subdomains are the dot-separated parts of the host before the main domain of the app. By default, the domain of the app is assumed to be the last two @@ -161,23 +163,23 @@

    For example, if the domain is "tobi.ferrets.example.com": If "subdomain offset" is not set, req.subdomains is ["ferrets", "tobi"]. If "subdomain offset" is 3, req.subdomains is ["tobi"].

    -
    trailers: Dict<string>
    +
    trailers: Dict<string>

    The request/response trailers object. Only populated at the 'end' event.

    since

    v0.3.0

    -
    trailersDistinct: Dict<string[]>
    +
    trailersDistinct: Dict<string[]>

    Similar to message.trailers, but there is no join logic and the values are always arrays of strings, even for headers received just once. Only populated at the 'end' event.

    since

    v18.3.0, v16.17.0

    -
    url: string
    xhr: boolean
    +
    url: string
    xhr: boolean

    Check if the request was an XMLHttpRequest.

    -

    Methods

    • [Symbol.asyncDispose](): Promise<void>
    • +

    Methods

    • [Symbol.asyncDispose](): Promise<void>
    • Calls readable.destroy() with an AbortError and returns a promise that fulfills when the stream is finished.

      since

      v20.4.0

      -

      Returns Promise<void>

    • [Symbol.asyncIterator](): AsyncIterableIterator<any>
    • Returns AsyncIterableIterator<any>

    • [asyncDispose](): Promise<void>
    • +

      Returns Promise<void>

    • [Symbol.asyncIterator](): AsyncIterableIterator<any>
    • Returns AsyncIterableIterator<any>

    • [asyncDispose](): Promise<void>
    • Calls readable.destroy() with an AbortError and returns a promise that fulfills when the stream is finished.

      since

      v20.4.0

      -

      Returns Promise<void>

    • _construct(callback: ((error?: null | Error) => void)): void
    • Parameters

      • callback: ((error?: null | Error) => void)
          • (error?: null | Error): void
          • Parameters

            • Optional error: null | Error

            Returns void

      Returns void

    • _destroy(error: null | Error, callback: ((error?: null | Error) => void)): void
    • Parameters

      • error: null | Error
      • callback: ((error?: null | Error) => void)
          • (error?: null | Error): void
          • Parameters

            • Optional error: null | Error

            Returns void

      Returns void

    • _read(size: number): void
    • Parameters

      • size: number

      Returns void

    • accepts(): string[]
    • accepts(type: string): string | false
    • accepts(type: string[]): string | false
    • accepts(...type: string[]): string | false
    • +

      Returns Promise<void>

    • [captureRejectionSymbol]<K>(error: Error, event: string | symbol, ...args: AnyRest): void
    • Type Parameters

      • K

      Parameters

      • error: Error
      • event: string | symbol
      • Rest ...args: AnyRest

      Returns void

    • _construct(callback: ((error?: null | Error) => void)): void
    • Parameters

      • callback: ((error?: null | Error) => void)
          • (error?: null | Error): void
          • Parameters

            • Optional error: null | Error

            Returns void

      Returns void

    • _destroy(error: null | Error, callback: ((error?: null | Error) => void)): void
    • Parameters

      • error: null | Error
      • callback: ((error?: null | Error) => void)
          • (error?: null | Error): void
          • Parameters

            • Optional error: null | Error

            Returns void

      Returns void

    • _read(size: number): void
    • Parameters

      • size: number

      Returns void

    • accepts(): string[]
    • accepts(type: string): string | false
    • accepts(type: string[]): string | false
    • accepts(...type: string[]): string | false
    • Check if the given type(s) is acceptable, returning the best match when true, otherwise undefined, in which case you should respond with 406 "Not Acceptable".

      @@ -187,24 +189,24 @@ or an array ["json", "html", "text/plain"]. When a list or array is given the best match, if any is returned.

      Examples:

      -
      // Accept: text/html
      req.accepts('html');
      // => "html"

      // Accept: text/*, application/json
      req.accepts('html');
      // => "html"
      req.accepts('text/html');
      // => "text/html"
      req.accepts('json, text');
      // => "json"
      req.accepts('application/json');
      // => "application/json"

      // Accept: text/*, application/json
      req.accepts('image/png');
      req.accepts('png');
      // => undefined

      // Accept: text/*;q=.5, application/json
      req.accepts(['html', 'json']);
      req.accepts('html, json');
      // => "json" +
      // Accept: text/html
      req.accepts('html');
      // => "html"

      // Accept: text/*, application/json
      req.accepts('html');
      // => "html"
      req.accepts('text/html');
      // => "text/html"
      req.accepts('json, text');
      // => "json"
      req.accepts('application/json');
      // => "application/json"

      // Accept: text/*, application/json
      req.accepts('image/png');
      req.accepts('png');
      // => false

      // Accept: text/*;q=.5, application/json
      req.accepts(['html', 'json']);
      req.accepts('html, json');
      // => "json"
      -

      Returns string[]

    • Parameters

      • type: string

      Returns string | false

    • Parameters

      • type: string[]

      Returns string | false

    • Parameters

      • Rest ...type: string[]

      Returns string | false

    • acceptsCharsets(): string[]
    • acceptsCharsets(charset: string): string | false
    • acceptsCharsets(charset: string[]): string | false
    • acceptsCharsets(...charset: string[]): string | false
    • +

      Returns string[]

    • Parameters

      • type: string

      Returns string | false

    • Parameters

      • type: string[]

      Returns string | false

    • Parameters

      • Rest ...type: string[]

      Returns string | false

    • acceptsCharsets(): string[]
    • acceptsCharsets(charset: string): string | false
    • acceptsCharsets(charset: string[]): string | false
    • acceptsCharsets(...charset: string[]): string | false
    • Returns the first accepted charset of the specified character sets, based on the request's Accept-Charset HTTP header field. If none of the specified charsets is accepted, returns false.

      For more information, or if you have issues or concerns, see accepts.

      -

      Returns string[]

    • Parameters

      • charset: string

      Returns string | false

    • Parameters

      • charset: string[]

      Returns string | false

    • Parameters

      • Rest ...charset: string[]

      Returns string | false

    • acceptsEncodings(): string[]
    • acceptsEncodings(encoding: string): string | false
    • acceptsEncodings(encoding: string[]): string | false
    • acceptsEncodings(...encoding: string[]): string | false
    • +

      Returns string[]

    • Parameters

      • charset: string

      Returns string | false

    • Parameters

      • charset: string[]

      Returns string | false

    • Parameters

      • Rest ...charset: string[]

      Returns string | false

    • acceptsEncodings(): string[]
    • acceptsEncodings(encoding: string): string | false
    • acceptsEncodings(encoding: string[]): string | false
    • acceptsEncodings(...encoding: string[]): string | false
    • Returns the first accepted encoding of the specified encodings, based on the request's Accept-Encoding HTTP header field. If none of the specified encodings is accepted, returns false.

      For more information, or if you have issues or concerns, see accepts.

      -

      Returns string[]

    • Parameters

      • encoding: string

      Returns string | false

    • Parameters

      • encoding: string[]

      Returns string | false

    • Parameters

      • Rest ...encoding: string[]

      Returns string | false

    • acceptsLanguages(): string[]
    • acceptsLanguages(lang: string): string | false
    • acceptsLanguages(lang: string[]): string | false
    • acceptsLanguages(...lang: string[]): string | false
    • +

      Returns string[]

    • Parameters

      • encoding: string

      Returns string | false

    • Parameters

      • encoding: string[]

      Returns string | false

    • Parameters

      • Rest ...encoding: string[]

      Returns string | false

    • acceptsLanguages(): string[]
    • acceptsLanguages(lang: string): string | false
    • acceptsLanguages(lang: string[]): string | false
    • acceptsLanguages(...lang: string[]): string | false
    • Returns the first accepted language of the specified languages, based on the request's Accept-Language HTTP header field. If none of the specified languages is accepted, returns false.

      For more information, or if you have issues or concerns, see accepts.

      -

      Returns string[]

    • Parameters

      • lang: string

      Returns string | false

    • Parameters

      • lang: string[]

      Returns string | false

    • Parameters

      • Rest ...lang: string[]

      Returns string | false

    • addListener(event: "close", listener: (() => void)): SessionRequest
    • addListener(event: "data", listener: ((chunk: any) => void)): SessionRequest
    • addListener(event: "end", listener: (() => void)): SessionRequest
    • addListener(event: "error", listener: ((err: Error) => void)): SessionRequest
    • addListener(event: "pause", listener: (() => void)): SessionRequest
    • addListener(event: "readable", listener: (() => void)): SessionRequest
    • addListener(event: "resume", listener: (() => void)): SessionRequest
    • addListener(event: string | symbol, listener: ((...args: any[]) => void)): SessionRequest
    • +

      Returns string[]

    • Parameters

      • lang: string

      Returns string | false

    • Parameters

      • lang: string[]

      Returns string | false

    • Parameters

      • Rest ...lang: string[]

      Returns string | false

    • addListener(event: "close", listener: (() => void)): SessionRequest
    • addListener(event: "data", listener: ((chunk: any) => void)): SessionRequest
    • addListener(event: "end", listener: (() => void)): SessionRequest
    • addListener(event: "error", listener: ((err: Error) => void)): SessionRequest
    • addListener(event: "pause", listener: (() => void)): SessionRequest
    • addListener(event: "readable", listener: (() => void)): SessionRequest
    • addListener(event: "resume", listener: (() => void)): SessionRequest
    • addListener(event: string | symbol, listener: ((...args: any[]) => void)): SessionRequest
    • Event emitter The defined events on documents including:

        @@ -216,17 +218,77 @@
      1. readable
      2. resume
      -

      Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • compose<T>(stream: T | ComposeFnParam | Iterable<T> | AsyncIterable<T>, options?: { signal: AbortSignal }): T
    • Type Parameters

      • T extends ReadableStream<T>

      Parameters

      • stream: T | ComposeFnParam | Iterable<T> | AsyncIterable<T>
      • Optional options: { signal: AbortSignal }
        • signal: AbortSignal

      Returns T

    • +

      Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • asIndexedPairs(options?: Pick<ArrayOptions, "signal">): Readable
    • +

      This method returns a new stream with chunks of the underlying stream paired with a counter +in the form [index, chunk]. The first index value is 0 and it increases by 1 for each chunk produced.

      +
      since

      v17.5.0

      +

      Parameters

      • Optional options: Pick<ArrayOptions, "signal">

      Returns Readable

      a stream of indexed pairs.

      +
    • compose<T>(stream: T | ComposeFnParam | Iterable<T> | AsyncIterable<T>, options?: { signal: AbortSignal }): T
    • Type Parameters

      • T extends ReadableStream<T>

      Parameters

      • stream: T | ComposeFnParam | Iterable<T> | AsyncIterable<T>
      • Optional options: { signal: AbortSignal }
        • signal: AbortSignal

      Returns T

    • Calls destroy() on the socket that received the IncomingMessage. If erroris provided, an 'error' event is emitted on the socket and error is passed as an argument to any listeners on the event.

      since

      v0.3.0

      -

      Parameters

      • Optional error: Error

      Returns SessionRequest

    • emit(event: "close"): boolean
    • emit(event: "data", chunk: any): boolean
    • emit(event: "end"): boolean
    • emit(event: "error", err: Error): boolean
    • emit(event: "pause"): boolean
    • emit(event: "readable"): boolean
    • emit(event: "resume"): boolean
    • emit(event: string | symbol, ...args: any[]): boolean
    • Parameters

      • event: "close"

      Returns boolean

    • Parameters

      • event: "data"
      • chunk: any

      Returns boolean

    • Parameters

      • event: "end"

      Returns boolean

    • Parameters

      • event: "error"
      • err: Error

      Returns boolean

    • Parameters

      • event: "pause"

      Returns boolean

    • Parameters

      • event: "readable"

      Returns boolean

    • Parameters

      • event: "resume"

      Returns boolean

    • Parameters

      • event: string | symbol
      • Rest ...args: any[]

      Returns boolean

    • eventNames(): (string | symbol)[]
    • +

      Parameters

      • Optional error: Error

      Returns SessionRequest

    • drop(limit: number, options?: Pick<ArrayOptions, "signal">): Readable
    • +

      This method returns a new stream with the first limit chunks dropped from the start.

      +
      since

      v17.5.0

      +

      Parameters

      • limit: number
        +

        the number of chunks to drop from the readable.

        +
      • Optional options: Pick<ArrayOptions, "signal">

      Returns Readable

      a stream with limit chunks dropped from the start.

      +
    • emit(event: "close"): boolean
    • emit(event: "data", chunk: any): boolean
    • emit(event: "end"): boolean
    • emit(event: "error", err: Error): boolean
    • emit(event: "pause"): boolean
    • emit(event: "readable"): boolean
    • emit(event: "resume"): boolean
    • emit(event: string | symbol, ...args: any[]): boolean
    • Parameters

      • event: "close"

      Returns boolean

    • Parameters

      • event: "data"
      • chunk: any

      Returns boolean

    • Parameters

      • event: "end"

      Returns boolean

    • Parameters

      • event: "error"
      • err: Error

      Returns boolean

    • Parameters

      • event: "pause"

      Returns boolean

    • Parameters

      • event: "readable"

      Returns boolean

    • Parameters

      • event: "resume"

      Returns boolean

    • Parameters

      • event: string | symbol
      • Rest ...args: any[]

      Returns boolean

    • eventNames(): (string | symbol)[]
    • Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

      import { EventEmitter } from 'node:events';

      const myEE = new EventEmitter();
      myEE.on('foo', () => {});
      myEE.on('bar', () => {});

      const sym = Symbol('symbol');
      myEE.on(sym, () => {});

      console.log(myEE.eventNames());
      // Prints: [ 'foo', 'bar', Symbol(symbol) ]
      since

      v6.0.0

      -

      Returns (string | symbol)[]

    • get(name: "set-cookie"): undefined | string[]
    • get(name: string): undefined | string
    • +

      Returns (string | symbol)[]

    • every(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Promise<boolean>
    • +

      This method is similar to Array.prototype.every and calls fn on each chunk in the stream +to check if all awaited return values are truthy value for fn. Once an fn call on a chunk +awaited return value is falsy, the stream is destroyed and the promise is fulfilled with false. +If all of the fn calls on the chunks return a truthy value, the promise is fulfilled with true.

      +
      since

      v17.5.0

      +

      Parameters

      • fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>)
        +

        a function to call on each chunk of the stream. Async or not.

        +
          • (data: any, options?: Pick<ArrayOptions, "signal">): boolean | Promise<boolean>
          • Parameters

            • data: any
            • Optional options: Pick<ArrayOptions, "signal">

            Returns boolean | Promise<boolean>

      • Optional options: ArrayOptions

      Returns Promise<boolean>

      a promise evaluating to true if fn returned a truthy value for every one of the chunks.

      +
    • filter(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Readable
    • +

      This method allows filtering the stream. For each chunk in the stream the fn function will be called +and if it returns a truthy value, the chunk will be passed to the result stream. +If the fn function returns a promise - that promise will be awaited.

      +
      since

      v17.4.0, v16.14.0

      +

      Parameters

      • fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>)
        +

        a function to filter chunks from the stream. Async or not.

        +
          • (data: any, options?: Pick<ArrayOptions, "signal">): boolean | Promise<boolean>
          • Parameters

            • data: any
            • Optional options: Pick<ArrayOptions, "signal">

            Returns boolean | Promise<boolean>

      • Optional options: ArrayOptions

      Returns Readable

      a stream filtered with the predicate fn.

      +
    • find<T>(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => data is T), options?: ArrayOptions): Promise<undefined | T>
    • find(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Promise<any>
    • +

      This method is similar to Array.prototype.find and calls fn on each chunk in the stream +to find a chunk with a truthy value for fn. Once an fn call's awaited return value is truthy, +the stream is destroyed and the promise is fulfilled with value for which fn returned a truthy value. +If all of the fn calls on the chunks return a falsy value, the promise is fulfilled with undefined.

      +
      since

      v17.5.0

      +

      Type Parameters

      • T

      Parameters

      • fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => data is T)
        +

        a function to call on each chunk of the stream. Async or not.

        +
          • (data: any, options?: Pick<ArrayOptions, "signal">): data is T
          • Parameters

            • data: any
            • Optional options: Pick<ArrayOptions, "signal">

            Returns data is T

      • Optional options: ArrayOptions

      Returns Promise<undefined | T>

      a promise evaluating to the first chunk for which fn evaluated with a truthy value, +or undefined if no element was found.

      +
    • Parameters

      • fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>)
          • (data: any, options?: Pick<ArrayOptions, "signal">): boolean | Promise<boolean>
          • Parameters

            • data: any
            • Optional options: Pick<ArrayOptions, "signal">

            Returns boolean | Promise<boolean>

      • Optional options: ArrayOptions

      Returns Promise<any>

    • flatMap(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => any), options?: ArrayOptions): Readable
    • +

      This method returns a new stream by applying the given callback to each chunk of the stream +and then flattening the result.

      +

      It is possible to return a stream or another iterable or async iterable from fn and the result streams +will be merged (flattened) into the returned stream.

      +
      since

      v17.5.0

      +

      Parameters

      • fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => any)
        +

        a function to map over every chunk in the stream. May be async. May be a stream or generator.

        +
          • (data: any, options?: Pick<ArrayOptions, "signal">): any
          • Parameters

            • data: any
            • Optional options: Pick<ArrayOptions, "signal">

            Returns any

      • Optional options: ArrayOptions

      Returns Readable

      a stream flat-mapped with the function fn.

      +
    • forEach(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => void | Promise<void>), options?: ArrayOptions): Promise<void>
    • +

      This method allows iterating a stream. For each chunk in the stream the fn function will be called. +If the fn function returns a promise - that promise will be awaited.

      +

      This method is different from for await...of loops in that it can optionally process chunks concurrently. +In addition, a forEach iteration can only be stopped by having passed a signal option +and aborting the related AbortController while for await...of can be stopped with break or return. +In either case the stream will be destroyed.

      +

      This method is different from listening to the 'data' event in that it uses the readable event +in the underlying machinary and can limit the number of concurrent fn calls.

      +
      since

      v17.5.0

      +

      Parameters

      • fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => void | Promise<void>)
        +

        a function to call on each chunk of the stream. Async or not.

        +
          • (data: any, options?: Pick<ArrayOptions, "signal">): void | Promise<void>
          • Parameters

            • data: any
            • Optional options: Pick<ArrayOptions, "signal">

            Returns void | Promise<void>

      • Optional options: ArrayOptions

      Returns Promise<void>

      a promise for when the stream has finished.

      +
    • get(name: "set-cookie"): undefined | string[]
    • get(name: string): undefined | string
    • Return request header.

      The Referrer header field is special-cased, both Referrer and Referer are interchangeable.

      @@ -234,41 +296,57 @@
      req.get('Content-Type');
      // => "text/plain"

      req.get('content-type');
      // => "text/plain"

      req.get('Something');
      // => undefined

      Aliased as req.header().

      -

      Parameters

      • name: "set-cookie"

      Returns undefined | string[]

    • Parameters

      • name: string

      Returns undefined | string

    • getMaxListeners(): number
    • +

      Parameters

      • name: "set-cookie"

      Returns undefined | string[]

    • Parameters

      • name: string

      Returns undefined | string

    • getMaxListeners(): number
    • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to {@link defaultMaxListeners}.

      since

      v1.0.0

      -

      Returns number

    • header(name: "set-cookie"): undefined | string[]
    • header(name: string): undefined | string
    • Parameters

      • name: "set-cookie"

      Returns undefined | string[]

    • Parameters

      • name: string

      Returns undefined | string

    • is(type: string | string[]): null | string | false
    • +

      Returns number

    • header(name: "set-cookie"): undefined | string[]
    • header(name: string): undefined | string
    • Parameters

      • name: "set-cookie"

      Returns undefined | string[]

    • Parameters

      • name: string

      Returns undefined | string

    • is(type: string | string[]): null | string | false
    • Check if the incoming request contains the "Content-Type" header field, and it contains the give mime type.

      Examples:

       // With Content-Type: text/html; charset=utf-8
      req.is('html');
      req.is('text/html');
      req.is('text/*');
      // => true

      // When Content-Type is application/json
      req.is('json');
      req.is('application/json');
      req.is('application/*');
      // => true

      req.is('html');
      // => false
      -

      Parameters

      • type: string | string[]

      Returns null | string | false

    • isPaused(): boolean
    • +

      Parameters

      • type: string | string[]

      Returns null | string | false

    • isPaused(): boolean
    • The readable.isPaused() method returns the current operating state of theReadable. This is used primarily by the mechanism that underlies thereadable.pipe() method. In most typical cases, there will be no reason to use this method directly.

      const readable = new stream.Readable();

      readable.isPaused(); // === false
      readable.pause();
      readable.isPaused(); // === true
      readable.resume();
      readable.isPaused(); // === false
      since

      v0.11.14

      -

      Returns boolean

    • listenerCount(eventName: string | symbol, listener?: Function): number
    • +

      Returns boolean

    • iterator(options?: { destroyOnReturn?: boolean }): AsyncIterableIterator<any>
    • +

      The iterator created by this method gives users the option to cancel the destruction +of the stream if the for await...of loop is exited by return, break, or throw, +or if the iterator should destroy the stream if the stream emitted an error during iteration.

      +
      since

      v16.3.0

      +

      Parameters

      • Optional options: { destroyOnReturn?: boolean }
        • Optional destroyOnReturn?: boolean
          +

          When set to false, calling return on the async iterator, +or exiting a for await...of iteration using a break, return, or throw will not destroy the stream. +Default: true.

          +

      Returns AsyncIterableIterator<any>

    • listenerCount<K>(eventName: string | symbol, listener?: Function): number
    • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

      since

      v3.2.0

      -

      Parameters

      • eventName: string | symbol
        +

        Type Parameters

        • K

        Parameters

        • eventName: string | symbol

          The name of the event being listened for

        • Optional listener: Function

          The event handler function

          -

        Returns number

    • listeners(eventName: string | symbol): Function[]
    • +

    Returns number

    • listeners<K>(eventName: string | symbol): Function[]
    • Returns a copy of the array of listeners for the event named eventName.

      server.on('connection', (stream) => {
      console.log('someone connected!');
      });
      console.log(util.inspect(server.listeners('connection')));
      // Prints: [ [Function] ]
      since

      v0.1.26

      -

      Parameters

      • eventName: string | symbol

      Returns Function[]

    • off(eventName: string | symbol, listener: ((...args: any[]) => void)): SessionRequest
    • +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

    • map(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => any), options?: ArrayOptions): Readable
    • +

      This method allows mapping over the stream. The fn function will be called for every chunk in the stream. +If the fn function returns a promise - that promise will be awaited before being passed to the result stream.

      +
      since

      v17.4.0, v16.14.0

      +

      Parameters

      • fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => any)
        +

        a function to map over every chunk in the stream. Async or not.

        +
          • (data: any, options?: Pick<ArrayOptions, "signal">): any
          • Parameters

            • data: any
            • Optional options: Pick<ArrayOptions, "signal">

            Returns any

      • Optional options: ArrayOptions

      Returns Readable

      a stream mapped with the function fn.

      +
    • off<K>(eventName: string | symbol, listener: ((...args: any[]) => void)): SessionRequest
    • Alias for emitter.removeListener().

      since

      v10.0.0

      -

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • param(name: string, defaultValue?: any): string
    • deprecated

      since 4.11 Use either req.params, req.body or req.query, as applicable.

      +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • param(name: string, defaultValue?: any): string
    • deprecated

      since 4.11 Use either req.params, req.body or req.query, as applicable.

      Return the value of param name when present or defaultValue.

      • Checks route placeholders, ex: /user/:id
      • @@ -278,7 +356,7 @@

        To utilize request bodies, req.body should be an object. This can be done by using the connect.bodyParser() middleware.

        -

      Parameters

      • name: string
      • Optional defaultValue: any

      Returns string

    • +

      Parameters

      • name: string
      • Optional defaultValue: any

      Returns string

    • The readable.pause() method will cause a stream in flowing mode to stop emitting 'data' events, switching out of flowing mode. Any data that becomes available will remain in the internal buffer.

      @@ -286,7 +364,7 @@

      The readable.pause() method has no effect if there is a 'readable'event listener.

      since

      v0.9.4

      -

      Returns SessionRequest

    • pipe<T>(destination: T, options?: { end?: boolean }): T
    • Type Parameters

      • T extends WritableStream<T>

      Parameters

      • destination: T
      • Optional options: { end?: boolean }
        • Optional end?: boolean

      Returns T

    • prependListener(event: "close", listener: (() => void)): SessionRequest
    • prependListener(event: "data", listener: ((chunk: any) => void)): SessionRequest
    • prependListener(event: "end", listener: (() => void)): SessionRequest
    • prependListener(event: "error", listener: ((err: Error) => void)): SessionRequest
    • prependListener(event: "pause", listener: (() => void)): SessionRequest
    • prependListener(event: "readable", listener: (() => void)): SessionRequest
    • prependListener(event: "resume", listener: (() => void)): SessionRequest
    • prependListener(event: string | symbol, listener: ((...args: any[]) => void)): SessionRequest
    • Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • prependOnceListener(event: "close", listener: (() => void)): SessionRequest
    • prependOnceListener(event: "data", listener: ((chunk: any) => void)): SessionRequest
    • prependOnceListener(event: "end", listener: (() => void)): SessionRequest
    • prependOnceListener(event: "error", listener: ((err: Error) => void)): SessionRequest
    • prependOnceListener(event: "pause", listener: (() => void)): SessionRequest
    • prependOnceListener(event: "readable", listener: (() => void)): SessionRequest
    • prependOnceListener(event: "resume", listener: (() => void)): SessionRequest
    • prependOnceListener(event: string | symbol, listener: ((...args: any[]) => void)): SessionRequest
    • Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • push(chunk: any, encoding?: BufferEncoding): boolean
    • Parameters

      • chunk: any
      • Optional encoding: BufferEncoding

      Returns boolean

    • range(size: number, options?: Options): undefined | Ranges | Result
    • +

      Returns SessionRequest

    • pipe<T>(destination: T, options?: { end?: boolean }): T
    • Type Parameters

      • T extends WritableStream<T>

      Parameters

      • destination: T
      • Optional options: { end?: boolean }
        • Optional end?: boolean

      Returns T

    • prependListener(event: "close", listener: (() => void)): SessionRequest
    • prependListener(event: "data", listener: ((chunk: any) => void)): SessionRequest
    • prependListener(event: "end", listener: (() => void)): SessionRequest
    • prependListener(event: "error", listener: ((err: Error) => void)): SessionRequest
    • prependListener(event: "pause", listener: (() => void)): SessionRequest
    • prependListener(event: "readable", listener: (() => void)): SessionRequest
    • prependListener(event: "resume", listener: (() => void)): SessionRequest
    • prependListener(event: string | symbol, listener: ((...args: any[]) => void)): SessionRequest
    • Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • prependOnceListener(event: "close", listener: (() => void)): SessionRequest
    • prependOnceListener(event: "data", listener: ((chunk: any) => void)): SessionRequest
    • prependOnceListener(event: "end", listener: (() => void)): SessionRequest
    • prependOnceListener(event: "error", listener: ((err: Error) => void)): SessionRequest
    • prependOnceListener(event: "pause", listener: (() => void)): SessionRequest
    • prependOnceListener(event: "readable", listener: (() => void)): SessionRequest
    • prependOnceListener(event: "resume", listener: (() => void)): SessionRequest
    • prependOnceListener(event: string | symbol, listener: ((...args: any[]) => void)): SessionRequest
    • Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • push(chunk: any, encoding?: BufferEncoding): boolean
    • Parameters

      • chunk: any
      • Optional encoding: BufferEncoding

      Returns boolean

    • range(size: number, options?: Options): undefined | Ranges | Result
    • Parse Range header field, capping to the given size.

      Unspecified ranges such as "0-" require knowledge of your resource length. In the case of a byte range this is of course the total number of bytes. @@ -295,13 +373,13 @@ See more ./types/range-parser/index.d.ts

      NOTE: remember that ranges are inclusive, so for example "Range: users=0-3" should respond with 4 users when available, not 3.

      -

      Parameters

      • size: number
      • Optional options: Options

      Returns undefined | Ranges | Result

    • rawListeners(eventName: string | symbol): Function[]
    • +

      Parameters

      • size: number
      • Optional options: Options

      Returns undefined | Ranges | Result

    • rawListeners<K>(eventName: string | symbol): Function[]
    • Returns a copy of the array of listeners for the event named eventName, including any wrappers (such as those created by .once()).

      import { EventEmitter } from 'node:events';
      const emitter = new EventEmitter();
      emitter.once('log', () => console.log('log once'));

      // Returns a new Array with a function `onceWrapper` which has a property
      // `listener` which contains the original listener bound above
      const listeners = emitter.rawListeners('log');
      const logFnWrapper = listeners[0];

      // Logs "log once" to the console and does not unbind the `once` event
      logFnWrapper.listener();

      // Logs "log once" to the console and removes the listener
      logFnWrapper();

      emitter.on('log', () => console.log('log persistently'));
      // Will return a new Array with a single function bound by `.on()` above
      const newListeners = emitter.rawListeners('log');

      // Logs "log persistently" twice
      newListeners[0]();
      emitter.emit('log');
      since

      v9.4.0

      -

      Parameters

      • eventName: string | symbol

      Returns Function[]

    • read(size?: number): any
    • +

      Type Parameters

      • K

      Parameters

      • eventName: string | symbol

      Returns Function[]

    • read(size?: number): any
    • The readable.read() method reads data out of the internal buffer and returns it. If no data is available to be read, null is returned. By default, the data is returned as a Buffer object unless an encoding has been @@ -338,14 +416,27 @@

      since

      v0.9.4

      Parameters

      • Optional size: number

        Optional argument to specify how much data to read.

        -

      Returns any

    • +

    Returns any

    • reduce<T>(fn: ((previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T), initial?: undefined, options?: Pick<ArrayOptions, "signal">): Promise<T>
    • reduce<T>(fn: ((previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T), initial: T, options?: Pick<ArrayOptions, "signal">): Promise<T>
    • +

      This method calls fn on each chunk of the stream in order, passing it the result from the calculation +on the previous element. It returns a promise for the final value of the reduction.

      +

      If no initial value is supplied the first chunk of the stream is used as the initial value. +If the stream is empty, the promise is rejected with a TypeError with the ERR_INVALID_ARGS code property.

      +

      The reducer function iterates the stream element-by-element which means that there is no concurrency parameter +or parallelism. To perform a reduce concurrently, you can extract the async function to readable.map method.

      +
      since

      v17.5.0

      +

      Type Parameters

      • T = any

      Parameters

      • fn: ((previous: any, data: any, options?: Pick<ArrayOptions, "signal">) => T)
        +

        a reducer function to call over every chunk in the stream. Async or not.

        +
          • (previous: any, data: any, options?: Pick<ArrayOptions, "signal">): T
          • Parameters

            • previous: any
            • data: any
            • Optional options: Pick<ArrayOptions, "signal">

            Returns T

      • Optional initial: undefined
        +

        the initial value to use in the reduction.

        +
      • Optional options: Pick<ArrayOptions, "signal">

      Returns Promise<T>

      a promise for the final value of the reduction.

      +
    • Type Parameters

      • T = any

      Parameters

      • fn: ((previous: T, data: any, options?: Pick<ArrayOptions, "signal">) => T)
          • (previous: T, data: any, options?: Pick<ArrayOptions, "signal">): T
          • Parameters

            • previous: T
            • data: any
            • Optional options: Pick<ArrayOptions, "signal">

            Returns T

      • initial: T
      • Optional options: Pick<ArrayOptions, "signal">

      Returns Promise<T>

    • Removes all listeners, or those of the specified eventName.

      It is bad practice to remove listeners added elsewhere in the code, particularly when the EventEmitter instance was created by some other component or module (e.g. sockets or file streams).

      Returns a reference to the EventEmitter, so that calls can be chained.

      since

      v0.1.26

      -

      Parameters

      • Optional event: string | symbol

      Returns SessionRequest

    • removeListener(event: "close", listener: (() => void)): SessionRequest
    • removeListener(event: "data", listener: ((chunk: any) => void)): SessionRequest
    • removeListener(event: "end", listener: (() => void)): SessionRequest
    • removeListener(event: "error", listener: ((err: Error) => void)): SessionRequest
    • removeListener(event: "pause", listener: (() => void)): SessionRequest
    • removeListener(event: "readable", listener: (() => void)): SessionRequest
    • removeListener(event: "resume", listener: (() => void)): SessionRequest
    • removeListener(event: string | symbol, listener: ((...args: any[]) => void)): SessionRequest
    • Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • +

      Parameters

      • Optional event: string | symbol

      Returns SessionRequest

    • removeListener(event: "close", listener: (() => void)): SessionRequest
    • removeListener(event: "data", listener: ((chunk: any) => void)): SessionRequest
    • removeListener(event: "end", listener: (() => void)): SessionRequest
    • removeListener(event: "error", listener: ((err: Error) => void)): SessionRequest
    • removeListener(event: "pause", listener: (() => void)): SessionRequest
    • removeListener(event: "readable", listener: (() => void)): SessionRequest
    • removeListener(event: "resume", listener: (() => void)): SessionRequest
    • removeListener(event: string | symbol, listener: ((...args: any[]) => void)): SessionRequest
    • Parameters

      • event: "close"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "data"
      • listener: ((chunk: any) => void)
          • (chunk: any): void
          • Parameters

            • chunk: any

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "end"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "error"
      • listener: ((err: Error) => void)
          • (err: Error): void
          • Parameters

            • err: Error

            Returns void

      Returns SessionRequest

    • Parameters

      • event: "pause"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "readable"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: "resume"
      • listener: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • Parameters

      • event: string | symbol
      • listener: ((...args: any[]) => void)
          • (...args: any[]): void
          • Parameters

            • Rest ...args: any[]

            Returns void

      Returns SessionRequest

    • The readable.resume() method causes an explicitly paused Readable stream to resume emitting 'data' events, switching the stream into flowing mode.

      The readable.resume() method can be used to fully consume the data from a @@ -354,7 +445,7 @@

      The readable.resume() method has no effect if there is a 'readable'event listener.

      since

      v0.9.4

      -

      Returns SessionRequest

    • +

      Returns SessionRequest

    • The readable.setEncoding() method sets the character encoding for data read from the Readable stream.

      By default, no encoding is assigned and stream data will be returned asBuffer objects. Setting an encoding causes the stream data @@ -369,17 +460,38 @@

      since

      v0.9.4

      Parameters

      • encoding: BufferEncoding

        The encoding to use.

        -

      Returns SessionRequest

    • +

    Returns SessionRequest

    • By default EventEmitters will print a warning if more than 10 listeners are added for a particular event. This is a useful default that helps finding memory leaks. The emitter.setMaxListeners() method allows the limit to be modified for this specific EventEmitter instance. The value can be set toInfinity (or 0) to indicate an unlimited number of listeners.

      Returns a reference to the EventEmitter, so that calls can be chained.

      since

      v0.3.5

      -

      Parameters

      • n: number

      Returns SessionRequest

    • +

      Parameters

      • n: number

      Returns SessionRequest

    • Calls message.socket.setTimeout(msecs, callback).

      since

      v0.5.9

      -

      Parameters

      • msecs: number
      • Optional callback: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • +

      Parameters

      • msecs: number
      • Optional callback: (() => void)
          • (): void
          • Returns void

      Returns SessionRequest

    • some(fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>), options?: ArrayOptions): Promise<boolean>
    • +

      This method is similar to Array.prototype.some and calls fn on each chunk in the stream +until the awaited return value is true (or any truthy value). Once an fn call on a chunk +awaited return value is truthy, the stream is destroyed and the promise is fulfilled with true. +If none of the fn calls on the chunks return a truthy value, the promise is fulfilled with false.

      +
      since

      v17.5.0

      +

      Parameters

      • fn: ((data: any, options?: Pick<ArrayOptions, "signal">) => boolean | Promise<boolean>)
        +

        a function to call on each chunk of the stream. Async or not.

        +
          • (data: any, options?: Pick<ArrayOptions, "signal">): boolean | Promise<boolean>
          • Parameters

            • data: any
            • Optional options: Pick<ArrayOptions, "signal">

            Returns boolean | Promise<boolean>

      • Optional options: ArrayOptions

      Returns Promise<boolean>

      a promise evaluating to true if fn returned a truthy value for at least one of the chunks.

      +
    • take(limit: number, options?: Pick<ArrayOptions, "signal">): Readable
    • +

      This method returns a new stream with the first limit chunks.

      +
      since

      v17.5.0

      +

      Parameters

      • limit: number
        +

        the number of chunks to take from the readable.

        +
      • Optional options: Pick<ArrayOptions, "signal">

      Returns Readable

      a stream with limit chunks taken.

      +
    • toArray(options?: Pick<ArrayOptions, "signal">): Promise<any[]>
    • +

      This method allows easily obtaining the contents of a stream.

      +

      As this method reads the entire stream into memory, it negates the benefits of streams. It's intended +for interoperability and convenience, not as the primary way to consume streams.

      +
      since

      v17.5.0

      +

      Parameters

      • Optional options: Pick<ArrayOptions, "signal">

      Returns Promise<any[]>

      a promise containing an array with the contents of the stream.

      +
    • The readable.unpipe() method detaches a Writable stream previously attached using the pipe method.

      If the destination is not specified, then all pipes are detached.

      @@ -390,7 +502,7 @@
      since

      v0.9.4

      Parameters

      • Optional destination: WritableStream

        Optional specific stream to unpipe

        -

      Returns SessionRequest

    • unshift(chunk: any, encoding?: BufferEncoding): void
    • +

    Returns SessionRequest

    • unshift(chunk: any, encoding?: BufferEncoding): void
    • Passing chunk as null signals the end of the stream (EOF) and behaves the same as readable.push(null), after which no more data can be written. The EOF signal is put at the end of the buffer and any buffered data will still be @@ -418,7 +530,7 @@ streams, chunk may be any JavaScript value.

    • Optional encoding: BufferEncoding

      Encoding of string chunks. Must be a valid Buffer encoding, such as 'utf8' or 'ascii'.

      -

    Returns void

    • +

    Returns void

    • Prior to Node.js 0.10, streams did not implement the entire node:streammodule API as it is currently defined. (See Compatibility for more information.)

      When using an older Node.js library that emits 'data' events and has a pause method that is advisory only, thereadable.wrap() method can be used to create a Readable @@ -432,4 +544,4 @@

      since

      v0.9.4

      Parameters

      • stream: ReadableStream

        An "old style" readable stream

        -

      Returns SessionRequest

    Legend

    • Variable
    • Function
    • Function with type parameter
    • Type alias
    • Type alias with type parameter
    • Interface
    • Property
    • Class
    • Class with type parameter

    Settings

    Theme

    Generated using TypeDoc

    \ No newline at end of file +

    Returns SessionRequest

    Generated using TypeDoc

    \ No newline at end of file diff --git a/docs/interfaces/framework_hapi.SessionRequest.html b/docs/interfaces/framework_hapi.SessionRequest.html index f6b470857..fb613ae5b 100644 --- a/docs/interfaces/framework_hapi.SessionRequest.html +++ b/docs/interfaces/framework_hapi.SessionRequest.html @@ -89,7 +89,7 @@
    server: Server

    Access: read only and the public server interface. The server object.

    -
    state: Dictionary<any>
    +
    state: Dictionary<any>

    An object containing parsed HTTP state information (cookies) where each key is the cookie name and value is the matching cookie content after processing using any registered cookie definition.

    url: URL

    The parsed request URI.

    diff --git a/docs/interfaces/framework_koa.SessionContext.html b/docs/interfaces/framework_koa.SessionContext.html index 2acad344a..d6a0aeddb 100644 --- a/docs/interfaces/framework_koa.SessionContext.html +++ b/docs/interfaces/framework_koa.SessionContext.html @@ -1,95 +1,95 @@ -SessionContext | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • Context
      • SessionContext

    Index

    Properties

    URL: URL
    +SessionContext | supertokens-node
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • Context
      • SessionContext

    Index

    Properties

    URL: URL

    Get WHATWG parsed URL object.

    -
    accept: Accepts
    app: __module
    assert: typeof assert
    +
    accept: Accepts
    app: __module
    assert: typeof assert

    Similar to .throw(), adds assertion.

    this.assert(this.user, 401, 'Please login!');

    See: https://github.com/jshttp/http-assert

    -
    body: unknown
    +
    body: unknown

    Get/Set response body.

    -
    cookies: Cookies
    etag: string
    +
    cookies: Cookies
    etag: string

    Get/Set the ETag of a response. This will normalize the quotes if necessary.

    this.response.etag = 'md5hashsum';
    this.response.etag = '"md5hashsum"';
    this.response.etag = 'W/"123456789"';
    param etag
    api

    public

    -
    fresh: boolean
    +
    fresh: boolean

    Check if the request is fresh, aka Last-Modified and/or the ETag still match.

    -
    header: IncomingHttpHeaders
    +
    header: IncomingHttpHeaders

    Return request header.

    -
    headerSent: boolean
    +
    headerSent: boolean

    Check if a header has been written to the socket.

    -
    headers: IncomingHttpHeaders
    +
    headers: IncomingHttpHeaders

    Return request header, alias as request.header

    -
    host: string
    +
    host: string

    Parse the "Host" header field host and support X-Forwarded-Host when a proxy is enabled.

    -
    hostname: string
    +
    hostname: string

    Parse the "Host" header field hostname and support X-Forwarded-Host when a proxy is enabled.

    -
    href: string
    +
    href: string

    Get full request URL.

    -
    idempotent: boolean
    +
    idempotent: boolean

    Check if the request is idempotent.

    -
    ip: string
    +
    ip: string

    Request remote address. Supports X-Forwarded-For when app.proxy is true.

    -
    ips: string[]
    +
    ips: string[]

    When app.proxy is true, parse the "X-Forwarded-For" ip address list.

    For example if the value were "client, proxy1, proxy2" you would receive the array ["client", "proxy1", "proxy2"] where "proxy2" is the furthest down-stream.

    -
    lastModified: Date
    +
    lastModified: Date

    Get the Last-Modified date in Date form, if it exists. Set the Last-Modified date using a string or a Date.

    this.response.lastModified = new Date();
    this.response.lastModified = '2013-09-13';
    -
    length: number
    +
    length: number

    Return parsed response Content-Length when present. Set Content-Length field to n.

    -
    message: string
    +
    message: string

    Get response status message

    -
    method: string
    +
    method: string

    Get/Set request method.

    -
    origin: string
    +
    origin: string

    Get origin of URL.

    -
    originalUrl: string
    path: string
    +
    originalUrl: string
    path: string

    Get request pathname. Set pathname, retaining the query-string when present.

    -
    protocol: string
    +
    protocol: string

    Return the protocol string "http" or "https" when requested with TLS. When the proxy setting is enabled the "X-Forwarded-Proto" header field will be trusted. If you're running behind a reverse proxy that supplies https for you this may be enabled.

    -
    query: ParsedUrlQuery
    +
    query: ParsedUrlQuery

    Get parsed query-string. Set query-string as an object.

    -
    querystring: string
    +
    querystring: string

    Get/Set query string.

    -
    req: IncomingMessage
    request: Request
    res: ServerResponse<IncomingMessage>
    respond?: boolean
    +
    req: IncomingMessage
    request: Request
    res: ServerResponse<IncomingMessage>
    respond?: boolean

    To bypass Koa's built-in response handling, you may explicitly set ctx.respond = false;

    -
    response: Response & { body: unknown }
    search: string
    +
    response: Response & { body: unknown }
    search: string

    Get the search string. Same as the querystring except it includes the leading ?.

    Set the search string. Same as response.querystring= but included for ubiquity.

    -
    secure: boolean
    +
    secure: boolean

    Short-hand for:

    this.protocol == 'https'

    -
    socket: Socket
    +
    socket: Socket

    Return the request socket.

    -
    stale: boolean
    +
    stale: boolean

    Check if the request is stale, aka "Last-Modified" and / or the "ETag" for the resource has changed.

    -
    state: DefaultState
    status: number
    +
    state: DefaultState
    status: number

    Get/Set response status code.

    -
    subdomains: string[]
    +
    subdomains: string[]

    Return subdomains as an array.

    Subdomains are the dot-separated parts of the host before the main domain of the app. By default, the domain of the app is assumed to be the last two @@ -98,7 +98,7 @@ If app.subdomainOffset is not set, this.subdomains is ["ferrets", "tobi"]. If app.subdomainOffset is 3, this.subdomains is ["tobi"].

    -
    type: string
    +
    type: string

    Return the response mime type void of parameters such as "charset".

    Set Content-Type response header with type through mime.lookup() @@ -106,13 +106,13 @@

    Examples:

    this.type = '.html';
    this.type = 'html';
    this.type = 'json';
    this.type = 'application/json';
    this.type = 'png';
    -
    url: string
    +
    url: string

    Get/Set request URL.

    -
    writable: boolean
    +
    writable: boolean

    Checks if the request is writable. Tests for the existence of the socket as node sometimes does not set it.

    -

    Methods

    • accepts(): string[]
    • accepts(...types: string[]): string | false
    • accepts(types: string[]): string | false
    • +

    Methods

    • accepts(): string[]
    • accepts(...types: string[]): string | false
    • accepts(types: string[]): string | false
    • Check if the given type(s) is acceptable, returning the best match when true, otherwise false, in which case you should respond with 406 "Not Acceptable".

      @@ -123,35 +123,35 @@

      Examples:

      // Accept: text/html
      this.accepts('html');
      // => "html"

      // Accept: text/*, application/json
      this.accepts('html');
      // => "html"
      this.accepts('text/html');
      // => "text/html"
      this.accepts('json', 'text');
      // => "json"
      this.accepts('application/json');
      // => "application/json"

      // Accept: text/*, application/json
      this.accepts('image/png');
      this.accepts('png');
      // => undefined

      // Accept: text/*;q=.5, application/json
      this.accepts(['html', 'json']);
      this.accepts('html', 'json');
      // => "json"
      -

      Returns string[]

    • Parameters

      • Rest ...types: string[]

      Returns string | false

    • Parameters

      • types: string[]

      Returns string | false

    • acceptsCharsets(): string[]
    • acceptsCharsets(...charsets: string[]): string | false
    • acceptsCharsets(charsets: string[]): string | false
    • +

      Returns string[]

    • Parameters

      • Rest ...types: string[]

      Returns string | false

    • Parameters

      • types: string[]

      Returns string | false

    • acceptsCharsets(): string[]
    • acceptsCharsets(...charsets: string[]): string | false
    • acceptsCharsets(charsets: string[]): string | false
    • Return accepted charsets or best fit based on charsets.

      Given Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5 an array sorted by quality is returned:

      ['utf-8', 'utf-7', 'iso-8859-1']
       
      -

      Returns string[]

    • Parameters

      • Rest ...charsets: string[]

      Returns string | false

    • Parameters

      • charsets: string[]

      Returns string | false

    • acceptsEncodings(): string[]
    • acceptsEncodings(...encodings: string[]): string | false
    • acceptsEncodings(encodings: string[]): string | false
    • +

      Returns string[]

    • Parameters

      • Rest ...charsets: string[]

      Returns string | false

    • Parameters

      • charsets: string[]

      Returns string | false

    • acceptsEncodings(): string[]
    • acceptsEncodings(...encodings: string[]): string | false
    • acceptsEncodings(encodings: string[]): string | false
    • Return accepted encodings or best fit based on encodings.

      Given Accept-Encoding: gzip, deflate an array sorted by quality is returned:

      ['gzip', 'deflate']
       
      -

      Returns string[]

    • Parameters

      • Rest ...encodings: string[]

      Returns string | false

    • Parameters

      • encodings: string[]

      Returns string | false

    • acceptsLanguages(): string[]
    • acceptsLanguages(...langs: string[]): string | false
    • acceptsLanguages(langs: string[]): string | false
    • +

      Returns string[]

    • Parameters

      • Rest ...encodings: string[]

      Returns string | false

    • Parameters

      • encodings: string[]

      Returns string | false

    • acceptsLanguages(): string[]
    • acceptsLanguages(...langs: string[]): string | false
    • acceptsLanguages(langs: string[]): string | false
    • Return accepted languages or best fit based on langs.

      Given Accept-Language: en;q=0.8, es, pt an array sorted by quality is returned:

      ['es', 'pt', 'en']
       
      -

      Returns string[]

    • Parameters

      • Rest ...langs: string[]

      Returns string | false

    • Parameters

      • langs: string[]

      Returns string | false

    • append(field: string, val: string | string[]): void
    • +

      Returns string[]

    • Parameters

      • Rest ...langs: string[]

      Returns string | false

    • Parameters

      • langs: string[]

      Returns string | false

    • append(field: string, val: string | string[]): void
    • Append additional header field with value val.

      Examples:

      this.append('Link', ['<http://localhost/>', '<http://localhost:3000/>']);
      this.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly');
      this.append('Warning', '199 Miscellaneous warning');
      -

      Parameters

      • field: string
      • val: string | string[]

      Returns void

    • attachment(filename?: string, options?: Options): void
    • +

      Parameters

      • field: string
      • val: string | string[]

      Returns void

    • attachment(filename?: string, options?: Options): void
    • Set Content-Disposition to "attachment" to signal the client to prompt for download. Optionally specify the filename of the download and some options.

      -

      Parameters

      • Optional filename: string
      • Optional options: Options

      Returns void

    • flushHeaders(): void
    • +

      Parameters

      • Optional filename: string
      • Optional options: Options

      Returns void

    • flushHeaders(): void
    • Flush any set headers, and begin the body

      -

      Returns void

    • get(field: string): string
    • +

      Returns void

    • get(field: string): string
    • Return request header. If the header is not set, will return an empty string.

      The Referrer header field is special-cased, both Referrer and @@ -159,10 +159,10 @@

      Examples:

      this.get('Content-Type');
      // => "text/plain"

      this.get('content-type');
      // => "text/plain"

      this.get('Something');
      // => ''
      -

      Parameters

      • field: string

      Returns string

    • inspect(): any
    • +

      Parameters

      • field: string

      Returns string

    • inspect(): any
    • util.inspect() implementation, which just returns the JSON output.

      -

      Returns any

    • is(...types: string[]): null | string | false
    • is(types: string[]): null | string | false
    • +

      Returns any

    • is(...types: string[]): null | string | false
    • is(types: string[]): null | string | false
    • Check if the incoming request contains the "Content-Type" header field, and it contains any of the give mime types. If there is no request body, null is returned. @@ -171,9 +171,9 @@

      Examples:

      // With Content-Type: text/html; charset=utf-8
      this.is('html'); // => 'html'
      this.is('text/html'); // => 'text/html'
      this.is('text/*', 'application/json'); // => 'text/html'

      // When Content-Type is application/json
      this.is('json', 'urlencoded'); // => 'json'
      this.is('application/json'); // => 'application/json'
      this.is('html', 'application/*'); // => 'application/json'

      this.is('html'); // => false
      -

      Parameters

      • Rest ...types: string[]

      Returns null | string | false

    • Parameters

      • types: string[]

      Returns null | string | false

    • onerror(err: Error): void
    • +

      Parameters

      • Rest ...types: string[]

      Returns null | string | false

    • Parameters

      • types: string[]

      Returns null | string | false

    • onerror(err: Error): void
    • Default error handling.

      -

      Parameters

      • err: Error

      Returns void

    • redirect(url: string, alt?: string): void
    • +

      Parameters

      • err: Error

      Returns void

    • redirect(url: string, alt?: string): void
    • Perform a 302 redirect to url.

      The string "back" is special-cased to provide Referrer support, when Referrer @@ -183,16 +183,16 @@ this.redirect('back', '/index.html'); this.redirect('/login'); this.redirect('http://google.com');

      -

      Parameters

      • url: string
      • Optional alt: string

      Returns void

    • remove(field: string): void
    • +

      Parameters

      • url: string
      • Optional alt: string

      Returns void

    • remove(field: string): void
    • Remove header field.

      -

      Parameters

      • field: string

      Returns void

    • set(field: {}): void
    • set(field: string, val: string | string[]): void
    • +

      Parameters

      • field: string

      Returns void

    • set(field: {}): void
    • set(field: string, val: string | string[]): void
    • Set header field to val, or pass an object of header fields.

      Examples:

      this.set('Foo', ['bar', 'baz']); this.set('Accept', 'application/json'); this.set({ Accept: 'text/plain', 'X-API-Key': 'tobi' });

      -

      Parameters

      • field: {}
        • [key: string]: string | string[]

      Returns void

    • Parameters

      • field: string
      • val: string | string[]

      Returns void

    • throw(message: string, code?: number, properties?: {}): never
    • throw(status: number): never
    • throw(...properties: (string | number | {})[]): never
    • +

      Parameters

      • field: {}
        • [key: string]: string | string[]

      Returns void

    • Parameters

      • field: string
      • val: string | string[]

      Returns void

    • throw(message: string, code?: number, properties?: {}): never
    • throw(status: number): never
    • throw(...properties: (string | number | {})[]): never
    • Throw an error with msg and optional status defaulting to 500. Note that these are user-level errors, and the message may be exposed to the client.

      @@ -203,12 +203,12 @@ this.throw(new Error('invalid'), 400); this.throw(400, new Error('invalid'));

      See: https://github.com/jshttp/http-errors

      -

      Parameters

      • message: string
      • Optional code: number
      • Optional properties: {}

        Returns never

      • Parameters

        • status: number

        Returns never

      • Parameters

        • Rest ...properties: (string | number | {})[]

        Returns never

      • toJSON(): any
      • +

        Parameters

        • message: string
        • Optional code: number
        • Optional properties: {}

          Returns never

        • Parameters

          • status: number

          Returns never

        • Parameters

          • Rest ...properties: (string | number | {})[]

          Returns never

        • toJSON(): any
        • Return JSON representation.

          Here we explicitly invoke .toJSON() on each object, as iteration will otherwise fail due to the getters and cause utilities such as clone() to fail.

          -

          Returns any

        • vary(field: string): void
        • +

          Returns any

        • vary(field: string | string[]): void
        • Vary on field.

          -

          Parameters

          • field: string

          Returns void

        Legend

        • Variable
        • Function
        • Function with type parameter
        • Type alias
        • Type alias with type parameter
        • Interface
        • Property
        • Class
        • Class with type parameter

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file +

        Parameters

        • field: string | string[]

        Returns void

        Legend

        • Variable
        • Function
        • Function with type parameter
        • Type alias
        • Type alias with type parameter
        • Interface
        • Property
        • Class
        • Class with type parameter

        Settings

        Theme

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/interfaces/framework_loopback.SessionContext.html b/docs/interfaces/framework_loopback.SessionContext.html index f963ac049..5f9ae514e 100644 --- a/docs/interfaces/framework_loopback.SessionContext.html +++ b/docs/interfaces/framework_loopback.SessionContext.html @@ -1,4 +1,4 @@ -SessionContext | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Hierarchy

        • MiddlewareContext
          • SessionContext

        Index

        Properties

        _debug: Debugger
        +SessionContext | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Hierarchy

        • MiddlewareContext
          • SessionContext

        Index

        Properties

        _debug: Debugger

        A debug function which can be overridden by subclasses.

        example
        import debugFactory from 'debug';
        const debug = debugFactory('loopback:context:application');
        export class Application extends Context {
        super('application');
        this._debug = debug;
        }
        @@ -14,12 +14,12 @@

        A flag to tell if the response is finished.

        scope: BindingScope

        Scope for binding resolution

        -
        subscriptionManager: ContextSubscriptionManager
        +
        subscriptionManager: ContextSubscriptionManager

        Manager for observer subscriptions

        tagIndexer: ContextTagIndexer

        Indexer for bindings by tag

        Accessors

        • get parent(): undefined | Context
        • internal

          Getter for ContextSubscriptionManager

          -

          Returns undefined | Context

        Methods

        • _findByTagIndex<ValueType>(tag: RegExp | BindingTag): Readonly<Binding<ValueType>>[]
        • +

          Returns undefined | Context

        Methods

        • [captureRejectionSymbol]<K>(error: Error, event: string | symbol, ...args: AnyRest): void
        • Type Parameters

          • K

          Parameters

          • error: Error
          • event: string | symbol
          • Rest ...args: AnyRest

          Returns void

        • _findByTagIndex<ValueType>(tag: RegExp | BindingTag): Readonly<Binding<ValueType>>[]
        • Find bindings by tag leveraging indexes

          Type Parameters

          • ValueType = any

          Parameters

          • tag: RegExp | BindingTag

            Tag name pattern or name/value pairs

            @@ -28,10 +28,10 @@ same key, an error will be thrown.

            Parameters

            • binding: Binding<unknown>

              The configured binding to be added

              -

            Returns SessionContext

        • addListener(eventName: string | symbol, listener: ((...args: any[]) => void)): SessionContext
        • +

        Returns SessionContext

        • addListener<K>(eventName: string | symbol, listener: ((...args: any[]) => void)): SessionContext
        • Alias for emitter.on(eventName, listener).

          since

          v0.1.26

          -

          Parameters

          • eventName: string | symbol
          • listener: ((...args: any[]) => void)
              • (...args: any[]): void
              • Parameters

                • Rest ...args: any[]

                Returns void

          Returns SessionContext

        • bind<ValueType>(key: BindingAddress<ValueType>): Binding<ValueType>
        • +

          Type Parameters

          • K

          Parameters

          • eventName: string | symbol
          • listener: ((...args: any[]) => void)
              • (...args: any[]): void
              • Parameters

                • Rest ...args: any[]

                Returns void

          Returns SessionContext

        • bind<ValueType>(key: BindingAddress<ValueType>): Binding<ValueType>
        • Create a binding with the given key in the context. If a locked binding already exists with the same key, an error will be thrown.

          Type Parameters

          • ValueType = any

          Parameters

          • key: BindingAddress<ValueType>
            @@ -67,14 +67,14 @@ as the prefix

            Parameters

            • Rest ...args: unknown[]

              Arguments for the debug

              -

            Returns void

        • emit(eventName: string | symbol, ...args: any[]): boolean
        • +

        Returns void

        • emit<K>(eventName: string | symbol, ...args: AnyRest): boolean
        • Synchronously calls each of the listeners registered for the event namedeventName, in the order they were registered, passing the supplied arguments to each.

          Returns true if the event had listeners, false otherwise.

          import { EventEmitter } from 'node:events';
          const myEmitter = new EventEmitter();

          // First listener
          myEmitter.on('event', function firstListener() {
          console.log('Helloooo! first listener');
          });
          // Second listener
          myEmitter.on('event', function secondListener(arg1, arg2) {
          console.log(`event with parameters ${arg1}, ${arg2} in second listener`);
          });
          // Third listener
          myEmitter.on('event', function thirdListener(...args) {
          const parameters = args.join(', ');
          console.log(`event with parameters ${parameters} in third listener`);
          });

          console.log(myEmitter.listeners('event'));

          myEmitter.emit('event', 1, 2, 3, 4, 5);

          // Prints:
          // [
          // [Function: firstListener],
          // [Function: secondListener],
          // [Function: thirdListener]
          // ]
          // Helloooo! first listener
          // event with parameters 1, 2 in second listener
          // event with parameters 1, 2, 3, 4, 5 in third listener
          since

          v0.1.26

          -

          Parameters

          • eventName: string | symbol
          • Rest ...args: any[]

          Returns boolean

        • emitError(err: unknown): void
        • +

          Type Parameters

          • K

          Parameters

          • eventName: string | symbol
          • Rest ...args: AnyRest

          Returns boolean

        • emitError(err: unknown): void
        • Emit an error event

          Parameters

          • err: unknown

            Error

            @@ -84,7 +84,7 @@

            Event type

          • event: T

            Context event

            -

          Returns void

        • eventNames(): (string | symbol)[]
        • +

        Returns void

        • eventNames(): (string | symbol)[]
        • Returns an array listing the events for which the emitter has registered listeners. The values in the array are strings or Symbols.

          import { EventEmitter } from 'node:events';

          const myEE = new EventEmitter();
          myEE.on('foo', () => {});
          myEE.on('bar', () => {});

          const sym = Symbol('symbol');
          myEE.on(sym, () => {});

          console.log(myEE.eventNames());
          // Prints: [ 'foo', 'bar', Symbol(symbol) ] @@ -207,7 +207,7 @@ this method to supply its own namespace.

          example
          export class Application extends Context {
          super('application');
          }

          protected getDebugNamespace() {
          return 'loopback:context:application';
          }
          -

          Returns string

        • getMaxListeners(): number
        • +

          Returns string

        • getMaxListeners(): number
        • Returns the current max listener value for the EventEmitter which is either set by emitter.setMaxListeners(n) or defaults to {@link defaultMaxListeners}.

          since

          v1.0.0

          @@ -283,24 +283,24 @@

          Check if this context is visible (same or ancestor) to the given one

        Parameters

        • ctx: Context

          Another context object

          -

        Returns boolean

        • listenerCount(eventName: string | symbol, listener?: Function): number
        • +

        Returns boolean

        • listenerCount<K>(eventName: string | symbol, listener?: Function): number
        • Returns the number of listeners listening for the event named eventName. If listener is provided, it will return how many times the listener is found in the list of the listeners of the event.

          since

          v3.2.0

          -

          Parameters

          • eventName: string | symbol
            +

            Type Parameters

            • K

            Parameters

            • eventName: string | symbol

              The name of the event being listened for

            • Optional listener: Function

              The event handler function

              -

            Returns number

        • listeners(eventName: string | symbol): Function[]
        • +

        Returns number

        • listeners<K>(eventName: string | symbol): Function[]
        • Returns a copy of the array of listeners for the event named eventName.

          server.on('connection', (stream) => {
          console.log('someone connected!');
          });
          console.log(util.inspect(server.listeners('connection')));
          // Prints: [ [Function] ]
          since

          v0.1.26

          -

          Parameters

          • eventName: string | symbol

          Returns Function[]

        • off(eventName: string | symbol, listener: ((...args: any[]) => void)): SessionContext
        • +

          Type Parameters

          • K

          Parameters

          • eventName: string | symbol

          Returns Function[]

        • off<K>(eventName: string | symbol, listener: ((...args: any[]) => void)): SessionContext
        • Alias for emitter.removeListener().

          since

          v10.0.0

          -

          Parameters

          • eventName: string | symbol
          • listener: ((...args: any[]) => void)
              • (...args: any[]): void
              • Parameters

                • Rest ...args: any[]

                Returns void

          Returns SessionContext

        • on(eventName: "bind" | "unbind", listener: ContextEventListener): SessionContext
        • on(event: string | symbol, listener: ((...args: any[]) => void)): SessionContext
        • +

          Type Parameters

          • K

          Parameters

          • eventName: string | symbol
          • listener: ((...args: any[]) => void)
              • (...args: any[]): void
              • Parameters

                • Rest ...args: any[]

                Returns void

          Returns SessionContext

        • on(eventName: "bind" | "unbind", listener: ContextEventListener): SessionContext
        • on(event: string | symbol, listener: ((...args: any[]) => void)): SessionContext
        • The "bind" event is emitted when a new binding is added to the context. The "unbind" event is emitted when an existing binding is removed.

          Parameters

          • eventName: "bind" | "unbind"
            @@ -314,7 +314,7 @@

            The name of the event - always bind or unbind.

          • listener: ContextEventListener

            The listener function to call when the event is emitted.

            -

          Returns SessionContext

        • Parameters

          • event: string | symbol
          • listener: ((...args: any[]) => void)
              • (...args: any[]): void
              • Parameters

                • Rest ...args: any[]

                Returns void

          Returns SessionContext

        • prependListener(eventName: string | symbol, listener: ((...args: any[]) => void)): SessionContext
        • +

        Returns SessionContext

      • Parameters

        • event: string | symbol
        • listener: ((...args: any[]) => void)
            • (...args: any[]): void
            • Parameters

              • Rest ...args: any[]

              Returns void

        Returns SessionContext

        • prependListener<K>(eventName: string | symbol, listener: ((...args: any[]) => void)): SessionContext

        Returns SessionContext

        Returns SessionContext

        Generated using TypeDoc

        \ No newline at end of file +

        Returns boolean

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/interfaces/recipe_session.SessionContainer.html b/docs/interfaces/recipe_session.SessionContainer.html index 302272065..19d666c71 100644 --- a/docs/interfaces/recipe_session.SessionContainer.html +++ b/docs/interfaces/recipe_session.SessionContainer.html @@ -1 +1 @@ -SessionContainer | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Hierarchy

        • SessionContainer

        Index

        Methods

        • attachToRequestResponse(reqResInfo: ReqResInfo, userContext?: any): void | Promise<void>
        • fetchAndSetClaim<T>(claim: SessionClaim<T>, userContext?: any): Promise<void>
        • getAccessToken(userContext?: any): string
        • getAccessTokenPayload(userContext?: any): any
        • getAllSessionTokensDangerously(): { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }
        • Returns { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }

          • accessAndFrontTokenUpdated: boolean
          • accessToken: string
          • antiCsrfToken: undefined | string
          • frontToken: string
          • refreshToken: undefined | string
        • getClaimValue<T>(claim: SessionClaim<T>, userContext?: any): Promise<undefined | T>
        • getExpiry(userContext?: any): Promise<number>
        • getHandle(userContext?: any): string
        • getSessionDataFromDatabase(userContext?: any): Promise<any>
        • getTenantId(userContext?: any): string
        • getTimeCreated(userContext?: any): Promise<number>
        • getUserId(userContext?: any): string
        • mergeIntoAccessTokenPayload(accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<void>
        • removeClaim(claim: SessionClaim<any>, userContext?: any): Promise<void>
        • revokeSession(userContext?: any): Promise<void>
        • setClaimValue<T>(claim: SessionClaim<T>, value: T, userContext?: any): Promise<void>
        • updateSessionDataInDatabase(newSessionData: any, userContext?: any): Promise<any>

        Generated using TypeDoc

        \ No newline at end of file +SessionContainer | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Hierarchy

        • SessionContainer

        Index

        Methods

        • attachToRequestResponse(reqResInfo: ReqResInfo, userContext?: any): void | Promise<void>
        • fetchAndSetClaim<T>(claim: SessionClaim<T>, userContext?: any): Promise<void>
        • getAccessToken(userContext?: any): string
        • getAccessTokenPayload(userContext?: any): any
        • getAllSessionTokensDangerously(): { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }
        • Returns { accessAndFrontTokenUpdated: boolean; accessToken: string; antiCsrfToken: undefined | string; frontToken: string; refreshToken: undefined | string }

          • accessAndFrontTokenUpdated: boolean
          • accessToken: string
          • antiCsrfToken: undefined | string
          • frontToken: string
          • refreshToken: undefined | string
        • getClaimValue<T>(claim: SessionClaim<T>, userContext?: any): Promise<undefined | T>
        • getExpiry(userContext?: any): Promise<number>
        • getHandle(userContext?: any): string
        • getSessionDataFromDatabase(userContext?: any): Promise<any>
        • getTenantId(userContext?: any): string
        • getTimeCreated(userContext?: any): Promise<number>
        • getUserId(userContext?: any): string
        • mergeIntoAccessTokenPayload(accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<void>
        • removeClaim(claim: SessionClaim<any>, userContext?: any): Promise<void>
        • revokeSession(userContext?: any): Promise<void>
        • setClaimValue<T>(claim: SessionClaim<T>, value: T, userContext?: any): Promise<void>
        • updateSessionDataInDatabase(newSessionData: any, userContext?: any): Promise<any>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/interfaces/recipe_session.VerifySessionOptions.html b/docs/interfaces/recipe_session.VerifySessionOptions.html index 8ca199359..f913af3fd 100644 --- a/docs/interfaces/recipe_session.VerifySessionOptions.html +++ b/docs/interfaces/recipe_session.VerifySessionOptions.html @@ -1 +1 @@ -VerifySessionOptions | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Generated using TypeDoc

        \ No newline at end of file +VerifySessionOptions | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/framework.html b/docs/modules/framework.html index ac6ac8fa3..e1b358d49 100644 --- a/docs/modules/framework.html +++ b/docs/modules/framework.html @@ -1 +1 @@ -framework | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework

        Index

        Variables

        awsLambda: framework/awsLambda = awsLambdaFramework
        default: { awsLambda: framework/awsLambda; express: framework/express; fastify: framework/fastify; hapi: framework/hapi; koa: framework/koa; loopback: framework/loopback }

        Type declaration

        express: framework/express = expressFramework
        fastify: framework/fastify = fastifyFramework
        hapi: framework/hapi = hapiFramework
        koa: framework/koa = koaFramework
        loopback: framework/loopback = loopbackFramework

        Generated using TypeDoc

        \ No newline at end of file +framework | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework

        Index

        Variables

        awsLambda: framework/awsLambda = awsLambdaFramework
        default: { awsLambda: framework/awsLambda; express: framework/express; fastify: framework/fastify; hapi: framework/hapi; koa: framework/koa; loopback: framework/loopback }

        Type declaration

        express: framework/express = expressFramework
        fastify: framework/fastify = fastifyFramework
        hapi: framework/hapi = hapiFramework
        koa: framework/koa = koaFramework
        loopback: framework/loopback = loopbackFramework

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/framework_awsLambda.html b/docs/modules/framework_awsLambda.html index 487c6f9d7..53df0e377 100644 --- a/docs/modules/framework_awsLambda.html +++ b/docs/modules/framework_awsLambda.html @@ -1 +1 @@ -framework/awsLambda | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/awsLambda

        Generated using TypeDoc

        \ No newline at end of file +framework/awsLambda | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/awsLambda

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/framework_custom.html b/docs/modules/framework_custom.html index a86dd010c..ac13642ed 100644 --- a/docs/modules/framework_custom.html +++ b/docs/modules/framework_custom.html @@ -1 +1 @@ -framework/custom | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/custom

        Index

        Functions

        • middleware<OrigReqType, OrigRespType>(wrapRequest?: ((req: OrigReqType) => BaseRequest), wrapResponse?: ((req: OrigRespType) => BaseResponse)): ((request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>)
        • Type Parameters

          Parameters

          Returns ((request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>)

            • (request: OrigReqType, response: OrigRespType, next?: NextFunction): Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>
            • Parameters

              • request: OrigReqType
              • response: OrigRespType
              • Optional next: NextFunction

              Returns Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>

        Generated using TypeDoc

        \ No newline at end of file +framework/custom | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/custom

        Index

        Functions

        • middleware<OrigReqType, OrigRespType>(wrapRequest?: ((req: OrigReqType) => BaseRequest), wrapResponse?: ((req: OrigRespType) => BaseResponse)): ((request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>)
        • Type Parameters

          Parameters

          Returns ((request: OrigReqType, response: OrigRespType, next?: NextFunction) => Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>)

            • (request: OrigReqType, response: OrigRespType, next?: NextFunction): Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>
            • Parameters

              • request: OrigReqType
              • response: OrigRespType
              • Optional next: NextFunction

              Returns Promise<{ error: undefined; handled: boolean } | { error: any; handled: undefined }>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/framework_express.html b/docs/modules/framework_express.html index ae57a016e..6ad95f618 100644 --- a/docs/modules/framework_express.html +++ b/docs/modules/framework_express.html @@ -1 +1 @@ -framework/express | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/express

        Index

        Functions

        • errorHandler(): ((err: any, req: Request, res: Response, next: NextFunction) => Promise<void>)
        • Returns ((err: any, req: Request, res: Response, next: NextFunction) => Promise<void>)

            • (err: any, req: Request, res: Response, next: NextFunction): Promise<void>
            • Parameters

              • err: any
              • req: Request
              • res: Response
              • next: NextFunction

              Returns Promise<void>

        • middleware(): ((req: Request, res: Response, next: NextFunction) => Promise<void>)
        • Returns ((req: Request, res: Response, next: NextFunction) => Promise<void>)

            • (req: Request, res: Response, next: NextFunction): Promise<void>
            • Parameters

              • req: Request
              • res: Response
              • next: NextFunction

              Returns Promise<void>

        Generated using TypeDoc

        \ No newline at end of file +framework/express | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/express

        Index

        Functions

        • errorHandler(): ((err: any, req: Request, res: Response, next: NextFunction) => Promise<void>)
        • Returns ((err: any, req: Request, res: Response, next: NextFunction) => Promise<void>)

            • (err: any, req: Request, res: Response, next: NextFunction): Promise<void>
            • Parameters

              • err: any
              • req: Request
              • res: Response
              • next: NextFunction

              Returns Promise<void>

        • middleware(): ((req: Request, res: Response, next: NextFunction) => Promise<void>)
        • Returns ((req: Request, res: Response, next: NextFunction) => Promise<void>)

            • (req: Request, res: Response, next: NextFunction): Promise<void>
            • Parameters

              • req: Request
              • res: Response
              • next: NextFunction

              Returns Promise<void>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/framework_fastify.html b/docs/modules/framework_fastify.html index e40cae803..919479c9a 100644 --- a/docs/modules/framework_fastify.html +++ b/docs/modules/framework_fastify.html @@ -1 +1 @@ -framework/fastify | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/fastify

        Index

        Type Aliases

        SessionRequest<TRequest>: TRequest & { session?: SessionContainer }

        Type Parameters

        • TRequest extends OriginalFastifyRequest = OriginalFastifyRequest

        Functions

        • errorHandler(): ((err: any, req: FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage>, res: FastifyReply<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown>) => Promise<void>)
        • Returns ((err: any, req: FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage>, res: FastifyReply<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown>) => Promise<void>)

            • (err: any, req: FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage>, res: FastifyReply<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown>): Promise<void>
            • Parameters

              • err: any
              • req: FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage>
              • res: FastifyReply<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown>

              Returns Promise<void>

        • plugin(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyLoggerInstance>, opts: Record<never, never>, done: ((err?: Error) => void)): void
        • Parameters

          • instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyLoggerInstance>
          • opts: Record<never, never>
          • done: ((err?: Error) => void)
              • (err?: Error): void
              • Parameters

                • Optional err: Error

                Returns void

          Returns void

        Generated using TypeDoc

        \ No newline at end of file +framework/fastify | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/fastify

        Index

        Type Aliases

        SessionRequest<TRequest>: TRequest & { session?: SessionContainer }

        Type Parameters

        • TRequest extends OriginalFastifyRequest = OriginalFastifyRequest

        Functions

        • errorHandler(): ((err: any, req: FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage>, res: FastifyReply<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown>) => Promise<void>)
        • Returns ((err: any, req: FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage>, res: FastifyReply<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown>) => Promise<void>)

            • (err: any, req: FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage>, res: FastifyReply<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown>): Promise<void>
            • Parameters

              • err: any
              • req: FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage>
              • res: FastifyReply<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, RouteGenericInterface, unknown>

              Returns Promise<void>

        • plugin(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyLoggerInstance>, opts: Record<never, never>, done: ((err?: Error) => void)): void
        • Parameters

          • instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyLoggerInstance>
          • opts: Record<never, never>
          • done: ((err?: Error) => void)
              • (err?: Error): void
              • Parameters

                • Optional err: Error

                Returns void

          Returns void

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/framework_hapi.html b/docs/modules/framework_hapi.html index 42557eef2..1ce36a71a 100644 --- a/docs/modules/framework_hapi.html +++ b/docs/modules/framework_hapi.html @@ -1 +1 @@ -framework/hapi | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/hapi

        Generated using TypeDoc

        \ No newline at end of file +framework/hapi | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/hapi

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/framework_koa.html b/docs/modules/framework_koa.html index 4e0b82b9e..b17868a68 100644 --- a/docs/modules/framework_koa.html +++ b/docs/modules/framework_koa.html @@ -1 +1 @@ -framework/koa | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/koa

        Generated using TypeDoc

        \ No newline at end of file +framework/koa | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/koa

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/framework_loopback.html b/docs/modules/framework_loopback.html index 1463232e3..3727569c9 100644 --- a/docs/modules/framework_loopback.html +++ b/docs/modules/framework_loopback.html @@ -1 +1 @@ -framework/loopback | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/loopback

        Generated using TypeDoc

        \ No newline at end of file +framework/loopback | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module framework/loopback

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/index.html b/docs/modules/index.html index 0e13518b2..59a61b6c0 100644 --- a/docs/modules/index.html +++ b/docs/modules/index.html @@ -1 +1 @@ -index | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Index

        Variables

        Error: typeof default = SuperTokensWrapper.Error

        Functions

        • createUserIdMapping(input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: any }): Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
        • Parameters

          • input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: any }
            • externalUserId: string
            • Optional externalUserIdInfo?: string
            • Optional force?: boolean
            • superTokensUserId: string
            • Optional userContext?: any

          Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>

        • deleteUser(userId: string, removeAllLinkedAccounts?: boolean, userContext?: any): Promise<{ status: "OK" }>
        • Parameters

          • userId: string
          • removeAllLinkedAccounts: boolean = true
          • Optional userContext: any

          Returns Promise<{ status: "OK" }>

        • deleteUserIdMapping(input: { force?: boolean; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ didMappingExist: boolean; status: "OK" }>
        • Parameters

          • input: { force?: boolean; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
            • Optional force?: boolean
            • Optional userContext?: any
            • userId: string
            • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

          Returns Promise<{ didMappingExist: boolean; status: "OK" }>

        • getAllCORSHeaders(): string[]
        • getRequestFromUserContext(userContext: any): undefined | BaseRequest
        • getUser(userId: string, userContext?: any): Promise<undefined | User>
        • Parameters

          • userId: string
          • Optional userContext: any

          Returns Promise<undefined | User>

        • getUserCount(includeRecipeIds?: string[], tenantId?: string, userContext?: any): Promise<number>
        • Parameters

          • Optional includeRecipeIds: string[]
          • Optional tenantId: string
          • Optional userContext: any

          Returns Promise<number>

        • getUserIdMapping(input: { userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
        • Parameters

          • input: { userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
            • Optional userContext?: any
            • userId: string
            • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

          Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>

        • getUsersNewestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
        • Parameters

          • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }
            • Optional includeRecipeIds?: string[]
            • Optional limit?: number
            • Optional paginationToken?: string
            • Optional query?: {}
              • [key: string]: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<{ nextPaginationToken?: string; users: User[] }>

        • getUsersOldestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
        • Parameters

          • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }
            • Optional includeRecipeIds?: string[]
            • Optional limit?: number
            • Optional paginationToken?: string
            • Optional query?: {}
              • [key: string]: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<{ nextPaginationToken?: string; users: User[] }>

        • init(config: TypeInput): void
        • listUsersByAccountInfo(tenantId: string, accountInfo: AccountInfo, doUnionOfAccountInfo?: boolean, userContext?: any): Promise<User[]>
        • Parameters

          • tenantId: string
          • accountInfo: AccountInfo
          • doUnionOfAccountInfo: boolean = false
          • Optional userContext: any

          Returns Promise<User[]>

        • updateOrDeleteUserIdMappingInfo(input: { externalUserIdInfo?: string; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
        • Parameters

          • input: { externalUserIdInfo?: string; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
            • Optional externalUserIdInfo?: string
            • Optional userContext?: any
            • userId: string
            • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

          Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file +index | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Index

        Variables

        Error: typeof default = SuperTokensWrapper.Error

        Functions

        • createUserIdMapping(input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: any }): Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>
        • Parameters

          • input: { externalUserId: string; externalUserIdInfo?: string; force?: boolean; superTokensUserId: string; userContext?: any }
            • externalUserId: string
            • Optional externalUserIdInfo?: string
            • Optional force?: boolean
            • superTokensUserId: string
            • Optional userContext?: any

          Returns Promise<{ status: "OK" | "UNKNOWN_SUPERTOKENS_USER_ID_ERROR" } | { doesExternalUserIdExist: boolean; doesSuperTokensUserIdExist: boolean; status: "USER_ID_MAPPING_ALREADY_EXISTS_ERROR" }>

        • deleteUser(userId: string, removeAllLinkedAccounts?: boolean, userContext?: any): Promise<{ status: "OK" }>
        • Parameters

          • userId: string
          • removeAllLinkedAccounts: boolean = true
          • Optional userContext: any

          Returns Promise<{ status: "OK" }>

        • deleteUserIdMapping(input: { force?: boolean; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ didMappingExist: boolean; status: "OK" }>
        • Parameters

          • input: { force?: boolean; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
            • Optional force?: boolean
            • Optional userContext?: any
            • userId: string
            • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

          Returns Promise<{ didMappingExist: boolean; status: "OK" }>

        • getAllCORSHeaders(): string[]
        • getRequestFromUserContext(userContext: any): undefined | BaseRequest
        • getUser(userId: string, userContext?: any): Promise<undefined | User>
        • Parameters

          • userId: string
          • Optional userContext: any

          Returns Promise<undefined | User>

        • getUserCount(includeRecipeIds?: string[], tenantId?: string, userContext?: any): Promise<number>
        • Parameters

          • Optional includeRecipeIds: string[]
          • Optional tenantId: string
          • Optional userContext: any

          Returns Promise<number>

        • getUserIdMapping(input: { userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>
        • Parameters

          • input: { userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
            • Optional userContext?: any
            • userId: string
            • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

          Returns Promise<{ externalUserId: string; externalUserIdInfo: undefined | string; status: "OK"; superTokensUserId: string } | { status: "UNKNOWN_MAPPING_ERROR" }>

        • getUsersNewestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
        • Parameters

          • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }
            • Optional includeRecipeIds?: string[]
            • Optional limit?: number
            • Optional paginationToken?: string
            • Optional query?: {}
              • [key: string]: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<{ nextPaginationToken?: string; users: User[] }>

        • getUsersOldestFirst(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
        • Parameters

          • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; userContext?: any }
            • Optional includeRecipeIds?: string[]
            • Optional limit?: number
            • Optional paginationToken?: string
            • Optional query?: {}
              • [key: string]: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<{ nextPaginationToken?: string; users: User[] }>

        • init(config: TypeInput): void
        • listUsersByAccountInfo(tenantId: string, accountInfo: AccountInfo, doUnionOfAccountInfo?: boolean, userContext?: any): Promise<User[]>
        • Parameters

          • tenantId: string
          • accountInfo: AccountInfo
          • doUnionOfAccountInfo: boolean = false
          • Optional userContext: any

          Returns Promise<User[]>

        • updateOrDeleteUserIdMappingInfo(input: { externalUserIdInfo?: string; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }): Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>
        • Parameters

          • input: { externalUserIdInfo?: string; userContext?: any; userId: string; userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY" }
            • Optional externalUserIdInfo?: string
            • Optional userContext?: any
            • userId: string
            • Optional userIdType?: "SUPERTOKENS" | "EXTERNAL" | "ANY"

          Returns Promise<{ status: "OK" | "UNKNOWN_MAPPING_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_accountlinking.html b/docs/modules/recipe_accountlinking.html index c80178fa9..af3912c77 100644 --- a/docs/modules/recipe_accountlinking.html +++ b/docs/modules/recipe_accountlinking.html @@ -1 +1 @@ -recipe/accountlinking | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/accountlinking

        Index

        Type Aliases

        RecipeInterface: { canCreatePrimaryUser: any; canLinkAccounts: any; createPrimaryUser: any; deleteUser: any; getUser: any; getUsers: any; linkAccounts: any; listUsersByAccountInfo: any; unlinkAccount: any }

        Type declaration

        • canCreatePrimaryUser:function
          • canCreatePrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
          • Parameters

            Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

        • canLinkAccounts:function
          • canLinkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
          • Parameters

            • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
              • primaryUserId: string
              • recipeUserId: RecipeUserId
              • userContext: any

            Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

        • createPrimaryUser:function
          • createPrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
          • Parameters

            Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

        • deleteUser:function
          • deleteUser(input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }): Promise<{ status: "OK" }>
          • Parameters

            • input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }
              • removeAllLinkedAccounts: boolean
              • userContext: any
              • userId: string

            Returns Promise<{ status: "OK" }>

        • getUser:function
          • getUser(input: { userContext: any; userId: string }): Promise<undefined | User>
        • getUsers:function
          • getUsers(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
          • Parameters

            • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }
              • Optional includeRecipeIds?: string[]
              • Optional limit?: number
              • Optional paginationToken?: string
              • Optional query?: {}
                • [key: string]: string
              • tenantId: string
              • timeJoinedOrder: "ASC" | "DESC"
              • userContext: any

            Returns Promise<{ nextPaginationToken?: string; users: User[] }>

        • linkAccounts:function
          • linkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
          • Parameters

            • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
              • primaryUserId: string
              • recipeUserId: RecipeUserId
              • userContext: any

            Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

        • listUsersByAccountInfo:function
          • listUsersByAccountInfo(input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }): Promise<User[]>
          • Parameters

            • input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }
              • accountInfo: AccountInfo
              • doUnionOfAccountInfo: boolean
              • tenantId: string
              • userContext: any

            Returns Promise<User[]>

        • unlinkAccount:function
          • unlinkAccount(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

        Functions

        • canCreatePrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
        • Parameters

          Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

        • canLinkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
        • Parameters

          • recipeUserId: RecipeUserId
          • primaryUserId: string
          • userContext: any = {}

          Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

        • createPrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
        • Parameters

          Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

        • createPrimaryUserIdOrLinkAccounts(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<User>
        • getPrimaryUserThatCanBeLinkedToRecipeUserId(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<undefined | User>
        • init(config?: TypeInput): RecipeListFunction
        • isEmailChangeAllowed(recipeUserId: RecipeUserId, newEmail: string, isVerified: boolean, userContext?: any): Promise<boolean>
        • isSignInAllowed(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<boolean>
        • isSignUpAllowed(tenantId: string, newUser: AccountInfoWithRecipeId, isVerified: boolean, userContext?: any): Promise<boolean>
        • linkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
        • Parameters

          • recipeUserId: RecipeUserId
          • primaryUserId: string
          • userContext: any = {}

          Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

        • unlinkAccount(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

        Generated using TypeDoc

        \ No newline at end of file +recipe/accountlinking | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/accountlinking

        Index

        Type Aliases

        RecipeInterface: { canCreatePrimaryUser: any; canLinkAccounts: any; createPrimaryUser: any; deleteUser: any; getUser: any; getUsers: any; linkAccounts: any; listUsersByAccountInfo: any; unlinkAccount: any }

        Type declaration

        • canCreatePrimaryUser:function
          • canCreatePrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
          • Parameters

            Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

        • canLinkAccounts:function
          • canLinkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
          • Parameters

            • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
              • primaryUserId: string
              • recipeUserId: RecipeUserId
              • userContext: any

            Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

        • createPrimaryUser:function
          • createPrimaryUser(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
          • Parameters

            Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

        • deleteUser:function
          • deleteUser(input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }): Promise<{ status: "OK" }>
          • Parameters

            • input: { removeAllLinkedAccounts: boolean; userContext: any; userId: string }
              • removeAllLinkedAccounts: boolean
              • userContext: any
              • userId: string

            Returns Promise<{ status: "OK" }>

        • getUser:function
          • getUser(input: { userContext: any; userId: string }): Promise<undefined | User>
        • getUsers:function
          • getUsers(input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }): Promise<{ nextPaginationToken?: string; users: User[] }>
          • Parameters

            • input: { includeRecipeIds?: string[]; limit?: number; paginationToken?: string; query?: {}; tenantId: string; timeJoinedOrder: "ASC" | "DESC"; userContext: any }
              • Optional includeRecipeIds?: string[]
              • Optional limit?: number
              • Optional paginationToken?: string
              • Optional query?: {}
                • [key: string]: string
              • tenantId: string
              • timeJoinedOrder: "ASC" | "DESC"
              • userContext: any

            Returns Promise<{ nextPaginationToken?: string; users: User[] }>

        • linkAccounts:function
          • linkAccounts(input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
          • Parameters

            • input: { primaryUserId: string; recipeUserId: RecipeUserId; userContext: any }
              • primaryUserId: string
              • recipeUserId: RecipeUserId
              • userContext: any

            Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

        • listUsersByAccountInfo:function
          • listUsersByAccountInfo(input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }): Promise<User[]>
          • Parameters

            • input: { accountInfo: AccountInfo; doUnionOfAccountInfo: boolean; tenantId: string; userContext: any }
              • accountInfo: AccountInfo
              • doUnionOfAccountInfo: boolean
              • tenantId: string
              • userContext: any

            Returns Promise<User[]>

        • unlinkAccount:function
          • unlinkAccount(input: { recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

        Functions

        • canCreatePrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
        • Parameters

          Returns Promise<{ status: "OK"; wasAlreadyAPrimaryUser: boolean } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

        • canLinkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
        • Parameters

          • recipeUserId: RecipeUserId
          • primaryUserId: string
          • userContext: any = {}

          Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK" } | { description: string; primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

        • createPrimaryUser(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>
        • Parameters

          Returns Promise<{ status: "OK"; user: User; wasAlreadyAPrimaryUser: boolean } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_PRIMARY_USER_ID_ERROR" } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" }>

        • createPrimaryUserIdOrLinkAccounts(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<User>
        • getPrimaryUserThatCanBeLinkedToRecipeUserId(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<undefined | User>
        • init(config?: TypeInput): RecipeListFunction
        • isEmailChangeAllowed(recipeUserId: RecipeUserId, newEmail: string, isVerified: boolean, userContext?: any): Promise<boolean>
        • isSignInAllowed(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<boolean>
        • isSignUpAllowed(tenantId: string, newUser: AccountInfoWithRecipeId, isVerified: boolean, userContext?: any): Promise<boolean>
        • linkAccounts(recipeUserId: RecipeUserId, primaryUserId: string, userContext?: any): Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>
        • Parameters

          • recipeUserId: RecipeUserId
          • primaryUserId: string
          • userContext: any = {}

          Returns Promise<{ accountsAlreadyLinked: boolean; status: "OK"; user: User } | { primaryUserId: string; status: "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"; user: User } | { description: string; primaryUserId: string; status: "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR" } | { status: "INPUT_USER_IS_NOT_A_PRIMARY_USER" }>

        • unlinkAccount(recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasLinked: boolean; wasRecipeUserDeleted: boolean }>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_dashboard.html b/docs/modules/recipe_dashboard.html index 84f2696eb..00ab89775 100644 --- a/docs/modules/recipe_dashboard.html +++ b/docs/modules/recipe_dashboard.html @@ -1 +1 @@ -recipe/dashboard | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/dashboard

        Index

        Type Aliases

        APIInterface: { dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>) }

        Type declaration

        • dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>)
        APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

        Type declaration

        RecipeInterface: { getDashboardBundleLocation: any; shouldAllowAccess: any }

        Type declaration

        • getDashboardBundleLocation:function
          • getDashboardBundleLocation(input: { userContext: any }): Promise<string>
        • shouldAllowAccess:function
          • shouldAllowAccess(input: { config: TypeNormalisedInput; req: BaseRequest; userContext: any }): Promise<boolean>

        Functions

        • init(config?: TypeInput): RecipeListFunction

        Generated using TypeDoc

        \ No newline at end of file +recipe/dashboard | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/dashboard

        Index

        Type Aliases

        APIInterface: { dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>) }

        Type declaration

        • dashboardGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<string>)
        APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

        Type declaration

        RecipeInterface: { getDashboardBundleLocation: any; shouldAllowAccess: any }

        Type declaration

        • getDashboardBundleLocation:function
          • getDashboardBundleLocation(input: { userContext: any }): Promise<string>
        • shouldAllowAccess:function
          • shouldAllowAccess(input: { config: TypeNormalisedInput; req: BaseRequest; userContext: any }): Promise<boolean>

        Functions

        • init(config?: TypeInput): RecipeListFunction

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_emailpassword.html b/docs/modules/recipe_emailpassword.html index c08bcb2ea..6aabf36e9 100644 --- a/docs/modules/recipe_emailpassword.html +++ b/docs/modules/recipe_emailpassword.html @@ -1,5 +1,5 @@ -recipe/emailpassword | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/emailpassword

        Index

        Type Aliases

        APIInterface: { emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>) }

        Type declaration

        • emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
        • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
        • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
        • signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
        • signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
        APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailPasswordEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

        Type declaration

        RecipeInterface: { consumePasswordResetToken: any; createNewRecipeUser: any; createResetPasswordToken: any; signIn: any; signUp: any; updateEmailOrPassword: any }

        Type declaration

        • consumePasswordResetToken:function
          • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
          • Parameters

            • input: { tenantId: string; token: string; userContext: any }
              • tenantId: string
              • token: string
              • userContext: any

            Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

        • createNewRecipeUser:function
          • createNewRecipeUser(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

        • createResetPasswordToken:function
          • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
          • +recipe/emailpassword | supertokens-node
            Options
            All
            • Public
            • Public/Protected
            • All
            Menu

            Module recipe/emailpassword

            Index

            Type Aliases

            APIInterface: { emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>) }

            Type declaration

            • emailExistsGET: undefined | ((input: { email: string; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
            • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
            • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: User } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
            • signInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
            • signUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: APIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: User } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
            APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailPasswordEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

            Type declaration

            RecipeInterface: { consumePasswordResetToken: any; createNewRecipeUser: any; createResetPasswordToken: any; signIn: any; signUp: any; updateEmailOrPassword: any }

            Type declaration

            • consumePasswordResetToken:function
              • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
              • Parameters

                • input: { tenantId: string; token: string; userContext: any }
                  • tenantId: string
                  • token: string
                  • userContext: any

                Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

            • createNewRecipeUser:function
              • createNewRecipeUser(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
              • Parameters

                • input: { email: string; password: string; tenantId: string; userContext: any }
                  • email: string
                  • password: string
                  • tenantId: string
                  • userContext: any

                Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

            • createResetPasswordToken:function
              • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
              • We pass in the email as well to this function cause the input userId may not be associated with an emailpassword account. In this case, we need to know which email to use to create an emailpassword account later on.

                -

                Parameters

                • input: { email: string; tenantId: string; userContext: any; userId: string }
                  • email: string
                  • tenantId: string
                  • userContext: any
                  • userId: string

                Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

            • signIn:function
              • signIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
              • Parameters

                • input: { email: string; password: string; tenantId: string; userContext: any }
                  • email: string
                  • password: string
                  • tenantId: string
                  • userContext: any

                Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>

            • signUp:function
              • signUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
              • Parameters

                • input: { email: string; password: string; tenantId: string; userContext: any }
                  • email: string
                  • password: string
                  • tenantId: string
                  • userContext: any

                Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

            • updateEmailOrPassword:function
              • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
              • Parameters

                • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
                  • Optional applyPasswordPolicy?: boolean
                  • Optional email?: string
                  • Optional password?: string
                  • recipeUserId: RecipeUserId
                  • tenantIdForPasswordPolicy: string
                  • userContext: any

                Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

            Variables

            Error: typeof default = Wrapper.Error

            Functions

            • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
            • Parameters

              • tenantId: string
              • token: string
              • Optional userContext: any

              Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

            • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
            • Parameters

              • tenantId: string
              • userId: string
              • email: string
              • userContext: any = {}

              Returns Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>

            • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
            • Parameters

              • tenantId: string
              • userId: string
              • email: string
              • Optional userContext: any

              Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

            • init(config?: TypeInput): RecipeListFunction
            • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
            • Parameters

              • tenantId: string
              • token: string
              • newPassword: string
              • Optional userContext: any

              Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

            • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
            • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
            • signIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
            • signUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
            • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
            • Parameters

              • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
                • Optional applyPasswordPolicy?: boolean
                • Optional email?: string
                • Optional password?: string
                • recipeUserId: RecipeUserId
                • Optional tenantIdForPasswordPolicy?: string
                • Optional userContext?: any

              Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

            Legend

            • Variable
            • Function
            • Function with type parameter
            • Type alias
            • Type alias with type parameter
            • Class
            • Class with type parameter
            • Interface

            Settings

            Theme

            Generated using TypeDoc

            \ No newline at end of file +

            Parameters

            • input: { email: string; tenantId: string; userContext: any; userId: string }
              • email: string
              • tenantId: string
              • userContext: any
              • userId: string

            Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

        • signIn:function
          • signIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>

        • signUp:function
          • signUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

        • updateEmailOrPassword:function
          • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
          • Parameters

            • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
              • Optional applyPasswordPolicy?: boolean
              • Optional email?: string
              • Optional password?: string
              • recipeUserId: RecipeUserId
              • tenantIdForPasswordPolicy: string
              • userContext: any

            Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        Variables

        Error: typeof default = Wrapper.Error

        Functions

        • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
        • Parameters

          • tenantId: string
          • token: string
          • Optional userContext: any

          Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

        • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
        • Parameters

          • tenantId: string
          • userId: string
          • email: string
          • userContext: any = {}

          Returns Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>

        • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
        • Parameters

          • tenantId: string
          • userId: string
          • email: string
          • Optional userContext: any

          Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

        • init(config?: TypeInput): RecipeListFunction
        • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
        • Parameters

          • tenantId: string
          • token: string
          • newPassword: string
          • Optional userContext: any

          Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
        • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
        • signIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
        • signUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
        • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
        • Parameters

          • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
            • Optional applyPasswordPolicy?: boolean
            • Optional email?: string
            • Optional password?: string
            • recipeUserId: RecipeUserId
            • Optional tenantIdForPasswordPolicy?: string
            • Optional userContext?: any

          Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_emailverification.html b/docs/modules/recipe_emailverification.html index 106491bf9..a44172e47 100644 --- a/docs/modules/recipe_emailverification.html +++ b/docs/modules/recipe_emailverification.html @@ -1 +1 @@ -recipe/emailverification | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/emailverification

        Index

        Type Aliases

        APIInterface: { generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>); isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>); verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>) }

        Type declaration

        • generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>)
        • isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>)
        • verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
        APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

        Type declaration

        • appInfo: NormalisedAppinfo
        • config: TypeNormalisedInput
        • emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>
        • isInServerlessEnv: boolean
        • recipeId: string
        • recipeImplementation: RecipeInterface
        • req: BaseRequest
        • res: BaseResponse
        RecipeInterface: { createEmailVerificationToken: any; isEmailVerified: any; revokeEmailVerificationTokens: any; unverifyEmail: any; verifyEmailUsingToken: any }

        Type declaration

        • createEmailVerificationToken:function
          • createEmailVerificationToken(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
        • isEmailVerified:function
          • isEmailVerified(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<boolean>
        • revokeEmailVerificationTokens:function
          • revokeEmailVerificationTokens(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
        • unverifyEmail:function
          • unverifyEmail(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" }>
        • verifyEmailUsingToken:function
          • verifyEmailUsingToken(input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
          • Parameters

            • input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }
              • attemptAccountLinking: boolean
              • tenantId: string
              • token: string
              • userContext: any

            Returns Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

        UserEmailInfo: { email: string; recipeUserId: RecipeUserId }

        Type declaration

        Variables

        EmailVerificationClaim: EmailVerificationClaimClass = ...
        Error: typeof default = Wrapper.Error

        Functions

        • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
        • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
        • init(config: TypeInput): RecipeListFunction
        • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
        • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
        • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
        • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
        • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
        • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file +recipe/emailverification | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/emailverification

        Index

        Type Aliases

        APIInterface: { generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>); isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>); verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>) }

        Type declaration

        • generateEmailVerifyTokenPOST: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ status: "OK" } | { newSession?: SessionContainer; status: "EMAIL_ALREADY_VERIFIED_ERROR" } | GeneralErrorResponse>)
        • isEmailVerifiedGET: undefined | ((input: { options: APIOptions; session: SessionContainer; userContext: any }) => Promise<{ isVerified: boolean; newSession?: SessionContainer; status: "OK" } | GeneralErrorResponse>)
        • verifyEmailPOST: undefined | ((input: { options: APIOptions; session?: SessionContainer; tenantId: string; token: string; userContext: any }) => Promise<{ newSession?: SessionContainer; status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" } | GeneralErrorResponse>)
        APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

        Type declaration

        • appInfo: NormalisedAppinfo
        • config: TypeNormalisedInput
        • emailDelivery: default<TypeEmailVerificationEmailDeliveryInput>
        • isInServerlessEnv: boolean
        • recipeId: string
        • recipeImplementation: RecipeInterface
        • req: BaseRequest
        • res: BaseResponse
        RecipeInterface: { createEmailVerificationToken: any; isEmailVerified: any; revokeEmailVerificationTokens: any; unverifyEmail: any; verifyEmailUsingToken: any }

        Type declaration

        • createEmailVerificationToken:function
          • createEmailVerificationToken(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
        • isEmailVerified:function
          • isEmailVerified(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<boolean>
        • revokeEmailVerificationTokens:function
          • revokeEmailVerificationTokens(input: { email: string; recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
        • unverifyEmail:function
          • unverifyEmail(input: { email: string; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" }>
        • verifyEmailUsingToken:function
          • verifyEmailUsingToken(input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>
          • Parameters

            • input: { attemptAccountLinking: boolean; tenantId: string; token: string; userContext: any }
              • attemptAccountLinking: boolean
              • tenantId: string
              • token: string
              • userContext: any

            Returns Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

        UserEmailInfo: { email: string; recipeUserId: RecipeUserId }

        Type declaration

        Variables

        EmailVerificationClaim: EmailVerificationClaimClass = ...
        Error: typeof default = Wrapper.Error

        Functions

        • createEmailVerificationLink(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
        • createEmailVerificationToken(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
        • init(config: TypeInput): RecipeListFunction
        • isEmailVerified(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<boolean>
        • revokeEmailVerificationTokens(tenantId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
        • sendEmail(input: TypeEmailVerificationEmailDeliveryInput & { userContext?: any }): Promise<void>
        • sendEmailVerificationEmail(tenantId: string, userId: string, recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: "OK" } | { status: "EMAIL_ALREADY_VERIFIED_ERROR" }>
        • unverifyEmail(recipeUserId: RecipeUserId, email?: string, userContext?: any): Promise<{ status: string }>
        • verifyEmailUsingToken(tenantId: string, token: string, attemptAccountLinking?: boolean, userContext?: any): Promise<{ status: "OK"; user: UserEmailInfo } | { status: "EMAIL_VERIFICATION_INVALID_TOKEN_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_jwt.html b/docs/modules/recipe_jwt.html index a7ff64098..22ecf70df 100644 --- a/docs/modules/recipe_jwt.html +++ b/docs/modules/recipe_jwt.html @@ -1 +1 @@ -recipe/jwt | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/jwt

        Index

        Type Aliases

        APIInterface: { getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>) }

        Type declaration

        • getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>)
        APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

        Type declaration

        JsonWebKey: { alg: string; e: string; kid: string; kty: string; n: string; use: string }

        Type declaration

        • alg: string
        • e: string
        • kid: string
        • kty: string
        • n: string
        • use: string
        RecipeInterface: { createJWT: any; getJWKS: any }

        Type declaration

        • createJWT:function
          • createJWT(input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
          • Parameters

            • input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }
              • Optional payload?: any
              • Optional useStaticSigningKey?: boolean
              • userContext: any
              • Optional validitySeconds?: number

            Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

        • getJWKS:function
          • getJWKS(input: { userContext: any }): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

        Functions

        • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
        • Parameters

          • payload: any
          • Optional validitySeconds: number
          • Optional useStaticSigningKey: boolean
          • Optional userContext: any

          Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

        • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
        • init(config?: TypeInput): RecipeListFunction

        Generated using TypeDoc

        \ No newline at end of file +recipe/jwt | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/jwt

        Index

        Type Aliases

        APIInterface: { getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>) }

        Type declaration

        • getJWKSGET: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<{ keys: JsonWebKey[] } | GeneralErrorResponse>)
        APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

        Type declaration

        JsonWebKey: { alg: string; e: string; kid: string; kty: string; n: string; use: string }

        Type declaration

        • alg: string
        • e: string
        • kid: string
        • kty: string
        • n: string
        • use: string
        RecipeInterface: { createJWT: any; getJWKS: any }

        Type declaration

        • createJWT:function
          • createJWT(input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
          • Parameters

            • input: { payload?: any; useStaticSigningKey?: boolean; userContext: any; validitySeconds?: number }
              • Optional payload?: any
              • Optional useStaticSigningKey?: boolean
              • userContext: any
              • Optional validitySeconds?: number

            Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

        • getJWKS:function
          • getJWKS(input: { userContext: any }): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>

        Functions

        • createJWT(payload: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
        • Parameters

          • payload: any
          • Optional validitySeconds: number
          • Optional useStaticSigningKey: boolean
          • Optional userContext: any

          Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

        • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
        • init(config?: TypeInput): RecipeListFunction

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_multitenancy.html b/docs/modules/recipe_multitenancy.html index 1881d8c34..23e118e5a 100644 --- a/docs/modules/recipe_multitenancy.html +++ b/docs/modules/recipe_multitenancy.html @@ -1 +1 @@ -recipe/multitenancy | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/multitenancy

        Index

        Type Aliases

        APIInterface: { loginMethodsGET: any }

        Type declaration

        • loginMethodsGET:function
          • loginMethodsGET(input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>
          • Parameters

            • input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }
              • Optional clientType?: string
              • options: APIOptions
              • tenantId: string
              • userContext: any

            Returns Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>

        APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; staticThirdPartyProviders: ProviderInput[] }

        Type declaration

        RecipeInterface: { associateUserToTenant: any; createOrUpdateTenant: any; createOrUpdateThirdPartyConfig: any; deleteTenant: any; deleteThirdPartyConfig: any; disassociateUserFromTenant: any; getTenant: any; getTenantId: any; listAllTenants: any }

        Type declaration

        • associateUserToTenant:function
          • associateUserToTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
          • Parameters

            • input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }

            Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

        • createOrUpdateTenant:function
          • createOrUpdateTenant(input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
          • Parameters

            • input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }
              • Optional config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
                • Optional coreConfig?: {}
                  • [key: string]: any
                • Optional emailPasswordEnabled?: boolean
                • Optional passwordlessEnabled?: boolean
                • Optional thirdPartyEnabled?: boolean
              • tenantId: string
              • userContext: any

            Returns Promise<{ createdNew: boolean; status: "OK" }>

        • createOrUpdateThirdPartyConfig:function
          • createOrUpdateThirdPartyConfig(input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
          • Parameters

            • input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }
              • config: ProviderConfig
              • Optional skipValidation?: boolean
              • tenantId: string
              • userContext: any

            Returns Promise<{ createdNew: boolean; status: "OK" }>

        • deleteTenant:function
          • deleteTenant(input: { tenantId: string; userContext: any }): Promise<{ didExist: boolean; status: "OK" }>
        • deleteThirdPartyConfig:function
          • deleteThirdPartyConfig(input: { tenantId: string; thirdPartyId: string; userContext: any }): Promise<{ didConfigExist: boolean; status: "OK" }>
          • Parameters

            • input: { tenantId: string; thirdPartyId: string; userContext: any }
              • tenantId: string
              • thirdPartyId: string
              • userContext: any

            Returns Promise<{ didConfigExist: boolean; status: "OK" }>

        • disassociateUserFromTenant:function
          • disassociateUserFromTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAssociated: boolean }>
        • getTenant:function
          • getTenant(input: { tenantId: string; userContext: any }): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
          • Parameters

            • input: { tenantId: string; userContext: any }
              • tenantId: string
              • userContext: any

            Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

        • getTenantId:function
          • getTenantId(input: { tenantIdFromFrontend: string; userContext: any }): Promise<string>
        • listAllTenants:function
          • listAllTenants(input: { userContext: any }): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
          • Parameters

            • input: { userContext: any }
              • userContext: any

            Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

        Variables

        AllowedDomainsClaim: AllowedDomainsClaimClass = ...

        Functions

        • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
        • Parameters

          • tenantId: string
          • recipeUserId: RecipeUserId
          • Optional userContext: any

          Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

        • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
        • Parameters

          • tenantId: string
          • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
            • Optional coreConfig?: {}
              • [key: string]: any
            • Optional emailPasswordEnabled?: boolean
            • Optional passwordlessEnabled?: boolean
            • Optional thirdPartyEnabled?: boolean
          • Optional userContext: any

          Returns Promise<{ createdNew: boolean; status: "OK" }>

        • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
        • Parameters

          • tenantId: string
          • config: ProviderConfig
          • Optional skipValidation: boolean
          • Optional userContext: any

          Returns Promise<{ createdNew: boolean; status: "OK" }>

        • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
        • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
        • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
        • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
        • Parameters

          • tenantId: string
          • Optional userContext: any

          Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

        • init(config?: TypeInput): RecipeListFunction
        • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
        • Parameters

          • Optional userContext: any

          Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

        Generated using TypeDoc

        \ No newline at end of file +recipe/multitenancy | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/multitenancy

        Index

        Type Aliases

        APIInterface: { loginMethodsGET: any }

        Type declaration

        • loginMethodsGET:function
          • loginMethodsGET(input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>
          • Parameters

            • input: { clientType?: string; options: APIOptions; tenantId: string; userContext: any }
              • Optional clientType?: string
              • options: APIOptions
              • tenantId: string
              • userContext: any

            Returns Promise<GeneralErrorResponse | { emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: { id: string; name?: string }[] } }>

        APIOptions: { config: TypeNormalisedInput; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; staticThirdPartyProviders: ProviderInput[] }

        Type declaration

        RecipeInterface: { associateUserToTenant: any; createOrUpdateTenant: any; createOrUpdateThirdPartyConfig: any; deleteTenant: any; deleteThirdPartyConfig: any; disassociateUserFromTenant: any; getTenant: any; getTenantId: any; listAllTenants: any }

        Type declaration

        • associateUserToTenant:function
          • associateUserToTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
          • Parameters

            • input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }

            Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

        • createOrUpdateTenant:function
          • createOrUpdateTenant(input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
          • Parameters

            • input: { config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }; tenantId: string; userContext: any }
              • Optional config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
                • Optional coreConfig?: {}
                  • [key: string]: any
                • Optional emailPasswordEnabled?: boolean
                • Optional passwordlessEnabled?: boolean
                • Optional thirdPartyEnabled?: boolean
              • tenantId: string
              • userContext: any

            Returns Promise<{ createdNew: boolean; status: "OK" }>

        • createOrUpdateThirdPartyConfig:function
          • createOrUpdateThirdPartyConfig(input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }): Promise<{ createdNew: boolean; status: "OK" }>
          • Parameters

            • input: { config: ProviderConfig; skipValidation?: boolean; tenantId: string; userContext: any }
              • config: ProviderConfig
              • Optional skipValidation?: boolean
              • tenantId: string
              • userContext: any

            Returns Promise<{ createdNew: boolean; status: "OK" }>

        • deleteTenant:function
          • deleteTenant(input: { tenantId: string; userContext: any }): Promise<{ didExist: boolean; status: "OK" }>
        • deleteThirdPartyConfig:function
          • deleteThirdPartyConfig(input: { tenantId: string; thirdPartyId: string; userContext: any }): Promise<{ didConfigExist: boolean; status: "OK" }>
          • Parameters

            • input: { tenantId: string; thirdPartyId: string; userContext: any }
              • tenantId: string
              • thirdPartyId: string
              • userContext: any

            Returns Promise<{ didConfigExist: boolean; status: "OK" }>

        • disassociateUserFromTenant:function
          • disassociateUserFromTenant(input: { recipeUserId: RecipeUserId; tenantId: string; userContext: any }): Promise<{ status: "OK"; wasAssociated: boolean }>
        • getTenant:function
          • getTenant(input: { tenantId: string; userContext: any }): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
          • Parameters

            • input: { tenantId: string; userContext: any }
              • tenantId: string
              • userContext: any

            Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

        • getTenantId:function
          • getTenantId(input: { tenantIdFromFrontend: string; userContext: any }): Promise<string>
        • listAllTenants:function
          • listAllTenants(input: { userContext: any }): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
          • Parameters

            • input: { userContext: any }
              • userContext: any

            Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

        Variables

        AllowedDomainsClaim: AllowedDomainsClaimClass = ...

        Functions

        • associateUserToTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>
        • Parameters

          • tenantId: string
          • recipeUserId: RecipeUserId
          • Optional userContext: any

          Returns Promise<{ status: "OK"; wasAlreadyAssociated: boolean } | { status: "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" | "THIRD_PARTY_USER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "ASSOCIATION_NOT_ALLOWED_ERROR" }>

        • createOrUpdateTenant(tenantId: string, config?: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
        • Parameters

          • tenantId: string
          • Optional config: { coreConfig?: {}; emailPasswordEnabled?: boolean; passwordlessEnabled?: boolean; thirdPartyEnabled?: boolean }
            • Optional coreConfig?: {}
              • [key: string]: any
            • Optional emailPasswordEnabled?: boolean
            • Optional passwordlessEnabled?: boolean
            • Optional thirdPartyEnabled?: boolean
          • Optional userContext: any

          Returns Promise<{ createdNew: boolean; status: "OK" }>

        • createOrUpdateThirdPartyConfig(tenantId: string, config: ProviderConfig, skipValidation?: boolean, userContext?: any): Promise<{ createdNew: boolean; status: "OK" }>
        • Parameters

          • tenantId: string
          • config: ProviderConfig
          • Optional skipValidation: boolean
          • Optional userContext: any

          Returns Promise<{ createdNew: boolean; status: "OK" }>

        • deleteTenant(tenantId: string, userContext?: any): Promise<{ didExist: boolean; status: "OK" }>
        • deleteThirdPartyConfig(tenantId: string, thirdPartyId: string, userContext?: any): Promise<{ didConfigExist: boolean; status: "OK" }>
        • disassociateUserFromTenant(tenantId: string, recipeUserId: RecipeUserId, userContext?: any): Promise<{ status: "OK"; wasAssociated: boolean }>
        • getTenant(tenantId: string, userContext?: any): Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>
        • Parameters

          • tenantId: string
          • Optional userContext: any

          Returns Promise<undefined | { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; status: "OK"; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }>

        • init(config?: TypeInput): RecipeListFunction
        • listAllTenants(userContext?: any): Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>
        • Parameters

          • Optional userContext: any

          Returns Promise<{ status: "OK"; tenants: { coreConfig: {}; emailPassword: { enabled: boolean }; passwordless: { enabled: boolean }; tenantId: string; thirdParty: { enabled: boolean; providers: ProviderConfig[] } }[] }>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_openid.html b/docs/modules/recipe_openid.html index 84af5d37b..bb2f53556 100644 --- a/docs/modules/recipe_openid.html +++ b/docs/modules/recipe_openid.html @@ -1 +1 @@ -recipe/openid | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/openid

        Index

        Functions

        • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
        • Parameters

          • Optional payload: any
          • Optional validitySeconds: number
          • Optional useStaticSigningKey: boolean
          • Optional userContext: any

          Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

        • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
        • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
        • init(config?: TypeInput): RecipeListFunction

        Generated using TypeDoc

        \ No newline at end of file +recipe/openid | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/openid

        Index

        Functions

        • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
        • Parameters

          • Optional payload: any
          • Optional validitySeconds: number
          • Optional useStaticSigningKey: boolean
          • Optional userContext: any

          Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

        • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[]; validityInSeconds?: number }>
        • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
        • init(config?: TypeInput): RecipeListFunction

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_passwordless.html b/docs/modules/recipe_passwordless.html index c2ce3d2ae..2f7db4aca 100644 --- a/docs/modules/recipe_passwordless.html +++ b/docs/modules/recipe_passwordless.html @@ -1 +1 @@ -recipe/passwordless | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/passwordless

        Index

        Type Aliases

        APIInterface: { consumeCodePOST?: any; createCodePOST?: any; emailExistsGET?: any; phoneNumberExistsGET?: any; resendCodePOST?: any }

        Type declaration

        • consumeCodePOST?:function
          • consumeCodePOST(input: { deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any } & { linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any } & { linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }

            Returns Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • createCodePOST?:function
          • createCodePOST(input: { email: string } & { options: APIOptions; tenantId: string; userContext: any } & { phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string } & { options: APIOptions; tenantId: string; userContext: any } & { phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any }

            Returns Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • emailExistsGET?:function
          • emailExistsGET(input: { email: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
        • phoneNumberExistsGET?:function
          • phoneNumberExistsGET(input: { options: APIOptions; phoneNumber: string; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
        • resendCodePOST?:function
          • resendCodePOST(input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>
          • Parameters

            • input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }

            Returns Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>

        APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypePasswordlessEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; smsDelivery: default<TypePasswordlessSmsDeliveryInput> }

        Type declaration

        • appInfo: NormalisedAppinfo
        • config: TypeNormalisedInput
        • emailDelivery: default<TypePasswordlessEmailDeliveryInput>
        • isInServerlessEnv: boolean
        • recipeId: string
        • recipeImplementation: RecipeInterface
        • req: BaseRequest
        • res: BaseResponse
        • smsDelivery: default<TypePasswordlessSmsDeliveryInput>
        RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; updateUser: any }

        Type declaration

        • consumeCode:function
          • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
          • Parameters

            • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

            Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

        • createCode:function
          • createCode(input: { email: string } & { tenantId: string; userContext: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
          • Parameters

            • input: { email: string } & { tenantId: string; userContext: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string }

            Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

        • createNewCodeForDevice:function
          • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
          • Parameters

            • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
              • deviceId: string
              • tenantId: string
              • userContext: any
              • Optional userInputCode?: string

            Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

        • listCodesByDeviceId:function
          • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
          • Parameters

            • input: { deviceId: string; tenantId: string; userContext: any }
              • deviceId: string
              • tenantId: string
              • userContext: any

            Returns Promise<undefined | DeviceType>

        • listCodesByEmail:function
          • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
        • listCodesByPhoneNumber:function
          • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
          • Parameters

            • input: { phoneNumber: string; tenantId: string; userContext: any }
              • phoneNumber: string
              • tenantId: string
              • userContext: any

            Returns Promise<DeviceType[]>

        • listCodesByPreAuthSessionId:function
          • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
          • Parameters

            • input: { preAuthSessionId: string; tenantId: string; userContext: any }
              • preAuthSessionId: string
              • tenantId: string
              • userContext: any

            Returns Promise<undefined | DeviceType>

        • revokeAllCodes:function
          • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
          • Parameters

            • input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }

            Returns Promise<{ status: "OK" }>

        • revokeCode:function
          • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
          • Parameters

            • input: { codeId: string; tenantId: string; userContext: any }
              • codeId: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ status: "OK" }>

        • updateUser:function
          • updateUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
          • Parameters

            • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
              • Optional email?: string | null
              • Optional phoneNumber?: string | null
              • recipeUserId: RecipeUserId
              • userContext: any

            Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

        Variables

        Error: typeof default = Wrapper.Error

        Functions

        • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
        • Parameters

          • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

        • createCode(input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
        • Parameters

          • input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }

          Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

        • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
        • Parameters

          • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

          Returns Promise<string>

        • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
        • Parameters

          • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
            • deviceId: string
            • tenantId: string
            • Optional userContext?: any
            • Optional userInputCode?: string

          Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

        • init(config: TypeInput): RecipeListFunction
        • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
        • Parameters

          • input: { deviceId: string; tenantId: string; userContext?: any }
            • deviceId: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<undefined | DeviceType>

        • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
        • Parameters

          • input: { email: string; tenantId: string; userContext?: any }
            • email: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<DeviceType[]>

        • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
        • Parameters

          • input: { phoneNumber: string; tenantId: string; userContext?: any }
            • phoneNumber: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<DeviceType[]>

        • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
        • Parameters

          • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
            • preAuthSessionId: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<undefined | DeviceType>

        • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
        • Parameters

          • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

          Returns Promise<{ status: "OK" }>

        • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
        • Parameters

          • input: { codeId: string; tenantId: string; userContext?: any }
            • codeId: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<{ status: "OK" }>

        • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
        • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
        • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
        • Parameters

          • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

        • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
        • Parameters

          • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
            • Optional email?: null | string
            • Optional phoneNumber?: null | string
            • recipeUserId: RecipeUserId
            • Optional userContext?: any

          Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file +recipe/passwordless | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/passwordless

        Index

        Type Aliases

        APIInterface: { consumeCodePOST?: any; createCodePOST?: any; emailExistsGET?: any; phoneNumberExistsGET?: any; resendCodePOST?: any }

        Type declaration

        • consumeCodePOST?:function
          • consumeCodePOST(input: { deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any } & { linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { deviceId: string; preAuthSessionId: string; userInputCode: string } & { options: APIOptions; tenantId: string; userContext: any } & { linkCode: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }

            Returns Promise<GeneralErrorResponse | { createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • createCodePOST?:function
          • createCodePOST(input: { email: string } & { options: APIOptions; tenantId: string; userContext: any } & { phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string } & { options: APIOptions; tenantId: string; userContext: any } & { phoneNumber: string } & { options: APIOptions; tenantId: string; userContext: any }

            Returns Promise<GeneralErrorResponse | { deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • emailExistsGET?:function
          • emailExistsGET(input: { email: string; options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
        • phoneNumberExistsGET?:function
          • phoneNumberExistsGET(input: { options: APIOptions; phoneNumber: string; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { exists: boolean; status: "OK" }>
        • resendCodePOST?:function
          • resendCodePOST(input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }): Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>
          • Parameters

            • input: { deviceId: string; preAuthSessionId: string } & { options: APIOptions; tenantId: string; userContext: any }

            Returns Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>

        APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; emailDelivery: default<TypePasswordlessEmailDeliveryInput>; isInServerlessEnv: boolean; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse; smsDelivery: default<TypePasswordlessSmsDeliveryInput> }

        Type declaration

        • appInfo: NormalisedAppinfo
        • config: TypeNormalisedInput
        • emailDelivery: default<TypePasswordlessEmailDeliveryInput>
        • isInServerlessEnv: boolean
        • recipeId: string
        • recipeImplementation: RecipeInterface
        • req: BaseRequest
        • res: BaseResponse
        • smsDelivery: default<TypePasswordlessSmsDeliveryInput>
        RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; updateUser: any }

        Type declaration

        • consumeCode:function
          • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
          • Parameters

            • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

            Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

        • createCode:function
          • createCode(input: { email: string } & { tenantId: string; userContext: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
          • Parameters

            • input: { email: string } & { tenantId: string; userContext: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string }

            Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

        • createNewCodeForDevice:function
          • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
          • Parameters

            • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
              • deviceId: string
              • tenantId: string
              • userContext: any
              • Optional userInputCode?: string

            Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

        • listCodesByDeviceId:function
          • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
          • Parameters

            • input: { deviceId: string; tenantId: string; userContext: any }
              • deviceId: string
              • tenantId: string
              • userContext: any

            Returns Promise<undefined | DeviceType>

        • listCodesByEmail:function
          • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
        • listCodesByPhoneNumber:function
          • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
          • Parameters

            • input: { phoneNumber: string; tenantId: string; userContext: any }
              • phoneNumber: string
              • tenantId: string
              • userContext: any

            Returns Promise<DeviceType[]>

        • listCodesByPreAuthSessionId:function
          • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
          • Parameters

            • input: { preAuthSessionId: string; tenantId: string; userContext: any }
              • preAuthSessionId: string
              • tenantId: string
              • userContext: any

            Returns Promise<undefined | DeviceType>

        • revokeAllCodes:function
          • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
          • Parameters

            • input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }

            Returns Promise<{ status: "OK" }>

        • revokeCode:function
          • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
          • Parameters

            • input: { codeId: string; tenantId: string; userContext: any }
              • codeId: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ status: "OK" }>

        • updateUser:function
          • updateUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
          • Parameters

            • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
              • Optional email?: string | null
              • Optional phoneNumber?: string | null
              • recipeUserId: RecipeUserId
              • userContext: any

            Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

        Variables

        Error: typeof default = Wrapper.Error

        Functions

        • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
        • Parameters

          • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

        • createCode(input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
        • Parameters

          • input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }

          Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

        • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
        • Parameters

          • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

          Returns Promise<string>

        • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
        • Parameters

          • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
            • deviceId: string
            • tenantId: string
            • Optional userContext?: any
            • Optional userInputCode?: string

          Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

        • init(config: TypeInput): RecipeListFunction
        • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
        • Parameters

          • input: { deviceId: string; tenantId: string; userContext?: any }
            • deviceId: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<undefined | DeviceType>

        • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
        • Parameters

          • input: { email: string; tenantId: string; userContext?: any }
            • email: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<DeviceType[]>

        • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
        • Parameters

          • input: { phoneNumber: string; tenantId: string; userContext?: any }
            • phoneNumber: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<DeviceType[]>

        • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
        • Parameters

          • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
            • preAuthSessionId: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<undefined | DeviceType>

        • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
        • Parameters

          • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

          Returns Promise<{ status: "OK" }>

        • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
        • Parameters

          • input: { codeId: string; tenantId: string; userContext?: any }
            • codeId: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<{ status: "OK" }>

        • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
        • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
        • signInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
        • Parameters

          • input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>

        • updateUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
        • Parameters

          • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
            • Optional email?: null | string
            • Optional phoneNumber?: null | string
            • recipeUserId: RecipeUserId
            • Optional userContext?: any

          Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_session.html b/docs/modules/recipe_session.html index 6f6548910..8a49c6b2c 100644 --- a/docs/modules/recipe_session.html +++ b/docs/modules/recipe_session.html @@ -1,13 +1,13 @@ -recipe/session | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/session

        Index

        Type Aliases

        APIInterface: { refreshPOST: undefined | ((input: { options: APIOptions; userContext: any }) => Promise<SessionContainer>); signOutPOST: undefined | ((input: { options: APIOptions; session: SessionContainer | undefined; userContext: any }) => Promise<{ status: "OK" } | GeneralErrorResponse>); verifySession: any }

        Type declaration

      • mergeIntoAccessTokenPayload:function
        • mergeIntoAccessTokenPayload(input: { accessTokenPayloadUpdate: JSONObject; sessionHandle: string; userContext: any }): Promise<boolean>
      • refreshSession:function
        • refreshSession(input: { antiCsrfToken?: string; disableAntiCsrf: boolean; refreshToken: string; userContext: any }): Promise<SessionContainer>
        • Parameters

          • input: { antiCsrfToken?: string; disableAntiCsrf: boolean; refreshToken: string; userContext: any }
            • Optional antiCsrfToken?: string
            • disableAntiCsrf: boolean
            • refreshToken: string
            • userContext: any

          Returns Promise<SessionContainer>

      • regenerateAccessToken:function
        • regenerateAccessToken(input: { accessToken: string; newAccessTokenPayload?: any; userContext: any }): Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; recipeUserId: RecipeUserId; tenantId: string; userDataInJWT: any; userId: string }; status: "OK" }>
        • Parameters

          • input: { accessToken: string; newAccessTokenPayload?: any; userContext: any }
            • accessToken: string
            • Optional newAccessTokenPayload?: any
            • userContext: any

          Returns Promise<undefined | { accessToken?: { createdTime: number; expiry: number; token: string }; session: { handle: string; recipeUserId: RecipeUserId; tenantId: string; userDataInJWT: any; userId: string }; status: "OK" }>

          Returns false if the sessionHandle does not exist

          +
      • removeClaim:function
        • removeClaim(input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }): Promise<boolean>
        • Parameters

          • input: { claim: SessionClaim<any>; sessionHandle: string; userContext: any }
            • claim: SessionClaim<any>
            • sessionHandle: string
            • userContext: any

          Returns Promise<boolean>

      • revokeAllSessionsForUser:function
        • revokeAllSessionsForUser(input: { revokeAcrossAllTenants?: boolean; revokeSessionsForLinkedAccounts: boolean; tenantId: string; userContext: any; userId: string }): Promise<string[]>
        • Parameters

          • input: { revokeAcrossAllTenants?: boolean; revokeSessionsForLinkedAccounts: boolean; tenantId: string; userContext: any; userId: string }
            • Optional revokeAcrossAllTenants?: boolean
            • revokeSessionsForLinkedAccounts: boolean
            • tenantId: string
            • userContext: any
            • userId: string

          Returns Promise<string[]>

      • revokeMultipleSessions:function
        • revokeMultipleSessions(input: { sessionHandles: string[]; userContext: any }): Promise<string[]>
        • Parameters

          • input: { sessionHandles: string[]; userContext: any }
            • sessionHandles: string[]
            • userContext: any

          Returns Promise<string[]>

      • revokeSession:function
        • revokeSession(input: { sessionHandle: string; userContext: any }): Promise<boolean>
      • setClaimValue:function
        • setClaimValue<T>(input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any; value: T }): Promise<boolean>
        • Type Parameters

          • T

          Parameters

          • input: { claim: SessionClaim<T>; sessionHandle: string; userContext: any; value: T }
            • claim: SessionClaim<T>
            • sessionHandle: string
            • userContext: any
            • value: T

          Returns Promise<boolean>

      • updateSessionDataInDatabase:function
        • updateSessionDataInDatabase(input: { newSessionData: any; sessionHandle: string; userContext: any }): Promise<boolean>
        • Parameters

          • input: { newSessionData: any; sessionHandle: string; userContext: any }
            • newSessionData: any
            • sessionHandle: string
            • userContext: any

          Returns Promise<boolean>

      • validateClaims:function
        • validateClaims(input: { accessTokenPayload: any; claimValidators: SessionClaimValidator[]; recipeUserId: RecipeUserId; userContext: any; userId: string }): Promise<{ accessTokenPayloadUpdate?: any; invalidClaims: ClaimValidationError[] }>
      • SessionClaimValidator: ({ claim: SessionClaim<any>; shouldRefetch: any } | {}) & { id: string; validate: any }
        SessionInformation: { customClaimsInAccessTokenPayload: any; expiry: number; recipeUserId: RecipeUserId; sessionDataInDatabase: any; sessionHandle: string; tenantId: string; timeCreated: number; userId: string }

        Type declaration

        • customClaimsInAccessTokenPayload: any
        • expiry: number
        • recipeUserId: RecipeUserId
        • sessionDataInDatabase: any
        • sessionHandle: string
        • tenantId: string
        • timeCreated: number
        • userId: string

        Variables

        Error: typeof default = SessionWrapper.Error

        Functions

        • createJWT(payload?: any, validitySeconds?: number, useStaticSigningKey?: boolean, userContext?: any): Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>
        • Parameters

          • Optional payload: any
          • Optional validitySeconds: number
          • Optional useStaticSigningKey: boolean
          • userContext: any = {}

          Returns Promise<{ jwt: string; status: "OK" } | { status: "UNSUPPORTED_ALGORITHM_ERROR" }>

        • createNewSession(req: any, res: any, tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, userContext?: any): Promise<SessionContainer>
        • createNewSessionWithoutRequestResponse(tenantId: string, recipeUserId: RecipeUserId, accessTokenPayload?: any, sessionDataInDatabase?: any, disableAntiCsrf?: boolean, userContext?: any): Promise<SessionContainer>
        • fetchAndSetClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
        • getAllSessionHandlesForUser(userId: string, fetchSessionsForAllLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
        • Parameters

          • userId: string
          • fetchSessionsForAllLinkedAccounts: boolean = true
          • Optional tenantId: string
          • userContext: any = {}

          Returns Promise<string[]>

        • getClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, userContext?: any): Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>
        • Type Parameters

          • T

          Parameters

          • sessionHandle: string
          • claim: SessionClaim<T>
          • userContext: any = {}

          Returns Promise<{ status: "SESSION_DOES_NOT_EXIST_ERROR" } | { status: "OK"; value: undefined | T }>

        • getJWKS(userContext?: any): Promise<{ keys: JsonWebKey[] }>
        • getOpenIdDiscoveryConfiguration(userContext?: any): Promise<{ issuer: string; jwks_uri: string; status: "OK" }>
        • getSessionInformation(sessionHandle: string, userContext?: any): Promise<undefined | SessionInformation>
        • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string): Promise<SessionContainer>
        • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired?: true }, userContext?: any): Promise<SessionContainer>
        • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions & { sessionRequired: false }, userContext?: any): Promise<undefined | SessionContainer>
        • getSessionWithoutRequestResponse(accessToken: string, antiCsrfToken?: string, options?: VerifySessionOptions, userContext?: any): Promise<undefined | SessionContainer>
        • init(config?: TypeInput): RecipeListFunction
        • mergeIntoAccessTokenPayload(sessionHandle: string, accessTokenPayloadUpdate: JSONObject, userContext?: any): Promise<boolean>
        • refreshSession(req: any, res: any, userContext?: any): Promise<SessionContainer>
        • refreshSessionWithoutRequestResponse(refreshToken: string, disableAntiCsrf?: boolean, antiCsrfToken?: string, userContext?: any): Promise<SessionContainer>
        • removeClaim(sessionHandle: string, claim: SessionClaim<any>, userContext?: any): Promise<boolean>
        • revokeAllSessionsForUser(userId: string, revokeSessionsForLinkedAccounts?: boolean, tenantId?: string, userContext?: any): Promise<string[]>
        • Parameters

          • userId: string
          • revokeSessionsForLinkedAccounts: boolean = true
          • Optional tenantId: string
          • userContext: any = {}

          Returns Promise<string[]>

        • revokeMultipleSessions(sessionHandles: string[], userContext?: any): Promise<string[]>
        • revokeSession(sessionHandle: string, userContext?: any): Promise<boolean>
        • setClaimValue<T>(sessionHandle: string, claim: SessionClaim<T>, value: T, userContext?: any): Promise<boolean>
        • updateSessionDataInDatabase(sessionHandle: string, newSessionData: any, userContext?: any): Promise<boolean>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_thirdparty.html b/docs/modules/recipe_thirdparty.html index cfe87fdaf..6726b36f2 100644 --- a/docs/modules/recipe_thirdparty.html +++ b/docs/modules/recipe_thirdparty.html @@ -1 +1 @@ -recipe/thirdparty | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/thirdparty

        Index

        Type Aliases

        APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

        Type declaration

        • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>)
        • authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
        • signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
        APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; providers: ProviderInput[]; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

        Type declaration

        • appInfo: NormalisedAppinfo
        • config: TypeNormalisedInput
        • isInServerlessEnv: boolean
        • providers: ProviderInput[]
        • recipeId: string
        • recipeImplementation: RecipeInterface
        • req: BaseRequest
        • res: BaseResponse
        RecipeInterface: { getProvider: any; manuallyCreateOrUpdateUser: any; signInUp: any }

        Type declaration

        • getProvider:function
          • getProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
          • Parameters

            • input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }
              • Optional clientType?: string
              • tenantId: string
              • thirdPartyId: string
              • userContext: any

            Returns Promise<undefined | TypeProvider>

        • manuallyCreateOrUpdateUser:function
          • manuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • signInUp:function
          • signInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • oAuthTokens: {}
                • [key: string]: any
              • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
                • Optional fromIdTokenPayload?: {}
                  • [key: string]: any
                • Optional fromUserInfoAPI?: {}
                  • [key: string]: any
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        TypeProvider: { config: ProviderConfigForClientType; id: string; exchangeAuthCodeForOAuthTokens: any; getAuthorisationRedirectURL: any; getConfigForClientType: any; getUserInfo: any }

        Type declaration

        • config: ProviderConfigForClientType
        • id: string
        • exchangeAuthCodeForOAuthTokens:function
          • exchangeAuthCodeForOAuthTokens(input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }): Promise<any>
          • Parameters

            • input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }
              • redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }
                • Optional pkceCodeVerifier?: string
                • redirectURIOnProviderDashboard: string
                • redirectURIQueryParams: any
              • userContext: any

            Returns Promise<any>

        • getAuthorisationRedirectURL:function
          • getAuthorisationRedirectURL(input: { redirectURIOnProviderDashboard: string; userContext: any }): Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>
          • Parameters

            • input: { redirectURIOnProviderDashboard: string; userContext: any }
              • redirectURIOnProviderDashboard: string
              • userContext: any

            Returns Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>

        • getConfigForClientType:function
          • getConfigForClientType(input: { clientType?: string; userContext: any }): Promise<ProviderConfigForClientType>
          • Parameters

            • input: { clientType?: string; userContext: any }
              • Optional clientType?: string
              • userContext: any

            Returns Promise<ProviderConfigForClientType>

        • getUserInfo:function
          • getUserInfo(input: { oAuthTokens: any; userContext: any }): Promise<UserInfo>

        Variables

        Error: typeof default = Wrapper.Error

        Functions

        • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
        • init(config?: TypeInput): RecipeListFunction
        • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Parameters

          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • email: string
          • isVerified: boolean
          • userContext: any = {}

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        Generated using TypeDoc

        \ No newline at end of file +recipe/thirdparty | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/thirdparty

        Index

        Type Aliases

        APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

        Type declaration

        • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: {}; options: APIOptions; userContext: any }) => Promise<void>)
        • authorisationUrlGET: undefined | ((input: { options: APIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
        • signInUpPOST: undefined | ((input: { options: APIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
        APIOptions: { appInfo: NormalisedAppinfo; config: TypeNormalisedInput; isInServerlessEnv: boolean; providers: ProviderInput[]; recipeId: string; recipeImplementation: RecipeInterface; req: BaseRequest; res: BaseResponse }

        Type declaration

        • appInfo: NormalisedAppinfo
        • config: TypeNormalisedInput
        • isInServerlessEnv: boolean
        • providers: ProviderInput[]
        • recipeId: string
        • recipeImplementation: RecipeInterface
        • req: BaseRequest
        • res: BaseResponse
        RecipeInterface: { getProvider: any; manuallyCreateOrUpdateUser: any; signInUp: any }

        Type declaration

        • getProvider:function
          • getProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
          • Parameters

            • input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }
              • Optional clientType?: string
              • tenantId: string
              • thirdPartyId: string
              • userContext: any

            Returns Promise<undefined | TypeProvider>

        • manuallyCreateOrUpdateUser:function
          • manuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • signInUp:function
          • signInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • oAuthTokens: {}
                • [key: string]: any
              • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
                • Optional fromIdTokenPayload?: {}
                  • [key: string]: any
                • Optional fromUserInfoAPI?: {}
                  • [key: string]: any
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        TypeProvider: { config: ProviderConfigForClientType; id: string; exchangeAuthCodeForOAuthTokens: any; getAuthorisationRedirectURL: any; getConfigForClientType: any; getUserInfo: any }

        Type declaration

        • config: ProviderConfigForClientType
        • id: string
        • exchangeAuthCodeForOAuthTokens:function
          • exchangeAuthCodeForOAuthTokens(input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }): Promise<any>
          • Parameters

            • input: { redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }; userContext: any }
              • redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any }
                • Optional pkceCodeVerifier?: string
                • redirectURIOnProviderDashboard: string
                • redirectURIQueryParams: any
              • userContext: any

            Returns Promise<any>

        • getAuthorisationRedirectURL:function
          • getAuthorisationRedirectURL(input: { redirectURIOnProviderDashboard: string; userContext: any }): Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>
          • Parameters

            • input: { redirectURIOnProviderDashboard: string; userContext: any }
              • redirectURIOnProviderDashboard: string
              • userContext: any

            Returns Promise<{ pkceCodeVerifier?: string; urlWithQueryParams: string }>

        • getConfigForClientType:function
          • getConfigForClientType(input: { clientType?: string; userContext: any }): Promise<ProviderConfigForClientType>
          • Parameters

            • input: { clientType?: string; userContext: any }
              • Optional clientType?: string
              • userContext: any

            Returns Promise<ProviderConfigForClientType>

        • getUserInfo:function
          • getUserInfo(input: { oAuthTokens: any; userContext: any }): Promise<UserInfo>

        Variables

        Error: typeof default = Wrapper.Error

        Functions

        • getProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
        • init(config?: TypeInput): RecipeListFunction
        • manuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Parameters

          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • email: string
          • isVerified: boolean
          • userContext: any = {}

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_thirdpartyemailpassword.html b/docs/modules/recipe_thirdpartyemailpassword.html index ef528eb45..95441fed2 100644 --- a/docs/modules/recipe_thirdpartyemailpassword.html +++ b/docs/modules/recipe_thirdpartyemailpassword.html @@ -1 +1 @@ -recipe/thirdpartyemailpassword | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/thirdpartyemailpassword

        Index

        References

        Re-exports TypeProvider

        Type Aliases

        APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

        Type declaration

        • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
        • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
        • emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
        • emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
        • emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
        • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
        • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
        • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
        EmailPasswordAPIOptions: APIOptions
        RecipeInterface: { consumePasswordResetToken: any; createNewEmailPasswordRecipeUser: any; createResetPasswordToken: any; emailPasswordSignIn: any; emailPasswordSignUp: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updateEmailOrPassword: any }

        Type declaration

        • consumePasswordResetToken:function
          • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
          • Parameters

            • input: { tenantId: string; token: string; userContext: any }
              • tenantId: string
              • token: string
              • userContext: any

            Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

        • createNewEmailPasswordRecipeUser:function
          • createNewEmailPasswordRecipeUser(input: { email: string; password: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
        • createResetPasswordToken:function
          • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
          • Parameters

            • input: { email: string; tenantId: string; userContext: any; userId: string }
              • email: string
              • tenantId: string
              • userContext: any
              • userId: string

            Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

        • emailPasswordSignIn:function
          • emailPasswordSignIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>

        • emailPasswordSignUp:function
          • emailPasswordSignUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

        • thirdPartyGetProvider:function
          • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
        • thirdPartyManuallyCreateOrUpdateUser:function
          • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • thirdPartySignInUp:function
          • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • oAuthTokens: {}
                • [key: string]: any
              • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
                • Optional fromIdTokenPayload?: {}
                  • [key: string]: any
                • Optional fromUserInfoAPI?: {}
                  • [key: string]: any
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • updateEmailOrPassword:function
          • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
          • Parameters

            • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
              • Optional applyPasswordPolicy?: boolean
              • Optional email?: string
              • Optional password?: string
              • recipeUserId: RecipeUserId
              • tenantIdForPasswordPolicy: string
              • userContext: any

            Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        ThirdPartyAPIOptions: APIOptions

        Variables

        Error: typeof default = Wrapper.Error

        Functions

        • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
        • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
        • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
        • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
        • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
        • init(config?: TypeInput): RecipeListFunction
        • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
        • Parameters

          • tenantId: string
          • token: string
          • newPassword: string
          • Optional userContext: any

          Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
        • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
        • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
        • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Parameters

          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • email: string
          • isVerified: boolean
          • userContext: any = {}

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
        • Parameters

          • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
            • Optional applyPasswordPolicy?: boolean
            • Optional email?: string
            • Optional password?: string
            • recipeUserId: RecipeUserId
            • Optional tenantIdForPasswordPolicy?: string
            • Optional userContext?: any

          Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file +recipe/thirdpartyemailpassword | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/thirdpartyemailpassword

        Index

        References

        Re-exports TypeProvider

        Type Aliases

        APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>); emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>); generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>); passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

        Type declaration

        • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
        • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
        • emailPasswordEmailExistsGET: undefined | ((input: { email: string; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
        • emailPasswordSignInPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_IN_NOT_ALLOWED" } | { status: "WRONG_CREDENTIALS_ERROR" } | GeneralErrorResponse>)
        • emailPasswordSignUpPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ session: SessionContainer; status: "OK"; user: GlobalUser } | { reason: string; status: "SIGN_UP_NOT_ALLOWED" } | { status: "EMAIL_ALREADY_EXISTS_ERROR" } | GeneralErrorResponse>)
        • generatePasswordResetTokenPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; userContext: any }) => Promise<{ status: "OK" } | { reason: string; status: "PASSWORD_RESET_NOT_ALLOWED" } | GeneralErrorResponse>)
        • passwordResetPOST: undefined | ((input: { formFields: { id: string; value: string }[]; options: EmailPasswordAPIOptions; tenantId: string; token: string; userContext: any }) => Promise<{ email: string; status: "OK"; user: GlobalUser } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" } | GeneralErrorResponse>)
        • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: GlobalUser } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
        EmailPasswordAPIOptions: APIOptions
        RecipeInterface: { consumePasswordResetToken: any; createNewEmailPasswordRecipeUser: any; createResetPasswordToken: any; emailPasswordSignIn: any; emailPasswordSignUp: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updateEmailOrPassword: any }

        Type declaration

        • consumePasswordResetToken:function
          • consumePasswordResetToken(input: { tenantId: string; token: string; userContext: any }): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
          • Parameters

            • input: { tenantId: string; token: string; userContext: any }
              • tenantId: string
              • token: string
              • userContext: any

            Returns Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>

        • createNewEmailPasswordRecipeUser:function
          • createNewEmailPasswordRecipeUser(input: { email: string; password: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
        • createResetPasswordToken:function
          • createResetPasswordToken(input: { email: string; tenantId: string; userContext: any; userId: string }): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
          • Parameters

            • input: { email: string; tenantId: string; userContext: any; userId: string }
              • email: string
              • tenantId: string
              • userContext: any
              • userId: string

            Returns Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>

        • emailPasswordSignIn:function
          • emailPasswordSignIn(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "WRONG_CREDENTIALS_ERROR" }>

        • emailPasswordSignUp:function
          • emailPasswordSignUp(input: { email: string; password: string; tenantId: string; userContext: any }): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
          • Parameters

            • input: { email: string; password: string; tenantId: string; userContext: any }
              • email: string
              • password: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>

        • thirdPartyGetProvider:function
          • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
        • thirdPartyManuallyCreateOrUpdateUser:function
          • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: GlobalUser } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • thirdPartySignInUp:function
          • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • oAuthTokens: {}
                • [key: string]: any
              • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
                • Optional fromIdTokenPayload?: {}
                  • [key: string]: any
                • Optional fromUserInfoAPI?: {}
                  • [key: string]: any
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • updateEmailOrPassword:function
          • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
          • Parameters

            • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy: string; userContext: any }
              • Optional applyPasswordPolicy?: boolean
              • Optional email?: string
              • Optional password?: string
              • recipeUserId: RecipeUserId
              • tenantIdForPasswordPolicy: string
              • userContext: any

            Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        ThirdPartyAPIOptions: APIOptions

        Variables

        Error: typeof default = Wrapper.Error

        Functions

        • consumePasswordResetToken(tenantId: string, token: string, userContext?: any): Promise<{ email: string; status: "OK"; userId: string } | { status: "RESET_PASSWORD_INVALID_TOKEN_ERROR" }>
        • createResetPasswordLink(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ link: string; status: "OK" } | { status: "UNKNOWN_USER_ID_ERROR" }>
        • createResetPasswordToken(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK"; token: string } | { status: "UNKNOWN_USER_ID_ERROR" }>
        • emailPasswordSignIn(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "WRONG_CREDENTIALS_ERROR" }>
        • emailPasswordSignUp(tenantId: string, email: string, password: string, userContext?: any): Promise<{ recipeUserId: RecipeUserId; status: "OK"; user: User } | { status: "EMAIL_ALREADY_EXISTS_ERROR" }>
        • init(config?: TypeInput): RecipeListFunction
        • resetPasswordUsingToken(tenantId: string, token: string, newPassword: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
        • Parameters

          • tenantId: string
          • token: string
          • newPassword: string
          • Optional userContext: any

          Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "RESET_PASSWORD_INVALID_TOKEN_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        • sendEmail(input: TypeEmailPasswordPasswordResetEmailDeliveryInput & { userContext?: any }): Promise<void>
        • sendResetPasswordEmail(tenantId: string, userId: string, email: string, userContext?: any): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" }>
        • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
        • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Parameters

          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • email: string
          • isVerified: boolean
          • userContext: any = {}

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • updateEmailOrPassword(input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>
        • Parameters

          • input: { applyPasswordPolicy?: boolean; email?: string; password?: string; recipeUserId: RecipeUserId; tenantIdForPasswordPolicy?: string; userContext?: any }
            • Optional applyPasswordPolicy?: boolean
            • Optional email?: string
            • Optional password?: string
            • recipeUserId: RecipeUserId
            • Optional tenantIdForPasswordPolicy?: string
            • Optional userContext?: any

          Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { failureReason: string; status: "PASSWORD_POLICY_VIOLATED_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_thirdpartypasswordless.html b/docs/modules/recipe_thirdpartypasswordless.html index f23e8961b..56a0ee701 100644 --- a/docs/modules/recipe_thirdpartypasswordless.html +++ b/docs/modules/recipe_thirdpartypasswordless.html @@ -1 +1 @@ -recipe/thirdpartypasswordless | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/thirdpartypasswordless

        Index

        References

        Re-exports TypeProvider

        Type Aliases

        APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>); createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>); passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

        Type declaration

        • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
        • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
        • consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>)
        • createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
        • passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
        • passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
        • resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>)
        • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
        PasswordlessAPIOptions: APIOptions
        RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updatePasswordlessUser: any }

        Type declaration

        • consumeCode:function
          • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
          • Parameters

            • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

            Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

        • createCode:function
          • createCode(input: { email: string } & { tenantId: string; userContext: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
          • Parameters

            • input: { email: string } & { tenantId: string; userContext: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string }

            Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

        • createNewCodeForDevice:function
          • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
          • Parameters

            • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
              • deviceId: string
              • tenantId: string
              • userContext: any
              • Optional userInputCode?: string

            Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

        • listCodesByDeviceId:function
          • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
        • listCodesByEmail:function
          • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
        • listCodesByPhoneNumber:function
          • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
        • listCodesByPreAuthSessionId:function
          • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
        • revokeAllCodes:function
          • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
        • revokeCode:function
          • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
        • thirdPartyGetProvider:function
          • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
        • thirdPartyManuallyCreateOrUpdateUser:function
          • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • thirdPartySignInUp:function
          • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • oAuthTokens: {}
                • [key: string]: any
              • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
                • Optional fromIdTokenPayload?: {}
                  • [key: string]: any
                • Optional fromUserInfoAPI?: {}
                  • [key: string]: any
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • updatePasswordlessUser:function
          • updatePasswordlessUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
          • Parameters

            • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
              • Optional email?: string | null
              • Optional phoneNumber?: string | null
              • recipeUserId: RecipeUserId
              • userContext: any

            Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

        ThirdPartyAPIOptions: APIOptions

        Variables

        Error: typeof default = Wrapper.Error

        Functions

        • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
        • Parameters

          • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

        • createCode(input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
        • Parameters

          • input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }

          Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

        • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
        • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
        • Parameters

          • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
            • deviceId: string
            • tenantId: string
            • Optional userContext?: any
            • Optional userInputCode?: string

          Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

        • init(config: TypeInput): RecipeListFunction
        • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
        • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
        • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
        • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
        • Parameters

          • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
            • preAuthSessionId: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<undefined | DeviceType>

        • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
        • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
        • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
        • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
        • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
        • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
        • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Parameters

          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • email: string
          • isVerified: boolean
          • userContext: any = {}

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
        • Parameters

          • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
            • Optional email?: null | string
            • Optional phoneNumber?: null | string
            • recipeUserId: RecipeUserId
            • Optional userContext?: any

          Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file +recipe/thirdpartypasswordless | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/thirdpartypasswordless

        Index

        References

        Re-exports TypeProvider

        Type Aliases

        APIInterface: { appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>); authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>); consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>); createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>); passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>); resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>); thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>) }

        Type declaration

        • appleRedirectHandlerPOST: undefined | ((input: { formPostInfoFromProvider: any; options: ThirdPartyAPIOptions; userContext: any }) => Promise<void>)
        • authorisationUrlGET: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; redirectURIOnProviderDashboard: string; tenantId: string; userContext: any }) => Promise<{ pkceCodeVerifier?: string; status: "OK"; urlWithQueryParams: string } | GeneralErrorResponse>)
        • consumeCodePOST: undefined | ((input: ({ deviceId: string; preAuthSessionId: string; userInputCode: string } | { linkCode: string; preAuthSessionId: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ createdNewRecipeUser: boolean; session: SessionContainer; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>)
        • createCodePOST: undefined | ((input: ({ email: string } | { phoneNumber: string }) & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ deviceId: string; flowType: "USER_INPUT_CODE" | "MAGIC_LINK" | "USER_INPUT_CODE_AND_MAGIC_LINK"; preAuthSessionId: string; status: "OK" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
        • passwordlessUserEmailExistsGET: undefined | ((input: { email: string; options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
        • passwordlessUserPhoneNumberExistsGET: undefined | ((input: { options: PasswordlessAPIOptions; phoneNumber: string; tenantId: string; userContext: any }) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>)
        • resendCodePOST: undefined | ((input: { deviceId: string; preAuthSessionId: string } & { options: PasswordlessAPIOptions; tenantId: string; userContext: any }) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>)
        • thirdPartySignInUpPOST: undefined | ((input: { options: ThirdPartyAPIOptions; provider: TypeProvider; tenantId: string; userContext: any } & ({ redirectURIInfo: { pkceCodeVerifier?: string; redirectURIOnProviderDashboard: string; redirectURIQueryParams: any } } | { oAuthTokens: {} })) => Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; session: SessionContainer; status: "OK"; user: User } | { status: "NO_EMAIL_GIVEN_BY_PROVIDER" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" } | GeneralErrorResponse>)
        PasswordlessAPIOptions: APIOptions
        RecipeInterface: { consumeCode: any; createCode: any; createNewCodeForDevice: any; listCodesByDeviceId: any; listCodesByEmail: any; listCodesByPhoneNumber: any; listCodesByPreAuthSessionId: any; revokeAllCodes: any; revokeCode: any; thirdPartyGetProvider: any; thirdPartyManuallyCreateOrUpdateUser: any; thirdPartySignInUp: any; updatePasswordlessUser: any }

        Type declaration

        • consumeCode:function
          • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
          • Parameters

            • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext: any }

            Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

        • createCode:function
          • createCode(input: { email: string } & { tenantId: string; userContext: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
          • Parameters

            • input: { email: string } & { tenantId: string; userContext: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext: any; userInputCode?: string }

            Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

        • createNewCodeForDevice:function
          • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
          • Parameters

            • input: { deviceId: string; tenantId: string; userContext: any; userInputCode?: string }
              • deviceId: string
              • tenantId: string
              • userContext: any
              • Optional userInputCode?: string

            Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

        • listCodesByDeviceId:function
          • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
        • listCodesByEmail:function
          • listCodesByEmail(input: { email: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
        • listCodesByPhoneNumber:function
          • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext: any }): Promise<DeviceType[]>
        • listCodesByPreAuthSessionId:function
          • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext: any }): Promise<undefined | DeviceType>
        • revokeAllCodes:function
          • revokeAllCodes(input: { email: string; tenantId: string; userContext: any } | { phoneNumber: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
        • revokeCode:function
          • revokeCode(input: { codeId: string; tenantId: string; userContext: any }): Promise<{ status: "OK" }>
        • thirdPartyGetProvider:function
          • thirdPartyGetProvider(input: { clientType?: string; tenantId: string; thirdPartyId: string; userContext: any }): Promise<undefined | TypeProvider>
        • thirdPartyManuallyCreateOrUpdateUser:function
          • thirdPartyManuallyCreateOrUpdateUser(input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • thirdPartySignInUp:function
          • thirdPartySignInUp(input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }): Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
          • Parameters

            • input: { email: string; isVerified: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; tenantId: string; thirdPartyId: string; thirdPartyUserId: string; userContext: any }
              • email: string
              • isVerified: boolean
              • oAuthTokens: {}
                • [key: string]: any
              • rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }
                • Optional fromIdTokenPayload?: {}
                  • [key: string]: any
                • Optional fromUserInfoAPI?: {}
                  • [key: string]: any
              • tenantId: string
              • thirdPartyId: string
              • thirdPartyUserId: string
              • userContext: any

            Returns Promise<{ createdNewRecipeUser: boolean; oAuthTokens: {}; rawUserInfoFromProvider: { fromIdTokenPayload?: {}; fromUserInfoAPI?: {} }; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • updatePasswordlessUser:function
          • updatePasswordlessUser(input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
          • Parameters

            • input: { email?: string | null; phoneNumber?: string | null; recipeUserId: RecipeUserId; userContext: any }
              • Optional email?: string | null
              • Optional phoneNumber?: string | null
              • recipeUserId: RecipeUserId
              • userContext: any

            Returns Promise<{ status: "OK" | "UNKNOWN_USER_ID_ERROR" | "EMAIL_ALREADY_EXISTS_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

        ThirdPartyAPIOptions: APIOptions

        Variables

        Error: typeof default = Wrapper.Error

        Functions

        • consumeCode(input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>
        • Parameters

          • input: { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: any; userInputCode: string } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: any }

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR" } | { status: "RESTART_FLOW_ERROR" }>

        • createCode(input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>
        • Parameters

          • input: { email: string } & { tenantId: string; userContext?: any; userInputCode?: string } & { phoneNumber: string } & { tenantId: string; userContext?: any; userInputCode?: string }

          Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string }>

        • createMagicLink(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<string>
        • createNewCodeForDevice(input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }): Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>
        • Parameters

          • input: { deviceId: string; tenantId: string; userContext?: any; userInputCode?: string }
            • deviceId: string
            • tenantId: string
            • Optional userContext?: any
            • Optional userInputCode?: string

          Returns Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR" }>

        • init(config: TypeInput): RecipeListFunction
        • listCodesByDeviceId(input: { deviceId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
        • listCodesByEmail(input: { email: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
        • listCodesByPhoneNumber(input: { phoneNumber: string; tenantId: string; userContext?: any }): Promise<DeviceType[]>
        • listCodesByPreAuthSessionId(input: { preAuthSessionId: string; tenantId: string; userContext?: any }): Promise<undefined | DeviceType>
        • Parameters

          • input: { preAuthSessionId: string; tenantId: string; userContext?: any }
            • preAuthSessionId: string
            • tenantId: string
            • Optional userContext?: any

          Returns Promise<undefined | DeviceType>

        • passwordlessSignInUp(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User }>
        • revokeAllCodes(input: { email: string; tenantId: string; userContext?: any } | { phoneNumber: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
        • revokeCode(input: { codeId: string; tenantId: string; userContext?: any }): Promise<{ status: "OK" }>
        • sendEmail(input: TypePasswordlessEmailDeliveryInput & { userContext?: any }): Promise<void>
        • sendSms(input: TypePasswordlessSmsDeliveryInput & { userContext?: any }): Promise<void>
        • thirdPartyGetProvider(tenantId: string, thirdPartyId: string, clientType: undefined | string, userContext?: any): Promise<undefined | TypeProvider>
        • thirdPartyManuallyCreateOrUpdateUser(tenantId: string, thirdPartyId: string, thirdPartyUserId: string, email: string, isVerified: boolean, userContext?: any): Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>
        • Parameters

          • tenantId: string
          • thirdPartyId: string
          • thirdPartyUserId: string
          • email: string
          • isVerified: boolean
          • userContext: any = {}

          Returns Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" } | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }>

        • updatePasswordlessUser(input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }): Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>
        • Parameters

          • input: { email?: null | string; phoneNumber?: null | string; recipeUserId: RecipeUserId; userContext?: any }
            • Optional email?: null | string
            • Optional phoneNumber?: null | string
            • recipeUserId: RecipeUserId
            • Optional userContext?: any

          Returns Promise<{ status: "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR" } | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_usermetadata.html b/docs/modules/recipe_usermetadata.html index 460d8dc81..af5635103 100644 --- a/docs/modules/recipe_usermetadata.html +++ b/docs/modules/recipe_usermetadata.html @@ -1,4 +1,4 @@ -recipe/usermetadata | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/usermetadata

        Index

        Type Aliases

        RecipeInterface: { clearUserMetadata: any; getUserMetadata: any; updateUserMetadata: any }

        Type declaration

        • clearUserMetadata:function
          • clearUserMetadata(input: { userContext: any; userId: string }): Promise<{ status: "OK" }>
        • getUserMetadata:function
          • getUserMetadata(input: { userContext: any; userId: string }): Promise<{ metadata: any; status: "OK" }>
        • updateUserMetadata:function
          • updateUserMetadata(input: { metadataUpdate: JSONObject; userContext: any; userId: string }): Promise<{ metadata: JSONObject; status: "OK" }>
          • +recipe/usermetadata | supertokens-node
            Options
            All
            • Public
            • Public/Protected
            • All
            Menu

            Module recipe/usermetadata

            Index

            Type Aliases

            RecipeInterface: { clearUserMetadata: any; getUserMetadata: any; updateUserMetadata: any }

            Type declaration

            • clearUserMetadata:function
              • clearUserMetadata(input: { userContext: any; userId: string }): Promise<{ status: "OK" }>
            • getUserMetadata:function
              • getUserMetadata(input: { userContext: any; userId: string }): Promise<{ metadata: any; status: "OK" }>
            • updateUserMetadata:function
              • updateUserMetadata(input: { metadataUpdate: JSONObject; userContext: any; userId: string }): Promise<{ metadata: JSONObject; status: "OK" }>
              • Updates the metadata object of the user by doing a shallow merge of the stored and the update JSONs and removing properties set to null on the root level of the update object. e.g.:

                @@ -7,4 +7,4 @@
              • update: { "notifications": { "sms": true }, "todos": null }
              • result: { "preferences": { "theme":"dark" }, "notifications": { "sms": true } }
              -

            Parameters

            • input: { metadataUpdate: JSONObject; userContext: any; userId: string }
              • metadataUpdate: JSONObject
              • userContext: any
              • userId: string

            Returns Promise<{ metadata: JSONObject; status: "OK" }>

        Functions

        • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
        • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
        • init(config?: TypeInput): RecipeListFunction
        • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

        Generated using TypeDoc

        \ No newline at end of file +

        Parameters

        Returns Promise<{ metadata: JSONObject; status: "OK" }>

        Functions

        • clearUserMetadata(userId: string, userContext?: any): Promise<{ status: "OK" }>
        • getUserMetadata(userId: string, userContext?: any): Promise<{ metadata: any; status: "OK" }>
        • init(config?: TypeInput): RecipeListFunction
        • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: any): Promise<{ metadata: JSONObject; status: "OK" }>

        Generated using TypeDoc

        \ No newline at end of file diff --git a/docs/modules/recipe_userroles.html b/docs/modules/recipe_userroles.html index 4d8f2d616..e60dbf53f 100644 --- a/docs/modules/recipe_userroles.html +++ b/docs/modules/recipe_userroles.html @@ -1 +1 @@ -recipe/userroles | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/userroles

        Index

        Type Aliases

        RecipeInterface: { addRoleToUser: any; createNewRoleOrAddPermissions: any; deleteRole: any; getAllRoles: any; getPermissionsForRole: any; getRolesForUser: any; getRolesThatHavePermission: any; getUsersThatHaveRole: any; removePermissionsFromRole: any; removeUserRole: any }

        Type declaration

        • addRoleToUser:function
          • addRoleToUser(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
          • Parameters

            • input: { role: string; tenantId: string; userContext: any; userId: string }
              • role: string
              • tenantId: string
              • userContext: any
              • userId: string

            Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        • createNewRoleOrAddPermissions:function
          • createNewRoleOrAddPermissions(input: { permissions: string[]; role: string; userContext: any }): Promise<{ createdNewRole: boolean; status: "OK" }>
          • Parameters

            • input: { permissions: string[]; role: string; userContext: any }
              • permissions: string[]
              • role: string
              • userContext: any

            Returns Promise<{ createdNewRole: boolean; status: "OK" }>

        • deleteRole:function
          • deleteRole(input: { role: string; userContext: any }): Promise<{ didRoleExist: boolean; status: "OK" }>
          • Parameters

            • input: { role: string; userContext: any }
              • role: string
              • userContext: any

            Returns Promise<{ didRoleExist: boolean; status: "OK" }>

        • getAllRoles:function
          • getAllRoles(input: { userContext: any }): Promise<{ roles: string[]; status: "OK" }>
        • getPermissionsForRole:function
          • getPermissionsForRole(input: { role: string; userContext: any }): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
          • Parameters

            • input: { role: string; userContext: any }
              • role: string
              • userContext: any

            Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        • getRolesForUser:function
          • getRolesForUser(input: { tenantId: string; userContext: any; userId: string }): Promise<{ roles: string[]; status: "OK" }>
          • Parameters

            • input: { tenantId: string; userContext: any; userId: string }
              • tenantId: string
              • userContext: any
              • userId: string

            Returns Promise<{ roles: string[]; status: "OK" }>

        • getRolesThatHavePermission:function
          • getRolesThatHavePermission(input: { permission: string; userContext: any }): Promise<{ roles: string[]; status: "OK" }>
          • Parameters

            • input: { permission: string; userContext: any }
              • permission: string
              • userContext: any

            Returns Promise<{ roles: string[]; status: "OK" }>

        • getUsersThatHaveRole:function
          • getUsersThatHaveRole(input: { role: string; tenantId: string; userContext: any }): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
          • Parameters

            • input: { role: string; tenantId: string; userContext: any }
              • role: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

        • removePermissionsFromRole:function
          • removePermissionsFromRole(input: { permissions: string[]; role: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
          • Parameters

            • input: { permissions: string[]; role: string; userContext: any }
              • permissions: string[]
              • role: string
              • userContext: any

            Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>

        • removeUserRole:function
          • removeUserRole(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
          • Parameters

            • input: { role: string; tenantId: string; userContext: any; userId: string }
              • role: string
              • tenantId: string
              • userContext: any
              • userId: string

            Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        Variables

        PermissionClaim: PermissionClaimClass = ...
        UserRoleClaim: UserRoleClaimClass = ...

        Functions

        • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
        • Parameters

          • tenantId: string
          • userId: string
          • role: string
          • Optional userContext: any

          Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
        • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
        • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
        • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
        • Parameters

          • role: string
          • Optional userContext: any

          Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
        • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
        • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
        • Parameters

          • tenantId: string
          • role: string
          • Optional userContext: any

          Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

        • init(config?: TypeInput): RecipeListFunction
        • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
        • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
        • Parameters

          • tenantId: string
          • userId: string
          • role: string
          • Optional userContext: any

          Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file +recipe/userroles | supertokens-node
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Module recipe/userroles

        Index

        Type Aliases

        RecipeInterface: { addRoleToUser: any; createNewRoleOrAddPermissions: any; deleteRole: any; getAllRoles: any; getPermissionsForRole: any; getRolesForUser: any; getRolesThatHavePermission: any; getUsersThatHaveRole: any; removePermissionsFromRole: any; removeUserRole: any }

        Type declaration

        • addRoleToUser:function
          • addRoleToUser(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
          • Parameters

            • input: { role: string; tenantId: string; userContext: any; userId: string }
              • role: string
              • tenantId: string
              • userContext: any
              • userId: string

            Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        • createNewRoleOrAddPermissions:function
          • createNewRoleOrAddPermissions(input: { permissions: string[]; role: string; userContext: any }): Promise<{ createdNewRole: boolean; status: "OK" }>
          • Parameters

            • input: { permissions: string[]; role: string; userContext: any }
              • permissions: string[]
              • role: string
              • userContext: any

            Returns Promise<{ createdNewRole: boolean; status: "OK" }>

        • deleteRole:function
          • deleteRole(input: { role: string; userContext: any }): Promise<{ didRoleExist: boolean; status: "OK" }>
          • Parameters

            • input: { role: string; userContext: any }
              • role: string
              • userContext: any

            Returns Promise<{ didRoleExist: boolean; status: "OK" }>

        • getAllRoles:function
          • getAllRoles(input: { userContext: any }): Promise<{ roles: string[]; status: "OK" }>
        • getPermissionsForRole:function
          • getPermissionsForRole(input: { role: string; userContext: any }): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
          • Parameters

            • input: { role: string; userContext: any }
              • role: string
              • userContext: any

            Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        • getRolesForUser:function
          • getRolesForUser(input: { tenantId: string; userContext: any; userId: string }): Promise<{ roles: string[]; status: "OK" }>
          • Parameters

            • input: { tenantId: string; userContext: any; userId: string }
              • tenantId: string
              • userContext: any
              • userId: string

            Returns Promise<{ roles: string[]; status: "OK" }>

        • getRolesThatHavePermission:function
          • getRolesThatHavePermission(input: { permission: string; userContext: any }): Promise<{ roles: string[]; status: "OK" }>
          • Parameters

            • input: { permission: string; userContext: any }
              • permission: string
              • userContext: any

            Returns Promise<{ roles: string[]; status: "OK" }>

        • getUsersThatHaveRole:function
          • getUsersThatHaveRole(input: { role: string; tenantId: string; userContext: any }): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
          • Parameters

            • input: { role: string; tenantId: string; userContext: any }
              • role: string
              • tenantId: string
              • userContext: any

            Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

        • removePermissionsFromRole:function
          • removePermissionsFromRole(input: { permissions: string[]; role: string; userContext: any }): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
          • Parameters

            • input: { permissions: string[]; role: string; userContext: any }
              • permissions: string[]
              • role: string
              • userContext: any

            Returns Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>

        • removeUserRole:function
          • removeUserRole(input: { role: string; tenantId: string; userContext: any; userId: string }): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
          • Parameters

            • input: { role: string; tenantId: string; userContext: any; userId: string }
              • role: string
              • tenantId: string
              • userContext: any
              • userId: string

            Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        Variables

        PermissionClaim: PermissionClaimClass = ...
        UserRoleClaim: UserRoleClaimClass = ...

        Functions

        • addRoleToUser(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
        • Parameters

          • tenantId: string
          • userId: string
          • role: string
          • Optional userContext: any

          Returns Promise<{ didUserAlreadyHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        • createNewRoleOrAddPermissions(role: string, permissions: string[], userContext?: any): Promise<{ createdNewRole: boolean; status: "OK" }>
        • deleteRole(role: string, userContext?: any): Promise<{ didRoleExist: boolean; status: "OK" }>
        • getAllRoles(userContext?: any): Promise<{ roles: string[]; status: "OK" }>
        • getPermissionsForRole(role: string, userContext?: any): Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
        • Parameters

          • role: string
          • Optional userContext: any

          Returns Promise<{ permissions: string[]; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        • getRolesForUser(tenantId: string, userId: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
        • getRolesThatHavePermission(permission: string, userContext?: any): Promise<{ roles: string[]; status: "OK" }>
        • getUsersThatHaveRole(tenantId: string, role: string, userContext?: any): Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>
        • Parameters

          • tenantId: string
          • role: string
          • Optional userContext: any

          Returns Promise<{ status: "OK"; users: string[] } | { status: "UNKNOWN_ROLE_ERROR" }>

        • init(config?: TypeInput): RecipeListFunction
        • removePermissionsFromRole(role: string, permissions: string[], userContext?: any): Promise<{ status: "OK" | "UNKNOWN_ROLE_ERROR" }>
        • removeUserRole(tenantId: string, userId: string, role: string, userContext?: any): Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>
        • Parameters

          • tenantId: string
          • userId: string
          • role: string
          • Optional userContext: any

          Returns Promise<{ didUserHaveRole: boolean; status: "OK" } | { status: "UNKNOWN_ROLE_ERROR" }>

        Generated using TypeDoc

        \ No newline at end of file