n8n-bookstack-agent-tool
Version:
Comprehensive BookStack API integration tool for n8n AI Agent with MCP framework compatibility
249 lines • 9.94 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BookStackAgentTool = void 0;
const gui_config_js_1 = require("../auth/gui-config.js");
class BookStackAgentTool {
constructor() {
this.description = {
displayName: 'BookStack Agent Tool',
name: 'bookStackAgentTool',
icon: 'file:bookstack.svg',
group: ['transform'],
version: 1,
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Interact with BookStack API for documentation management',
defaults: {
name: 'BookStack Agent Tool',
},
inputs: ['main'],
outputs: ['main'],
credentials: [
{
name: 'bookStackApi',
required: true,
},
],
properties: [
...gui_config_js_1.N8nConfigGenerator.generateConfigSchema(),
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Books',
value: 'books',
},
{
name: 'Chapters',
value: 'chapters',
},
{
name: 'Pages',
value: 'pages',
},
{
name: 'Shelves',
value: 'shelves',
},
{
name: 'Users',
value: 'users',
},
{
name: 'Roles',
value: 'roles',
},
{
name: 'Attachments',
value: 'attachments',
},
{
name: 'Tags',
value: 'tags',
},
],
default: 'books',
description: 'The resource to operate on',
},
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['books', 'chapters', 'pages', 'shelves', 'users', 'roles', 'attachments', 'tags'],
},
},
options: [
{
name: 'List',
value: 'list',
description: 'Get a list of resources',
action: 'List resources',
},
{
name: 'Get',
value: 'get',
description: 'Get a specific resource',
action: 'Get a resource',
},
{
name: 'Create',
value: 'create',
description: 'Create a new resource',
action: 'Create a resource',
},
{
name: 'Update',
value: 'update',
description: 'Update an existing resource',
action: 'Update a resource',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a resource',
action: 'Delete a resource',
},
],
default: 'list',
description: 'The operation to perform',
},
{
displayName: 'Export Format',
name: 'exportFormat',
type: 'options',
displayOptions: {
show: {
resource: ['books'],
operation: ['export'],
},
},
options: [
{
name: 'HTML',
value: 'html',
},
{
name: 'PDF',
value: 'pdf',
},
{
name: 'Plain Text',
value: 'plaintext',
},
{
name: 'Markdown',
value: 'markdown',
},
],
default: 'html',
description: 'The format to export the book in',
},
{
displayName: 'Resource ID',
name: 'resourceId',
type: 'number',
displayOptions: {
show: {
operation: ['get', 'update', 'delete'],
},
},
default: 1,
description: 'The ID of the resource to operate on',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
options: [
{
displayName: 'Count',
name: 'count',
type: 'number',
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 10,
description: 'Number of records to return',
},
{
displayName: 'Offset',
name: 'offset',
type: 'number',
typeOptions: {
minValue: 0,
},
default: 0,
description: 'Number of records to skip',
},
{
displayName: 'Sort',
name: 'sort',
type: 'string',
default: '+name',
description: 'Sort order (+field for ascending, -field for descending)',
},
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'Name of the resource',
},
{
displayName: 'Description',
name: 'description',
type: 'string',
typeOptions: {
rows: 3,
},
default: '',
description: 'Description of the resource',
},
{
displayName: 'Tags',
name: 'tags',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'tag',
displayName: 'Tag',
values: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'Tag name',
},
{
displayName: 'Value',
name: 'value',
type: 'string',
default: '',
description: 'Tag value',
},
],
},
],
description: 'Tags to assign to the resource',
},
],
},
],
};
}
}
exports.BookStackAgentTool = BookStackAgentTool;
//# sourceMappingURL=node-definition.js.map