gbox-sdk
    Preparing search index...

    Class GboxClient

    API Client for interfacing with the Gbox Client API.

    Index

    Constructors

    Properties

    _options: ClientOptions
    apiKey: string
    baseURL: string
    fetchOptions: undefined | MergedRequestInit
    idempotencyHeader?: string
    logger: undefined | Logger
    logLevel: undefined | LogLevel
    maxRetries: number
    timeout: number
    v1: GboxClient.V1 = ...
    APIConnectionError: typeof APIConnectionError = Errors.APIConnectionError
    APIConnectionTimeoutError: typeof APIConnectionTimeoutError = Errors.APIConnectionTimeoutError
    APIError: typeof APIError = Errors.APIError
    APIUserAbortError: typeof APIUserAbortError = Errors.APIUserAbortError
    AuthenticationError: typeof AuthenticationError = Errors.AuthenticationError
    BadRequestError: typeof BadRequestError = Errors.BadRequestError
    ConflictError: typeof ConflictError = Errors.ConflictError
    DEFAULT_TIMEOUT: number = 60000
    GboxClient: typeof GboxClient = ...
    GboxClientError: typeof GboxClientError = Errors.GboxClientError
    InternalServerError: typeof InternalServerError = Errors.InternalServerError
    NotFoundError: typeof NotFoundError = Errors.NotFoundError
    PermissionDeniedError: typeof PermissionDeniedError = Errors.PermissionDeniedError
    RateLimitError: typeof RateLimitError = Errors.RateLimitError
    toFile: (
        value: ToFileInput | PromiseLike<ToFileInput>,
        name?: null | string,
        options?: FilePropertyBag,
    ) => Promise<File> = Uploads.toFile

    Type declaration

      • (
            value: ToFileInput | PromiseLike<ToFileInput>,
            name?: null | string,
            options?: FilePropertyBag,
        ): Promise<File>
      • Helper for creating a File to pass to an SDK upload method from a variety of different data formats

        Parameters

        • value: ToFileInput | PromiseLike<ToFileInput>

          the raw content of the file. Can be an Uploadable, BlobLikePart, or AsyncIterable of BlobLikeParts

        • Optionalname: null | string

          the name of the file. If omitted, toFile will try to determine a file name from bits if possible

        • Optionaloptions: FilePropertyBag

          additional properties

          • type

            the MIME type of the content

          • lastModified

            the last modified timestamp

        Returns Promise<File>

        a File with the given properties

    UnprocessableEntityError: typeof UnprocessableEntityError = Errors.UnprocessableEntityError

    Methods

    • Parameters

      • opts: FinalRequestOptions

      Returns undefined | NullableHeaders

    • Parameters

      • inputOptions: FinalRequestOptions
      • __namedParameters: { retryCount?: number } = {}

      Returns { req: FinalizedRequestInit; timeout: number; url: string }

    • Parameters

      • path: string
      • query: undefined | null | Record<string, unknown>
      • OptionaldefaultBaseURL: string

      Returns string

    • Returns undefined | Record<string, undefined | string>

    • Type Parameters

      • Rsp

      Parameters

      • path: string
      • Optionalopts: PromiseOrValue<RequestOptions>

      Returns APIPromise<Rsp>

    • Parameters

      • url: _RequestInfo
      • init: undefined | RequestInit
      • ms: number
      • controller: AbortController

      Returns Promise<Response>

    • Parameters

      • status: number
      • error: Object
      • message: undefined | string
      • headers: Headers

      Returns APIError

    post

    • Used as a callback for mutating the given FinalRequestOptions object.

      Parameters

      • options: FinalRequestOptions

      Returns Promise<void>

    • Used as a callback for mutating the given RequestInit object.

      This is useful for cases where you want to add certain headers based off of the request properties, e.g. method or url.

      Parameters

      • request: RequestInit
      • __namedParameters: { options: FinalRequestOptions; url: string }

      Returns Promise<void>

    • Type Parameters

      • Rsp

      Parameters

      • options: PromiseOrValue<FinalRequestOptions>
      • remainingRetries: null | number = null

      Returns APIPromise<Rsp>

    • Parameters

      • query: Record<string, unknown>

      Returns string

    • Parameters

      • __namedParameters: NullableHeaders

      Returns void

    • Create a new client instance re-using the same options given to the current client with optional overriding.

      Parameters

      Returns this