Files
Agent-n8n/n8n-n8n-1.109.2/packages/nodes-base/nodes/Cockpit/SingletonFunctions.ts

17 lines
556 B
TypeScript
Raw Normal View History

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