UNPKG

@qualifyze/airtable

Version:
26 lines 979 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Base = void 0; const official_client_wrapper_1 = require("./official-client-wrapper"); const table_1 = require("./table"); class Base { constructor(endpoint) { this.endpoint = endpoint; } static fromOfficialClient(airtable, baseId) { return new this(new official_client_wrapper_1.OfficialClientWrapper(airtable.base(baseId))); } async runAction(method, { responseValidation, ...options }) { const result = await this.endpoint.runAction(method, options); if (!responseValidation.isValid(result)) { throw (responseValidation.getValidationError() || new Error("Encountered unknown error while validating the response")); } return result; } table(tableName, validator) { return new table_1.Table(this, tableName, validator); } } exports.Base = Base; //# sourceMappingURL=base.js.map