"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.invoiceFields = exports.invoiceOperations = void 0; exports.invoiceOperations = [ { displayName: 'Operation', name: 'operation', type: 'options', noDataExpression: true, displayOptions: { show: { resource: ['invoice'], }, }, options: [ { name: 'Create', value: 'create', description: 'Create an invoice', action: 'Create an invoice', }, { name: 'Get', value: 'get', description: 'Get an invoice by ID', action: 'Get an invoice', }, { name: 'Get Many', value: 'getAll', description: 'Get many invoices', action: 'Get many invoices', }, { name: 'Create Quote', value: 'createQuote', description: 'Generate a quote for an invoice', action: 'Create quote for an invoice', }, { name: 'Cancel', value: 'cancel', description: 'Cancel an unpaid invoice', action: 'Cancel an invoice', }, ], default: 'getAll', }, ]; exports.invoiceFields = [ // ---------------------------------- // invoice:create // ---------------------------------- { displayName: 'Correlation ID', name: 'correlationId', type: 'string', default: '', description: 'Unique identifier for idempotency', displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, }, { displayName: 'Description', name: 'description', type: 'string', default: '', description: 'Description of the invoice', displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, }, { displayName: 'Amount', name: 'amount', type: 'number', typeOptions: { numberPrecision: 8, }, default: 0, description: 'Amount for the invoice (leave empty for any amount)', displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, }, { displayName: 'Currency', name: 'currency', type: 'options', options: [ { name: 'BTC', value: 'BTC' }, { name: 'USD', value: 'USD' }, { name: 'EUR', value: 'EUR' }, { name: 'GBP', value: 'GBP' }, ], default: 'USD', description: 'Currency for the invoice amount', displayOptions: { show: { resource: ['invoice'], operation: ['create'], }, }, }, // ---------------------------------- // invoice:get // ---------------------------------- { displayName: 'Invoice ID', name: 'invoiceId', type: 'string', required: true, default: '', description: 'The ID of the invoice to retrieve', displayOptions: { show: { resource: ['invoice'], operation: ['get', 'createQuote', 'cancel'], }, }, }, // ---------------------------------- // invoice:getAll // ---------------------------------- { displayName: 'Return All', name: 'returnAll', type: 'boolean', default: false, description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { resource: ['invoice'], operation: ['getAll'], }, }, }, { displayName: 'Limit', name: 'limit', type: 'number', typeOptions: { minValue: 1, }, default: 50, description: 'Max number of results to return', displayOptions: { show: { resource: ['invoice'], operation: ['getAll'], returnAll: [false], }, }, }, { displayName: 'Filters', name: 'filters', type: 'collection', placeholder: 'Add Filter', default: {}, displayOptions: { show: { resource: ['invoice'], operation: ['getAll'], }, }, options: [ { displayName: 'Filter (OData)', name: 'filter', type: 'string', default: '', description: 'OData filter expression (e.g., state eq \'UNPAID\')', }, { displayName: 'Order By', name: 'orderBy', type: 'string', default: 'created desc', description: 'OData orderby expression', }, ], }, // ---------------------------------- // invoice:createQuote // ---------------------------------- { displayName: 'Description Hash', name: 'descriptionHash', type: 'string', default: '', description: 'Optional description hash for the quote', displayOptions: { show: { resource: ['invoice'], operation: ['createQuote'], }, }, }, ];