n8n-nodes-h2i 1.0.5 → 1.0.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.
@@ -413,7 +413,7 @@ class DavixH2I {
413
413
  name: 'actions',
414
414
  type: 'multiOptions',
415
415
  default: [],
416
- description: 'Select one or more actions to apply. Selecting an action reveals its parameters below.',
416
+ description: 'Select one or more actions. Each action reveals its own parameter group below.',
417
417
  displayOptions: { show: { resource: ['image'], operation: ['multitask'] } },
418
418
  options: [
419
419
  { name: 'Format', value: 'format' },
@@ -442,7 +442,13 @@ class DavixH2I {
442
442
  { name: 'SVG', value: 'svg' },
443
443
  { name: 'PDF', value: 'pdf' },
444
444
  ],
445
- displayOptions: { show: { resource: ['image'], operation: ['multitask'] } },
445
+ displayOptions: {
446
+ show: {
447
+ resource: ['image'],
448
+ operation: ['multitask'],
449
+ actions: ['format', 'resize', 'crop', 'transform', 'compress', 'enhance', 'frame', 'background', 'watermark'],
450
+ },
451
+ },
446
452
  },
447
453
  {
448
454
  displayName: 'Keep Metadata',
@@ -450,189 +456,164 @@ class DavixH2I {
450
456
  type: 'boolean',
451
457
  default: false,
452
458
  description: 'Preserve EXIF/metadata for the multitask request when possible.',
453
- displayOptions: { show: { resource: ['image'], operation: ['multitask'] } },
454
- },
455
- {
456
- displayName: 'Format Action',
457
- name: 'formatNotice',
458
- type: 'notice',
459
- default: '────────── Format action ──────────',
460
- description: 'Parameters below apply to the Format action.',
461
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['format'] } },
462
- },
463
- { displayName: 'Width', name: 'formatWidth', type: 'number', default: 0, description: 'Resize width in pixels for format.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['format'] } } },
464
- { displayName: 'Height', name: 'formatHeight', type: 'number', default: 0, description: 'Resize height in pixels for format.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['format'] } } },
465
- {
466
- displayName: 'Resize Action',
467
- name: 'resizeNotice',
468
- type: 'notice',
469
- default: '────────── Resize action ──────────',
470
- description: 'Parameters below apply to the Resize action.',
471
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['resize'] } },
472
- },
473
- { displayName: 'Width', name: 'resizeWidth', type: 'number', default: 0, description: 'Resize width in pixels.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['resize'] } } },
474
- { displayName: 'Height', name: 'resizeHeight', type: 'number', default: 0, description: 'Resize height in pixels.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['resize'] } } },
475
- { displayName: 'Enlarge', name: 'resizeEnlarge', type: 'boolean', default: false, description: 'Allow upscaling when resizing.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['resize'] } } },
476
- {
477
- displayName: 'Normalize Orientation',
478
- name: 'resizeNormalizeOrientation',
479
- type: 'boolean',
480
- default: false,
481
- description: 'Auto-rotate based on EXIF orientation.',
482
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['resize'] } },
483
- },
484
- {
485
- displayName: 'Crop Action',
486
- name: 'cropNotice',
487
- type: 'notice',
488
- default: '────────── Crop action ──────────',
489
- description: 'Parameters below apply to the Crop action.',
490
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['crop'] } },
491
- },
492
- { displayName: 'Crop X', name: 'cropXMulti', type: 'number', default: 0, description: 'Left offset for crop.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['crop'] } } },
493
- { displayName: 'Crop Y', name: 'cropYMulti', type: 'number', default: 0, description: 'Top offset for crop.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['crop'] } } },
494
- { displayName: 'Crop Width', name: 'cropWidthMulti', type: 'number', default: 0, description: 'Crop width in pixels.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['crop'] } } },
495
- { displayName: 'Crop Height', name: 'cropHeightMulti', type: 'number', default: 0, description: 'Crop height in pixels.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['crop'] } } },
496
- {
497
- displayName: 'Normalize Orientation',
498
- name: 'cropNormalizeOrientation',
499
- type: 'boolean',
500
- default: false,
501
- description: 'Auto-rotate before cropping based on EXIF orientation.',
502
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['crop'] } },
503
- },
504
- { displayName: 'Background Color', name: 'cropBackgroundColor', type: 'string', default: '', description: 'Background color used when the crop exceeds bounds.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['crop'] } } },
505
- {
506
- displayName: 'Transform Action',
507
- name: 'transformNotice',
508
- type: 'notice',
509
- default: '────────── Transform action ──────────',
510
- description: 'Parameters below apply to the Transform action.',
511
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['transform'] } },
512
- },
513
- { displayName: 'Rotate (degrees)', name: 'transformRotate', type: 'number', default: 0, description: 'Rotate image by degrees.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['transform'] } } },
514
- { displayName: 'Flip Horizontal', name: 'transformFlipH', type: 'boolean', default: false, description: 'Flip image horizontally.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['transform'] } } },
515
- { displayName: 'Flip Vertical', name: 'transformFlipV', type: 'boolean', default: false, description: 'Flip image vertically.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['transform'] } } },
516
- {
517
- displayName: 'Color Space',
518
- name: 'transformColorSpace',
519
- type: 'options',
520
- default: 'srgb',
521
- description: 'Color space to use for transforms.',
522
- options: [
523
- { name: 'sRGB', value: 'srgb' },
524
- { name: 'Display P3', value: 'display-p3' },
525
- ],
526
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['transform'] } },
527
- },
528
- {
529
- displayName: 'Compress Action',
530
- name: 'compressNotice',
531
- type: 'notice',
532
- default: '────────── Compress action ──────────',
533
- description: 'Parameters below apply to the Compress action.',
534
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['compress'] } },
535
- },
536
- { displayName: 'Quality', name: 'compressQuality', type: 'number', default: 82, description: 'Output quality (1-100).', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['compress'] } } },
537
- { displayName: 'Target Size (KB)', name: 'compressTargetSizeKB', type: 'number', default: 0, description: 'Target compressed size in KB.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['compress'] } } },
538
- { displayName: 'Background Color', name: 'compressBackgroundColor', type: 'string', default: '', description: 'Background color used for compression fills.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['compress'] } } },
539
- {
540
- displayName: 'Color Space',
541
- name: 'compressColorSpace',
542
- type: 'options',
543
- default: 'srgb',
544
- description: 'Color space to use for compression.',
545
- options: [
546
- { name: 'sRGB', value: 'srgb' },
547
- { name: 'Display P3', value: 'display-p3' },
548
- ],
549
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['compress'] } },
550
- },
551
- {
552
- displayName: 'Enhance Action',
553
- name: 'enhanceNotice',
554
- type: 'notice',
555
- default: '────────── Enhance action ──────────',
556
- description: 'Parameters below apply to the Enhance action.',
557
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['enhance'] } },
558
- },
559
- { displayName: 'Blur', name: 'enhanceBlur', type: 'number', default: 0, description: 'Blur radius.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['enhance'] } } },
560
- { displayName: 'Sharpen', name: 'enhanceSharpen', type: 'number', default: 0, description: 'Sharpen amount.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['enhance'] } } },
561
- { displayName: 'Grayscale', name: 'enhanceGrayscale', type: 'boolean', default: false, description: 'Convert to grayscale.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['enhance'] } } },
562
- { displayName: 'Sepia', name: 'enhanceSepia', type: 'boolean', default: false, description: 'Apply sepia tone.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['enhance'] } } },
563
- { displayName: 'Brightness', name: 'enhanceBrightness', type: 'number', default: 0, description: 'Brightness adjustment (-100 to 100).', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['enhance'] } } },
564
- { displayName: 'Contrast', name: 'enhanceContrast', type: 'number', default: 0, description: 'Contrast adjustment (-100 to 100).', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['enhance'] } } },
565
- { displayName: 'Saturation', name: 'enhanceSaturation', type: 'number', default: 0, description: 'Saturation adjustment (-100 to 100).', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['enhance'] } } },
566
- {
567
- displayName: 'Normalize Orientation',
568
- name: 'enhanceNormalizeOrientation',
569
- type: 'boolean',
570
- default: false,
571
- description: 'Auto-rotate based on EXIF orientation before enhancing.',
572
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['enhance'] } },
573
- },
574
- {
575
- displayName: 'Frame Action',
576
- name: 'frameNotice',
577
- type: 'notice',
578
- default: '────────── Frame action ──────────',
579
- description: 'Parameters below apply to the Frame action.',
580
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['frame'] } },
581
- },
582
- { displayName: 'Pad', name: 'framePad', type: 'number', default: 0, description: 'Uniform padding size.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['frame'] } } },
583
- { displayName: 'Pad Color', name: 'framePadColor', type: 'string', default: '', description: 'Padding color (e.g. #ffffff).', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['frame'] } } },
584
- { displayName: 'Border', name: 'frameBorder', type: 'number', default: 0, description: 'Border thickness in pixels.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['frame'] } } },
585
- { displayName: 'Border Color', name: 'frameBorderColor', type: 'string', default: '', description: 'Border color (e.g. #000000).', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['frame'] } } },
586
- { displayName: 'Border Radius', name: 'frameBorderRadius', type: 'number', default: 0, description: 'Rounded corner radius.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['frame'] } } },
587
- {
588
- displayName: 'Background Action',
589
- name: 'backgroundNotice',
590
- type: 'notice',
591
- default: '────────── Background action ──────────',
592
- description: 'Parameters below apply to the Background action.',
593
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['background'] } },
594
- },
595
- { displayName: 'Background Color', name: 'backgroundColorMulti', type: 'string', default: '', description: 'Background color to apply.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['background'] } } },
596
- { displayName: 'Background Blur', name: 'backgroundBlurMulti', type: 'number', default: 0, description: 'Blur background by this radius.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['background'] } } },
597
- { displayName: 'Border Radius', name: 'backgroundBorderRadius', type: 'number', default: 0, description: 'Rounded corner radius.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['background'] } } },
598
- { displayName: 'Pad Color', name: 'backgroundPadColor', type: 'string', default: '', description: 'Padding color for background.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['background'] } } },
599
- {
600
- displayName: 'Watermark Action',
601
- name: 'watermarkNotice',
602
- type: 'notice',
603
- default: '────────── Watermark action ──────────',
604
- description: 'Parameters below apply to the Watermark action.',
605
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['watermark'] } },
459
+ displayOptions: {
460
+ show: {
461
+ resource: ['image'],
462
+ operation: ['multitask'],
463
+ actions: ['format', 'resize', 'crop', 'transform', 'compress', 'enhance', 'frame', 'background', 'watermark'],
464
+ },
465
+ },
606
466
  },
607
- { displayName: 'Watermark Text', name: 'watermarkTextMulti', type: 'string', default: '', description: 'Text watermark content.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['watermark'] } } },
608
- { displayName: 'Watermark Opacity', name: 'watermarkOpacityMulti', type: 'number', default: 0.35, description: 'Watermark opacity (0-1).', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['watermark'] } } },
609
467
  {
610
- displayName: 'Watermark Position',
611
- name: 'watermarkPositionMulti',
612
- type: 'options',
613
- default: 'center',
614
- description: 'Placement for watermark.',
468
+ displayName: 'Action Parameters',
469
+ name: 'imageActionParams',
470
+ type: 'fixedCollection',
471
+ default: {},
472
+ placeholder: 'Add action parameters',
473
+ description: 'Parameters for each selected action.',
474
+ typeOptions: { multipleValues: false },
475
+ displayOptions: { show: { resource: ['image'], operation: ['multitask'] } },
615
476
  options: [
616
- { name: 'Center', value: 'center' },
617
- { name: 'Top Left', value: 'top-left' },
618
- { name: 'Top Right', value: 'top-right' },
619
- { name: 'Bottom Left', value: 'bottom-left' },
620
- { name: 'Bottom Right', value: 'bottom-right' },
477
+ {
478
+ name: 'format',
479
+ displayName: 'Format',
480
+ values: [
481
+ { displayName: 'Width', name: 'formatWidthMulti', type: 'number', default: 0, description: 'Resize width in pixels for format.' },
482
+ { displayName: 'Height', name: 'formatHeightMulti', type: 'number', default: 0, description: 'Resize height in pixels for format.' },
483
+ ],
484
+ },
485
+ {
486
+ name: 'resize',
487
+ displayName: 'Resize',
488
+ values: [
489
+ { displayName: 'Width', name: 'resizeWidthMulti', type: 'number', default: 0, description: 'Resize width in pixels.' },
490
+ { displayName: 'Height', name: 'resizeHeightMulti', type: 'number', default: 0, description: 'Resize height in pixels.' },
491
+ { displayName: 'Enlarge', name: 'resizeEnlargeMulti', type: 'boolean', default: false, description: 'Allow upscaling when resizing.' },
492
+ { displayName: 'Normalize Orientation', name: 'resizeNormalizeOrientationMulti', type: 'boolean', default: false, description: 'Auto-rotate based on EXIF orientation.' },
493
+ ],
494
+ },
495
+ {
496
+ name: 'crop',
497
+ displayName: 'Crop',
498
+ values: [
499
+ { displayName: 'Crop X', name: 'cropXMulti', type: 'number', default: 0, description: 'Left offset for crop.' },
500
+ { displayName: 'Crop Y', name: 'cropYMulti', type: 'number', default: 0, description: 'Top offset for crop.' },
501
+ { displayName: 'Crop Width', name: 'cropWidthMulti', type: 'number', default: 0, description: 'Crop width in pixels.' },
502
+ { displayName: 'Crop Height', name: 'cropHeightMulti', type: 'number', default: 0, description: 'Crop height in pixels.' },
503
+ { displayName: 'Normalize Orientation', name: 'cropNormalizeOrientationMulti', type: 'boolean', default: false, description: 'Auto-rotate before cropping based on EXIF orientation.' },
504
+ { displayName: 'Background Color', name: 'cropBackgroundColorMulti', type: 'string', default: '', description: 'Background color used when the crop exceeds bounds.' },
505
+ ],
506
+ },
507
+ {
508
+ name: 'transform',
509
+ displayName: 'Transform',
510
+ values: [
511
+ { displayName: 'Rotate (degrees)', name: 'transformRotateMulti', type: 'number', default: 0, description: 'Rotate image by degrees.' },
512
+ { displayName: 'Flip Horizontal', name: 'transformFlipHMulti', type: 'boolean', default: false, description: 'Flip image horizontally.' },
513
+ { displayName: 'Flip Vertical', name: 'transformFlipVMulti', type: 'boolean', default: false, description: 'Flip image vertically.' },
514
+ {
515
+ displayName: 'Color Space',
516
+ name: 'transformColorSpaceMulti',
517
+ type: 'options',
518
+ default: 'srgb',
519
+ description: 'Color space to use for transforms.',
520
+ options: [
521
+ { name: 'sRGB', value: 'srgb' },
522
+ { name: 'Display P3', value: 'display-p3' },
523
+ ],
524
+ },
525
+ ],
526
+ },
527
+ {
528
+ name: 'compress',
529
+ displayName: 'Compress',
530
+ values: [
531
+ { displayName: 'Quality', name: 'compressQualityMulti', type: 'number', default: 82, description: 'Output quality (1-100).' },
532
+ { displayName: 'Target Size (KB)', name: 'compressTargetSizeKBMulti', type: 'number', default: 0, description: 'Target compressed size in KB.' },
533
+ { displayName: 'Background Color', name: 'compressBackgroundColorMulti', type: 'string', default: '', description: 'Background color used for compression fills.' },
534
+ {
535
+ displayName: 'Color Space',
536
+ name: 'compressColorSpaceMulti',
537
+ type: 'options',
538
+ default: 'srgb',
539
+ description: 'Color space to use for compression.',
540
+ options: [
541
+ { name: 'sRGB', value: 'srgb' },
542
+ { name: 'Display P3', value: 'display-p3' },
543
+ ],
544
+ },
545
+ ],
546
+ },
547
+ {
548
+ name: 'enhance',
549
+ displayName: 'Enhance',
550
+ values: [
551
+ { displayName: 'Blur', name: 'enhanceBlurMulti', type: 'number', default: 0, description: 'Blur radius.' },
552
+ { displayName: 'Sharpen', name: 'enhanceSharpenMulti', type: 'number', default: 0, description: 'Sharpen amount.' },
553
+ { displayName: 'Grayscale', name: 'enhanceGrayscaleMulti', type: 'boolean', default: false, description: 'Convert to grayscale.' },
554
+ { displayName: 'Sepia', name: 'enhanceSepiaMulti', type: 'boolean', default: false, description: 'Apply sepia tone.' },
555
+ { displayName: 'Brightness', name: 'enhanceBrightnessMulti', type: 'number', default: 0, description: 'Brightness adjustment (-100 to 100).' },
556
+ { displayName: 'Contrast', name: 'enhanceContrastMulti', type: 'number', default: 0, description: 'Contrast adjustment (-100 to 100).' },
557
+ { displayName: 'Saturation', name: 'enhanceSaturationMulti', type: 'number', default: 0, description: 'Saturation adjustment (-100 to 100).' },
558
+ { displayName: 'Normalize Orientation', name: 'enhanceNormalizeOrientationMulti', type: 'boolean', default: false, description: 'Auto-rotate based on EXIF orientation before enhancing.' },
559
+ ],
560
+ },
561
+ {
562
+ name: 'frame',
563
+ displayName: 'Frame',
564
+ values: [
565
+ { displayName: 'Pad', name: 'framePadMulti', type: 'number', default: 0, description: 'Uniform padding size.' },
566
+ { displayName: 'Pad Color', name: 'framePadColorMulti', type: 'string', default: '', description: 'Padding color (e.g. #ffffff).' },
567
+ { displayName: 'Border', name: 'frameBorderMulti', type: 'number', default: 0, description: 'Border thickness in pixels.' },
568
+ { displayName: 'Border Color', name: 'frameBorderColorMulti', type: 'string', default: '', description: 'Border color (e.g. #000000).' },
569
+ { displayName: 'Border Radius', name: 'frameBorderRadiusMulti', type: 'number', default: 0, description: 'Rounded corner radius.' },
570
+ ],
571
+ },
572
+ {
573
+ name: 'background',
574
+ displayName: 'Background',
575
+ values: [
576
+ { displayName: 'Background Color', name: 'backgroundColorMulti', type: 'string', default: '', description: 'Background color to apply.' },
577
+ { displayName: 'Background Blur', name: 'backgroundBlurMulti', type: 'number', default: 0, description: 'Blur background by this radius.' },
578
+ { displayName: 'Border Radius', name: 'backgroundBorderRadiusMulti', type: 'number', default: 0, description: 'Rounded corner radius.' },
579
+ { displayName: 'Pad Color', name: 'backgroundPadColorMulti', type: 'string', default: '', description: 'Padding color for background.' },
580
+ ],
581
+ },
582
+ {
583
+ name: 'watermark',
584
+ displayName: 'Watermark',
585
+ values: [
586
+ { displayName: 'Watermark Text', name: 'watermarkTextMulti', type: 'string', default: '', description: 'Text watermark content.' },
587
+ { displayName: 'Watermark Opacity', name: 'watermarkOpacityMulti', type: 'number', default: 0.35, description: 'Watermark opacity (0-1).' },
588
+ {
589
+ displayName: 'Watermark Position',
590
+ name: 'watermarkPositionMulti',
591
+ type: 'options',
592
+ default: 'center',
593
+ description: 'Placement for watermark.',
594
+ options: [
595
+ { name: 'Center', value: 'center' },
596
+ { name: 'Top Left', value: 'top-left' },
597
+ { name: 'Top Right', value: 'top-right' },
598
+ { name: 'Bottom Left', value: 'bottom-left' },
599
+ { name: 'Bottom Right', value: 'bottom-right' },
600
+ ],
601
+ },
602
+ { displayName: 'Watermark Margin', name: 'watermarkMarginMulti', type: 'number', default: 8, description: 'Margin/padding around watermark.' },
603
+ { displayName: 'Watermark Scale', name: 'watermarkScaleMulti', type: 'number', default: 1, description: 'Scale factor for watermark.' },
604
+ { displayName: 'Watermark Color', name: 'watermarkColorMulti', type: 'string', default: '#000000', description: 'Color for text watermark.' },
605
+ { displayName: 'Watermark Font Size', name: 'watermarkFontSizeMulti', type: 'number', default: 24, description: 'Font size for text watermark.' },
606
+ {
607
+ displayName: 'Watermark Image Binary Property',
608
+ name: 'watermarkImageBinaryProperty',
609
+ type: 'string',
610
+ default: '',
611
+ placeholder: 'watermarkImage',
612
+ description: 'Binary property containing an image watermark (optional).',
613
+ },
614
+ ],
615
+ },
621
616
  ],
622
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['watermark'] } },
623
- },
624
- { displayName: 'Watermark Margin', name: 'watermarkMarginMulti', type: 'number', default: 8, description: 'Margin/padding around watermark.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['watermark'] } } },
625
- { displayName: 'Watermark Scale', name: 'watermarkScaleMulti', type: 'number', default: 1, description: 'Scale factor for watermark.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['watermark'] } } },
626
- { displayName: 'Watermark Color', name: 'watermarkColorMulti', type: 'string', default: '#000000', description: 'Color for text watermark.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['watermark'] } } },
627
- { displayName: 'Watermark Font Size', name: 'watermarkFontSizeMulti', type: 'number', default: 24, description: 'Font size for text watermark.', displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['watermark'] } } },
628
- {
629
- displayName: 'Watermark Image Binary Property',
630
- name: 'watermarkBinaryPropertyMulti',
631
- type: 'string',
632
- default: '',
633
- placeholder: 'watermarkImage',
634
- description: 'Binary property containing an image watermark (optional).',
635
- displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['watermark'] } },
636
617
  },
637
618
  {
638
619
  displayName: 'Download Result(s) as Binary',
@@ -851,134 +832,212 @@ class DavixH2I {
851
832
  displayOptions: { show: { resource: ['tools'], operation: ['multitask'] } },
852
833
  },
853
834
  {
854
- displayName: 'Metadata Tool',
855
- name: 'metadataToolNoticeSingle',
856
- type: 'notice',
857
- default: '────────── Metadata tool ──────────',
858
- description: 'Parameters for the Metadata tool.',
859
- displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['metadata'] } },
860
- },
861
- {
862
- displayName: 'Include Raw EXIF',
863
- name: 'includeRawExifSingle',
864
- type: 'boolean',
865
- default: false,
866
- description: 'Include raw EXIF data when available (metadata tool).',
867
- displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['metadata'] } },
868
- },
869
- {
870
- displayName: 'Palette Tool',
871
- name: 'paletteToolNoticeSingle',
872
- type: 'notice',
873
- default: '────────── Palette tool ──────────',
874
- description: 'Parameters for the Palette tool.',
875
- displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['palette'] } },
876
- },
877
- { displayName: 'Palette Size', name: 'paletteSizeSingle', type: 'number', default: 5, description: 'Number of colors to extract (palette tool).', displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['palette'] } } },
878
- {
879
- displayName: 'Hash Tool',
880
- name: 'hashToolNoticeSingle',
881
- type: 'notice',
882
- default: '────────── Hash tool ──────────',
883
- description: 'Parameters for the Hash tool.',
884
- displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['hash'] } },
885
- },
886
- {
887
- displayName: 'Hash Type',
888
- name: 'hashTypeSingle',
889
- type: 'options',
890
- default: 'phash',
891
- description: 'Hash algorithm to compute (hash tool).',
835
+ // Single-tool parameters grouped to keep property keys unique
836
+ displayName: 'Tool Parameters (Single)',
837
+ name: 'toolParametersSingle',
838
+ type: 'fixedCollection',
839
+ default: {},
840
+ placeholder: 'Add tool parameters',
841
+ description: 'Parameters for the selected tool.',
842
+ typeOptions: { multipleValues: false },
843
+ displayOptions: { show: { resource: ['tools'], operation: ['single'] } },
892
844
  options: [
893
- { name: 'pHash', value: 'phash' },
894
- { name: 'MD5', value: 'md5' },
895
- { name: 'SHA1', value: 'sha1' },
845
+ {
846
+ name: 'metadata',
847
+ displayName: 'Metadata',
848
+ values: [{ displayName: 'Include Raw EXIF', name: 'metadataIncludeRawExifSingle', type: 'boolean', default: false, description: 'Include raw EXIF data when available.' }],
849
+ },
850
+ {
851
+ name: 'palette',
852
+ displayName: 'Palette',
853
+ values: [{ displayName: 'Palette Size', name: 'paletteSizeSingle', type: 'number', default: 5, description: 'Number of colors to extract.' }],
854
+ },
855
+ {
856
+ name: 'hash',
857
+ displayName: 'Hash',
858
+ values: [
859
+ {
860
+ displayName: 'Hash Type',
861
+ name: 'hashTypeSingle',
862
+ type: 'options',
863
+ default: 'phash',
864
+ description: 'Hash algorithm to compute.',
865
+ options: [
866
+ { name: 'pHash', value: 'phash' },
867
+ { name: 'MD5', value: 'md5' },
868
+ { name: 'SHA1', value: 'sha1' },
869
+ ],
870
+ },
871
+ ],
872
+ },
873
+ {
874
+ name: 'similarity',
875
+ displayName: 'Similarity',
876
+ values: [
877
+ { displayName: 'Similarity Mode', name: 'similarityModeSingle', type: 'string', default: '', description: 'Similarity mode.' },
878
+ { displayName: 'Similarity Threshold', name: 'similarityThresholdSingle', type: 'number', default: 0, description: 'Similarity threshold.' },
879
+ ],
880
+ },
881
+ {
882
+ name: 'quality',
883
+ displayName: 'Quality',
884
+ values: [{ displayName: 'Quality Sample', name: 'qualitySampleSingle', type: 'number', default: 0, description: 'Sample size for quality analysis.' }],
885
+ },
886
+ {
887
+ name: 'transparency',
888
+ displayName: 'Transparency',
889
+ values: [{ displayName: 'Transparency Sample', name: 'transparencySampleSingle', type: 'number', default: 0, description: 'Sample size for transparency analysis.' }],
890
+ },
891
+ {
892
+ name: 'efficiency',
893
+ displayName: 'Efficiency',
894
+ values: [
895
+ { displayName: 'Efficiency Format', name: 'efficiencyFormatSingle', type: 'string', default: '', description: 'Output format for efficiency tool.' },
896
+ { displayName: 'Efficiency Quality', name: 'efficiencyQualitySingle', type: 'number', default: 0, description: 'Quality setting for efficiency tool.' },
897
+ ],
898
+ },
896
899
  ],
897
- displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['hash'] } },
898
- },
899
- {
900
- displayName: 'Similarity Tool',
901
- name: 'similarityToolNoticeSingle',
902
- type: 'notice',
903
- default: '────────── Similarity tool ──────────',
904
- description: 'Parameters for the Similarity tool.',
905
- displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['similarity'] } },
906
- },
907
- { displayName: 'Similarity Mode', name: 'similarityModeSingle', type: 'string', default: '', description: 'Similarity mode (similarity tool).', displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['similarity'] } } },
908
- { displayName: 'Similarity Threshold', name: 'similarityThresholdSingle', type: 'number', default: 0, description: 'Similarity threshold (similarity tool).', displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['similarity'] } } },
909
- {
910
- displayName: 'Quality Tool',
911
- name: 'qualityToolNoticeSingle',
912
- type: 'notice',
913
- default: '────────── Quality tool ──────────',
914
- description: 'Parameters for the Quality tool.',
915
- displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['quality'] } },
916
900
  },
917
- { displayName: 'Quality Sample', name: 'qualitySampleSingle', type: 'number', default: 0, description: 'Sample size for quality analysis.', displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['quality'] } } },
918
901
  {
919
- displayName: 'Transparency Tool',
920
- name: 'transparencyToolNoticeSingle',
921
- type: 'notice',
922
- default: '────────── Transparency tool ──────────',
923
- description: 'Parameters for the Transparency tool.',
924
- displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['transparency'] } },
925
- },
926
- { displayName: 'Transparency Sample', name: 'transparencySampleSingle', type: 'number', default: 0, description: 'Sample size for transparency analysis.', displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['transparency'] } } },
927
- {
928
- displayName: 'Efficiency Tool',
929
- name: 'efficiencyToolNoticeSingle',
930
- type: 'notice',
931
- default: '────────── Efficiency tool ──────────',
932
- description: 'Parameters for the Efficiency tool.',
933
- displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['efficiency'] } },
934
- },
935
- { displayName: 'Efficiency Format', name: 'efficiencyFormatSingle', type: 'string', default: '', description: 'Output format for efficiency tool.', displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['efficiency'] } } },
936
- { displayName: 'Efficiency Quality', name: 'efficiencyQualitySingle', type: 'number', default: 0, description: 'Quality setting for efficiency tool.', displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['efficiency'] } } },
937
- {
938
- displayName: 'Metadata Tool',
939
- name: 'metadataToolNoticeMulti',
940
- type: 'notice',
941
- default: '────────── Metadata tool ──────────',
942
- description: 'Parameters for the Metadata tool.',
943
- displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['metadata'] } },
902
+ // Multitask tool parameters grouped to keep property keys unique
903
+ displayName: 'Tool Parameters (Multitask)',
904
+ name: 'toolParametersMulti',
905
+ type: 'fixedCollection',
906
+ default: {},
907
+ placeholder: 'Add tool parameters',
908
+ description: 'Parameters for selected tools in multitask.',
909
+ typeOptions: { multipleValues: false },
910
+ displayOptions: { show: { resource: ['tools'], operation: ['multitask'] } },
911
+ options: [
912
+ {
913
+ name: 'metadata',
914
+ displayName: 'Metadata',
915
+ values: [{ displayName: 'Include Raw EXIF', name: 'metadataIncludeRawExifMulti', type: 'boolean', default: false, description: 'Include raw EXIF data when available.' }],
916
+ },
917
+ {
918
+ name: 'palette',
919
+ displayName: 'Palette',
920
+ values: [{ displayName: 'Palette Size', name: 'paletteSizeMulti', type: 'number', default: 5, description: 'Number of colors to extract.' }],
921
+ },
922
+ {
923
+ name: 'hash',
924
+ displayName: 'Hash',
925
+ values: [
926
+ {
927
+ displayName: 'Hash Type',
928
+ name: 'hashTypeMulti',
929
+ type: 'options',
930
+ default: 'phash',
931
+ description: 'Hash algorithm to compute.',
932
+ options: [
933
+ { name: 'pHash', value: 'phash' },
934
+ { name: 'MD5', value: 'md5' },
935
+ { name: 'SHA1', value: 'sha1' },
936
+ ],
937
+ },
938
+ ],
939
+ },
940
+ {
941
+ name: 'similarity',
942
+ displayName: 'Similarity',
943
+ values: [
944
+ { displayName: 'Similarity Mode', name: 'similarityModeMulti', type: 'string', default: '', description: 'Similarity mode.' },
945
+ { displayName: 'Similarity Threshold', name: 'similarityThresholdMulti', type: 'number', default: 0, description: 'Similarity threshold.' },
946
+ ],
947
+ },
948
+ {
949
+ name: 'quality',
950
+ displayName: 'Quality',
951
+ values: [{ displayName: 'Quality Sample', name: 'qualitySampleMulti', type: 'number', default: 0, description: 'Sample size for quality analysis.' }],
952
+ },
953
+ {
954
+ name: 'transparency',
955
+ displayName: 'Transparency',
956
+ values: [{ displayName: 'Transparency Sample', name: 'transparencySampleMulti', type: 'number', default: 0, description: 'Sample size for transparency analysis.' }],
957
+ },
958
+ {
959
+ name: 'efficiency',
960
+ displayName: 'Efficiency',
961
+ values: [
962
+ { displayName: 'Efficiency Format', name: 'efficiencyFormatMulti', type: 'string', default: '', description: 'Output format for efficiency tool.' },
963
+ { displayName: 'Efficiency Quality', name: 'efficiencyQualityMulti', type: 'number', default: 0, description: 'Quality setting for efficiency tool.' },
964
+ ],
965
+ },
966
+ ],
944
967
  },
