Initializes a new instance of the DataService class. Calls the constructor of the BaseService.
Protected
deleteProtected
Deletes a single record from the specified Airtable table using its record ID.
The Airtable Personal Access Token for authentication.
The ID of the target Airtable base.
The name or ID of the target table.
The object representing the record to delete. It must include the id
property.
A promise that resolves to the Airtable API response confirming the deletion.
Deletes a record from the specified Airtable table.
Publicly exposes the delete
method from BaseService.
The type extending BaseModel representing the record to delete (must include id
).
The Airtable Personal Access Token.
The ID of the Airtable base.
The name or ID of the table.
An object containing the id
of the record to delete.
A promise resolving to the Airtable API response.
Protected
getProtected
Retrieves multiple records from a specified Airtable table, optionally applying query parameters.
Maps the Airtable record structure to the provided generic type T
.
The Airtable Personal Access Token for authentication.
The ID of the target Airtable base.
The name or ID of the target table within the base.
Optional
options: SelectOptionsOptional parameters for filtering, sorting, pagination, etc. See Airtable API documentation for details.
A promise that resolves to an array of records matching the query, cast to type T.
Retrieves multiple records from the specified Airtable table.
Publicly exposes the get
method from BaseService.
The type extending BaseModel representing the record structure.
The Airtable Personal Access Token.
The ID of the Airtable base.
The name or ID of the table.
Optional
options: SelectOptionsOptional query parameters.
A promise resolving to an array of records.
Protected
saveProtected
Creates a single new record in the specified Airtable table.
The Airtable Personal Access Token for authentication.
The ID of the target Airtable base.
The name or ID of the target table.
The data object representing the record to be created. The id
property, if present, will be ignored by Airtable.
A promise that resolves to the Airtable API response for the created record.
Creates a new record in the specified Airtable table.
Publicly exposes the save
method from BaseService.
The type extending BaseModel representing the record to create.
The Airtable Personal Access Token.
The ID of the Airtable base.
The name or ID of the table.
The data for the new record.
A promise resolving to the Airtable API response.
Protected
updateProtected
Updates an existing record in the specified Airtable table using its record ID.
The Airtable Personal Access Token for authentication.
The ID of the target Airtable base.
The name or ID of the target table.
The data object containing the fields to update. It must include the id
property of the record to update.
A promise that resolves to the Airtable API response for the updated record.
Updates an existing record in the specified Airtable table.
Publicly exposes the update
method from BaseService.
The type extending BaseModel representing the record to update (must include id
).
The Airtable Personal Access Token.
The ID of the Airtable base.
The name or ID of the table.
The data containing updates, including the record id
.
A promise resolving to the Airtable API response.
A service designed for dependency injection (using typedi) to interact with Airtable. It extends BaseService and exposes its CRUD methods publicly. Inject this service into other services or controllers to access Airtable data.
Example
Export
DataService