mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(Discord Node): Overhaul (#5351)
Github issue / Community forum post (link here to close automatically): --------- Co-authored-by: Giulio Andreini <g.andreini@gmail.com> Co-authored-by: Marcus <marcus@n8n.io>
This commit is contained in:
@@ -7,3 +7,28 @@ export const oldVersionNotice: INodeProperties = {
|
||||
type: 'notice',
|
||||
default: '',
|
||||
};
|
||||
|
||||
export const returnAllOrLimit: INodeProperties[] = [
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
displayOptions: {
|
||||
show: {
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
},
|
||||
default: 100,
|
||||
description: 'Max number of results to return',
|
||||
},
|
||||
];
|
||||
|
||||
@@ -294,10 +294,19 @@ export function flattenObject(data: IDataObject) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate Paired Item Data by length of input array
|
||||
* Capitalizes the first letter of a string
|
||||
*
|
||||
* @param {number} length
|
||||
* @param {string} string The string to capitalize
|
||||
*/
|
||||
export function capitalize(str: string): string {
|
||||
if (!str) return str;
|
||||
|
||||
const chars = str.split('');
|
||||
chars[0] = chars[0].toUpperCase();
|
||||
|
||||
return chars.join('');
|
||||
}
|
||||
|
||||
export function generatePairedItemData(length: number): IPairedItemData[] {
|
||||
return Array.from({ length }, (_, item) => ({
|
||||
item,
|
||||
|
||||
Reference in New Issue
Block a user