945
968
  {
946
- displayName: 'Include Raw EXIF',
947
- name: 'includeRawExifMulti',
948
- type: 'boolean',
949
- default: false,
950
- description: 'Include raw EXIF data when available (metadata tool).',
951
- displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['metadata'] } },
969
+ displayName: 'Similarity Parameters (Multitask)',
970
+ name: 'similarityParametersMulti',
971
+ type: 'fixedCollection',
972
+ default: {},
973
+ placeholder: 'Add similarity parameters',
974
+ description: 'Similarity tool options for multitask.',
975
+ typeOptions: { multipleValues: false },
976
+ displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['similarity'] } },
977
+ options: [
978
+ {
979
+ name: 'parameters',
980
+ displayName: 'Parameters',
981
+ values: [
982
+ { displayName: 'Similarity Mode', name: 'similarityMode', type: 'string', default: '', description: 'Similarity mode.' },
983
+ { displayName: 'Similarity Threshold', name: 'similarityThreshold', type: 'number', default: 0, description: 'Similarity threshold.' },
984
+ ],
985
+ },
986
+ ],
952
987
  },
953
988
  {
954
- displayName: 'Palette Tool',
955
- name: 'paletteToolNoticeMulti',
956
- type: 'notice',
957
- default: '────────── Palette tool ──────────',
958
- description: 'Parameters for the Palette tool.',
959
- displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['palette'] } },
989
+ displayName: 'Quality Parameters (Multitask)',
990
+ name: 'qualityParametersMulti',
991
+ type: 'fixedCollection',
992
+ default: {},
993
+ placeholder: 'Add quality parameters',
994
+ description: 'Quality tool options for multitask.',
995
+ typeOptions: { multipleValues: false },
996
+ displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['quality'] } },
997
+ options: [
998
+ {
999
+ name: 'parameters',
1000
+ displayName: 'Parameters',
1001
+ values: [{ displayName: 'Quality Sample', name: 'qualitySample', type: 'number', default: 0, description: 'Sample size for quality analysis.' }],
1002
+ },
1003
+ ],
960
1004
  },
