n8n-nodes-sudomock 0.8.0 → 0.8.2

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.
@@ -16,8 +16,9 @@ function format2DPrintAreas(printAreas) {
16
16
  }
17
17
  function parseJsonArray(value, name) {
18
18
  const parsed = typeof value === 'string' ? JSON.parse(value) : value;
19
- if (!Array.isArray(parsed))
20
- throw new Error(`${name} must be a JSON array`);
19
+ if (!Array.isArray(parsed)) {
20
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `${name} must be a JSON array`);
21
+ }
21
22
  return parsed;
22
23
  }
23
24
  /**
@@ -48,7 +49,7 @@ class SudoMock {
48
49
  description = {
49
50
  displayName: 'SudoMock',
50
51
  name: 'sudoMock',
51
- icon: 'file:sudomock.svg',
52
+ icon: { light: 'file:sudomock.svg', dark: 'file:sudomock.svg' },
52
53
  group: ['transform'],
53
54
  version: 1,
54
55
  subtitle: '={{$parameter["operation"]}}',
@@ -81,6 +82,12 @@ class SudoMock {
81
82
  description: 'Create a 2D mockup now or queue it for background processing',
82
83
  action: 'Create a 2D mockup',
83
84
  },
85
+ {
86
+ name: '2D: Delete Mockup',
87
+ value: 'delete2DMockup',
88
+ description: 'Delete a 2D mockup',
89
+ action: 'Delete a 2D mockup',
90
+ },
84
91
  {
85
92
  name: '2D: Get Mockup',
86
93
  value: 'get2DMockup',
@@ -93,12 +100,6 @@ class SudoMock {
93
100
  description: 'List your 2D mockups',
94
101
  action: 'List 2D mockups',
95
102
  },
96
- {
97
- name: '2D: Set Print Areas',
98
- value: 'set2DPrintAreas',
99
- description: 'Replace or clear the saved print area quads for a 2D mockup',
100
- action: 'Set 2D print areas',
101
- },
102
103
  {
103
104
  name: '2D: Render Mockup',
104
105
  value: 'render2DMockup',
@@ -106,10 +107,10 @@ class SudoMock {
106
107
  action: 'Render a 2D mockup',
107
108
  },
108
109
  {
109
- name: '2D: Delete Mockup',
110
- value: 'delete2DMockup',
111
- description: 'Delete a 2D mockup',
112
- action: 'Delete a 2D mockup',
110
+ name: '2D: Set Print Areas',
111
+ value: 'set2DPrintAreas',
112
+ description: 'Replace or clear the saved print area quads for a 2D mockup',
113
+ action: 'Set 2D print areas',
113
114
  },
114
115
  {
115
116
  name: 'Artwork: Delete Stored Files',
@@ -153,30 +154,30 @@ class SudoMock {
153
154
  description: 'Get account details, subscription, and usage statistics',
154
155
  action: 'Get account information',
155
156
  },
156
- {
157
- name: 'Get Mockup',
158
- value: 'getMockup',
159
- description: 'Get details of a specific mockup template',
160
- action: 'Get mockup details',
161
- },
162
- {
163
- name: 'List Mockups',
164
- value: 'listMockups',
165
- description: 'List all your uploaded mockup templates',
166
- action: 'List mockups',
167
- },
168
157
  {
169
158
  name: 'Get Job',
170
159
  value: 'getJob',
171
160
  description: 'Poll an async job by its job_id (GET /jobs/{job_id}) to get its status and result',
172
161
  action: 'Get a job',
173
162
  },
163
+ {
164
+ name: 'Get Mockup',
165
+ value: 'getMockup',
166
+ description: 'Get details of a specific mockup template',
167
+ action: 'Get mockup details',
168
+ },
174
169
  {
175
170
  name: 'List Jobs',
176
171
  value: 'listJobs',
177
172
  description: 'List your async render, upload, and video jobs',
178
173
  action: 'List jobs',
179
174
  },
175
+ {
176
+ name: 'List Mockups',
177
+ value: 'listMockups',
178
+ description: 'List all your uploaded mockup templates',
179
+ action: 'List mockups',
180
+ },
180
181
  {
181
182
  name: 'Remove Background',
182
183
  value: 'removeBackground',
@@ -359,7 +360,7 @@ class SudoMock {
359
360
  type: 'number',
360
361
  typeOptions: { minValue: 1, maxValue: 100 },
361
362
  displayOptions: { show: { operation: ['list2DMockups'] } },
362
- default: 20,
363
+ default: 50,
363
364
  description: 'Number of 2D mockups to return from 1 to 100',
364
365
  },
365
366
  {
@@ -503,49 +504,73 @@ class SudoMock {
503
504
  displayName: 'Render Target',
504
505
  values: [
505
506
  {
506
- displayName: 'Target Type',
507
- name: 'targetType',
508
- type: 'options',
507
+ displayName: 'Adjustments',
508
+ name: 'adjustments',
509
+ type: 'collection',
510
+ placeholder: 'Add Adjustment',
511
+ default: {},
512
+ description: 'Artwork appearance settings for this print area',
509
513
  options: [
510
514
  {
511
- name: 'Saved Print Area',
512
- value: 'savedPrintArea',
513
- description: 'Target a saved print area returned in data.quads',
515
+ displayName: 'Blend Mode',
516
+ name: 'blend_mode',
517
+ type: 'options',
518
+ options: [
519
+ { name: 'Multiply', value: 'multiply' },
520
+ { name: 'Normal', value: 'normal' },
521
+ ],
522
+ default: 'multiply',
523
+ description: 'Artwork blend mode for the product surface',
514
524
  },
515
525
  {
516
- name: 'Full Surface',
517
- value: 'fullSurface',
518
- description: 'Target a full surface returned in data.surfaces',
526
+ displayName: 'Blur',
527
+ name: 'blur',
528
+ type: 'number',
529
+ typeOptions: { minValue: 0, maxValue: 100 },
530
+ default: 0,
531
+ description: 'Gaussian blur amount from 0 to 100',
519
532
  },
520
- ],
521
- default: 'savedPrintArea',
522
- description: 'Whether this artwork targets a saved area or a full surface',
523
- },
524
- {
525
- displayName: 'Saved Print Area UUID',
526
- name: 'uuid',
527
- type: 'string',
528
- required: true,
529
- displayOptions: {
530
- show: {
531
- targetType: ['savedPrintArea'],
533
+ {
534
+ displayName: 'Brightness',
535
+ name: 'brightness',
536
+ type: 'number',
537
+ typeOptions: { minValue: -150, maxValue: 150 },
538
+ default: 0,
539
+ description: 'Brightness adjustment from -150 to 150',
532
540
  },
533
- },
534
- default: '',
535
- description: 'The print_area_id returned in data.quads by 2D: Get Mockup',
536
- },
537
- {
538
- displayName: 'Full-Surface UUID',
539
- name: 'surfaceUuid',
540
- type: 'string',
541
- required: true,
542
- displayOptions: {
543
- show: {
544
- targetType: ['fullSurface'],
541
+ {
542
+ displayName: 'Contrast',
543
+ name: 'contrast',
544
+ type: 'number',
545
+ typeOptions: { minValue: -100, maxValue: 100 },
546
+ default: 0,
547
+ description: 'Contrast adjustment from -100 to 100',
545
548
  },
546
- },
547
- default: '',
548
- description: 'The surface_uuid returned in data.surfaces by 2D: Get Mockup',
549
+ {
550
+ displayName: 'Opacity',
551
+ name: 'opacity',
552
+ type: 'number',
553
+ typeOptions: { minValue: 0, maxValue: 100 },
554
+ default: 100,
555
+ description: 'Artwork opacity from 0 to 100',
556
+ },
557
+ {
558
+ displayName: 'Saturation',
559
+ name: 'saturation',
560
+ type: 'number',
561
+ typeOptions: { minValue: -100, maxValue: 100 },
562
+ default: 0,
563
+ description: 'Saturation adjustment from -100 to 100',
564
+ },
565
+ {
566
+ displayName: 'Vibrance',
567
+ name: 'vibrance',
568
+ type: 'number',
569
+ typeOptions: { minValue: -100, maxValue: 100 },
570
+ default: 0,
571
+ description: 'Vibrance adjustment from -100 to 100',
572
+ },
573
+ ],
549
574
  },
550
575
  {
551
576
  displayName: 'Artwork Type',
@@ -593,89 +618,26 @@ class SudoMock {
593
618
  default: '',
594
619
  description: 'Base64 artwork data for this print area',
595
620
  },
596
- {
597
- displayName: 'Remove Background',
598
- name: 'removeBackground',
599
- type: 'boolean',
600
- default: false,
601
- description: 'Whether to remove the artwork background before placing it. Adds 25 credits per artwork.',
602
- },
603
621
  {
604
622
  displayName: 'Color',
605
623
  name: 'color',
606
- type: 'string',
624
+ type: 'color',
607
625
  default: '',
608
626
  placeholder: '#FF0000',
609
627
  description: 'Optional hex color fill or overlay',
610
628
  },
611
629
  {
612
- displayName: 'Adjustments',
613
- name: 'adjustments',
614
- type: 'collection',
615
- placeholder: 'Add Adjustment',
616
- default: {},
617
- description: 'Artwork appearance settings for this print area',
618
- options: [
619
- {
620
- displayName: 'Brightness',
621
- name: 'brightness',
622
- type: 'number',
623
- typeOptions: { minValue: -150, maxValue: 150 },
624
- default: 0,
625
- description: 'Brightness adjustment from -150 to 150',
626
- },
627
- {
628
- displayName: 'Contrast',
629
- name: 'contrast',
630
- type: 'number',
631
- typeOptions: { minValue: -100, maxValue: 100 },
632
- default: 0,
633
- description: 'Contrast adjustment from -100 to 100',
634
- },
635
- {
636
- displayName: 'Opacity',
637
- name: 'opacity',
638
- type: 'number',
639
- typeOptions: { minValue: 0, maxValue: 100 },
640
- default: 100,
641
- description: 'Artwork opacity from 0 to 100',
642
- },
643
- {
644
- displayName: 'Saturation',
645
- name: 'saturation',
646
- type: 'number',
647
- typeOptions: { minValue: -100, maxValue: 100 },
648
- default: 0,
649
- description: 'Saturation adjustment from -100 to 100',
650
- },
651
- {
652
- displayName: 'Vibrance',
653
- name: 'vibrance',
654
- type: 'number',
655
- typeOptions: { minValue: -100, maxValue: 100 },
656
- default: 0,
657
- description: 'Vibrance adjustment from -100 to 100',
658
- },
659
- {
660
- displayName: 'Blur',
661
- name: 'blur',
662
- type: 'number',
663
- typeOptions: { minValue: 0, maxValue: 100 },
664
- default: 0,
665
- description: 'Gaussian blur amount from 0 to 100',
666
- },
667
- {
668
- displayName: 'Blend Mode',
669
- name: 'blend_mode',
670
- type: 'options',
671
- options: [
672
- { name: 'Multiply', value: 'multiply' },
673
- { name: 'Normal', value: 'normal' },
674
- ],
675
- default: 'multiply',
676
- description: 'Artwork blend mode for the product surface',
630
+ displayName: 'Full-Surface UUID',
631
+ name: 'surfaceUuid',
632
+ type: 'string',
633
+ required: true,
634
+ displayOptions: {
635
+ show: {
636
+ targetType: ['fullSurface'],
677
637
  },
678
- ],
638
+ },
639
+ default: '',
640
+ description: 'The surface_uuid returned in data.surfaces by 2D: Get Mockup',
679
641
  },
680
642
  {
681
643
  displayName: 'Placement',
@@ -685,24 +647,6 @@ class SudoMock {
685
647
  default: {},
686
648
  description: 'Artwork position and size settings for this print area',
687
649
  options: [
688
- {
689
- displayName: 'Position',
690
- name: 'position',
691
- type: 'options',
692
- options: [
693
- { name: 'Top Left', value: 'top_left' },
694
- { name: 'Top Center', value: 'top_center' },
695
- { name: 'Top Right', value: 'top_right' },
696
- { name: 'Center Left', value: 'center_left' },
697
- { name: 'Center', value: 'center' },
698
- { name: 'Center Right', value: 'center_right' },
699
- { name: 'Bottom Left', value: 'bottom_left' },
700
- { name: 'Bottom Center', value: 'bottom_center' },
701
- { name: 'Bottom Right', value: 'bottom_right' },
702
- ],
703
- default: 'center',
704
- description: 'Predefined artwork position in the print area',
705
- },
706
650
  {
707
651
  displayName: 'Coverage',
708
652
  name: 'coverage',
@@ -723,14 +667,6 @@ class SudoMock {
723
667
  default: 'contain',
724
668
  description: 'How the artwork fits within the print area',
725
669
  },
726
- {
727
- displayName: 'Width',
728
- name: 'width',
729
- type: 'number',
730
- typeOptions: { minValue: 1, maxValue: 30000 },
731
- default: 1000,
732
- description: 'Artwork width in print-area pixels. Add Height alongside it; the pair overrides Coverage and Fit. Width and Height are independent, so any aspect ratio is allowed.',
733
- },
734
670
  {
735
671
  displayName: 'Height',
736
672
  name: 'height',
@@ -739,6 +675,38 @@ class SudoMock {
739
675
  default: 1000,
740
676
  description: 'Artwork height in print-area pixels. Add Width alongside it. Adding only one of the two is rejected rather than silently completed, so the aspect ratio is never guessed for you.',
741
677
  },
678
+ {
679
+ displayName: 'Offset X',
680
+ name: 'offset_x',
681
+ type: 'number',
682
+ default: 0,
683
+ description: 'Horizontal artwork offset in pixels',
684
+ },
685
+ {
686
+ displayName: 'Offset Y',
687
+ name: 'offset_y',
688
+ type: 'number',
689
+ default: 0,
690
+ description: 'Vertical artwork offset in pixels',
691
+ },
692
+ {
693
+ displayName: 'Position',
694
+ name: 'position',
695
+ type: 'options',
696
+ options: [
697
+ { name: 'Bottom Center', value: 'bottom_center' },
698
+ { name: 'Bottom Left', value: 'bottom_left' },
699
+ { name: 'Bottom Right', value: 'bottom_right' },
700
+ { name: 'Center', value: 'center' },
701
+ { name: 'Center Left', value: 'center_left' },
702
+ { name: 'Center Right', value: 'center_right' },
703
+ { name: 'Top Center', value: 'top_center' },
704
+ { name: 'Top Left', value: 'top_left' },
705
+ { name: 'Top Right', value: 'top_right' },
706
+ ],
707
+ default: 'center',
708
+ description: 'Predefined artwork position in the print area',
709
+ },
742
710
  {
743
711
  displayName: 'Rotation',
744
712
  name: 'rotation',
@@ -747,20 +715,53 @@ class SudoMock {
747
715
  description: 'Artwork rotation in degrees',
748
716
  },
749
717
  {
750
- displayName: 'Offset X',
751
- name: 'offset_x',
718
+ displayName: 'Width',
719
+ name: 'width',
752
720
  type: 'number',
753
- default: 0,
754
- description: 'Horizontal artwork offset in pixels',
721
+ typeOptions: { minValue: 1, maxValue: 30000 },
722
+ default: 1000,
723
+ description: 'Artwork width in print-area pixels. Add Height alongside it; the pair overrides Coverage and Fit. Width and Height are independent, so any aspect ratio is allowed.',
724
+ },
725
+ ],
726
+ },
727
+ {
728
+ displayName: 'Remove Background',
729
+ name: 'removeBackground',
730
+ type: 'boolean',
731
+ default: false,
732
+ description: 'Whether to remove the artwork background before placing it. Adds 25 credits per artwork.',
733
+ },
734
+ {
735
+ displayName: 'Saved Print Area UUID',
736
+ name: 'uuid',
737
+ type: 'string',
738
+ required: true,
739
+ displayOptions: {
740
+ show: {
741
+ targetType: ['savedPrintArea'],
742
+ },
743
+ },
744
+ default: '',
745
+ description: 'The print_area_id returned in data.quads by 2D: Get Mockup',
746
+ },
747
+ {
748
+ displayName: 'Target Type',
749
+ name: 'targetType',
750
+ type: 'options',
751
+ options: [
752
+ {
753
+ name: 'Saved Print Area',
754
+ value: 'savedPrintArea',
755
+ description: 'Target a saved print area returned in data.quads',
755
756
  },
756
757
  {
757
- displayName: 'Offset Y',
758
- name: 'offset_y',
759
- type: 'number',
760
- default: 0,
761
- description: 'Vertical artwork offset in pixels',
758
+ name: 'Full Surface',
759
+ value: 'fullSurface',
760
+ description: 'Target a full surface returned in data.surfaces',
762
761
  },
763
762
  ],
763
+ default: 'savedPrintArea',
764
+ description: 'Whether this artwork targets a saved area or a full surface',
764
765
  },
765
766
  ],
766
767
  },
@@ -956,22 +957,60 @@ class SudoMock {
956
957
  default: {},
957
958
  options: [
958
959
  {
959
- displayName: 'Rotation',
960
- name: 'rotate',
960
+ displayName: 'Base64 Image',
961
+ name: 'base64',
962
+ type: 'string',
963
+ default: '',
964
+ description: 'Raw base64-encoded image bytes (no data: prefix). Alternative to Design URL; eliminates server-side download latency. If set, takes priority over the URL.',
965
+ },
966
+ {
967
+ displayName: 'Blur',
968
+ name: 'blur',
961
969
  type: 'number',
962
970
  typeOptions: {
963
- minValue: -360,
964
- maxValue: 360,
971
+ minValue: 0,
972
+ maxValue: 100,
965
973
  },
966
974
  default: 0,
967
- description: 'Rotation angle in degrees',
975
+ description: 'Gaussian blur amount (0=sharp, 100=max blur)',
968
976
  },
969
977
  {
970
- displayName: 'Base64 Image',
971
- name: 'base64',
972
- type: 'string',
978
+ displayName: 'Brightness',
979
+ name: 'brightness',
980
+ type: 'number',
981
+ typeOptions: {
982
+ minValue: -150,
983
+ maxValue: 150,
984
+ },
985
+ default: 0,
986
+ description: 'Brightness adjustment (-150 to 150)',
987
+ },
988
+ {
989
+ displayName: 'Color Blend Mode',
990
+ name: 'colorBlendMode',
991
+ type: 'options',
992
+ options: [
993
+ { name: 'Color Burn', value: 'color-burn' },
994
+ { name: 'Color Dodge', value: 'color-dodge' },
995
+ { name: 'Darken', value: 'darken' },
996
+ { name: 'Hard Light', value: 'hard-light' },
997
+ { name: 'Lighten', value: 'lighten' },
998
+ { name: 'Multiply', value: 'multiply' },
999
+ { name: 'Normal', value: 'normal' },
1000
+ { name: 'Overlay', value: 'overlay' },
1001
+ { name: 'Screen', value: 'screen' },
1002
+ { name: 'Soft Light', value: 'soft-light' },
1003
+ ],
1004
+ default: 'normal',
1005
+ description: 'Blend mode for color overlay',
1006
+ },
1007
+ {
1008
+ displayName: 'Color Overlay (Hex)',
1009
+ name: 'colorHex',
1010
+ type: 'color',
973
1011
  default: '',
974
- description: 'Raw base64-encoded image bytes (no data: prefix). Alternative to Design URL; eliminates server-side download latency. If set, takes priority over the URL.',
1012
+ placeholder: '#FF5733',
1013
+ description: 'Apply color overlay to the design',
975
1014
  },
976
1015
  {
977
1016
  displayName: 'Content Type',
@@ -987,14 +1026,15 @@ class SudoMock {
987
1026
  description: 'MIME type of the Base64 Image. Defaults to image/png if omitted.',
988
1027
  },
989
1028
  {
990
- displayName: 'Custom Width',
991
- name: 'sizeWidth',
1029
+ displayName: 'Contrast',
1030
+ name: 'contrast',
992
1031
  type: 'number',
993
1032
  typeOptions: {
994
- minValue: 1,
1033
+ minValue: -100,
1034
+ maxValue: 100,
995
1035
  },
996
1036
  default: 0,
997
- description: 'Custom asset width override in pixels. 0 = use smart object bounds.',
1037
+ description: 'Contrast adjustment (-100 to 100)',
998
1038
  },
999
1039
  {
1000
1040
  displayName: 'Custom Height',
@@ -1007,11 +1047,25 @@ class SudoMock {
1007
1047
  description: 'Custom asset height override in pixels. 0 = use smart object bounds.',
1008
1048
  },
1009
1049
  {
1010
- displayName: 'Position Top',
1011
- name: 'positionTop',
1050
+ displayName: 'Custom Width',
1051
+ name: 'sizeWidth',
1012
1052
  type: 'number',
1053
+ typeOptions: {
1054
+ minValue: 1,
1055
+ },
1013
1056
  default: 0,
1014
- description: 'Custom position top offset in pixels',
1057
+ description: 'Custom asset width override in pixels. 0 = use smart object bounds.',
1058
+ },
1059
+ {
1060
+ displayName: 'Opacity',
1061
+ name: 'opacity',
1062
+ type: 'number',
1063
+ typeOptions: {
1064
+ minValue: 0,
1065
+ maxValue: 100,
1066
+ },
1067
+ default: 100,
1068
+ description: 'Layer opacity (0-100)',
1015
1069
  },
1016
1070
  {
1017
1071
  displayName: 'Position Left',
@@ -1020,6 +1074,13 @@ class SudoMock {
1020
1074
  default: 0,
1021
1075
  description: 'Custom position left offset in pixels',
1022
1076
  },
1077
+ {
1078
+ displayName: 'Position Top',
1079
+ name: 'positionTop',
1080
+ type: 'number',
1081
+ default: 0,
1082
+ description: 'Custom position top offset in pixels',
1083
+ },
1023
1084
  {
1024
1085
  displayName: 'Remove Background',
1025
1086
  name: 'removeBackground',
@@ -1028,64 +1089,15 @@ class SudoMock {
1028
1089
  description: 'Whether to remove the artwork background before placing it. Adds 25 credits per artwork.',
1029
1090
  },
1030
1091
  {
1031
- displayName: 'Color Overlay (Hex)',
1032
- name: 'colorHex',
1033
- type: 'string',
1034
- default: '',
1035
- placeholder: '#FF5733',
1036
- description: 'Apply color overlay to the design',
1037
- },
1038
- {
1039
- displayName: 'Color Blend Mode',
1040
- name: 'colorBlendMode',
1041
- type: 'options',
1042
- options: [
1043
- { name: 'Normal', value: 'normal' },
1044
- { name: 'Multiply', value: 'multiply' },
1045
- { name: 'Screen', value: 'screen' },
1046
- { name: 'Overlay', value: 'overlay' },
1047
- { name: 'Darken', value: 'darken' },
1048
- { name: 'Lighten', value: 'lighten' },
1049
- { name: 'Color Dodge', value: 'color-dodge' },
1050
- { name: 'Color Burn', value: 'color-burn' },
1051
- { name: 'Hard Light', value: 'hard-light' },
1052
- { name: 'Soft Light', value: 'soft-light' },
1053
- ],
1054
- default: 'normal',
1055
- description: 'Blend mode for color overlay',
1056
- },
1057
- {
1058
- displayName: 'Brightness',
1059
- name: 'brightness',
1060
- type: 'number',
1061
- typeOptions: {
1062
- minValue: -150,
1063
- maxValue: 150,
1064
- },
1065
- default: 0,
1066
- description: 'Brightness adjustment (-150 to 150)',
1067
- },
1068
- {
1069
- displayName: 'Contrast',
1070
- name: 'contrast',
1092
+ displayName: 'Rotation',
1093
+ name: 'rotate',
1071
1094
  type: 'number',
1072
1095
  typeOptions: {
1073
- minValue: -100,
1074
- maxValue: 100,
1096
+ minValue: -360,
1097
+ maxValue: 360,
1075
1098
  },
1076
1099
  default: 0,
1077
- description: 'Contrast adjustment (-100 to 100)',
1078
- },
1079
- {
1080
- displayName: 'Opacity',
1081
- name: 'opacity',
1082
- type: 'number',
1083
- typeOptions: {
1084
- minValue: 0,
1085
- maxValue: 100,
1086
- },
1087
- default: 100,
1088
- description: 'Layer opacity (0-100)',
1100
+ description: 'Rotation angle in degrees',
1089
1101
  },
1090
1102
  {
1091
1103
  displayName: 'Saturation',
@@ -1109,17 +1121,6 @@ class SudoMock {
1109
1121
  default: 0,
1110
1122
  description: 'Vibrance adjustment (-100 to 100). Similar to saturation but preserves skin tones.',
1111
1123
  },
1112
- {
1113
- displayName: 'Blur',
1114
- name: 'blur',
1115
- type: 'number',
1116
- typeOptions: {
1117
- minValue: 0,
1118
- maxValue: 100,
1119
- },
1120
- default: 0,
1121
- description: 'Gaussian blur amount (0=sharp, 100=max blur)',
1122
- },
1123
1124
  ],
1124
1125
  },
1125
1126
  ],
@@ -1146,6 +1147,24 @@ class SudoMock {
1146
1147
  },
1147
1148
  default: {},
1148
1149
  options: [
1150
+ {
1151
+ displayName: 'DPI',
1152
+ name: 'dpi',
1153
+ type: 'number',
1154
+ typeOptions: {
1155
+ minValue: 72,
1156
+ maxValue: 2400,
1157
+ },
1158
+ default: 300,
1159
+ description: 'Print resolution 72-2400. Embeds a resolution tag in output metadata (JPEG/PNG/WebP). Does not change pixel count, image_size controls that (for a true print file: image_size = print inches x dpi). jpg/png recommended for max compatibility. Leave unset for web mockups.',
1160
+ },
1161
+ {
1162
+ displayName: 'Export Label',
1163
+ name: 'exportLabel',
1164
+ type: 'string',
1165
+ default: '',
1166
+ description: 'Optional label for the output file naming',
1167
+ },
1149
1168
  {
1150
1169
  displayName: 'Image Format',
1151
1170
  name: 'imageFormat',
@@ -1191,24 +1210,6 @@ class SudoMock {
1191
1210
  default: 90,
1192
1211
  description: 'Quality for JPG/WebP output (1-100). Ignored for PNG (always lossless).',
1193
1212
  },
1194
- {
1195
- displayName: 'DPI',
1196
- name: 'dpi',
1197
- type: 'number',
1198
- typeOptions: {
1199
- minValue: 72,
1200
- maxValue: 2400,
1201
- },
1202
- default: 300,
1203
- description: 'Print resolution 72-2400. Embeds a resolution tag in output metadata (JPEG/PNG/WebP). Does not change pixel count, image_size controls that (for a true print file: image_size = print inches x dpi). jpg/png recommended for max compatibility. Leave unset for web mockups.',
1204
- },
1205
- {
1206
- displayName: 'Export Label',
1207
- name: 'exportLabel',
1208
- type: 'string',
1209
- default: '',
1210
- description: 'Optional label for the output file naming',
1211
- },
1212
1213
  ],
1213
1214
  },
1214
1215
  {
@@ -1414,7 +1415,7 @@ class SudoMock {
1414
1415
  type: 'string',
1415
1416
  default: '',
1416
1417
  placeholder: 'kling-v3-pro',
1417
- description: 'Optional override to pin a specific model from the roster (veo-3.1-fast, kling-v3-pro, kling-2.6-pro, seedance-2.0, wan-2.5). Leave empty to let SudoMock auto-pick by plan tier. An unknown id returns a 400 error.',
1418
+ description: 'Optional override to pin a specific model from the roster (veo-3.1-fast, kling-v3-pro, kling-2.6-pro, seedance-2.0, wan-2.5). Leave empty to let SudoMock auto-pick by plan tier. An unknown ID returns a 400 error.',
1418
1419
  },
1419
1420
  ],
1420
1421
  },
@@ -1511,11 +1512,11 @@ class SudoMock {
1511
1512
  name: 'kind',
1512
1513
  type: 'options',
1513
1514
  options: [
1515
+ { name: '2D Create', value: '2d_create' },
1516
+ { name: '2D Render', value: '2d_render' },
1514
1517
  { name: 'Render', value: 'render' },
1515
1518
  { name: 'Upload', value: 'upload' },
1516
1519
  { name: 'Video', value: 'video' },
1517
- { name: '2D Create', value: '2d_create' },
1518
- { name: '2D Render', value: '2d_render' },
1519
1520
  ],
1520
1521
  default: 'render',
1521
1522
  description: 'Only return jobs of this kind',
@@ -1535,7 +1536,7 @@ class SudoMock {
1535
1536
  minValue: 1,
1536
1537
  maxValue: 50,
1537
1538
  },
1538
- default: 20,
1539
+ default: 50,
1539
1540
  description: 'Max number of results to return',
1540
1541
  },
1541
1542
  {
@@ -1585,6 +1586,12 @@ class SudoMock {
1585
1586
  displayOptions: { show: { operation: ['listFonts'] } },
1586
1587
  default: {},
1587
1588
  options: [
1589
+ {
1590
+ displayName: 'Category',
1591
+ name: 'category',
1592
+ type: 'string',
1593
+ default: '',
1594
+ },
1588
1595
  {
1589
1596
  displayName: 'Page',
1590
1597
  name: 'page',
@@ -1599,19 +1606,6 @@ class SudoMock {
1599
1606
  typeOptions: { minValue: 1, maxValue: 100 },
1600
1607
  default: 50,
1601
1608
  },
1602
- {
1603
- displayName: 'Category',
1604
- name: 'category',
1605
- type: 'string',
1606
- default: '',
1607
- },
1608
- {
1609
- displayName: 'Search',
1610
- name: 'search',
1611
- type: 'string',
1612
- default: '',
1613
- description: 'Filter by font family name',
1614
- },
1615
1609
  {
1616
1610
  displayName: 'Scope',
1617
1611
  name: 'scope',
@@ -1623,6 +1617,13 @@ class SudoMock {
1623
1617
  ],
1624
1618
  default: 'all',
1625
1619
  },
1620
+ {
1621
+ displayName: 'Search',
1622
+ name: 'search',
1623
+ type: 'string',
1624
+ default: '',
1625
+ description: 'Filter by font family name',
1626
+ },
1626
1627
  ],
1627
1628
  },
1628
1629
  // ============================================
@@ -1832,7 +1833,7 @@ class SudoMock {
1832
1833
  maxValue: 200,
1833
1834
  },
1834
1835
  default: 50,
1835
- description: 'Max number of results to return (1-200)',
1836
+ description: 'Max number of results to return',
1836
1837
  },
1837
1838
  ],
1838
1839
  },
@@ -1877,8 +1878,8 @@ class SudoMock {
1877
1878
  minValue: 1,
1878
1879
  maxValue: 200,
1879
1880
  },
1880
- default: 100,
1881
- description: 'Max number of results to return (1-200)',
1881
+ default: 50,
1882
+ description: 'Max number of results to return',
1882
1883
  },
1883
1884
  ],
1884
1885
  },
@@ -1911,8 +1912,8 @@ class SudoMock {
1911
1912
  minValue: 1,
1912
1913
  maxValue: 100,
1913
1914
  },
1914
- default: 20,
1915
- description: 'Max number of results to return (1-100)',
1915
+ default: 50,
1916
+ description: 'Max number of results to return',
1916
1917
  },
1917
1918
  {
1918
1919
  displayName: 'Additional Options',
@@ -1926,13 +1927,6 @@ class SudoMock {
1926
1927
  },
1927
1928
  default: {},
1928
1929
  options: [
1929
- {
1930
- displayName: 'Filter by Name',
1931
- name: 'name',
1932
- type: 'string',
1933
- default: '',
1934
- description: 'Filter mockups by name (case-insensitive, partial match)',
1935
- },
1936
1930
  {
1937
1931
  displayName: 'Created After',
1938
1932
  name: 'created_after',
@@ -1947,6 +1941,13 @@ class SudoMock {
1947
1941
  default: '',
1948
1942
  description: 'Filter mockups created before this date',
1949
1943
  },
1944
+ {
1945
+ displayName: 'Filter by Name',
1946
+ name: 'name',
1947
+ type: 'string',
1948
+ default: '',
1949
+ description: 'Filter mockups by name (case-insensitive, partial match)',
1950
+ },
1950
1951
  {
1951
1952
  displayName: 'Sort By',
1952
1953
  name: 'sort',
@@ -2344,7 +2345,7 @@ class SudoMock {
2344
2345
  body.mockup_uuid = this.getNodeParameter('artworkDeleteMockupUuid', i);
2345
2346
  }
2346
2347
  else {
2347
- const urls = parseJsonArray(this.getNodeParameter('artworkDeleteUrls', i, []), 'URLs');
2348
+ const urls = parseJsonArray.call(this, this.getNodeParameter('artworkDeleteUrls', i, []), 'URLs');
2348
2349
  if (urls.length === 0 || !urls.every((url) => typeof url === 'string')) {
2349
2350
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'URLs must contain at least one URL');
2350
2351
  }
@@ -2367,7 +2368,7 @@ class SudoMock {
2367
2368
  else if (operation === 'render') {
2368
2369
  const mockupUuid = this.getNodeParameter('mockupUuid', i);
2369
2370
  const smartObjectsData = this.getNodeParameter('smartObjects.items', i, []);
2370
- const textLayers = parseJsonArray(this.getNodeParameter('textLayers', i, []), 'Text Layers');
2371
+ const textLayers = parseJsonArray.call(this, this.getNodeParameter('textLayers', i, []), 'Text Layers');
2371
2372
  const exportOptions = this.getNodeParameter('exportOptions', i, {});
2372
2373
  // Convert smart objects array to API format
2373
2374
  const smartObjects = smartObjectsData.map((so) => {
@@ -11,13 +11,15 @@ class SudoMockTrigger {
11
11
  description = {
12
12
  displayName: 'SudoMock Trigger',
13
13
  name: 'sudoMockTrigger',
14
- icon: 'file:sudomock.svg',
14
+ icon: { light: 'file:sudomock.svg', dark: 'file:sudomock.svg' },
15
15
  group: ['trigger'],
16
16
  version: 1,
17
+ subtitle: '={{$parameter["events"].length > 0 ? $parameter["events"].join(", ") : "All events"}}',
17
18
  description: 'Start a workflow when a SudoMock job or test event finishes',
18
19
  defaults: { name: 'SudoMock Trigger' },
19
20
  inputs: [],
20
21
  outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
22
+ usableAsTool: true,
21
23
  credentials: [{ name: 'sudoMockApi', required: true }],
22
24
  webhooks: [
23
25
  {
@@ -53,8 +55,9 @@ class SudoMockTrigger {
53
55
  return true;
54
56
  }
55
57
  catch (error) {
56
- if (Number(error.statusCode) !== 404)
57
- throw error;
58
+ if (Number(error.statusCode) !== 404) {
59
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
60
+ }
58
61
  delete data.webhookId;
59
62
  delete data.webhookSecret;
60
63
  return false;
@@ -91,8 +94,8 @@ class SudoMockTrigger {
91
94
  url: `${API_URL}/${data.webhookId}`,
92
95
  });
93
96
  }
94
- catch {
95
- return false;
97
+ catch (error) {
98
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
96
99
  }
97
100
  delete data.webhookId;
98
101
  delete data.webhookSecret;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-sudomock",
3
- "version": "0.8.0",
3
+ "version": "0.8.2",
4
4
  "description": "n8n community node for SudoMock mockup rendering API - POD automation",
5
5
  "license": "MIT",
6
6
  "homepage": "https://sudomock.com",