mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-13 16:14:07 -08:00
20 lines
624 B
TypeScript
20 lines
624 B
TypeScript
import type {
|
|
IExecuteFunctions,
|
|
IExecuteSingleFunctions,
|
|
ILoadOptionsFunctions,
|
|
} from 'n8n-workflow';
|
|
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', {});
|
|
}
|