961
- { displayName: 'Palette Size', name: 'paletteSizeMulti', type: 'number', default: 5, description: 'Number of colors to extract (palette tool).', displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['palette'] } } },
962
1005
  {
963
- displayName: 'Hash Tool',
964
- name: 'hashToolNoticeMulti',
965
- type: 'notice',
966
- default: '────────── Hash tool ──────────',
967
- description: 'Parameters for the Hash tool.',
968
- displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['hash'] } },
1006
+ displayName: 'Transparency Parameters (Multitask)',
1007
+ name: 'transparencyParametersMulti',
1008
+ type: 'fixedCollection',
1009
+ default: {},
1010
+ placeholder: 'Add transparency parameters',
1011
+ description: 'Transparency tool options for multitask.',
1012
+ typeOptions: { multipleValues: false },
1013
+ displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['transparency'] } },
1014
+ options: [
1015
+ {
1016
+ name: 'parameters',
1017
+ displayName: 'Parameters',
1018
+ values: [{ displayName: 'Transparency Sample', name: 'transparencySample', type: 'number', default: 0, description: 'Sample size for transparency analysis.' }],
1019
+ },
1020
+ ],
969
1021
  },
970
1022
  {
971
- displayName: 'Hash Type',
972
- name: 'hashTypeMulti',
973
- type: 'options',
974
- default: 'phash',
975
- description: 'Hash algorithm to compute (hash tool).',
1023
+ displayName: 'Efficiency Parameters (Multitask)',
1024
+ name: 'efficiencyParametersMulti',
1025
+ type: 'fixedCollection',
1026
+ default: {},
1027
+ placeholder: 'Add efficiency parameters',
1028
+ description: 'Efficiency tool options for multitask.',
1029
+ typeOptions: { multipleValues: false },
1030
+ displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['efficiency'] } },
976
1031
  options: [
977
- { name: 'pHash', value: 'phash' },
978
- { name: 'MD5', value: 'md5' },
979
- { name: 'SHA1', value: 'sha1' },
1032
+ {
1033
+ name: 'parameters',
1034
+ displayName: 'Parameters',
1035
+ values: [
1036
+ { displayName: 'Efficiency Format', name: 'efficiencyFormat', type: 'string', default: '', description: 'Output format for efficiency tool.' },
1037
+ { displayName: 'Efficiency Quality', name: 'efficiencyQuality', type: 'number', default: 0, description: 'Quality setting for efficiency tool.' },
1038
+ ],
1039
+ },
980
1040
  ],
