@opsrev/acculynx-cli 1.5.0 → 1.5.1

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -77,12 +77,13 @@ function createApiClient(config) {
77
77
  body
78
78
  });
79
79
  if (!response.ok) {
80
- const text = await response.text();
80
+ const text2 = await response.text();
81
81
  throw new Error(
82
- `API error (${response.status} ${response.statusText}): ${text}`
82
+ `API error (${response.status} ${response.statusText}): ${text2}`
83
83
  );
84
84
  }
85
- return response.json();
85
+ const text = await response.text();
86
+ return text ? JSON.parse(text) : { status: response.status };
86
87
  }
87
88
  return {
88
89
  get: doGet,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opsrev/acculynx-cli",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "CLI for the AccuLynx roofing CRM API",
5
5
  "type": "module",
6
6
  "bin": {