@joshuanode/n8n-nodes-cipp 0.0.13 → 0.0.15

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.
Files changed (49) hide show
  1. package/README.md +1 -1
  2. package/dist/nodes/Cipp/Cipp.node.d.ts.map +1 -1
  3. package/dist/nodes/Cipp/Cipp.node.js +1533 -46
  4. package/dist/nodes/Cipp/Cipp.node.js.map +1 -1
  5. package/dist/nodes/Cipp/descriptions/ConditionalAccessDescription.d.ts +4 -0
  6. package/dist/nodes/Cipp/descriptions/ConditionalAccessDescription.d.ts.map +1 -0
  7. package/dist/nodes/Cipp/descriptions/ConditionalAccessDescription.js +413 -0
  8. package/dist/nodes/Cipp/descriptions/ConditionalAccessDescription.js.map +1 -0
  9. package/dist/nodes/Cipp/descriptions/DeviceDescription.d.ts.map +1 -1
  10. package/dist/nodes/Cipp/descriptions/DeviceDescription.js +6 -0
  11. package/dist/nodes/Cipp/descriptions/DeviceDescription.js.map +1 -1
  12. package/dist/nodes/Cipp/descriptions/EmailSecurityDescription.d.ts +4 -0
  13. package/dist/nodes/Cipp/descriptions/EmailSecurityDescription.d.ts.map +1 -0
  14. package/dist/nodes/Cipp/descriptions/EmailSecurityDescription.js +347 -0
  15. package/dist/nodes/Cipp/descriptions/EmailSecurityDescription.js.map +1 -0
  16. package/dist/nodes/Cipp/descriptions/ExchangeResourceDescription.d.ts +4 -0
  17. package/dist/nodes/Cipp/descriptions/ExchangeResourceDescription.d.ts.map +1 -0
  18. package/dist/nodes/Cipp/descriptions/ExchangeResourceDescription.js +249 -0
  19. package/dist/nodes/Cipp/descriptions/ExchangeResourceDescription.js.map +1 -0
  20. package/dist/nodes/Cipp/descriptions/IntuneDescription.d.ts +4 -0
  21. package/dist/nodes/Cipp/descriptions/IntuneDescription.d.ts.map +1 -0
  22. package/dist/nodes/Cipp/descriptions/IntuneDescription.js +250 -0
  23. package/dist/nodes/Cipp/descriptions/IntuneDescription.js.map +1 -0
  24. package/dist/nodes/Cipp/descriptions/MailboxDescription.d.ts.map +1 -1
  25. package/dist/nodes/Cipp/descriptions/MailboxDescription.js +1094 -6
  26. package/dist/nodes/Cipp/descriptions/MailboxDescription.js.map +1 -1
  27. package/dist/nodes/Cipp/descriptions/SafeLinksDescription.d.ts +4 -0
  28. package/dist/nodes/Cipp/descriptions/SafeLinksDescription.d.ts.map +1 -0
  29. package/dist/nodes/Cipp/descriptions/SafeLinksDescription.js +201 -0
  30. package/dist/nodes/Cipp/descriptions/SafeLinksDescription.js.map +1 -0
  31. package/dist/nodes/Cipp/descriptions/SharePointDescription.d.ts +4 -0
  32. package/dist/nodes/Cipp/descriptions/SharePointDescription.d.ts.map +1 -0
  33. package/dist/nodes/Cipp/descriptions/SharePointDescription.js +129 -0
  34. package/dist/nodes/Cipp/descriptions/SharePointDescription.js.map +1 -0
  35. package/dist/nodes/Cipp/descriptions/StandardsDescription.d.ts +4 -0
  36. package/dist/nodes/Cipp/descriptions/StandardsDescription.d.ts.map +1 -0
  37. package/dist/nodes/Cipp/descriptions/StandardsDescription.js +288 -0
  38. package/dist/nodes/Cipp/descriptions/StandardsDescription.js.map +1 -0
  39. package/dist/nodes/Cipp/descriptions/TestingDescription.d.ts +4 -0
  40. package/dist/nodes/Cipp/descriptions/TestingDescription.d.ts.map +1 -0
  41. package/dist/nodes/Cipp/descriptions/TestingDescription.js +170 -0
  42. package/dist/nodes/Cipp/descriptions/TestingDescription.js.map +1 -0
  43. package/dist/nodes/Cipp/descriptions/UserDescription.d.ts.map +1 -1
  44. package/dist/nodes/Cipp/descriptions/UserDescription.js +135 -2
  45. package/dist/nodes/Cipp/descriptions/UserDescription.js.map +1 -1
  46. package/dist/nodes/Cipp/descriptions/index.d.ts.map +1 -1
  47. package/dist/nodes/Cipp/descriptions/index.js +24 -0
  48. package/dist/nodes/Cipp/descriptions/index.js.map +1 -1
  49. package/package.json +1 -1
@@ -52,11 +52,26 @@ class Cipp {
52
52
  value: 'backup',
53
53
  description: 'Manage CIPP backups',
54
54
  },
55
+ {
56
+ name: 'Conditional Access',
57
+ value: 'conditionalAccess',
58
+ description: 'Manage conditional access policies and named locations',
59
+ },
55
60
  {
56
61
  name: 'Device',
57
62
  value: 'device',
58
63
  description: 'Manage Intune devices',
59
64
  },
65
+ {
66
+ name: 'Email Security',
67
+ value: 'emailSecurity',
68
+ description: 'Manage spam filters, transport rules, connectors, and email security policies',
69
+ },
70
+ {
71
+ name: 'Exchange Resource',
72
+ value: 'exchangeResource',
73
+ description: 'Manage Exchange rooms, equipment, and room lists',
74
+ },
60
75
  {
61
76
  name: 'GDAP',
62
77
  value: 'gdap',
@@ -72,6 +87,11 @@ class Cipp {
72
87
  value: 'identity',
73
88
  description: 'Manage audit logs, roles, and deleted items',
74
89
  },
90
+ {
91
+ name: 'Intune',
92
+ value: 'intune',
93
+ description: 'Manage Intune scripts, compliance policies, assignment filters, and reusable settings',
94
+ },
75
95
  {
76
96
  name: 'Mailbox',
77
97
  value: 'mailbox',
@@ -92,11 +112,26 @@ class Cipp {
92
112
  value: 'quarantine',
93
113
  description: 'Manage quarantined email messages',
94
114
  },
115
+ {
116
+ name: 'Safe Links',
117
+ value: 'safeLinks',
118
+ description: 'Manage Safe Links policies and templates',
119
+ },
95
120
  {
96
121
  name: 'Scheduled Item',
97
122
  value: 'scheduledItem',
98
123
  description: 'Manage scheduled jobs',
99
124
  },
125
+ {
126
+ name: 'SharePoint',
127
+ value: 'sharepoint',
128
+ description: 'Manage SharePoint sites, quotas, and settings',
129
+ },
130
+ {
131
+ name: 'Standards',
132
+ value: 'standards',
133
+ description: 'Manage tenant standards, drift, BPA, and domain analyser',
134
+ },
100
135
  {
101
136
  name: 'Team',
102
137
  value: 'team',
@@ -107,6 +142,11 @@ class Cipp {
107
142
  value: 'teamsShift',
108
143
  description: 'Manage Teams Shifts schedule — shifts, open shifts, groups, time off',
109
144
  },
145
+ {
146
+ name: 'Testing',
147
+ value: 'testing',
148
+ description: 'Manage test runs, test reports, and available tests',
149
+ },
110
150
  {
111
151
  name: 'Tenant',
112
152
  value: 'tenant',
@@ -508,6 +548,108 @@ class Cipp {
508
548
  Role: jitAdminRole,
509
549
  }, {});
510
550
  }
551
+ else if (operation === 'listUserDevices') {
552
+ const returnAll = this.getNodeParameter('returnAll', i);
553
+ const userId = this.getNodeParameter('userId', i);
554
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListUserDevices', {}, { tenantFilter, userId });
555
+ if (Array.isArray(responseData) && !returnAll) {
556
+ const limit = this.getNodeParameter('limit', i);
557
+ responseData = responseData.slice(0, limit);
558
+ }
559
+ }
560
+ else if (operation === 'listUserGroups') {
561
+ const returnAll = this.getNodeParameter('returnAll', i);
562
+ const userId = this.getNodeParameter('userId', i);
563
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListUserGroups', {}, { tenantFilter, userId });
564
+ if (Array.isArray(responseData) && !returnAll) {
565
+ const limit = this.getNodeParameter('limit', i);
566
+ responseData = responseData.slice(0, limit);
567
+ }
568
+ }
569
+ else if (operation === 'listUserMailboxDetails') {
570
+ const returnAll = this.getNodeParameter('returnAll', i);
571
+ const userId = this.getNodeParameter('userId', i);
572
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListUserMailboxDetails', {}, { tenantFilter, UserID: userId });
573
+ if (Array.isArray(responseData) && !returnAll) {
574
+ const limit = this.getNodeParameter('limit', i);
575
+ responseData = responseData.slice(0, limit);
576
+ }
577
+ }
578
+ else if (operation === 'listUserPhoto') {
579
+ const returnAll = this.getNodeParameter('returnAll', i);
580
+ const userId = this.getNodeParameter('userId', i);
581
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListUserPhoto', {}, { tenantFilter, userId });
582
+ if (Array.isArray(responseData) && !returnAll) {
583
+ const limit = this.getNodeParameter('limit', i);
584
+ responseData = responseData.slice(0, limit);
585
+ }
586
+ }
587
+ else if (operation === 'listUserCAPolicies') {
588
+ const returnAll = this.getNodeParameter('returnAll', i);
589
+ const userId = this.getNodeParameter('userId', i);
590
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListUserConditionalAccessPolicies', {}, { tenantFilter, userId });
591
+ if (Array.isArray(responseData) && !returnAll) {
592
+ const limit = this.getNodeParameter('limit', i);
593
+ responseData = responseData.slice(0, limit);
594
+ }
595
+ }
596
+ else if (operation === 'listUserSettings') {
597
+ const returnAll = this.getNodeParameter('returnAll', i);
598
+ const userId = this.getNodeParameter('userId', i);
599
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListUserSettings', {}, { tenantFilter, userId });
600
+ if (Array.isArray(responseData) && !returnAll) {
601
+ const limit = this.getNodeParameter('limit', i);
602
+ responseData = responseData.slice(0, limit);
603
+ }
604
+ }
605
+ else if (operation === 'listPerUserMfa') {
606
+ const returnAll = this.getNodeParameter('returnAll', i);
607
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListPerUserMFA', {}, { tenantFilter });
608
+ if (Array.isArray(responseData) && !returnAll) {
609
+ const limit = this.getNodeParameter('limit', i);
610
+ responseData = responseData.slice(0, limit);
611
+ }
612
+ }
613
+ else if (operation === 'listUserCounts') {
614
+ const returnAll = this.getNodeParameter('returnAll', i);
615
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListUserCounts', {}, { tenantFilter });
616
+ if (Array.isArray(responseData) && !returnAll) {
617
+ const limit = this.getNodeParameter('limit', i);
618
+ responseData = responseData.slice(0, limit);
619
+ }
620
+ }
621
+ else if (operation === 'addGuest') {
622
+ const displayName = this.getNodeParameter('guestDisplayName', i);
623
+ const mail = this.getNodeParameter('guestMail', i);
624
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddGuest', {
625
+ tenantFilter,
626
+ displayName,
627
+ mail,
628
+ }, {});
629
+ }
630
+ else if (operation === 'setUserPhoto') {
631
+ const userId = this.getNodeParameter('userId', i);
632
+ const photo = this.getNodeParameter('photo', i);
633
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSetUserPhoto', {
634
+ tenantFilter,
635
+ userId,
636
+ photo,
637
+ }, {});
638
+ }
639
+ else if (operation === 'bulkLicense') {
640
+ const licenseJson = this.getNodeParameter('licenseJson', i);
641
+ let parsedLicense;
642
+ try {
643
+ parsedLicense = JSON.parse(typeof licenseJson === 'string' ? licenseJson : '{}');
644
+ }
645
+ catch (e) {
646
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'License JSON must be valid JSON', { itemIndex: i });
647
+ }
648
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecBulkLicense', {
649
+ ...parsedLicense,
650
+ tenantFilter,
651
+ }, {});
652
+ }
511
653
  }
