mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import type { ILdapConfig, ILdapSyncData } from '@/Interface';
|
|
import type { IRestApiContext } from '@n8n/rest-api-client';
|
|
import { makeRestApiRequest } from '@n8n/rest-api-client';
|
|
import type { IDataObject } from 'n8n-workflow';
|
|
|
|
export async function getLdapConfig(context: IRestApiContext): Promise<ILdapConfig> {
|
|
return await makeRestApiRequest(context, 'GET', '/ldap/config');
|
|
}
|
|
|
|
export async function testLdapConnection(context: IRestApiContext): Promise<{}> {
|
|
return await makeRestApiRequest(context, 'POST', '/ldap/test-connection');
|
|
}
|
|
|
|
export async function updateLdapConfig(
|
|
context: IRestApiContext,
|
|
adConfig: ILdapConfig,
|
|
): Promise<ILdapConfig> {
|
|
return await makeRestApiRequest(
|
|
context,
|
|
'PUT',
|
|
'/ldap/config',
|
|
adConfig as unknown as IDataObject,
|
|
);
|
|
}
|
|
|
|
export async function runLdapSync(context: IRestApiContext, data: IDataObject): Promise<{}> {
|
|
return await makeRestApiRequest(context, 'POST', '/ldap/sync', data as unknown as IDataObject);
|
|
}
|
|
|
|
export async function getLdapSynchronizations(
|
|
context: IRestApiContext,
|
|
pagination: { page: number },
|
|
): Promise<ILdapSyncData[]> {
|
|
return await makeRestApiRequest(context, 'GET', '/ldap/sync', pagination);
|
|
}
|