n8n-nodes-h2i 1.0.4 → 1.0.5

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.
@@ -359,6 +359,7 @@ class DavixH2I {
359
359
  name: 'pdfPageSize',
360
360
  type: 'options',
361
361
  default: 'auto',
362
+ description: 'Page size to use when exporting to PDF.',
362
363
  options: [
363
364
  { name: 'Auto', value: 'auto' },
364
365
  { name: 'A4', value: 'a4' },
@@ -371,6 +372,7 @@ class DavixH2I {
371
372
  name: 'pdfOrientation',
372
373
  type: 'options',
373
374
  default: 'portrait',
375
+ description: 'Orientation for pages in the exported PDF.',
374
376
  options: [
375
377
  { name: 'Portrait', value: 'portrait' },
376
378
  { name: 'Landscape', value: 'landscape' },
@@ -382,6 +384,7 @@ class DavixH2I {
382
384
  name: 'pdfMargin',
383
385
  type: 'number',
384
386
  default: 0,
387
+ description: 'Margin (in pixels) applied to the exported PDF pages.',
385
388
  displayOptions: { show: { resource: ['image'], operation: ['pdf'] } },
386
389
  },
387
390
  {
@@ -389,6 +392,7 @@ class DavixH2I {
389
392
  name: 'pdfEmbedFormat',
390
393
  type: 'options',
391
394
  default: 'png',
395
+ description: 'Image format embedded inside the generated PDF.',
392
396
  options: [
393
397
  { name: 'PNG', value: 'png' },
394
398
  { name: 'JPEG', value: 'jpeg' },
@@ -400,161 +404,235 @@ class DavixH2I {
400
404
  name: 'pdfJpegQuality',
401
405
  type: 'number',
402
406
  default: 85,
407
+ description: 'JPEG quality used when embedding images into the PDF.',
403
408
  displayOptions: { show: { resource: ['image'], operation: ['pdf'] } },
404
409
  },
405
410
  { displayName: 'Include Raw EXIF', name: 'includeRawExif', type: 'boolean', default: false, description: 'Include raw EXIF data when available.', displayOptions: { show: { resource: ['image'], operation: ['metadata'] } } },
406
411
  {
407
- displayName: 'Options',
408
- name: 'options',
409
- type: 'collection',
410
- default: {},
411
- placeholder: 'Add option',
412
- description: 'Optional PixLab multitask parameters. Only selected options are sent.',
412
+ displayName: 'Actions',
413
+ name: 'actions',
414
+ type: 'multiOptions',
415
+ default: [],
416
+ description: 'Select one or more actions to apply. Selecting an action reveals its parameters below.',
413
417
  displayOptions: { show: { resource: ['image'], operation: ['multitask'] } },
414
418
  options: [
415
- {
416
- displayName: 'Format',
417
- name: 'format',
418
- type: 'options',
419
- default: 'webp',
420
- description: 'Output format for the multitask result.',
421
- options: [
422
- { name: 'JPEG', value: 'jpeg' },
423
- { name: 'PNG', value: 'png' },
424
- { name: 'WebP', value: 'webp' },
425
- { name: 'AVIF', value: 'avif' },
426
- { name: 'GIF', value: 'gif' },
427
- { name: 'SVG', value: 'svg' },
428
- { name: 'PDF', value: 'pdf' },
429
- ],
430
- },
431
- { displayName: 'Width', name: 'width', type: 'number', default: 0, description: 'Resize width in pixels.' },
432
- { displayName: 'Height', name: 'height', type: 'number', default: 0, description: 'Resize height in pixels.' },
433
- { displayName: 'Enlarge', name: 'enlarge', type: 'boolean', default: false, description: 'Allow upscaling when resizing.' },
434
- {
435
- displayName: 'Normalize Orientation',
436
- name: 'normalizeOrientation',
437
- type: 'boolean',
438
- default: false,
439
- description: 'Auto-rotate based on EXIF orientation.',
440
- },
441
- { displayName: 'Crop X', name: 'cropX', type: 'number', default: 0, description: 'Left offset for crop.' },
442
- { displayName: 'Crop Y', name: 'cropY', type: 'number', default: 0, description: 'Top offset for crop.' },
443
- { displayName: 'Crop Width', name: 'cropWidth', type: 'number', default: 0, description: 'Crop width in pixels.' },
444
- { displayName: 'Crop Height', name: 'cropHeight', type: 'number', default: 0, description: 'Crop height in pixels.' },
445
- { displayName: 'Background Color', name: 'backgroundColor', type: 'string', default: '', description: 'Background color used for fills or padding.' },
446
- { displayName: 'Rotate (degrees)', name: 'rotate', type: 'number', default: 0, description: 'Rotate image by degrees.' },
447
- { displayName: 'Flip Horizontal', name: 'flipH', type: 'boolean', default: false, description: 'Flip image horizontally.' },
448
- { displayName: 'Flip Vertical', name: 'flipV', type: 'boolean', default: false, description: 'Flip image vertically.' },
449
- {
450
- displayName: 'Color Space',
451
- name: 'colorSpace',
452
- type: 'options',
453
- default: 'srgb',
454
- description: 'Color space for processing.',
455
- options: [
456
- { name: 'sRGB', value: 'srgb' },
457
- { name: 'Display P3', value: 'display-p3' },
458
- ],
459
- },
460
- { displayName: 'Target Size (KB)', name: 'targetSizeKB', type: 'number', default: 0, description: 'Target compressed size in KB.' },
461
- { displayName: 'Quality', name: 'quality', type: 'number', default: 82, description: 'Output quality (1-100).' },
462
- { displayName: 'Keep Metadata', name: 'keepMetadata', type: 'boolean', default: false, description: 'Keep EXIF/metadata when possible.' },
463
- { displayName: 'Blur', name: 'blur', type: 'number', default: 0, description: 'Blur radius.' },
464
- { displayName: 'Sharpen', name: 'sharpen', type: 'number', default: 0, description: 'Sharpen amount.' },
465
- { displayName: 'Grayscale', name: 'grayscale', type: 'boolean', default: false, description: 'Convert to grayscale.' },
466
- { displayName: 'Sepia', name: 'sepia', type: 'boolean', default: false, description: 'Apply sepia tone.' },
467
- { displayName: 'Brightness', name: 'brightness', type: 'number', default: 0, description: 'Brightness adjustment (-100 to 100).' },
468
- { displayName: 'Contrast', name: 'contrast', type: 'number', default: 0, description: 'Contrast adjustment (-100 to 100).' },
469
- { displayName: 'Saturation', name: 'saturation', type: 'number', default: 0, description: 'Saturation adjustment (-100 to 100).' },
470
- { displayName: 'Pad', name: 'pad', type: 'number', default: 0, description: 'Uniform padding size.' },
471
- { displayName: 'Pad Color', name: 'padColor', type: 'string', default: '', description: 'Padding color (e.g. #ffffff).' },
472
- { displayName: 'Pad Top', name: 'padTop', type: 'number', default: 0, description: 'Top padding override.' },
473
- { displayName: 'Pad Right', name: 'padRight', type: 'number', default: 0, description: 'Right padding override.' },
474
- { displayName: 'Pad Bottom', name: 'padBottom', type: 'number', default: 0, description: 'Bottom padding override.' },
475
- { displayName: 'Pad Left', name: 'padLeft', type: 'number', default: 0, description: 'Left padding override.' },
476
- { displayName: 'Border Radius', name: 'borderRadius', type: 'number', default: 0, description: 'Rounded corner radius.' },
477
- { displayName: 'Border', name: 'border', type: 'number', default: 0, description: 'Border thickness in pixels.' },
478
- { displayName: 'Border Color', name: 'borderColor', type: 'string', default: '', description: 'Border color (e.g. #000000).' },
479
- { displayName: 'Background Blur', name: 'backgroundBlur', type: 'number', default: 0, description: 'Background blur radius.' },
480
- { displayName: 'Watermark Text', name: 'watermarkText', type: 'string', default: '', description: 'Text watermark content.' },
481
- { displayName: 'Watermark Font Size', name: 'watermarkFontSize', type: 'number', default: 24, description: 'Font size for text watermark.' },
482
- { displayName: 'Watermark Color', name: 'watermarkColor', type: 'string', default: '#000000', description: 'Color for text watermark.' },
483
- { displayName: 'Watermark Opacity', name: 'watermarkOpacity', type: 'number', default: 0.35, description: 'Watermark opacity (0-1).' },
484
- {
485
- displayName: 'Watermark Position',
486
- name: 'watermarkPosition',
487
- type: 'options',
488
- default: 'center',
489
- description: 'Placement for watermark.',
490
- options: [
491
- { name: 'Center', value: 'center' },
492
- { name: 'Top Left', value: 'top-left' },
493
- { name: 'Top Right', value: 'top-right' },
494
- { name: 'Bottom Left', value: 'bottom-left' },
495
- { name: 'Bottom Right', value: 'bottom-right' },
496
- ],
497
- },
498
- { displayName: 'Watermark Margin', name: 'watermarkMargin', type: 'number', default: 8, description: 'Margin/padding around watermark.' },
499
- { displayName: 'Watermark Scale', name: 'watermarkScale', type: 'number', default: 1, description: 'Scale factor for watermark.' },
500
- {
501
- displayName: 'PDF Mode',
502
- name: 'pdfMode',
503
- type: 'options',
504
- default: 'single',
505
- description: 'Single or multi-page PDF export.',
506
- options: [
507
- { name: 'Single', value: 'single' },
508
- { name: 'Multi', value: 'multi' },
509
- ],
510
- },
511
- {
512
- displayName: 'PDF Page Size',
513
- name: 'pdfPageSize',
514
- type: 'options',
515
- default: 'auto',
516
- description: 'Page size for PDF output.',
517
- options: [
518
- { name: 'Auto', value: 'auto' },
519
- { name: 'A4', value: 'a4' },
520
- { name: 'Letter', value: 'letter' },
521
- ],
522
- },
523
- {
524
- displayName: 'PDF Orientation',
525
- name: 'pdfOrientation',
526
- type: 'options',
527
- default: 'portrait',
528
- description: 'Orientation for PDF pages.',
529
- options: [
530
- { name: 'Portrait', value: 'portrait' },
531
- { name: 'Landscape', value: 'landscape' },
532
- ],
533
- },
534
- { displayName: 'PDF Margin', name: 'pdfMargin', type: 'number', default: 0, description: 'Page margin for PDF output.' },
535
- {
536
- displayName: 'PDF Embed Format',
537
- name: 'pdfEmbedFormat',
538
- type: 'options',
539
- default: 'png',
540
- description: 'Image format embedded in the PDF.',
541
- options: [
542
- { name: 'PNG', value: 'png' },
543
- { name: 'JPEG', value: 'jpeg' },
544
- ],
545
- },
546
- { displayName: 'PDF JPEG Quality', name: 'pdfJpegQuality', type: 'number', default: 85, description: 'JPEG quality for PDF embedding.' },
547
- { displayName: 'Include Raw EXIF', name: 'includeRawExif', type: 'boolean', default: false, description: 'Include raw EXIF data when available.' },
419
+ { name: 'Format', value: 'format' },
420
+ { name: 'Resize', value: 'resize' },
421
+ { name: 'Crop', value: 'crop' },
422
+ { name: 'Transform', value: 'transform' },
423
+ { name: 'Compress', value: 'compress' },
424
+ { name: 'Enhance', value: 'enhance' },
425
+ { name: 'Frame', value: 'frame' },
426
+ { name: 'Background', value: 'background' },
427
+ { name: 'Watermark', value: 'watermark' },
428
+ ],
429
+ },
430
+ {
431
+ displayName: 'Format',
432
+ name: 'multitaskFormat',
433
+ type: 'options',
434
+ default: 'webp',
435
+ description: 'Output format for the multitask result.',
436
+ options: [
437
+ { name: 'JPEG', value: 'jpeg' },
438
+ { name: 'PNG', value: 'png' },
439
+ { name: 'WebP', value: 'webp' },
440
+ { name: 'AVIF', value: 'avif' },
441
+ { name: 'GIF', value: 'gif' },
442
+ { name: 'SVG', value: 'svg' },
443
+ { name: 'PDF', value: 'pdf' },
444
+ ],
445
+ displayOptions: { show: { resource: ['image'], operation: ['multitask'] } },
446
+ },
447
+ {
448
+ displayName: 'Keep Metadata',
449
+ name: 'multitaskKeepMetadata',
450
+ type: 'boolean',
451
+ default: false,
452
+ 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
548
  ],
549
+ displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['compress'] } },
549
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'] } },
606
+ },
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
+ {
610
+ displayName: 'Watermark Position',
611
+ name: 'watermarkPositionMulti',
612
+ type: 'options',
613
+ default: 'center',
614
+ description: 'Placement for watermark.',
615
+ 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' },
621
+ ],
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'] } } },
550
628
  {
551
629
  displayName: 'Watermark Image Binary Property',
552
- name: 'watermarkBinaryProperty',
630
+ name: 'watermarkBinaryPropertyMulti',
553
631
  type: 'string',
554
632
  default: '',
555
633
  placeholder: 'watermarkImage',
556
- description: 'Binary property containing an image watermark (used if watermark options are set).',
557
- displayOptions: { show: { resource: ['image'], operation: ['multitask'] } },
634
+ description: 'Binary property containing an image watermark (optional).',
635
+ displayOptions: { show: { resource: ['image'], operation: ['multitask'], actions: ['watermark'] } },
558
636
  },
559
637
  {
560
638
  displayName: 'Download Result(s) as Binary',
@@ -773,67 +851,173 @@ class DavixH2I {
773
851
  displayOptions: { show: { resource: ['tools'], operation: ['multitask'] } },
774
852
  },
775
853
  {
776
- displayName: 'Options',
777
- name: 'options',
778
- type: 'collection',
779
- default: {},
780
- placeholder: 'Add option',
781
- description: 'Optional tool parameters (only applied when the selected tool supports them).',
782
- displayOptions: { show: { resource: ['tools'], operation: ['single'] } },
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).',
783
892
  options: [
784
- { displayName: 'Include Raw EXIF', name: 'includeRawExif', type: 'boolean', default: false, description: 'Include raw EXIF data (metadata tool only).' },
785
- { displayName: 'Palette Size', name: 'paletteSize', type: 'number', default: 5, description: 'Number of colors to extract (palette tool).' },
786
- {
787
- displayName: 'Hash Type',
788
- name: 'hashType',
789
- type: 'options',
790
- default: 'phash',
791
- description: 'Hash algorithm to compute (hash tool).',
792
- options: [
793
- { name: 'pHash', value: 'phash' },
794
- { name: 'MD5', value: 'md5' },
795
- { name: 'SHA1', value: 'sha1' },
796
- ],
797
- },
798
- { displayName: 'Similarity Mode', name: 'similarityMode', type: 'string', default: '', description: 'Similarity mode (similarity tool).' },
799
- { displayName: 'Similarity Threshold', name: 'similarityThreshold', type: 'number', default: 0, description: 'Similarity threshold (similarity tool).' },
800
- { displayName: 'Quality Sample', name: 'qualitySample', type: 'number', default: 0, description: 'Sample size for quality analysis (quality tool).' },
801
- { displayName: 'Transparency Sample', name: 'transparencySample', type: 'number', default: 0, description: 'Sample size for transparency analysis (transparency tool).' },
802
- { displayName: 'Efficiency Format', name: 'efficiencyFormat', type: 'string', default: '', description: 'Output format for efficiency tool.' },
803
- { displayName: 'Efficiency Quality', name: 'efficiencyQuality', type: 'number', default: 0, description: 'Quality setting for efficiency tool.' },
893
+ { name: 'pHash', value: 'phash' },
894
+ { name: 'MD5', value: 'md5' },
895
+ { name: 'SHA1', value: 'sha1' },
804
896
  ],
897
+ displayOptions: { show: { resource: ['tools'], operation: ['single'], tool: ['hash'] } },
805
898
  },
806
899
  {
807
- displayName: 'Options',
808
- name: 'options',
809
- type: 'collection',
810
- default: {},
811
- placeholder: 'Add option',
812
- description: 'Optional tool parameters (applied per selected tool).',
813
- displayOptions: { show: { resource: ['tools'], operation: ['multitask'] } },
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
+ },
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
+ {
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'] } },
944
+ },
945
+ {
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'] } },
952
+ },
953
+ {
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'] } },
960
+ },
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
+ {
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'] } },
969
+ },
970
+ {
971
+ displayName: 'Hash Type',
972
+ name: 'hashTypeMulti',
973
+ type: 'options',
974
+ default: 'phash',
975
+ description: 'Hash algorithm to compute (hash tool).',
814
976
  options: [
815
- { displayName: 'Include Raw EXIF', name: 'includeRawExif', type: 'boolean', default: false, description: 'Include raw EXIF data (metadata tool).' },
816
- { displayName: 'Palette Size', name: 'paletteSize', type: 'number', default: 5, description: 'Number of colors to extract (palette tool).' },
817
- {
818
- displayName: 'Hash Type',
819
- name: 'hashType',
820
- type: 'options',
821
- default: 'phash',
822
- description: 'Hash algorithm to compute (hash tool).',
823
- options: [
824
- { name: 'pHash', value: 'phash' },
825
- { name: 'MD5', value: 'md5' },
826
- { name: 'SHA1', value: 'sha1' },
827
- ],
828
- },
829
- { displayName: 'Similarity Mode', name: 'similarityMode', type: 'string', default: '', description: 'Similarity mode (similarity tool).' },
830
- { displayName: 'Similarity Threshold', name: 'similarityThreshold', type: 'number', default: 0, description: 'Similarity threshold (similarity tool).' },
831
- { displayName: 'Quality Sample', name: 'qualitySample', type: 'number', default: 0, description: 'Sample size for quality analysis (quality tool).' },
832
- { displayName: 'Transparency Sample', name: 'transparencySample', type: 'number', default: 0, description: 'Sample size for transparency analysis (transparency tool).' },
833
- { displayName: 'Efficiency Format', name: 'efficiencyFormat', type: 'string', default: '', description: 'Output format for efficiency tool.' },
834
- { displayName: 'Efficiency Quality', name: 'efficiencyQuality', type: 'number', default: 0, description: 'Quality setting for efficiency tool.' },
977
+ { name: 'pHash', value: 'phash' },
978
+ { name: 'MD5', value: 'md5' },
979
+ { name: 'SHA1', value: 'sha1' },
835
980
  ],
981
+ displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['hash'] } },
836
982
  },
983
+ {
984
+ displayName: 'Similarity Tool',
985
+ name: 'similarityToolNoticeMulti',
986
+ type: 'notice',
987
+ default: '────────── Similarity tool ──────────',
988
+ description: 'Parameters for the Similarity tool.',
989
+ displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['similarity'] } },
990
+ },
991
+ { displayName: 'Similarity Mode', name: 'similarityModeMulti', type: 'string', default: '', description: 'Similarity mode (similarity tool).', displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['similarity'] } } },
992
+ { displayName: 'Similarity Threshold', name: 'similarityThresholdMulti', type: 'number', default: 0, description: 'Similarity threshold (similarity tool).', displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['similarity'] } } },
993
+ {
994
+ displayName: 'Quality Tool',
995
+ name: 'qualityToolNoticeMulti',
996
+ type: 'notice',
997
+ default: '────────── Quality tool ──────────',
998
+ description: 'Parameters for the Quality tool.',
999
+ displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['quality'] } },
1000
+ },
1001
+ { displayName: 'Quality Sample', name: 'qualitySampleMulti', type: 'number', default: 0, description: 'Sample size for quality analysis.', displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['quality'] } } },
1002
+ {
1003
+ displayName: 'Transparency Tool',
1004
+ name: 'transparencyToolNoticeMulti',
1005
+ type: 'notice',
1006
+ default: '────────── Transparency tool ──────────',
1007
+ description: 'Parameters for the Transparency tool.',
1008
+ displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['transparency'] } },
1009
+ },
1010
+ { displayName: 'Transparency Sample', name: 'transparencySampleMulti', type: 'number', default: 0, description: 'Sample size for transparency analysis.', displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['transparency'] } } },
1011
+ {
1012
+ displayName: 'Efficiency Tool',
1013
+ name: 'efficiencyToolNoticeMulti',
1014
+ type: 'notice',
1015
+ default: '────────── Efficiency tool ──────────',
1016
+ description: 'Parameters for the Efficiency tool.',
1017
+ displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['efficiency'] } },
1018
+ },
1019
+ { displayName: 'Efficiency Format', name: 'efficiencyFormatMulti', type: 'string', default: '', description: 'Output format for efficiency tool.', displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['efficiency'] } } },
1020
+ { displayName: 'Efficiency Quality', name: 'efficiencyQualityMulti', type: 'number', default: 0, description: 'Quality setting for efficiency tool.', displayOptions: { show: { resource: ['tools'], operation: ['multitask'], tools: ['efficiency'] } } },
837
1021
  ],