512
654
  // ==================== GROUP ====================
513
655
  else if (resource === 'group') {
@@ -598,6 +740,143 @@ class Cipp {
598
740
  }, {});
599
741
  }
600
742
  }
743
+ // ==================== CONDITIONAL ACCESS ====================
744
+ else if (resource === 'conditionalAccess') {
745
+ const tenantFilter = getTenantFilter();
746
+ if (operation === 'listPolicies') {
747
+ const returnAll = this.getNodeParameter('returnAll', i);
748
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListConditionalAccessPolicies', {}, { tenantFilter });
749
+ if (Array.isArray(responseData) && !returnAll) {
750
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
751
+ }
752
+ }
753
+ else if (operation === 'listTemplates') {
754
+ const returnAll = this.getNodeParameter('returnAll', i);
755
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListCAtemplates', {}, {});
756
+ if (Array.isArray(responseData) && !returnAll) {
757
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
758
+ }
759
+ }
760
+ else if (operation === 'listNamedLocations') {
761
+ const returnAll = this.getNodeParameter('returnAll', i);
762
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListNamedLocations', {}, { tenantFilter });
763
+ if (Array.isArray(responseData) && !returnAll) {
764
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
765
+ }
766
+ }
767
+ else if (operation === 'addPolicy') {
768
+ const policyJson = this.getNodeParameter('caPolicyJson', i);
769
+ const caState = this.getNodeParameter('caState', i);
770
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddCAPolicy', {
771
+ tenantFilter: { value: [tenantFilter] },
772
+ RawJSON: policyJson,
773
+ NewState: caState || 'donotchange',
774
+ }, {});
775
+ }
776
+ else if (operation === 'editPolicy') {
777
+ const policyId = this.getNodeParameter('policyId', i);
778
+ const editState = this.getNodeParameter('editCaState', i);
779
+ const body = {
780
+ tenantFilter,
781
+ GUID: policyId,
782
+ };
783
+ if (editState)
784
+ body.State = editState;
785
+ const editJson = this.getNodeParameter('editPolicyJson', i);
786
+ let editData;
787
+ try {
788
+ editData = JSON.parse(editJson);
789
+ }
790
+ catch (e) {
791
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Policy JSON must be valid JSON', { itemIndex: i });
792
+ }
793
+ if (editData.displayName)
794
+ body.newDisplayName = editData.displayName;
795
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditCAPolicy', body, {});
796
+ }
797
+ else if (operation === 'removePolicy') {
798
+ const policyId = this.getNodeParameter('policyId', i);
799
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveCAPolicy', {
800
+ tenantFilter,
801
+ GUID: policyId,
802
+ }, {});
803
+ }
804
+ else if (operation === 'addTemplate') {
805
+ const templateJson = this.getNodeParameter('caTemplateJson', i);
806
+ let templateData;
807
+ try {
808
+ templateData = JSON.parse(templateJson);
809
+ }
810
+ catch (e) {
811
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Template JSON must be valid JSON', { itemIndex: i });
812
+ }
813
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddCATemplate', {
814
+ tenantFilter,
815
+ ...templateData,
816
+ }, {});
817
+ }
818
+ else if (operation === 'removeTemplate') {
819
+ const templateId = this.getNodeParameter('caTemplateId', i);
820
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveCATemplate', {
821
+ ID: templateId,
822
+ }, {});
823
+ }
824
+ else if (operation === 'caCheck') {
825
+ const userId = this.getNodeParameter('caCheckUserId', i);
826
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecCACheck', {
827
+ tenantFilter,
828
+ userID: { value: userId },
829
+ }, {});
830
+ }
831
+ else if (operation === 'addNamedLocation') {
832
+ const locationName = this.getNodeParameter('namedLocationName', i);
833
+ const locationType = this.getNodeParameter('namedLocationType', i);
834
+ const body = {
835
+ selectedTenants: { value: [tenantFilter] },
836
+ policyName: locationName,
837
+ };
838
+ if (locationType === 'ip') {
839
+ const ipRanges = this.getNodeParameter('namedLocationIpRanges', i);
840
+ const trusted = this.getNodeParameter('namedLocationTrusted', i);
841
+ body.Type = 'IPLocation';
842
+ body.Ips = ipRanges.split(',').map((r) => r.trim()).join('\n');
843
+ body.Trusted = trusted;
844
+ }
845
+ else {
846
+ const countries = this.getNodeParameter('namedLocationCountries', i);
847
+ body.Type = 'CountryLocation';
848
+ body.Countries = { value: countries.split(',').map((c) => c.trim()) };
849
+ }
850
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddNamedLocation', body, {});
851
+ }
852
+ else if (operation === 'manageNamedLocation') {
853
+ const locationId = this.getNodeParameter('namedLocationId', i);
854
+ const action = this.getNodeParameter('namedLocationAction', i);
855
+ if (action === 'Delete') {
856
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecNamedLocation', {
857
+ tenantFilter,
858
+ namedLocationId: locationId,
859
+ change: 'Delete',
860
+ }, {});
861
+ }
862
+ else {
863
+ const locationJson = this.getNodeParameter('namedLocationJson', i);
864
+ let locationData;
865
+ try {
866
+ locationData = JSON.parse(locationJson);
867
+ }
868
+ catch (e) {
869
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Location JSON must be valid JSON', { itemIndex: i });
870
+ }
871
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecNamedLocation', {
872
+ tenantFilter,
873
+ namedLocationId: locationId,
874
+ change: 'Update',
875
+ input: locationData,
876
+ }, {});
877
+ }
878
+ }
879
+ }
601
880
  // ==================== DEVICE ====================
602
881
  else if (resource === 'device') {
603
882
  const tenantFilter = getTenantFilter();
@@ -682,12 +961,122 @@ class Cipp {
682
961
  const configType = this.getNodeParameter('configType', i);
683
962
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListAutopilotConfig', {}, { tenantFilter, type: configType });
684
963
  }
964
+ else if (operation === 'syncDep') {
965
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSyncDEP', { tenantFilter }, {});
966
+ }
685
967
  }
686
968
  // ==================== MAILBOX ====================
