n8n/packages/nodes-base/nodes/Cockpit/SingletonFunctions.ts
Iván Ovejero cfd32d2642
refactor: Phase out TSLint in nodes-base (no-changelog) (#4798)
* 🔥 Remove TSLint scripts

* 🔥 Remove TSLint config

* 🔥 Remove TSLint exceptions

* 👕 Adjust lint config

* ✏️ Add story numbers
2022-12-02 15:25:21 +01:00

16 lines
611 B
TypeScript

import { IExecuteFunctions, IExecuteSingleFunctions, ILoadOptionsFunctions } from 'n8n-core';
import { cockpitApiRequest } from './GenericFunctions';
export async function getSingleton(
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
resourceName: string,
): Promise<any> {
return cockpitApiRequest.call(this, 'get', `/singletons/get/${resourceName}`);
}
export async function getAllSingletonNames(
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
): Promise<string[]> {
return cockpitApiRequest.call(this, 'GET', `/singletons/listSingletons`, {});
}