2023-08-16 06:52:41 -07:00
|
|
|
import type { IExecuteFunctions, 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(
|
2023-08-16 06:52:41 -07:00
|
|
|
this: IExecuteFunctions | ILoadOptionsFunctions,
|
2022-08-01 13:47:55 -07:00
|
|
|
resourceName: string,
|
|
|
|
): Promise<any> {
|
2024-02-14 07:29:09 -08:00
|
|
|
return await cockpitApiRequest.call(this, 'GET', `/singletons/get/${resourceName}`);
|
2020-04-04 07:04:25 -07:00
|
|
|
}
|
2020-04-05 06:49:47 -07:00
|
|
|
|
2022-08-01 13:47:55 -07:00
|
|
|
export async function getAllSingletonNames(
|
2023-08-16 06:52:41 -07:00
|
|
|
this: IExecuteFunctions | ILoadOptionsFunctions,
|
2022-08-01 13:47:55 -07:00
|
|
|
): Promise<string[]> {
|
2024-01-17 07:08:50 -08:00
|
|
|
return await cockpitApiRequest.call(this, 'GET', '/singletons/listSingletons', {});
|
2020-04-06 01:03:49 -07:00
|
|
|
}
|