1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-10-08 02:28:57 +03:00
n8n/packages/nodes-base/nodes/Cockpit/SingletonFunctions.ts

16 lines
543 B
TypeScript

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