import { type INodeDataBaseSchema, NodeConnectionTypes, type INodeType } from '../../Interface'
import Setter from './setter.vue'
import { getNodeDescription, getNodeDisplayName } from '@/nodes/i18n'

export type CodeData = INodeDataBaseSchema & {
	code: string
	code_language: string
}

export const codeNode: INodeType = {
	version: ['1'],
	displayName: getNodeDisplayName('code'),
	name: 'code',
	Setter,
	description: getNodeDescription('code'),
	group: 'data',
	icon: 'lucide:code',
	iconColor: '#2e90fa',
	inputs: [NodeConnectionTypes.main],
	outputs: [NodeConnectionTypes.main],
	schema: {
		appAgentId: '',
		parentId: '',
		position: {
			x: 20,
			y: 30
		},
		width: 96,
		height: 96,
		selected: false,
		nodeType: 'code',
		zIndex: 1,
		data: {
			code: '',
			code_language: 'javascript'
		}
	}
}
