ofsc-utility 1.0.34 → 1.0.35

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.
@@ -108,6 +108,8 @@ async function generateAllOnHandInventoryOfAllResources(clientId, clientSecret,
108
108
  const rows = [];
109
109
  for (const [index, resource] of allResources.entries()) {
110
110
  console.log(`${index} 👤 Fetching Inventories for ${resource.resourceId}`);
111
+ if (!resource)
112
+ continue;
111
113
  if (resource.status !== "active") {
112
114
  console.log(` ⚠ Skipping inactive resource ${resource.resourceId}`);
113
115
  continue;
@@ -116,6 +118,7 @@ async function generateAllOnHandInventoryOfAllResources(clientId, clientSecret,
116
118
  while (true) {
117
119
  const invUrl = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscCore/v1/resources/${encodeURIComponent(resource.resourceId)}/inventories/?offset=${offset}&limit=${limit}`;
118
120
  try {
121
+ console.log(`➡️ Fetching resources offset=${offset}`);
119
122
  const res = await (0, utilities_1.fetchWithRetry)(invUrl, clientId, clientSecret, instanceUrl, token);
120
123
  token = res.token;
121
124
  const itemsData = res.data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofsc-utility",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
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
@@ -32,6 +32,8 @@ export INSTANCE_NAME=yourInstanceName
32
32
  export SUBSCRIPTION_ID=yourSubscriptionId
33
33
  ```
34
34
 
35
+ - `instanceUrl` is the OFSC instance name only, not the full URL. For example: `mycompany` for `mycompany.fs.ocs.oraclecloud.com`.
36
+
35
37
  3. Create a file such as `example.js` and add the sample code below.
36
38
 
37
39
  4. Run the example: