Auth0 Node.js SDK - v5.0.0
    Preparing search index...

    Class HttpResponsePromise<T>

    A promise that returns the parsed response and lets you retrieve the raw response too.

    Type Parameters

    • T

    Hierarchy

    • Promise<T>
      • HttpResponsePromise
    Index

    Methods

    • Creates an HttpResponsePromise from a function that returns a promise.

      Type Parameters

      Parameters

      • fn: F

        A function that returns a promise resolving to a WithRawResponse object.

      • ...args: Parameters<F>

        Arguments to pass to the function.

      Returns HttpResponsePromise<T>

      An HttpResponsePromise instance.

    • Creates a function that returns an HttpResponsePromise from a function that returns a promise.

      Type Parameters

      • F extends (...args: never[]) => Promise<WithRawResponse<T>>
      • T = Awaited<ReturnType<F>>["data"]

      Parameters

      • fn: F

        A function that returns a promise resolving to a WithRawResponse object.

      Returns (...args: Parameters<F>) => HttpResponsePromise<T>

      A function that returns an HttpResponsePromise instance.

    • Creates an HttpResponsePromise from an executor function.

      Type Parameters

      • T

      Parameters

      • executor: (
            resolve: (value: WithRawResponse<T>) => void,
            reject: (reason?: unknown) => void,
        ) => void

        A function that takes resolve and reject callbacks to create a promise.

      Returns HttpResponsePromise<T>

      An HttpResponsePromise instance.

    • Type Parameters

      • TResult = never

      Parameters

      • Optionalonrejected: null | ((reason: unknown) => TResult | PromiseLike<TResult>)

      Returns Promise<T | TResult>

    • Parameters

      • Optionalonfinally: null | (() => void)

      Returns Promise<T>

    • Retrieves the data and raw response.

      Returns Promise<WithRawResponse<T>>

      A promise resolving to a WithRawResponse object.