feat: add Airtable integration - database operations#69
Open
jackulau wants to merge 1 commit into
Open
Conversation
Add Airtable database integration (Issue wespreadjam#29) with bearer token credential and 4 nodes: createRecord, getRecords, updateRecord, deleteRecord. Includes formula filtering, multi-sort, pagination offset support, and 36 unit tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Airtable integration for database operations per Issue #29 (P1 priority). Implements a bearer token credential and 4 CRUD operation nodes following the
existing Slack/DevTo integration patterns.
Credential
defineBearerCredentialfrom@jam-nodes/coreairtable, type:bearerAuthorization: Bearer {{accessToken}}headerairtable?: { accessToken: string }toNodeCredentialsinterface in coreOperations
airtableCreateRecord
{ baseId, tableId, fields }POST https://api.airtable.com/v0/{baseId}/{tableId}{ fields: {...} }{ id, fields, createdTime }airtableGetRecords
{ baseId, tableId, filterByFormula?, sort?, maxRecords? }GET https://api.airtable.com/v0/{baseId}/{tableId}with query paramsfilterByFormula— URL-encoded, supports special characters (e.g.AND({Name}="O'Brien", {Age}>30))sort— Airtable bracket notation (sort[0][field]=Name&sort[0][direction]=asc), supports multiple sort fieldsmaxRecords— integer limitoffsettoken from Airtable response for subsequent requests{ records: [{ id, fields, createdTime }], offset? }airtableUpdateRecord
{ baseId, tableId, recordId, fields }PATCH https://api.airtable.com/v0/{baseId}/{tableId}/{recordId}{ fields: {...} }(partial update — only specified fields are changed){ id, fields, createdTime }airtableDeleteRecord
{ baseId, tableId, recordId }DELETE https://api.airtable.com/v0/{baseId}/{tableId}/{recordId}{ id, deleted }Architecture
slack-send-message.ts, etc.)defineNodefrom@jam-nodes/corewith categoryintegrationfetchWithRetryutility which handles rate limiting (429), retries with exponential backoff, and timeoutscontext.credentials.airtable.accessTokenmatching theNodeCredentialspatterntableIdis URL-encoded viaencodeURIComponentto handle table names with spaces{ success: false, error }— no thrown exceptionsFiles Changed
New files (8)
packages/nodes/src/integrations/airtable/credentials.ts— bearer credential definitionpackages/nodes/src/integrations/airtable/schemas.ts— Zod input/output schemas + inferred typespackages/nodes/src/integrations/airtable/airtable-create-record.ts— create operationpackages/nodes/src/integrations/airtable/airtable-get-records.ts— get/list operation with filtering, sorting, paginationpackages/nodes/src/integrations/airtable/airtable-update-record.ts— update operation (PATCH)packages/nodes/src/integrations/airtable/airtable-delete-record.ts— delete operationpackages/nodes/src/integrations/airtable/index.ts— barrel exportspackages/nodes/src/integrations/airtable/__tests__/airtable.test.ts— 36 unit testsModified files (3)
packages/core/src/types/node.ts— addedairtabletoNodeCredentialsinterfacepackages/nodes/src/integrations/index.ts— added airtable exportspackages/nodes/src/index.ts— added airtable exports + registered 4 nodes inbuiltInNodesTest Plan
36 tests covering:
special character formula encoding, pagination offset, empty table, API error
Results: 36/36 passing, 0 regressions (231 total suite, baseline 195)