n8n/packages/nodes-base/nodes/Cockpit/SingletonFunctions.ts
कारतोफ्फेलस्क्रिप्ट™ 7a4e9ef5fa
refactor: Remove n8n-core dependency in nodes-base (no-changelog) (#5649)
2023-03-09 18:13:15 +01:00

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', {});
}