mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
refactor: Reduce usage of IExecuteSingleFunctions (no-changelog) (#6944)
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
import type {
|
||||
IExecuteFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
} from 'n8n-workflow';
|
||||
import type { IExecuteFunctions, ILoadOptionsFunctions } from 'n8n-workflow';
|
||||
import { cockpitApiRequest } from './GenericFunctions';
|
||||
|
||||
export async function getSingleton(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
resourceName: string,
|
||||
): Promise<any> {
|
||||
return cockpitApiRequest.call(this, 'get', `/singletons/get/${resourceName}`);
|
||||
}
|
||||
|
||||
export async function getAllSingletonNames(
|
||||
this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
|
||||
this: IExecuteFunctions | ILoadOptionsFunctions,
|
||||
): Promise<string[]> {
|
||||
return cockpitApiRequest.call(this, 'GET', '/singletons/listSingletons', {});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user