refactor(editor): Move cloudPlans api to @n8n/rest-api-client (no-changelog) (#16182)

This commit is contained in:
Alex Grozav
2025-06-10 18:03:24 +02:00
committed by GitHub
parent b7c9d4e3b2
commit a54f0c8af7
9 changed files with 73 additions and 68 deletions

View File

@@ -46,6 +46,7 @@ import type {
ISourceData,
} from 'n8n-workflow';
import type { Version, VersionNode } from '@n8n/rest-api-client/api/versions';
import type { Cloud, InstanceUsage } from '@n8n/rest-api-client/api/cloudPlans';
import type {
AI_NODE_CREATOR_VIEW,
@@ -1300,39 +1301,6 @@ export type ExecutionsQueryFilter = {
vote?: ExecutionFilterVote;
};
export declare namespace Cloud {
export interface PlanData {
planId: number;
monthlyExecutionsLimit: number;
activeWorkflowsLimit: number;
credentialsLimit: number;
isActive: boolean;
displayName: string;
expirationDate: string;
metadata: PlanMetadata;
}
export interface PlanMetadata {
version: 'v1';
group: 'opt-out' | 'opt-in' | 'trial';
slug: 'pro-1' | 'pro-2' | 'starter' | 'trial-1';
trial?: Trial;
}
interface Trial {
length: number;
gracePeriod: number;
}
export type UserAccount = {
confirmed: boolean;
username: string;
email: string;
hasEarlyAccess?: boolean;
role?: string;
};
}
export interface CloudPlanState {
initialized: boolean;
data: Cloud.PlanData | null;
@@ -1340,12 +1308,6 @@ export interface CloudPlanState {
loadingPlan: boolean;
}
export interface InstanceUsage {
timeframe?: string;
executions: number;
activeWorkflows: number;
}
export type CloudPlanAndUsageData = Cloud.PlanData & { usage: InstanceUsage };
export interface ExternalSecretsProviderSecret {