@joshuanode/n8n-nodes-cipp 0.0.21 → 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 +192 -0
- 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/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 = {};
|
|
@@ -783,6 +803,13 @@ class Cipp {
|
|
|
783
803
|
responseData = responseData.slice(0, this.getNodeParameter('limit', i));
|
|
784
804
|
}
|
|
785
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
|
+
}
|
|
786
813
|
else if (operation === 'listTemplates') {
|
|
787
814
|
const returnAll = this.getNodeParameter('returnAll', i);
|
|
788
815
|
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListCAtemplates', {}, {});
|
|
@@ -1036,6 +1063,38 @@ class Cipp {
|
|
|
1036
1063
|
if (Array.isArray(responseData) && !returnAll) {
|
|
1037
1064
|
responseData = responseData.slice(0, this.getNodeParameter('limit', i));
|
|
1038
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
|
+
}
|
|
1039
1098
|
// ---------- List operations (userId required) ----------
|
|
1040
1099
|
}
|
|
1041
1100
|
else if (operation === 'listMailboxDetails') {
|
|
@@ -1579,6 +1638,40 @@ class Cipp {
|
|
|
1579
1638
|
responseData = responseData.slice(0, limit);
|
|
1580
1639
|
}
|
|
1581
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
|
+
}
|
|
1582
1675
|
else if (operation === 'assign') {
|
|
1583
1676
|
const appId = this.getNodeParameter('appId', i);
|
|
1584
1677
|
const assignTo = this.getNodeParameter('assignTo', i);
|
|
@@ -2023,6 +2116,42 @@ class Cipp {
|
|
|
2023
2116
|
const tenantFilter = getTenantFilter();
|
|
2024
2117
|
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ExecBreachSearch', {}, { tenantFilter });
|
|
2025
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
|
+
}
|
|
2026
2155
|
else if (operation === 'graphRequest') {
|
|
2027
2156
|
const tenantFilter = getTenantFilter();
|
|
2028
2157
|
const endpoint = this.getNodeParameter('graphEndpoint', i);
|
|
@@ -2363,6 +2492,41 @@ class Cipp {
|
|
|
2363
2492
|
responseData = responseData.slice(0, limit);
|
|
2364
2493
|
}
|
|
2365
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
|
+
}
|
|
2366
2530
|
else if (operation === 'listDeletedItems') {
|
|
2367
2531
|
const returnAll = this.getNodeParameter('returnAll', i);
|
|
2368
2532
|
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListDeletedItems', {}, { tenantFilter });
|
|
@@ -2371,6 +2535,14 @@ class Cipp {
|
|
|
2371
2535
|
responseData = responseData.slice(0, limit);
|
|
2372
2536
|
}
|
|
2373
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
|
+
}
|
|
2374
2546
|
else if (operation === 'listRoles') {
|
|
2375
2547
|
const returnAll = this.getNodeParameter('returnAll', i);
|
|
2376
2548
|
responseData = await GenericFunctions_1.cippApiRequest.call(this, 'GET', '/api/ListRoles', {}, { tenantFilter });
|
|
@@ -2386,6 +2558,19 @@ class Cipp {
|
|
|
2386
2558
|
ID: objectId,
|
|
2387
2559
|
}, {});
|
|
2388
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
|
+
}
|
|
2389
2574
|
}
|
|
2390
2575
|
// ==================== POLICY ====================
|
|
2391
2576
|
else if (resource === 'policy') {
|
|
@@ -2465,6 +2650,13 @@ class Cipp {
|
|
|
2465
2650
|
responseData = responseData.slice(0, this.getNodeParameter('limit', i));
|
|
2466
2651
|
}
|
|
2467
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
|
+
}
|
|
2468
2660
|
else if (operation === 'addSpamFilter') {
|
|
2469
2661
|
const policyJson = this.getNodeParameter('esSpamFilterJson', i);
|
|
2470
2662
|
let policyData;
|