838
1022
  };
839
1023
  async execute() {
@@ -1065,108 +1249,91 @@ class DavixH2I {
1065
1249
  setBool('includeRawExif', this.getNodeParameter('includeRawExif', itemIndex));
1066
1250
  break;
1067
1251
  case 'multitask': {
1068
- const options = this.getNodeParameter('options', itemIndex, {}) || {};
1069
- const hasVal = (key) => Object.prototype.hasOwnProperty.call(options, key);
1070
- const getOpt = (key) => options[key];
1071
- if (hasVal('format'))
1072
- setString('format', getOpt('format'));
1073
- if (hasVal('width'))
1074
- setNumber('width', Number(getOpt('width')));
1075
- if (hasVal('height'))
1076
- setNumber('height', Number(getOpt('height')));
1077
- if (hasVal('enlarge'))
1078
- setBool('enlarge', Boolean(getOpt('enlarge')));
1079
- if (hasVal('normalizeOrientation'))
1080
- setBool('normalizeOrientation', Boolean(getOpt('normalizeOrientation')));
1081
- if (hasVal('cropX'))
1082
- setNumber('cropX', Number(getOpt('cropX')));
1083
- if (hasVal('cropY'))
1084
- setNumber('cropY', Number(getOpt('cropY')));
1085
- if (hasVal('cropWidth'))
1086
- setNumber('cropWidth', Number(getOpt('cropWidth')));
1087
- if (hasVal('cropHeight'))
1088
- setNumber('cropHeight', Number(getOpt('cropHeight')));
1089
- if (hasVal('backgroundColor'))
1090
- setString('backgroundColor', String(getOpt('backgroundColor')));
1091
- if (hasVal('rotate'))
1092
- setNumber('rotate', Number(getOpt('rotate')));
1093
- if (hasVal('flipH'))
1094
- setBool('flipH', Boolean(getOpt('flipH')));
1095
- if (hasVal('flipV'))
1096
- setBool('flipV', Boolean(getOpt('flipV')));
1097
- if (hasVal('colorSpace'))
1098
- formData.colorSpace = String(getOpt('colorSpace'));
1099
- if (hasVal('targetSizeKB'))
1100
- setNumber('targetSizeKB', Number(getOpt('targetSizeKB')));
1101
- if (hasVal('quality'))
1102
- setNumber('quality', Number(getOpt('quality')));
1103
- if (hasVal('keepMetadata'))
1104
- setBool('keepMetadata', Boolean(getOpt('keepMetadata')));
1105
- if (hasVal('blur'))
1106
- setNumber('blur', Number(getOpt('blur')));
1107
- if (hasVal('sharpen'))
1108
- setNumber('sharpen', Number(getOpt('sharpen')));
1109
- if (hasVal('grayscale'))
1110
- setBool('grayscale', Boolean(getOpt('grayscale')));
1111
- if (hasVal('sepia'))
1112
- setBool('sepia', Boolean(getOpt('sepia')));
1113
- if (hasVal('brightness'))
1114
- setNumber('brightness', Number(getOpt('brightness')));
1115
- if (hasVal('contrast'))
1116
- setNumber('contrast', Number(getOpt('contrast')));
1117
- if (hasVal('saturation'))
1118
- setNumber('saturation', Number(getOpt('saturation')));
1119
- if (hasVal('pad'))
1120
- setNumber('pad', Number(getOpt('pad')));
1121
- if (hasVal('padTop'))
1122
- setNumber('padTop', Number(getOpt('padTop')));
1123
- if (hasVal('padRight'))
1124
- setNumber('padRight', Number(getOpt('padRight')));
1125
- if (hasVal('padBottom'))
1126
- setNumber('padBottom', Number(getOpt('padBottom')));
1127
- if (hasVal('padLeft'))
1128
- setNumber('padLeft', Number(getOpt('padLeft')));
1129
- if (hasVal('padColor'))
1130
- setString('padColor', String(getOpt('padColor')));
1131
- if (hasVal('borderRadius'))
1132
- setNumber('borderRadius', Number(getOpt('borderRadius')));
1133
- if (hasVal('border'))
1134
- setNumber('border', Number(getOpt('border')));
1135
- if (hasVal('borderColor'))
1136
- setString('borderColor', String(getOpt('borderColor')));
1137
- if (hasVal('backgroundBlur'))
1138
- setNumber('backgroundBlur', Number(getOpt('backgroundBlur')));
1139
- if (hasVal('watermarkText'))
1140
- setString('watermarkText', String(getOpt('watermarkText')));
1141
- if (hasVal('watermarkFontSize'))
1142
- setNumber('watermarkFontSize', Number(getOpt('watermarkFontSize')));
1143
- if (hasVal('watermarkColor'))
1144
- setString('watermarkColor', String(getOpt('watermarkColor')));
1145
- if (hasVal('watermarkOpacity'))
1146
- setNumber('watermarkOpacity', Number(getOpt('watermarkOpacity')));
1147
- if (hasVal('watermarkPosition'))
1148
- formData.watermarkPosition = String(getOpt('watermarkPosition'));
1149
- if (hasVal('watermarkMargin'))
1150
- setNumber('watermarkMargin', Number(getOpt('watermarkMargin')));
1151
- if (hasVal('watermarkScale'))
1152
- setNumber('watermarkScale', Number(getOpt('watermarkScale')));
1153
- if (hasVal('pdfMode'))
1154
- formData.pdfMode = String(getOpt('pdfMode'));
1155
- if (hasVal('pdfPageSize'))
1156
- formData.pdfPageSize = String(getOpt('pdfPageSize'));
1157
- if (hasVal('pdfOrientation'))
1158
- formData.pdfOrientation = String(getOpt('pdfOrientation'));
1159
- if (hasVal('pdfMargin'))
1160
- setNumber('pdfMargin', Number(getOpt('pdfMargin')));
1161
- if (hasVal('pdfEmbedFormat'))
1162
- formData.pdfEmbedFormat = String(getOpt('pdfEmbedFormat'));
1163
- if (hasVal('pdfJpegQuality'))
1164
- setNumber('pdfJpegQuality', Number(getOpt('pdfJpegQuality')));
1165
- if (hasVal('includeRawExif'))
1166
- setBool('includeRawExif', Boolean(getOpt('includeRawExif')));
1167
- const watermarkProp = this.getNodeParameter('watermarkBinaryProperty', itemIndex, '');
1168
- if (watermarkProp)
1169
- await includeWatermarkFile(watermarkProp);
1252
+ const selectedActions = this.getNodeParameter('actions', itemIndex, []) || [];
1253
+ if (selectedActions.length === 0)
1254
+ throw new Error('Select at least one action for multitask.');
1255
+ const setNumberOnce = (name, value) => {
1256
+ if (value !== undefined && value !== null && value !== 0 && formData[name] === undefined)
1257
+ formData[name] = String(value);
1258
+ };
1259
+ const setStringOnce = (name, value) => {
1260
+ if (value && formData[name] === undefined)
1261
+ formData[name] = value;
1262
+ };
1263
+ const setBoolOnce = (name, value) => {
1264
+ if (value && formData[name] === undefined)
1265
+ formData[name] = toBoolString(value);
1266
+ };
1267
+ setStringOnce('format', this.getNodeParameter('multitaskFormat', itemIndex));
1268
+ setBoolOnce('keepMetadata', this.getNodeParameter('multitaskKeepMetadata', itemIndex));
1269
+ for (const a of selectedActions) {
1270
+ switch (a) {
1271
+ case 'format':
1272
+ setNumberOnce('width', this.getNodeParameter('formatWidth', itemIndex));
1273
+ setNumberOnce('height', this.getNodeParameter('formatHeight', itemIndex));
1274
+ break;
1275
+ 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));
1280
+ break;
1281
+ 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));
1288
+ break;
1289
+ 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));
1294
+ break;
1295
+ 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));
1300
+ break;
1301
+ 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));
1310
+ break;
1311
+ 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));
1317
+ break;
1318
+ 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));
1323
+ break;
1324
+ 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));
1334
+ break;
1335
+ }
1336
+ }
1170
1337
  break;
