@pokash/n8n-nodes-optima-rest-api 1.3.0 → 1.3.1
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.
|
@@ -486,36 +486,54 @@ class OptimaRestApi {
|
|
|
486
486
|
],
|
|
487
487
|
default: 'printDocument',
|
|
488
488
|
},
|
|
489
|
-
// Print
|
|
489
|
+
// Print Format ID
|
|
490
490
|
{
|
|
491
|
-
displayName: '
|
|
492
|
-
name: '
|
|
493
|
-
type: '
|
|
494
|
-
required:
|
|
491
|
+
displayName: 'Format ID',
|
|
492
|
+
name: 'formatId',
|
|
493
|
+
type: 'number',
|
|
494
|
+
required: true,
|
|
495
495
|
displayOptions: {
|
|
496
496
|
show: {
|
|
497
497
|
resource: ['print'],
|
|
498
498
|
operation: ['printDocument'],
|
|
499
499
|
},
|
|
500
500
|
},
|
|
501
|
-
default:
|
|
502
|
-
|
|
503
|
-
description: 'SQL filter to select documents (e.g. "TrN_TrNID = 123" or "EDN_EDNId = 1002")',
|
|
501
|
+
default: 1,
|
|
502
|
+
description: 'ID of the print format from Optima',
|
|
504
503
|
},
|
|
505
|
-
// Print
|
|
504
|
+
// Print SQL Filter
|
|
506
505
|
{
|
|
507
|
-
displayName: '
|
|
508
|
-
name: '
|
|
509
|
-
type: '
|
|
510
|
-
|
|
506
|
+
displayName: 'SQL Filter',
|
|
507
|
+
name: 'filtrSQL',
|
|
508
|
+
type: 'fixedCollection',
|
|
509
|
+
typeOptions: {
|
|
510
|
+
multipleValues: false,
|
|
511
|
+
multipleValueButtonText: 'Add Filter',
|
|
512
|
+
},
|
|
511
513
|
displayOptions: {
|
|
512
514
|
show: {
|
|
513
515
|
resource: ['print'],
|
|
514
516
|
operation: ['printDocument'],
|
|
515
517
|
},
|
|
516
518
|
},
|
|
517
|
-
default:
|
|
518
|
-
description: '
|
|
519
|
+
default: {},
|
|
520
|
+
description: 'SQL filter to select documents',
|
|
521
|
+
options: [
|
|
522
|
+
{
|
|
523
|
+
name: 'filter',
|
|
524
|
+
displayName: 'Filter',
|
|
525
|
+
values: [
|
|
526
|
+
{
|
|
527
|
+
displayName: 'Expression',
|
|
528
|
+
name: 'expression',
|
|
529
|
+
type: 'string',
|
|
530
|
+
default: '',
|
|
531
|
+
placeholder: 'TrN_TrNID = 123',
|
|
532
|
+
description: 'SQL filter expression (e.g. "EDN_EDNId = 1002")',
|
|
533
|
+
},
|
|
534
|
+
],
|
|
535
|
+
},
|
|
536
|
+
],
|
|
519
537
|
},
|
|
520
538
|
// Print Dynamic Parameters
|
|
521
539
|
{
|
|
@@ -524,6 +542,7 @@ class OptimaRestApi {
|
|
|
524
542
|
type: 'fixedCollection',
|
|
525
543
|
typeOptions: {
|
|
526
544
|
multipleValues: true,
|
|
545
|
+
multipleValueButtonText: 'Add Parameter',
|
|
527
546
|
},
|
|
528
547
|
displayOptions: {
|
|
529
548
|
show: {
|
|
@@ -532,7 +551,6 @@ class OptimaRestApi {
|
|
|
532
551
|
},
|
|
533
552
|
},
|
|
534
553
|
default: {},
|
|
535
|
-
placeholder: 'Add Parameter',
|
|
536
554
|
description: 'Dynamic parameters passed to the print template',
|
|
537
555
|
options: [
|
|
538
556
|
{
|
|
@@ -544,14 +562,14 @@ class OptimaRestApi {
|
|
|
544
562
|
name: 'name',
|
|
545
563
|
type: 'string',
|
|
546
564
|
default: '',
|
|
547
|
-
|
|
565
|
+
placeholder: 'Parameter name',
|
|
548
566
|
},
|
|
549
567
|
{
|
|
550
568
|
displayName: 'Value',
|
|
551
569
|
name: 'value',
|
|
552
570
|
type: 'string',
|
|
553
571
|
default: '',
|
|
554
|
-
|
|
572
|
+
placeholder: 'Parameter value',
|
|
555
573
|
},
|
|
556
574
|
],
|
|
557
575
|
},
|
|
@@ -974,14 +992,17 @@ class OptimaRestApi {
|
|
|
974
992
|
}
|
|
975
993
|
else if (resource === 'print') {
|
|
976
994
|
if (operation === 'printDocument') {
|
|
977
|
-
const filtrSQL = this.getNodeParameter('filtrSQL', i, '');
|
|
978
995
|
const formatId = this.getNodeParameter('formatId', i);
|
|
996
|
+
const filtrSQLRaw = this.getNodeParameter('filtrSQL', i, {});
|
|
979
997
|
const dynamicParamsRaw = this.getNodeParameter('dynamicParameters', i, {});
|
|
980
998
|
const requestBody = {
|
|
981
999
|
FormatId: formatId,
|
|
982
1000
|
};
|
|
983
|
-
if (
|
|
984
|
-
|
|
1001
|
+
if (filtrSQLRaw.filter) {
|
|
1002
|
+
const filter = filtrSQLRaw.filter;
|
|
1003
|
+
if (filter.expression) {
|
|
1004
|
+
requestBody.FiltrSQL = filter.expression;
|
|
1005
|
+
}
|
|
985
1006
|
}
|
|
986
1007
|
if (dynamicParamsRaw.parameter) {
|
|
987
1008
|
const params = dynamicParamsRaw.parameter;
|