mirror of
https://github.com/n8n-io/n8n.git
synced 2025-01-10 20:37:29 -08:00
57aab63c10
* 👕 Move `consistent-type-imports` to top level * 👕 Apply lintfixes * 👕 Apply more lintfixes * 👕 More lintfixes * 👕 More lintfixes
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import { makeRestApiRequest } from '@/utils';
|
|
import type {
|
|
IRestApiContext,
|
|
SamlPreferencesLoginEnabled,
|
|
SamlPreferences,
|
|
SamlPreferencesExtractedData,
|
|
} from '@/Interface';
|
|
|
|
export const initSSO = (context: IRestApiContext): Promise<string> => {
|
|
return makeRestApiRequest(context, 'GET', '/sso/saml/initsso');
|
|
};
|
|
|
|
export const getSamlMetadata = (context: IRestApiContext): Promise<SamlPreferences> => {
|
|
return makeRestApiRequest(context, 'GET', '/sso/saml/metadata');
|
|
};
|
|
|
|
export const getSamlConfig = (
|
|
context: IRestApiContext,
|
|
): Promise<SamlPreferences & SamlPreferencesExtractedData> => {
|
|
return makeRestApiRequest(context, 'GET', '/sso/saml/config');
|
|
};
|
|
|
|
export const saveSamlConfig = (
|
|
context: IRestApiContext,
|
|
data: SamlPreferences,
|
|
): Promise<SamlPreferences | undefined> => {
|
|
return makeRestApiRequest(context, 'POST', '/sso/saml/config', data);
|
|
};
|
|
|
|
export const toggleSamlConfig = (
|
|
context: IRestApiContext,
|
|
data: SamlPreferencesLoginEnabled,
|
|
): Promise<void> => {
|
|
return makeRestApiRequest(context, 'POST', '/sso/saml/config/toggle', data);
|
|
};
|
|
|
|
export const testSamlConfig = (context: IRestApiContext): Promise<string> => {
|
|
return makeRestApiRequest(context, 'GET', '/sso/saml/config/test');
|
|
};
|