diff --git a/packages/editor-ui/src/App.vue b/packages/editor-ui/src/App.vue index 0e671aad7b..7d5cd479de 100644 --- a/packages/editor-ui/src/App.vue +++ b/packages/editor-ui/src/App.vue @@ -51,7 +51,7 @@ import { useExternalHooks } from '@/composables/useExternalHooks'; import { useToast } from '@/composables/useToast'; import { useCloudPlanStore } from '@/stores/cloudPlan.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; -import { useRootStore } from '@/stores/n8nRoot.store'; +import { useRootStore } from '@/stores/root.store'; import { useSettingsStore } from '@/stores/settings.store'; import { useSourceControlStore } from '@/stores/sourceControl.store'; import { useTemplatesStore } from '@/stores/templates.store'; diff --git a/packages/editor-ui/src/__tests__/init.test.ts b/packages/editor-ui/src/__tests__/init.test.ts index 6bf6f32999..f41e3abc52 100644 --- a/packages/editor-ui/src/__tests__/init.test.ts +++ b/packages/editor-ui/src/__tests__/init.test.ts @@ -2,7 +2,7 @@ import { useUsersStore } from '@/stores/users.store'; import { useCloudPlanStore } from '@/stores/cloudPlan.store'; import { useSourceControlStore } from '@/stores/sourceControl.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; -import { useRootStore } from '@/stores/n8nRoot.store'; +import { useRootStore } from '@/stores/root.store'; import { initializeAuthenticatedFeatures, initializeCore } from '@/init'; import { createTestingPinia } from '@pinia/testing'; import { setActivePinia } from 'pinia'; @@ -13,7 +13,7 @@ vi.mock('@/stores/users.store', () => ({ useUsersStore: vi.fn().mockReturnValue({ initialize: vi.fn() }), })); -vi.mock('@/stores/n8nRoot.store', () => ({ +vi.mock('@/stores/root.store', () => ({ useRootStore: vi.fn(), })); diff --git a/packages/editor-ui/src/components/AboutModal.vue b/packages/editor-ui/src/components/AboutModal.vue index 067c3daa81..1b61aabf67 100644 --- a/packages/editor-ui/src/components/AboutModal.vue +++ b/packages/editor-ui/src/components/AboutModal.vue @@ -65,7 +65,7 @@ import { createEventBus } from 'n8n-design-system/utils'; import Modal from './Modal.vue'; import { ABOUT_MODAL_KEY } from '../constants'; import { useSettingsStore } from '@/stores/settings.store'; -import { useRootStore } from '@/stores/n8nRoot.store'; +import { useRootStore } from '@/stores/root.store'; export default defineComponent({ name: 'About', diff --git a/packages/editor-ui/src/components/BecomeTemplateCreatorCta/becomeTemplateCreatorStore.ts b/packages/editor-ui/src/components/BecomeTemplateCreatorCta/becomeTemplateCreatorStore.ts index 83785e0fae..faf2ad8e0c 100644 --- a/packages/editor-ui/src/components/BecomeTemplateCreatorCta/becomeTemplateCreatorStore.ts +++ b/packages/editor-ui/src/components/BecomeTemplateCreatorCta/becomeTemplateCreatorStore.ts @@ -4,7 +4,7 @@ import { computed, ref } from 'vue'; import { STORES } from '@/constants'; import { useCloudPlanStore } from '@/stores/cloudPlan.store'; import { useStorage } from '@/composables/useStorage'; -import { useRootStore } from '@/stores/n8nRoot.store'; +import { useRootStore } from '@/stores/root.store'; import { getBecomeCreatorCta } from '@/api/ctas'; const LOCAL_STORAGE_KEY = 'N8N_BECOME_TEMPLATE_CREATOR_CTA_DISMISSED_AT'; @@ -42,7 +42,7 @@ export const useBecomeTemplateCreatorStore = defineStore(STORES.BECOME_TEMPLATE_ }; const fetchBecomeCreatorCta = async () => { - const becomeCreatorCta = await getBecomeCreatorCta(rootStore.getRestApiContext); + const becomeCreatorCta = await getBecomeCreatorCta(rootStore.restApiContext); ctaMeetsCriteria.value = becomeCreatorCta; }; diff --git a/packages/editor-ui/src/components/ChatEmbedModal.vue b/packages/editor-ui/src/components/ChatEmbedModal.vue index 2db07e0935..a19523a933 100644 --- a/packages/editor-ui/src/components/ChatEmbedModal.vue +++ b/packages/editor-ui/src/components/ChatEmbedModal.vue @@ -4,7 +4,7 @@ import type { EventBus } from 'n8n-design-system/utils'; import { createEventBus } from 'n8n-design-system/utils'; import Modal from './Modal.vue'; import { CHAT_EMBED_MODAL_KEY, CHAT_TRIGGER_NODE_TYPE, WEBHOOK_NODE_TYPE } from '../constants'; -import { useRootStore } from '@/stores/n8nRoot.store'; +import { useRootStore } from '@/stores/root.store'; import { useWorkflowsStore } from '@/stores/workflows.store'; import HtmlEditor from '@/components/HtmlEditor/HtmlEditor.vue'; import JsEditor from '@/components/JsEditor/JsEditor.vue'; @@ -68,7 +68,7 @@ const webhookNode = computed(() => { }); const webhookUrl = computed(() => { - const url = `${rootStore.getWebhookUrl}${ + const url = `${rootStore.webhookUrl}${ webhookNode.value ? `/${webhookNode.value.node.webhookId}` : '' }`; diff --git a/packages/editor-ui/src/components/CodeNodeEditor/AskAI/AskAI.vue b/packages/editor-ui/src/components/CodeNodeEditor/AskAI/AskAI.vue index ce06458366..9607277660 100644 --- a/packages/editor-ui/src/components/CodeNodeEditor/AskAI/AskAI.vue +++ b/packages/editor-ui/src/components/CodeNodeEditor/AskAI/AskAI.vue @@ -16,7 +16,7 @@ import { useMessage } from '@/composables/useMessage'; import { useToast } from '@/composables/useToast'; import { useNDVStore } from '@/stores/ndv.store'; import { usePostHog } from '@/stores/posthog.store'; -import { useRootStore } from '@/stores/n8nRoot.store'; +import { useRootStore } from '@/stores/root.store'; import { useWorkflowsStore } from '@/stores/workflows.store'; import { executionDataToJson } from '@/utils/nodeTypesUtils'; import { @@ -131,7 +131,7 @@ function stopLoading() { } async function onSubmit() { - const { getRestApiContext } = useRootStore(); + const { restApiContext } = useRootStore(); const { activeNode } = useNDVStore(); const { showMessage } = useToast(); const { alert } = useMessage(); @@ -153,20 +153,22 @@ async function onSubmit() { startLoading(); + const rootStore = useRootStore(); + try { - const version = useRootStore().versionCli; + const version = rootStore.versionCli; const model = usePostHog().getVariant(ASK_AI_EXPERIMENT.name) === ASK_AI_EXPERIMENT.gpt4 ? 'gpt-4' : 'gpt-3.5-turbo-16k'; - const { code } = await generateCodeForPrompt(getRestApiContext, { + const { code } = await generateCodeForPrompt(restApiContext, { question: prompt.value, context: { schema: schemas.parentNodesSchemas, inputSchema: schemas.inputSchema!, ndvPushRef: useNDVStore().pushRef, - pushRef: useRootStore().pushRef, + pushRef: rootStore.pushRef, }, model, n8nVersion: version, diff --git a/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue b/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue index 3c2cfdd3b1..ff4602475d 100644 --- a/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue +++ b/packages/editor-ui/src/components/CodeNodeEditor/CodeNodeEditor.vue @@ -65,7 +65,7 @@ import { CODE_EXECUTION_MODES, CODE_LANGUAGES } from 'n8n-workflow'; import { ASK_AI_EXPERIMENT, CODE_NODE_TYPE } from '@/constants'; import { codeNodeEditorEventBus } from '@/event-bus'; -import { useRootStore } from '@/stores/n8nRoot.store'; +import { useRootStore } from '@/stores/root.store'; import { usePostHog } from '@/stores/posthog.store'; import { readOnlyEditorExtensions, writableEditorExtensions } from './baseExtensions'; diff --git a/packages/editor-ui/src/components/ContactPromptModal.vue b/packages/editor-ui/src/components/ContactPromptModal.vue index 8bb2110d34..a0364b43e5 100644 --- a/packages/editor-ui/src/components/ContactPromptModal.vue +++ b/packages/editor-ui/src/components/ContactPromptModal.vue @@ -40,7 +40,7 @@ import type { IN8nPromptResponse, ModalKey } from '@/Interface'; import { VALID_EMAIL_REGEX } from '@/constants'; import Modal from '@/components/Modal.vue'; import { useSettingsStore } from '@/stores/settings.store'; -import { useRootStore } from '@/stores/n8nRoot.store'; +import { useRootStore } from '@/stores/root.store'; import { createEventBus } from 'n8n-design-system/utils'; import { useToast } from '@/composables/useToast'; import { useNpsSurveyStore } from '@/stores/npsSurvey.store'; diff --git a/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue b/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue index d4f43d94fd..a135725bc9 100644 --- a/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue +++ b/packages/editor-ui/src/components/CredentialEdit/CredentialConfig.vue @@ -162,7 +162,7 @@ import type { PermissionsMap } from '@/permissions'; import type { CredentialScope } from '@n8n/permissions'; import { useUIStore } from '@/stores/ui.store'; import { useWorkflowsStore } from '@/stores/workflows.store'; -import { useRootStore } from '@/stores/n8nRoot.store'; +import { useRootStore } from '@/stores/root.store'; import { useNDVStore } from '@/stores/ndv.store'; import { useCredentialsStore } from '@/stores/credentials.store'; import { useNodeTypesStore } from '@/stores/nodeTypes.store'; @@ -338,7 +338,7 @@ export default defineComponent({ this.credentialTypeName === 'oAuth2Api' || this.parentTypes.includes('oAuth2Api') ? 'oauth2' : 'oauth1'; - return this.rootStore.oauthCallbackUrls[oauthType as keyof {}]; + return this.rootStore.OAuthCallbackUrls[oauthType as keyof {}]; }, showOAuthSuccessBanner(): boolean { return ( diff --git a/packages/editor-ui/src/components/CredentialEdit/GoogleAuthButton.vue b/packages/editor-ui/src/components/CredentialEdit/GoogleAuthButton.vue index f2eb2ca9de..083deabaf5 100644 --- a/packages/editor-ui/src/components/CredentialEdit/GoogleAuthButton.vue +++ b/packages/editor-ui/src/components/CredentialEdit/GoogleAuthButton.vue @@ -8,7 +8,7 @@