ofsc-utility 1.0.22 → 1.0.24
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/events/index.d.ts +5 -0
- package/dist/events/index.js +7 -4
- package/package.json +1 -1
package/dist/events/index.d.ts
CHANGED
package/dist/events/index.js
CHANGED
|
@@ -115,6 +115,9 @@ function processEventItems(items, sinceDate, output) {
|
|
|
115
115
|
}
|
|
116
116
|
// Add activityId as first level field
|
|
117
117
|
const activityId = item.activityDetails?.activityId ?? null;
|
|
118
|
+
item["uniqueId"] = generateHash(item);
|
|
119
|
+
item["Change"] = item.activityChanges || item.inventoryChanges || item.requestChanges || item.userChanges || {};
|
|
120
|
+
item["Id"] = item.activityId || item.resourceDetails?.resourceId || '-';
|
|
118
121
|
output.push({ activityId, ...item });
|
|
119
122
|
}
|
|
120
123
|
return true;
|
|
@@ -255,9 +258,9 @@ function generateHash(item) {
|
|
|
255
258
|
.createHash("sha256")
|
|
256
259
|
.update(stableStringify({
|
|
257
260
|
eventType: item.eventType,
|
|
258
|
-
activityId: item.activityId || item.resourceDetails.resourceId,
|
|
261
|
+
activityId: item.activityId || item.resourceDetails.resourceId || item.userDetails?.login || '-',
|
|
259
262
|
time: item.time,
|
|
260
|
-
activityChanges: item.activityChanges || item.inventoryChanges || {},
|
|
263
|
+
activityChanges: item.activityChanges || item.inventoryChanges || item.requestChanges || {},
|
|
261
264
|
}))
|
|
262
265
|
.digest("hex");
|
|
263
266
|
}
|
|
@@ -343,8 +346,8 @@ async function downloadAllEventsOfDLastTwoMinutes(clientId, clientSecret, instan
|
|
|
343
346
|
}
|
|
344
347
|
for (let k of page.items) {
|
|
345
348
|
k["uniqueId"] = generateHash(k);
|
|
346
|
-
k["Change"] = k.activityChanges || k.inventoryChanges || {};
|
|
347
|
-
k["Id"] = k.activityId || k.resourceDetails?.resourceId || '-';
|
|
349
|
+
k["Change"] = k.activityChanges || k.inventoryChanges || k.requestChanges || k.userChanges || {};
|
|
350
|
+
k["Id"] = k.activityId || k.resourceDetails?.resourceId || `${k.userDetails?.login}(${k.userDetails?.status})` || '-';
|
|
348
351
|
events.push(k);
|
|
349
352
|
}
|
|
350
353
|
}
|