@zivego/n8n-nodes-dfir-iris 3.0.0
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/LICENSE.md +19 -0
- package/README.md +75 -0
- package/dist/credentials/DfirIrisApi.credentials.js +90 -0
- package/dist/credentials/icons/iris.svg +6 -0
- package/dist/nodes/DfirIris/DfirIris.node.js +25 -0
- package/dist/nodes/DfirIris/DfirIris.node.json +18 -0
- package/dist/nodes/DfirIris/iris.svg +6 -0
- package/dist/nodes/DfirIris/v1/DfirIrisV1.node.js +22 -0
- package/dist/nodes/DfirIris/v1/actions/alert/Alert.resource.js +78 -0
- package/dist/nodes/DfirIris/v1/actions/alert/batchDelete.operation.js +82 -0
- package/dist/nodes/DfirIris/v1/actions/alert/batchUpdate.operation.js +129 -0
- package/dist/nodes/DfirIris/v1/actions/alert/commonDescription.js +537 -0
- package/dist/nodes/DfirIris/v1/actions/alert/countAlerts.operation.js +139 -0
- package/dist/nodes/DfirIris/v1/actions/alert/create.operation.js +160 -0
- package/dist/nodes/DfirIris/v1/actions/alert/deleteAlert.operation.js +72 -0
- package/dist/nodes/DfirIris/v1/actions/alert/escalate.operation.js +150 -0
- package/dist/nodes/DfirIris/v1/actions/alert/filterAlerts.operation.js +171 -0
- package/dist/nodes/DfirIris/v1/actions/alert/get.operation.js +107 -0
- package/dist/nodes/DfirIris/v1/actions/alert/getRelations.operation.js +118 -0
- package/dist/nodes/DfirIris/v1/actions/alert/merge.operation.js +141 -0
- package/dist/nodes/DfirIris/v1/actions/alert/unmerge.operation.js +100 -0
- package/dist/nodes/DfirIris/v1/actions/alert/update.operation.js +212 -0
- package/dist/nodes/DfirIris/v1/actions/apiRequest/ApiRequest.resource.js +313 -0
- package/dist/nodes/DfirIris/v1/actions/asset/Asset.resource.js +57 -0
- package/dist/nodes/DfirIris/v1/actions/asset/commonDescription.js +101 -0
- package/dist/nodes/DfirIris/v1/actions/asset/create.operation.js +130 -0
- package/dist/nodes/DfirIris/v1/actions/asset/deleteAsset.operation.js +79 -0
- package/dist/nodes/DfirIris/v1/actions/asset/get.operation.js +83 -0
- package/dist/nodes/DfirIris/v1/actions/asset/getAll.operation.js +72 -0
- package/dist/nodes/DfirIris/v1/actions/asset/update.operation.js +107 -0
- package/dist/nodes/DfirIris/v1/actions/case/Case.resource.js +69 -0
- package/dist/nodes/DfirIris/v1/actions/case/addTaskLog.operation.js +60 -0
- package/dist/nodes/DfirIris/v1/actions/case/commonDescription.js +314 -0
- package/dist/nodes/DfirIris/v1/actions/case/countCases.operation.js +145 -0
- package/dist/nodes/DfirIris/v1/actions/case/create.operation.js +125 -0
- package/dist/nodes/DfirIris/v1/actions/case/deleteCase.operation.js +76 -0
- package/dist/nodes/DfirIris/v1/actions/case/exportCase.operation.js +56 -0
- package/dist/nodes/DfirIris/v1/actions/case/filterCases.operation.js +187 -0
- package/dist/nodes/DfirIris/v1/actions/case/getSummary.operation.js +81 -0
- package/dist/nodes/DfirIris/v1/actions/case/update.operation.js +123 -0
- package/dist/nodes/DfirIris/v1/actions/case/updateSummary.operation.js +79 -0
- package/dist/nodes/DfirIris/v1/actions/comment/Comment.resource.js +53 -0
- package/dist/nodes/DfirIris/v1/actions/comment/commonDescription.js +42 -0
- package/dist/nodes/DfirIris/v1/actions/comment/create.operation.js +89 -0
- package/dist/nodes/DfirIris/v1/actions/comment/deleteComment.operation.js +77 -0
- package/dist/nodes/DfirIris/v1/actions/comment/getAll.operation.js +86 -0
- package/dist/nodes/DfirIris/v1/actions/comment/update.operation.js +91 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFile/DatastoreFile.resource.js +60 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFile/commonDescription.js +11 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFile/deleteFile.operation.js +75 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFile/downloadFile.operation.js +108 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFile/getFileInfo.operation.js +74 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFile/moveFile.operation.js +87 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFile/updateFileInfo.operation.js +162 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFile/uploadFile.operation.js +126 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFolder/DatastoreFolder.resource.js +57 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFolder/addFolder.operation.js +61 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFolder/commonDescription.js +11 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFolder/deleteFolder.operation.js +51 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFolder/getTree.operation.js +69 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFolder/moveFolder.operation.js +73 -0
- package/dist/nodes/DfirIris/v1/actions/datastoreFolder/renameFolder.operation.js +44 -0
- package/dist/nodes/DfirIris/v1/actions/evidence/Evidence.resource.js +57 -0
- package/dist/nodes/DfirIris/v1/actions/evidence/commonDescription.js +65 -0
- package/dist/nodes/DfirIris/v1/actions/evidence/createEvidence.operation.js +148 -0
- package/dist/nodes/DfirIris/v1/actions/evidence/deleteEvidence.operation.js +73 -0
- package/dist/nodes/DfirIris/v1/actions/evidence/getEvidence.operation.js +75 -0
- package/dist/nodes/DfirIris/v1/actions/evidence/listEvidences.operation.js +42 -0
- package/dist/nodes/DfirIris/v1/actions/evidence/updateEvidence.operation.js +149 -0
- package/dist/nodes/DfirIris/v1/actions/ioc/IOC.resource.js +57 -0
- package/dist/nodes/DfirIris/v1/actions/ioc/commonDescription.js +54 -0
- package/dist/nodes/DfirIris/v1/actions/ioc/create.operation.js +120 -0
- package/dist/nodes/DfirIris/v1/actions/ioc/deleteIOC.operation.js +79 -0
- package/dist/nodes/DfirIris/v1/actions/ioc/get.operation.js +83 -0
- package/dist/nodes/DfirIris/v1/actions/ioc/getAll.operation.js +52 -0
- package/dist/nodes/DfirIris/v1/actions/ioc/update.operation.js +100 -0
- package/dist/nodes/DfirIris/v1/actions/manage/Manage.resource.js +71 -0
- package/dist/nodes/DfirIris/v1/actions/manage/getAssetTypes.operation.js +48 -0
- package/dist/nodes/DfirIris/v1/actions/manage/getCaseClassifications.operation.js +46 -0
- package/dist/nodes/DfirIris/v1/actions/manage/getCaseCustomers.operation.js +47 -0
- package/dist/nodes/DfirIris/v1/actions/manage/getCaseStates.operation.js +45 -0
- package/dist/nodes/DfirIris/v1/actions/manage/getCaseTemplates.operation.js +51 -0
- package/dist/nodes/DfirIris/v1/actions/manage/getEvidenceTypes.operation.js +45 -0
- package/dist/nodes/DfirIris/v1/actions/manage/getIOCTypes.operation.js +47 -0
- package/dist/nodes/DfirIris/v1/actions/manage/getSeverities.operation.js +44 -0
- package/dist/nodes/DfirIris/v1/actions/manage/getTaskStatuses.operation.js +45 -0
- package/dist/nodes/DfirIris/v1/actions/manage/getUsers.operation.js +48 -0
- package/dist/nodes/DfirIris/v1/actions/module/Module.resource.js +50 -0
- package/dist/nodes/DfirIris/v1/actions/module/callModule.operation.js +73 -0
- package/dist/nodes/DfirIris/v1/actions/module/commonDescription.js +117 -0
- package/dist/nodes/DfirIris/v1/actions/module/listHooks.operation.js +75 -0
- package/dist/nodes/DfirIris/v1/actions/module/listTasks.operation.js +44 -0
- package/dist/nodes/DfirIris/v1/actions/node.type.js +3 -0
- package/dist/nodes/DfirIris/v1/actions/note/Note.resource.js +57 -0
- package/dist/nodes/DfirIris/v1/actions/note/create.operation.js +86 -0
- package/dist/nodes/DfirIris/v1/actions/note/deleteNote.operation.js +49 -0
- package/dist/nodes/DfirIris/v1/actions/note/get.operation.js +65 -0
- package/dist/nodes/DfirIris/v1/actions/note/search.operation.js +48 -0
- package/dist/nodes/DfirIris/v1/actions/note/update.operation.js +110 -0
- package/dist/nodes/DfirIris/v1/actions/noteDirectory/NoteDirectory.resource.js +54 -0
- package/dist/nodes/DfirIris/v1/actions/noteDirectory/create.operation.js +69 -0
- package/dist/nodes/DfirIris/v1/actions/noteDirectory/deleteNoteDirectory.operation.js +49 -0
- package/dist/nodes/DfirIris/v1/actions/noteDirectory/getAll.operation.js +39 -0
- package/dist/nodes/DfirIris/v1/actions/noteDirectory/update.operation.js +79 -0
- package/dist/nodes/DfirIris/v1/actions/router.js +138 -0
- package/dist/nodes/DfirIris/v1/actions/task/Task.resource.js +57 -0
- package/dist/nodes/DfirIris/v1/actions/task/create.operation.js +148 -0
- package/dist/nodes/DfirIris/v1/actions/task/deleteTask.operation.js +56 -0
- package/dist/nodes/DfirIris/v1/actions/task/get.operation.js +78 -0
- package/dist/nodes/DfirIris/v1/actions/task/getAll.operation.js +70 -0
- package/dist/nodes/DfirIris/v1/actions/task/update.operation.js +161 -0
- package/dist/nodes/DfirIris/v1/actions/timeline/Timeline.resource.js +63 -0
- package/dist/nodes/DfirIris/v1/actions/timeline/addEvent.operation.js +122 -0
- package/dist/nodes/DfirIris/v1/actions/timeline/commonDescription.js +211 -0
- package/dist/nodes/DfirIris/v1/actions/timeline/deleteEvent.operation.js +59 -0
- package/dist/nodes/DfirIris/v1/actions/timeline/fetchEvent.operation.js +103 -0
- package/dist/nodes/DfirIris/v1/actions/timeline/flagEvent.operation.js +103 -0
- package/dist/nodes/DfirIris/v1/actions/timeline/getTimelineState.operation.js +38 -0
- package/dist/nodes/DfirIris/v1/actions/timeline/queryTimeline.operation.js +187 -0
- package/dist/nodes/DfirIris/v1/actions/timeline/updateEvent.operation.js +123 -0
- package/dist/nodes/DfirIris/v1/actions/versionDescription.js +93 -0
- package/dist/nodes/DfirIris/v1/compatibility/compatibility.manifest.json +198 -0
- package/dist/nodes/DfirIris/v1/compatibility/index.js +143 -0
- package/dist/nodes/DfirIris/v1/helpers/index.js +39 -0
- package/dist/nodes/DfirIris/v1/helpers/types.js +271 -0
- package/dist/nodes/DfirIris/v1/helpers/utils.js +251 -0
- package/dist/nodes/DfirIris/v1/methods/index.js +38 -0
- package/dist/nodes/DfirIris/v1/methods/loadOptions.js +544 -0
- package/dist/nodes/DfirIris/v1/transport/index.js +251 -0
- package/dist/package.json +74 -0
- package/package.json +74 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.apiRequest = apiRequest;
|
|
4
|
+
exports.getCredentialApiMode = getCredentialApiMode;
|
|
5
|
+
exports.apiRequestAll = apiRequestAll;
|
|
6
|
+
exports.apiRequestAllNext = apiRequestAllNext;
|
|
7
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
8
|
+
const compatibility_1 = require("../compatibility");
|
|
9
|
+
const utils_1 = require("../helpers/utils");
|
|
10
|
+
function isPlainObject(value) {
|
|
11
|
+
return (typeof value === 'object' &&
|
|
12
|
+
value !== null &&
|
|
13
|
+
!Array.isArray(value) &&
|
|
14
|
+
!(value instanceof FormData) &&
|
|
15
|
+
!(value instanceof Buffer) &&
|
|
16
|
+
!(value instanceof ArrayBuffer) &&
|
|
17
|
+
!(value instanceof Uint8Array) &&
|
|
18
|
+
!(value instanceof Blob));
|
|
19
|
+
}
|
|
20
|
+
function hasRequestBody(body, isFormData) {
|
|
21
|
+
if (body === undefined) {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
if (body === null) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
if (isFormData) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
if (typeof body === 'string') {
|
|
31
|
+
return body.length > 0;
|
|
32
|
+
}
|
|
33
|
+
if (typeof body === 'number' ||
|
|
34
|
+
typeof body === 'boolean' ||
|
|
35
|
+
body instanceof Buffer ||
|
|
36
|
+
body instanceof ArrayBuffer ||
|
|
37
|
+
body instanceof Uint8Array ||
|
|
38
|
+
body instanceof Blob) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
if (Array.isArray(body)) {
|
|
42
|
+
return body.length > 0;
|
|
43
|
+
}
|
|
44
|
+
if (isPlainObject(body)) {
|
|
45
|
+
return Object.keys(body).length > 0;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
function normalizeEndpoint(endpoint) {
|
|
50
|
+
return endpoint.replace(/^\/+/, '');
|
|
51
|
+
}
|
|
52
|
+
function extractNextPaginatedPayload(responseData) {
|
|
53
|
+
if (!responseData || typeof responseData !== 'object' || Array.isArray(responseData)) {
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
56
|
+
const rootPayload = responseData;
|
|
57
|
+
if (Array.isArray(rootPayload.data)) {
|
|
58
|
+
return rootPayload;
|
|
59
|
+
}
|
|
60
|
+
if ('data' in rootPayload &&
|
|
61
|
+
rootPayload.data &&
|
|
62
|
+
typeof rootPayload.data === 'object' &&
|
|
63
|
+
!Array.isArray(rootPayload.data)) {
|
|
64
|
+
return rootPayload.data;
|
|
65
|
+
}
|
|
66
|
+
return {};
|
|
67
|
+
}
|
|
68
|
+
function getConnectionSettings(credentials) {
|
|
69
|
+
const baseUrl = `${credentials.isHttp ? 'http' : 'https'}://${credentials.host}`;
|
|
70
|
+
const skipSslCertificateValidation = credentials.isHttp
|
|
71
|
+
? true
|
|
72
|
+
: Boolean(credentials.allowUnauthorizedCerts);
|
|
73
|
+
return {
|
|
74
|
+
apiMode: (0, compatibility_1.resolveApiMode)(credentials.apiMode),
|
|
75
|
+
baseUrl,
|
|
76
|
+
skipSslCertificateValidation,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function buildRequestOptions(method, baseUrl, endpoint, body, query = {}, option = {}, isFormData = false, skipSslCertificateValidation) {
|
|
80
|
+
let options = {
|
|
81
|
+
method,
|
|
82
|
+
url: `${baseUrl}/${normalizeEndpoint(endpoint)}`,
|
|
83
|
+
qs: query,
|
|
84
|
+
body: body,
|
|
85
|
+
returnFullResponse: false,
|
|
86
|
+
json: true,
|
|
87
|
+
headers: { 'content-type': 'application/json' },
|
|
88
|
+
skipSslCertificateValidation,
|
|
89
|
+
ignoreHttpStatusErrors: false,
|
|
90
|
+
};
|
|
91
|
+
if (isFormData) {
|
|
92
|
+
options.json = false;
|
|
93
|
+
delete options.headers;
|
|
94
|
+
}
|
|
95
|
+
if (Object.keys(option).length > 0) {
|
|
96
|
+
options = Object.assign({}, options, option);
|
|
97
|
+
}
|
|
98
|
+
if (!hasRequestBody(body, isFormData)) {
|
|
99
|
+
delete options.body;
|
|
100
|
+
}
|
|
101
|
+
if (!query || Object.keys(query).length === 0) {
|
|
102
|
+
delete options.qs;
|
|
103
|
+
}
|
|
104
|
+
if (isFormData) {
|
|
105
|
+
delete options.headers;
|
|
106
|
+
}
|
|
107
|
+
Object.assign(options, {
|
|
108
|
+
rejectUnauthorized: !skipSslCertificateValidation,
|
|
109
|
+
});
|
|
110
|
+
return options;
|
|
111
|
+
}
|
|
112
|
+
async function apiRequest(method, endpoint, body, query, option = {}, isFormData = false) {
|
|
113
|
+
const credentials = await this.getCredentials('dfirIrisApi');
|
|
114
|
+
(0, utils_1.enableDebug)(credentials === null || credentials === void 0 ? void 0 : credentials.enableDebug);
|
|
115
|
+
const irisLogger = new utils_1.IrisLog(this.logger);
|
|
116
|
+
const { baseUrl, skipSslCertificateValidation } = getConnectionSettings(credentials);
|
|
117
|
+
const options = buildRequestOptions(method, baseUrl, endpoint, body, query || {}, option, isFormData, skipSslCertificateValidation);
|
|
118
|
+
try {
|
|
119
|
+
irisLogger.info('options', { options });
|
|
120
|
+
return await this.helpers.httpRequestWithAuthentication.call(this, 'dfirIrisApi', options);
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
async function getCredentialApiMode() {
|
|
127
|
+
const credentials = await this.getCredentials('dfirIrisApi');
|
|
128
|
+
return (0, compatibility_1.resolveApiMode)(credentials === null || credentials === void 0 ? void 0 : credentials.apiMode);
|
|
129
|
+
}
|
|
130
|
+
async function apiRequestAll(method, endpoint, body = {}, query, max_items = 0, start_page = 1, propKey) {
|
|
131
|
+
const credentials = await this.getCredentials('dfirIrisApi');
|
|
132
|
+
(0, utils_1.enableDebug)(credentials === null || credentials === void 0 ? void 0 : credentials.enableDebug);
|
|
133
|
+
const { baseUrl, skipSslCertificateValidation } = getConnectionSettings(credentials);
|
|
134
|
+
const headers = { 'content-type': 'application/json; charset=utf-8' };
|
|
135
|
+
const irisLogger = new utils_1.IrisLog(this.logger);
|
|
136
|
+
query = query || {};
|
|
137
|
+
let returnData = [];
|
|
138
|
+
let responseData;
|
|
139
|
+
let proceed = true;
|
|
140
|
+
query.page = start_page;
|
|
141
|
+
query.per_page = max_items > 0 && max_items < 100 ? max_items : 100;
|
|
142
|
+
if (start_page > 1) {
|
|
143
|
+
query.page = Math.floor((start_page * max_items) / query.per_page);
|
|
144
|
+
}
|
|
145
|
+
const options = {
|
|
146
|
+
headers: headers,
|
|
147
|
+
method,
|
|
148
|
+
url: `${baseUrl}/${endpoint}`,
|
|
149
|
+
body,
|
|
150
|
+
qs: query,
|
|
151
|
+
json: true,
|
|
152
|
+
skipSslCertificateValidation,
|
|
153
|
+
ignoreHttpStatusErrors: true,
|
|
154
|
+
};
|
|
155
|
+
Object.assign(options, {
|
|
156
|
+
rejectUnauthorized: !skipSslCertificateValidation,
|
|
157
|
+
});
|
|
158
|
+
irisLogger.info('req options: ', { options });
|
|
159
|
+
do {
|
|
160
|
+
try {
|
|
161
|
+
responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'dfirIrisApi', options);
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
165
|
+
}
|
|
166
|
+
irisLogger.info('responseData', { responseData });
|
|
167
|
+
irisLogger.info('current_page: ', responseData.data.current_page);
|
|
168
|
+
irisLogger.info('next_page: ', responseData.data.next_page);
|
|
169
|
+
irisLogger.info('last_page: ', responseData.data.last_page);
|
|
170
|
+
irisLogger.info('total: ', responseData.data.total);
|
|
171
|
+
returnData.push(...responseData.data[propKey]);
|
|
172
|
+
irisLogger.info(`max_items: ${max_items}`);
|
|
173
|
+
irisLogger.info(`returnData.length: ${returnData.length}`);
|
|
174
|
+
if (max_items > 0 && returnData.length >= max_items) {
|
|
175
|
+
proceed = false;
|
|
176
|
+
}
|
|
177
|
+
else if (!responseData.data.next_page ||
|
|
178
|
+
responseData.data.next_page === 'null' ||
|
|
179
|
+
responseData.data.next_page === null) {
|
|
180
|
+
proceed = false;
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
if (options.qs && typeof options.qs === 'object') {
|
|
184
|
+
options.qs.page = responseData.data.next_page;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
} while (proceed);
|
|
188
|
+
if (max_items > 0)
|
|
189
|
+
returnData = returnData.slice(0, max_items);
|
|
190
|
+
responseData.data[propKey] = returnData;
|
|
191
|
+
return responseData;
|
|
192
|
+
}
|
|
193
|
+
async function apiRequestAllNext(method, endpoint, body = {}, query = {}, maxItems = 0, startPage = 1) {
|
|
194
|
+
const credentials = await this.getCredentials('dfirIrisApi');
|
|
195
|
+
(0, utils_1.enableDebug)(credentials === null || credentials === void 0 ? void 0 : credentials.enableDebug);
|
|
196
|
+
const { baseUrl, skipSslCertificateValidation } = getConnectionSettings(credentials);
|
|
197
|
+
const headers = { 'content-type': 'application/json; charset=utf-8' };
|
|
198
|
+
const irisLogger = new utils_1.IrisLog(this.logger);
|
|
199
|
+
const returnData = [];
|
|
200
|
+
const perPage = maxItems > 0 && maxItems < 100 ? maxItems : 100;
|
|
201
|
+
const isGetLikeRequest = method === 'GET' || method === 'HEAD';
|
|
202
|
+
let currentPage = startPage;
|
|
203
|
+
let lastPage = startPage;
|
|
204
|
+
let total = 0;
|
|
205
|
+
do {
|
|
206
|
+
const options = {
|
|
207
|
+
headers,
|
|
208
|
+
method,
|
|
209
|
+
url: `${baseUrl}/${normalizeEndpoint(endpoint)}`,
|
|
210
|
+
body: isGetLikeRequest ? undefined : body,
|
|
211
|
+
qs: {
|
|
212
|
+
...(isGetLikeRequest ? body : {}),
|
|
213
|
+
...query,
|
|
214
|
+
page: currentPage,
|
|
215
|
+
per_page: perPage,
|
|
216
|
+
},
|
|
217
|
+
json: true,
|
|
218
|
+
skipSslCertificateValidation,
|
|
219
|
+
ignoreHttpStatusErrors: true,
|
|
220
|
+
};
|
|
221
|
+
Object.assign(options, {
|
|
222
|
+
rejectUnauthorized: !skipSslCertificateValidation,
|
|
223
|
+
});
|
|
224
|
+
let responseData;
|
|
225
|
+
try {
|
|
226
|
+
responseData = await this.helpers.httpRequestWithAuthentication.call(this, 'dfirIrisApi', options);
|
|
227
|
+
}
|
|
228
|
+
catch (error) {
|
|
229
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
230
|
+
}
|
|
231
|
+
irisLogger.info('next responseData', { responseData });
|
|
232
|
+
const payload = extractNextPaginatedPayload(responseData);
|
|
233
|
+
const items = Array.isArray(payload.data) ? payload.data : [];
|
|
234
|
+
returnData.push(...items);
|
|
235
|
+
total = Number(payload.total || returnData.length);
|
|
236
|
+
lastPage = Number(payload.last_page || currentPage);
|
|
237
|
+
currentPage += 1;
|
|
238
|
+
if (maxItems > 0 && returnData.length >= maxItems) {
|
|
239
|
+
break;
|
|
240
|
+
}
|
|
241
|
+
} while (currentPage <= lastPage);
|
|
242
|
+
return {
|
|
243
|
+
data: {
|
|
244
|
+
current_page: startPage,
|
|
245
|
+
data: maxItems > 0 ? returnData.slice(0, maxItems) : returnData,
|
|
246
|
+
last_page: lastPage,
|
|
247
|
+
total,
|
|
248
|
+
},
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zivego/n8n-nodes-dfir-iris",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "n8n node for DFIR IRIS IRP",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/zivego/iris-n8n-fork",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"n8n-community-node-package",
|
|
9
|
+
"dfir-iris",
|
|
10
|
+
"iris",
|
|
11
|
+
"zivego"
|
|
12
|
+
],
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "zivego",
|
|
15
|
+
"email": "266826730+zivego@users.noreply.github.com"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/zivego/iris-n8n-fork.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/zivego/iris-n8n-fork/issues"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"clean": "node -e \"const fs=require('fs'); const path=require('path'); const rm=function(target){ if(!fs.existsSync(target)) return; const stat=fs.lstatSync(target); if(stat.isDirectory()){ fs.readdirSync(target).forEach(function(name){ rm(path.join(target,name)); }); fs.rmdirSync(target); } else { fs.unlinkSync(target); } }; rm('dist');\"",
|
|
29
|
+
"prune:dist": "node -e \"const fs=require('fs'); const path=require('path'); const walk=function(dir){ if(!fs.existsSync(dir)) return; fs.readdirSync(dir).forEach(function(name){ const full=path.join(dir,name); const stat=fs.lstatSync(full); if(stat.isDirectory()) return walk(full); if(/\\\\.map$|\\\\.d\\\\.ts$|tsconfig\\\\.tsbuildinfo$/.test(full)) fs.unlinkSync(full); }); }; walk('dist');\"",
|
|
30
|
+
"build": "npm run clean && n8n-node build && npm run prune:dist",
|
|
31
|
+
"build:watch": "tsc --watch",
|
|
32
|
+
"dev": "n8n-node dev",
|
|
33
|
+
"pack:tarball": "npm run build && npm pack --pack-destination artifacts",
|
|
34
|
+
"prepack": "npm run build",
|
|
35
|
+
"prepublishOnly": "npm run build"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
40
|
+
"n8n": {
|
|
41
|
+
"n8nNodesApiVersion": 1,
|
|
42
|
+
"strict": true,
|
|
43
|
+
"credentials": [
|
|
44
|
+
"dist/credentials/DfirIrisApi.credentials.js"
|
|
45
|
+
],
|
|
46
|
+
"nodes": [
|
|
47
|
+
"dist/nodes/DfirIris/DfirIris.node.js"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@n8n/node-cli": "0.18.0",
|
|
52
|
+
"@types/node": "^20.19.30",
|
|
53
|
+
"n8n-workflow": "2.4.3",
|
|
54
|
+
"typescript": "5.9.2"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"n8n-workflow": "2.4.3"
|
|
58
|
+
},
|
|
59
|
+
"packageManager": "pnpm@10.22.0+sha512.bf049efe995b28f527fd2b41ae0474ce29186f7edcb3bf545087bd61fbbebb2bf75362d1307fda09c2d288e1e499787ac12d4fcb617a974718a6051f2eee741c",
|
|
60
|
+
"pnpm": {
|
|
61
|
+
"overrides": {
|
|
62
|
+
"@isaacs/brace-expansion": "^5.0.1",
|
|
63
|
+
"@types/node": "20.19.30",
|
|
64
|
+
"form-data": "4.0.4",
|
|
65
|
+
"glob@10": "10.5.0",
|
|
66
|
+
"glob@7": "7.2.3",
|
|
67
|
+
"lodash-es": "4.17.23",
|
|
68
|
+
"lodash": ">=4.17.23",
|
|
69
|
+
"undici@6": "^6.23.0",
|
|
70
|
+
"undici@7": "^7.18.2",
|
|
71
|
+
"js-yaml": "4.1.1"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@zivego/n8n-nodes-dfir-iris",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "n8n node for DFIR IRIS IRP",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/zivego/iris-n8n-fork",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"n8n-community-node-package",
|
|
9
|
+
"dfir-iris",
|
|
10
|
+
"iris",
|
|
11
|
+
"zivego"
|
|
12
|
+
],
|
|
13
|
+
"author": {
|
|
14
|
+
"name": "zivego",
|
|
15
|
+
"email": "266826730+zivego@users.noreply.github.com"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "https://github.com/zivego/iris-n8n-fork.git"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/zivego/iris-n8n-fork/issues"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"clean": "node -e \"const fs=require('fs'); const path=require('path'); const rm=function(target){ if(!fs.existsSync(target)) return; const stat=fs.lstatSync(target); if(stat.isDirectory()){ fs.readdirSync(target).forEach(function(name){ rm(path.join(target,name)); }); fs.rmdirSync(target); } else { fs.unlinkSync(target); } }; rm('dist');\"",
|
|
29
|
+
"prune:dist": "node -e \"const fs=require('fs'); const path=require('path'); const walk=function(dir){ if(!fs.existsSync(dir)) return; fs.readdirSync(dir).forEach(function(name){ const full=path.join(dir,name); const stat=fs.lstatSync(full); if(stat.isDirectory()) return walk(full); if(/\\\\.map$|\\\\.d\\\\.ts$|tsconfig\\\\.tsbuildinfo$/.test(full)) fs.unlinkSync(full); }); }; walk('dist');\"",
|
|
30
|
+
"build": "npm run clean && n8n-node build && npm run prune:dist",
|
|
31
|
+
"build:watch": "tsc --watch",
|
|
32
|
+
"dev": "n8n-node dev",
|
|
33
|
+
"pack:tarball": "npm run build && npm pack --pack-destination artifacts",
|
|
34
|
+
"prepack": "npm run build",
|
|
35
|
+
"prepublishOnly": "npm run build"
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist"
|
|
39
|
+
],
|
|
40
|
+
"n8n": {
|
|
41
|
+
"n8nNodesApiVersion": 1,
|
|
42
|
+
"strict": true,
|
|
43
|
+
"credentials": [
|
|
44
|
+
"dist/credentials/DfirIrisApi.credentials.js"
|
|
45
|
+
],
|
|
46
|
+
"nodes": [
|
|
47
|
+
"dist/nodes/DfirIris/DfirIris.node.js"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@n8n/node-cli": "0.18.0",
|
|
52
|
+
"@types/node": "^20.19.30",
|
|
53
|
+
"n8n-workflow": "2.4.3",
|
|
54
|
+
"typescript": "5.9.2"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"n8n-workflow": "2.4.3"
|
|
58
|
+
},
|
|
59
|
+
"packageManager": "pnpm@10.22.0+sha512.bf049efe995b28f527fd2b41ae0474ce29186f7edcb3bf545087bd61fbbebb2bf75362d1307fda09c2d288e1e499787ac12d4fcb617a974718a6051f2eee741c",
|
|
60
|
+
"pnpm": {
|
|
61
|
+
"overrides": {
|
|
62
|
+
"@isaacs/brace-expansion": "^5.0.1",
|
|
63
|
+
"@types/node": "20.19.30",
|
|
64
|
+
"form-data": "4.0.4",
|
|
65
|
+
"glob@10": "10.5.0",
|
|
66
|
+
"glob@7": "7.2.3",
|
|
67
|
+
"lodash-es": "4.17.23",
|
|
68
|
+
"lodash": ">=4.17.23",
|
|
69
|
+
"undici@6": "^6.23.0",
|
|
70
|
+
"undici@7": "^7.18.2",
|
|
71
|
+
"js-yaml": "4.1.1"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|