2020-04-04 07:04:25 -07:00
|
|
|
import {
|
|
|
|
IExecuteFunctions,
|
|
|
|
IExecuteSingleFunctions,
|
|
|
|
ILoadOptionsFunctions
|
|
|
|
} from 'n8n-core';
|
|
|
|
import { cockpitApiRequest } from './GenericFunctions';
|
|
|
|
|
2020-04-05 06:49:47 -07:00
|
|
|
export async function getAllSingleton(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, resourceName: string): Promise<any> { // tslint:disable-line:no-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
|
|
|
|
|
|
|
export async function getAllSingletonNames(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions): Promise<string[]> {
|
|
|
|
return cockpitApiRequest.call(this, 'GET', `/singletons/listSingletons`, {});
|
|
|
|
}
|