mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor: Format nodes-base package (A-F) (#3800)
* 🔨 prettier formated nodes - A * 🔨 prettier formated nodes - B * ⚡ prettier formated nodes - C * ⚡ prettier formated nodes - D * ⚡ prettier formated nodes - E-F * 🎨 Adjust nodes-base formatting command (#3805) * Format additional files in nodes A-F (#3811) * ⚡ fixes * 🎨 Add Mindee to ignored dirs Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions
|
||||
} from 'n8n-core';
|
||||
import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
|
||||
import { IDataObject } from 'n8n-workflow';
|
||||
import { ICollection } from './CollectionInterface';
|
||||
import { cockpitApiRequest } from './GenericFunctions';
|
||||
|
||||
export async function createCollectionEntry(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, resourceName: string, data: IDataObject, id?: string): Promise<any> { // tslint:disable-line:no-any
|
||||
export async function createCollectionEntry(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
resourceName: string,
|
||||
data: IDataObject,
|
||||
id?: string,
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const body: ICollection = {
|
||||
data,
|
||||
};
|
||||
@@ -22,12 +24,16 @@ export async function createCollectionEntry(this: IExecuteFunctions | IExecuteSi
|
||||
return cockpitApiRequest.call(this, 'post', `/collections/save/${resourceName}`, body);
|
||||
}
|
||||
|
||||
|
||||
export async function getAllCollectionEntries(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, resourceName: string, options: IDataObject): Promise<any> { // tslint:disable-line:no-any
|
||||
export async function getAllCollectionEntries(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
resourceName: string,
|
||||
options: IDataObject,
|
||||
// tslint:disable-next-line:no-any
|
||||
): Promise<any> {
|
||||
const body: ICollection = {};
|
||||
|
||||
if (options.fields) {
|
||||
const fields = (options.fields as string).split(',').map(field => field.trim() );
|
||||
const fields = (options.fields as string).split(',').map((field) => field.trim());
|
||||
|
||||
const bodyFields = {
|
||||
_id: false,
|
||||
@@ -71,7 +77,8 @@ export async function getAllCollectionEntries(this: IExecuteFunctions | IExecute
|
||||
return cockpitApiRequest.call(this, 'post', `/collections/get/${resourceName}`, body);
|
||||
}
|
||||
|
||||
|
||||
export async function getAllCollectionNames(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions): Promise<string[]> {
|
||||
export async function getAllCollectionNames(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
): Promise<string[]> {
|
||||
return cockpitApiRequest.call(this, 'GET', `/collections/listCollections`, {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user