feat(core): Add LDAP support (#3835)

This commit is contained in:
Ricardo Espinoza
2023-01-24 20:18:39 -05:00
committed by GitHub
parent 259296c5c9
commit 0c70a40317
77 changed files with 3686 additions and 192 deletions

View File

@@ -0,0 +1,29 @@
import { ILdapConfig, ILdapSyncData, IRestApiContext } from '@/Interface';
import { makeRestApiRequest } from '@/utils';
import { IDataObject } from 'n8n-workflow';
export function getLdapConfig(context: IRestApiContext): Promise<ILdapConfig> {
return makeRestApiRequest(context, 'GET', '/ldap/config');
}
export function testLdapConnection(context: IRestApiContext): Promise<{}> {
return makeRestApiRequest(context, 'POST', '/ldap/test-connection');
}
export function updateLdapConfig(
context: IRestApiContext,
adConfig: ILdapConfig,
): Promise<ILdapConfig> {
return makeRestApiRequest(context, 'PUT', '/ldap/config', adConfig as unknown as IDataObject);
}
export function runLdapSync(context: IRestApiContext, data: IDataObject): Promise<{}> {
return makeRestApiRequest(context, 'POST', '/ldap/sync', data as unknown as IDataObject);
}
export function getLdapSynchronizations(
context: IRestApiContext,
pagination: { page: number },
): Promise<ILdapSyncData[]> {
return makeRestApiRequest(context, 'GET', '/ldap/sync', pagination);
}