Compare commits

...

6 commits

Author SHA1 Message Date
Iván Ovejero 6722996be6
Merge 5b1e4e2f79 into 48294e7ec1 2024-09-19 20:57:47 +02:00
Ricardo Espinoza 48294e7ec1
refactor(editor): Stop importing Vue compiler macros (#10890)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Waiting to run
2024-09-19 13:53:23 -04:00
कारतोफ्फेलस्क्रिप्ट™ fdef6c9f0d
ci: Remove eslint-plugin-prettier again (no-changelog) (#10876) 2024-09-19 16:29:04 +02:00
Tomi Turtiainen 8fb31e8459
fix(benchmark): Simplify binary data scenario setup and use larger binary file (#10879) 2024-09-19 16:21:55 +03:00
Ricardo Espinoza cee57b6504
refactor(editor): Migrate LogStreaming.store.ts to composition API (#10719)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Benchmark Docker Image CI / build (push) Waiting to run
2024-09-19 09:15:01 -04:00
Iván Ovejero 5b1e4e2f79
fix(core): Support CIFS permission restrictions in source control 2024-09-19 12:41:37 +02:00
27 changed files with 270 additions and 306 deletions

View file

@ -72,7 +72,6 @@
"chokidar": "3.5.2", "chokidar": "3.5.2",
"esbuild": "^0.20.2", "esbuild": "^0.20.2",
"formidable": "3.5.1", "formidable": "3.5.1",
"prettier": "^3.2.5",
"pug": "^3.0.3", "pug": "^3.0.3",
"semver": "^7.5.4", "semver": "^7.5.4",
"tslib": "^2.6.2", "tslib": "^2.6.2",

View file

@ -3,8 +3,9 @@ import { check } from 'k6';
const apiBaseUrl = __ENV.API_BASE_URL; const apiBaseUrl = __ENV.API_BASE_URL;
const file = open(__ENV.SCRIPT_FILE_PATH, 'b'); // This creates a 2MB file (16 * 128 * 1024 = 2 * 1024 * 1024 = 2MB)
const filename = String(__ENV.SCRIPT_FILE_PATH).split('/').pop(); const file = Array.from({ length: 128 * 1024 }, () => Math.random().toString().slice(2)).join('');
const filename = 'test.bin';
export default function () { export default function () {
const data = { const data = {

View file

@ -77,7 +77,6 @@ export function handleSummary(data) {
env: { env: {
API_BASE_URL: this.opts.n8nApiBaseUrl, API_BASE_URL: this.opts.n8nApiBaseUrl,
K6_CLOUD_TOKEN: this.opts.k6ApiToken, K6_CLOUD_TOKEN: this.opts.k6ApiToken,
SCRIPT_FILE_PATH: augmentedTestScriptPath,
}, },
stdio: 'inherit', stdio: 'inherit',
})`${k6ExecutablePath} run ${flattedFlags} ${augmentedTestScriptPath}`; })`${k6ExecutablePath} run ${flattedFlags} ${augmentedTestScriptPath}`;

View file

@ -25,7 +25,6 @@ module.exports = {
}, },
{ {
files: ['**/*.vue'], files: ['**/*.vue'],
plugins: isCI ? [] : ['eslint-plugin-prettier'],
rules: { rules: {
'vue/no-deprecated-slot-attribute': 'error', 'vue/no-deprecated-slot-attribute': 'error',
'vue/no-deprecated-slot-scope-attribute': 'error', 'vue/no-deprecated-slot-scope-attribute': 'error',
@ -68,14 +67,6 @@ module.exports = {
], ],
'vue/no-v-html': 'error', 'vue/no-v-html': 'error',
...(isCI
? {}
: {
'prettier/prettier': ['error', { endOfLine: 'auto' }],
'arrow-body-style': 'off',
'prefer-arrow-callback': 'off',
}),
// TODO: remove these // TODO: remove these
'vue/no-mutating-props': 'warn', 'vue/no-mutating-props': 'warn',
'vue/no-side-effects-in-computed-properties': 'warn', 'vue/no-side-effects-in-computed-properties': 'warn',

View file

@ -6,7 +6,6 @@
"@types/eslint": "^8.56.5", "@types/eslint": "^8.56.5",
"@typescript-eslint/eslint-plugin": "^7.2.0", "@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0", "@typescript-eslint/parser": "^7.2.0",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0", "@vue/eslint-config-typescript": "^13.0.0",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"eslint-config-airbnb-typescript": "^18.0.0", "eslint-config-airbnb-typescript": "^18.0.0",
@ -15,7 +14,6 @@
"eslint-plugin-import": "^2.29.1", "eslint-plugin-import": "^2.29.1",
"eslint-plugin-lodash": "^7.4.0", "eslint-plugin-lodash": "^7.4.0",
"eslint-plugin-n8n-local-rules": "^1.0.0", "eslint-plugin-n8n-local-rules": "^1.0.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-unicorn": "^51.0.1", "eslint-plugin-unicorn": "^51.0.1",
"eslint-plugin-unused-imports": "^3.1.0", "eslint-plugin-unused-imports": "^3.1.0",
"eslint-plugin-vue": "^9.23.0", "eslint-plugin-vue": "^9.23.0",

View file

@ -0,0 +1,30 @@
import { mock } from 'jest-mock-extended';
import type { InstanceSettings } from 'n8n-core';
import fsp from 'node:fs/promises';
import { SourceControlPreferencesService } from '../source-control-preferences.service.ee';
describe('SourceControlPreferencesService', () => {
const service = new SourceControlPreferencesService(
mock<InstanceSettings>({ n8nFolder: 'test' }),
mock(),
mock(),
);
describe('getPrivateKeyPath', () => {
it('should return the path to the private key file', async () => {
fsp.writeFile = jest.fn();
// @ts-expect-error Private method
jest.spyOn(service, 'getPrivateKeyFromDatabase').mockResolvedValue('private-key');
await service.getPrivateKeyPath();
expect(fsp.writeFile).toHaveBeenCalledWith(
expect.stringContaining('ssh_private_key_temp'),
'private-key',
{ mode: 0o600, encoding: 'utf8' },
);
});
});
});

View file

@ -3,7 +3,7 @@ import { validate } from 'class-validator';
import { rm as fsRm } from 'fs/promises'; import { rm as fsRm } from 'fs/promises';
import { Cipher, InstanceSettings } from 'n8n-core'; import { Cipher, InstanceSettings } from 'n8n-core';
import { ApplicationError, jsonParse } from 'n8n-workflow'; import { ApplicationError, jsonParse } from 'n8n-workflow';
import { writeFile, chmod, readFile } from 'node:fs/promises'; import { writeFile, readFile } from 'node:fs/promises';
import path from 'path'; import path from 'path';
import Container, { Service } from 'typedi'; import Container, { Service } from 'typedi';
@ -97,9 +97,10 @@ export class SourceControlPreferencesService {
const tempFilePath = path.join(this.instanceSettings.n8nFolder, 'ssh_private_key_temp'); const tempFilePath = path.join(this.instanceSettings.n8nFolder, 'ssh_private_key_temp');
await writeFile(tempFilePath, dbPrivateKey); await writeFile(tempFilePath, dbPrivateKey, {
mode: 0o600, // required by OpenSSH login client
await chmod(tempFilePath, 0o600); encoding: 'utf8',
});
return tempFilePath; return tempFilePath;
} }

View file

@ -1,6 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import { defineProps, withDefaults } from 'vue';
import AssistantAvatar from '../AskAssistantAvatar/AssistantAvatar.vue'; import AssistantAvatar from '../AskAssistantAvatar/AssistantAvatar.vue';
withDefaults( withDefaults(

View file

@ -63,7 +63,7 @@
"n8n-design-system": "workspace:*", "n8n-design-system": "workspace:*",
"n8n-workflow": "workspace:*", "n8n-workflow": "workspace:*",
"pinia": "^2.1.6", "pinia": "^2.1.6",
"prettier": "^3.1.0", "prettier": "^3.3.3",
"qrcode.vue": "^3.3.4", "qrcode.vue": "^3.3.4",
"stream-browserify": "^3.0.0", "stream-browserify": "^3.0.0",
"timeago.js": "^4.0.2", "timeago.js": "^4.0.2",

View file

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineProps, defineEmits } from 'vue'; import { computed } from 'vue';
import TagsContainer from './TagsContainer.vue'; import TagsContainer from './TagsContainer.vue';
import { useAnnotationTagsStore } from '@/stores/tags.store'; import { useAnnotationTagsStore } from '@/stores/tags.store';
import type { ITag } from '@/Interface'; import type { ITag } from '@/Interface';

View file

@ -77,7 +77,7 @@ const onDrag = (event: MouseEvent) => {
if (!isDragging.value && draggingElement.value) { if (!isDragging.value && draggingElement.value) {
isDragging.value = true; isDragging.value = true;
const data = props.targetDataKey ? draggingElement.value.dataset.value : props.data ?? ''; const data = props.targetDataKey ? draggingElement.value.dataset.value : (props.data ?? '');
ndvStore.draggableStartDragging({ ndvStore.draggableStartDragging({
type: props.type, type: props.type,

View file

@ -417,7 +417,7 @@ export default defineComponent({
type="secondary" type="secondary"
hide-icon hide-icon
:transparent="true" :transparent="true"
:node-name="isActiveNodeConfig ? rootNode : currentNodeName ?? ''" :node-name="isActiveNodeConfig ? rootNode : (currentNodeName ?? '')"
:label="$locale.baseText('ndv.input.noOutputData.executePrevious')" :label="$locale.baseText('ndv.input.noOutputData.executePrevious')"
telemetry-source="inputs" telemetry-source="inputs"
data-test-id="execute-previous-node" data-test-id="execute-previous-node"

View file

@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import { withDefaults, defineProps, defineEmits, ref, computed } from 'vue'; import { ref, computed } from 'vue';
import { import {
WEBHOOK_NODE_TYPE, WEBHOOK_NODE_TYPE,
MANUAL_TRIGGER_NODE_TYPE, MANUAL_TRIGGER_NODE_TYPE,

View file

@ -26,7 +26,7 @@ const emit = defineEmits<{
projectRemoved: [value: ProjectSharingData]; projectRemoved: [value: ProjectSharingData];
}>(); }>();
const selectedProject = ref(Array.isArray(model.value) ? '' : model.value?.id ?? ''); const selectedProject = ref(Array.isArray(model.value) ? '' : (model.value?.id ?? ''));
const filter = ref(''); const filter = ref('');
const selectPlaceholder = computed( const selectPlaceholder = computed(
() => props.placeholder ?? locale.baseText('projects.sharing.select.placeholder'), () => props.placeholder ?? locale.baseText('projects.sharing.select.placeholder'),

View file

@ -41,7 +41,7 @@ export default defineComponent({
const projectId = props.projectId ?? inferProjectIdFromRoute(route); const projectId = props.projectId ?? inferProjectIdFromRoute(route);
const resourceType = props.resourceType ?? inferResourceTypeFromRoute(route); const resourceType = props.resourceType ?? inferResourceTypeFromRoute(route);
const resourceId = resourceType const resourceId = resourceType
? props.resourceId ?? inferResourceIdFromRoute(route) ? (props.resourceId ?? inferResourceIdFromRoute(route))
: undefined; : undefined;
return rbacStore.hasScope( return rbacStore.hasScope(

View file

@ -25,7 +25,7 @@ const i18n = useI18n();
const saveButtonLabel = computed(() => { const saveButtonLabel = computed(() => {
return props.isSaving return props.isSaving
? props.savingLabel ?? i18n.baseText('saveButton.saving') ? (props.savingLabel ?? i18n.baseText('saveButton.saving'))
: i18n.baseText('saveButton.save'); : i18n.baseText('saveButton.save');
}); });

View file

@ -87,7 +87,7 @@ const valueToDisplay = computed<NodeParameterValue>(() => {
} }
if (isListMode.value) { if (isListMode.value) {
return props.modelValue ? props.modelValue.cachedResultName ?? props.modelValue.value : ''; return props.modelValue ? (props.modelValue.cachedResultName ?? props.modelValue.value) : '';
} }
return props.modelValue ? props.modelValue.value : ''; return props.modelValue ? props.modelValue.value : '';

View file

@ -37,7 +37,7 @@ const plusLineSize = computed(
small: 46, small: 46,
medium: 66, medium: 66,
large: 80, large: 80,
})[renderOptions.value.outputs?.labelSize ?? runData.value ? 'large' : 'small'], })[(renderOptions.value.outputs?.labelSize ?? runData.value) ? 'large' : 'small'],
); );
function onMouseEnter() { function onMouseEnter() {

View file

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onMounted, onBeforeUnmount, defineProps } from 'vue'; import { ref, computed, onMounted, onBeforeUnmount } from 'vue';
import { useI18n } from '@/composables/useI18n'; import { useI18n } from '@/composables/useI18n';
const props = defineProps<{ const props = defineProps<{

View file

@ -1,5 +1,4 @@
<script setup lang="ts"> <script setup lang="ts">
import { defineProps, defineEmits } from 'vue';
import type { AnnotationVote } from 'n8n-workflow'; import type { AnnotationVote } from 'n8n-workflow';
defineProps<{ defineProps<{

View file

@ -39,7 +39,7 @@ const router = useRouter();
const temporaryExecution = computed<ExecutionSummary | undefined>(() => const temporaryExecution = computed<ExecutionSummary | undefined>(() =>
props.executions.find((execution) => execution.id === props.execution?.id) props.executions.find((execution) => execution.id === props.execution?.id)
? undefined ? undefined
: props.execution ?? undefined, : (props.execution ?? undefined),
); );
const hidePreview = computed(() => { const hidePreview = computed(() => {

View file

@ -7,8 +7,9 @@ import {
hasDestinationId, hasDestinationId,
saveDestinationToDb, saveDestinationToDb,
sendTestMessageToDestination, sendTestMessageToDestination,
} from '../api/eventbus.ee'; } from '@/api/eventbus.ee';
import { useRootStore } from './root.store'; import { useRootStore } from './root.store';
import { ref } from 'vue';
export interface EventSelectionItem { export interface EventSelectionItem {
selected: boolean; selected: boolean;
@ -32,221 +33,242 @@ export interface DestinationSettingsStore {
[key: string]: DestinationStoreItem; [key: string]: DestinationStoreItem;
} }
export const useLogStreamingStore = defineStore('logStreaming', { export const useLogStreamingStore = defineStore('logStreaming', () => {
state: () => ({ const items = ref<DestinationSettingsStore>({});
items: {} as DestinationSettingsStore, const eventNames = ref(new Set<string>());
eventNames: new Set<string>(),
}), const rootStore = useRootStore();
getters: {},
actions: { const addDestination = (destination: MessageEventBusDestinationOptions) => {
addDestination(destination: MessageEventBusDestinationOptions) { if (destination.id && items.value[destination.id]) {
if (destination.id && this.items[destination.id]) { items.value[destination.id].destination = destination;
this.items[destination.id].destination = destination; } else {
} else { setSelectionAndBuildItems(destination);
this.setSelectionAndBuildItems(destination); }
};
const setSelectionAndBuildItems = (destination: MessageEventBusDestinationOptions) => {
if (destination.id) {
if (!items.value[destination.id]) {
items.value[destination.id] = {
destination,
selectedEvents: new Set<string>(),
eventGroups: [],
isNew: false,
} as DestinationStoreItem;
} }
}, items.value[destination.id]?.selectedEvents?.clear();
getDestination(destinationId: string): MessageEventBusDestinationOptions | undefined { if (destination.subscribedEvents) {
if (this.items[destinationId]) { for (const eventName of destination.subscribedEvents) {
return this.items[destinationId].destination; items.value[destination.id]?.selectedEvents?.add(eventName);
} else { }
return;
} }
}, items.value[destination.id].eventGroups = eventGroupsFromStringList(
getAllDestinations(): MessageEventBusDestinationOptions[] { eventNames.value,
const destinations: MessageEventBusDestinationOptions[] = []; items.value[destination.id]?.selectedEvents,
for (const key of Object.keys(this.items)) { );
destinations.push(this.items[key].destination); }
} };
return destinations;
}, const getDestination = (destinationId: string) => {
updateDestination(destination: MessageEventBusDestinationOptions) { if (items.value[destinationId]) {
if (destination.id && this.items[destination.id]) { return items.value[destinationId].destination;
this.$patch((state) => { } else {
if (destination.id && this.items[destination.id]) { return;
state.items[destination.id].destination = destination; }
} };
// to trigger refresh
state.items = { ...state.items }; const getAllDestinations = () => {
}); const destinations: MessageEventBusDestinationOptions[] = [];
} for (const key of Object.keys(items)) {
}, destinations.push(items.value[key].destination);
removeDestination(destinationId: string) { }
if (!destinationId) return; return destinations;
delete this.items[destinationId]; };
if (this.items[destinationId]) {
this.$patch({ const clearDestinations = () => {
items: { items.value = {};
...this.items, };
},
}); const addEventName = (name: string) => {
} eventNames.value.add(name);
}, };
clearDestinations() {
this.items = {}; const removeEventName = (name: string) => {
}, eventNames.value.delete(name);
addEventName(name: string) { };
this.eventNames.add(name);
}, const clearEventNames = () => {
removeEventName(name: string) { eventNames.value.clear();
this.eventNames.delete(name); };
},
clearEventNames() { const addSelectedEvent = (id: string, name: string) => {
this.eventNames.clear(); items.value[id]?.selectedEvents?.add(name);
}, setSelectedInGroup(id, name, true);
addSelectedEvent(id: string, name: string) { };
this.items[id]?.selectedEvents?.add(name);
this.setSelectedInGroup(id, name, true); const removeSelectedEvent = (id: string, name: string) => {
}, items.value[id]?.selectedEvents?.delete(name);
removeSelectedEvent(id: string, name: string) { setSelectedInGroup(id, name, false);
this.items[id]?.selectedEvents?.delete(name); };
this.setSelectedInGroup(id, name, false);
}, const setSelectedInGroup = (destinationId: string, name: string, isSelected: boolean) => {
getSelectedEvents(destinationId: string): string[] { if (items.value[destinationId]) {
const selectedEvents: string[] = []; const groupName = eventGroupFromEventName(name);
if (this.items[destinationId]) { const groupIndex = items.value[destinationId].eventGroups.findIndex(
for (const group of this.items[destinationId].eventGroups) { (e) => e.name === groupName,
if (group.selected) { );
selectedEvents.push(group.name);
} if (groupIndex > -1) {
for (const event of group.children) { if (groupName === name) {
if (event.selected) { items.value[destinationId].eventGroups[groupIndex].selected = isSelected;
selectedEvents.push(event.name); } else {
const eventIndex = items.value[destinationId].eventGroups[groupIndex].children.findIndex(
(e) => e.name === name,
);
if (eventIndex > -1) {
items.value[destinationId].eventGroups[groupIndex].children[eventIndex].selected =
isSelected;
if (isSelected) {
items.value[destinationId].eventGroups[groupIndex].indeterminate = isSelected;
} else {
let anySelected = false;
for (
let i = 0;
i < items.value[destinationId].eventGroups[groupIndex].children.length;
i++
) {
anySelected =
anySelected ||
items.value[destinationId].eventGroups[groupIndex].children[i].selected;
}
items.value[destinationId].eventGroups[groupIndex].indeterminate = anySelected;
} }
} }
} }
} }
return selectedEvents; }
}, };
setSelectedInGroup(destinationId: string, name: string, isSelected: boolean) {
if (this.items[destinationId]) { const removeDestinationItemTree = (id: string) => {
const groupName = eventGroupFromEventName(name); delete items.value[id];
const groupIndex = this.items[destinationId].eventGroups.findIndex( };
(e) => e.name === groupName,
); const updateDestination = (destination: MessageEventBusDestinationOptions) => {
if (groupIndex > -1) { if (destination.id && items.value[destination.id]) {
if (groupName === name) { items.value[destination.id].destination = destination;
this.$patch((state) => { }
state.items[destinationId].eventGroups[groupIndex].selected = isSelected; };
});
} else { const removeDestination = (destinationId: string) => {
const eventIndex = this.items[destinationId].eventGroups[groupIndex].children.findIndex( if (!destinationId) return;
(e) => e.name === name, delete items.value[destinationId];
); };
if (eventIndex > -1) {
this.$patch((state) => { const getSelectedEvents = (destinationId: string): string[] => {
state.items[destinationId].eventGroups[groupIndex].children[eventIndex].selected = const selectedEvents: string[] = [];
isSelected; if (items.value[destinationId]) {
if (isSelected) { for (const group of items.value[destinationId].eventGroups) {
state.items[destinationId].eventGroups[groupIndex].indeterminate = isSelected; if (group.selected) {
} else { selectedEvents.push(group.name);
let anySelected = false; }
for ( for (const event of group.children) {
let i = 0; if (event.selected) {
i < state.items[destinationId].eventGroups[groupIndex].children.length; selectedEvents.push(event.name);
i++
) {
anySelected =
anySelected ||
state.items[destinationId].eventGroups[groupIndex].children[i].selected;
}
state.items[destinationId].eventGroups[groupIndex].indeterminate = anySelected;
}
});
}
} }
} }
} }
}, }
removeDestinationItemTree(id: string) { return selectedEvents;
delete this.items[id]; };
},
clearDestinationItemTrees() {
this.items = {} as DestinationSettingsStore;
},
setSelectionAndBuildItems(destination: MessageEventBusDestinationOptions) {
if (destination.id) {
if (!this.items[destination.id]) {
this.items[destination.id] = {
destination,
selectedEvents: new Set<string>(),
eventGroups: [],
isNew: false,
} as DestinationStoreItem;
}
this.items[destination.id]?.selectedEvents?.clear();
if (destination.subscribedEvents) {
for (const eventName of destination.subscribedEvents) {
this.items[destination.id]?.selectedEvents?.add(eventName);
}
}
this.items[destination.id].eventGroups = eventGroupsFromStringList(
this.eventNames,
this.items[destination.id]?.selectedEvents,
);
}
},
async saveDestination(destination: MessageEventBusDestinationOptions): Promise<boolean> {
if (!hasDestinationId(destination)) {
return false;
}
const rootStore = useRootStore(); const saveDestination = async (
const selectedEvents = this.getSelectedEvents(destination.id); destination: MessageEventBusDestinationOptions,
try { ): Promise<boolean> => {
await saveDestinationToDb(rootStore.restApiContext, destination, selectedEvents); if (!hasDestinationId(destination)) {
this.updateDestination(destination); return false;
return true; }
} catch (e) {
return false;
}
},
async sendTestMessage(destination: MessageEventBusDestinationOptions): Promise<boolean> {
if (!hasDestinationId(destination)) {
return false;
}
const rootStore = useRootStore(); const selectedEvents = getSelectedEvents(destination.id);
const testResult = await sendTestMessageToDestination(rootStore.restApiContext, destination); try {
return testResult; await saveDestinationToDb(rootStore.restApiContext, destination, selectedEvents);
}, updateDestination(destination);
async fetchEventNames(): Promise<string[]> { return true;
const rootStore = useRootStore(); } catch (e) {
return await getEventNamesFromBackend(rootStore.restApiContext); return false;
}, }
async fetchDestinations(): Promise<MessageEventBusDestinationOptions[]> { };
const rootStore = useRootStore();
return await getDestinationsFromBackend(rootStore.restApiContext); const sendTestMessage = async (
}, destination: MessageEventBusDestinationOptions,
async deleteDestination(destinationId: string) { ): Promise<boolean> => {
const rootStore = useRootStore(); if (!hasDestinationId(destination)) {
await deleteDestinationFromDb(rootStore.restApiContext, destinationId); return false;
this.removeDestination(destinationId); }
},
}, const testResult = await sendTestMessageToDestination(rootStore.restApiContext, destination);
return testResult;
};
const fetchEventNames = async () => {
return await getEventNamesFromBackend(rootStore.restApiContext);
};
const fetchDestinations = async (): Promise<MessageEventBusDestinationOptions[]> => {
return await getDestinationsFromBackend(rootStore.restApiContext);
};
const deleteDestination = async (destinationId: string) => {
await deleteDestinationFromDb(rootStore.restApiContext, destinationId);
removeDestination(destinationId);
};
return {
addDestination,
setSelectionAndBuildItems,
getDestination,
getAllDestinations,
clearDestinations,
addEventName,
removeEventName,
clearEventNames,
addSelectedEvent,
removeSelectedEvent,
setSelectedInGroup,
removeDestinationItemTree,
updateDestination,
removeDestination,
getSelectedEvents,
saveDestination,
sendTestMessage,
fetchEventNames,
fetchDestinations,
deleteDestination,
items,
};
}); });
export function eventGroupFromEventName(eventName: string): string | undefined { export const eventGroupFromEventName = (eventName: string): string | undefined => {
const matches = eventName.match(/^[\w\s]+\.[\w\s]+/); const matches = eventName.match(/^[\w\s]+\.[\w\s]+/);
if (matches && matches?.length > 0) { if (matches && matches?.length > 0) {
return matches[0]; return matches[0];
} }
return undefined; return undefined;
} };
function prettifyEventName(label: string, group = ''): string { const prettifyEventName = (label: string, group = ''): string => {
label = label.replace(group + '.', ''); label = label.replace(group + '.', '');
if (label.length > 0) { if (label.length > 0) {
label = label[0].toUpperCase() + label.substring(1); label = label[0].toUpperCase() + label.substring(1);
label = label.replaceAll('.', ' '); label = label.replaceAll('.', ' ');
} }
return label; return label;
} };
export function eventGroupsFromStringList( export const eventGroupsFromStringList = (
dottedList: Set<string>, dottedList: Set<string>,
selectionList: Set<string> = new Set(), selectionList: Set<string> = new Set(),
) { ) => {
const result = [] as EventSelectionGroup[]; const result = [] as EventSelectionGroup[];
const eventNameArray = Array.from(dottedList.values()); const eventNameArray = Array.from(dottedList.values());
@ -287,4 +309,4 @@ export function eventGroupsFromStringList(
result.push(collection); result.push(collection);
} }
return result; return result;
} };

View file

@ -935,7 +935,7 @@ const workflowPermissions = computed(() => {
const projectPermissions = computed(() => { const projectPermissions = computed(() => {
const project = route.query?.projectId const project = route.query?.projectId
? projectsStore.myProjects.find((p) => p.id === route.query.projectId) ? projectsStore.myProjects.find((p) => p.id === route.query.projectId)
: projectsStore.currentProject ?? projectsStore.personalProject; : (projectsStore.currentProject ?? projectsStore.personalProject);
return getResourcePermissions(project?.scopes); return getResourcePermissions(project?.scopes);
}); });

View file

@ -507,7 +507,7 @@ export default defineComponent({
projectPermissions() { projectPermissions() {
const project = this.$route.query?.projectId const project = this.$route.query?.projectId
? this.projectsStore.myProjects.find((p) => p.id === this.$route.query.projectId) ? this.projectsStore.myProjects.find((p) => p.id === this.$route.query.projectId)
: this.projectsStore.currentProject ?? this.projectsStore.personalProject; : (this.projectsStore.currentProject ?? this.projectsStore.personalProject);
return getResourcePermissions(project?.scopes); return getResourcePermissions(project?.scopes);
}, },
}, },

View file

@ -95,7 +95,7 @@ export default defineComponent({
}, },
async getDestinationDataFromBackend(): Promise<void> { async getDestinationDataFromBackend(): Promise<void> {
this.logStreamingStore.clearEventNames(); this.logStreamingStore.clearEventNames();
this.logStreamingStore.clearDestinationItemTrees(); this.logStreamingStore.clearDestinations();
this.allDestinations = []; this.allDestinations = [];
const eventNamesData = await this.logStreamingStore.fetchEventNames(); const eventNamesData = await this.logStreamingStore.fetchEventNames();
if (eventNamesData) { if (eventNamesData) {

View file

@ -124,7 +124,7 @@ function resetNewVariablesList() {
const resourceToEnvironmentVariable = (data: IResource): EnvironmentVariable => ({ const resourceToEnvironmentVariable = (data: IResource): EnvironmentVariable => ({
id: data.id, id: data.id,
key: data.name, key: data.name,
value: 'value' in data ? data.value ?? '' : '', value: 'value' in data ? (data.value ?? '') : '',
}); });
const environmentVariableToResource = (data: EnvironmentVariable): IResource => ({ const environmentVariableToResource = (data: EnvironmentVariable): IResource => ({

View file

@ -88,7 +88,6 @@ overrides:
chokidar: 3.5.2 chokidar: 3.5.2
esbuild: ^0.20.2 esbuild: ^0.20.2
formidable: 3.5.1 formidable: 3.5.1
prettier: ^3.2.5
pug: ^3.0.3 pug: ^3.0.3
semver: ^7.5.4 semver: ^7.5.4
tslib: ^2.6.2 tslib: ^2.6.2
@ -623,9 +622,6 @@ importers:
'@typescript-eslint/parser': '@typescript-eslint/parser':
specifier: ^7.2.0 specifier: ^7.2.0
version: 7.2.0(eslint@8.57.0)(typescript@5.6.2) version: 7.2.0(eslint@8.57.0)(typescript@5.6.2)
'@vue/eslint-config-prettier':
specifier: ^9.0.0
version: 9.0.0(@types/eslint@8.56.5)(eslint@8.57.0)(prettier@3.2.5)
'@vue/eslint-config-typescript': '@vue/eslint-config-typescript':
specifier: ^13.0.0 specifier: ^13.0.0
version: 13.0.0(eslint-plugin-vue@9.23.0(eslint@8.57.0))(eslint@8.57.0)(typescript@5.6.2) version: 13.0.0(eslint-plugin-vue@9.23.0(eslint@8.57.0))(eslint@8.57.0)(typescript@5.6.2)
@ -650,9 +646,6 @@ importers:
eslint-plugin-n8n-local-rules: eslint-plugin-n8n-local-rules:
specifier: ^1.0.0 specifier: ^1.0.0
version: 1.0.0 version: 1.0.0
eslint-plugin-prettier:
specifier: ^5.1.3
version: 5.1.3(@types/eslint@8.56.5)(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.2.5)
eslint-plugin-unicorn: eslint-plugin-unicorn:
specifier: ^51.0.1 specifier: ^51.0.1
version: 51.0.1(eslint@8.57.0) version: 51.0.1(eslint@8.57.0)
@ -1392,8 +1385,8 @@ importers:
specifier: ^2.1.6 specifier: ^2.1.6
version: 2.1.6(typescript@5.6.2)(vue@3.4.21(typescript@5.6.2)) version: 2.1.6(typescript@5.6.2)(vue@3.4.21(typescript@5.6.2))
prettier: prettier:
specifier: ^3.2.5 specifier: ^3.3.3
version: 3.2.5 version: 3.3.3
qrcode.vue: qrcode.vue:
specifier: ^3.3.4 specifier: ^3.3.4
version: 3.3.4(vue@3.4.21(typescript@5.6.2)) version: 3.3.4(vue@3.4.21(typescript@5.6.2))
@ -3819,10 +3812,6 @@ packages:
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
engines: {node: '>=14'} engines: {node: '>=14'}
'@pkgr/core@0.1.1':
resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==}
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
'@protobufjs/aspromise@1.1.2': '@protobufjs/aspromise@1.1.2':
resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==}
@ -5435,12 +5424,6 @@ packages:
'@vue/devtools-api@6.5.0': '@vue/devtools-api@6.5.0':
resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==} resolution: {integrity: sha512-o9KfBeaBmCKl10usN4crU53fYtC1r7jJwdGKjPT24t348rHxgfpZ0xL3Xm/gLUYnc0oTp8LAmrxOeLyu6tbk2Q==}
'@vue/eslint-config-prettier@9.0.0':
resolution: {integrity: sha512-z1ZIAAUS9pKzo/ANEfd2sO+v2IUalz7cM/cTLOZ7vRFOPk5/xuRKQteOu1DErFLAh/lYGXMVZ0IfYKlyInuDVg==}
peerDependencies:
eslint: '>= 8.0.0'
prettier: ^3.2.5
'@vue/eslint-config-typescript@13.0.0': '@vue/eslint-config-typescript@13.0.0':
resolution: {integrity: sha512-MHh9SncG/sfqjVqjcuFLOLD6Ed4dRAis4HNt0dXASeAuLqIAx4YMB1/m2o4pUKK1vCt8fUvYG8KKX2Ot3BVZTg==} resolution: {integrity: sha512-MHh9SncG/sfqjVqjcuFLOLD6Ed4dRAis4HNt0dXASeAuLqIAx4YMB1/m2o4pUKK1vCt8fUvYG8KKX2Ot3BVZTg==}
engines: {node: ^18.18.0 || >=20.0.0} engines: {node: ^18.18.0 || >=20.0.0}
@ -7171,20 +7154,6 @@ packages:
resolution: {integrity: sha512-Qj8S+YgymYkt/5Fr1buwOTjl0jAERJBp3MA5V8M6NR1HYfErKazVjpOPEy5+04c0vAQZO1mPLGAzanxqqNUIng==} resolution: {integrity: sha512-Qj8S+YgymYkt/5Fr1buwOTjl0jAERJBp3MA5V8M6NR1HYfErKazVjpOPEy5+04c0vAQZO1mPLGAzanxqqNUIng==}
engines: {node: '>=20.15', pnpm: '>=9.6'} engines: {node: '>=20.15', pnpm: '>=9.6'}
eslint-plugin-prettier@5.1.3:
resolution: {integrity: sha512-C9GCVAs4Eq7ZC/XFQHITLiHJxQngdtraXaM+LoUFoFp/lHNl2Zn8f3WQbe9HvTBBQ9YnKFB0/2Ajdqwo5D1EAw==}
engines: {node: ^14.18.0 || >=16.0.0}
peerDependencies:
'@types/eslint': '>=8.0.0'
eslint: '>=8.0.0'
eslint-config-prettier: '*'
prettier: ^3.2.5
peerDependenciesMeta:
'@types/eslint':
optional: true
eslint-config-prettier:
optional: true
eslint-plugin-unicorn@51.0.1: eslint-plugin-unicorn@51.0.1:
resolution: {integrity: sha512-MuR/+9VuB0fydoI0nIn2RDA5WISRn4AsJyNSaNKLVwie9/ONvQhxOBbkfSICBPnzKrB77Fh6CZZXjgTt/4Latw==} resolution: {integrity: sha512-MuR/+9VuB0fydoI0nIn2RDA5WISRn4AsJyNSaNKLVwie9/ONvQhxOBbkfSICBPnzKrB77Fh6CZZXjgTt/4Latw==}
engines: {node: '>=16'} engines: {node: '>=16'}
@ -7388,9 +7357,6 @@ packages:
fast-deep-equal@3.1.3: fast-deep-equal@3.1.3:
resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==}
fast-diff@1.2.0:
resolution: {integrity: sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==}
fast-glob@3.2.12: fast-glob@3.2.12:
resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==}
engines: {node: '>=8.6.0'} engines: {node: '>=8.6.0'}
@ -10440,12 +10406,8 @@ packages:
pretender@3.4.7: pretender@3.4.7:
resolution: {integrity: sha512-jkPAvt1BfRi0RKamweJdEcnjkeu7Es8yix3bJ+KgBC5VpG/Ln4JE3hYN6vJym4qprm8Xo5adhWpm3HCoft1dOw==} resolution: {integrity: sha512-jkPAvt1BfRi0RKamweJdEcnjkeu7Es8yix3bJ+KgBC5VpG/Ln4JE3hYN6vJym4qprm8Xo5adhWpm3HCoft1dOw==}
prettier-linter-helpers@1.0.0: prettier@3.3.3:
resolution: {integrity: sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==} resolution: {integrity: sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==}
engines: {node: '>=6.0.0'}
prettier@3.2.5:
resolution: {integrity: sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==}
engines: {node: '>=14'} engines: {node: '>=14'}
hasBin: true hasBin: true
@ -11516,10 +11478,6 @@ packages:
symbol-tree@3.2.4: symbol-tree@3.2.4:
resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==}
synckit@0.8.8:
resolution: {integrity: sha512-HwOKAP7Wc5aRGYdKH+dw0PRRpbO841v2DENBtjnR5HFWoiNByAl7vrx3p0G/rCyYXQsrxqtX48TImFtPcIHSpQ==}
engines: {node: ^14.18.0 || >=16.0.0}
syslog-client@1.1.1: syslog-client@1.1.1:
resolution: {integrity: sha512-c3qKw8JzCuHt0mwrzKQr8eqOc3RB28HgOpFuwGMO3GLscVpfR+0ECevWLZq/yIJTbx3WTb3QXBFVpTFtKAPDrw==} resolution: {integrity: sha512-c3qKw8JzCuHt0mwrzKQr8eqOc3RB28HgOpFuwGMO3GLscVpfR+0ECevWLZq/yIJTbx3WTb3QXBFVpTFtKAPDrw==}
@ -15578,8 +15536,6 @@ snapshots:
'@pkgjs/parseargs@0.11.0': '@pkgjs/parseargs@0.11.0':
optional: true optional: true
'@pkgr/core@0.1.1': {}
'@protobufjs/aspromise@1.1.2': {} '@protobufjs/aspromise@1.1.2': {}
'@protobufjs/base64@1.1.2': {} '@protobufjs/base64@1.1.2': {}
@ -17814,15 +17770,6 @@ snapshots:
'@vue/devtools-api@6.5.0': {} '@vue/devtools-api@6.5.0': {}
'@vue/eslint-config-prettier@9.0.0(@types/eslint@8.56.5)(eslint@8.57.0)(prettier@3.2.5)':
dependencies:
eslint: 8.57.0
eslint-config-prettier: 9.1.0(eslint@8.57.0)
eslint-plugin-prettier: 5.1.3(@types/eslint@8.56.5)(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.2.5)
prettier: 3.2.5
transitivePeerDependencies:
- '@types/eslint'
'@vue/eslint-config-typescript@13.0.0(eslint-plugin-vue@9.23.0(eslint@8.57.0))(eslint@8.57.0)(typescript@5.6.2)': '@vue/eslint-config-typescript@13.0.0(eslint-plugin-vue@9.23.0(eslint@8.57.0))(eslint@8.57.0)(typescript@5.6.2)':
dependencies: dependencies:
'@typescript-eslint/eslint-plugin': 7.2.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.6.2))(eslint@8.57.0)(typescript@5.6.2) '@typescript-eslint/eslint-plugin': 7.2.0(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.6.2))(eslint@8.57.0)(typescript@5.6.2)
@ -19909,16 +19856,6 @@ snapshots:
- supports-color - supports-color
- typescript - typescript
eslint-plugin-prettier@5.1.3(@types/eslint@8.56.5)(eslint-config-prettier@9.1.0(eslint@8.57.0))(eslint@8.57.0)(prettier@3.2.5):
dependencies:
eslint: 8.57.0
prettier: 3.2.5
prettier-linter-helpers: 1.0.0
synckit: 0.8.8
optionalDependencies:
'@types/eslint': 8.56.5
eslint-config-prettier: 9.1.0(eslint@8.57.0)
eslint-plugin-unicorn@51.0.1(eslint@8.57.0): eslint-plugin-unicorn@51.0.1(eslint@8.57.0):
dependencies: dependencies:
'@babel/helper-validator-identifier': 7.22.20 '@babel/helper-validator-identifier': 7.22.20
@ -20233,8 +20170,6 @@ snapshots:
fast-deep-equal@3.1.3: {} fast-deep-equal@3.1.3: {}
fast-diff@1.2.0: {}
fast-glob@3.2.12: fast-glob@3.2.12:
dependencies: dependencies:
'@nodelib/fs.stat': 2.0.5 '@nodelib/fs.stat': 2.0.5
@ -23882,11 +23817,7 @@ snapshots:
fake-xml-http-request: 2.1.2 fake-xml-http-request: 2.1.2
route-recognizer: 0.3.4 route-recognizer: 0.3.4
prettier-linter-helpers@1.0.0: prettier@3.3.3: {}
dependencies:
fast-diff: 1.2.0
prettier@3.2.5: {}
pretty-bytes@5.6.0: {} pretty-bytes@5.6.0: {}
@ -25252,11 +25183,6 @@ snapshots:
symbol-tree@3.2.4: {} symbol-tree@3.2.4: {}
synckit@0.8.8:
dependencies:
'@pkgr/core': 0.1.1
tslib: 2.6.2
syslog-client@1.1.1: {} syslog-client@1.1.1: {}
tailwindcss@3.4.3(ts-node@10.9.2(@types/node@18.16.16)(typescript@5.6.2)): tailwindcss@3.4.3(ts-node@10.9.2(@types/node@18.16.16)(typescript@5.6.2)):