mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
58 lines
1.2 KiB
TypeScript
58 lines
1.2 KiB
TypeScript
import type {
|
|
IDisplayOptions,
|
|
IExecuteFunctions,
|
|
INodeExecutionData,
|
|
INodeProperties,
|
|
} from 'n8n-workflow';
|
|
|
|
import { ROWS_LIMIT_DEFAULT } from '../../common/constants';
|
|
import { executeSelectMany, getSelectFields } from '../../common/selectMany';
|
|
import { getDataTableProxyExecute } from '../../common/utils';
|
|
|
|
export const FIELD: string = 'get';
|
|
|
|
const displayOptions: IDisplayOptions = {
|
|
show: {
|
|
resource: ['row'],
|
|
operation: [FIELD],
|
|
},
|
|
};
|
|
|
|
export const description: INodeProperties[] = [
|
|
...getSelectFields(displayOptions),
|
|
{
|
|
displayName: 'Return All',
|
|
name: 'returnAll',
|
|
type: 'boolean',
|
|
displayOptions,
|
|
default: false,
|
|
description: 'Whether to return all results or only up to a given limit',
|
|
},
|
|
{
|
|
displayName: 'Limit',
|
|
name: 'limit',
|
|
type: 'number',
|
|
displayOptions: {
|
|
...displayOptions,
|
|
show: {
|
|
...displayOptions.show,
|
|
returnAll: [false],
|
|
},
|
|
},
|
|
typeOptions: {
|
|
minValue: 1,
|
|
},
|
|
default: ROWS_LIMIT_DEFAULT,
|
|
description: 'Max number of results to return',
|
|
},
|
|
];
|
|
|
|
export async function execute(
|
|
this: IExecuteFunctions,
|
|
index: number,
|
|
): Promise<INodeExecutionData[]> {
|
|
const dataStoreProxy = await getDataTableProxyExecute(this, index);
|
|
|
|
return await executeSelectMany(this, index, dataStoreProxy);
|
|
}
|