feat(editor): Add 'Whats new' section and modal (#16664)

This commit is contained in:
Jaakko Husso
2025-06-26 16:41:49 +03:00
committed by GitHub
parent fcf559b93d
commit 0b7bca29f8
31 changed files with 1907 additions and 134 deletions

View File

@@ -1,4 +1,4 @@
import { INSTANCE_ID_HEADER } from '@n8n/constants';
import { INSTANCE_ID_HEADER, INSTANCE_VERSION_HEADER } from '@n8n/constants';
import type { INodeParameters } from 'n8n-workflow';
import { get } from '../utils';
@@ -29,11 +29,34 @@ export interface Version {
securityIssueFixVersion: string;
}
export interface WhatsNewArticle {
id: number;
title: string;
createdAt: string;
updatedAt: string | null;
publishedAt: string;
content: string;
calloutTitle: string;
calloutText: string;
}
export async function getNextVersions(
endpoint: string,
version: string,
currentVersion: string,
instanceId: string,
): Promise<Version[]> {
const headers = { [INSTANCE_ID_HEADER as string]: instanceId };
return await get(endpoint, version, {}, headers);
return await get(endpoint, currentVersion, {}, headers);
}
export async function getWhatsNewArticles(
endpoint: string,
currentVersion: string,
instanceId: string,
): Promise<WhatsNewArticle[]> {
const headers = {
[INSTANCE_ID_HEADER as string]: instanceId,
[INSTANCE_VERSION_HEADER as string]: currentVersion,
};
return await get(endpoint, '', {}, headers);
}