ofsc-utility 1.0.19 → 1.0.20

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.
@@ -11,7 +11,7 @@ async function getCapacityMetaData(clientId, clientSecret, instanceUrl, token =
11
11
  const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/capacityAreas?offset=${offset}&limit=${limit}`;
12
12
  const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
13
13
  token = res.token;
14
- responsedata = [...responsedata, ...res.data.items];
14
+ responsedata = [...responsedata, ...res.data?.items || []];
15
15
  if (!res.data.hasMore)
16
16
  break;
17
17
  offset = res.data.offset + limit;
@@ -46,7 +46,7 @@ async function capacitycategoriesOfacapacityArea(clientId, clientSecret, instanc
46
46
  const url = `https://${instanceUrl}.fs.ocs.oraclecloud.com/rest/ofscMetadata/v1/capacityAreas/${capacityArea.label}/capacityCategories`;
47
47
  const res = await (0, utilities_1.fetchWithRetry)(url, clientId, clientSecret, instanceUrl, token);
48
48
  token = res.token;
49
- for (const category of res.data.items) {
49
+ for (const category of res.data?.items || []) {
50
50
  data.push({
51
51
  "capacityArea": capacityArea.label,
52
52
  "Capacity Category": category.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ofsc-utility",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "A wrapper for Oracle Field Service REST API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",