687
969
  else if (resource === 'mailbox') {
688
970
  const tenantFilter = getTenantFilter();
689
- const userId = this.getNodeParameter('userId', i);
690
- if (operation === 'convert') {
971
+ // ---------- List operations (no userId required) ----------
972
+ if (operation === 'listMailboxes') {
973
+ const returnAll = this.getNodeParameter('returnAll', i);
974
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListMailboxes', {}, { tenantFilter });
975
+ if (Array.isArray(responseData) && !returnAll) {
976
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
977
+ }
978
+ }
979
+ else if (operation === 'listMailboxForwarding') {
980
+ const returnAll = this.getNodeParameter('returnAll', i);
981
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListMailboxForwarding', {}, { tenantFilter });
982
+ if (Array.isArray(responseData) && !returnAll) {
983
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
984
+ }
985
+ }
986
+ else if (operation === 'listRestrictedUsers') {
987
+ const returnAll = this.getNodeParameter('returnAll', i);
988
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListRestrictedUsers', {}, { tenantFilter });
989
+ if (Array.isArray(responseData) && !returnAll) {
990
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
991
+ }
992
+ }
993
+ else if (operation === 'listSharedMailboxStatistics') {
994
+ const returnAll = this.getNodeParameter('returnAll', i);
995
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListSharedMailboxStatistics', {}, { tenantFilter });
996
+ if (Array.isArray(responseData) && !returnAll) {
997
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
998
+ }
999
+ }
1000
+ else if (operation === 'listSharedMailboxAccountEnabled') {
1001
+ const returnAll = this.getNodeParameter('returnAll', i);
1002
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListSharedMailboxAccountEnabled', {}, { tenantFilter });
1003
+ if (Array.isArray(responseData) && !returnAll) {
1004
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
1005
+ }
1006
+ // ---------- List operations (userId required) ----------
1007
+ }
1008
+ else if (operation === 'listMailboxDetails') {
1009
+ const userId = this.getNodeParameter('userId', i);
1010
+ const returnAll = this.getNodeParameter('returnAll', i);
1011
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListUserMailboxDetails', {}, { tenantFilter, UserID: userId });
1012
+ if (Array.isArray(responseData) && !returnAll) {
1013
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
1014
+ }
1015
+ }
1016
+ else if (operation === 'listMailboxRules') {
1017
+ const userId = this.getNodeParameter('userId', i);
1018
+ const returnAll = this.getNodeParameter('returnAll', i);
1019
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListMailboxRules', {}, { tenantFilter, userId });
1020
+ if (Array.isArray(responseData) && !returnAll) {
1021
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
1022
+ }
1023
+ }
1024
+ else if (operation === 'listMailboxMobileDevices') {
1025
+ const userId = this.getNodeParameter('userId', i);
1026
+ const returnAll = this.getNodeParameter('returnAll', i);
1027
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListMailboxMobileDevices', {}, { tenantFilter, Mailbox: userId });
1028
+ if (Array.isArray(responseData) && !returnAll) {
1029
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
1030
+ }
1031
+ }
1032
+ else if (operation === 'listMailboxCAS') {
1033
+ const returnAll = this.getNodeParameter('returnAll', i);
1034
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListMailboxCAS', {}, { TenantFilter: tenantFilter });
1035
+ if (Array.isArray(responseData) && !returnAll) {
1036
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
1037
+ }
1038
+ }
1039
+ else if (operation === 'listCalendarPermissions') {
1040
+ const userId = this.getNodeParameter('userId', i);
1041
+ const returnAll = this.getNodeParameter('returnAll', i);
1042
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListCalendarPermissions', {}, { tenantFilter, UserID: userId });
1043
+ if (Array.isArray(responseData) && !returnAll) {
1044
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
1045
+ }
1046
+ }
1047
+ else if (operation === 'listContactPermissions') {
1048
+ const userId = this.getNodeParameter('userId', i);
1049
+ const returnAll = this.getNodeParameter('returnAll', i);
1050
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListContactPermissions', {}, { tenantFilter, UserID: userId });
1051
+ if (Array.isArray(responseData) && !returnAll) {
1052
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
1053
+ }
1054
+ }
1055
+ else if (operation === 'listOoO') {
1056
+ const userId = this.getNodeParameter('userId', i);
1057
+ const returnAll = this.getNodeParameter('returnAll', i);
1058
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListOoO', {}, { tenantFilter, userid: userId });
1059
+ if (Array.isArray(responseData) && !returnAll) {
1060
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
1061
+ }
1062
+ // ---------- Add Shared Mailbox ----------
1063
+ }
1064
+ else if (operation === 'addSharedMailbox') {
1065
+ const displayName = this.getNodeParameter('displayName', i);
1066
+ const username = this.getNodeParameter('username', i);
1067
+ const domain = this.getNodeParameter('domain', i);
1068
+ const additionalFields = this.getNodeParameter('additionalFields', i, {});
1069
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddSharedMailbox', {
1070
+ tenantID: tenantFilter,
1071
+ displayName,
1072
+ username,
1073
+ domain,
1074
+ ...additionalFields,
1075
+ }, {});
1076
+ // ---------- Existing operations ----------
1077
+ }
1078
+ else if (operation === 'convert') {
1079
+ const userId = this.getNodeParameter('userId', i);
691
1080
  const mailboxType = this.getNodeParameter('mailboxType', i);
692
1081
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecConvertMailbox', {
693
1082
  tenantFilter,
@@ -696,12 +1085,14 @@ class Cipp {
696
1085
  }, {});
697
1086
  }
698
1087
  else if (operation === 'enableArchive') {
1088
+ const userId = this.getNodeParameter('userId', i);
699
1089
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecEnableArchive', {
700
1090
  tenantFilter,
701
1091
  ID: userId,
702
1092
  }, {});
703
1093
  }
704
1094
  else if (operation === 'setOutOfOffice') {
1095
+ const userId = this.getNodeParameter('userId', i);
705
1096
  const autoReplyState = this.getNodeParameter('autoReplyState', i);
706
1097
  const body = {
707
1098
  tenantFilter,
@@ -714,6 +1105,7 @@ class Cipp {
714
1105
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSetOOO', body, {});
715
1106
  }
716
1107
  else if (operation === 'setForwarding') {
1108
+ const userId = this.getNodeParameter('userId', i);
717
1109
  const forwardTo = this.getNodeParameter('forwardTo', i);
718
1110
  const keepCopy = this.getNodeParameter('keepCopy', i);
719
1111
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecEmailForward', {
@@ -722,62 +1114,376 @@ class Cipp {
722
1114
  ForwardTo: forwardTo,
723
1115
  KeepCopy: keepCopy,
724
1116
  }, {});
1117
+ // ---------- Edit Mailbox Permissions ----------
725
1118
  }
726
- }
727
- // ==================== QUARANTINE ====================
728
- else if (resource === 'quarantine') {
729
- const tenantFilter = getTenantFilter();
730
- if (operation === 'getMany') {
731
- const returnAll = this.getNodeParameter('returnAll', i);
732
- responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListMailQuarantine', {}, { tenantFilter });
733
- if (Array.isArray(responseData) && !returnAll) {
734
- const limit = this.getNodeParameter('limit', i);
735
- responseData = responseData.slice(0, limit);
736
- }
1119
+ else if (operation === 'editMailboxPermissions') {
1120
+ const userId = this.getNodeParameter('userId', i);
1121
+ const permissions = this.getNodeParameter('permissions', i, {});
1122
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecEditMailboxPermissions', {
1123
+ tenantfilter: tenantFilter,
1124
+ userID: userId,
1125
+ ...permissions,
1126
+ }, {});
1127
+ // ---------- Edit Calendar Permissions ----------
737
1128
  }
738
- else if (operation === 'release') {
739
- const messageId = this.getNodeParameter('messageId', i);
740
- const allowSender = this.getNodeParameter('allowSender', i);
741
- responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecQuarantineManagement', {
1129
+ else if (operation === 'editCalendarPermissions') {
1130
+ const userId = this.getNodeParameter('userId', i);
1131
+ const userToModify = this.getNodeParameter('userToModify', i);
1132
+ const permissionLevel = this.getNodeParameter('permissionLevel', i);
1133
+ const folderName = this.getNodeParameter('folderName', i);
1134
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecEditCalendarPermissions', {
742
1135
  tenantFilter,
743
- ID: messageId,
744
- Type: 'Release',
745
- AllowSender: allowSender,
1136
+ userid: userId,
1137
+ UserToGetPermissions: userToModify,
1138
+ Permissions: permissionLevel,
1139
+ FolderName: folderName,
746
1140
  }, {});
1141
+ // ---------- Modify Contact Permissions ----------
747
1142
  }
748
- else if (operation === 'deny') {
749
- const messageId = this.getNodeParameter('messageId', i);
750
- responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecQuarantineManagement', {
1143
+ else if (operation === 'modifyContactPerms') {
1144
+ const userId = this.getNodeParameter('userId', i);
1145
+ const contactUserToModify = this.getNodeParameter('contactUserToModify', i);
1146
+ const contactPermissionLevel = this.getNodeParameter('contactPermissionLevel', i);
1147
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecModifyContactPerms', {
751
1148
  tenantFilter,
752
- ID: messageId,
753
- Type: 'Deny',
1149
+ UserID: userId,
1150
+ UserToGetPermissions: contactUserToModify,
1151
+ Permissions: contactPermissionLevel,
754
1152
  }, {});
1153
+ // ---------- Mailbox Rules ----------
755
1154
  }
756
- else if (operation === 'getMessage') {
757
- const messageId = this.getNodeParameter('messageId', i);
758
- responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListMailQuarantineMessage', {}, {
759
- tenantFilter,
760
- Identity: messageId,
761
- });
1155
+ else if (operation === 'removeMailboxRule') {
1156
+ const userId = this.getNodeParameter('userId', i);
1157
+ const ruleName = this.getNodeParameter('ruleName', i);
1158
+ const ruleId = this.getNodeParameter('ruleId', i);
1159
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecRemoveMailboxRule', {
1160
+ TenantFilter: tenantFilter,
1161
+ userPrincipalName: userId,
1162
+ ruleName,
1163
+ ruleId,
1164
+ }, {});
762
1165
  }
