mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
refactor(editor): Migrate versions api to @n8n/rest-client-api (no-changelog) (#16147)
This commit is contained in:
@@ -10,4 +10,5 @@ export * from './orchestration';
|
||||
export * from './roles';
|
||||
export * from './sso';
|
||||
export * from './ui';
|
||||
export * from './versions';
|
||||
export * from './webhooks';
|
||||
|
||||
39
packages/frontend/@n8n/rest-api-client/src/api/versions.ts
Normal file
39
packages/frontend/@n8n/rest-api-client/src/api/versions.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user