Skip to main content

Source Data Discover

Overview

Use these commands to intercept the source-data-discover command.

Input/OutputData Type
InputStdSourceDataDiscoverInput
OutputStdSourceDataDiscoverOutput

Example StdSourceDataDiscoverInput

{
"queryInput": {
"query": "fetchAll",
"limit": 10
}
}

Example StdSourceDataDiscoverOutput

[
{
key: 'id',
label: 'Id',
subLabel: 'Airtable Base Id'
},
{
key: 'name',
label: 'Name',
subLabel: 'Airtable Source Table Name'
}
]

Implementation

Before source-data-discover command

Use this logic to implement the command:

    .beforeStdSourceDataDiscover(async (context: Context, input: StdSourceDataDiscoverInput) => {
logger.info(`Running before source data discover. Query: ${input.queryInput?.query}`)
return input
})

The input object can be mutated and returned, but the same data type must still be returned.

After source-data-discover command

Use this logic to implement the command:

    .afterStdSourceDataDiscover(async (context: Context, output: StdSourceDataDiscoverOutput) => {
logger.info(`Running after source data discover first record key: ${output[0].key}`)
return output
})

The output object can be mutated and returned, but the same data type must still be returned.