763
- }
764
- // ==================== ALERT ====================
765
- else if (resource === 'alert') {
766
- if (operation === 'getAll') {
767
- const returnAll = this.getNodeParameter('returnAll', i);
768
- responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListAlertsQueue', {}, {});
769
- if (Array.isArray(responseData) && !returnAll) {
770
- const limit = this.getNodeParameter('limit', i);
771
- responseData = responseData.slice(0, limit);
1166
+ else if (operation === 'setMailboxRule') {
1167
+ const userId = this.getNodeParameter('userId', i);
1168
+ const setRuleName = this.getNodeParameter('setRuleName', i);
1169
+ const setRuleId = this.getNodeParameter('setRuleId', i);
1170
+ const ruleAction = this.getNodeParameter('ruleAction', i);
1171
+ const body = {
1172
+ TenantFilter: tenantFilter,
1173
+ userPrincipalName: userId,
1174
+ ruleName: setRuleName,
1175
+ ruleId: setRuleId,
1176
+ };
1177
+ if (ruleAction === 'Enable') {
1178
+ body.Enable = true;
1179
+ }
1180
+ else {
1181
+ body.Disable = true;
772
1182
  }
1183
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSetMailboxRule', body, {});
1184
+ // ---------- Set Mailbox Quota ----------
773
1185
  }
774
- else if (operation === 'add') {
775
- const alertConfig = this.getNodeParameter('alertConfig', i);
776
- responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddAlert', JSON.parse(alertConfig), {});
1186
+ else if (operation === 'setMailboxQuota') {
1187
+ const userId = this.getNodeParameter('userId', i);
1188
+ const quotaType = this.getNodeParameter('quotaType', i);
1189
+ const quotaValue = this.getNodeParameter('quotaValue', i);
1190
+ const body = {
1191
+ tenantfilter: tenantFilter,
1192
+ user: userId,
1193
+ quota: quotaValue,
1194
+ };
1195
+ body[quotaType] = true;
1196
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSetMailboxQuota', body, {});
1197
+ // ---------- Set Litigation Hold ----------
777
1198
  }
778
- else if (operation === 'getSecurityAlerts') {
779
- const tenantFilter = getTenantFilter();
780
- const returnAll = this.getNodeParameter('returnAll', i);
1199
+ else if (operation === 'setLitigationHold') {
1200
+ const userId = this.getNodeParameter('userId', i);
1201
+ const enabled = this.getNodeParameter('litigationHoldEnabled', i);
1202
+ const body = {
1203
+ tenantFilter,
1204
+ Identity: userId,
1205
+ UPN: userId,
1206
+ };
1207
+ if (!enabled) {
1208
+ body.disable = true;
1209
+ }
1210
+ else {
1211
+ const duration = this.getNodeParameter('litigationHoldDuration', i);
1212
+ if (duration > 0)
1213
+ body.days = duration;
1214
+ }
1215
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSetLitigationHold', body, {});
1216
+ // ---------- Set Mailbox Email Size ----------
1217
+ }
1218
+ else if (operation === 'setMailboxEmailSize') {
1219
+ const userId = this.getNodeParameter('userId', i);
1220
+ const maxSendSize = this.getNodeParameter('maxSendSize', i);
1221
+ const maxReceiveSize = this.getNodeParameter('maxReceiveSize', i);
1222
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSetMailboxEmailSize', {
1223
+ tenantFilter,
1224
+ UPN: userId,
1225
+ id: userId,
1226
+ maxSendSize: String(maxSendSize),
1227
+ maxReceiveSize: String(maxReceiveSize),
1228
+ }, {});
1229
+ // ---------- Set Mailbox Locale ----------
1230
+ }
1231
+ else if (operation === 'setMailboxLocale') {
1232
+ const userId = this.getNodeParameter('userId', i);
1233
+ const language = this.getNodeParameter('language', i);
1234
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSetMailboxLocale', {
1235
+ tenantFilter,
1236
+ user: userId,
1237
+ locale: language,
1238
+ }, {});
1239
+ // ---------- Set Retention Hold ----------
1240
+ }
1241
+ else if (operation === 'setRetentionHold') {
1242
+ const userId = this.getNodeParameter('userId', i);
1243
+ const enabled = this.getNodeParameter('retentionHoldEnabled', i);
1244
+ const retentionBody = {
1245
+ tenantFilter,
1246
+ Identity: userId,
1247
+ UPN: userId,
1248
+ };
1249
+ if (!enabled) {
1250
+ retentionBody.disable = true;
1251
+ }
1252
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSetRetentionHold', retentionBody, {});
1253
+ // ---------- Set Recipient Limits ----------
1254
+ }
1255
+ else if (operation === 'setRecipientLimits') {
1256
+ const userId = this.getNodeParameter('userId', i);
1257
+ const recipientLimit = this.getNodeParameter('recipientLimit', i);
1258
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSetRecipientLimits', {
1259
+ tenantFilter,
1260
+ Identity: userId,
1261
+ userid: userId,
1262
+ recipientLimit,
1263
+ }, {});
1264
+ // ---------- Copy for Sent ----------
1265
+ }
1266
+ else if (operation === 'copyForSent') {
1267
+ const userId = this.getNodeParameter('userId', i);
1268
+ const enabled = this.getNodeParameter('copyForSentEnabled', i);
1269
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecCopyForSent', {
1270
+ tenantFilter,
1271
+ ID: userId,
1272
+ messageCopyState: String(enabled),
1273
+ }, {});
1274
+ // ---------- Hide From GAL ----------
1275
+ }
1276
+ else if (operation === 'hideFromGAL') {
1277
+ const userId = this.getNodeParameter('userId', i);
1278
+ const hidden = this.getNodeParameter('hiddenFromGAL', i);
1279
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecHideFromGAL', {
1280
+ tenantFilter,
1281
+ ID: userId,
1282
+ HideFromGAL: String(hidden),
1283
+ }, {});
1284
+ // ---------- Manage Mobile Devices ----------
1285
+ }
1286
+ else if (operation === 'mailboxMobileDevices') {
1287
+ const userId = this.getNodeParameter('userId', i);
1288
+ const deviceGuid = this.getNodeParameter('deviceGuid', i);
1289
+ const deviceId = this.getNodeParameter('deviceId', i);
1290
+ const mobileAction = this.getNodeParameter('mobileAction', i);
1291
+ const qs = {
1292
+ tenantfilter: tenantFilter,
1293
+ Userid: userId,
1294
+ guid: deviceGuid,
1295
+ deviceid: deviceId,
1296
+ };
1297
+ if (mobileAction === 'Quarantine') {
1298
+ qs.Quarantine = 'true';
1299
+ }
1300
+ else if (mobileAction === 'Delete') {
1301
+ qs.Delete = 'true';
1302
+ }
1303
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ExecMailboxMobileDevices', {}, qs);
1304
+ // ---------- Start Managed Folder Assistant ----------
1305
+ }
1306
+ else if (operation === 'startManagedFolderAssistant') {
1307
+ const userId = this.getNodeParameter('userId', i);
1308
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecStartManagedFolderAssistant', {
1309
+ tenantFilter,
1310
+ Id: userId,
1311
+ UserPrincipalName: userId,
1312
+ }, {});
1313
+ // ---------- Enable Auto-Expanding Archive ----------
1314
+ }
1315
+ else if (operation === 'enableAutoExpandingArchive') {
1316
+ const userId = this.getNodeParameter('userId', i);
1317
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecEnableAutoExpandingArchive', {
1318
+ tenantFilter,
1319
+ ID: userId,
1320
+ username: userId,
1321
+ }, {});
1322
+ // ---------- High Volume Email ----------
1323
+ }
1324
+ else if (operation === 'hveUser') {
1325
+ const hveDisplayName = this.getNodeParameter('hveDisplayName', i);
1326
+ const hvePrimarySMTPAddress = this.getNodeParameter('hvePrimarySMTPAddress', i);
1327
+ const hvePassword = this.getNodeParameter('hvePassword', i);
1328
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecHVEUser', {
1329
+ TenantFilter: tenantFilter,
1330
+ displayName: hveDisplayName,
1331
+ primarySMTPAddress: hvePrimarySMTPAddress,
1332
+ password: hvePassword,
1333
+ }, {});
1334
+ // ---------- Schedule Mailbox Vacation ----------
1335
+ }
1336
+ else if (operation === 'scheduleMailboxVacation') {
1337
+ const userId = this.getNodeParameter('userId', i);
1338
+ const startDate = this.getNodeParameter('vacationStartDate', i);
1339
+ const endDate = this.getNodeParameter('vacationEndDate', i);
1340
+ const vacationOptions = this.getNodeParameter('vacationOptions', i, {});
1341
+ const body = {
1342
+ tenantFilter,
1343
+ mailboxOwners: [{ value: userId }],
1344
+ startDate: new Date(startDate).getTime(),
1345
+ endDate: new Date(endDate).getTime(),
1346
+ };
1347
+ if (vacationOptions.ForwardTo) {
1348
+ body.delegates = [{ value: vacationOptions.ForwardTo }];
1349
+ }
1350
+ if (vacationOptions.KeepCopy !== undefined)
1351
+ body.autoMap = vacationOptions.KeepCopy;
1352
+ if (vacationOptions.CalendarAccessUser) {
1353
+ body.includeCalendar = true;
1354
+ body.calendarPermission = vacationOptions.CalendarPermission || 'Reviewer';
1355
+ body.canViewPrivateItems = false;
1356
+ }
1357
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecScheduleMailboxVacation', body, {});
1358
+ // ---------- Schedule OOO Vacation ----------
1359
+ }
1360
+ else if (operation === 'scheduleOOOVacation') {
1361
+ const userId = this.getNodeParameter('userId', i);
1362
+ const startDate = this.getNodeParameter('oooStartDate', i);
1363
+ const endDate = this.getNodeParameter('oooEndDate', i);
1364
+ const internalMessage = this.getNodeParameter('oooInternalMessage', i);
1365
+ const body = {
1366
+ tenantFilter,
1367
+ Users: [{ value: userId }],
1368
+ startDate: new Date(startDate).getTime(),
1369
+ endDate: new Date(endDate).getTime(),
1370
+ internalMessage,
1371
+ };
1372
+ const externalMessage = this.getNodeParameter('oooExternalMessage', i, '');
1373
+ if (externalMessage) {
1374
+ body.externalMessage = externalMessage;
1375
+ }
1376
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecScheduleOOOVacation', body, {});
1377
+ // ---------- Manage Retention Policies ----------
1378
+ }
1379
+ else if (operation === 'manageRetentionPolicies') {
1380
+ const action = this.getNodeParameter('retentionPolicyAction', i);
1381
+ if (action === 'List') {
1382
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ExecManageRetentionPolicies', {}, { tenantFilter });
1383
+ }
1384
+ else {
1385
+ const policyName = this.getNodeParameter('retentionPolicyName', i);
1386
+ const body = { tenantFilter };
1387
+ if (action === 'Create') {
1388
+ body.CreatePolicies = [{ Name: policyName }];
1389
+ }
1390
+ else if (action === 'Delete') {
1391
+ body.DeletePolicies = [policyName];
1392
+ }
1393
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecManageRetentionPolicies', body, {});
1394
+ }
1395
+ // ---------- Manage Retention Tags ----------
1396
+ }
1397
+ else if (operation === 'manageRetentionTags') {
1398
+ const action = this.getNodeParameter('retentionTagAction', i);
1399
+ if (action === 'List') {
1400
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ExecManageRetentionTags', {}, { tenantFilter });
1401
+ }
1402
+ else {
1403
+ const tagName = this.getNodeParameter('retentionTagName', i);
1404
+ const body = { tenantFilter };
1405
+ if (action === 'Create') {
1406
+ body.CreateTags = [{ Name: tagName }];
1407
+ }
1408
+ else if (action === 'Delete') {
1409
+ body.DeleteTags = [tagName];
1410
+ }
1411
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecManageRetentionTags', body, {});
1412
+ }
1413
+ // ---------- Set Mailbox Retention Policy ----------
1414
+ }
1415
+ else if (operation === 'setMailboxRetentionPolicies') {
1416
+ const userId = this.getNodeParameter('userId', i);
1417
+ const policyName = this.getNodeParameter('retentionPolicyToSet', i);
1418
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSetMailboxRetentionPolicies', {
1419
+ tenantFilter,
1420
+ PolicyName: policyName,
1421
+ Mailboxes: [userId],
1422
+ }, {});
1423
+ // ---------- Remove Restricted User ----------
1424
+ }
1425
+ else if (operation === 'removeRestrictedUser') {
1426
+ const userId = this.getNodeParameter('userId', i);
1427
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecRemoveRestrictedUser', {
1428
+ tenantFilter,
1429
+ SenderAddress: userId,
1430
+ }, {});
1431
+ }
1432
+ }
1433
+ // ==================== QUARANTINE ====================
1434
+ else if (resource === 'quarantine') {
1435
+ const tenantFilter = getTenantFilter();
1436
+ if (operation === 'getMany') {
1437
+ const returnAll = this.getNodeParameter('returnAll', i);
1438
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListMailQuarantine', {}, { tenantFilter });
1439
+ if (Array.isArray(responseData) && !returnAll) {
1440
+ const limit = this.getNodeParameter('limit', i);
1441
+ responseData = responseData.slice(0, limit);
1442
+ }
1443
+ }
1444
+ else if (operation === 'release') {
1445
+ const messageId = this.getNodeParameter('messageId', i);
1446
+ const allowSender = this.getNodeParameter('allowSender', i);
1447
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecQuarantineManagement', {
1448
+ tenantFilter,
1449
+ ID: messageId,
1450
+ Type: 'Release',
1451
+ AllowSender: allowSender,
1452
+ }, {});
1453
+ }
1454
+ else if (operation === 'deny') {
1455
+ const messageId = this.getNodeParameter('messageId', i);
1456
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecQuarantineManagement', {
1457
+ tenantFilter,
1458
+ ID: messageId,
1459
+ Type: 'Deny',
1460
+ }, {});
1461
+ }
1462
+ else if (operation === 'getMessage') {
1463
+ const messageId = this.getNodeParameter('messageId', i);
1464
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListMailQuarantineMessage', {}, {
1465
+ tenantFilter,
1466
+ Identity: messageId,
1467
+ });
1468
+ }
1469
+ }
1470
+ // ==================== ALERT ====================
1471
+ else if (resource === 'alert') {
1472
+ if (operation === 'getAll') {
1473
+ const returnAll = this.getNodeParameter('returnAll', i);
1474
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListAlertsQueue', {}, {});
1475
+ if (Array.isArray(responseData) && !returnAll) {
1476
+ const limit = this.getNodeParameter('limit', i);
1477
+ responseData = responseData.slice(0, limit);
1478
+ }
1479
+ }
1480
+ else if (operation === 'add') {
1481
+ const alertConfig = this.getNodeParameter('alertConfig', i);
1482
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddAlert', JSON.parse(alertConfig), {});
1483
+ }
1484
+ else if (operation === 'getSecurityAlerts') {
1485
+ const tenantFilter = getTenantFilter();
1486
+ const returnAll = this.getNodeParameter('returnAll', i);
781
1487
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ExecAlertsList', {}, { tenantFilter });
782
1488
  if (Array.isArray(responseData) && !returnAll) {
783
1489
  const limit = this.getNodeParameter('limit', i);
@@ -1096,6 +1802,106 @@ class Cipp {
1096
1802
  }, {});
1097
1803
  }
1098
1804
  }
