feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
import type {
|
|
|
|
|
IExecuteFunctions,
|
|
|
|
|
INodeExecutionData,
|
|
|
|
|
INodeType,
|
|
|
|
|
INodeTypeDescription,
|
|
|
|
|
INodeProperties,
|
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
import { NodeConnectionType, NodeOperationError } from 'n8n-workflow';
|
|
|
|
|
|
2025-06-11 16:09:26 +00:00
|
|
|
import * as sunoApi from '../../utils/sunoApi';
|
|
|
|
|
import type { SunoPromptOptions } from '../../interfaces/SunoTypes';
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
|
|
|
|
|
export class SunoNode implements INodeType {
|
|
|
|
|
description: INodeTypeDescription = {
|
|
|
|
|
displayName: 'Suno',
|
|
|
|
|
name: 'suno',
|
|
|
|
|
icon: 'file:suno.svg',
|
|
|
|
|
group: ['ai'],
|
|
|
|
|
version: 1,
|
|
|
|
|
subtitle: '={{$parameter["operation"]}}',
|
|
|
|
|
description: 'Integrates with Suno AI for music generation',
|
|
|
|
|
defaults: {
|
|
|
|
|
name: 'Suno',
|
|
|
|
|
},
|
|
|
|
|
inputs: [NodeConnectionType.Main],
|
|
|
|
|
outputs: [NodeConnectionType.Main],
|
|
|
|
|
credentials: [
|
|
|
|
|
{
|
2025-06-11 16:09:26 +00:00
|
|
|
name: 'sunoApi',
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
required: true,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
properties: [
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Operation',
|
|
|
|
|
name: 'operation',
|
|
|
|
|
type: 'options',
|
|
|
|
|
noDataExpression: true,
|
|
|
|
|
options: [
|
2025-06-11 16:09:26 +00:00
|
|
|
{
|
|
|
|
|
name: 'Login',
|
|
|
|
|
value: 'login',
|
|
|
|
|
description: 'Perform login to Suno API (for testing)',
|
|
|
|
|
action: 'Login',
|
|
|
|
|
},
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
{
|
|
|
|
|
name: 'Generate Song from Prompt',
|
|
|
|
|
value: 'generateSongFromPrompt',
|
|
|
|
|
description: 'Create a new song based on a text prompt',
|
|
|
|
|
action: 'Generate song from prompt',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Upload Track Reference',
|
|
|
|
|
value: 'uploadTrackReference',
|
|
|
|
|
description: 'Upload a reference track for generation',
|
|
|
|
|
action: 'Upload track reference',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Get Track Status',
|
|
|
|
|
value: 'getTrackStatus',
|
|
|
|
|
description: 'Get the status of a generated track',
|
|
|
|
|
action: 'Get track status',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'Download Track',
|
|
|
|
|
value: 'downloadTrack',
|
|
|
|
|
description: 'Download a generated track',
|
|
|
|
|
action: 'Download track',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'List Previous Songs',
|
|
|
|
|
value: 'listPreviousSongs',
|
|
|
|
|
description: 'List previously generated songs',
|
|
|
|
|
action: 'List previous songs',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
default: 'generateSongFromPrompt',
|
|
|
|
|
},
|
2025-06-11 16:09:26 +00:00
|
|
|
// Properties for 'login' (if not using credentials directly for this action)
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Email (for Login Operation)',
|
|
|
|
|
name: 'email',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['login'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Password (for Login Operation)',
|
|
|
|
|
name: 'password',
|
|
|
|
|
type: 'string',
|
|
|
|
|
typeOptions: { password: true },
|
|
|
|
|
default: '',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['login'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
// Properties for 'generateSongFromPrompt'
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Prompt',
|
|
|
|
|
name: 'prompt',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
2025-06-11 16:09:26 +00:00
|
|
|
required: true,
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
placeholder: 'e.g., Epic orchestral score for a space battle',
|
|
|
|
|
description: 'The text prompt to generate music from',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['generateSongFromPrompt'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-06-11 16:09:26 +00:00
|
|
|
// TODO: Add more options for prompt generation if desired
|
|
|
|
|
// e.g., style, instrumental, mood
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
// Properties for 'getTrackStatus' and 'downloadTrack'
|
|
|
|
|
{
|
|
|
|
|
displayName: 'Track ID',
|
|
|
|
|
name: 'trackId',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
placeholder: 'Enter Track ID',
|
|
|
|
|
description: 'The ID of the track',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['getTrackStatus', 'downloadTrack'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
// Properties for 'uploadTrackReference'
|
|
|
|
|
{
|
|
|
|
|
displayName: 'File Path',
|
|
|
|
|
name: 'filePath',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: '',
|
|
|
|
|
required: true,
|
|
|
|
|
placeholder: '/path/to/your/audio.mp3',
|
|
|
|
|
description: 'Path to the audio file to upload as reference',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['uploadTrackReference'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-06-11 16:09:26 +00:00
|
|
|
{
|
|
|
|
|
displayName: 'Binary Property Name (for Download)',
|
|
|
|
|
name: 'binaryPropertyName',
|
|
|
|
|
type: 'string',
|
|
|
|
|
default: 'sunoTrackAudio',
|
|
|
|
|
description: 'Name of the binary property where audio data will be stored for download operation.',
|
|
|
|
|
displayOptions: {
|
|
|
|
|
show: {
|
|
|
|
|
operation: ['downloadTrack'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
] as INodeProperties[],
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
2025-06-11 16:09:26 +00:00
|
|
|
* Performs login to the Suno API.
|
|
|
|
|
* @param {IExecuteFunctions} this - The execution context.
|
|
|
|
|
* @returns {Promise<INodeExecutionData[][]>}
|
|
|
|
|
*/
|
|
|
|
|
async login(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
|
|
|
const email = this.getNodeParameter('email', 0, '') as string;
|
|
|
|
|
const password = this.getNodeParameter('password', 0, '') as string;
|
|
|
|
|
try {
|
|
|
|
|
const response = await sunoApi.loginWithCredentials(email, password);
|
|
|
|
|
return [this.helpers.returnJsonArray([response])];
|
|
|
|
|
} catch (error) {
|
|
|
|
|
if (error instanceof Error) {
|
|
|
|
|
throw new NodeOperationError(this.getNode(), error, { itemIndex: 0 });
|
|
|
|
|
}
|
|
|
|
|
throw new NodeOperationError(this.getNode(), new Error(String(error)), { itemIndex: 0 });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Generates a song from a prompt using the Suno API.
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
* @param {IExecuteFunctions} this - The execution context.
|
|
|
|
|
* @returns {Promise<INodeExecutionData[][]>}
|
|
|
|
|
*/
|
|
|
|
|
async generateSongFromPrompt(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
2025-06-11 16:09:26 +00:00
|
|
|
const promptText = this.getNodeParameter('prompt', 0, '') as string;
|
|
|
|
|
// const options: SunoPromptOptions = {}; // TODO: Get from node parameters if added
|
|
|
|
|
try {
|
|
|
|
|
const job = await sunoApi.submitPrompt(promptText /*, options */);
|
|
|
|
|
return [this.helpers.returnJsonArray([job])];
|
|
|
|
|
} catch (error) {
|
|
|
|
|
if (error instanceof Error) {
|
|
|
|
|
throw new NodeOperationError(this.getNode(), error, { itemIndex: 0 });
|
|
|
|
|
}
|
|
|
|
|
throw new NodeOperationError(this.getNode(), new Error(String(error)), { itemIndex: 0 });
|
|
|
|
|
}
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2025-06-11 16:09:26 +00:00
|
|
|
* Uploads a track reference to the Suno API.
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
* @param {IExecuteFunctions} this - The execution context.
|
|
|
|
|
* @returns {Promise<INodeExecutionData[][]>}
|
|
|
|
|
*/
|
|
|
|
|
async uploadTrackReference(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
|
|
|
const filePath = this.getNodeParameter('filePath', 0, '') as string;
|
2025-06-11 16:09:26 +00:00
|
|
|
try {
|
|
|
|
|
// TODO: Add options if necessary
|
|
|
|
|
const result = await sunoApi.uploadReferenceTrack(filePath);
|
|
|
|
|
return [this.helpers.returnJsonArray([result])];
|
|
|
|
|
} catch (error) {
|
|
|
|
|
if (error instanceof Error) {
|
|
|
|
|
throw new NodeOperationError(this.getNode(), error, { itemIndex: 0 });
|
|
|
|
|
}
|
|
|
|
|
throw new NodeOperationError(this.getNode(), new Error(String(error)), { itemIndex: 0 });
|
|
|
|
|
}
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2025-06-11 16:09:26 +00:00
|
|
|
* Gets the status of a track from the Suno API.
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
* @param {IExecuteFunctions} this - The execution context.
|
|
|
|
|
* @returns {Promise<INodeExecutionData[][]>}
|
|
|
|
|
*/
|
|
|
|
|
async getTrackStatus(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
|
|
|
const trackId = this.getNodeParameter('trackId', 0, '') as string;
|
2025-06-11 16:09:26 +00:00
|
|
|
try {
|
|
|
|
|
const status = await sunoApi.pollJobStatus(trackId);
|
|
|
|
|
return [this.helpers.returnJsonArray([status])];
|
|
|
|
|
} catch (error) {
|
|
|
|
|
if (error instanceof Error) {
|
|
|
|
|
throw new NodeOperationError(this.getNode(), error, { itemIndex: 0 });
|
|
|
|
|
}
|
|
|
|
|
throw new NodeOperationError(this.getNode(), new Error(String(error)), { itemIndex: 0 });
|
|
|
|
|
}
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2025-06-11 16:09:26 +00:00
|
|
|
* Downloads a track from the Suno API.
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
* @param {IExecuteFunctions} this - The execution context.
|
|
|
|
|
* @returns {Promise<INodeExecutionData[][]>}
|
|
|
|
|
*/
|
|
|
|
|
async downloadTrack(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
|
|
|
const trackId = this.getNodeParameter('trackId', 0, '') as string;
|
2025-06-11 16:09:26 +00:00
|
|
|
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', 0, 'sunoTrackAudio') as string;
|
|
|
|
|
try {
|
|
|
|
|
const audioBuffer = await sunoApi.downloadTrack(trackId);
|
|
|
|
|
const executionData = this.helpers.returnJsonArray([{ trackId, message: 'Audio data attached in binary property.' }])[0];
|
|
|
|
|
if (executionData.json) { // Ensure json property exists
|
|
|
|
|
executionData.binary = { [binaryPropertyName]: await this.helpers.prepareBinaryData(audioBuffer, binaryPropertyName + '.mp3') };
|
|
|
|
|
}
|
|
|
|
|
return [[executionData]];
|
|
|
|
|
} catch (error) {
|
|
|
|
|
if (error instanceof Error) {
|
|
|
|
|
throw new NodeOperationError(this.getNode(), error, { itemIndex: 0 });
|
|
|
|
|
}
|
|
|
|
|
throw new NodeOperationError(this.getNode(), new Error(String(error)), { itemIndex: 0 });
|
|
|
|
|
}
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2025-06-11 16:09:26 +00:00
|
|
|
* Lists previous songs from the Suno API.
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
* @param {IExecuteFunctions} this - The execution context.
|
|
|
|
|
* @returns {Promise<INodeExecutionData[][]>}
|
|
|
|
|
*/
|
|
|
|
|
async listPreviousSongs(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
2025-06-11 16:09:26 +00:00
|
|
|
try {
|
|
|
|
|
const songs = await sunoApi.listPreviousSongs();
|
|
|
|
|
return [this.helpers.returnJsonArray(songs)];
|
|
|
|
|
} catch (error) {
|
|
|
|
|
if (error instanceof Error) {
|
|
|
|
|
throw new NodeOperationError(this.getNode(), error, { itemIndex: 0 });
|
|
|
|
|
}
|
|
|
|
|
throw new NodeOperationError(this.getNode(), new Error(String(error)), { itemIndex: 0 });
|
|
|
|
|
}
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
|
|
|
const operation = this.getNodeParameter('operation', 0, '') as string;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
switch (operation) {
|
2025-06-11 16:09:26 +00:00
|
|
|
case 'login':
|
|
|
|
|
return this.login(this);
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
case 'generateSongFromPrompt':
|
|
|
|
|
return this.generateSongFromPrompt(this);
|
|
|
|
|
case 'uploadTrackReference':
|
|
|
|
|
return this.uploadTrackReference(this);
|
|
|
|
|
case 'getTrackStatus':
|
|
|
|
|
return this.getTrackStatus(this);
|
|
|
|
|
case 'downloadTrack':
|
|
|
|
|
return this.downloadTrack(this);
|
|
|
|
|
case 'listPreviousSongs':
|
|
|
|
|
return this.listPreviousSongs(this);
|
|
|
|
|
default:
|
|
|
|
|
throw new NodeOperationError(this.getNode(), `The operation "${operation}" is not supported.`);
|
|
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
if (this.continueOnFail()) {
|
2025-06-11 16:09:26 +00:00
|
|
|
const item = this.getInputData(0)?.[0];
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
return [this.prepareOutputData([{ json: {}, error: error, pairedItem: item ? { item: 0 } : undefined }])];
|
|
|
|
|
} else {
|
2025-06-11 16:09:26 +00:00
|
|
|
throw error;
|
feat: Initial structure for Suno AI n8n node
I've set up the foundational boilerplate for the Suno AI integration.
Key changes include:
- Restructured directories for nodes, credentials, interfaces, utils, tests, and docs.
- Renamed and updated example files to Suno-specific names and conventions (SunoApi.credentials.ts, Suno.node.ts).
- Updated package.json and root README.md for the Suno AI node.
- Created .env.example with placeholders for Suno environment variables.
- Added a dev-log.md with initial notes on authentication research strategy.
- Scaffolded utils/sunoApi.ts with placeholder API functions and JSDoc comments.
- Scaffolded nodes/Suno/Suno.node.ts with operations, properties, execute routing, and a placeholder SVG icon.
- Scaffolded nodes/Suno/SunoTrigger.node.ts with a basic trigger structure and properties.
- Defined initial TypeScript types in interfaces/SunoTypes.ts for common data structures (SunoTrack, SunoJob, etc.).
- Created placeholder README.md files in new subdirectories.
This commit establishes the project structure and lays the groundwork for implementing Suno AI API interactions and node functionality.
2025-05-23 17:03:46 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|