Skip to content

Latest commit

 

History

History
274 lines (185 loc) · 27.7 KB

README.md

File metadata and controls

274 lines (185 loc) · 27.7 KB

Sync

(sync)

Available Operations

  • getRecord - Returns data synced with Nango Sync, allowing for advanced filtering, sorting, and pagination options.
  • createTrigger - Triggers an additional, one-off execution of specified sync(s) for a given connection or all applicable connections if no connection is specified.
  • start - Starts the continuous execution of specified sync(s) for a given connection or all applicable connections if no connection is specified.
  • pause - Pauses the continuous execution of specified sync(s) for a given connection or all applicable connections if no connection is specified.
  • getStatus - Get the status of specified sync(s) for a given connection or all applicable connections if no connection is specified.
  • updateFrequency - Override a sync's default frequency for a specific connection or revert to the default frequency.

getRecord

Returns data synced with Nango Sync

Example Usage

import { Nango } from "@speakeasy-sdks/nango";

const nango = new Nango();

async function run() {
  const result = await nango.sync.getRecord({
    model: "Expedition",
    connectionId: "<value>",
    providerConfigKey: "<value>",
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.GetSyncRecordRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<components.GetSyncRecordResponse[]>

Errors

Error Object Status Code Content Type
errors.Response400 400 application/json
errors.SDKError 4xx-5xx /

createTrigger

Triggers an additional, one-off execution of specified sync(s) (for a given connection or all applicable connections if no connection is specified).

Example Usage

import { Nango } from "@speakeasy-sdks/nango";

const nango = new Nango();

async function run() {
  await nango.sync.createTrigger({
    providerConfigKey: "<value>",
    syncs: [
      "<value>",
    ],
  });

  
}

run();

Parameters

Parameter Type Required Description
request components.CreateSyncTriggerRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<void>

Errors

Error Object Status Code Content Type
errors.Response400 400 application/json
errors.SDKError 4xx-5xx /

start

Starts the continuous execution of specified sync(s) (for a given connection or all applicable connections if no connection is specified).

Example Usage

import { Nango } from "@speakeasy-sdks/nango";

const nango = new Nango();

async function run() {
  await nango.sync.start({
    providerConfigKey: "<value>",
    syncs: [
      "<value>",
    ],
  });

  
}

run();

Parameters

Parameter Type Required Description
request components.CreateSyncStartRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<void>

Errors

Error Object Status Code Content Type
errors.Response400 400 application/json
errors.SDKError 4xx-5xx /

pause

Pauses the continuous execution of specified sync(s) (for a given connection or all applicable connections if no connection is specified).

Example Usage

import { Nango } from "@speakeasy-sdks/nango";

const nango = new Nango();

async function run() {
  await nango.sync.pause({
    providerConfigKey: "<value>",
    syncs: [
      "<value>",
    ],
  });

  
}

run();

Parameters

Parameter Type Required Description
request components.CreateSyncPauseRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<void>

Errors

Error Object Status Code Content Type
errors.Response400 400 application/json
errors.SDKError 4xx-5xx /

getStatus

Get the status of specified sync(s) (for a given connection or all applicable connections if no connection is specified)

Example Usage

import { Nango } from "@speakeasy-sdks/nango";

const nango = new Nango();

async function run() {
  const result = await nango.sync.getStatus("<value>", "<value>", "<value>");

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
providerConfigKey string ✔️ The ID of the integration you established within Nango
syncs string ✔️ The name of the syncs you want to fetch a status for. Pass in "*" to return all syncs per the integration
connectionId string The ID of the connection. If omitted, all connections will be surfaced.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<components.GetSyncStatusResponse>

Errors

Error Object Status Code Content Type
errors.Response400 400 application/json
errors.SDKError 4xx-5xx /

updateFrequency

Override a sync's default frequency for a specific connection, or revert to the default frequency.

Example Usage

import { Nango } from "@speakeasy-sdks/nango";

const nango = new Nango();

async function run() {
  const result = await nango.sync.updateFrequency({
    providerConfigKey: "<value>",
    connectionId: "<value>",
    syncName: "<value>",
    frequency: "<value>",
  });

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request components.UpdateConnectionFrequencyRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.

Response

Promise<components.UpdateConnectionFrequencyResponse>

Errors

Error Object Status Code Content Type
errors.Response400 400 application/json
errors.SDKError 4xx-5xx /