// api/rapids/shared/rapids.commonParams.ts
import { INodeProperties } from 'n8n-workflow';

/**
 * Common RAPIDS parameters used across most endpoints
 */
export const commonRapidsParams: INodeProperties[] = [
	{
		displayName: 'Return All',
		name: 'returnAll',
		type: 'boolean',
		displayOptions: {
			show: {
				domain: ['rapids'],
			},
		},
		default: true,
		description: 'Whether to return all results or only up to a given limit',
	},
	{
		displayName: 'Limit',
		name: 'limit',
		type: 'number',
		displayOptions: {
			show: {
				domain: ['rapids'],
				returnAll: [false],
			},
		},
		typeOptions: {
			minValue: 1,
			maxValue: 1000,
		},
		default: 100,
		description: 'Maximum number of results to return',
	},
	{
		displayName: 'Additional Fields',
		name: 'additionalFields',
		type: 'collection',
		placeholder: 'Add Field',
		displayOptions: {
			show: {
				domain: ['rapids'],
			},
		},
		default: {},
		options: [
			{
				displayName: 'Group Names',
				name: 'group',
				type: 'string',
				default: '',
				description: 'List of group names (comma-separated)',
			},
			{
				displayName: 'Label Names',
				name: 'label',
				type: 'string',
				default: '',
				description: 'List of label names (comma-separated)',
			},
			{
				displayName: 'Site Names',
				name: 'site',
				type: 'string',
				default: '',
				description: 'List of site names (comma-separated)',
			},
			{
				displayName: 'Swarm ID',
				name: 'swarm_id',
				type: 'string',
				default: '',
				description: 'Filter by Swarm ID',
			},
		],
	},
	{
		displayName: 'Time Range',
		name: 'timeRange',
		type: 'collection',
		placeholder: 'Add Time Range',
		displayOptions: {
			show: {
				domain: ['rapids'],
			},
		},
		default: {},
		options: [
			{
				displayName: 'From Timestamp',
				name: 'from_timestamp',
				type: 'dateTime',
				default: '',
				description:
					'Need information from this timestamp. Default is current UTC timestamp minus 3 hours',
			},
			{
				displayName: 'To Timestamp',
				name: 'to_timestamp',
				type: 'dateTime',
				default: '',
				description: 'Need information to this timestamp. Default is current UTC timestamp',
			},
		],
	},
];