1805
+ // ==================== SAFE LINKS ====================
1806
+ else if (resource === 'safeLinks') {
1807
+ const tenantFilter = getTenantFilter();
1808
+ if (operation === 'listPolicies') {
1809
+ const returnAll = this.getNodeParameter('returnAll', i);
1810
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListSafeLinksPolicy', {}, { tenantFilter });
1811
+ if (Array.isArray(responseData) && !returnAll) {
1812
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
1813
+ }
1814
+ }
1815
+ else if (operation === 'listTemplates') {
1816
+ const returnAll = this.getNodeParameter('returnAll', i);
1817
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListSafeLinksPolicyTemplates', {}, {});
1818
+ if (Array.isArray(responseData) && !returnAll) {
1819
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
1820
+ }
1821
+ }
1822
+ else if (operation === 'addPolicy') {
1823
+ const policyName = this.getNodeParameter('slPolicyName', i);
1824
+ const policyJson = this.getNodeParameter('slPolicyJson', i);
1825
+ let policyData;
1826
+ try {
1827
+ policyData = JSON.parse(policyJson);
1828
+ }
1829
+ catch (e) {
1830
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Policy JSON must be valid JSON', { itemIndex: i });
1831
+ }
1832
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecNewSafeLinksPolicy', {
1833
+ ...policyData,
1834
+ tenantFilter,
1835
+ Name: policyName,
1836
+ }, {});
1837
+ }
1838
+ else if (operation === 'editPolicy') {
1839
+ const policyName = this.getNodeParameter('slPolicyName', i);
1840
+ const policyJson = this.getNodeParameter('slPolicyJson', i);
1841
+ let policyData;
1842
+ try {
1843
+ policyData = JSON.parse(policyJson);
1844
+ }
1845
+ catch (e) {
1846
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Policy JSON must be valid JSON', { itemIndex: i });
1847
+ }
1848
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditSafeLinksPolicy', {
1849
+ ...policyData,
1850
+ tenantFilter,
1851
+ Name: policyName,
1852
+ }, {});
1853
+ }
1854
+ else if (operation === 'deletePolicy') {
1855
+ const policyName = this.getNodeParameter('slPolicyName', i);
1856
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecDeleteSafeLinksPolicy', {
1857
+ tenantFilter,
1858
+ Name: policyName,
1859
+ }, {});
1860
+ }
1861
+ else if (operation === 'addTemplate') {
1862
+ const templateName = this.getNodeParameter('slTemplateName', i);
1863
+ const templateJson = this.getNodeParameter('slTemplateJson', i);
1864
+ let templateData;
1865
+ try {
1866
+ templateData = JSON.parse(templateJson);
1867
+ }
1868
+ catch (e) {
1869
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Template JSON must be valid JSON', { itemIndex: i });
1870
+ }
1871
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddSafeLinksPolicyTemplate', {
1872
+ ...templateData,
1873
+ Name: templateName,
1874
+ }, {});
1875
+ }
1876
+ else if (operation === 'editTemplate') {
1877
+ const templateName = this.getNodeParameter('slTemplateName', i);
1878
+ const templateJson = this.getNodeParameter('slTemplateJson', i);
1879
+ let templateData;
1880
+ try {
1881
+ templateData = JSON.parse(templateJson);
1882
+ }
1883
+ catch (e) {
1884
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Template JSON must be valid JSON', { itemIndex: i });
1885
+ }
1886
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditSafeLinksPolicyTemplate', {
1887
+ ...templateData,
1888
+ Name: templateName,
1889
+ }, {});
1890
+ }
1891
+ else if (operation === 'removeTemplate') {
1892
+ const templateName = this.getNodeParameter('slTemplateName', i);
1893
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveSafeLinksPolicyTemplate', {
1894
+ Name: templateName,
1895
+ }, {});
1896
+ }
1897
+ else if (operation === 'addFromTemplate') {
1898
+ const templateName = this.getNodeParameter('slTemplateName', i);
1899
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddSafeLinksPolicyFromTemplate', {
1900
+ tenantFilter,
1901
+ TemplateName: templateName,
1902
+ }, {});
1903
+ }
1904
+ }
1099
1905
  // ==================== SCHEDULED ITEM ====================