981
- displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['hash'] } },
982
1041
  },
983
1042
  {
984
1043
  displayName: 'Similarity Tool',
@@ -1261,7 +1320,7 @@ class DavixH2I {
1261
1320
  formData[name] = value;
1262
1321
  };
1263
1322
  const setBoolOnce = (name, value) => {
1264
- if (value && formData[name] === undefined)
1323
+ if (value !== undefined && value !== null && formData[name] === undefined)
1265
1324
  formData[name] = toBoolString(value);
1266
1325
  };
1267
1326
  setStringOnce('format', this.getNodeParameter('multitaskFormat', itemIndex));
@@ -1269,68 +1328,94 @@ class DavixH2I {
1269
1328
  for (const a of selectedActions) {
1270
1329
  switch (a) {
1271
1330
  case 'format':
1272
- setNumberOnce('width', this.getNodeParameter('formatWidth', itemIndex));
1273
- setNumberOnce('height', this.getNodeParameter('formatHeight', itemIndex));
1331
+ {
1332
+ const params = this.getNodeParameter('imageActionParams.format', itemIndex, {}) || {};
1333
+ setNumberOnce('width', Number(params.formatWidthMulti ?? 0));
1334
+ setNumberOnce('height', Number(params.formatHeightMulti ?? 0));
1335
+ }
1274
1336
  break;
1275
1337
  case 'resize':
1276
- setNumberOnce('width', this.getNodeParameter('resizeWidth', itemIndex));
1277
- setNumberOnce('height', this.getNodeParameter('resizeHeight', itemIndex));
1278
- setBoolOnce('enlarge', this.getNodeParameter('resizeEnlarge', itemIndex));
1279
- setBoolOnce('normalizeOrientation', this.getNodeParameter('resizeNormalizeOrientation', itemIndex));
1338
+ {
1339
+ const params = this.getNodeParameter('imageActionParams.resize', itemIndex, {}) || {};
1340
+ setNumberOnce('width', Number(params.resizeWidthMulti ?? 0));
1341
+ setNumberOnce('height', Number(params.resizeHeightMulti ?? 0));
1342
+ setBoolOnce('enlarge', Boolean(params.resizeEnlargeMulti));
1343
+ setBoolOnce('normalizeOrientation', Boolean(params.resizeNormalizeOrientationMulti));
1344
+ }
1280
1345
  break;
1281
1346
  case 'crop':
1282
- setNumberOnce('cropX', this.getNodeParameter('cropXMulti', itemIndex));
1283
- setNumberOnce('cropY', this.getNodeParameter('cropYMulti', itemIndex));
1284
- setNumberOnce('cropWidth', this.getNodeParameter('cropWidthMulti', itemIndex));
1285
- setNumberOnce('cropHeight', this.getNodeParameter('cropHeightMulti', itemIndex));
1286
- setBoolOnce('normalizeOrientation', this.getNodeParameter('cropNormalizeOrientation', itemIndex));
1287
- setStringOnce('backgroundColor', this.getNodeParameter('cropBackgroundColor', itemIndex));
1347
+ {
1348
+ const params = this.getNodeParameter('imageActionParams.crop', itemIndex, {}) || {};
1349
+ setNumberOnce('cropX', Number(params.cropXMulti ?? 0));
1350
+ setNumberOnce('cropY', Number(params.cropYMulti ?? 0));
1351
+ setNumberOnce('cropWidth', Number(params.cropWidthMulti ?? 0));
1352
+ setNumberOnce('cropHeight', Number(params.cropHeightMulti ?? 0));
1353
+ setBoolOnce('normalizeOrientation', Boolean(params.cropNormalizeOrientationMulti));
1354
+ setStringOnce('backgroundColor', String(params.cropBackgroundColorMulti ?? ''));
1355
+ }
1288
1356
  break;
1289
1357
  case 'transform':
1290
- setNumberOnce('rotate', this.getNodeParameter('transformRotate', itemIndex));
1291
- setBoolOnce('flipH', this.getNodeParameter('transformFlipH', itemIndex));
1292
- setBoolOnce('flipV', this.getNodeParameter('transformFlipV', itemIndex));
1293
- setStringOnce('colorSpace', this.getNodeParameter('transformColorSpace', itemIndex));
1358
+ {
1359
+ const params = this.getNodeParameter('imageActionParams.transform', itemIndex, {}) || {};
1360
+ setNumberOnce('rotate', Number(params.transformRotateMulti ?? 0));
1361
+ setBoolOnce('flipH', Boolean(params.transformFlipHMulti));
1362
+ setBoolOnce('flipV', Boolean(params.transformFlipVMulti));
1363
+ setStringOnce('colorSpace', String(params.transformColorSpaceMulti ?? ''));
1364
+ }
1294
1365
  break;
1295
1366
  case 'compress':
1296
- setNumberOnce('quality', this.getNodeParameter('compressQuality', itemIndex));
1297
- setNumberOnce('targetSizeKB', this.getNodeParameter('compressTargetSizeKB', itemIndex));
1298
- setStringOnce('backgroundColor', this.getNodeParameter('compressBackgroundColor', itemIndex));
1299
- setStringOnce('colorSpace', this.getNodeParameter('compressColorSpace', itemIndex));
1367
+ {
1368
+ const params = this.getNodeParameter('imageActionParams.compress', itemIndex, {}) || {};
1369
+ setNumberOnce('quality', Number(params.compressQualityMulti ?? 0));
1370
+ setNumberOnce('targetSizeKB', Number(params.compressTargetSizeKBMulti ?? 0));
1371
+ setStringOnce('backgroundColor', String(params.compressBackgroundColorMulti ?? ''));
1372
+ setStringOnce('colorSpace', String(params.compressColorSpaceMulti ?? ''));
1373
+ }
1300
1374
  break;
1301
1375
  case 'enhance':
1302
- setNumberOnce('blur', this.getNodeParameter('enhanceBlur', itemIndex));
1303
- setNumberOnce('sharpen', this.getNodeParameter('enhanceSharpen', itemIndex));
1304
- setBoolOnce('grayscale', this.getNodeParameter('enhanceGrayscale', itemIndex));
1305
- setBoolOnce('sepia', this.getNodeParameter('enhanceSepia', itemIndex));
1306
- setNumberOnce('brightness', this.getNodeParameter('enhanceBrightness', itemIndex));
1307
- setNumberOnce('contrast', this.getNodeParameter('enhanceContrast', itemIndex));
1308
- setNumberOnce('saturation', this.getNodeParameter('enhanceSaturation', itemIndex));
1309
- setBoolOnce('normalizeOrientation', this.getNodeParameter('enhanceNormalizeOrientation', itemIndex));
1376
+ {
1377
+ const params = this.getNodeParameter('imageActionParams.enhance', itemIndex, {}) || {};
1378
+ setNumberOnce('blur', Number(params.enhanceBlurMulti ?? 0));
1379
+ setNumberOnce('sharpen', Number(params.enhanceSharpenMulti ?? 0));
1380
+ setBoolOnce('grayscale', Boolean(params.enhanceGrayscaleMulti));
1381
+ setBoolOnce('sepia', Boolean(params.enhanceSepiaMulti));
1382
+ setNumberOnce('brightness', Number(params.enhanceBrightnessMulti ?? 0));
1383
+ setNumberOnce('contrast', Number(params.enhanceContrastMulti ?? 0));
1384
+ setNumberOnce('saturation', Number(params.enhanceSaturationMulti ?? 0));
1385
+ setBoolOnce('normalizeOrientation', Boolean(params.enhanceNormalizeOrientationMulti));
1386
+ }
1310
1387
  break;
1311
1388
  case 'frame':
1312
- setNumberOnce('pad', this.getNodeParameter('framePad', itemIndex));
1313
- setStringOnce('padColor', this.getNodeParameter('framePadColor', itemIndex));
1314
- setNumberOnce('border', this.getNodeParameter('frameBorder', itemIndex));
1315
- setStringOnce('borderColor', this.getNodeParameter('frameBorderColor', itemIndex));
1316
- setNumberOnce('borderRadius', this.getNodeParameter('frameBorderRadius', itemIndex));
1389
+ {
1390
+ const params = this.getNodeParameter('imageActionParams.frame', itemIndex, {}) || {};
1391
+ setNumberOnce('pad', Number(params.framePadMulti ?? 0));
1392
+ setStringOnce('padColor', String(params.framePadColorMulti ?? ''));
1393
+ setNumberOnce('border', Number(params.frameBorderMulti ?? 0));
1394
+ setStringOnce('borderColor', String(params.frameBorderColorMulti ?? ''));
1395
+ setNumberOnce('borderRadius', Number(params.frameBorderRadiusMulti ?? 0));
1396
+ }
1317
1397
  break;
1318
1398
  case 'background':
1319
- setStringOnce('backgroundColor', this.getNodeParameter('backgroundColorMulti', itemIndex));
1320
- setNumberOnce('backgroundBlur', this.getNodeParameter('backgroundBlurMulti', itemIndex));
1321
- setNumberOnce('borderRadius', this.getNodeParameter('backgroundBorderRadius', itemIndex));
1322
- setStringOnce('padColor', this.getNodeParameter('backgroundPadColor', itemIndex));
1399
+ {
1400
+ const params = this.getNodeParameter('imageActionParams.background', itemIndex, {}) || {};
1401
+ setStringOnce('backgroundColor', String(params.backgroundColorMulti ?? ''));
1402
+ setNumberOnce('backgroundBlur', Number(params.backgroundBlurMulti ?? 0));
1403
+ setNumberOnce('borderRadius', Number(params.backgroundBorderRadiusMulti ?? 0));
1404
+ setStringOnce('padColor', String(params.backgroundPadColorMulti ?? ''));
1405
+ }
1323
1406
  break;
1324
1407
  case 'watermark':
1325
- setStringOnce('watermarkText', this.getNodeParameter('watermarkTextMulti', itemIndex));
1326
- setNumberOnce('watermarkOpacity', this.getNodeParameter('watermarkOpacityMulti', itemIndex));
1327
- formData.watermarkPosition =
1328
- formData.watermarkPosition ?? this.getNodeParameter('watermarkPositionMulti', itemIndex);
1329
- setNumberOnce('watermarkMargin', this.getNodeParameter('watermarkMarginMulti', itemIndex));
1330
- setNumberOnce('watermarkScale', this.getNodeParameter('watermarkScaleMulti', itemIndex));
1331
- setStringOnce('watermarkColor', this.getNodeParameter('watermarkColorMulti', itemIndex));
1332
- setNumberOnce('watermarkFontSize', this.getNodeParameter('watermarkFontSizeMulti', itemIndex));
1333
- await includeWatermarkFile(this.getNodeParameter('watermarkBinaryPropertyMulti', itemIndex));
1408
+ {
1409
+ const params = this.getNodeParameter('imageActionParams.watermark', itemIndex, {}) || {};
1410
+ setStringOnce('watermarkText', String(params.watermarkTextMulti ?? ''));
1411
+ setNumberOnce('watermarkOpacity', Number(params.watermarkOpacityMulti ?? 0));
1412
+ formData.watermarkPosition = formData.watermarkPosition ?? params.watermarkPositionMulti;
1413
+ setNumberOnce('watermarkMargin', Number(params.watermarkMarginMulti ?? 0));
1414
+ setNumberOnce('watermarkScale', Number(params.watermarkScaleMulti ?? 0));
1415
+ setStringOnce('watermarkColor', String(params.watermarkColorMulti ?? ''));
1416
+ setNumberOnce('watermarkFontSize', Number(params.watermarkFontSizeMulti ?? 0));
1417
+ await includeWatermarkFile(String(params.watermarkImageBinaryProperty ?? ''));
1418
+ }
1334
1419
  break;
1335
1420
  }
1336
1421
  }
@@ -1491,64 +1576,61 @@ class DavixH2I {
1491
1576
  formData.tools = tools.join(',');
1492
1577
  }
1493
1578
  const hasTool = (toolName) => selectedTools.includes(toolName);
1579
+ const getParams = (path) => this.getNodeParameter(path, itemIndex, {}) || {};
1494
1580
  if (hasTool('metadata')) {
1495
- const includeRawExif = action === 'single'
1496
- ? this.getNodeParameter('includeRawExifSingle', itemIndex, false)
1497
- : this.getNodeParameter('includeRawExifMulti', itemIndex, false);
1498
- if (includeRawExif)
1499
- setBool('includeRawExif', includeRawExif);
1581
+ const params = action === 'single'
1582
+ ? getParams('toolParametersSingle.metadata')
1583
+ : getParams('toolParametersMulti.metadata');
1584
+ if (params.metadataIncludeRawExifSingle ?? params.metadataIncludeRawExifMulti)
1585
+ setBool('includeRawExif', Boolean(params.metadataIncludeRawExifSingle ?? params.metadataIncludeRawExifMulti));
1500
1586
  }
1501
1587
  if (hasTool('palette')) {
1502
- const paletteSize = action === 'single'
1503
- ? this.getNodeParameter('paletteSizeSingle', itemIndex, 0)
1504
- : this.getNodeParameter('paletteSizeMulti', itemIndex, 0);
1505
- if (paletteSize)
1506
- setNumber('paletteSize', paletteSize);
1588
+ const params = action === 'single' ? getParams('toolParametersSingle.palette') : getParams('toolParametersMulti.palette');
1589
+ const val = params.paletteSizeSingle ?? params.paletteSizeMulti;
1590
+ if (val)
1591
+ setNumber('paletteSize', Number(val));
1507
1592
  }
1508
1593
  if (hasTool('hash')) {
1509
- const hashType = action === 'single'
1510
- ? this.getNodeParameter('hashTypeSingle', itemIndex)
1511
- : this.getNodeParameter('hashTypeMulti', itemIndex);
1512
- if (hashType)
1513
- setString('hashType', hashType);
1594
+ const params = action === 'single' ? getParams('toolParametersSingle.hash') : getParams('toolParametersMulti.hash');
1595
+ const val = params.hashTypeSingle ?? params.hashTypeMulti;
1596
+ if (val)
1597
+ setString('hashType', String(val));
1514
1598
  }
1515
1599
  if (hasTool('quality')) {
1516
- const qualitySample = action === 'single'
1517
- ? this.getNodeParameter('qualitySampleSingle', itemIndex, 0)
1518
- : this.getNodeParameter('qualitySampleMulti', itemIndex, 0);
1519
- if (qualitySample)
1520
- setNumber('qualitySample', qualitySample);
1600
+ const params = action === 'single' ? getParams('toolParametersSingle.quality') : getParams('toolParametersMulti.quality');
1601
+ const val = params.qualitySampleSingle ?? params.qualitySampleMulti;
1602
+ if (val)
1603
+ setNumber('qualitySample', Number(val));
1521
1604
  }
1522
1605
  if (hasTool('transparency')) {
1523
- const transparencySample = action === 'single'
1524
- ? this.getNodeParameter('transparencySampleSingle', itemIndex, 0)
1525
- : this.getNodeParameter('transparencySampleMulti', itemIndex, 0);
1526
- if (transparencySample)
1527
- setNumber('transparencySample', transparencySample);
1606
+ const params = action === 'single'
1607
+ ? getParams('toolParametersSingle.transparency')
1608
+ : getParams('toolParametersMulti.transparency');
1609
+ const val = params.transparencySampleSingle ?? params.transparencySampleMulti;
1610
+ if (val)
1611
+ setNumber('transparencySample', Number(val));
1528
1612
  }
1529
1613
  if (hasTool('similarity')) {
1530
- const similarityMode = action === 'single'
1531
- ? this.getNodeParameter('similarityModeSingle', itemIndex, '')
1532
- : this.getNodeParameter('similarityModeMulti', itemIndex, '');
1533
- const similarityThreshold = action === 'single'
1534
- ? this.getNodeParameter('similarityThresholdSingle', itemIndex, 0)
1535
- : this.getNodeParameter('similarityThresholdMulti', itemIndex, 0);
1536
- if (similarityMode)
1537
- setString('similarityMode', similarityMode);
1538
- if (similarityThreshold)
1539
- setNumber('similarityThreshold', similarityThreshold);
1614
+ const params = action === 'single'
1615
+ ? getParams('toolParametersSingle.similarity')
1616
+ : getParams('toolParametersMulti.similarity');
1617
+ const mode = params.similarityModeSingle ?? params.similarityModeMulti;
1618
+ const threshold = params.similarityThresholdSingle ?? params.similarityThresholdMulti;
1619
+ if (mode)
1620
+ setString('similarityMode', String(mode));
1621
+ if (threshold)
1622
+ setNumber('similarityThreshold', Number(threshold));
1540
1623
  }
1541
1624
  if (hasTool('efficiency')) {
1542
- const efficiencyFormat = action === 'single'
1543
- ? this.getNodeParameter('efficiencyFormatSingle', itemIndex, '')
1544
- : this.getNodeParameter('efficiencyFormatMulti', itemIndex, '');
1545
- const efficiencyQuality = action === 'single'
1546
- ? this.getNodeParameter('efficiencyQualitySingle', itemIndex, 0)
1547
- : this.getNodeParameter('efficiencyQualityMulti', itemIndex, 0);
1548
- if (efficiencyFormat)
1549
- setString('efficiencyFormat', efficiencyFormat);
1550
- if (efficiencyQuality)
1551
- setNumber('efficiencyQuality', efficiencyQuality);
1625
+ const params = action === 'single'
1626
+ ? getParams('toolParametersSingle.efficiency')
1627
+ : getParams('toolParametersMulti.efficiency');
1628
+ const formatVal = params.efficiencyFormatSingle ?? params.efficiencyFormatMulti;
1629
+ const qualityVal = params.efficiencyQualitySingle ?? params.efficiencyQualityMulti;
1630
+ if (formatVal)
1631
+ setString('efficiencyFormat', String(formatVal));
1632
+ if (qualityVal)
1633
+ setNumber('efficiencyQuality', Number(qualityVal));
1552
1634
  }
1553
1635
  const response = await GenericFunctions_1.davixRequest.call(this, {
1554
1636
  method: 'POST',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-h2i",
3
- "version": "1.0.5",
3
+ "version": "1.0.8",
4
4
  "description": "Davix H2I (PixLab) community node for n8n: H2I, Image, PDF, Tools endpoints",
5
5
  "license": "MIT",
6
6
  "keywords": [