UNPKG

jsc8

Version:

The official Macrometa JavaScript SDK.

43 lines 1.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Connectors = void 0; const connection_1 = require("./connection"); class Connectors { constructor(config) { this._connection = new connection_1.Connection(config); } // body: type is `any` since users can define their own connectors // absolutePath: true is required since this endpoint is not prefixed with /_fabric getAvailableConnectors() { return this._connection.request({ method: "GET", path: "/_api/connectors", absolutePath: true, }, (res) => res.body); } getConnectorDetails(connectorName) { return this._connection.request({ method: "GET", path: `/_api/connectors/${connectorName}`, absolutePath: true, }, (res) => res.body); } retrieveConnectorSchema(connectorName, body) { return this._connection.request({ method: "POST", path: `/_api/connectors/${connectorName}/schema`, body, absolutePath: true, }, (res) => res.body); } retrieveConnectorSampleData(connectorName, body) { return this._connection.request({ method: "POST", path: `/_api/connectors/${connectorName}/sample`, body, absolutePath: true, }, (res) => res.body); } } exports.Connectors = Connectors; //# sourceMappingURL=connectors.js.map