- Add Strike API credentials configuration - Implement Strike node with 9 resources (Account, Balance, Currency Exchange, Deposit, Invoice, Payment, Payment Method, Payout, Rates) - Add comprehensive operation descriptions for all resources - Include CLAUDE.MD documentation - Set up build configuration with TypeScript, ESLint, and Prettier 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
214 lines
4.2 KiB
TypeScript
214 lines
4.2 KiB
TypeScript
import type { INodeProperties } from 'n8n-workflow';
|
|
|
|
export const invoiceOperations: INodeProperties[] = [
|
|
{
|
|
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',
|
|
},
|
|
];
|
|
|
|
export const invoiceFields: INodeProperties[] = [
|
|
// ----------------------------------
|
|
// 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'],
|
|
},
|
|
},
|
|
},
|
|
];
|