@disruptive-learning/n8n-nodes-gigstack 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nodes/Gigstack/GenericFunctions.js +11 -0
- package/dist/nodes/Gigstack/Gigstack.node.js +12 -0
- package/dist/nodes/Gigstack/descriptions/ClientDescription.js +34 -0
- package/dist/nodes/Gigstack/descriptions/InvoiceDescription.js +34 -0
- package/dist/nodes/Gigstack/descriptions/PaymentDescription.js +64 -0
- package/package.json +1 -1
|
@@ -91,5 +91,16 @@ function buildFilterQuery(filters) {
|
|
|
91
91
|
if (filters.createdBefore) {
|
|
92
92
|
qs['created[lte]'] = Math.floor(new Date(filters.createdBefore).getTime() / 1000);
|
|
93
93
|
}
|
|
94
|
+
// Metadata filters - supports both dot notation (metadata.key) and underscore notation (metadata_key)
|
|
95
|
+
if (filters.metadataFilters) {
|
|
96
|
+
const metadataFilters = filters.metadataFilters;
|
|
97
|
+
const metadataFilterItems = metadataFilters.filters || [];
|
|
98
|
+
for (const filter of metadataFilterItems) {
|
|
99
|
+
if (filter.key && filter.value) {
|
|
100
|
+
// Use dot notation as per API spec: metadata.{key}={value}
|
|
101
|
+
qs[`metadata.${filter.key}`] = filter.value;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
94
105
|
return qs;
|
|
95
106
|
}
|
|
@@ -512,6 +512,18 @@ class Gigstack {
|
|
|
512
512
|
if (additionalFields.metadata) {
|
|
513
513
|
body.metadata = JSON.parse(additionalFields.metadata);
|
|
514
514
|
}
|
|
515
|
+
// Handle invoice_config
|
|
516
|
+
const invoiceConfig = this.getNodeParameter('invoiceConfig', i, {});
|
|
517
|
+
if (invoiceConfig && Object.keys(invoiceConfig).length > 0) {
|
|
518
|
+
const config = {};
|
|
519
|
+
if (invoiceConfig.serie)
|
|
520
|
+
config.serie = invoiceConfig.serie;
|
|
521
|
+
if (invoiceConfig.folio && invoiceConfig.folio !== 0)
|
|
522
|
+
config.folio = invoiceConfig.folio;
|
|
523
|
+
if (Object.keys(config).length > 0) {
|
|
524
|
+
body.invoice_config = config;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
515
527
|
responseData = await GenericFunctions_1.gigstackApiRequest.call(this, 'POST', '/payments/register', body, qs);
|
|
516
528
|
responseData = (0, GenericFunctions_1.simplifyResponse)(responseData);
|
|
517
529
|
}
|
|
@@ -575,6 +575,40 @@ exports.clientFields = [
|
|
|
575
575
|
default: '',
|
|
576
576
|
description: 'Filter clients created before this date',
|
|
577
577
|
},
|
|
578
|
+
{
|
|
579
|
+
displayName: 'Metadata Filters',
|
|
580
|
+
name: 'metadataFilters',
|
|
581
|
+
type: 'fixedCollection',
|
|
582
|
+
typeOptions: {
|
|
583
|
+
multipleValues: true,
|
|
584
|
+
},
|
|
585
|
+
default: {},
|
|
586
|
+
description: 'Filter by metadata fields using key-value pairs',
|
|
587
|
+
options: [
|
|
588
|
+
{
|
|
589
|
+
name: 'filters',
|
|
590
|
+
displayName: 'Metadata Filter',
|
|
591
|
+
values: [
|
|
592
|
+
{
|
|
593
|
+
displayName: 'Key',
|
|
594
|
+
name: 'key',
|
|
595
|
+
type: 'string',
|
|
596
|
+
default: '',
|
|
597
|
+
placeholder: 'e.g., external_id',
|
|
598
|
+
description: 'The metadata field key to filter on',
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
displayName: 'Value',
|
|
602
|
+
name: 'value',
|
|
603
|
+
type: 'string',
|
|
604
|
+
default: '',
|
|
605
|
+
placeholder: 'e.g., EXT-123',
|
|
606
|
+
description: 'The value to match',
|
|
607
|
+
},
|
|
608
|
+
],
|
|
609
|
+
},
|
|
610
|
+
],
|
|
611
|
+
},
|
|
578
612
|
],
|
|
579
613
|
},
|
|
580
614
|
// ----------------------------------
|
|
@@ -502,6 +502,40 @@ exports.invoiceFields = [
|
|
|
502
502
|
default: '',
|
|
503
503
|
description: 'Filter invoices created before this date',
|
|
504
504
|
},
|
|
505
|
+
{
|
|
506
|
+
displayName: 'Metadata Filters',
|
|
507
|
+
name: 'metadataFilters',
|
|
508
|
+
type: 'fixedCollection',
|
|
509
|
+
typeOptions: {
|
|
510
|
+
multipleValues: true,
|
|
511
|
+
},
|
|
512
|
+
default: {},
|
|
513
|
+
description: 'Filter by metadata fields using key-value pairs',
|
|
514
|
+
options: [
|
|
515
|
+
{
|
|
516
|
+
name: 'filters',
|
|
517
|
+
displayName: 'Metadata Filter',
|
|
518
|
+
values: [
|
|
519
|
+
{
|
|
520
|
+
displayName: 'Key',
|
|
521
|
+
name: 'key',
|
|
522
|
+
type: 'string',
|
|
523
|
+
default: '',
|
|
524
|
+
placeholder: 'e.g., external_id',
|
|
525
|
+
description: 'The metadata field key to filter on',
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
displayName: 'Value',
|
|
529
|
+
name: 'value',
|
|
530
|
+
type: 'string',
|
|
531
|
+
default: '',
|
|
532
|
+
placeholder: 'e.g., INV-12345',
|
|
533
|
+
description: 'The value to match',
|
|
534
|
+
},
|
|
535
|
+
],
|
|
536
|
+
},
|
|
537
|
+
],
|
|
538
|
+
},
|
|
505
539
|
],
|
|
506
540
|
},
|
|
507
541
|
// ----------------------------------
|
|
@@ -250,6 +250,36 @@ exports.paymentFields = [
|
|
|
250
250
|
},
|
|
251
251
|
description: 'SAT payment form code',
|
|
252
252
|
},
|
|
253
|
+
{
|
|
254
|
+
displayName: 'Invoice Config',
|
|
255
|
+
name: 'invoiceConfig',
|
|
256
|
+
type: 'collection',
|
|
257
|
+
placeholder: 'Add Invoice Config',
|
|
258
|
+
default: {},
|
|
259
|
+
displayOptions: {
|
|
260
|
+
show: {
|
|
261
|
+
resource: ['payment'],
|
|
262
|
+
operation: ['register'],
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
description: 'Configure invoice serie and folio for the generated invoice',
|
|
266
|
+
options: [
|
|
267
|
+
{
|
|
268
|
+
displayName: 'Serie',
|
|
269
|
+
name: 'serie',
|
|
270
|
+
type: 'string',
|
|
271
|
+
default: '',
|
|
272
|
+
description: 'Invoice serie (e.g., "A", "B"). Leave empty for default.',
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
displayName: 'Folio',
|
|
276
|
+
name: 'folio',
|
|
277
|
+
type: 'number',
|
|
278
|
+
default: 0,
|
|
279
|
+
description: 'Invoice folio number. Leave 0 for automatic increment.',
|
|
280
|
+
},
|
|
281
|
+
],
|
|
282
|
+
},
|
|
253
283
|
// ----------------------------------
|
|
254
284
|
// payment: get, cancel, markAsPaid, refund
|
|
255
285
|
// ----------------------------------
|
|
@@ -472,6 +502,40 @@ exports.paymentFields = [
|
|
|
472
502
|
default: '',
|
|
473
503
|
description: 'Filter payments created before this date',
|
|
474
504
|
},
|
|
505
|
+
{
|
|
506
|
+
displayName: 'Metadata Filters',
|
|
507
|
+
name: 'metadataFilters',
|
|
508
|
+
type: 'fixedCollection',
|
|
509
|
+
typeOptions: {
|
|
510
|
+
multipleValues: true,
|
|
511
|
+
},
|
|
512
|
+
default: {},
|
|
513
|
+
description: 'Filter by metadata fields using key-value pairs',
|
|
514
|
+
options: [
|
|
515
|
+
{
|
|
516
|
+
name: 'filters',
|
|
517
|
+
displayName: 'Metadata Filter',
|
|
518
|
+
values: [
|
|
519
|
+
{
|
|
520
|
+
displayName: 'Key',
|
|
521
|
+
name: 'key',
|
|
522
|
+
type: 'string',
|
|
523
|
+
default: '',
|
|
524
|
+
placeholder: 'e.g., order_id',
|
|
525
|
+
description: 'The metadata field key to filter on',
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
displayName: 'Value',
|
|
529
|
+
name: 'value',
|
|
530
|
+
type: 'string',
|
|
531
|
+
default: '',
|
|
532
|
+
placeholder: 'e.g., ORD-12345',
|
|
533
|
+
description: 'The value to match',
|
|
534
|
+
},
|
|
535
|
+
],
|
|
536
|
+
},
|
|
537
|
+
],
|
|
538
|
+
},
|
|
475
539
|
],
|
|
476
540
|
},
|
|
477
541
|
// ----------------------------------
|
package/package.json
CHANGED