mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 20:29:08 +00:00
feat: Expose license feature flags for free AI credits feature to frontend (no-changelog) (#12363)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import type { IRestApiContext } from '@/Interface';
|
||||
import type { ICredentialsResponse, IRestApiContext } from '@/Interface';
|
||||
import type { AskAiRequest, ChatRequest, ReplaceCodeRequest } from '@/types/assistant.types';
|
||||
import { makeRestApiRequest, streamRequest } from '@/utils/apiUtils';
|
||||
import type { IDataObject } from 'n8n-workflow';
|
||||
@@ -42,3 +42,12 @@ export async function generateCodeForPrompt(
|
||||
forNode,
|
||||
} as IDataObject);
|
||||
}
|
||||
|
||||
export async function claimFreeAiCredits(
|
||||
ctx: IRestApiContext,
|
||||
{ projectId }: { projectId?: string },
|
||||
): Promise<ICredentialsResponse> {
|
||||
return await makeRestApiRequest(ctx, 'POST', '/ai/free-credits', {
|
||||
projectId,
|
||||
} as IDataObject);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user