@joshuanode/n8n-nodes-cipp 0.0.27 → 0.0.28

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 (46) hide show
  1. package/README.md +13 -0
  2. package/dist/credentials/CippApi.credentials.js +1 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/nodes/Cipp/{Cipp.node.d.ts → CippApp.node.d.ts} +1 -1
  8. package/dist/nodes/Cipp/CippApp.node.d.ts.map +1 -0
  9. package/dist/nodes/Cipp/{Cipp.node.js → CippApp.node.js} +148 -49
  10. package/dist/nodes/Cipp/CippApp.node.js.map +1 -0
  11. package/dist/nodes/Cipp/cipp.svg +4 -0
  12. package/dist/nodes/Cipp/descriptions/ConditionalAccessDescription.d.ts.map +1 -1
  13. package/dist/nodes/Cipp/descriptions/ConditionalAccessDescription.js +1 -2
  14. package/dist/nodes/Cipp/descriptions/ConditionalAccessDescription.js.map +1 -1
  15. package/dist/nodes/Cipp/descriptions/EmailSecurityDescription.js +7 -7
  16. package/dist/nodes/Cipp/descriptions/IdentityDescription.d.ts.map +1 -1
  17. package/dist/nodes/Cipp/descriptions/IdentityDescription.js +1 -2
  18. package/dist/nodes/Cipp/descriptions/IdentityDescription.js.map +1 -1
  19. package/dist/nodes/Cipp/descriptions/IntuneDescription.js +8 -8
  20. package/dist/nodes/Cipp/descriptions/MailboxDescription.d.ts.map +1 -1
  21. package/dist/nodes/Cipp/descriptions/MailboxDescription.js +1 -5
  22. package/dist/nodes/Cipp/descriptions/MailboxDescription.js.map +1 -1
  23. package/dist/nodes/Cipp/descriptions/OneDriveDescription.js +2 -2
  24. package/dist/nodes/Cipp/descriptions/OneDriveDescription.js.map +1 -1
  25. package/dist/nodes/Cipp/descriptions/PolicyDescription.js +1 -1
  26. package/dist/nodes/Cipp/descriptions/SafeLinksDescription.js +1 -1
  27. package/dist/nodes/Cipp/descriptions/SharePointDescription.js +4 -4
  28. package/dist/nodes/Cipp/descriptions/SharePointDescription.js.map +1 -1
  29. package/dist/nodes/Cipp/descriptions/ShiftDescription.d.ts.map +1 -1
  30. package/dist/nodes/Cipp/descriptions/ShiftDescription.js +2 -3
  31. package/dist/nodes/Cipp/descriptions/ShiftDescription.js.map +1 -1
  32. package/dist/nodes/Cipp/descriptions/TenantDescription.js +2 -2
  33. package/dist/nodes/Cipp/descriptions/TenantDescription.js.map +1 -1
  34. package/dist/nodes/Cipp/descriptions/UserDescription.d.ts.map +1 -1
  35. package/dist/nodes/Cipp/descriptions/UserDescription.js +4 -10
  36. package/dist/nodes/Cipp/descriptions/UserDescription.js.map +1 -1
  37. package/dist/nodes/Cipp/descriptions/V105Description.d.ts +4 -0
  38. package/dist/nodes/Cipp/descriptions/V105Description.d.ts.map +1 -0
  39. package/dist/nodes/Cipp/descriptions/V105Description.js +237 -0
  40. package/dist/nodes/Cipp/descriptions/V105Description.js.map +1 -0
  41. package/dist/nodes/Cipp/descriptions/index.d.ts.map +1 -1
  42. package/dist/nodes/Cipp/descriptions/index.js +3 -0
  43. package/dist/nodes/Cipp/descriptions/index.js.map +1 -1
  44. package/package.json +3 -3
  45. package/dist/nodes/Cipp/Cipp.node.d.ts.map +0 -1
  46. package/dist/nodes/Cipp/Cipp.node.js.map +0 -1
package/README.md CHANGED
@@ -21,6 +21,7 @@ This node provides full integration with the CIPP API, enabling automation of:
21
21
  - **Intune** - Applications, Autopilot, device actions
