Options
All
  • Public
  • Public/Protected
  • All
Menu

Class to handle requests to the Interfolio API. Generally not called directly but used by API functions to actually make the call

Hierarchy

  • ApiRequest

Index

Constructors

constructor

  • Initialize the request object with the necessary config options

    Parameters

    • config: ApiConfig

      The API Configuration settings (keys and base urls)

    Returns ApiRequest

Properties

errors

errors: { error: any; headers: any; method: undefined | "GET" | "POST" | "PUT" | "PATCH" | "HEAD" | "DELETE" | "OPTIONS" | "TRACE" | "get" | "post" | "put" | "patch" | "head" | "delete" | "options" | "trace"; url: undefined | string | URL }[]

errors which were encountered

maxRetries

maxRetries: number = 2

number of retries that should be attempted when encountering an error

outputErrors

outputErrors: boolean = false

Flag indicating if upon an error the request and error should be output with console.error

outputRequestOptions

outputRequestOptions: boolean = false

Flag indicating if options sent to server should be output with console.log

outputResponse

outputResponse: boolean = false

Flag indicating if the response should be output

Methods

executeFileStream

  • executeFileStream(__namedParameters: RestRequest, filePath: string): Promise<any>

executeGraphQl

  • executeGraphQl(gqlRequest: GraphQlRequest, retryNum?: number): Promise<any>
  • Execute an API request against the GraphQL (caas-box) data endpoint

    Parameters

    • gqlRequest: GraphQlRequest
    • retryNum: number = 0

      The number of retries that this request is currently attempting

    Returns Promise<any>

executeRest

  • executeRest(__namedParameters: RestRequest, retryNum?: number): Promise<any>
  • Execute a request against the REST (logic.interfolio.com) endpoint

    Parameters

    • __namedParameters: RestRequest
    • retryNum: number = 0

      The number of retries that this request is currently attempting

    Returns Promise<any>

Static isJson

  • isJson(str: string): boolean
  • Tests if a string is parsable JSON

    Parameters

    • str: string

      the string to test for json parseability

    Returns boolean

Static objectToFormData

  • objectToFormData(o: {}, prefix?: string): string
  • Converts a javascript object into form data

    Parameters

    • o: {}

      object (the object)

      • [key: string]: any
    • prefix: string = ''

      string (prefex to append to parameter names)

    Returns string

Static rfc3986EncodeURIComponent

  • rfc3986EncodeURIComponent(str: string): string
  • encode a string for url/form values

    Parameters

    • str: string

      The string to encode

    Returns string

    The encoded string

Legend

  • Class
  • Constructor
  • Property
  • Method
  • Variable
  • Function
  • Type alias
  • Static method

Generated using TypeDoc