fix(editor): Remove @n8n/permissions from n8n-workflow (no-changelog) (#10399)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-08-14 12:52:19 +02:00 committed by GitHub
parent c0811b218a
commit c4fcbe40c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 13 additions and 16 deletions

View file

@ -385,9 +385,11 @@ export interface IExecutionResponse extends IExecutionBase {
executedNode?: string; executedNode?: string;
} }
export type ExecutionSummaryWithScopes = ExecutionSummary & { scopes: Scope[] };
export interface IExecutionsListResponse { export interface IExecutionsListResponse {
count: number; count: number;
results: ExecutionSummary[]; results: ExecutionSummaryWithScopes[];
estimated: boolean; estimated: boolean;
} }

View file

@ -7,7 +7,7 @@ import { useToast } from '@/composables/useToast';
import { useMessage } from '@/composables/useMessage'; import { useMessage } from '@/composables/useMessage';
import { useI18n } from '@/composables/useI18n'; import { useI18n } from '@/composables/useI18n';
import { useTelemetry } from '@/composables/useTelemetry'; import { useTelemetry } from '@/composables/useTelemetry';
import type { ExecutionFilterType, IWorkflowDb } from '@/Interface'; import type { ExecutionFilterType, ExecutionSummaryWithScopes, IWorkflowDb } from '@/Interface';
import type { ExecutionSummary } from 'n8n-workflow'; import type { ExecutionSummary } from 'n8n-workflow';
import { useWorkflowsStore } from '@/stores/workflows.store'; import { useWorkflowsStore } from '@/stores/workflows.store';
import { useExecutionsStore } from '@/stores/executions.store'; import { useExecutionsStore } from '@/stores/executions.store';
@ -16,7 +16,7 @@ import { getResourcePermissions } from '@/permissions';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
executions: ExecutionSummary[]; executions: ExecutionSummaryWithScopes[];
filters: ExecutionFilterType; filters: ExecutionFilterType;
total: number; total: number;
estimated: boolean; estimated: boolean;
@ -165,7 +165,7 @@ function getExecutionWorkflowName(execution: ExecutionSummary): string {
} }
function getExecutionWorkflowPermissions( function getExecutionWorkflowPermissions(
execution: ExecutionSummary, execution: ExecutionSummaryWithScopes,
): PermissionsRecord['workflow'] { ): PermissionsRecord['workflow'] {
return getResourcePermissions(execution.scopes).workflow; return getResourcePermissions(execution.scopes).workflow;
} }

View file

