ofsc-utility 1.0.30 → 1.0.31

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.
@@ -76,7 +76,7 @@ const fetchWithRetry = async (url, clientId, clientSecret, instanceUrl, token, r
76
76
  res = await doFetch(token);
77
77
  }
78
78
  /* ---------- 429: retry with backoff ---------- */
79
- if (res.status === 429 && retries > 0) {
79
+ if ((res.status === 429 || res.status === 400) && retries > 0) {
80
80
  const retryAfter = res.headers.get("Retry-After");
81
81
  console.log("⚠️ 429 received. Retrying...", retryAfter);
82
82
  const delay = retryAfter ? Number(retryAfter) * 1000 : baseDelay;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofsc-utility",
3
- "version": "1.0.30",
3
+ "version": "1.0.31",
4
4
  "description": "A wrapper for Oracle Field Service REST API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/readme.md CHANGED
@@ -282,6 +282,29 @@ The `metadata` object exposes metadata helpers such as:
282
282
  - `getWorkZonesMetaData`
283
283
  - `createConfigurationFile`
284
284
 
285
+ ### Properties metadata note
286
+
287
+ The `getPropertiesMetaData` helper fetches OFSC property definitions and then builds:
288
+
289
+ - `Properties Overview`: one row per property, including label, name, type, entity, GUI, clone flag, and deduplicated comments
290
+ - `Properties Enumerations`: combined enumeration dropdown values for any properties whose data type is `enumeration`
291
+
292
+ This function requires an `allUsedPropes` array to identify which properties are referenced by other metadata types and to collect comments for the overview.
293
+
294
+ ```js
295
+ const allPropes = [];
296
+
297
+ const propertiesSheet = await ofs.metadata.getPropertiesMetaData(
298
+ process.env.CLIENT_ID,
299
+ process.env.CLIENT_SECRET,
300
+ process.env.INSTANCE_NAME,
301
+ allPropes,
302
+ );
303
+
304
+ console.log(propertiesSheet["Properties Overview"]);
305
+ console.log(propertiesSheet["Properties Enumerations"]);
306
+ ```
307
+
285
308
  ## Notes
286
309
 
287
310
  - `instanceUrl` is the OFSC instance name only, not the full URL. For example: `mycompany` for `mycompany.fs.ocs.oraclecloud.com`.