mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 04:10:01 +00:00
feat(editor): Add 'Whats new' section and modal (#16664)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user