@akc42/app-utils 5.0.4 → 5.0.6
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/api.js +0 -8
- package/package.json +2 -2
- package/partMap.js +1 -1
package/api.js
CHANGED
|
@@ -18,10 +18,6 @@
|
|
|
18
18
|
along with @akc42/app-utils. If not, see <http://www.gnu.org/licenses/>.
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
|
-
import Debug from './debug.js';
|
|
22
|
-
|
|
23
|
-
const debug = Debug('client-api', 'api');
|
|
24
|
-
|
|
25
21
|
class ApiError extends Error {
|
|
26
22
|
constructor(address, code) {
|
|
27
23
|
super('API Error: ' + address)
|
|
@@ -58,24 +54,20 @@ async function api(url, params, bl) {
|
|
|
58
54
|
'chrome=yes,centerscreen,resizable,scrollbars,status,height=800,width=800');
|
|
59
55
|
|
|
60
56
|
document.body.dispatchEvent(new CustomEvent('wait-request',{bubbles: true, composed: true, detail: false}));
|
|
61
|
-
debug('request returned blob');
|
|
62
57
|
return {};
|
|
63
58
|
} else {
|
|
64
59
|
text = await response.text();
|
|
65
60
|
if (text.length > 0) {
|
|
66
61
|
const j = JSON.parse(text);
|
|
67
62
|
document.body.dispatchEvent(new CustomEvent('wait-request',{bubbles: true, composed: true, detail: false}));
|
|
68
|
-
debug('request returned JSON', text);
|
|
69
63
|
return j;
|
|
70
64
|
}
|
|
71
65
|
document.body.dispatchEvent(new CustomEvent('wait-request',{bubbles: true, composed: true, detail: false}));
|
|
72
|
-
debug('empty return');
|
|
73
66
|
return {};
|
|
74
67
|
}
|
|
75
68
|
|
|
76
69
|
} else if (response.status < 500) throw new ApiError(address, response.status);
|
|
77
70
|
} catch (err) {
|
|
78
|
-
//no debug needed - will report at where its thrown
|
|
79
71
|
clearTimeout(timer);
|
|
80
72
|
if (!(err instanceof TypeError)) {
|
|
81
73
|
//not network failure so no retry
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akc42/app-utils",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.6",
|
|
4
4
|
"description": "General Utilities for SPAs",
|
|
5
5
|
"mains": "app-utils.js",
|
|
6
6
|
"scripts": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
},
|
|
21
21
|
"homepage": "https://github.com/akc42/app-utils#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@akc42/server-utils": "^4.0.
|
|
23
|
+
"@akc42/server-utils": "^4.0.1",
|
|
24
24
|
"lit": "^3.3.1"
|
|
25
25
|
}
|
|
26
26
|
}
|