@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
55 lines (54 loc) • 1.55 kB
JavaScript
import { AirtableAPIV4Api } from '../generated';
export class Airtable {
constructor(config) {
const api = new AirtableAPIV4Api(config);
this.schema = new AirtableSchema(api);
this.tables = new AirtableTables(api);
}
}
export class AirtableSchema {
constructor(api) {
this.api = api;
}
/**
* get - get /v4/airtable/schema
*/
get() {
return this.api.v4AirtableControllerGetSchemaV4({});
}
}
export class AirtableTables {
constructor(api) {
this.api = api;
this.records = new AirtableTablesRecords(api);
}
}
export class AirtableTablesRecords {
constructor(api) {
this.api = api;
this.comments = new AirtableTablesRecordsComments(api);
}
/**
* list - get /v4/airtable/tables/{tableId}/records
*/
list(tableId, options) {
return this.api.v4AirtableControllerListRecordsV4({ tableId, ...options });
}
}
export class AirtableTablesRecordsComments {
constructor(api) {
this.api = api;
}
/**
* list - get /v4/airtable/tables/{tableId}/records/{recordId}/comments
*/
list(tableId, recordId, options) {
return this.api.v4AirtableControllerListCommentsV4({ tableId, recordId, ...options });
}
/**
* create - post /v4/airtable/tables/{tableId}/records/{recordId}/comments
*/
create(tableId, recordId, body) {
return this.api.v4AirtableControllerCreateCommentV4({ tableId, recordId, v4AirtableCreateCommentBodyDto: body });
}
}