refactor(editor): Migrate versions api to @n8n/rest-client-api (no-changelog) (#16147)

This commit is contained in:
Alex Grozav
2025-06-10 09:47:51 +02:00
committed by GitHub
parent 5deab75c7d
commit 07ed01d9fc
11 changed files with 65 additions and 62 deletions

View File

@@ -10,4 +10,5 @@ export * from './orchestration';
export * from './roles';
export * from './sso';
export * from './ui';
export * from './versions';
export * from './webhooks';

View File

@@ -0,0 +1,39 @@
import { INSTANCE_ID_HEADER } from '@n8n/constants';
import type { INodeParameters } from 'n8n-workflow';
import { get } from '../utils';
export interface VersionNode {
name: string;
displayName: string;
icon: string;
iconUrl?: string;
defaults: INodeParameters;
iconData: {
type: string;
icon?: string;
fileBuffer?: string;
};
typeVersion?: number;
}
export interface Version {
name: string;
nodes: VersionNode[];
createdAt: string;
description: string;
documentationUrl: string;
hasBreakingChange: boolean;
hasSecurityFix: boolean;
hasSecurityIssue: boolean;
securityIssueFixVersion: string;
}
export async function getNextVersions(
endpoint: string,
version: string,
instanceId: string,
): Promise<Version[]> {
const headers = { [INSTANCE_ID_HEADER as string]: instanceId };
return await get(endpoint, version, {}, headers);
}