ofsc-utility 1.0.39 → 1.0.40

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/index.d.ts CHANGED
@@ -14,7 +14,7 @@ export { generateAllOnHandInventoryOfAllResources, generateAllOnHandInventoryOfA
14
14
  export { getOAuthToken } from './oauthTokenService';
15
15
  export { downloadWorkZoneCSV } from './workZones';
16
16
  export { AllResources, downloadAllResourcesCSV, getworkSkillsOfResource } from './resources';
17
- export { downloadAllInactiveUsersCSV, downloadAllUsersCSV, generateUsersCollaborationCSV } from './users';
17
+ export { downloadAllInactiveUsers, downloadAllInactiveUsersCSV, downloadAllUsersCSV, generateUsersCollaborationCSV } from './users';
18
18
  export { downloadAllInventoryTypesCSV, getInventoryTypesDetail, updateCreateInventoryType } from './inventoryTypes';
19
19
  export { getActivitybyId, getAllActivities } from './activities';
20
20
  export { createActivityCustomerInventories, getActivityCustomerInventories } from './activityInventories';
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.createConfigurationFile = exports.createExcelFile = exports.downloadAllEventsOfLastOneHour = exports.downloadAllEventsOfDLastTwoMinutes = exports.downloadAllEventsOfDayCSV = exports.downloadAllEventsOfDay = exports.getActivityCustomerInventories = exports.createActivityCustomerInventories = exports.getAllActivities = exports.getActivitybyId = exports.updateCreateInventoryType = exports.getInventoryTypesDetail = exports.downloadAllInventoryTypesCSV = exports.generateUsersCollaborationCSV = exports.downloadAllUsersCSV = exports.downloadAllInactiveUsersCSV = exports.getworkSkillsOfResource = exports.downloadAllResourcesCSV = exports.AllResources = exports.downloadWorkZoneCSV = exports.getOAuthToken = exports.generateAllOnHandInventoryOfAllResourcesCSV = exports.generateAllOnHandInventoryOfAllResources = exports.WorkZone = exports.Utilities = exports.User = exports.Resource = exports.OauthTokenService = exports.CreateConfigurationFile = exports.InventoryType = exports.Inventory = exports.Events = exports.ActivityInventories = exports.Activity = void 0;
39
+ exports.createConfigurationFile = exports.createExcelFile = exports.downloadAllEventsOfLastOneHour = exports.downloadAllEventsOfDLastTwoMinutes = exports.downloadAllEventsOfDayCSV = exports.downloadAllEventsOfDay = exports.getActivityCustomerInventories = exports.createActivityCustomerInventories = exports.getAllActivities = exports.getActivitybyId = exports.updateCreateInventoryType = exports.getInventoryTypesDetail = exports.downloadAllInventoryTypesCSV = exports.generateUsersCollaborationCSV = exports.downloadAllUsersCSV = exports.downloadAllInactiveUsersCSV = exports.downloadAllInactiveUsers = exports.getworkSkillsOfResource = exports.downloadAllResourcesCSV = exports.AllResources = exports.downloadWorkZoneCSV = exports.getOAuthToken = exports.generateAllOnHandInventoryOfAllResourcesCSV = exports.generateAllOnHandInventoryOfAllResources = exports.WorkZone = exports.Utilities = exports.User = exports.Resource = exports.OauthTokenService = exports.CreateConfigurationFile = exports.InventoryType = exports.Inventory = exports.Events = exports.ActivityInventories = exports.Activity = void 0;
40
40
  // Export all methods grouped by category
41
41
  exports.Activity = __importStar(require("./activities"));
42
42
  exports.ActivityInventories = __importStar(require("./activityInventories"));
@@ -63,6 +63,7 @@ Object.defineProperty(exports, "AllResources", { enumerable: true, get: function
63
63
  Object.defineProperty(exports, "downloadAllResourcesCSV", { enumerable: true, get: function () { return resources_1.downloadAllResourcesCSV; } });
64
64
  Object.defineProperty(exports, "getworkSkillsOfResource", { enumerable: true, get: function () { return resources_1.getworkSkillsOfResource; } });
65
65
  var users_1 = require("./users");
66
+ Object.defineProperty(exports, "downloadAllInactiveUsers", { enumerable: true, get: function () { return users_1.downloadAllInactiveUsers; } });
66
67
  Object.defineProperty(exports, "downloadAllInactiveUsersCSV", { enumerable: true, get: function () { return users_1.downloadAllInactiveUsersCSV; } });
67
68
  Object.defineProperty(exports, "downloadAllUsersCSV", { enumerable: true, get: function () { return users_1.downloadAllUsersCSV; } });
68
69
  Object.defineProperty(exports, "generateUsersCollaborationCSV", { enumerable: true, get: function () { return users_1.generateUsersCollaborationCSV; } });
@@ -4,6 +4,7 @@ declare const OfscUserUtility: {
4
4
  generateUsersCollaborationCSV: any;
5
5
  downloadAllUsersCSV: typeof downloadAllUsersCSV;
6
6
  downloadAllInactiveUsersCSV: typeof downloadAllInactiveUsersCSV;
7
+ downloadAllInactiveUsers: typeof downloadAllInactiveUsers;
7
8
  };
8
9
  export declare function downloadAllInactiveUsersCSV(clientId: string, clientSecret: string, instanceUrl: string, inactivityThresholdDays?: number): Promise<void>;
9
10
  export declare function downloadAllInactiveUsers(clientId: string, clientSecret: string, instanceUrl: string, inactivityThresholdDays?: number): Promise<Record<string, any>[]>;
@@ -122,7 +122,8 @@ Object.defineProperty(exports, "generateUsersCollaborationCSV", { enumerable: tr
122
122
  const OfscUserUtility = {
123
123
  generateUsersCollaborationCSV: require('./collaborationGroups').generateUsersCollaborationCSV,
124
124
  downloadAllUsersCSV,
125
- downloadAllInactiveUsersCSV
125
+ downloadAllInactiveUsersCSV,
126
+ downloadAllInactiveUsers
126
127
  };
127
128
  /**
128
129
  * Returns true if the user is "inactive":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofsc-utility",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "TypeScript helpers for Oracle Field Service Cloud (OFSC): events, resources, inventories, metadata and CSV/Excel utilities.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/readme.md CHANGED
@@ -248,7 +248,7 @@ node scripts/test-download-inactive-users.js
248
248
  users whose last login is within the inactivity threshold, and returns the
249
249
  matching users as an array of plain objects. It does not create a CSV file.
250
250
 
251
- Unlike `downloadAllInactiveUsersCSV`, users with a blank(never loggedin)
251
+ Unlike `downloadAllInactiveUsersCSV`, users with a blank or unparsable
252
252
  `lastLoginTime` are skipped. The threshold defaults to `14` days, and a user is
253
253
  included only when the time since the last login is strictly greater than the
254
254
  threshold.
@@ -301,6 +301,19 @@ downloadAllInactiveUsers(
301
301
  The helper retrieves users in pages of 100 records and requires valid OFSC API
302
302
  credentials.
303
303
 
304
+ To run the repository test script against a built distribution:
305
+
306
+ ```bash
307
+ npm run build
308
+ export CLIENT_ID=yourClientId
309
+ export CLIENT_SECRET=yourClientSecret
310
+ export INSTANCE_URL=yourInstanceName
311
+ export INACTIVITY_THRESHOLD_DAYS=14
312
+ node scripts/test-download-inactive-users-data.js
313
+ ```
314
+
315
+ `INACTIVITY_THRESHOLD_DAYS` is optional in the test script and defaults to `14`.
316
+
304
317
  ### Resource related methods
305
318
 
306
319
  ```js