@pokash/n8n-nodes-optima-rest-api 1.1.10 → 1.1.12
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.
|
@@ -431,22 +431,27 @@ class OptimaRestApi {
|
|
|
431
431
|
// Extract customers array from response
|
|
432
432
|
if (responseData.Customers && Array.isArray(responseData.Customers)) {
|
|
433
433
|
const customers = responseData.Customers;
|
|
434
|
-
//
|
|
434
|
+
// Preserve binary from input if present
|
|
435
435
|
if (items[i].binary) {
|
|
436
436
|
returnData.push({
|
|
437
|
-
json: {
|
|
438
|
-
_metadata: 'Binary passthrough from previous node',
|
|
439
|
-
_itemCount: customers.length
|
|
440
|
-
},
|
|
437
|
+
json: customers[0] || {},
|
|
441
438
|
binary: items[i].binary
|
|
442
439
|
});
|
|
440
|
+
// Add remaining customers (without binary)
|
|
441
|
+
customers.slice(1).forEach((item) => {
|
|
442
|
+
returnData.push({
|
|
443
|
+
json: item
|
|
444
|
+
});
|
|
445
|
+
});
|
|
443
446
|
}
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
447
|
+
else {
|
|
448
|
+
// No binary - just add all customers normally
|
|
449
|
+
customers.forEach((item) => {
|
|
450
|
+
returnData.push({
|
|
451
|
+
json: item
|
|
452
|
+
});
|
|
448
453
|
});
|
|
449
|
-
}
|
|
454
|
+
}
|
|
450
455
|
}
|
|
451
456
|
else if (responseData.Customers) {
|
|
452
457
|
// Single customer - preserve binary
|
|
@@ -575,23 +580,27 @@ class OptimaRestApi {
|
|
|
575
580
|
// Extract dictionary array from response
|
|
576
581
|
if (responseData[dictConfig.dataKey] && Array.isArray(responseData[dictConfig.dataKey])) {
|
|
577
582
|
const dictItems = responseData[dictConfig.dataKey];
|
|
578
|
-
//
|
|
583
|
+
// Preserve binary from input if present
|
|
579
584
|
if (items[i].binary) {
|
|
580
585
|
returnData.push({
|
|
581
|
-
json: {
|
|
582
|
-
_metadata: 'Binary passthrough from previous node',
|
|
583
|
-
_itemCount: dictItems.length,
|
|
584
|
-
_dictionaryType: operation
|
|
585
|
-
},
|
|
586
|
+
json: dictItems[0] || {},
|
|
586
587
|
binary: items[i].binary
|
|
587
588
|
});
|
|
589
|
+
// Add remaining dictionary items (without binary)
|
|
590
|
+
dictItems.slice(1).forEach((item) => {
|
|
591
|
+
returnData.push({
|
|
592
|
+
json: item
|
|
593
|
+
});
|
|
594
|
+
});
|
|
588
595
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
596
|
+
else {
|
|
597
|
+
// No binary - just add all items normally
|
|
598
|
+
dictItems.forEach((item) => {
|
|
599
|
+
returnData.push({
|
|
600
|
+
json: item
|
|
601
|
+
});
|
|
593
602
|
});
|
|
594
|
-
}
|
|
603
|
+
}
|
|
595
604
|
}
|
|
596
605
|
else {
|
|
597
606
|
// Fallback - return entire response if structure is unexpected
|
|
@@ -634,22 +643,27 @@ class OptimaRestApi {
|
|
|
634
643
|
json: true,
|
|
635
644
|
});
|
|
636
645
|
const products = response;
|
|
637
|
-
//
|
|
646
|
+
// Preserve binary from input if present
|
|
638
647
|
if (items[i].binary) {
|
|
639
648
|
returnData.push({
|
|
640
|
-
json: {
|
|
641
|
-
_metadata: 'Binary passthrough from previous node',
|
|
642
|
-
_itemCount: products.length
|
|
643
|
-
},
|
|
649
|
+
json: products[0] || {},
|
|
644
650
|
binary: items[i].binary
|
|
645
651
|
});
|
|
652
|
+
// Add remaining products (without binary)
|
|
653
|
+
products.slice(1).forEach((item) => {
|
|
654
|
+
returnData.push({
|
|
655
|
+
json: item
|
|
656
|
+
});
|
|
657
|
+
});
|
|
646
658
|
}
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
659
|
+
else {
|
|
660
|
+
// No binary - just add all products normally
|
|
661
|
+
products.forEach((item) => {
|
|
662
|
+
returnData.push({
|
|
663
|
+
json: item
|
|
664
|
+
});
|
|
651
665
|
});
|
|
652
|
-
}
|
|
666
|
+
}
|
|
653
667
|
}
|
|
654
668
|
}
|
|
655
669
|
else if (resource === 'print') {
|