feat(Airtable Node): Access token support (#6160)

This commit is contained in:
Michael Kret
2023-05-04 13:17:22 +03:00
committed by GitHub
parent 91fee0ca66
commit f9fd82040a
6 changed files with 121 additions and 16 deletions

View File

@@ -28,12 +28,42 @@ export class AirtableTrigger implements INodeType {
{
name: 'airtableApi',
required: true,
displayOptions: {
show: {
authentication: ['airtableApi'],
},
},
},
{
name: 'airtableTokenApi',
required: true,
displayOptions: {
show: {
authentication: ['airtableTokenApi'],
},
},
},
],
polling: true,
inputs: [],
outputs: ['main'],
properties: [
{
displayName: 'Authentication',
name: 'authentication',
type: 'options',
options: [
{
name: 'API Key',
value: 'airtableApi',
},
{
name: 'Access Token',
value: 'airtableTokenApi',
},
],
default: 'airtableApi',
},
{
displayName: 'Base',
name: 'baseId',
@@ -192,19 +222,14 @@ export class AirtableTrigger implements INodeType {
async poll(this: IPollFunctions): Promise<INodeExecutionData[][] | null> {
const downloadAttachments = this.getNodeParameter('downloadAttachments', 0) as boolean;
const webhookData = this.getWorkflowStaticData('node');
const additionalFields = this.getNodeParameter('additionalFields') as IDataObject;
const base = this.getNodeParameter('baseId', '', { extractValue: true }) as string;
const table = this.getNodeParameter('tableId', '', { extractValue: true }) as string;
const triggerField = this.getNodeParameter('triggerField') as string;
const qs: IDataObject = {};
const additionalFields = this.getNodeParameter('additionalFields') as IDataObject;
const base = this.getNodeParameter('baseId', '', { extractValue: true }) as string;
const table = this.getNodeParameter('tableId', '', { extractValue: true }) as string;
const triggerField = this.getNodeParameter('triggerField') as string;
const endpoint = `${base}/${table}`;
const now = moment().utc().format();