1100
1906
  else if (resource === 'scheduledItem') {
1101
1907
  if (operation === 'getAll') {
@@ -1616,6 +2422,352 @@ class Cipp {
1616
2422
  }, {});
1617
2423
  }
1618
2424
  }
2425
+ // ==================== EMAIL SECURITY ====================
2426
+ else if (resource === 'emailSecurity') {
2427
+ const tenantFilter = getTenantFilter();
2428
+ if (operation === 'listSpamFilters') {
2429
+ const returnAll = this.getNodeParameter('returnAll', i);
2430
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListSpamfilter', {}, { tenantFilter });
2431
+ if (Array.isArray(responseData) && !returnAll) {
2432
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2433
+ }
2434
+ }
2435
+ else if (operation === 'addSpamFilter') {
2436
+ const policyJson = this.getNodeParameter('esSpamFilterJson', i);
2437
+ let policyData;
2438
+ try {
2439
+ policyData = JSON.parse(policyJson);
2440
+ }
2441
+ catch (e) {
2442
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Policy JSON must be valid JSON', { itemIndex: i });
2443
+ }
2444
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddSpamFilter', {
2445
+ ...policyData,
2446
+ tenantFilter,
2447
+ }, {});
2448
+ }
2449
+ else if (operation === 'editSpamFilter') {
2450
+ const policyJson = this.getNodeParameter('esSpamFilterJson', i);
2451
+ let policyData;
2452
+ try {
2453
+ policyData = JSON.parse(policyJson);
2454
+ }
2455
+ catch (e) {
2456
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Policy JSON must be valid JSON', { itemIndex: i });
2457
+ }
2458
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditSpamFilter', {
2459
+ ...policyData,
2460
+ tenantFilter,
2461
+ }, {});
2462
+ }
2463
+ else if (operation === 'removeSpamFilter') {
2464
+ const name = this.getNodeParameter('esName', i);
2465
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveSpamfilter', {
2466
+ tenantFilter,
2467
+ Name: name,
2468
+ }, {});
2469
+ }
2470
+ else if (operation === 'listTransportRules') {
2471
+ const returnAll = this.getNodeParameter('returnAll', i);
2472
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListTransportRules', {}, { tenantFilter });
2473
+ if (Array.isArray(responseData) && !returnAll) {
2474
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2475
+ }
2476
+ }
2477
+ else if (operation === 'addTransportRule') {
2478
+ const ruleJson = this.getNodeParameter('esTransportRuleJson', i);
2479
+ let ruleData;
2480
+ try {
2481
+ ruleData = JSON.parse(ruleJson);
2482
+ }
2483
+ catch (e) {
2484
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Rule JSON must be valid JSON', { itemIndex: i });
2485
+ }
2486
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddTransportRule', {
2487
+ ...ruleData,
2488
+ tenantFilter,
2489
+ }, {});
2490
+ }
2491
+ else if (operation === 'editTransportRule') {
2492
+ const ruleJson = this.getNodeParameter('esTransportRuleJson', i);
2493
+ let ruleData;
2494
+ try {
2495
+ ruleData = JSON.parse(ruleJson);
2496
+ }
2497
+ catch (e) {
2498
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Rule JSON must be valid JSON', { itemIndex: i });
2499
+ }
2500
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditTransportRule', {
2501
+ ...ruleData,
2502
+ tenantFilter,
2503
+ }, {});
2504
+ }
2505
+ else if (operation === 'removeTransportRule') {
2506
+ const name = this.getNodeParameter('esName', i);
2507
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveTransportRule', {
2508
+ tenantFilter,
2509
+ Name: name,
2510
+ }, {});
2511
+ }
2512
+ else if (operation === 'listExchangeConnectors') {
2513
+ const returnAll = this.getNodeParameter('returnAll', i);
2514
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListExchangeConnectors', {}, { tenantFilter });
2515
+ if (Array.isArray(responseData) && !returnAll) {
2516
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2517
+ }
2518
+ }
2519
+ else if (operation === 'addExConnector') {
2520
+ const connectorJson = this.getNodeParameter('esConnectorJson', i);
2521
+ let connectorData;
2522
+ try {
2523
+ connectorData = JSON.parse(connectorJson);
2524
+ }
2525
+ catch (e) {
2526
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Connector JSON must be valid JSON', { itemIndex: i });
2527
+ }
2528
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddExConnector', {
2529
+ ...connectorData,
2530
+ tenantFilter,
2531
+ }, {});
2532
+ }
2533
+ else if (operation === 'editExConnector') {
2534
+ const connectorJson = this.getNodeParameter('esConnectorJson', i);
2535
+ let connectorData;
2536
+ try {
2537
+ connectorData = JSON.parse(connectorJson);
2538
+ }
2539
+ catch (e) {
2540
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Connector JSON must be valid JSON', { itemIndex: i });
2541
+ }
2542
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditExConnector', {
2543
+ ...connectorData,
2544
+ tenantFilter,
2545
+ }, {});
2546
+ }
2547
+ else if (operation === 'removeExConnector') {
2548
+ const name = this.getNodeParameter('esName', i);
2549
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveExConnector', {
2550
+ tenantFilter,
2551
+ Name: name,
2552
+ }, {});
2553
+ }
2554
+ else if (operation === 'listConnectionFilters') {
2555
+ const returnAll = this.getNodeParameter('returnAll', i);
2556
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListConnectionFilter', {}, { tenantFilter });
2557
+ if (Array.isArray(responseData) && !returnAll) {
2558
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2559
+ }
2560
+ }
2561
+ else if (operation === 'addConnectionFilter') {
2562
+ const filterJson = this.getNodeParameter('esConnectionFilterJson', i);
2563
+ let filterData;
2564
+ try {
2565
+ filterData = JSON.parse(filterJson);
2566
+ }
2567
+ catch (e) {
2568
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Filter JSON must be valid JSON', { itemIndex: i });
2569
+ }
2570
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddConnectionFilter', {
2571
+ ...filterData,
2572
+ tenantFilter,
2573
+ }, {});
2574
+ }
2575
+ else if (operation === 'listAntiPhishingFilters') {
2576
+ const returnAll = this.getNodeParameter('returnAll', i);
2577
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListAntiPhishingFilters', {}, { tenantFilter });
2578
+ if (Array.isArray(responseData) && !returnAll) {
2579
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2580
+ }
2581
+ }
2582
+ else if (operation === 'editAntiPhishingFilter') {
2583
+ const filterJson = this.getNodeParameter('esAntiPhishingFilterJson', i);
2584
+ let filterData;
2585
+ try {
2586
+ filterData = JSON.parse(filterJson);
2587
+ }
2588
+ catch (e) {
2589
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Filter JSON must be valid JSON', { itemIndex: i });
2590
+ }
2591
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditAntiPhishingFilter', {
2592
+ ...filterData,
2593
+ tenantFilter,
2594
+ }, {});
2595
+ }
2596
+ else if (operation === 'listMalwareFilters') {
2597
+ const returnAll = this.getNodeParameter('returnAll', i);
2598
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListMalwareFilters', {}, { tenantFilter });
2599
+ if (Array.isArray(responseData) && !returnAll) {
2600
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2601
+ }
2602
+ }
2603
+ else if (operation === 'editMalwareFilter') {
2604
+ const filterJson = this.getNodeParameter('esMalwareFilterJson', i);
2605
+ let filterData;
2606
+ try {
2607
+ filterData = JSON.parse(filterJson);
2608
+ }
2609
+ catch (e) {
2610
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Filter JSON must be valid JSON', { itemIndex: i });
2611
+ }
2612
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditMalwareFilter', {
2613
+ ...filterData,
2614
+ tenantFilter,
2615
+ }, {});
2616
+ }
2617
+ else if (operation === 'listSafeAttachmentsFilters') {
2618
+ const returnAll = this.getNodeParameter('returnAll', i);
2619
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListSafeAttachmentsFilters', {}, { tenantFilter });
2620
+ if (Array.isArray(responseData) && !returnAll) {
2621
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2622
+ }
2623
+ }
2624
+ else if (operation === 'addTenantAllowBlockList') {
2625
+ const blockListJson = this.getNodeParameter('esBlockListJson', i);
2626
+ let blockListData;
2627
+ try {
2628
+ blockListData = JSON.parse(blockListJson);
2629
+ }
2630
+ catch (e) {
2631
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Block List JSON must be valid JSON', { itemIndex: i });
2632
+ }
2633
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddTenantAllowBlockList', {
2634
+ ...blockListData,
2635
+ tenantFilter,
2636
+ }, {});
2637
+ }
2638
+ else if (operation === 'removeTenantAllowBlockList') {
2639
+ const blockListJson = this.getNodeParameter('esBlockListJson', i);
2640
+ let blockListData;
2641
+ try {
2642
+ blockListData = JSON.parse(blockListJson);
2643
+ }
2644
+ catch (e) {
2645
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Block List JSON must be valid JSON', { itemIndex: i });
2646
+ }
2647
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveTenantAllowBlockList', {
2648
+ ...blockListData,
2649
+ tenantFilter,
2650
+ }, {});
2651
+ }
2652
+ else if (operation === 'listTenantAllowBlockList') {
2653
+ const returnAll = this.getNodeParameter('returnAll', i);
2654
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListTenantAllowBlockList', {}, { tenantFilter });
2655
+ if (Array.isArray(responseData) && !returnAll) {
2656
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2657
+ }
2658
+ }
2659
+ }
2660
+ // ==================== EXCHANGE RESOURCE ====================
2661
+ else if (resource === 'exchangeResource') {
2662
+ const tenantFilter = getTenantFilter();
2663
+ if (operation === 'listRooms') {
2664
+ const returnAll = this.getNodeParameter('returnAll', i);
2665
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListRooms', {}, { tenantFilter });
2666
+ if (Array.isArray(responseData) && !returnAll) {
2667
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2668
+ }
2669
+ }
2670
+ else if (operation === 'addRoomMailbox') {
2671
+ const displayName = this.getNodeParameter('erDisplayName', i);
2672
+ const username = this.getNodeParameter('erUsername', i);
2673
+ const domain = this.getNodeParameter('erDomain', i);
2674
+ const additionalJson = this.getNodeParameter('erAdditionalJson', i);
2675
+ let additionalData = {};
2676
+ if (additionalJson && additionalJson !== '{}') {
2677
+ try {
2678
+ additionalData = JSON.parse(additionalJson);
2679
+ }
2680
+ catch (e) {
2681
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional JSON must be valid JSON', { itemIndex: i });
2682
+ }
2683
+ }
2684
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddRoomMailbox', {
2685
+ ...additionalData,
2686
+ tenantFilter,
2687
+ displayName,
2688
+ username,
2689
+ domain,
2690
+ }, {});
2691
+ }
2692
+ else if (operation === 'editRoomMailbox') {
2693
+ const roomJson = this.getNodeParameter('erRoomJson', i);
2694
+ let roomData;
2695
+ try {
2696
+ roomData = JSON.parse(roomJson);
2697
+ }
2698
+ catch (e) {
2699
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Room JSON must be valid JSON', { itemIndex: i });
2700
+ }
2701
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditRoomMailbox', {
2702
+ ...roomData,
2703
+ tenantFilter,
2704
+ }, {});
2705
+ }
2706
+ else if (operation === 'listEquipment') {
2707
+ const returnAll = this.getNodeParameter('returnAll', i);
2708
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListEquipment', {}, { tenantFilter });
2709
+ if (Array.isArray(responseData) && !returnAll) {
2710
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2711
+ }
2712
+ }
2713
+ else if (operation === 'addEquipmentMailbox') {
2714
+ const displayName = this.getNodeParameter('erDisplayName', i);
2715
+ const username = this.getNodeParameter('erUsername', i);
2716
+ const domain = this.getNodeParameter('erDomain', i);
2717
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddEquipmentMailbox', {
2718
+ tenantFilter,
2719
+ displayName,
2720
+ username,
2721
+ domain,
2722
+ }, {});
2723
+ }
2724
+ else if (operation === 'editEquipmentMailbox') {
2725
+ const equipmentJson = this.getNodeParameter('erEquipmentJson', i);
2726
+ let equipmentData;
2727
+ try {
2728
+ equipmentData = JSON.parse(equipmentJson);
2729
+ }
2730
+ catch (e) {
2731
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Equipment JSON must be valid JSON', { itemIndex: i });
2732
+ }
2733
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditEquipmentMailbox', {
2734
+ ...equipmentData,
2735
+ tenantFilter,
2736
+ }, {});
2737
+ }
2738
+ else if (operation === 'listRoomLists') {
2739
+ const returnAll = this.getNodeParameter('returnAll', i);
2740
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListRoomLists', {}, { tenantFilter });
2741
+ if (Array.isArray(responseData) && !returnAll) {
2742
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2743
+ }
2744
+ }
2745
+ else if (operation === 'addRoomList') {
2746
+ const displayName = this.getNodeParameter('erDisplayName', i);
2747
+ const username = this.getNodeParameter('erUsername', i);
2748
+ const domain = this.getNodeParameter('erDomain', i);
2749
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddRoomList', {
2750
+ tenantFilter,
2751
+ displayName,
2752
+ username,
2753
+ domain,
2754
+ }, {});
2755
+ }
2756
+ else if (operation === 'editRoomList') {
2757
+ const roomListJson = this.getNodeParameter('erRoomListJson', i);
2758
+ let roomListData;
2759
+ try {
2760
+ roomListData = JSON.parse(roomListJson);
2761
+ }
2762
+ catch (e) {
2763
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Room List JSON must be valid JSON', { itemIndex: i });
2764
+ }
2765
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditRoomList', {
2766
+ ...roomListData,
2767
+ tenantFilter,
2768
+ }, {});
2769
+ }
2770
+ }
1619
2771
  // ==================== GDAP ====================
