Skip to content

DataConnectors

Overview

Data connector endpoints for various integrations

Available Operations

createConnectSession

Create a connection session for OAuth flow (Gmail, Google Sheets, Google Drive) or save connection with credentials (SQL, MongoDB).

Example Usage

import { Fermisdk } from "fermisdk";

const fermisdk = new Fermisdk({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await fermisdk.dataConnectors.createConnectSession({});

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FermisdkCore } from "fermisdk/core.js";
import { dataConnectorsCreateConnectSession } from "fermisdk/funcs/dataConnectorsCreateConnectSession.js";

// Use `FermisdkCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fermisdk = new FermisdkCore({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await dataConnectorsCreateConnectSession(fermisdk, {});
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("dataConnectorsCreateConnectSession failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ConnectSessionRequest :heavy_check_mark: The request object to use for the request.
options RequestOptions :heavy_minus_sign: Used to set various options for making HTTP requests.
options.fetchOptions RequestInit :heavy_minus_sign: 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.
options.retries RetryConfig :heavy_minus_sign: Enables retrying HTTP requests under certain failure conditions.

Response

Promise\<models.ConnectSessionResponse>

Errors

Error Type Status Code Content Type
errors.ErrorT 400 application/json
errors.ErrorT 500 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

listConnections

List all connections for a specific provider type.

Example Usage

import { Fermisdk } from "fermisdk";

const fermisdk = new Fermisdk({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await fermisdk.dataConnectors.listConnections({
    providerConfigKey: "mongodb",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FermisdkCore } from "fermisdk/core.js";
import { dataConnectorsListConnections } from "fermisdk/funcs/dataConnectorsListConnections.js";

// Use `FermisdkCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fermisdk = new FermisdkCore({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await dataConnectorsListConnections(fermisdk, {
    providerConfigKey: "mongodb",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("dataConnectorsListConnections failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.ListConnectionsRequest :heavy_check_mark: The request object to use for the request.
options RequestOptions :heavy_minus_sign: Used to set various options for making HTTP requests.
options.fetchOptions RequestInit :heavy_minus_sign: 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.
options.retries RetryConfig :heavy_minus_sign: Enables retrying HTTP requests under certain failure conditions.

Response

Promise\<models.ConnectionList>

Errors

Error Type Status Code Content Type
errors.ErrorT 404 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

getConnection

Get detailed information about a specific connection.

Example Usage

import { Fermisdk } from "fermisdk";

const fermisdk = new Fermisdk({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await fermisdk.dataConnectors.getConnection({
    connectionId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FermisdkCore } from "fermisdk/core.js";
import { dataConnectorsGetConnection } from "fermisdk/funcs/dataConnectorsGetConnection.js";

// Use `FermisdkCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fermisdk = new FermisdkCore({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await dataConnectorsGetConnection(fermisdk, {
    connectionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("dataConnectorsGetConnection failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetConnectionRequest :heavy_check_mark: The request object to use for the request.
options RequestOptions :heavy_minus_sign: Used to set various options for making HTTP requests.
options.fetchOptions RequestInit :heavy_minus_sign: 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.
options.retries RetryConfig :heavy_minus_sign: Enables retrying HTTP requests under certain failure conditions.

Response

Promise\<models.Connection>

Errors

Error Type Status Code Content Type
errors.ErrorT 404 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

deleteConnection

Remove a connection.

Example Usage

import { Fermisdk } from "fermisdk";

const fermisdk = new Fermisdk({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await fermisdk.dataConnectors.deleteConnection({
    connectionId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FermisdkCore } from "fermisdk/core.js";
import { dataConnectorsDeleteConnection } from "fermisdk/funcs/dataConnectorsDeleteConnection.js";

// Use `FermisdkCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fermisdk = new FermisdkCore({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await dataConnectorsDeleteConnection(fermisdk, {
    connectionId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("dataConnectorsDeleteConnection failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.DeleteConnectionRequest :heavy_check_mark: The request object to use for the request.
options RequestOptions :heavy_minus_sign: Used to set various options for making HTTP requests.
options.fetchOptions RequestInit :heavy_minus_sign: 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.
options.retries RetryConfig :heavy_minus_sign: Enables retrying HTTP requests under certain failure conditions.

Response

Promise\<operations.DeleteConnectionResponse>

Errors

Error Type Status Code Content Type
errors.ErrorT 404 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

getConnectionMetadata

Get connection metadata (files, sheets, etc.).

Example Usage

import { Fermisdk } from "fermisdk";

const fermisdk = new Fermisdk({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await fermisdk.dataConnectors.getConnectionMetadata({
    connectionId: "<id>",
    providerConfigKey: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FermisdkCore } from "fermisdk/core.js";
import { dataConnectorsGetConnectionMetadata } from "fermisdk/funcs/dataConnectorsGetConnectionMetadata.js";

// Use `FermisdkCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fermisdk = new FermisdkCore({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await dataConnectorsGetConnectionMetadata(fermisdk, {
    connectionId: "<id>",
    providerConfigKey: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("dataConnectorsGetConnectionMetadata failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.GetConnectionMetadataRequest :heavy_check_mark: The request object to use for the request.
options RequestOptions :heavy_minus_sign: Used to set various options for making HTTP requests.
options.fetchOptions RequestInit :heavy_minus_sign: 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.
options.retries RetryConfig :heavy_minus_sign: Enables retrying HTTP requests under certain failure conditions.

Response

Promise\<models.ConnectionMetadataResponse>

Errors

Error Type Status Code Content Type
errors.ErrorT 404 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

updateConnectionMetadata

Update connection metadata (files, sheets, connection details, etc.).

Example Usage

import { Fermisdk } from "fermisdk";

const fermisdk = new Fermisdk({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await fermisdk.dataConnectors.updateConnectionMetadata({
    connectionId: "<id>",
    providerConfigKey: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FermisdkCore } from "fermisdk/core.js";
import { dataConnectorsUpdateConnectionMetadata } from "fermisdk/funcs/dataConnectorsUpdateConnectionMetadata.js";

// Use `FermisdkCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fermisdk = new FermisdkCore({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await dataConnectorsUpdateConnectionMetadata(fermisdk, {
    connectionId: "<id>",
    providerConfigKey: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("dataConnectorsUpdateConnectionMetadata failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.ConnectionMetadataRequest :heavy_check_mark: The request object to use for the request.
options RequestOptions :heavy_minus_sign: Used to set various options for making HTTP requests.
options.fetchOptions RequestInit :heavy_minus_sign: 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.
options.retries RetryConfig :heavy_minus_sign: Enables retrying HTTP requests under certain failure conditions.

Response

Promise\<models.ConnectionMetadataResponse>

Errors

Error Type Status Code Content Type
errors.ErrorT 400 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

uploadDocuments

Upload one or more document files.

Example Usage

import { Fermisdk } from "fermisdk";

const fermisdk = new Fermisdk({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await fermisdk.dataConnectors.uploadDocuments({
    files: [],
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FermisdkCore } from "fermisdk/core.js";
import { dataConnectorsUploadDocuments } from "fermisdk/funcs/dataConnectorsUploadDocuments.js";

// Use `FermisdkCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fermisdk = new FermisdkCore({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await dataConnectorsUploadDocuments(fermisdk, {
    files: [],
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("dataConnectorsUploadDocuments failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.UploadDocumentsRequest :heavy_check_mark: The request object to use for the request.
options RequestOptions :heavy_minus_sign: Used to set various options for making HTTP requests.
options.fetchOptions RequestInit :heavy_minus_sign: 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.
options.retries RetryConfig :heavy_minus_sign: Enables retrying HTTP requests under certain failure conditions.

Response

Promise\<models.DocumentUploadResponse>

Errors

Error Type Status Code Content Type
errors.ErrorT 400 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

testDatabaseConnection

Test a database connection before saving.

Example Usage

import { Fermisdk } from "fermisdk";

const fermisdk = new Fermisdk({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await fermisdk.dataConnectors.testDatabaseConnection({
    databaseType: "mysql",
    connection: {
      host: "distant-event.com",
      port: 872827,
      database: "<value>",
      username: "Sandrine.Cassin",
      password: "a77KLKcXHvHrTua",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FermisdkCore } from "fermisdk/core.js";
import { dataConnectorsTestDatabaseConnection } from "fermisdk/funcs/dataConnectorsTestDatabaseConnection.js";

// Use `FermisdkCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fermisdk = new FermisdkCore({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await dataConnectorsTestDatabaseConnection(fermisdk, {
    databaseType: "mysql",
    connection: {
      host: "distant-event.com",
      port: 872827,
      database: "<value>",
      username: "Sandrine.Cassin",
      password: "a77KLKcXHvHrTua",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("dataConnectorsTestDatabaseConnection failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.TestConnectionRequest :heavy_check_mark: The request object to use for the request.
options RequestOptions :heavy_minus_sign: Used to set various options for making HTTP requests.
options.fetchOptions RequestInit :heavy_minus_sign: 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.
options.retries RetryConfig :heavy_minus_sign: Enables retrying HTTP requests under certain failure conditions.

Response

Promise\<models.TestConnectionResponse>

Errors

Error Type Status Code Content Type
errors.ErrorT 400 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

getDatabaseMetadata

Test MongoDB connection and fetch available databases.

Example Usage

import { Fermisdk } from "fermisdk";

const fermisdk = new Fermisdk({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await fermisdk.dataConnectors.getDatabaseMetadata({
    connectionString: "<value>",
    databaseType: "mongodb",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FermisdkCore } from "fermisdk/core.js";
import { dataConnectorsGetDatabaseMetadata } from "fermisdk/funcs/dataConnectorsGetDatabaseMetadata.js";

// Use `FermisdkCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fermisdk = new FermisdkCore({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await dataConnectorsGetDatabaseMetadata(fermisdk, {
    connectionString: "<value>",
    databaseType: "mongodb",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("dataConnectorsGetDatabaseMetadata failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.DatabaseMetadataRequest :heavy_check_mark: The request object to use for the request.
options RequestOptions :heavy_minus_sign: Used to set various options for making HTTP requests.
options.fetchOptions RequestInit :heavy_minus_sign: 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.
options.retries RetryConfig :heavy_minus_sign: Enables retrying HTTP requests under certain failure conditions.

Response

Promise\<models.DatabaseMetadataResponse>

Errors

Error Type Status Code Content Type
errors.ErrorT 400 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

enqueueSync

Start data synchronization for a connection.

Example Usage

import { Fermisdk } from "fermisdk";

const fermisdk = new Fermisdk({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const result = await fermisdk.dataConnectors.enqueueSync({
    connectionId: "<id>",
    providerKey: "<value>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { FermisdkCore } from "fermisdk/core.js";
import { dataConnectorsEnqueueSync } from "fermisdk/funcs/dataConnectorsEnqueueSync.js";

// Use `FermisdkCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const fermisdk = new FermisdkCore({
  bearerAuth: process.env["FERMISDK_BEARER_AUTH"] ?? "",
});

async function run() {
  const res = await dataConnectorsEnqueueSync(fermisdk, {
    connectionId: "<id>",
    providerKey: "<value>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("dataConnectorsEnqueueSync failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request models.SyncEnqueueRequest :heavy_check_mark: The request object to use for the request.
options RequestOptions :heavy_minus_sign: Used to set various options for making HTTP requests.
options.fetchOptions RequestInit :heavy_minus_sign: 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.
options.retries RetryConfig :heavy_minus_sign: Enables retrying HTTP requests under certain failure conditions.

Response

Promise\<models.SyncEnqueueResponse>

Errors

Error Type Status Code Content Type
errors.ErrorT 400 application/json
errors.FermisdkDefaultError 4XX, 5XX */*