ofsc-utility 1.0.26 → 1.0.27

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.
@@ -43,6 +43,9 @@ export declare function generateHash(item: {
43
43
  login: string;
44
44
  status: string;
45
45
  };
46
+ activityDetails?: {
47
+ activityId: string | number;
48
+ };
46
49
  }): string;
47
50
  /**
48
51
  * Events of last two minutes
@@ -268,7 +268,7 @@ function generateHash(item) {
268
268
  .createHash("sha256")
269
269
  .update(stableStringify({
270
270
  eventType: item.eventType,
271
- activityId: item.activityId || item.resourceDetails?.resourceId || item.userDetails?.login || '-',
271
+ activityId: item.activityDetails?.activityId || item.resourceDetails?.resourceId || item.userDetails?.login || '-',
272
272
  time: item.time,
273
273
  activityChanges: item.activityChanges || item.inventoryChanges || item.requestChanges || {},
274
274
  }))
@@ -357,7 +357,7 @@ async function downloadAllEventsOfDLastTwoMinutes(clientId, clientSecret, instan
357
357
  for (let k of page.items) {
358
358
  k["uniqueId"] = generateHash(k);
359
359
  k["Change"] = k.activityChanges || k.inventoryChanges || k.requestChanges || k.userChanges || {};
360
- k["Id"] = k.activityId || k.resourceDetails?.resourceId || `${k.userDetails?.login}(${k.userDetails?.status})` || '-';
360
+ k["Id"] = k.activityDetails?.activityId || k.resourceDetails?.resourceId || `${k.userDetails?.login}(${k.userDetails?.status})` || '-';
361
361
  events.push(k);
362
362
  }
363
363
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofsc-utility",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "A wrapper for Oracle Field Service REST API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",