1171
1338
  }
1172
1339
  }
@@ -1323,41 +1490,65 @@ class DavixH2I {
1323
1490
  selectedTools = tools;
1324
1491
  formData.tools = tools.join(',');
1325
1492
  }
1326
- const toolOptions = this.getNodeParameter('options', itemIndex, {}) || {};
1327
- const hasOpt = (key) => Object.prototype.hasOwnProperty.call(toolOptions, key);
1328
- const getOpt = (key) => toolOptions[key];
1329
1493
  const hasTool = (toolName) => selectedTools.includes(toolName);
1330
1494
  if (hasTool('metadata')) {
1331
- if (hasOpt('includeRawExif'))
1332
- setBool('includeRawExif', Boolean(getOpt('includeRawExif')));
1495
+ const includeRawExif = action === 'single'
1496
+ ? this.getNodeParameter('includeRawExifSingle', itemIndex, false)
1497
+ : this.getNodeParameter('includeRawExifMulti', itemIndex, false);
1498
+ if (includeRawExif)
1499
+ setBool('includeRawExif', includeRawExif);
1333
1500
  }
1334
1501
  if (hasTool('palette')) {
1335
- if (hasOpt('paletteSize'))
1336
- setNumber('paletteSize', Number(getOpt('paletteSize')));
1502
+ const paletteSize = action === 'single'
1503
+ ? this.getNodeParameter('paletteSizeSingle', itemIndex, 0)
1504
+ : this.getNodeParameter('paletteSizeMulti', itemIndex, 0);
1505
+ if (paletteSize)
1506
+ setNumber('paletteSize', paletteSize);
1337
1507
  }
