Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AsyncAirtable

The main AsyncAirtable class.

Hierarchy

  • AsyncAirtable

Index

Constructors

constructor

  • Creates a new instance of the AsyncAirtable library.

    Parameters

    • apiKey: string

      The API Key from AirTable

    • base: string

      The base id from AirTable

    • Optional config: Config

      The config to use for this instance of AsyncAirtable

    Returns AsyncAirtable

Properties

apiKey

apiKey: string

The API Key from AirTable

base

base: string

The base id from AirTable

maxRetry

maxRetry: number
default=60000

The maxmium amount of time before the library will stop retrying and timeout when rate limited

retryOnRateLimit

retryOnRateLimit: boolean
default=true

This decides whether or not the library will handle retrying a request when rate limited

retryTimeout

retryTimeout: number
default=5000

The starting timeout for the retry. This will get 50% larger with each try until you hit the maxRetry amount

Methods

bulkCreate

  • Creates multiple new records on the specified table.

    async

    Parameters

    • table: string

      Table name

    • records: Fields[]

      An array of Record objects

    • Optional typecast: Typecast

      Used for allowing the ability to add new selections for Select and Multiselect fields.

    Returns Promise<AirtableRecord[]>

bulkDelete

  • Deletes multiple records from the specified table

    async

    Parameters

    • table: string

      Table name

    • ids: string[]

      Array of Airtable record IDs

    Returns Promise<DeleteResponse[]>

bulkUpdate

  • Updates multiple records on the specified table

    async

    Parameters

    • table: string

      Table name

    • records: AirtableUpdateRecord[]

      An array of Record objects

    • Optional opts: updateOpts

      An object with options for your update statement

    Returns Promise<AirtableRecord[]>

createRecord

  • Creates a new record on the specified table.

    async

    Parameters

    • table: string

      Table name

    • record: Fields

      Record object, used to structure data for insert

    • Optional typecast: Typecast

      Used for allowing the ability to add new selections for Select and Multiselect fields.

    Returns Promise<AirtableRecord>

deleteRecord

  • Deletes a record from the specified table.

    async

    Parameters

    • table: string

      Table name

    • id: string

      Airtable record ID

    Returns Promise<DeleteResponse>

find

  • Finds a record on the specified table.

    async

    Parameters

    • table: string

      Table name

    • id: string

      Airtable record ID

    Returns Promise<AirtableRecord>

select

  • Select record(s) from the specified table.

    async

    Parameters

    • table: string

      Table name

    • Optional options: SelectOptions

      Options object, used to filter records

    • Optional page: undefined | number

      Used to get a specific page of records

    Returns Promise<AirtableRecord[]>

updateRecord

  • Updates a record on the specified table.

    async

    Parameters

    • table: string

      Table name

    • record: AirtableUpdateRecord

      Record object, used to update data within a specific record

    • Optional opts: updateOpts

      An object with options for your update statement

    Returns Promise<AirtableRecord>

upsertRecord

  • Checks if a record exists, and if it does updates it, if not creates a new record.

    async

    Parameters

    • table: string

      Table name

    • filterString: string

      The filter formula string used to check for a record

    • record: Fields

      Record object used to either update or create a record

    • Optional opts: updateOpts

      An object with options for your update statement

    Returns Promise<AirtableRecord>

Generated using TypeDoc