n8n-nodes-hudu 1.6.3 → 1.6.4
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/Hudu/descriptions/activity_logs.description.js +16 -5
- package/dist/nodes/Hudu/descriptions/activity_logs.description.js.map +1 -1
- package/dist/nodes/Hudu/descriptions/activity_logs.description.ts +17 -6
- package/dist/nodes/Hudu/resources/activity_logs/activity_logs.handler.js +104 -1
- package/dist/nodes/Hudu/resources/activity_logs/activity_logs.handler.js.map +1 -1
- package/dist/nodes/Hudu/resources/activity_logs/activity_logs.handler.ts +186 -9
- package/dist/nodes/Hudu/utils/constants.js +28 -1
- package/dist/nodes/Hudu/utils/constants.js.map +1 -1
- package/dist/nodes/Hudu/utils/constants.ts +31 -0
- package/package.json +1 -1
|
@@ -79,20 +79,31 @@ exports.activityLogsFields = [
|
|
|
79
79
|
{
|
|
80
80
|
displayName: 'Action Message',
|
|
81
81
|
name: 'action_message',
|
|
82
|
-
type: '
|
|
82
|
+
type: 'multiOptions',
|
|
83
83
|
options: constants_1.ACTIVITY_LOG_ACTIONS.map((action) => ({
|
|
84
84
|
name: (0, formatters_1.formatTitleCase)(action),
|
|
85
85
|
value: action,
|
|
86
86
|
})),
|
|
87
|
-
default:
|
|
88
|
-
description: 'Filter by
|
|
87
|
+
default: [],
|
|
88
|
+
description: 'Filter by action message(s). When multiple actions are selected, separate queries are made for each action and the results are merged client-side.',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Fields to Return',
|
|
92
|
+
name: 'fields',
|
|
93
|
+
type: 'multiOptions',
|
|
94
|
+
options: constants_1.ACTIVITY_LOG_FIELDS.map((field) => ({
|
|
95
|
+
name: field.name,
|
|
96
|
+
value: field.value,
|
|
97
|
+
})),
|
|
98
|
+
default: [],
|
|
99
|
+
description: 'Select which fields to return. If none selected, all fields are returned.',
|
|
89
100
|
},
|
|
90
101
|
{
|
|
91
102
|
displayName: 'Resource ID',
|
|
92
103
|
name: 'resource_id',
|
|
93
104
|
type: 'number',
|
|
94
105
|
default: undefined,
|
|
95
|
-
description: 'Filter by resource ID
|
|
106
|
+
description: 'Filter by resource ID. When used with Resource Type, enables efficient API-level filtering.',
|
|
96
107
|
},
|
|
97
108
|
{
|
|
98
109
|
displayName: 'Resource Type',
|
|
@@ -103,7 +114,7 @@ exports.activityLogsFields = [
|
|
|
103
114
|
value: type,
|
|
104
115
|
})),
|
|
105
116
|
default: '',
|
|
106
|
-
description: 'Filter by resource type
|
|
117
|
+
description: 'Filter by resource type. When used alone, pages are fetched incrementally and filtered client-side. For efficient API-level filtering, also provide Resource ID.',
|
|
107
118
|
},
|
|
108
119
|
{
|
|
109
120
|
displayName: 'Start Date',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity_logs.description.js","sourceRoot":"","sources":["../../../../../src/nodes/Hudu/descriptions/activity_logs.description.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"activity_logs.description.js","sourceRoot":"","sources":["../../../../../src/nodes/Hudu/descriptions/activity_logs.description.ts"],"names":[],"mappings":";;;AACA,kDAAmH;AACnH,oDAAsD;AAEzC,QAAA,sBAAsB,GAAsB;IACvD;QACE,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACd,IAAI,EAAE;gBACJ,QAAQ,EAAE,CAAC,eAAe,CAAC;aAC5B;SACF;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,kCAAkC;gBAC/C,MAAM,EAAE,wBAAwB;aACjC;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,sBAAsB;gBACnC,MAAM,EAAE,sBAAsB;aAC/B;SACF;QACD,OAAO,EAAE,QAAQ;KA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H;aAC9H;SACF;KACF;IAGD;QACE,WAAW,EAAE,UAAU;QACvB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,qEAAqE;QAClF,cAAc,EAAE;YACd,IAAI,EAAE;gBACJ,QAAQ,EAAE,CAAC,eAAe,CAAC;gBAC3B,SAAS,EAAE,CAAC,QAAQ,CAAC;aACtB;SACF;KACF;IACD;QACE,WAAW,EAAE,mBAAmB;QAChC,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACd,IAAI,EAAE;gBACJ,QAAQ,EAAE,CAAC,eAAe,CAAC;gBAC3B,SAAS,EAAE,CAAC,QAAQ,CAAC;aACtB;SACF;QACD,OAAO,EAAE;YACP;gBACE,WAAW,EAAE,6BAA6B;gBAC1C,IAAI,EAAE,wBAAwB;gBAC9B,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,kDAAkD;aAChE;SACF;KACF;CACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import { HUDU_API_CONSTANTS, ACTIVITY_LOG_ACTIONS, RESOURCE_TYPES } from '../utils/constants';
|
|
2
|
+
import { HUDU_API_CONSTANTS, ACTIVITY_LOG_ACTIONS, ACTIVITY_LOG_FIELDS, RESOURCE_TYPES } from '../utils/constants';
|
|
3
3
|
import { formatTitleCase } from '../utils/formatters';
|
|
4
4
|
|
|
5
5
|
export const activityLogsOperations: INodeProperties[] = [
|
|
@@ -81,20 +81,31 @@ export const activityLogsFields: INodeProperties[] = [
|
|
|
81
81
|
{
|
|
82
82
|
displayName: 'Action Message',
|
|
83
83
|
name: 'action_message',
|
|
84
|
-
type: '
|
|
84
|
+
type: 'multiOptions',
|
|
85
85
|
options: ACTIVITY_LOG_ACTIONS.map((action) => ({
|
|
86
86
|
name: formatTitleCase(action),
|
|
87
87
|
value: action,
|
|
88
88
|
})),
|
|
89
|
-
default:
|
|
90
|
-
description: 'Filter by
|
|
89
|
+
default: [],
|
|
90
|
+
description: 'Filter by action message(s). When multiple actions are selected, separate queries are made for each action and the results are merged client-side.',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
displayName: 'Fields to Return',
|
|
94
|
+
name: 'fields',
|
|
95
|
+
type: 'multiOptions',
|
|
96
|
+
options: ACTIVITY_LOG_FIELDS.map((field) => ({
|
|
97
|
+
name: field.name,
|
|
98
|
+
value: field.value,
|
|
99
|
+
})),
|
|
100
|
+
default: [],
|
|
101
|
+
description: 'Select which fields to return. If none selected, all fields are returned.',
|
|
91
102
|
},
|
|
92
103
|
{
|
|
93
104
|
displayName: 'Resource ID',
|
|
94
105
|
name: 'resource_id',
|
|
95
106
|
type: 'number',
|
|
96
107
|
default: undefined,
|
|
97
|
-
description: 'Filter by resource ID
|
|
108
|
+
description: 'Filter by resource ID. When used with Resource Type, enables efficient API-level filtering.',
|
|
98
109
|
},
|
|
99
110
|
{
|
|
100
111
|
displayName: 'Resource Type',
|
|
@@ -105,7 +116,7 @@ export const activityLogsFields: INodeProperties[] = [
|
|
|
105
116
|
value: type,
|
|
106
117
|
})),
|
|
107
118
|
default: '',
|
|
108
|
-
description: 'Filter by resource type
|
|
119
|
+
description: 'Filter by resource type. When used alone, pages are fetched incrementally and filtered client-side. For efficient API-level filtering, also provide Resource ID.',
|
|
109
120
|
},
|
|
110
121
|
{
|
|
111
122
|
displayName: 'Start Date',
|
|
@@ -4,6 +4,47 @@ exports.handleActivityLogsOperation = handleActivityLogsOperation;
|
|
|
4
4
|
const operations_1 = require("../../utils/operations");
|
|
5
5
|
const constants_1 = require("../../utils/constants");
|
|
6
6
|
const requestUtils_1 = require("../../utils/requestUtils");
|
|
7
|
+
function filterFields(item, fields) {
|
|
8
|
+
if (!fields || fields.length === 0) {
|
|
9
|
+
return item;
|
|
10
|
+
}
|
|
11
|
+
const filtered = {};
|
|
12
|
+
for (const field of fields) {
|
|
13
|
+
if (item.hasOwnProperty(field)) {
|
|
14
|
+
filtered[field] = item[field];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return filtered;
|
|
18
|
+
}
|
|
19
|
+
function applyFieldFiltering(results, fields) {
|
|
20
|
+
if (!fields || fields.length === 0) {
|
|
21
|
+
return results;
|
|
22
|
+
}
|
|
23
|
+
return results.map((item) => filterFields(item, fields));
|
|
24
|
+
}
|
|
25
|
+
async function fetchWithResourceTypeFilter(context, endpoint, filters, resourceType, returnAll, limit) {
|
|
26
|
+
const matchingResults = [];
|
|
27
|
+
let page = 1;
|
|
28
|
+
let hasMorePages = true;
|
|
29
|
+
while (hasMorePages) {
|
|
30
|
+
const qs = { ...filters, page, page_size: constants_1.HUDU_API_CONSTANTS.PAGE_SIZE };
|
|
31
|
+
const response = await requestUtils_1.huduApiRequest.call(context, 'GET', endpoint, {}, qs);
|
|
32
|
+
const items = Array.isArray(response)
|
|
33
|
+
? response
|
|
34
|
+
: (response.activity_logs || []);
|
|
35
|
+
const matching = items.filter((item) => item.record_type === resourceType);
|
|
36
|
+
matchingResults.push(...matching);
|
|
37
|
+
hasMorePages = items.length === constants_1.HUDU_API_CONSTANTS.PAGE_SIZE;
|
|
38
|
+
if (!returnAll && matchingResults.length >= limit) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
page++;
|
|
42
|
+
}
|
|
43
|
+
if (!returnAll && matchingResults.length > limit) {
|
|
44
|
+
return matchingResults.slice(0, limit);
|
|
45
|
+
}
|
|
46
|
+
return matchingResults;
|
|
47
|
+
}
|
|
7
48
|
async function handleActivityLogsOperation(operation, i) {
|
|
8
49
|
const resourceEndpoint = '/activity_logs';
|
|
9
50
|
switch (operation) {
|
|
@@ -11,11 +52,73 @@ async function handleActivityLogsOperation(operation, i) {
|
|
|
11
52
|
const returnAll = this.getNodeParameter('returnAll', i);
|
|
12
53
|
const filters = this.getNodeParameter('additionalFields', i);
|
|
13
54
|
const limit = this.getNodeParameter('limit', i, constants_1.HUDU_API_CONSTANTS.PAGE_SIZE);
|
|
55
|
+
const fieldsToReturn = filters.fields;
|
|
14
56
|
const cleanedFilters = { ...filters };
|
|
57
|
+
delete cleanedFilters.fields;
|
|
58
|
+
const resourceType = cleanedFilters.resource_type;
|
|
59
|
+
const resourceId = cleanedFilters.resource_id;
|
|
60
|
+
const hasResourceType = resourceType && resourceType !== '';
|
|
61
|
+
const hasResourceId = resourceId && resourceId !== 0;
|
|
62
|
+
const needsClientSideResourceTypeFilter = hasResourceType && !hasResourceId;
|
|
63
|
+
if (needsClientSideResourceTypeFilter) {
|
|
64
|
+
delete cleanedFilters.resource_type;
|
|
65
|
+
}
|
|
66
|
+
if (!hasResourceType && hasResourceId) {
|
|
67
|
+
delete cleanedFilters.resource_id;
|
|
68
|
+
}
|
|
15
69
|
if (cleanedFilters.resource_id === 0) {
|
|
16
70
|
delete cleanedFilters.resource_id;
|
|
17
71
|
}
|
|
18
|
-
|
|
72
|
+
const actionMessages = cleanedFilters.action_message;
|
|
73
|
+
delete cleanedFilters.action_message;
|
|
74
|
+
let results;
|
|
75
|
+
if (Array.isArray(actionMessages) && actionMessages.length > 1) {
|
|
76
|
+
const allResults = [];
|
|
77
|
+
for (const action of actionMessages) {
|
|
78
|
+
const actionFilters = { ...cleanedFilters, action_message: action };
|
|
79
|
+
if (needsClientSideResourceTypeFilter) {
|
|
80
|
+
const actionResults = await fetchWithResourceTypeFilter(this, resourceEndpoint, actionFilters, resourceType, returnAll, limit);
|
|
81
|
+
allResults.push(...actionResults);
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const actionResults = await operations_1.handleGetAllOperation.call(this, resourceEndpoint, 'activity_logs', actionFilters, returnAll, limit);
|
|
85
|
+
allResults.push(...(Array.isArray(actionResults) ? actionResults : [actionResults]));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const uniqueMap = new Map();
|
|
89
|
+
for (const item of allResults) {
|
|
90
|
+
if (item.id !== undefined && item.id !== null) {
|
|
91
|
+
uniqueMap.set(item.id, item);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
let merged = Array.from(uniqueMap.values());
|
|
95
|
+
merged.sort((a, b) => {
|
|
96
|
+
const dateA = a.created_at;
|
|
97
|
+
const dateB = b.created_at;
|
|
98
|
+
if (!dateA || !dateB)
|
|
99
|
+
return 0;
|
|
100
|
+
return new Date(dateB).getTime() - new Date(dateA).getTime();
|
|
101
|
+
});
|
|
102
|
+
if (!returnAll && limit && merged.length > limit) {
|
|
103
|
+
merged = merged.slice(0, limit);
|
|
104
|
+
}
|
|
105
|
+
results = merged;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
if (Array.isArray(actionMessages) && actionMessages.length === 1) {
|
|
109
|
+
cleanedFilters.action_message = actionMessages[0];
|
|
110
|
+
}
|
|
111
|
+
else if (typeof actionMessages === 'string' && actionMessages !== '') {
|
|
112
|
+
cleanedFilters.action_message = actionMessages;
|
|
113
|
+
}
|
|
114
|
+
if (needsClientSideResourceTypeFilter) {
|
|
115
|
+
results = await fetchWithResourceTypeFilter(this, resourceEndpoint, cleanedFilters, resourceType, returnAll, limit);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
results = await operations_1.handleGetAllOperation.call(this, resourceEndpoint, 'activity_logs', cleanedFilters, returnAll, limit);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return applyFieldFiltering(results, fieldsToReturn);
|
|
19
122
|
}
|
|
20
123
|
case 'delete': {
|
|
21
124
|
const datetime = this.getNodeParameter('datetime', i);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity_logs.handler.js","sourceRoot":"","sources":["../../../../../../src/nodes/Hudu/resources/activity_logs/activity_logs.handler.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"activity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gBAAgB,CAAC,sBAAsB,CAAC;YACtE,CAAC;YAED,OAAO,MAAM,6BAAc,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,yBAAyB,SAAS,EAAE,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -4,6 +4,80 @@ import type { ActivityLogsOperation } from './activity_logs.types';
|
|
|
4
4
|
import { HUDU_API_CONSTANTS } from '../../utils/constants';
|
|
5
5
|
import { huduApiRequest } from '../../utils/requestUtils';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Filter fields from a result object based on selected fields
|
|
9
|
+
*/
|
|
10
|
+
function filterFields(item: IDataObject, fields: string[] | undefined): IDataObject {
|
|
11
|
+
if (!fields || fields.length === 0) {
|
|
12
|
+
return item; // Return all fields if none specified
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const filtered: IDataObject = {};
|
|
16
|
+
for (const field of fields) {
|
|
17
|
+
if (item.hasOwnProperty(field)) {
|
|
18
|
+
filtered[field] = item[field];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return filtered;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Apply field filtering to an array of results
|
|
26
|
+
*/
|
|
27
|
+
function applyFieldFiltering(results: IDataObject[], fields: string[] | undefined): IDataObject[] {
|
|
28
|
+
if (!fields || fields.length === 0) {
|
|
29
|
+
return results; // Return all fields if none specified
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return results.map((item) => filterFields(item, fields));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Fetch activity logs with client-side resource_type filtering
|
|
37
|
+
* Uses incremental pagination to avoid fetching all logs unnecessarily
|
|
38
|
+
*/
|
|
39
|
+
async function fetchWithResourceTypeFilter(
|
|
40
|
+
context: IExecuteFunctions,
|
|
41
|
+
endpoint: string,
|
|
42
|
+
filters: IDataObject,
|
|
43
|
+
resourceType: string,
|
|
44
|
+
returnAll: boolean,
|
|
45
|
+
limit: number,
|
|
46
|
+
): Promise<IDataObject[]> {
|
|
47
|
+
const matchingResults: IDataObject[] = [];
|
|
48
|
+
let page = 1;
|
|
49
|
+
let hasMorePages = true;
|
|
50
|
+
|
|
51
|
+
while (hasMorePages) {
|
|
52
|
+
const qs = { ...filters, page, page_size: HUDU_API_CONSTANTS.PAGE_SIZE };
|
|
53
|
+
const response = await huduApiRequest.call(context, 'GET', endpoint, {}, qs);
|
|
54
|
+
const items = Array.isArray(response)
|
|
55
|
+
? response
|
|
56
|
+
: ((response as IDataObject).activity_logs as IDataObject[] || []);
|
|
57
|
+
|
|
58
|
+
// Filter this page by record_type
|
|
59
|
+
const matching = items.filter((item) => item.record_type === resourceType);
|
|
60
|
+
matchingResults.push(...matching);
|
|
61
|
+
|
|
62
|
+
// Check if more pages exist
|
|
63
|
+
hasMorePages = items.length === HUDU_API_CONSTANTS.PAGE_SIZE;
|
|
64
|
+
|
|
65
|
+
// Early exit if we have enough (and not returning all)
|
|
66
|
+
if (!returnAll && matchingResults.length >= limit) {
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
page++;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Apply limit if not returning all
|
|
74
|
+
if (!returnAll && matchingResults.length > limit) {
|
|
75
|
+
return matchingResults.slice(0, limit);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return matchingResults;
|
|
79
|
+
}
|
|
80
|
+
|
|
7
81
|
export async function handleActivityLogsOperation(
|
|
8
82
|
this: IExecuteFunctions,
|
|
9
83
|
operation: ActivityLogsOperation,
|
|
@@ -17,20 +91,123 @@ export async function handleActivityLogsOperation(
|
|
|
17
91
|
const filters = this.getNodeParameter('additionalFields', i) as IDataObject;
|
|
18
92
|
const limit = this.getNodeParameter('limit', i, HUDU_API_CONSTANTS.PAGE_SIZE) as number;
|
|
19
93
|
|
|
20
|
-
//
|
|
94
|
+
// Extract fields to return (if specified)
|
|
95
|
+
const fieldsToReturn = filters.fields as string[] | undefined;
|
|
21
96
|
const cleanedFilters: IDataObject = { ...filters };
|
|
97
|
+
delete cleanedFilters.fields; // Remove fields from API filters
|
|
98
|
+
|
|
99
|
+
// Determine filtering mode
|
|
100
|
+
const resourceType = cleanedFilters.resource_type as string | undefined;
|
|
101
|
+
const resourceId = cleanedFilters.resource_id as number | undefined;
|
|
102
|
+
const hasResourceType = resourceType && resourceType !== '';
|
|
103
|
+
const hasResourceId = resourceId && resourceId !== 0;
|
|
104
|
+
const needsClientSideResourceTypeFilter = hasResourceType && !hasResourceId;
|
|
105
|
+
|
|
106
|
+
if (needsClientSideResourceTypeFilter) {
|
|
107
|
+
delete cleanedFilters.resource_type;
|
|
108
|
+
}
|
|
109
|
+
if (!hasResourceType && hasResourceId) {
|
|
110
|
+
delete cleanedFilters.resource_id; // API requires both
|
|
111
|
+
}
|
|
22
112
|
if (cleanedFilters.resource_id === 0) {
|
|
23
113
|
delete cleanedFilters.resource_id;
|
|
24
114
|
}
|
|
25
115
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
)
|
|
116
|
+
// Extract action_message from filters
|
|
117
|
+
const actionMessages = cleanedFilters.action_message as string[] | string | undefined;
|
|
118
|
+
delete cleanedFilters.action_message;
|
|
119
|
+
|
|
120
|
+
let results: IDataObject[];
|
|
121
|
+
|
|
122
|
+
// Handle multi-action selection: query each action separately and merge results
|
|
123
|
+
if (Array.isArray(actionMessages) && actionMessages.length > 1) {
|
|
124
|
+
const allResults: IDataObject[] = [];
|
|
125
|
+
|
|
126
|
+
// Query each action separately
|
|
127
|
+
for (const action of actionMessages) {
|
|
128
|
+
const actionFilters = { ...cleanedFilters, action_message: action };
|
|
129
|
+
|
|
130
|
+
if (needsClientSideResourceTypeFilter) {
|
|
131
|
+
// Use incremental fetch with filter for each action
|
|
132
|
+
const actionResults = await fetchWithResourceTypeFilter(
|
|
133
|
+
this,
|
|
134
|
+
resourceEndpoint,
|
|
135
|
+
actionFilters,
|
|
136
|
+
resourceType!,
|
|
137
|
+
returnAll,
|
|
138
|
+
limit,
|
|
139
|
+
);
|
|
140
|
+
allResults.push(...actionResults);
|
|
141
|
+
} else {
|
|
142
|
+
// Use existing handleGetAllOperation
|
|
143
|
+
const actionResults = await handleGetAllOperation.call(
|
|
144
|
+
this,
|
|
145
|
+
resourceEndpoint,
|
|
146
|
+
'activity_logs',
|
|
147
|
+
actionFilters,
|
|
148
|
+
returnAll,
|
|
149
|
+
limit,
|
|
150
|
+
);
|
|
151
|
+
allResults.push(...(Array.isArray(actionResults) ? actionResults : [actionResults]));
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Deduplicate by id using Map (last occurrence wins)
|
|
156
|
+
const uniqueMap = new Map<number, IDataObject>();
|
|
157
|
+
for (const item of allResults) {
|
|
158
|
+
if (item.id !== undefined && item.id !== null) {
|
|
159
|
+
uniqueMap.set(item.id as number, item);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// Convert to array and sort by created_at descending (most recent first)
|
|
164
|
+
let merged = Array.from(uniqueMap.values());
|
|
165
|
+
merged.sort((a, b) => {
|
|
166
|
+
const dateA = a.created_at as string;
|
|
167
|
+
const dateB = b.created_at as string;
|
|
168
|
+
if (!dateA || !dateB) return 0;
|
|
169
|
+
return new Date(dateB).getTime() - new Date(dateA).getTime();
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
// Apply limit if not returning all
|
|
173
|
+
if (!returnAll && limit && merged.length > limit) {
|
|
174
|
+
merged = merged.slice(0, limit);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
results = merged;
|
|
178
|
+
} else {
|
|
179
|
+
// Single action or no action
|
|
180
|
+
if (Array.isArray(actionMessages) && actionMessages.length === 1) {
|
|
181
|
+
cleanedFilters.action_message = actionMessages[0];
|
|
182
|
+
} else if (typeof actionMessages === 'string' && actionMessages !== '') {
|
|
183
|
+
cleanedFilters.action_message = actionMessages;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if (needsClientSideResourceTypeFilter) {
|
|
187
|
+
// Use incremental fetch with filter
|
|
188
|
+
results = await fetchWithResourceTypeFilter(
|
|
189
|
+
this,
|
|
190
|
+
resourceEndpoint,
|
|
191
|
+
cleanedFilters,
|
|
192
|
+
resourceType!,
|
|
193
|
+
returnAll,
|
|
194
|
+
limit,
|
|
195
|
+
);
|
|
196
|
+
} else {
|
|
197
|
+
// Use existing handleGetAllOperation
|
|
198
|
+
results = await handleGetAllOperation.call(
|
|
199
|
+
this,
|
|
200
|
+
resourceEndpoint,
|
|
201
|
+
'activity_logs',
|
|
202
|
+
cleanedFilters,
|
|
203
|
+
returnAll,
|
|
204
|
+
limit,
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Apply field filtering
|
|
210
|
+
return applyFieldFiltering(results, fieldsToReturn);
|
|
34
211
|
}
|
|
35
212
|
|
|
36
213
|
case 'delete': {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OPERATION = exports.DATETIME_FORMAT = exports.TIME_FORMAT = exports.DATE_FORMAT = exports.RESOURCE_TYPES = exports.ACTIVITY_LOG_ACTIONS = exports.RESOURCES_WITH_PAGE_SIZE = exports.INTEGRATION_SLUGS = exports.ASSET_LAYOUT_FIELD_LABELS = exports.ASSET_LAYOUT_FIELD_TYPES = exports.HUDU_API_CONSTANTS = void 0;
|
|
3
|
+
exports.OPERATION = exports.DATETIME_FORMAT = exports.TIME_FORMAT = exports.DATE_FORMAT = exports.ACTIVITY_LOG_FIELDS = exports.RESOURCE_TYPES = exports.ACTIVITY_LOG_ACTIONS = exports.RESOURCES_WITH_PAGE_SIZE = exports.INTEGRATION_SLUGS = exports.ASSET_LAYOUT_FIELD_LABELS = exports.ASSET_LAYOUT_FIELD_TYPES = exports.HUDU_API_CONSTANTS = void 0;
|
|
4
4
|
exports.HUDU_API_CONSTANTS = {
|
|
5
5
|
PAGE_SIZE: 25,
|
|
6
6
|
DEFAULT_PAGE: 1,
|
|
@@ -166,6 +166,33 @@ exports.RESOURCE_TYPES = [
|
|
|
166
166
|
'VaultPassword',
|
|
167
167
|
'Website',
|
|
168
168
|
];
|
|
169
|
+
exports.ACTIVITY_LOG_FIELDS = [
|
|
170
|
+
{ name: 'Action', value: 'action' },
|
|
171
|
+
{ name: 'Agent String', value: 'agent_string' },
|
|
172
|
+
{ name: 'App Type', value: 'app_type' },
|
|
173
|
+
{ name: 'Company Name', value: 'company_name' },
|
|
174
|
+
{ name: 'Created At', value: 'created_at' },
|
|
175
|
+
{ name: 'Details', value: 'details' },
|
|
176
|
+
{ name: 'Device', value: 'device' },
|
|
177
|
+
{ name: 'Formatted Datetime', value: 'formatted_datetime' },
|
|
178
|
+
{ name: 'ID', value: 'id' },
|
|
179
|
+
{ name: 'IP Address', value: 'ip_address' },
|
|
180
|
+
{ name: 'Original Record Name', value: 'original_record_name' },
|
|
181
|
+
{ name: 'OS', value: 'os' },
|
|
182
|
+
{ name: 'Record Company URL', value: 'record_company_url' },
|
|
183
|
+
{ name: 'Record ID', value: 'record_id' },
|
|
184
|
+
{ name: 'Record Name', value: 'record_name' },
|
|
185
|
+
{ name: 'Record Type', value: 'record_type' },
|
|
186
|
+
{ name: 'Record URL', value: 'record_url' },
|
|
187
|
+
{ name: 'Record User URL', value: 'record_user_url' },
|
|
188
|
+
{ name: 'Token', value: 'token' },
|
|
189
|
+
{ name: 'URL', value: 'url' },
|
|
190
|
+
{ name: 'User Email', value: 'user_email' },
|
|
191
|
+
{ name: 'User ID', value: 'user_id' },
|
|
192
|
+
{ name: 'User Initials', value: 'user_initials' },
|
|
193
|
+
{ name: 'User Name', value: 'user_name' },
|
|
194
|
+
{ name: 'User Short Name', value: 'user_short_name' },
|
|
195
|
+
];
|
|
169
196
|
exports.DATE_FORMAT = 'YYYY-MM-DD';
|
|
170
197
|
exports.TIME_FORMAT = 'HH:mm:ss';
|
|
171
198
|
exports.DATETIME_FORMAT = `${exports.DATE_FORMAT} ${exports.TIME_FORMAT}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../src/nodes/Hudu/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,kBAAkB,GAAG;IAChC,SAAS,EAAE,EAAE;IACb,YAAY,EAAE,CAAC;IACf,aAAa,EAAE,SAAS;CAChB,CAAC;AAKE,QAAA,wBAAwB,GAAG;IACtC,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,UAAU;IACrB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,YAAY;IACzB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,UAAU;IACrB,QAAQ,EAAE,UAAU;IACpB,YAAY,EAAE,aAAa;IAC3B,QAAQ,EAAE,UAAU;CACZ,CAAC;AAKE,QAAA,yBAAyB,GAAG;IACvC,CAAC,gCAAwB,CAAC,IAAI,CAAC,EAAE,MAAM;IACvC,CAAC,gCAAwB,CAAC,SAAS,CAAC,EAAE,WAAW;IACjD,CAAC,gCAAwB,CAAC,OAAO,CAAC,EAAE,SAAS;IAC7C,CAAC,gCAAwB,CAAC,QAAQ,CAAC,EAAE,WAAW;IAChD,CAAC,gCAAwB,CAAC,OAAO,CAAC,EAAE,MAAM;IAC1C,CAAC,gCAAwB,CAAC,QAAQ,CAAC,EAAE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AAQ,EAAE,SAAS;IACnB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE;QACN,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,SAAS;QACpB,MAAM,EAAE,QAAQ;KACjB;CACF,CAAC"}
|
|
@@ -194,6 +194,37 @@ export const RESOURCE_TYPES = [
|
|
|
194
194
|
'Website',
|
|
195
195
|
] as const;
|
|
196
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Activity log response fields (alphabetically sorted by display name)
|
|
199
|
+
*/
|
|
200
|
+
export const ACTIVITY_LOG_FIELDS = [
|
|
201
|
+
{ name: 'Action', value: 'action' },
|
|
202
|
+
{ name: 'Agent String', value: 'agent_string' },
|
|
203
|
+
{ name: 'App Type', value: 'app_type' },
|
|
204
|
+
{ name: 'Company Name', value: 'company_name' },
|
|
205
|
+
{ name: 'Created At', value: 'created_at' },
|
|
206
|
+
{ name: 'Details', value: 'details' },
|
|
207
|
+
{ name: 'Device', value: 'device' },
|
|
208
|
+
{ name: 'Formatted Datetime', value: 'formatted_datetime' },
|
|
209
|
+
{ name: 'ID', value: 'id' },
|
|
210
|
+
{ name: 'IP Address', value: 'ip_address' },
|
|
211
|
+
{ name: 'Original Record Name', value: 'original_record_name' },
|
|
212
|
+
{ name: 'OS', value: 'os' },
|
|
213
|
+
{ name: 'Record Company URL', value: 'record_company_url' },
|
|
214
|
+
{ name: 'Record ID', value: 'record_id' },
|
|
215
|
+
{ name: 'Record Name', value: 'record_name' },
|
|
216
|
+
{ name: 'Record Type', value: 'record_type' },
|
|
217
|
+
{ name: 'Record URL', value: 'record_url' },
|
|
218
|
+
{ name: 'Record User URL', value: 'record_user_url' },
|
|
219
|
+
{ name: 'Token', value: 'token' },
|
|
220
|
+
{ name: 'URL', value: 'url' },
|
|
221
|
+
{ name: 'User Email', value: 'user_email' },
|
|
222
|
+
{ name: 'User ID', value: 'user_id' },
|
|
223
|
+
{ name: 'User Initials', value: 'user_initials' },
|
|
224
|
+
{ name: 'User Name', value: 'user_name' },
|
|
225
|
+
{ name: 'User Short Name', value: 'user_short_name' },
|
|
226
|
+
] as const;
|
|
227
|
+
|
|
197
228
|
// General date format constants
|
|
198
229
|
export const DATE_FORMAT = 'YYYY-MM-DD';
|
|
199
230
|
export const TIME_FORMAT = 'HH:mm:ss';
|