1620
2772
  else if (resource === 'gdap') {
1621
2773
  const tenantFilter = getTenantFilter();
@@ -1635,6 +2787,341 @@ class Cipp {
1635
2787
  }, {});
1636
2788
  }
1637
2789
  }
2790
+ // ==================== STANDARDS ====================
2791
+ else if (resource === 'standards') {
2792
+ const tenantFilter = (['listStandardTemplates', 'addStandardTemplate', 'removeStandardTemplate', 'listDomainHealth'].includes(operation))
2793
+ ? undefined
2794
+ : getTenantFilter();
2795
+ if (operation === 'listStandards') {
2796
+ const returnAll = this.getNodeParameter('returnAll', i);
2797
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListStandards', {}, { tenantFilter });
2798
+ if (Array.isArray(responseData) && !returnAll) {
2799
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2800
+ }
2801
+ }
2802
+ else if (operation === 'addStandardsDeploy') {
2803
+ const standardsJson = this.getNodeParameter('standardsJson', i);
2804
+ let standardsData;
2805
+ try {
2806
+ standardsData = JSON.parse(standardsJson);
2807
+ }
2808
+ catch (e) {
2809
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Standards JSON must be valid JSON', { itemIndex: i });
2810
+ }
2811
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddStandardsDeploy', {
2812
+ ...standardsData,
2813
+ tenantFilter,
2814
+ }, {});
2815
+ }
2816
+ else if (operation === 'removeStandard') {
2817
+ const standardId = this.getNodeParameter('standardId', i);
2818
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveStandard', {
2819
+ tenantFilter,
2820
+ ID: standardId,
2821
+ }, {});
2822
+ }
2823
+ else if (operation === 'listStandardTemplates') {
2824
+ const returnAll = this.getNodeParameter('returnAll', i);
2825
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/listStandardTemplates', {}, {});
2826
+ if (Array.isArray(responseData) && !returnAll) {
2827
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2828
+ }
2829
+ }
2830
+ else if (operation === 'addStandardTemplate') {
2831
+ const templateJson = this.getNodeParameter('standardTemplateJson', i);
2832
+ let templateData;
2833
+ try {
2834
+ templateData = JSON.parse(templateJson);
2835
+ }
2836
+ catch (e) {
2837
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Template JSON must be valid JSON', { itemIndex: i });
2838
+ }
2839
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddStandardsTemplate', {
2840
+ ...templateData,
2841
+ }, {});
2842
+ }
2843
+ else if (operation === 'removeStandardTemplate') {
2844
+ const templateId = this.getNodeParameter('standardTemplateId', i);
2845
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveStandardTemplate', {
2846
+ ID: templateId,
2847
+ }, {});
2848
+ }
2849
+ else if (operation === 'runStandards') {
2850
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecStandardsRun', {
2851
+ tenantFilter,
2852
+ }, {});
2853
+ }
2854
+ else if (operation === 'listBPA') {
2855
+ const returnAll = this.getNodeParameter('returnAll', i);
2856
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListBPA', {}, { tenantFilter });
2857
+ if (Array.isArray(responseData) && !returnAll) {
2858
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2859
+ }
2860
+ }
2861
+ else if (operation === 'execBPA') {
2862
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecBPA', {
2863
+ tenantFilter,
2864
+ }, {});
2865
+ }
2866
+ else if (operation === 'listDomainAnalyser') {
2867
+ const returnAll = this.getNodeParameter('returnAll', i);
2868
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListDomainAnalyser', {}, { tenantFilter });
2869
+ if (Array.isArray(responseData) && !returnAll) {
2870
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2871
+ }
2872
+ }
2873
+ else if (operation === 'execDomainAnalyser') {
2874
+ const domain = this.getNodeParameter('domain', i);
2875
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecDomainAnalyser', {
2876
+ tenantFilter,
2877
+ Domain: domain,
2878
+ }, {});
2879
+ }
2880
+ else if (operation === 'listDomainHealth') {
2881
+ const returnAll = this.getNodeParameter('returnAll', i);
2882
+ const domain = this.getNodeParameter('domain', i);
2883
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListDomainHealth', {}, { Domain: domain });
2884
+ if (Array.isArray(responseData) && !returnAll) {
2885
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2886
+ }
2887
+ }
2888
+ else if (operation === 'listTenantDrift') {
2889
+ const returnAll = this.getNodeParameter('returnAll', i);
2890
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListTenantDrift', {}, { tenantFilter });
2891
+ if (Array.isArray(responseData) && !returnAll) {
2892
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2893
+ }
2894
+ }
2895
+ else if (operation === 'listTenantAlignment') {
2896
+ const returnAll = this.getNodeParameter('returnAll', i);
2897
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListTenantAlignment', {}, { tenantFilter });
2898
+ if (Array.isArray(responseData) && !returnAll) {
2899
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2900
+ }
2901
+ }
2902
+ else if (operation === 'execDriftClone') {
2903
+ const driftJson = this.getNodeParameter('driftJson', i);
2904
+ let driftData;
2905
+ try {
2906
+ driftData = JSON.parse(driftJson);
2907
+ }
2908
+ catch (e) {
2909
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Drift JSON must be valid JSON', { itemIndex: i });
2910
+ }
2911
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecDriftClone', {
2912
+ ...driftData,
2913
+ tenantFilter,
2914
+ }, {});
2915
+ }
2916
+ }
2917
+ // ==================== INTUNE ====================
2918
+ else if (resource === 'intune') {
2919
+ const tenantFilter = getTenantFilter();
2920
+ if (operation === 'listIntuneScripts') {
2921
+ const returnAll = this.getNodeParameter('returnAll', i);
2922
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListIntuneScript', {}, { tenantFilter });
2923
+ if (Array.isArray(responseData) && !returnAll) {
2924
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2925
+ }
2926
+ }
2927
+ else if (operation === 'editIntuneScript') {
2928
+ const scriptJson = this.getNodeParameter('intuneScriptJson', i);
2929
+ let scriptData;
2930
+ try {
2931
+ scriptData = JSON.parse(scriptJson);
2932
+ }
2933
+ catch (e) {
2934
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Script JSON must be valid JSON', { itemIndex: i });
2935
+ }
2936
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditIntuneScript', {
2937
+ ...scriptData,
2938
+ tenantFilter,
2939
+ }, {});
2940
+ }
2941
+ else if (operation === 'removeIntuneScript') {
2942
+ const id = this.getNodeParameter('intuneId', i);
2943
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveIntuneScript', {
2944
+ tenantFilter,
2945
+ ID: id,
2946
+ }, {});
2947
+ }
2948
+ else if (operation === 'listCompliancePolicies') {
2949
+ const returnAll = this.getNodeParameter('returnAll', i);
2950
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListCompliancePolicies', {}, { tenantFilter });
2951
+ if (Array.isArray(responseData) && !returnAll) {
2952
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2953
+ }
2954
+ }
2955
+ else if (operation === 'listAppProtectionPolicies') {
2956
+ const returnAll = this.getNodeParameter('returnAll', i);
2957
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListAppProtectionPolicies', {}, { tenantFilter });
2958
+ if (Array.isArray(responseData) && !returnAll) {
2959
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2960
+ }
2961
+ }
2962
+ else if (operation === 'listAssignmentFilters') {
2963
+ const returnAll = this.getNodeParameter('returnAll', i);
2964
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListAssignmentFilters', {}, { tenantFilter });
2965
+ if (Array.isArray(responseData) && !returnAll) {
2966
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2967
+ }
2968
+ }
2969
+ else if (operation === 'addAssignmentFilter') {
2970
+ const filterJson = this.getNodeParameter('intuneFilterJson', i);
2971
+ let filterData;
2972
+ try {
2973
+ filterData = JSON.parse(filterJson);
2974
+ }
2975
+ catch (e) {
2976
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Filter JSON must be valid JSON', { itemIndex: i });
2977
+ }
2978
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddAssignmentFilter', {
2979
+ ...filterData,
2980
+ tenantFilter,
2981
+ }, {});
2982
+ }
2983
+ else if (operation === 'listIntuneReusableSettings') {
2984
+ const returnAll = this.getNodeParameter('returnAll', i);
2985
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListIntuneReusableSettings', {}, { tenantFilter });
2986
+ if (Array.isArray(responseData) && !returnAll) {
2987
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
2988
+ }
2989
+ }
2990
+ else if (operation === 'addIntuneReusableSetting') {
2991
+ const settingJson = this.getNodeParameter('intuneSettingJson', i);
2992
+ let settingData;
2993
+ try {
2994
+ settingData = JSON.parse(settingJson);
2995
+ }
2996
+ catch (e) {
2997
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Setting JSON must be valid JSON', { itemIndex: i });
2998
+ }
2999
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddIntuneReusableSetting', {
3000
+ ...settingData,
3001
+ tenantFilter,
3002
+ }, {});
3003
+ }
3004
+ else if (operation === 'removeIntuneReusableSetting') {
3005
+ const id = this.getNodeParameter('intuneId', i);
3006
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveIntuneReusableSetting', {
3007
+ tenantFilter,
3008
+ ID: id,
3009
+ }, {});
3010
+ }
3011
+ else if (operation === 'listIntuneTemplates') {
3012
+ const returnAll = this.getNodeParameter('returnAll', i);
3013
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListIntuneTemplates', {}, {});
3014
+ if (Array.isArray(responseData) && !returnAll) {
3015
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
3016
+ }
3017
+ }
3018
+ else if (operation === 'addWin32ScriptApp') {
3019
+ const appJson = this.getNodeParameter('intuneAppJson', i);
3020
+ let appData;
3021
+ try {
3022
+ appData = JSON.parse(appJson);
3023
+ }
3024
+ catch (e) {
3025
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'App JSON must be valid JSON', { itemIndex: i });
3026
+ }
3027
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddWin32ScriptApp', {
3028
+ ...appData,
3029
+ tenantFilter,
3030
+ }, {});
3031
+ }
3032
+ }
3033
+ // ==================== SHAREPOINT ====================
3034
+ else if (resource === 'sharepoint') {
3035
+ const tenantFilter = getTenantFilter();
3036
+ if (operation === 'deleteSharepointSite') {
3037
+ const siteUrl = this.getNodeParameter('siteUrl', i);
3038
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/DeleteSharepointSite', {
3039
+ tenantFilter,
3040
+ SiteUrl: siteUrl,
3041
+ }, {});
3042
+ }
3043
+ else if (operation === 'listSharepointQuota') {
3044
+ const returnAll = this.getNodeParameter('returnAll', i);
3045
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListSharepointQuota', {}, { tenantFilter });
3046
+ if (Array.isArray(responseData) && !returnAll) {
3047
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
3048
+ }
3049
+ }
3050
+ else if (operation === 'listSharepointSettings') {
3051
+ const returnAll = this.getNodeParameter('returnAll', i);
3052
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListSharepointSettings', {}, { tenantFilter });
3053
+ if (Array.isArray(responseData) && !returnAll) {
3054
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
3055
+ }
3056
+ }
3057
+ else if (operation === 'listSharepointAdminUrl') {
3058
+ const returnAll = this.getNodeParameter('returnAll', i);
3059
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListSharepointAdminUrl', {}, { tenantFilter });
3060
+ if (Array.isArray(responseData) && !returnAll) {
3061
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
3062
+ }
3063
+ }
3064
+ }
3065
+ // ==================== TESTING ====================
3066
+ else if (resource === 'testing') {
3067
+ const tenantFilter = getTenantFilter();
3068
+ if (operation === 'listTests') {
3069
+ const returnAll = this.getNodeParameter('returnAll', i);
3070
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListTests', {}, { tenantFilter });
3071
+ if (Array.isArray(responseData) && !returnAll) {
3072
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
3073
+ }
3074
+ }
3075
+ else if (operation === 'listAvailableTests') {
3076
+ const returnAll = this.getNodeParameter('returnAll', i);
3077
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListAvailableTests', {}, { tenantFilter });
3078
+ if (Array.isArray(responseData) && !returnAll) {
3079
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
3080
+ }
3081
+ }
3082
+ else if (operation === 'execTestRun') {
3083
+ const testJson = this.getNodeParameter('testJson', i);
3084
+ let testData;
3085
+ try {
3086
+ testData = JSON.parse(testJson);
3087
+ }
3088
+ catch (e) {
3089
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Test JSON must be valid JSON', { itemIndex: i });
3090
+ }
3091
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecTestRun', {
3092
+ ...testData,
3093
+ tenantFilter,
3094
+ }, {});
3095
+ }
3096
+ else if (operation === 'listTestReports') {
3097
+ const returnAll = this.getNodeParameter('returnAll', i);
3098
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListTestReports', {}, { tenantFilter });
3099
+ if (Array.isArray(responseData) && !returnAll) {
3100
+ responseData = responseData.slice(0, this.getNodeParameter('limit', i));
3101
+ }
3102
+ }
3103
+ else if (operation === 'addTestReport') {
3104
+ const reportJson = this.getNodeParameter('reportJson', i);
3105
+ let reportData;
3106
+ try {
3107
+ reportData = JSON.parse(reportJson);
3108
+ }
3109
+ catch (e) {
3110
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Report JSON must be valid JSON', { itemIndex: i });
3111
+ }
3112
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddTestReport', {
3113
+ ...reportData,
3114
+ tenantFilter,
3115
+ }, {});
3116
+ }
3117
+ else if (operation === 'deleteTestReport') {
3118
+ const id = this.getNodeParameter('testReportId', i);
3119
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/DeleteTestReport', {
3120
+ tenantFilter,
3121
+ ID: id,
3122
+ }, {});
3123
+ }
3124
+ }
1638
3125
  // Handle response
1639
3126
  const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
1640
3127
  returnData.push(...executionData);