1338
1508
  if (hasTool('hash')) {
1339
- if (hasOpt('hashType'))
1340
- setString('hashType', String(getOpt('hashType')));
1509
+ const hashType = action === 'single'
1510
+ ? this.getNodeParameter('hashTypeSingle', itemIndex)
1511
+ : this.getNodeParameter('hashTypeMulti', itemIndex);
1512
+ if (hashType)
1513
+ setString('hashType', hashType);
1341
1514
  }
1342
1515
  if (hasTool('quality')) {
1343
- if (hasOpt('qualitySample'))
1344
- setNumber('qualitySample', Number(getOpt('qualitySample')));
1516
+ const qualitySample = action === 'single'
1517
+ ? this.getNodeParameter('qualitySampleSingle', itemIndex, 0)
1518
+ : this.getNodeParameter('qualitySampleMulti', itemIndex, 0);
1519
+ if (qualitySample)
1520
+ setNumber('qualitySample', qualitySample);
1345
1521
  }
1346
1522
  if (hasTool('transparency')) {
1347
- if (hasOpt('transparencySample'))
1348
- setNumber('transparencySample', Number(getOpt('transparencySample')));
1523
+ const transparencySample = action === 'single'
1524
+ ? this.getNodeParameter('transparencySampleSingle', itemIndex, 0)
1525
+ : this.getNodeParameter('transparencySampleMulti', itemIndex, 0);
1526
+ if (transparencySample)
1527
+ setNumber('transparencySample', transparencySample);
1349
1528
  }
1350
1529
  if (hasTool('similarity')) {
1351
- if (hasOpt('similarityMode'))
1352
- setString('similarityMode', String(getOpt('similarityMode')));
1353
- if (hasOpt('similarityThreshold'))
1354
- setNumber('similarityThreshold', Number(getOpt('similarityThreshold')));
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);
1355
1540
  }
1356
1541
  if (hasTool('efficiency')) {
1357
- if (hasOpt('efficiencyFormat'))
1358
- setString('efficiencyFormat', String(getOpt('efficiencyFormat')));
1359
- if (hasOpt('efficiencyQuality'))
1360
- setNumber('efficiencyQuality', Number(getOpt('efficiencyQuality')));
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);
1361
1552
  }
1362
1553
  const response = await GenericFunctions_1.davixRequest.call(this, {
1363
1554
  method: 'POST',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-h2i",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Davix H2I (PixLab) community node for n8n: H2I, Image, PDF, Tools endpoints",
5
5
  "license": "MIT",
6
6
  "keywords": [