n8n-nodes-netbox
Version:
n8n community node for NetBox API integration with comprehensive DCIM, IPAM, Virtualization, Circuits, Wireless, and data center management operations
303 lines (302 loc) • 8.8 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.circuitTypeFields = exports.circuitTypeOperations = void 0;
const baseProperties_1 = require("../baseProperties");
// Circuit Type Operations
exports.circuitTypeOperations = {
...baseProperties_1.baseProperties,
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
domain: ['circuits'],
resource: ['circuit-types'],
},
},
options: [
{
name: 'List',
value: 'list',
description: 'Get all circuit types',
action: 'List all circuit types',
},
{
name: 'Get',
value: 'get',
description: 'Get a circuit type by ID',
action: 'Get a circuit type',
},
{
name: 'Create',
value: 'create',
description: 'Create a new circuit type',
action: 'Create a circuit type',
},
{
name: 'Update',
value: 'update',
description: 'Update an existing circuit type',
action: 'Update a circuit type',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a circuit type',
action: 'Delete a circuit type',
},
],
default: 'list',
};
// Circuit Type Fields
exports.circuitTypeFields = [
// List operation fields
{
...baseProperties_1.returnAllOption,
displayOptions: {
show: {
domain: ['circuits'],
resource: ['circuit-types'],
operation: ['list'],
},
},
},
{
...baseProperties_1.limitOption,
displayOptions: {
show: {
domain: ['circuits'],
resource: ['circuit-types'],
operation: ['list'],
returnAll: [false],
},
},
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
domain: ['circuits'],
resource: ['circuit-types'],
operation: ['list'],
},
},
options: [
{
displayName: 'Name',
name: 'circuitTypeName',
type: 'string',
default: '',
description: 'Filter by circuit type name',
},
{
displayName: 'Name (Contains)',
name: 'name__ic',
type: 'string',
default: '',
description: 'Filter by circuit type names containing this value',
},
{
displayName: 'Slug',
name: 'slug',
type: 'string',
default: '',
description: 'Filter by circuit type slug',
},
{
displayName: 'Tag',
name: 'tag',
type: 'string',
default: '',
description: 'Filter by tag (comma-separated for multiple)',
},
{
displayName: 'Search Query',
name: 'q',
type: 'string',
default: '',
description: 'Search for circuit types matching this query',
},
{
displayName: 'Ordering',
name: 'ordering',
type: 'options',
options: [
{
name: 'Name',
value: 'name',
},
{
name: 'Name (Descending)',
value: '-name',
},
{
name: 'Slug',
value: 'slug',
},
{
name: 'Slug (Descending)',
value: '-slug',
},
],
default: 'name',
description: 'Order of the results',
},
],
},
// Get operation fields
{
displayName: 'Circuit Type ID',
name: 'circuitTypeId',
type: 'number',
required: true,
default: 0,
displayOptions: {
show: {
domain: ['circuits'],
resource: ['circuit-types'],
operation: ['get', 'update', 'delete'],
},
},
description: 'Database ID of the circuit type',
},
// Create operation fields
{
displayName: 'Name',
name: 'circuitTypeName',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
domain: ['circuits'],
resource: ['circuit-types'],
operation: ['create'],
},
},
description: 'Name of the circuit type',
},
{
displayName: 'Slug',
name: 'slug',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
domain: ['circuits'],
resource: ['circuit-types'],
operation: ['create'],
},
},
description: 'URL-friendly unique shorthand',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
domain: ['circuits'],
resource: ['circuit-types'],
operation: ['create'],
},
},
options: [
{
displayName: 'Description',
name: 'circuitTypeDescription',
type: 'string',
default: '',
description: 'Circuit type description',
},
{
displayName: 'Color',
name: 'color',
type: 'string',
default: '',
description: 'Color for circuit type (hex code, e.g., #ff0000)',
},
{
displayName: 'Tags',
name: 'tags',
type: 'string',
default: '',
description: 'Comma-separated list of tag IDs or tag names',
},
{
displayName: 'Custom Fields',
name: 'custom_fields',
type: 'json',
default: '{}',
description: 'Custom fields as JSON object',
},
],
},
// Update operation fields
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
domain: ['circuits'],
resource: ['circuit-types'],
operation: ['update'],
},
},
options: [
{
displayName: 'Name',
name: 'circuitTypeName',
type: 'string',
default: '',
description: 'Name of the circuit type',
},
{
displayName: 'Slug',
name: 'slug',
type: 'string',
default: '',
description: 'URL-friendly unique shorthand',
},
{
displayName: 'Description',
name: 'circuitTypeDescription',
type: 'string',
default: '',
description: 'Circuit type description',
},
{
displayName: 'Color',
name: 'color',
type: 'string',
default: '',
description: 'Color for circuit type (hex code, e.g., #ff0000)',
},
{
displayName: 'Tags',
name: 'tags',
type: 'string',
default: '',
description: 'Comma-separated list of tag IDs or tag names',
},
{
displayName: 'Custom Fields',
name: 'custom_fields',
type: 'json',
default: '{}',
description: 'Custom fields as JSON object',
},
],
},
];