@andrey4emk/npm-app-back-b24 0.3.2 → 0.3.3
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/eventGet.js +3 -49
- package/package.json +1 -1
package/eventGet.js
CHANGED
|
@@ -27,7 +27,7 @@ export class Event {
|
|
|
27
27
|
filter: { EVENT_NAME: eventName },
|
|
28
28
|
// auth_connector: "change_entity_app",
|
|
29
29
|
});
|
|
30
|
-
|
|
30
|
+
arrOfflineEvents = arrOfflineEvents.getData();
|
|
31
31
|
// Очищаем сразу события, у которых EVENT_ADDITIONAL: { user_id: '138' }, их не обрабатываем
|
|
32
32
|
let arrEventsToClear = arrOfflineEvents.result.events.filter((event) => event.EVENT_ADDITIONAL.user_id === "138");
|
|
33
33
|
if (arrEventsToClear.length > 0) {
|
|
@@ -36,6 +36,7 @@ export class Event {
|
|
|
36
36
|
process_id: arrOfflineEvents.result.process_id,
|
|
37
37
|
message_id: arrMessageIdToClear,
|
|
38
38
|
});
|
|
39
|
+
resEventClear = resEventClear.getData();
|
|
39
40
|
// Удаляем эти события из основного массива arrOfflineEvents.result.events
|
|
40
41
|
arrOfflineEvents.result.events = arrOfflineEvents.result.events.filter((event) => event.EVENT_ADDITIONAL.user_id !== "138");
|
|
41
42
|
}
|
|
@@ -64,57 +65,10 @@ export class Event {
|
|
|
64
65
|
process_id: processId,
|
|
65
66
|
message_id: messageId,
|
|
66
67
|
});
|
|
68
|
+
resEventClear = resEventClear.getData();
|
|
67
69
|
return { error: false };
|
|
68
70
|
} catch (error) {
|
|
69
71
|
return { error: true, status: "error", message: `Не удалось очистить события. ${error}` };
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
|
-
async deleteMessageId(entityId, arrMessageIdAndEntityId) {
|
|
73
|
-
try {
|
|
74
|
-
// Находим в массиве arrMessageIdAndEntityId объект с нужным entityId и удаляем целиком этот объект из массива
|
|
75
|
-
let index = arrMessageIdAndEntityId.findIndex((item) => item.entityId === entityId);
|
|
76
|
-
if (index !== -1) {
|
|
77
|
-
arrMessageIdAndEntityId.splice(index, 1);
|
|
78
|
-
}
|
|
79
|
-
return arrMessageIdAndEntityId;
|
|
80
|
-
} catch (error) {
|
|
81
|
-
return { error: true, status: "error", message: `Не удалось удалить messageId. ${error}` };
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
74
|
}
|
|
85
|
-
|
|
86
|
-
// Как выглядит оффлайн событие
|
|
87
|
-
|
|
88
|
-
// {
|
|
89
|
-
// result: {
|
|
90
|
-
// process_id: '9bjf3j8mhfw40xisspvurxfnd0yvja97',
|
|
91
|
-
// events: [
|
|
92
|
-
// {
|
|
93
|
-
// ID: '81307763',
|
|
94
|
-
// TIMESTAMP_X: '2025-09-13T10:54:04+03:00',
|
|
95
|
-
// EVENT_NAME: 'ONCRMDYNAMICITEMUPDATE_149',
|
|
96
|
-
// EVENT_DATA: { FIELDS: { ID: 959, ENTITY_TYPE_ID: 149 } },
|
|
97
|
-
// EVENT_ADDITIONAL: { user_id: '1' },
|
|
98
|
-
// MESSAGE_ID: '892acbbb5d7a6aad30f5c670a65bcabc'
|
|
99
|
-
// },
|
|
100
|
-
// {
|
|
101
|
-
// ID: '81307739',
|
|
102
|
-
// TIMESTAMP_X: '2025-09-13T10:54:16+03:00',
|
|
103
|
-
// EVENT_NAME: 'ONCRMDYNAMICITEMUPDATE_149',
|
|
104
|
-
// EVENT_DATA: { FIELDS: { ID: 957, ENTITY_TYPE_ID: 149 } },
|
|
105
|
-
// EVENT_ADDITIONAL: { user_id: '138' },
|
|
106
|
-
// MESSAGE_ID: '7cf5d29bee90cc37382a9fff07fc2a43'
|
|
107
|
-
// }
|
|
108
|
-
// ]
|
|
109
|
-
// },
|
|
110
|
-
// time: {
|
|
111
|
-
// start: 1757750082.536543,
|
|
112
|
-
// finish: 1757750082.626707,
|
|
113
|
-
// duration: 0.0901641845703125,
|
|
114
|
-
// processing: 0.0034630298614501953,
|
|
115
|
-
// date_start: '2025-09-13T10:54:42+03:00',
|
|
116
|
-
// date_finish: '2025-09-13T10:54:42+03:00',
|
|
117
|
-
// operating_reset_at: 1757750682,
|
|
118
|
-
// operating: 0
|
|
119
|
-
// }
|
|
120
|
-
// }
|