@flatfile/safe-api
Version:
Flatfile Safe API client with streaming capabilities
71 lines (70 loc) • 2.92 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
const api_1 = require("@flatfile/api");
const records_helper_1 = require("./helpers/records.helper");
const files_helper_1 = require("./helpers/files.helper");
const jobs_helper_1 = require("./helpers/jobs.helper");
const sheets_helper_1 = require("./helpers/sheets.helper");
const workbooks_helper_1 = require("./helpers/workbooks.helper");
const spaces_helper_1 = require("./helpers/spaces.helper");
const config_1 = require("./utils/config");
// Re-export everything from the original API
__exportStar(require("@flatfile/api"), exports);
__exportStar(require("@flatfile/records"), exports);
__exportStar(require("./streaming/records"), exports);
__exportStar(require("./streaming/workbooks"), exports);
__exportStar(require("./streaming/jobs"), exports);
__exportStar(require("./streaming/sheets"), exports);
__exportStar(require("./streaming/files"), exports);
__exportStar(require("./streaming/spaces"), exports);
__exportStar(require("./helpers/records.helper"), exports);
__exportStar(require("./helpers/workbooks.helper"), exports);
__exportStar(require("./helpers/jobs.helper"), exports);
__exportStar(require("./helpers/sheets.helper"), exports);
__exportStar(require("./helpers/files.helper"), exports);
__exportStar(require("./helpers/spaces.helper"), exports);
// Remove direct config export
// export { config } from './config';
// Create a class that extends the original API client
class EnhancedApi extends api_1.FlatfileClient {
constructor() {
super(...arguments);
this._config = config_1.config;
}
get config() {
return this._config;
}
get records() {
return (0, records_helper_1.getRecordsExtension)(this);
}
get files() {
return (0, files_helper_1.getFilesExtension)(this);
}
get jobs() {
return (0, jobs_helper_1.getJobsExtension)(this);
}
get sheets() {
return (0, sheets_helper_1.getSheetsExtension)(this);
}
get workbooks() {
return (0, workbooks_helper_1.getWorkbooksExtension)(this);
}
get spaces() {
return (0, spaces_helper_1.getSpacesExtension)(this);
}
}
exports.default = new EnhancedApi();