n8n/packages/nodes-base/nodes/Cockpit/SingletonFunctions.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
555 B
TypeScript
Raw Normal View History

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