22
22
  - **Teams & SharePoint** - Teams, sites, voice numbers, shifts scheduling
23
23
  - **Security & Compliance** - Defender alerts, incidents
24
+ - **CIPP v10.5 APIs** - Purview compliance, enrollment profiles, mailbox restores, alert snoozing, license reports
24
25
  - **Tools** - Breach search, Graph API requests, ExecGraphRequest
25
26
  - **CIPP System** - Scheduled jobs, backups
26
27
 
@@ -77,6 +78,7 @@ For detailed authentication setup, see the [CIPP API Documentation](https://docs
77
78
  | **Voice** | Get Phone Numbers, Get Locations, Assign/Unassign Numbers |
78
79
  | **Scheduled Item** | Add, Get Many, Remove |
79
80
  | **Backup** | Get Many, Run, Restore, Set Auto-Backup |
81
+ | **CIPP v10.5** | Purview compliance policy/SIT/sensitivity label actions, enrollment profile actions, mailbox restore/CAS/HVE reports, alert snoozing, package tags, license reports |
80
82
  | **Tools** | Breach Search (Account/Tenant), Exec Graph Request, Graph Request (List), Graph Request (Exec) |
81
83
 
82
84
  ## Example Usage
@@ -131,6 +133,17 @@ $select: id,displayName,userPrincipalName
131
133
  $filter: startsWith(displayName,'John')
132
134
  ```
133
135
 
136
+ ### CIPP v10.5 APIs
137
+
138
+ ```
139
+ Resource: CIPP v10.5
140
+ Operation: List Licenses Report
141
+ Tenant: Select from dropdown
142
+ Return All: true
143
+ ```
144
+
145
+ Complex CIPP v10.5 create/edit/action operations use a validated JSON body so requests can match CIPP's current API fields without the node guessing incomplete schemas. The node only allows the enumerated CIPP v10.5 endpoints, validates query/body JSON objects, and enforces a maximum serialized body size.
146
+
134
147
  ### Teams Shifts (Dedicated Resource)
135
148
 
136
149
  ```
@@ -53,7 +53,7 @@ async function getAccessToken(credentials) {
53
53
  class CippApi {
54
54
  name = 'cippApi';
55
55
  displayName = 'CIPP.app API';
56
- icon = 'file:cipp.png';
56
+ icon = 'file:cipp.svg';
57
57
  documentationUrl = 'https://docs.cipp.app/api-documentation/setup-and-authentication';
58
58
  genericAuth = true;
59
59
  properties = [
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './nodes/Cipp/Cipp.node';
1
+ export * from './nodes/Cipp/CippApp.node';
2
2
  export * from './credentials/CippApi.credentials';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC"}
package/dist/index.js CHANGED
@@ -14,6 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./nodes/Cipp/Cipp.node"), exports);
17
+ __exportStar(require("./nodes/Cipp/CippApp.node"), exports);
18
18
  __exportStar(require("./credentials/CippApi.credentials"), exports);
19
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,oEAAkD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C;AAC1C,oEAAkD"}
@@ -11,4 +11,4 @@ export declare class Cipp implements INodeType {
11
11
  };
12
12
  execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
13
13
  }
14
- //# sourceMappingURL=Cipp.node.d.ts.map
14
+ //# sourceMappingURL=CippApp.node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CippApp.node.d.ts","sourceRoot":"","sources":["../../../nodes/Cipp/CippApp.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,qBAAqB,EACrB,wBAAwB,EAExB,iBAAiB,EAEjB,qBAAqB,EACrB,yBAAyB,EACzB,kBAAkB,EAClB,qBAAqB,EACrB,SAAS,EACT,oBAAoB,EACpB,MAAM,cAAc,CAAC;AAWtB,qBAAa,IAAK,YAAW,SAAS;IACrC,WAAW,EAAE,oBAAoB,CA8K/B;IAEF,OAAO;;wCAGE,wBAAwB,cAClB,qBAAqB,GAC/B,OAAO,CAAC,yBAAyB,CAAC;;;+BA6D9B,qBAAqB,WAClB,MAAM,GACb,OAAO,CAAC,qBAAqB,CAAC;;MAqBjC;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CAm9HvE"}
@@ -8,7 +8,7 @@ class Cipp {
8
8
  description = {
9
9
  displayName: 'CIPP.app',
10
10
  name: 'cippApp',
11
- icon: 'file:cipp.png',
11
+ icon: 'file:cipp.svg',
12
12
  group: ['transform'],
13
13
  version: 1,
14
14
  subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
@@ -52,6 +52,11 @@ class Cipp {
52
52
  value: 'backup',
53
53
  description: 'Manage CIPP backups',
54
54
  },
55
+ {
56
+ name: 'CIPP v10.5',
57
+ value: 'cippV105',
58
+ description: 'Use CIPP v10.5 API additions',
59
+ },
55
60
  {
56
61
  name: 'Conditional Access',
57
62
  value: 'conditionalAccess',
@@ -113,7 +118,7 @@ class Cipp {
113
118
  description: 'Manage quarantined email messages',
114
119
  },
115
120
  {
116
- name: 'Safe Links',
121
+ name: 'Safe Link',
117
122
  value: 'safeLinks',
118
123
  description: 'Manage Safe Links policies and templates',
119
124
  },
@@ -128,7 +133,7 @@ class Cipp {
128
133
  description: 'Manage SharePoint sites, quotas, and settings',
129
134
  },
130
135
  {
131
- name: 'Standards',
136
+ name: 'Standard',
132
137
  value: 'standards',
133
138
  description: 'Manage tenant standards, drift, BPA, and domain analyser',
134
139
  },
@@ -142,16 +147,16 @@ class Cipp {
142
147
  value: 'teamsShift',
143
148
  description: 'Manage Teams Shifts schedule — shifts, open shifts, groups, time off',
144
149
  },
145
- {
146
- name: 'Testing',
147
- value: 'testing',
148
- description: 'Manage test runs, test reports, and available tests',
149
- },
150
150
  {
151
151
  name: 'Tenant',
152
152
  value: 'tenant',
153
153
  description: 'List and manage tenants',
154
154
  },
155
+ {
156
+ name: 'Testing',
157
+ value: 'testing',
158
+ description: 'Manage test runs, test reports, and available tests',
159
+ },
155
160
  {
156
161
  name: 'Tool',
157
162
  value: 'tools',
@@ -188,31 +193,34 @@ class Cipp {
188
193
  const tokenUrl = `https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`;
189
194
  const scope = `api://${clientId}/.default`;
190
195
  const tokenBody = `grant_type=client_credentials&client_id=${encodeURIComponent(clientId)}&client_secret=${encodeURIComponent(clientSecret)}&scope=${encodeURIComponent(scope)}`;
191
- const tokenResponse = (await this.helpers.request({
196
+ const tokenRequest = await fetch(tokenUrl, {
192
197
  method: 'POST',
193
- uri: tokenUrl,
194
198
  headers: {
195
199
  'Content-Type': 'application/x-www-form-urlencoded',
196
200
  },
197
201
  body: tokenBody,
198
- json: true,
199
- }));
200
- if (!tokenResponse.access_token) {
202
+ });
203
+ const tokenResponse = (await tokenRequest.json().catch(() => ({})));
204
+ if (!tokenRequest.ok || typeof tokenResponse.access_token !== 'string') {
201
205
  return {
202
206
  status: 'Error',
203
207
  message: 'Failed to obtain access token from Azure AD. Check your Tenant ID, Client ID, and Client Secret.',
204
208
  };
205
209
  }
206
210
  // Step 2: Test API connection with the token
207
- await this.helpers.request({
211
+ const testRequest = await fetch(`${baseUrl}/api/ListTenants`, {
208
212
  method: 'GET',
209
- uri: `${baseUrl}/api/ListTenants`,
210
213
  headers: {
211
214
  Authorization: `Bearer ${tokenResponse.access_token}`,
212
215
  Accept: 'application/json',
213
216
  },
214
- json: true,
215
217
  });
218
+ if (!testRequest.ok) {
219
+ return {
220
+ status: 'Error',
221
+ message: `CIPP API test request failed with status ${testRequest.status}.`,
222
+ };
223
+ }
216
224
  return {
217
225
  status: 'OK',
218
226
  message: 'Connection successful!',
@@ -309,6 +317,51 @@ class Cipp {
309
317
  .map((entry) => entry.trim())
310
318
  .filter(Boolean);
311
319
  };
320
+ const v105Endpoints = {
321
+ addAssignmentFilterTemplate: { method: 'POST', endpoint: '/api/AddAssignmentFilterTemplate' },
322
+ addDlpCompliancePolicy: { method: 'POST', endpoint: '/api/AddDlpCompliancePolicy' },
323
+ addEnrollment: { method: 'POST', endpoint: '/api/AddEnrollment' },
324
+ addGroupTeam: { method: 'POST', endpoint: '/api/AddGroupTeam' },
325
+ addRetentionCompliancePolicy: { method: 'POST', endpoint: '/api/AddRetentionCompliancePolicy' },
326
+ addSensitiveInfoType: { method: 'POST', endpoint: '/api/AddSensitiveInfoType' },
327
+ addSensitivityLabel: { method: 'POST', endpoint: '/api/AddSensitivityLabel' },
328
+ addUserBulk: { method: 'POST', endpoint: '/api/AddUserBulk' },
329
+ assignPolicy: { method: 'POST', endpoint: '/api/ExecAssignPolicy' },
330
+ editAssignmentFilter: { method: 'POST', endpoint: '/api/EditAssignmentFilter' },
331
+ editDlpCompliancePolicy: { method: 'POST', endpoint: '/api/EditDlpCompliancePolicy' },
332
+ editRetentionCompliancePolicy: { method: 'POST', endpoint: '/api/EditRetentionCompliancePolicy' },
333
+ editSensitiveInfoType: { method: 'POST', endpoint: '/api/EditSensitiveInfoType' },
334
+ editSensitivityLabel: { method: 'POST', endpoint: '/api/EditSensitivityLabel' },
335
+ execAssignmentFilter: { method: 'DELETE', endpoint: '/api/ExecAssignmentFilter' },
336
+ execMailboxRestore: { method: 'POST', endpoint: '/api/ExecMailboxRestore' },
337
+ execMcp: { method: 'POST', endpoint: '/api/ExecMcp' },
338
+ execSpoVersionCleanup: { method: 'POST', endpoint: '/api/ExecSPOVersionCleanup' },
339
+ listActiveSyncDevices: { method: 'GET', endpoint: '/api/ListActiveSyncDevices' },
340
+ listAndroidEnrollmentProfiles: { method: 'POST', endpoint: '/api/ListAndroidEnrollmentProfiles' },
341
+ listAppleEnrollmentProfiles: { method: 'POST', endpoint: '/api/ListAppleEnrollmentProfiles' },
342
+ listAssignmentFilterTemplates: { method: 'GET', endpoint: '/api/ListAssignmentFilterTemplates' },
343
+ listCspSku: { method: 'GET', endpoint: '/api/ListCSPsku' },
344
+ listDlpCompliancePolicy: { method: 'GET', endpoint: '/api/ListDlpCompliancePolicy' },
345
+ listHveAccounts: { method: 'GET', endpoint: '/api/ListHVEAccounts' },
346
+ listLicensesReport: { method: 'GET', endpoint: '/api/ListLicensesReport' },
347
+ listMailboxRestores: { method: 'GET', endpoint: '/api/ListMailboxRestores' },
348
+ listRetentionCompliancePolicy: { method: 'GET', endpoint: '/api/ListRetentionCompliancePolicy' },
349
+ listSensitiveInfoType: { method: 'GET', endpoint: '/api/ListSensitiveInfoType' },
350
+ listSensitivityLabel: { method: 'GET', endpoint: '/api/ListSensitivityLabel' },
351
+ listSnoozedAlerts: { method: 'GET', endpoint: '/api/ListSnoozedAlerts' },
352
+ patchUser: { method: 'PATCH', endpoint: '/api/PatchUser' },
353
+ removeAdminRole: { method: 'POST', endpoint: '/api/ExecRemoveAdminRole' },
354
+ removeAssignmentFilterTemplate: { method: 'POST', endpoint: '/api/RemoveAssignmentFilterTemplate' },
355
+ removeDlpCompliancePolicy: { method: 'POST', endpoint: '/api/RemoveDlpCompliancePolicy' },
356
+ removeEnrollmentProfile: { method: 'POST', endpoint: '/api/ExecRemoveEnrollmentProfile' },
357
+ removeRetentionCompliancePolicy: { method: 'POST', endpoint: '/api/RemoveRetentionCompliancePolicy' },
358
+ removeSensitiveInfoType: { method: 'POST', endpoint: '/api/RemoveSensitiveInfoType' },
359
+ removeSensitivityLabel: { method: 'POST', endpoint: '/api/RemoveSensitivityLabel' },
360
+ removeSnooze: { method: 'POST', endpoint: '/api/ExecRemoveSnooze' },
361
+ setCasMailbox: { method: 'POST', endpoint: '/api/ExecSetCASMailbox' },
362
+ setPackageTag: { method: 'POST', endpoint: '/api/ExecSetPackageTag' },
363
+ snoozeAlert: { method: 'POST', endpoint: '/api/ExecSnoozeAlert' },
364
+ };
312
365
  for (let i = 0; i < items.length; i++) {
313
366
  try {
314
367
  let responseData = {};
@@ -352,7 +405,9 @@ class Cipp {
352
405
  // Strip out AssignedUsers and AssignedGroups if summaryOnly is enabled
353
406
  if (licenseOptions.summaryOnly && Array.isArray(responseData)) {
354
407
  responseData = responseData.map((license) => {
355
- const { AssignedUsers, AssignedGroups, ...summary } = license;
408
+ const summary = { ...license };
409
+ delete summary.AssignedUsers;
410
+ delete summary.AssignedGroups;
356
411
  return summary;
357
412
  });
358
413
  }
@@ -881,7 +936,7 @@ class Cipp {
881
936
  try {
882
937
  editData = JSON.parse(editJson);
883
938
  }
884
- catch (e) {
939
+ catch {
885
940
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Policy JSON must be valid JSON', { itemIndex: i });
886
941
  }
887
942
  if (editData.displayName)
@@ -901,7 +956,7 @@ class Cipp {
901
956
  try {
902
957
  templateData = JSON.parse(templateJson);
903
958
  }
904
- catch (e) {
959
+ catch {
905
960
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Template JSON must be valid JSON', { itemIndex: i });
906
961
  }
907
962
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddCATemplate', {
@@ -959,7 +1014,7 @@ class Cipp {
959
1014
  try {
960
1015
  locationData = JSON.parse(locationJson);
961
1016
  }
962
- catch (e) {
1017
+ catch {
963
1018
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Location JSON must be valid JSON', { itemIndex: i });
964
1019
  }
965
1020
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecNamedLocation', {
@@ -2030,7 +2085,7 @@ class Cipp {
2030
2085
  try {
2031
2086
  policyData = JSON.parse(policyJson);
2032
2087
  }
2033
- catch (e) {
2088
+ catch {
2034
2089
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Policy JSON must be valid JSON', { itemIndex: i });
2035
2090
  }
2036
2091
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecNewSafeLinksPolicy', {
@@ -2046,7 +2101,7 @@ class Cipp {
2046
2101
  try {
2047
2102
  policyData = JSON.parse(policyJson);
2048
2103
  }
2049
- catch (e) {
2104
+ catch {
2050
2105
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Policy JSON must be valid JSON', { itemIndex: i });
2051
2106
  }
2052
2107
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditSafeLinksPolicy', {
@@ -2069,7 +2124,7 @@ class Cipp {
2069
2124
  try {
2070
2125
  templateData = JSON.parse(templateJson);
2071
2126
  }
2072
- catch (e) {
2127
+ catch {
2073
2128
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Template JSON must be valid JSON', { itemIndex: i });
2074
2129
  }
2075
2130
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddSafeLinksPolicyTemplate', {
@@ -2084,7 +2139,7 @@ class Cipp {
2084
2139
  try {
2085
2140
  templateData = JSON.parse(templateJson);
2086
2141
  }
2087
- catch (e) {
2142
+ catch {
2088
2143
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Template JSON must be valid JSON', { itemIndex: i });
2089
2144
  }
2090
2145
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditSafeLinksPolicyTemplate', {
@@ -2180,6 +2235,50 @@ class Cipp {
2180
2235
  }, {});
2181
2236
  }
2182
2237
  }
2238
+ // ==================== CIPP V10.5 ====================
2239
+ else if (resource === 'cippV105') {
2240
+ const config = v105Endpoints[operation];
2241
+ if (!config) {
2242
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unsupported CIPP v10.5 operation: ${operation}`, { itemIndex: i });
2243
+ }
2244
+ const includeTenant = this.getNodeParameter('v105IncludeTenant', i);
2245
+ const query = parseJsonObjectPayload(this.getNodeParameter('v105QueryJson', i, '{}'), 'Query Parameters', i);
2246
+ const body = config.method === 'GET'
2247
+ ? {}
2248
+ : parseJsonObjectPayload(this.getNodeParameter('v105BodyJson', i, '{}'), 'Body', i);
2249
+ if (includeTenant) {
2250
+ const tenantValue = this.getNodeParameter('tenantFilter', i);
2251
+ const tenantFilter = (0, GenericFunctions_1.getResourceLocatorValue)(tenantValue);
2252
+ if (!tenantFilter) {
2253
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Tenant is required.', {
2254
+ itemIndex: i,
2255
+ });
2256
+ }
2257
+ if (!query.tenantFilter) {
2258
+ query.tenantFilter = tenantFilter;
2259
+ }
2260
+ if (!body.tenantFilter) {
2261
+ body.tenantFilter = tenantFilter;
2262
+ }
2263
+ }
2264
+ const options = this.getNodeParameter('v105Options', i, {});
2265
+ const maxPayloadBytes = Number(options.maxPayloadBytes ?? 262144);
2266
+ if (!Number.isFinite(maxPayloadBytes) || maxPayloadBytes <= 0) {
2267
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Max Payload Bytes must be a positive number.', { itemIndex: i });
2268
+ }
2269
+ const payloadBytes = new TextEncoder().encode(JSON.stringify(body)).length;
2270
+ if (payloadBytes > maxPayloadBytes) {
2271
+ throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Payload is ${payloadBytes} bytes, which exceeds Max Payload Bytes (${maxPayloadBytes}).`, { itemIndex: i });
2272
+ }
2273
+ responseData = await GenericFunctions_1.cippApiRequest.call(this, config.method, config.endpoint, body, query);
2274
+ if (Array.isArray(responseData)) {
2275
+ const returnAll = this.getNodeParameter('returnAll', i, true);
2276
+ if (!returnAll) {
2277
+ const limit = this.getNodeParameter('limit', i);
2278
+ responseData = responseData.slice(0, limit);
2279
+ }
2280
+ }
2281
+ }
2183
2282
  // ==================== TOOLS ====================
2184
2283
  else if (resource === 'tools') {
2185
2284
  if (operation === 'breachAccount') {
@@ -2741,7 +2840,7 @@ class Cipp {
2741
2840
  try {
2742
2841
  policyData = JSON.parse(policyJson);
2743
2842
  }
2744
- catch (e) {
2843
+ catch {
2745
2844
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Policy JSON must be valid JSON', { itemIndex: i });
2746
2845
  }
2747
2846
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddSpamFilter', {
@@ -2755,7 +2854,7 @@ class Cipp {
2755
2854
  try {
2756
2855
  policyData = JSON.parse(policyJson);
2757
2856
  }
2758
- catch (e) {
2857
+ catch {
2759
2858
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Policy JSON must be valid JSON', { itemIndex: i });
2760
2859
  }
2761
2860
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditSpamFilter', {
@@ -2783,7 +2882,7 @@ class Cipp {
2783
2882
  try {
2784
2883
  ruleData = JSON.parse(ruleJson);
2785
2884
  }
2786
- catch (e) {
2885
+ catch {
2787
2886
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Rule JSON must be valid JSON', { itemIndex: i });
2788
2887
  }
2789
2888
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddTransportRule', {
@@ -2797,7 +2896,7 @@ class Cipp {
2797
2896
  try {
2798
2897
  ruleData = JSON.parse(ruleJson);
2799
2898
  }
2800
- catch (e) {
2899
+ catch {
2801
2900
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Rule JSON must be valid JSON', { itemIndex: i });
2802
2901
  }
2803
2902
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditTransportRule', {
@@ -2825,7 +2924,7 @@ class Cipp {
2825
2924
  try {
2826
2925
  connectorData = JSON.parse(connectorJson);
2827
2926
  }
2828
- catch (e) {
2927
+ catch {
2829
2928
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Connector JSON must be valid JSON', { itemIndex: i });
2830
2929
  }
2831
2930
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddExConnector', {
@@ -2839,7 +2938,7 @@ class Cipp {
2839
2938
  try {
2840
2939
  connectorData = JSON.parse(connectorJson);
2841
2940
  }
2842
- catch (e) {
2941
+ catch {
2843
2942
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Connector JSON must be valid JSON', { itemIndex: i });
2844
2943
  }
2845
2944
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditExConnector', {
@@ -2867,7 +2966,7 @@ class Cipp {
2867
2966
  try {
2868
2967
  filterData = JSON.parse(filterJson);
2869
2968
  }
2870
- catch (e) {
2969
+ catch {
2871
2970
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Filter JSON must be valid JSON', { itemIndex: i });
2872
2971
  }
2873
2972
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddConnectionFilter', {
@@ -2888,7 +2987,7 @@ class Cipp {
2888
2987
  try {
2889
2988
  filterData = JSON.parse(filterJson);
2890
2989
  }
2891
- catch (e) {
2990
+ catch {
2892
2991
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Filter JSON must be valid JSON', { itemIndex: i });
2893
2992
  }
2894
2993
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditAntiPhishingFilter', {
@@ -2909,7 +3008,7 @@ class Cipp {
2909
3008
  try {
2910
3009
  filterData = JSON.parse(filterJson);
2911
3010
  }
2912
- catch (e) {
3011
+ catch {
2913
3012
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Filter JSON must be valid JSON', { itemIndex: i });
2914
3013
  }
2915
3014
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditMalwareFilter', {
@@ -2930,7 +3029,7 @@ class Cipp {
2930
3029
  try {
2931
3030
  blockListData = JSON.parse(blockListJson);
2932
3031
  }
2933
- catch (e) {
3032
+ catch {
2934
3033
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Block List JSON must be valid JSON', { itemIndex: i });
2935
3034
  }
2936
3035
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddTenantAllowBlockList', {
@@ -2944,7 +3043,7 @@ class Cipp {
2944
3043
  try {
2945
3044
  blockListData = JSON.parse(blockListJson);
2946
3045
  }
2947
- catch (e) {
3046
+ catch {
2948
3047
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Block List JSON must be valid JSON', { itemIndex: i });
2949
3048
  }
2950
3049
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/RemoveTenantAllowBlockList', {
@@ -2980,7 +3079,7 @@ class Cipp {
2980
3079
  try {
2981
3080
  additionalData = JSON.parse(additionalJson);
2982
3081
  }
2983
- catch (e) {
3082
+ catch {
2984
3083
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Additional JSON must be valid JSON', { itemIndex: i });
2985
3084
  }
2986
3085
  }
@@ -2998,7 +3097,7 @@ class Cipp {
2998
3097
  try {
2999
3098
  roomData = JSON.parse(roomJson);
3000
3099
  }
3001
- catch (e) {
3100
+ catch {
3002
3101
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Room JSON must be valid JSON', { itemIndex: i });
3003
3102
  }
3004
3103
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditRoomMailbox', {
@@ -3030,7 +3129,7 @@ class Cipp {
3030
3129
  try {
3031
3130
  equipmentData = JSON.parse(equipmentJson);
3032
3131
  }
3033
- catch (e) {
3132
+ catch {
3034
3133
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Equipment JSON must be valid JSON', { itemIndex: i });
3035
3134
  }
3036
3135
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditEquipmentMailbox', {
@@ -3062,7 +3161,7 @@ class Cipp {
3062
3161
  try {
3063
3162
  roomListData = JSON.parse(roomListJson);
3064
3163
  }
3065
- catch (e) {
3164
+ catch {
3066
3165
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Room List JSON must be valid JSON', { itemIndex: i });
3067
3166
  }
3068
3167
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditRoomList', {
@@ -3108,7 +3207,7 @@ class Cipp {
3108
3207
  try {
3109
3208
  standardsData = JSON.parse(standardsJson);
3110
3209
  }
3111
- catch (e) {
3210
+ catch {
3112
3211
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Standards JSON must be valid JSON', { itemIndex: i });
3113
3212
  }
3114
3213
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddStandardsDeploy', {
@@ -3136,7 +3235,7 @@ class Cipp {
3136
3235
  try {
3137
3236
  templateData = JSON.parse(templateJson);
3138
3237
  }
3139
- catch (e) {
3238
+ catch {
3140
3239
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Template JSON must be valid JSON', { itemIndex: i });
3141
3240
  }
3142
3241
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddStandardsTemplate', {
@@ -3208,7 +3307,7 @@ class Cipp {
3208
3307
  try {
3209
3308
  driftData = JSON.parse(driftJson);
3210
3309
  }
3211
- catch (e) {
3310
+ catch {
3212
3311
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Drift JSON must be valid JSON', { itemIndex: i });
3213
3312
  }
3214
3313
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecDriftClone', {
@@ -3233,7 +3332,7 @@ class Cipp {
3233
3332
  try {
3234
3333
  scriptData = JSON.parse(scriptJson);
3235
3334
  }
3236
- catch (e) {
3335
+ catch {
3237
3336
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Script JSON must be valid JSON', { itemIndex: i });
3238
3337
  }
3239
3338
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/EditIntuneScript', {
@@ -3275,7 +3374,7 @@ class Cipp {
3275
3374
  try {
3276
3375
  filterData = JSON.parse(filterJson);
3277
3376
  }
3278
- catch (e) {
3377
+ catch {
3279
3378
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Filter JSON must be valid JSON', { itemIndex: i });
3280
3379
  }
3281
3380
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddAssignmentFilter', {
@@ -3296,7 +3395,7 @@ class Cipp {
3296
3395
  try {
3297
3396
  settingData = JSON.parse(settingJson);
3298
3397
  }
3299
- catch (e) {
3398
+ catch {
3300
3399
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Setting JSON must be valid JSON', { itemIndex: i });
3301
3400
  }
3302
3401
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddIntuneReusableSetting', {
@@ -3324,7 +3423,7 @@ class Cipp {
3324
3423
  try {
3325
3424
  appData = JSON.parse(appJson);
3326
3425
  }
3327
- catch (e) {
3426
+ catch {
3328
3427
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'App JSON must be valid JSON', { itemIndex: i });
3329
3428
  }
3330
3429
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddWin32ScriptApp', {
@@ -3388,7 +3487,7 @@ class Cipp {
3388
3487
  try {
3389
3488
  testData = JSON.parse(testJson);
3390
3489
  }
3391
- catch (e) {
3490
+ catch {
3392
3491
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Test JSON must be valid JSON', { itemIndex: i });
3393
3492
  }
3394
3493
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecTestRun', {
@@ -3409,7 +3508,7 @@ class Cipp {
3409
3508
  try {
3410
3509
  reportData = JSON.parse(reportJson);
3411
3510
  }
3412
- catch (e) {
3511
+ catch {
3413
3512
  throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Report JSON must be valid JSON', { itemIndex: i });
3414
3513
  }
3415
3514
  responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/AddTestReport', {
@@ -3442,4 +3541,4 @@ class Cipp {
3442
3541
  }
3443
3542
  }
3444
3543
  exports.Cipp = Cipp;
3445
- //# sourceMappingURL=Cipp.node.js.map
3544
+ //# sourceMappingURL=CippApp.node.js.map