Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Rodonaves

Hierarchy

  • Rodonaves

Index

Constructors

constructor

  • new Rodonaves(username: string, password: string, mode?: Mode, timeout?: number): Rodonaves
  • Parameters

    • username: string

      Rodonaves username for Auth

    • password: string

      Rodonaves password for Auth

    • Default value mode: Mode = "dev"

      Mode of the request. Can be dev or prod

    • Default value timeout: number = 1000

      Timeout of the request in ms

    Returns Rodonaves

Properties

mode

mode: Mode

password

password: string

timeout

timeout: number

token

token: string

username

username: string

Methods

auth

  • auth(): Promise<boolean>

fetch

  • fetch<T>(url: string, method?: Method, params?: AxiosRequestConfig["params"], data?: AxiosRequestConfig["data"], contentType?: string): Promise<T>
  • 📨 Fetch in the RTE API

    Type parameters

    • T

    Parameters

    • url: string

      URL. Route to the fetch. can be /test

    • Default value method: Method = "GET"

      Method. Can be GET*. *POST...

    • Default value params: AxiosRequestConfig["params"] = {}

      Querystring params. Its most used in GET requests

    • Default value data: AxiosRequestConfig["data"] = {}

      Data. Use for POST requests

    • Default value contentType: string = "application/json"

      Type of data content. Use for POST requests

    Returns Promise<T>

getCityByZipCode

getDeliveryTime

  • getDeliveryTime(originZipCode: string, destinationZipCode: string): Promise<number>
  • 📅 Get Delivery Time

    Parameters

    • originZipCode: string
    • destinationZipCode: string

    Returns Promise<number>

Private sanitizePostalCode

  • sanitizePostalCode(postalCode: string): string

simulateQuote

  • 💵 Get Quote for Shipping

    Parameters

    • originZipCode: string

      Origin ZipCode

    • destinationZipCode: string

      Destination ZipCode

    • packs: RodonavesPack[]

      A list of boxes for shipping

    • invoiceValue: number

      Total money value of the items in shipment

    • destinationTaxId: string

      CPF/CNPJ of the destination

    Returns Promise<RodonavesSimulateQuoteResponse>

Generated using TypeDoc