n8n-nodes-alegra-unofficial
Version:
Unofficial Alegra node for n8n - Community integration with Alegra's accounting platform. NOT OFFICIALLY SUPPORTED BY ALEGRA.
517 lines • 15.2 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.itemOperations = void 0;
exports.itemOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
displayOptions: {
show: {
resource: ['item'],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a new item (product or service)',
action: 'Create an item',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete an item',
action: 'Delete an item',
},
{
name: 'Get',
value: 'get',
description: 'Get an item by ID',
action: 'Get an item',
},
{
name: 'Get Many',
value: 'getAll',
description: 'Get many items',
action: 'Get many items',
},
{
name: 'Update',
value: 'update',
description: 'Update an item',
action: 'Update an item',
},
],
default: 'create',
},
// Create Item
{
displayName: 'Name',
name: 'name',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['item'],
operation: ['create'],
},
},
description: 'Item name',
},
{
displayName: 'Type',
name: 'type',
type: 'options',
required: true,
options: [
{
name: 'Product',
value: 'product',
},
{
name: 'Service',
value: 'service',
},
],
default: 'product',
displayOptions: {
show: {
resource: ['item'],
operation: ['create'],
},
},
description: 'Type of item',
},
{
displayName: 'Price',
name: 'price',
type: 'number',
typeOptions: {
numberPrecision: 2,
},
required: true,
default: 0,
displayOptions: {
show: {
resource: ['item'],
operation: ['create'],
},
},
description: 'Item price',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['item'],
operation: ['create'],
},
},
options: [
{
displayName: 'Description',
name: 'description',
type: 'string',
typeOptions: {
rows: 4,
},
default: '',
description: 'Item description',
},
{
displayName: 'Reference',
name: 'reference',
type: 'string',
default: '',
description: 'Item reference or SKU',
},
{
displayName: 'Category Name or ID',
name: 'category',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getCategories',
},
default: '',
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
},
{
displayName: 'Tax Name or ID',
name: 'tax',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getTaxes',
},
default: [],
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
},
{
displayName: 'Unit',
name: 'unit',
type: 'string',
default: 'unit',
description: 'Unit of measurement',
},
{
displayName: 'Unit Cost',
name: 'unitCost',
type: 'number',
typeOptions: {
numberPrecision: 2,
},
default: 0,
description: 'Cost per unit',
},
{
displayName: 'Initial Quantity',
name: 'initialQuantity',
type: 'number',
default: 0,
description: 'Initial stock quantity',
displayOptions: {
show: {
'/type': ['product'],
},
},
},
{
displayName: 'Minimum Stock',
name: 'minStock',
type: 'number',
default: 0,
description: 'Minimum stock level',
displayOptions: {
show: {
'/type': ['product'],
},
},
},
{
displayName: 'Maximum Stock',
name: 'maxStock',
type: 'number',
default: 0,
description: 'Maximum stock level',
displayOptions: {
show: {
'/type': ['product'],
},
},
},
{
displayName: 'Product Key',
name: 'productKey',
type: 'string',
default: '',
description: 'Product key for electronic invoicing',
},
{
displayName: 'Active',
name: 'status',
type: 'boolean',
default: true,
description: 'Whether the item is active',
},
],
},
// Get Item
{
displayName: 'Item ID',
name: 'id',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['item'],
operation: ['get', 'delete'],
},
},
description: 'The ID of the item',
},
// Get All Items
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: ['item'],
operation: ['getAll'],
},
},
default: false,
description: 'Whether to return all results or only up to a given limit',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: ['item'],
operation: ['getAll'],
returnAll: [false],
},
},
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 30,
description: 'Max number of results to return',
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
placeholder: 'Add Filter',
default: {},
displayOptions: {
show: {
resource: ['item'],
operation: ['getAll'],
},
},
options: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'Filter by item name',
},
{
displayName: 'Type',
name: 'type',
type: 'options',
options: [
{
name: 'All',
value: '',
},
{
name: 'Product',
value: 'product',
},
{
name: 'Service',
value: 'service',
},
],
default: '',
description: 'Filter by item type',
},
{
displayName: 'Reference',
name: 'reference',
type: 'string',
default: '',
description: 'Filter by reference or SKU',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'All',
value: '',
},
{
name: 'Active',
value: 'active',
},
{
name: 'Inactive',
value: 'inactive',
},
],
default: '',
description: 'Filter by status',
},
{
displayName: 'Category Name or ID',
name: 'category',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getCategories',
},
default: '',
description: 'Filter by category. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'options',
options: [
{
name: 'Name',
value: 'name',
},
{
name: 'ID',
value: 'id',
},
{
name: 'Price',
value: 'price',
},
{
name: 'Reference',
value: 'reference',
},
],
default: 'name',
description: 'Field to order results by',
},
{
displayName: 'Order Direction',
name: 'orderDirection',
type: 'options',
options: [
{
name: 'Ascending',
value: 'ASC',
},
{
name: 'Descending',
value: 'DESC',
},
],
default: 'ASC',
description: 'Order direction',
},
],
},
// Update Item
{
displayName: 'Item ID',
name: 'id',
type: 'string',
required: true,
default: '',
displayOptions: {
show: {
resource: ['item'],
operation: ['update'],
},
},
description: 'The ID of the item to update',
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
resource: ['item'],
operation: ['update'],
},
},
options: [
{
displayName: 'Name',
name: 'name',
type: 'string',
default: '',
description: 'Item name',
},
{
displayName: 'Price',
name: 'price',
type: 'number',
typeOptions: {
numberPrecision: 2,
},
default: 0,
description: 'Item price',
},
{
displayName: 'Description',
name: 'description',
type: 'string',
typeOptions: {
rows: 4,
},
default: '',
description: 'Item description',
},
{
displayName: 'Reference',
name: 'reference',
type: 'string',
default: '',
description: 'Item reference or SKU',
},
{
displayName: 'Category Name or ID',
name: 'category',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getCategories',
},
default: '',
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
},
{
displayName: 'Tax Name or ID',
name: 'tax',
type: 'multiOptions',
typeOptions: {
loadOptionsMethod: 'getTaxes',
},
default: [],
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
},
{
displayName: 'Unit',
name: 'unit',
type: 'string',
default: '',
description: 'Unit of measurement',
},
{
displayName: 'Unit Cost',
name: 'unitCost',
type: 'number',
typeOptions: {
numberPrecision: 2,
},
default: 0,
description: 'Cost per unit',
},
{
displayName: 'Minimum Stock',
name: 'minStock',
type: 'number',
default: 0,
description: 'Minimum stock level',
},
{
displayName: 'Maximum Stock',
name: 'maxStock',
type: 'number',
default: 0,
description: 'Maximum stock level',
},
{
displayName: 'Active',
name: 'status',
type: 'boolean',
default: true,
description: 'Whether the item is active',
},
],
},
];
//# sourceMappingURL=item.operations.js.map