mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(editor): Move templates api to @n8n/rest-api-client package (no-changelog) (#16542)
This commit is contained in:
@@ -4,7 +4,7 @@ import { useUsersStore } from '@/stores/users.store';
|
||||
import { computed, watch, ref, onBeforeUnmount } from 'vue';
|
||||
import AskAssistantChat from '@n8n/design-system/components/AskAssistantChat/AskAssistantChat.vue';
|
||||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
import type { IWorkflowDataUpdate } from '@/Interface';
|
||||
import type { WorkflowDataUpdate } from '@n8n/rest-api-client/api/workflows';
|
||||
import { nodeViewEventBus } from '@/event-bus';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
@@ -37,7 +37,7 @@ async function onUserMessage(content: string) {
|
||||
await builderStore.initBuilderChat(content, 'chat');
|
||||
}
|
||||
|
||||
function fixWorkflowStickiesPosition(workflowData: IWorkflowDataUpdate): IWorkflowDataUpdate {
|
||||
function fixWorkflowStickiesPosition(workflowData: WorkflowDataUpdate): WorkflowDataUpdate {
|
||||
const STICKY_WIDTH = 480;
|
||||
const HEADERS_HEIGHT = 40;
|
||||
const NEW_LINE_HEIGHT = 20;
|
||||
@@ -76,7 +76,7 @@ function fixWorkflowStickiesPosition(workflowData: IWorkflowDataUpdate): IWorkfl
|
||||
}
|
||||
|
||||
function onInsertWorkflow(code: string) {
|
||||
let workflowData: IWorkflowDataUpdate;
|
||||
let workflowData: WorkflowDataUpdate;
|
||||
try {
|
||||
workflowData = JSON.parse(code);
|
||||
} catch (error) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import WorkflowTagsDropdown from '@/components/WorkflowTagsDropdown.vue';
|
||||
import Modal from '@/components/Modal.vue';
|
||||
import { useSettingsStore } from '@/stores/settings.store';
|
||||
import { useWorkflowsStore } from '@/stores/workflows.store';
|
||||
import type { IWorkflowDataUpdate } from '@/Interface';
|
||||
import type { WorkflowDataUpdate } from '@n8n/rest-api-client/api/workflows';
|
||||
import { createEventBus, type EventBus } from '@n8n/utils/event-bus';
|
||||
import { useCredentialsStore } from '@/stores/credentials.store';
|
||||
import { useWorkflowHelpers } from '@/composables/useWorkflowHelpers';
|
||||
@@ -86,7 +86,7 @@ const save = async (): Promise<void> => {
|
||||
isSaving.value = true;
|
||||
|
||||
try {
|
||||
let workflowToUpdate: IWorkflowDataUpdate | undefined;
|
||||
let workflowToUpdate: WorkflowDataUpdate | undefined;
|
||||
if (currentWorkflowId !== PLACEHOLDER_EMPTY_WORKFLOW_ID) {
|
||||
const {
|
||||
createdAt,
|
||||
|
||||
@@ -47,10 +47,10 @@ import { computed, ref, useCssModule, useTemplateRef, watch } from 'vue';
|
||||
import type {
|
||||
ActionDropdownItem,
|
||||
FolderShortInfo,
|
||||
IWorkflowDataUpdate,
|
||||
IWorkflowDb,
|
||||
IWorkflowToShare,
|
||||
} from '@/Interface';
|
||||
import type { WorkflowDataUpdate } from '@n8n/rest-api-client/api/workflows';
|
||||
import { usePageRedirectionHelper } from '@/composables/usePageRedirectionHelper';
|
||||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
import type { PathItem } from '@n8n/design-system/components/N8nBreadcrumbs/Breadcrumbs.vue';
|
||||
@@ -407,7 +407,7 @@ async function handleFileImport(): Promise<void> {
|
||||
if (inputRef?.files && inputRef.files.length !== 0) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = () => {
|
||||
let workflowData: IWorkflowDataUpdate;
|
||||
let workflowData: WorkflowDataUpdate;
|
||||
try {
|
||||
workflowData = JSON.parse(reader.result as string);
|
||||
} catch (error) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import NodeIcon from '@/components/NodeIcon.vue';
|
||||
import type { ITemplatesNode } from '@/Interface';
|
||||
import type { ITemplatesNode } from '@n8n/rest-api-client/api/templates';
|
||||
import { filterTemplateNodes } from '@/utils/nodeTypesUtils';
|
||||
|
||||
const props = withDefaults(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, onMounted, onBeforeUnmount, nextTick } from 'vue';
|
||||
import type { ComponentInstance } from 'vue';
|
||||
import type { ITag } from '@/Interface';
|
||||
import type { ITag } from '@n8n/rest-api-client/api/tags';
|
||||
import IntersectionObserver from './IntersectionObserver.vue';
|
||||
import IntersectionObserved from './IntersectionObserved.vue';
|
||||
import { createEventBus } from '@n8n/utils/event-bus';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
||||
import { onClickOutside } from '@vueuse/core';
|
||||
import type { ITag } from '@/Interface';
|
||||
import type { ITag } from '@n8n/rest-api-client/api/tags';
|
||||
import { MAX_TAG_NAME_LENGTH } from '@/constants';
|
||||
import { N8nOption, N8nSelect } from '@n8n/design-system';
|
||||
import type { EventBus } from '@n8n/utils/event-bus';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useI18n } from '@n8n/i18n';
|
||||
import { useToast } from '@/composables/useToast';
|
||||
import { useAnnotationTagsStore } from '@/stores/tags.store';
|
||||
import TagsManager from './TagsManager.vue';
|
||||
import type { ITag } from '@/Interface';
|
||||
import type { ITag } from '@n8n/rest-api-client/api/tags';
|
||||
import { ANNOTATION_TAGS_MANAGER_MODAL_KEY } from '@/constants';
|
||||
|
||||
const i18n = useI18n();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import type { ITag } from '@/Interface';
|
||||
import type { ITag } from '@n8n/rest-api-client/api/tags';
|
||||
import TagsView from '@/components/TagsManager/TagsView/TagsView.vue';
|
||||
import NoTagsView from '@/components/TagsManager/NoTagsView.vue';
|
||||
import Modal from '@/components/Modal.vue';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import type { ITag, ITagRow } from '@/Interface';
|
||||
import type { ITag } from '@n8n/rest-api-client/api/tags';
|
||||
import type { ITagRow } from '@/Interface';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import TagsTableHeader from '@/components/TagsManager/TagsView/TagsTableHeader.vue';
|
||||
import TagsTable from '@/components/TagsManager/TagsView/TagsTable.vue';
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useI18n } from '@n8n/i18n';
|
||||
import { useToast } from '@/composables/useToast';
|
||||
import { useTagsStore } from '@/stores/tags.store';
|
||||
import TagsManager from './TagsManager.vue';
|
||||
import type { ITag } from '@/Interface';
|
||||
import type { ITag } from '@n8n/rest-api-client/api/tags';
|
||||
import { TAGS_MANAGER_MODAL_KEY } from '@/constants';
|
||||
|
||||
const i18n = useI18n();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { abbreviateNumber } from '@/utils/typesUtils';
|
||||
import NodeList from './NodeList.vue';
|
||||
import TimeAgo from '@/components/TimeAgo.vue';
|
||||
import type { ITemplatesWorkflow } from '@/Interface';
|
||||
import type { ITemplatesWorkflow } from '@n8n/rest-api-client/api/templates';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import type { BaseTextKey } from '@n8n/i18n';
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import type {
|
||||
ITemplatesCollectionFull,
|
||||
ITemplatesNode,
|
||||
ITemplatesWorkflow,
|
||||
} from '@/Interface';
|
||||
} from '@n8n/rest-api-client/api/templates';
|
||||
import { useTemplatesStore } from '@/stores/templates.store';
|
||||
import TimeAgo from '@/components/TimeAgo.vue';
|
||||
import { isFullTemplatesCollection, isTemplatesWorkflow } from '@/utils/templates/typeGuards';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import type { ITemplatesCategory } from '@/Interface';
|
||||
import type { ITemplatesCategory } from '@n8n/rest-api-client/api/templates';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
||||
import TemplateCard from './TemplateCard.vue';
|
||||
import type { ITemplatesWorkflow } from '@/Interface';
|
||||
import type { ITemplatesWorkflow } from '@n8n/rest-api-client/api/templates';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import Card from '@/components/CollectionWorkflowCard.vue';
|
||||
import NodeList from '@/components/NodeList.vue';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import type { ITemplatesCollection } from '@/Interface';
|
||||
import type { ITemplatesCollection } from '@n8n/rest-api-client/api/templates';
|
||||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { nextTick, onBeforeMount, onMounted, ref, watch } from 'vue';
|
||||
import type { ITemplatesCollection } from '@/Interface';
|
||||
import type { ITemplatesCollection } from '@n8n/rest-api-client/api/templates';
|
||||
import Card from '@/components/CollectionWorkflowCard.vue';
|
||||
import TemplatesInfoCard from '@/components/TemplatesInfoCard.vue';
|
||||
import { VueAgile } from 'vue-agile';
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
import { onMounted, onBeforeUnmount, ref, computed, watch } from 'vue';
|
||||
import { useI18n } from '@n8n/i18n';
|
||||
import { useToast } from '@/composables/useToast';
|
||||
import type { IWorkflowDb, IWorkflowTemplate } from '@/Interface';
|
||||
import type { IWorkflowDb } from '@/Interface';
|
||||
import type { IWorkflowTemplate } from '@n8n/rest-api-client/api/templates';
|
||||
import { useExecutionsStore } from '@/stores/executions.store';
|
||||
|
||||
const props = withDefaults(
|
||||
|
||||
@@ -22,7 +22,7 @@ import { useProjectsStore } from '@/stores/projects.store';
|
||||
import { useTelemetry } from '@/composables/useTelemetry';
|
||||
import { VIEWS } from '@/constants';
|
||||
import { SAMPLE_SUBWORKFLOW_TRIGGER_ID, SAMPLE_SUBWORKFLOW_WORKFLOW } from '@/constants.workflows';
|
||||
import type { IWorkflowDataCreate } from '@/Interface';
|
||||
import type { WorkflowDataCreate } from '@n8n/rest-api-client/api/workflows';
|
||||
import { useDocumentVisibility } from '@/composables/useDocumentVisibility';
|
||||
|
||||
export interface Props {
|
||||
@@ -36,7 +36,7 @@ export interface Props {
|
||||
forceShowExpression?: boolean;
|
||||
parameterIssues?: string[];
|
||||
parameter: INodeProperties;
|
||||
sampleWorkflow?: IWorkflowDataCreate;
|
||||
sampleWorkflow?: WorkflowDataCreate;
|
||||
newResourceLabel?: string;
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ const onAddResourceClicked = async () => {
|
||||
(w) => w.name && new RegExp(workflowName).test(w.name),
|
||||
);
|
||||
|
||||
const workflow: IWorkflowDataCreate = {
|
||||
const workflow: WorkflowDataCreate = {
|
||||
...sampleWorkflow,
|
||||
name: `${workflowName} ${sampleSubWorkflows.length + 1}`,
|
||||
};
|
||||
|
||||
@@ -2,12 +2,8 @@
|
||||
import { ref, computed, onMounted } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { useToast } from '@/composables/useToast';
|
||||
import type {
|
||||
ITimeoutHMS,
|
||||
IWorkflowDataUpdate,
|
||||
IWorkflowSettings,
|
||||
IWorkflowShortResponse,
|
||||
} from '@/Interface';
|
||||
import type { ITimeoutHMS, IWorkflowSettings, IWorkflowShortResponse } from '@/Interface';
|
||||
import type { WorkflowDataUpdate } from '@n8n/rest-api-client/api/workflows';
|
||||
import Modal from '@/components/Modal.vue';
|
||||
import {
|
||||
EnterpriseEditionFeature,
|
||||
@@ -298,7 +294,7 @@ const convertToHMS = (num: number): ITimeoutHMS => {
|
||||
|
||||
const saveSettings = async () => {
|
||||
// Set that the active state should be changed
|
||||
const data: IWorkflowDataUpdate & { settings: IWorkflowSettings } = {
|
||||
const data: WorkflowDataUpdate & { settings: IWorkflowSettings } = {
|
||||
settings: workflowSettings.value,
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { computed } from 'vue';
|
||||
import TagsContainer from './TagsContainer.vue';
|
||||
import { useTagsStore } from '@/stores/tags.store';
|
||||
import type { ITag } from '@/Interface';
|
||||
import type { ITag } from '@n8n/rest-api-client/api/tags';
|
||||
|
||||
interface Props {
|
||||
tagIds: string[];
|
||||
|
||||
@@ -14,7 +14,8 @@ import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import type { BaseTextKey } from '@n8n/i18n';
|
||||
import type { Scope } from '@n8n/permissions';
|
||||
import type { BaseFolderItem, BaseResource, ITag, ResourceParentFolder } from '@/Interface';
|
||||
import type { ITag } from '@n8n/rest-api-client/api/tags';
|
||||
import type { BaseFolderItem, BaseResource, ResourceParentFolder } from '@/Interface';
|
||||
import { isSharedResource, isResourceSortableByDate } from '@/utils/typeGuards';
|
||||
import { useN8nLocalStorage } from '@/composables/useN8nLocalStorage';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user