2023-03-09 09:13:15 -08:00
|
|
|
import type {
|
|
|
|
IExecuteFunctions,
|
|
|
|
IExecuteSingleFunctions,
|
|
|
|
ILoadOptionsFunctions,
|
|
|
|
} from 'n8n-workflow';
|
2020-04-04 07:04:25 -07:00
|
|
|
import { cockpitApiRequest } from './GenericFunctions';
|
|
|
|
|
2022-08-01 13:47:55 -07:00
|
|
|
export async function getSingleton(
|
|
|
|
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
|
|
|
resourceName: string,
|
|
|
|
): Promise<any> {
|
2020-04-04 07:04:25 -07:00
|
|
|
return cockpitApiRequest.call(this, 'get', `/singletons/get/${resourceName}`);
|
|
|
|
}
|
2020-04-05 06:49:47 -07:00
|
|
|
|
2022-08-01 13:47:55 -07:00
|
|
|
export async function getAllSingletonNames(
|
|
|
|
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
|
|
|
): Promise<string[]> {
|
2022-12-29 03:20:43 -08:00
|
|
|
return cockpitApiRequest.call(this, 'GET', '/singletons/listSingletons', {});
|
2020-04-06 01:03:49 -07:00
|
|
|
}
|