@trg-admin/n8n-nodes-zoho-desk 0.1.21 → 0.1.22

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.
@@ -762,52 +762,86 @@ class ZohoDesk {
762
762
  const returnAll = this.getNodeParameter('returnAll', i, false);
763
763
  const options = this.getNodeParameter('options', i, {});
764
764
  const qs = {};
765
+ const cleanCommaSeparated = (value) => {
766
+ if (typeof value !== 'string') {
767
+ return '';
768
+ }
769
+ return value
770
+ .split(',')
771
+ .map((s) => s.trim())
772
+ .filter(Boolean)
773
+ .join(',');
774
+ };
765
775
  // Department filtering: options.departmentIds, options.departmentId, or legacy parameter
766
776
  const topLevelDepartmentId = this.getNodeParameter('departmentId', i, '');
767
777
  if (options.departmentIds) {
768
- qs.departmentIds = options.departmentIds;
778
+ const cleaned = cleanCommaSeparated(options.departmentIds);
779
+ if (cleaned)
780
+ qs.departmentIds = cleaned;
769
781
  }
770
782
  else if (options.departmentId) {
771
- qs.departmentId = options.departmentId;
783
+ const cleaned = String(options.departmentId).trim();
784
+ if (cleaned)
785
+ qs.departmentId = cleaned;
772
786
  }
773
787
  else if (topLevelDepartmentId) {
774
- qs.departmentId = topLevelDepartmentId;
788
+ const cleaned = String(topLevelDepartmentId).trim();
789
+ if (cleaned)
790
+ qs.departmentId = cleaned;
775
791
  }
776
792
  if (options.viewId) {
777
- qs.viewId = options.viewId;
793
+ const cleaned = String(options.viewId).trim();
794
+ if (cleaned)
795
+ qs.viewId = cleaned;
778
796
  }
779
797
  if (options.assignee) {
780
- qs.assignee = options.assignee;
798
+ const cleaned = cleanCommaSeparated(options.assignee);
799
+ if (cleaned)
800
+ qs.assignee = cleaned;
781
801
  }
782
802
  if (options.teamIds) {
783
- qs.teamIds = options.teamIds;
803
+ const cleaned = cleanCommaSeparated(options.teamIds);
804
+ if (cleaned)
805
+ qs.teamIds = cleaned;
784
806
  }
785
807
  if (options.channel) {
786
- qs.channel = options.channel;
808
+ const cleaned = cleanCommaSeparated(options.channel);
809
+ if (cleaned)
810
+ qs.channel = cleaned;
787
811
  }
788
812
  if (options.status) {
789
- qs.status = options.status;
813
+ const cleaned = cleanCommaSeparated(options.status);
814
+ if (cleaned)
815
+ qs.status = cleaned;
790
816
  }
791
817
  if (options.priority) {
792
- qs.priority = options.priority;
818
+ const cleaned = cleanCommaSeparated(options.priority);
819
+ if (cleaned)
820
+ qs.priority = cleaned;
793
821
  }
794
822
  if (options.sortBy) {
795
- qs.sortBy = options.sortBy;
823
+ const cleaned = String(options.sortBy).trim();
824
+ if (cleaned)
825
+ qs.sortBy = cleaned;
796
826
  }
797
827
  if (options.receivedInDays) {
798
828
  qs.receivedInDays = options.receivedInDays;
799
829
  }
800
830
  if (options.fields) {
801
- qs.fields = options.fields;
831
+ const cleaned = cleanCommaSeparated(options.fields);
832
+ if (cleaned)
833
+ qs.fields = cleaned;
802
834
  }
803
835
  if (options.include) {
804
836
  if (Array.isArray(options.include)) {
805
837
  if (options.include.length > 0) {
806
- qs.include = options.include.join(',');
838
+ qs.include = options.include.map((s) => String(s).trim()).filter(Boolean).join(',');
807
839
  }
808
840
  }
809
- else if (typeof options.include === 'string' && options.include.trim()) {
810
- qs.include = options.include.trim();
841
+ else if (typeof options.include === 'string') {
842
+ const cleaned = cleanCommaSeparated(options.include);
843
+ if (cleaned)
844
+ qs.include = cleaned;
811
845
  }
812
846
  }
813
847
  if (returnAll) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trg-admin/n8n-nodes-zoho-desk",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "description": "Community n8n node starter for Zoho Desk using built-in Zoho OAuth2 auth behavior",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",