diff --git a/packages/frontend/@n8n/rest-api-client/src/api/index.ts b/packages/frontend/@n8n/rest-api-client/src/api/index.ts index 3237740e14..35d7e7d22c 100644 --- a/packages/frontend/@n8n/rest-api-client/src/api/index.ts +++ b/packages/frontend/@n8n/rest-api-client/src/api/index.ts @@ -8,5 +8,6 @@ export * from './nodeTypes'; export * from './npsSurvey'; export * from './orchestration'; export * from './roles'; +export * from './sso'; export * from './ui'; export * from './webhooks'; diff --git a/packages/frontend/editor-ui/src/api/sso.ts b/packages/frontend/@n8n/rest-api-client/src/api/sso.ts similarity index 86% rename from packages/frontend/editor-ui/src/api/sso.ts rename to packages/frontend/@n8n/rest-api-client/src/api/sso.ts index 1ec52a4c8f..ea214c334e 100644 --- a/packages/frontend/editor-ui/src/api/sso.ts +++ b/packages/frontend/@n8n/rest-api-client/src/api/sso.ts @@ -1,7 +1,12 @@ import type { SamlPreferences, SamlToggleDto } from '@n8n/api-types'; -import { makeRestApiRequest } from '@n8n/rest-api-client'; -import type { SamlPreferencesExtractedData } from '@/Interface'; -import type { IRestApiContext } from '@n8n/rest-api-client'; + +import type { IRestApiContext } from '../types'; +import { makeRestApiRequest } from '../utils'; + +export type SamlPreferencesExtractedData = { + entityID: string; + returnUrl: string; +}; export const initSSO = async (context: IRestApiContext, redirectUrl = ''): Promise => { return await makeRestApiRequest(context, 'GET', `/sso/saml/initsso?redirect=${redirectUrl}`); diff --git a/packages/frontend/editor-ui/src/Interface.ts b/packages/frontend/editor-ui/src/Interface.ts index a2ddef11d9..f98ec3141c 100644 --- a/packages/frontend/editor-ui/src/Interface.ts +++ b/packages/frontend/editor-ui/src/Interface.ts @@ -1368,11 +1368,6 @@ export type ExecutionsQueryFilter = { vote?: ExecutionFilterVote; }; -export type SamlPreferencesExtractedData = { - entityID: string; - returnUrl: string; -}; - export declare namespace Cloud { export interface PlanData { planId: number; diff --git a/packages/frontend/editor-ui/src/__tests__/server/endpoints/sso.ts b/packages/frontend/editor-ui/src/__tests__/server/endpoints/sso.ts index 91b1aaaaf2..ffcaf9b095 100644 --- a/packages/frontend/editor-ui/src/__tests__/server/endpoints/sso.ts +++ b/packages/frontend/editor-ui/src/__tests__/server/endpoints/sso.ts @@ -1,7 +1,7 @@ import type { SamlPreferences } from '@n8n/api-types'; import type { Server, Request } from 'miragejs'; import { Response } from 'miragejs'; -import type { SamlPreferencesExtractedData } from '@/Interface'; +import type { SamlPreferencesExtractedData } from '@n8n/rest-api-client/api/sso'; import { faker } from '@faker-js/faker'; import type { AppSchema } from '@/__tests__/server/types'; import { jsonParse } from 'n8n-workflow'; diff --git a/packages/frontend/editor-ui/src/stores/sso.store.ts b/packages/frontend/editor-ui/src/stores/sso.store.ts index 0cb1568018..635bb3f205 100644 --- a/packages/frontend/editor-ui/src/stores/sso.store.ts +++ b/packages/frontend/editor-ui/src/stores/sso.store.ts @@ -5,8 +5,8 @@ import { defineStore } from 'pinia'; import { EnterpriseEditionFeature } from '@/constants'; import { useRootStore } from '@n8n/stores/useRootStore'; import { useSettingsStore } from '@/stores/settings.store'; -import * as ssoApi from '@/api/sso'; -import type { SamlPreferencesExtractedData } from '@/Interface'; +import * as ssoApi from '@n8n/rest-api-client/api/sso'; +import type { SamlPreferencesExtractedData } from '@n8n/rest-api-client/api/sso'; import { updateCurrentUser } from '@/api/users'; import { useUsersStore } from '@/stores/users.store'; diff --git a/packages/frontend/editor-ui/src/views/SettingsSso.test.ts b/packages/frontend/editor-ui/src/views/SettingsSso.test.ts index d9050133aa..750aced232 100644 --- a/packages/frontend/editor-ui/src/views/SettingsSso.test.ts +++ b/packages/frontend/editor-ui/src/views/SettingsSso.test.ts @@ -12,7 +12,7 @@ import { createComponentRenderer } from '@/__tests__/render'; import { EnterpriseEditionFeature } from '@/constants'; import { nextTick } from 'vue'; import { usePageRedirectionHelper } from '@/composables/usePageRedirectionHelper'; -import type { SamlPreferencesExtractedData } from '@/Interface'; +import type { SamlPreferencesExtractedData } from '@n8n/rest-api-client/api/sso'; const renderView = createComponentRenderer(SettingsSso);