88} from '@/tools/airtable/types'
99import { BlockConfig } from '../types'
1010
11- // Union type for all possible Airtable responses
1211type AirtableResponse =
1312 | AirtableListResponse
1413 | AirtableGetResponse
@@ -28,7 +27,6 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
2827 bgColor : '#E0E0E0' ,
2928 icon : AirtableIcon ,
3029 subBlocks : [
31- // Operation selector
3230 {
3331 id : 'operation' ,
3432 title : 'Operation' ,
@@ -41,7 +39,6 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
4139 { label : 'Update Record' , id : 'update' } ,
4240 ] ,
4341 } ,
44- // Airtable Credentials
4542 {
4643 id : 'credential' ,
4744 title : 'Airtable Account' ,
@@ -52,23 +49,20 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
5249 requiredScopes : [ 'data.records:read' , 'data.records:write' ] , // Keep both scopes
5350 placeholder : 'Select Airtable account' ,
5451 } ,
55- // Base ID
5652 {
5753 id : 'baseId' ,
5854 title : 'Base ID' ,
5955 type : 'short-input' ,
6056 layout : 'full' ,
6157 placeholder : 'Enter your base ID (e.g., appXXXXXXXXXXXXXX)' ,
6258 } ,
63- // Table ID
6459 {
6560 id : 'tableId' ,
6661 title : 'Table ID' ,
6762 type : 'short-input' ,
6863 layout : 'full' ,
6964 placeholder : 'Enter table ID (e.g., tblXXXXXXXXXXXXXX)' ,
7065 } ,
71- // Record ID (For Get/Update Single)
7266 {
7367 id : 'recordId' ,
7468 title : 'Record ID' ,
@@ -77,7 +71,6 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
7771 placeholder : 'ID of the record (e.g., recXXXXXXXXXXXXXX)' ,
7872 condition : { field : 'operation' , value : [ 'get' , 'update' ] } ,
7973 } ,
80- // List Operation Fields
8174 {
8275 id : 'maxRecords' ,
8376 title : 'Max Records' ,
@@ -94,7 +87,6 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
9487 placeholder : 'Airtable formula to filter records (optional)' ,
9588 condition : { field : 'operation' , value : 'list' } ,
9689 } ,
97- // Create / Update Multiple Operation Field: Records (Array)
9890 {
9991 id : 'records' ,
10092 title : 'Records (JSON Array)' ,
@@ -103,7 +95,6 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
10395 placeholder : 'For Create: `[{ "fields": { ... } }]`\n' ,
10496 condition : { field : 'operation' , value : [ 'create' , 'updateMultiple' ] } ,
10597 } ,
106- // Update Single Operation Field: Fields (Object)
10798 {
10899 id : 'fields' ,
109100 title : 'Fields (JSON Object)' ,
@@ -181,7 +172,7 @@ export const AirtableBlock: BlockConfig<AirtableResponse> = {
181172 baseId : { type : 'string' , required : true } ,
182173 tableId : { type : 'string' , required : true } ,
183174 // Conditional inputs
184- recordId : { type : 'string' , required : false } , // Required for get/update
175+ recordId : { type : 'string' , required : true } , // Required for get/update
185176 maxRecords : { type : 'number' , required : false } , // Optional for list
186177 filterFormula : { type : 'string' , required : false } , // Optional for list
187178 records : { type : 'json' , required : false } , // Required for create/updateMultiple
0 commit comments