@joshuanode/n8n-nodes-cipp 0.0.19 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nodes/Cipp/Cipp.node.d.ts.map +1 -1
- package/dist/nodes/Cipp/Cipp.node.js +206 -3
- package/dist/nodes/Cipp/Cipp.node.js.map +1 -1
- package/dist/nodes/Cipp/descriptions/ApplicationDescription.d.ts.map +1 -1
- package/dist/nodes/Cipp/descriptions/ApplicationDescription.js +86 -2
- package/dist/nodes/Cipp/descriptions/ApplicationDescription.js.map +1 -1
- package/dist/nodes/Cipp/descriptions/CippDescription.d.ts.map +1 -1
- package/dist/nodes/Cipp/descriptions/CippDescription.js +164 -4
- package/dist/nodes/Cipp/descriptions/CippDescription.js.map +1 -1
- package/dist/nodes/Cipp/descriptions/ConditionalAccessDescription.d.ts.map +1 -1
- package/dist/nodes/Cipp/descriptions/ConditionalAccessDescription.js +7 -0
- package/dist/nodes/Cipp/descriptions/ConditionalAccessDescription.js.map +1 -1
- package/dist/nodes/Cipp/descriptions/EmailSecurityDescription.d.ts.map +1 -1
- package/dist/nodes/Cipp/descriptions/EmailSecurityDescription.js +7 -0
- package/dist/nodes/Cipp/descriptions/EmailSecurityDescription.js.map +1 -1
- package/dist/nodes/Cipp/descriptions/IdentityDescription.d.ts.map +1 -1
- package/dist/nodes/Cipp/descriptions/IdentityDescription.js +140 -2
- package/dist/nodes/Cipp/descriptions/IdentityDescription.js.map +1 -1
- package/dist/nodes/Cipp/descriptions/MailboxDescription.d.ts.map +1 -1
- package/dist/nodes/Cipp/descriptions/MailboxDescription.js +106 -0
- package/dist/nodes/Cipp/descriptions/MailboxDescription.js.map +1 -1
- package/dist/nodes/Cipp/descriptions/UserDescription.d.ts.map +1 -1
- package/dist/nodes/Cipp/descriptions/UserDescription.js +99 -0
- package/dist/nodes/Cipp/descriptions/UserDescription.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cipp.node.d.ts","sourceRoot":"","sources":["../../../nodes/Cipp/Cipp.node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,qBAAqB,EACrB,wBAAwB,EAExB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"Cipp.node.d.ts","sourceRoot":"","sources":["../../../nodes/Cipp/Cipp.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,CAyK/B;IAEF,OAAO;;wCAGE,wBAAwB,cAClB,qBAAqB,GAC/B,OAAO,CAAC,yBAAyB,CAAC;;;+BAyD9B,qBAAqB,WAClB,MAAM,GACb,OAAO,CAAC,qBAAqB,CAAC;;MAqBjC;IAEI,OAAO,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC;CA6uHvE"}
|
|
@@ -289,6 +289,26 @@ class Cipp {
|
|
|
289
289
|
};
|
|
290
290
|
const hasPayloadContent = (payload) => Array.isArray(payload) ? payload.length > 0 : Object.keys(payload).length > 0;
|
|
291
291
|
const isTeamsScheduleEndpoint = (endpoint) => /^teams\/[^/]+\/schedule(?:\/.*)?$/i.test(endpoint);
|
|
292
|
+
const normalizeCippEndpoint = (endpoint) => {
|
|
293
|
+
const trimmed = endpoint.trim();
|
|
294
|
+
if (!trimmed) {
|
|
295
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Endpoint is required.');
|
|
296
|
+
}
|
|
297
|
+
const withoutOrigin = trimmed.replace(/^https?:\/\/[^/]+/i, '');
|
|
298
|
+
const withLeadingSlash = withoutOrigin.startsWith('/') ? withoutOrigin : `/${withoutOrigin}`;
|
|
299
|
+
return withLeadingSlash.toLowerCase().startsWith('/api/')
|
|
300
|
+
? withLeadingSlash
|
|
301
|
+
: `/api${withLeadingSlash}`;
|
|
302
|
+
};
|
|
303
|
+
const splitCsv = (value) => {
|
|
304
|
+
if (typeof value !== 'string' || value.trim() === '') {
|
|
305
|
+
return undefined;
|
|
306
|
+
}
|
|
307
|
+
return value
|
|
308
|
+
.split(',')
|
|
309
|
+
.map((entry) => entry.trim())
|
|
310
|
+
.filter(Boolean);
|
|
311
|
+
};
|
|
292
312
|
for (let i = 0; i < items.length; i++) {
|
|
293
313
|
try {
|
|
294
314
|
let responseData = {};
|
|
@@ -516,11 +536,22 @@ class Cipp {
|
|
|
516
536
|
else if (operation === 'offboard') {
|
|
517
537
|
const users = this.getNodeParameter('usersToOffboard', i);
|
|
518
538
|
const scheduled = this.getNodeParameter('scheduledOffboard', i);
|
|
519
|
-
|
|
539
|
+
const offboardOptions = this.getNodeParameter('offboardOptions', i, {});
|
|
540
|
+
const offboardBody = {
|
|
520
541
|
tenantFilter,
|
|
521
542
|
user: JSON.parse(users),
|
|
522
|
-
|
|
523
|
-
|
|
543
|
+
};
|
|
544
|
+
// Only include Scheduled when enabled — omitting it triggers immediate execution
|
|
545
|
+
if (scheduled) {
|
|
546
|
+
offboardBody.Scheduled = { enabled: true };
|
|
547
|
+
}
|
|
548
|
+
// Spread offboard options at the top level (CIPP expects them here, not on the user object)
|
|
549
|
+
for (const [key, value] of Object.entries(offboardOptions)) {
|
|
550
|
+
if (value !== undefined && value !== '' && value !== false) {
|
|
551
|
+
offboardBody[key] = value;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecOffboardUser', offboardBody, {});
|
|
524
555
|
}
|
|
525
556
|
else if (operation === 'listInactiveAccounts') {
|
|
526
557
|
const returnAll = this.getNodeParameter('returnAll', i);
|
|
@@ -772,6 +803,13 @@ class Cipp {
|
|
|
772
803
|
responseData = responseData.slice(0, this.getNodeParameter('limit', i));
|
|
773
804
|
}
|
|
774
805
|
}
|
|
806
|
+
else if (operation === 'listPolicyChanges') {
|
|
807
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
808
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListConditionalAccessPolicyChanges', {}, { tenantFilter });
|
|
809
|
+
if (Array.isArray(responseData) && !returnAll) {
|
|
810
|
+
responseData = responseData.slice(0, this.getNodeParameter('limit', i));
|
|
811
|
+
}
|
|
812
|
+
}
|
|
775
813
|
else if (operation === 'listTemplates') {
|
|
776
814
|
const returnAll = this.getNodeParameter('returnAll', i);
|
|
777
815
|
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListCAtemplates', {}, {});
|
|
@@ -1025,6 +1063,38 @@ class Cipp {
|
|
|
1025
1063
|
if (Array.isArray(responseData) && !returnAll) {
|
|
1026
1064
|
responseData = responseData.slice(0, this.getNodeParameter('limit', i));
|
|
1027
1065
|
}
|
|
1066
|
+
}
|
|
1067
|
+
else if (operation === 'listMessageTrace') {
|
|
1068
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1069
|
+
const filters = this.getNodeParameter('messageTraceFilters', i, {});
|
|
1070
|
+
const body = { tenantFilter };
|
|
1071
|
+
for (const key of [
|
|
1072
|
+
'dateFilter',
|
|
1073
|
+
'days',
|
|
1074
|
+
'endDate',
|
|
1075
|
+
'fromIP',
|
|
1076
|
+
'MessageId',
|
|
1077
|
+
'startDate',
|
|
1078
|
+
'toIP',
|
|
1079
|
+
'traceDetail',
|
|
1080
|
+
]) {
|
|
1081
|
+
if (filters[key] !== undefined && filters[key] !== '') {
|
|
1082
|
+
body[key] = filters[key];
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
const recipients = splitCsv(filters.recipient);
|
|
1086
|
+
const senders = splitCsv(filters.sender);
|
|
1087
|
+
const statuses = splitCsv(filters.status);
|
|
1088
|
+
if (recipients)
|
|
1089
|
+
body.recipient = recipients;
|
|
1090
|
+
if (senders)
|
|
1091
|
+
body.sender = senders;
|
|
1092
|
+
if (statuses)
|
|
1093
|
+
body.status = statuses;
|
|
1094
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ListMessageTrace', body, {});
|
|
1095
|
+
if (Array.isArray(responseData) && !returnAll) {
|
|
1096
|
+
responseData = responseData.slice(0, this.getNodeParameter('limit', i));
|
|
1097
|
+
}
|
|
1028
1098
|
// ---------- List operations (userId required) ----------
|
|
1029
1099
|
}
|
|
1030
1100
|
else if (operation === 'listMailboxDetails') {
|
|
@@ -1568,6 +1638,40 @@ class Cipp {
|
|
|
1568
1638
|
responseData = responseData.slice(0, limit);
|
|
1569
1639
|
}
|
|
1570
1640
|
}
|
|
1641
|
+
else if (operation === 'listDetectedApps') {
|
|
1642
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1643
|
+
const deviceId = this.getNodeParameter('detectedAppDeviceId', i, '');
|
|
1644
|
+
const includeDevices = this.getNodeParameter('detectedAppsIncludeDevices', i);
|
|
1645
|
+
const qs = { tenantFilter };
|
|
1646
|
+
if (deviceId)
|
|
1647
|
+
qs.DeviceID = deviceId;
|
|
1648
|
+
if (includeDevices)
|
|
1649
|
+
qs.includeDevices = 'true';
|
|
1650
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListDetectedApps', {}, qs);
|
|
1651
|
+
if (Array.isArray(responseData) && !returnAll) {
|
|
1652
|
+
const limit = this.getNodeParameter('limit', i);
|
|
1653
|
+
responseData = responseData.slice(0, limit);
|
|
1654
|
+
}
|
|
1655
|
+
}
|
|
1656
|
+
else if (operation === 'listDetectedAppDevices') {
|
|
1657
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
1658
|
+
const detectedAppId = this.getNodeParameter('detectedAppId', i);
|
|
1659
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListDetectedAppDevices', {}, { tenantFilter, id: detectedAppId });
|
|
1660
|
+
if (Array.isArray(responseData) && !returnAll) {
|
|
1661
|
+
const limit = this.getNodeParameter('limit', i);
|
|
1662
|
+
responseData = responseData.slice(0, limit);
|
|
1663
|
+
}
|
|
1664
|
+
}
|
|
1665
|
+
else if (operation === 'listAppRepository') {
|
|
1666
|
+
const search = this.getNodeParameter('appRepositorySearch', i, '');
|
|
1667
|
+
const repository = this.getNodeParameter('appRepositoryName', i, '');
|
|
1668
|
+
const body = { tenantFilter };
|
|
1669
|
+
if (search)
|
|
1670
|
+
body.Search = search;
|
|
1671
|
+
if (repository)
|
|
1672
|
+
body.Repository = repository;
|
|
1673
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ListAppsRepository', body, {});
|
|
1674
|
+
}
|
|
1571
1675
|
else if (operation === 'assign') {
|
|
1572
1676
|
const appId = this.getNodeParameter('appId', i);
|
|
1573
1677
|
const assignTo = this.getNodeParameter('assignTo', i);
|
|
@@ -2012,6 +2116,42 @@ class Cipp {
|
|
|
2012
2116
|
const tenantFilter = getTenantFilter();
|
|
2013
2117
|
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ExecBreachSearch', {}, { tenantFilter });
|
|
2014
2118
|
}
|
|
2119
|
+
else if (operation === 'getVersion') {
|
|
2120
|
+
const localVersion = this.getNodeParameter('localVersion', i, '');
|
|
2121
|
+
const qs = {};
|
|
2122
|
+
if (localVersion)
|
|
2123
|
+
qs.LocalVersion = localVersion;
|
|
2124
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/GetVersion', {}, qs);
|
|
2125
|
+
}
|
|
2126
|
+
else if (operation === 'cippApiRequest') {
|
|
2127
|
+
const method = this.getNodeParameter('cippApiMethod', i);
|
|
2128
|
+
const endpoint = normalizeCippEndpoint(this.getNodeParameter('cippApiEndpoint', i));
|
|
2129
|
+
const includeTenant = this.getNodeParameter('cippApiIncludeTenant', i);
|
|
2130
|
+
const query = parseJsonObjectPayload(this.getNodeParameter('cippApiQueryJson', i, '{}'), 'Query Parameters', i);
|
|
2131
|
+
const body = method === 'GET'
|
|
2132
|
+
? {}
|
|
2133
|
+
: parseJsonObjectPayload(this.getNodeParameter('cippApiBodyJson', i, '{}'), 'Body', i);
|
|
2134
|
+
if (includeTenant) {
|
|
2135
|
+
const tenantFilterValue = this.getNodeParameter('cippApiTenantFilter', i);
|
|
2136
|
+
const tenantFilter = (0, GenericFunctions_1.getResourceLocatorValue)(tenantFilterValue);
|
|
2137
|
+
if (!query.tenantFilter) {
|
|
2138
|
+
query.tenantFilter = tenantFilter;
|
|
2139
|
+
}
|
|
2140
|
+
if (!body.tenantFilter) {
|
|
2141
|
+
body.tenantFilter = tenantFilter;
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
const options = this.getNodeParameter('cippApiOptions', i, {});
|
|
2145
|
+
const maxPayloadBytes = Number(options.maxPayloadBytes ?? 262144);
|
|
2146
|
+
if (!Number.isFinite(maxPayloadBytes) || maxPayloadBytes <= 0) {
|
|
2147
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Max Payload Bytes must be a positive number.', { itemIndex: i });
|
|
2148
|
+
}
|
|
2149
|
+
const payloadBytes = new TextEncoder().encode(JSON.stringify(body)).length;
|
|
2150
|
+
if (payloadBytes > maxPayloadBytes) {
|
|
2151
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Payload is ${payloadBytes} bytes, which exceeds Max Payload Bytes (${maxPayloadBytes}).`, { itemIndex: i });
|
|
2152
|
+
}
|
|
2153
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, method, endpoint, body, query);
|
|
2154
|
+
}
|
|
2015
2155
|
else if (operation === 'graphRequest') {
|
|
2016
2156
|
const tenantFilter = getTenantFilter();
|
|
2017
2157
|
const endpoint = this.getNodeParameter('graphEndpoint', i);
|
|
@@ -2352,6 +2492,41 @@ class Cipp {
|
|
|
2352
2492
|
responseData = responseData.slice(0, limit);
|
|
2353
2493
|
}
|
|
2354
2494
|
}
|
|
2495
|
+
else if (operation === 'listAppConsentRequests') {
|
|
2496
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
2497
|
+
const requestStatus = this.getNodeParameter('appConsentRequestStatus', i, '');
|
|
2498
|
+
const filter = this.getNodeParameter('appConsentFilter', i, '');
|
|
2499
|
+
const qs = { tenantFilter };
|
|
2500
|
+
if (requestStatus)
|
|
2501
|
+
qs.RequestStatus = requestStatus;
|
|
2502
|
+
if (filter)
|
|
2503
|
+
qs.Filter = filter;
|
|
2504
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListAppConsentRequests', {}, qs);
|
|
2505
|
+
if (Array.isArray(responseData) && !returnAll) {
|
|
2506
|
+
const limit = this.getNodeParameter('limit', i);
|
|
2507
|
+
responseData = responseData.slice(0, limit);
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
else if (operation === 'listAzureAdConnectStatus') {
|
|
2511
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
2512
|
+
const dataToReturn = this.getNodeParameter('aadConnectDataToReturn', i, '');
|
|
2513
|
+
const qs = { tenantFilter };
|
|
2514
|
+
if (dataToReturn)
|
|
2515
|
+
qs.DataToReturn = dataToReturn;
|
|
2516
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListAzureADConnectStatus', {}, qs);
|
|
2517
|
+
if (Array.isArray(responseData) && !returnAll) {
|
|
2518
|
+
const limit = this.getNodeParameter('limit', i);
|
|
2519
|
+
responseData = responseData.slice(0, limit);
|
|
2520
|
+
}
|
|
2521
|
+
}
|
|
2522
|
+
else if (operation === 'listBasicAuth') {
|
|
2523
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
2524
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListBasicAuth', {}, { tenantFilter });
|
|
2525
|
+
if (Array.isArray(responseData) && !returnAll) {
|
|
2526
|
+
const limit = this.getNodeParameter('limit', i);
|
|
2527
|
+
responseData = responseData.slice(0, limit);
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2355
2530
|
else if (operation === 'listDeletedItems') {
|
|
2356
2531
|
const returnAll = this.getNodeParameter('returnAll', i);
|
|
2357
2532
|
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListDeletedItems', {}, { tenantFilter });
|
|
@@ -2360,6 +2535,14 @@ class Cipp {
|
|
|
2360
2535
|
responseData = responseData.slice(0, limit);
|
|
2361
2536
|
}
|
|
2362
2537
|
}
|
|
2538
|
+
else if (operation === 'listDomains') {
|
|
2539
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
2540
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListDomains', {}, { tenantFilter });
|
|
2541
|
+
if (Array.isArray(responseData) && !returnAll) {
|
|
2542
|
+
const limit = this.getNodeParameter('limit', i);
|
|
2543
|
+
responseData = responseData.slice(0, limit);
|
|
2544
|
+
}
|
|
2545
|
+
}
|
|
2363
2546
|
else if (operation === 'listRoles') {
|
|
2364
2547
|
const returnAll = this.getNodeParameter('returnAll', i);
|
|
2365
2548
|
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListRoles', {}, { tenantFilter });
|
|
@@ -2375,6 +2558,19 @@ class Cipp {
|
|
|
2375
2558
|
ID: objectId,
|
|
2376
2559
|
}, {});
|
|
2377
2560
|
}
|
|
2561
|
+
else if (operation === 'setCloudManaged') {
|
|
2562
|
+
const objectId = this.getNodeParameter('cloudManagedObjectId', i);
|
|
2563
|
+
const displayName = this.getNodeParameter('cloudManagedDisplayName', i, '');
|
|
2564
|
+
const type = this.getNodeParameter('cloudManagedType', i);
|
|
2565
|
+
const isCloudManaged = this.getNodeParameter('isCloudManaged', i);
|
|
2566
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'POST', '/api/ExecSetCloudManaged', {
|
|
2567
|
+
tenantFilter,
|
|
2568
|
+
displayName,
|
|
2569
|
+
ID: objectId,
|
|
2570
|
+
isCloudManaged: String(isCloudManaged),
|
|
2571
|
+
type,
|
|
2572
|
+
}, {});
|
|
2573
|
+
}
|
|
2378
2574
|
}
|
|
2379
2575
|
// ==================== POLICY ====================
|
|
2380
2576
|
else if (resource === 'policy') {
|
|
@@ -2454,6 +2650,13 @@ class Cipp {
|
|
|
2454
2650
|
responseData = responseData.slice(0, this.getNodeParameter('limit', i));
|
|
2455
2651
|
}
|
|
2456
2652
|
}
|
|
2653
|
+
else if (operation === 'listSpamFilterTemplates') {
|
|
2654
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
2655
|
+
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListSpamFilterTemplates', {}, { tenantFilter });
|
|
2656
|
+
if (Array.isArray(responseData) && !returnAll) {
|
|
2657
|
+
responseData = responseData.slice(0, this.getNodeParameter('limit', i));
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2457
2660
|
else if (operation === 'addSpamFilter') {
|
|
2458
2661
|
const policyJson = this.getNodeParameter('esSpamFilterJson', i);
|
|
2459
2662
|
let policyData;
|