@ -12,7 +12,7 @@ import { i18nInstance, I18nPlugin } from '@/plugins/i18n';
import { FontAwesomePlugin } from '@/plugins/icons'; import { FontAwesomePlugin } from '@/plugins/icons';
import { GlobalComponentsPlugin } from '@/plugins/components'; import { GlobalComponentsPlugin } from '@/plugins/components';
import { useWorkflowsStore } from '@/stores/workflows.store'; import { useWorkflowsStore } from '@/stores/workflows.store';
import type { IWorkflowDb } from '@/Interface'; import type { ExecutionSummaryWithScopes, IWorkflowDb } from '@/Interface';
let pinia: ReturnType<typeof createPinia>; let pinia: ReturnType<typeof createPinia>;
@ -49,7 +49,7 @@ const generateUndefinedNullOrString = () => {
} }
}; };
const executionDataFactory = (): ExecutionSummary => ({ const executionDataFactory = (): ExecutionSummaryWithScopes => ({
id: faker.string.uuid(), id: faker.string.uuid(),
finished: faker.datatype.boolean(), finished: faker.datatype.boolean(),
mode: faker.helpers.arrayElement(['manual', 'trigger']), mode: faker.helpers.arrayElement(['manual', 'trigger']),

View file

@ -4,6 +4,7 @@ import type { IDataObject, ExecutionSummary } from 'n8n-workflow';
import type { import type {
ExecutionFilterType, ExecutionFilterType,
ExecutionsQueryFilter, ExecutionsQueryFilter,
ExecutionSummaryWithScopes,
IExecutionDeleteFilter, IExecutionDeleteFilter,
IExecutionFlattedResponse, IExecutionFlattedResponse,
IExecutionResponse, IExecutionResponse,
@ -34,7 +35,7 @@ export const useExecutionsStore = defineStore('executions', () => {
const autoRefreshTimeout = ref<NodeJS.Timeout | null>(null); const autoRefreshTimeout = ref<NodeJS.Timeout | null>(null);
const autoRefreshDelay = ref(4 * 1000); // Refresh data every 4 secs const autoRefreshDelay = ref(4 * 1000); // Refresh data every 4 secs
const executionsById = ref<Record<string, ExecutionSummary>>({}); const executionsById = ref<Record<string, ExecutionSummaryWithScopes>>({});
const executionsCount = ref(0); const executionsCount = ref(0);
const executionsCountEstimated = ref(false); const executionsCountEstimated = ref(false);
const executions = computed(() => { const executions = computed(() => {
@ -57,7 +58,7 @@ export const useExecutionsStore = defineStore('executions', () => {
}, {}), }, {}),
); );
const currentExecutionsById = ref<Record<string, ExecutionSummary>>({}); const currentExecutionsById = ref<Record<string, ExecutionSummaryWithScopes>>({});
const currentExecutions = computed(() => { const currentExecutions = computed(() => {
const data = Object.values(currentExecutionsById.value); const data = Object.values(currentExecutionsById.value);
@ -80,14 +81,14 @@ export const useExecutionsStore = defineStore('executions', () => {
const allExecutions = computed(() => [...currentExecutions.value, ...executions.value]); const allExecutions = computed(() => [...currentExecutions.value, ...executions.value]);
function addExecution(execution: ExecutionSummary) { function addExecution(execution: ExecutionSummaryWithScopes) {
executionsById.value[execution.id] = { executionsById.value[execution.id] = {
...execution, ...execution,
mode: execution.mode, mode: execution.mode,
}; };
} }
function addCurrentExecution(execution: ExecutionSummary) { function addCurrentExecution(execution: ExecutionSummaryWithScopes) {
currentExecutionsById.value[execution.id] = { currentExecutionsById.value[execution.id] = {
...execution, ...execution,
mode: execution.mode, mode: execution.mode,

View file

@ -39,7 +39,6 @@
"@types/xml2js": "catalog:" "@types/xml2js": "catalog:"
}, },
"dependencies": { "dependencies": {
"@n8n/permissions": "workspace:*",
"@n8n/tournament": "1.0.5", "@n8n/tournament": "1.0.5",
"@n8n_io/riot-tmpl": "4.0.0", "@n8n_io/riot-tmpl": "4.0.0",
"ast-types": "0.15.2", "ast-types": "0.15.2",

View file

@ -10,7 +10,6 @@ import type { URLSearchParams } from 'url';
import type { RequestBodyMatcher } from 'nock'; import type { RequestBodyMatcher } from 'nock';
import type { Client as SSHClient } from 'ssh2'; import type { Client as SSHClient } from 'ssh2';
import type { Scope } from '@n8n/permissions';
import type { AuthenticationMethod } from './Authentication'; import type { AuthenticationMethod } from './Authentication';
import type { CODE_EXECUTION_MODES, CODE_LANGUAGES, LOG_LEVELS } from './Constants'; import type { CODE_EXECUTION_MODES, CODE_LANGUAGES, LOG_LEVELS } from './Constants';
import type { IDeferredPromise } from './DeferredPromise'; import type { IDeferredPromise } from './DeferredPromise';
@ -2464,7 +2463,6 @@ export interface ExecutionSummary {
nodeExecutionStatus?: { nodeExecutionStatus?: {
[key: string]: IExecutionSummaryNodeExecutionResult; [key: string]: IExecutionSummaryNodeExecutionResult;
}; };
scopes?: Scope[];
} }
export interface IExecutionSummaryNodeExecutionResult { export interface IExecutionSummaryNodeExecutionResult {

View file

@ -1709,9 +1709,6 @@ importers:
packages/workflow: packages/workflow:
dependencies: dependencies:
'@n8n/permissions':
specifier: workspace:*
version: link:../@n8n/permissions
'@n8n/tournament': '@n8n/tournament':
specifier: 1.0.5 specifier: 1.0.5
version: 1.0.5 version: 1.0.5