ywana-core8 0.0.371 → 0.0.372
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/dist/index.cjs +23 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +23 -23
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +23 -23
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/http/client.js +5 -4
package/dist/index.modern.js
CHANGED
@@ -8,6 +8,24 @@ import { ReactNotifications, Store } from 'react-notifications-component';
|
|
8
8
|
import 'react-notifications-component/dist/theme.css';
|
9
9
|
import equal from 'deep-equal';
|
10
10
|
|
11
|
+
function _extends() {
|
12
|
+
_extends = Object.assign || function (target) {
|
13
|
+
for (var i = 1; i < arguments.length; i++) {
|
14
|
+
var source = arguments[i];
|
15
|
+
|
16
|
+
for (var key in source) {
|
17
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
18
|
+
target[key] = source[key];
|
19
|
+
}
|
20
|
+
}
|
21
|
+
}
|
22
|
+
|
23
|
+
return target;
|
24
|
+
};
|
25
|
+
|
26
|
+
return _extends.apply(this, arguments);
|
27
|
+
}
|
28
|
+
|
11
29
|
function _catch$2(body, recover) {
|
12
30
|
try {
|
13
31
|
var result = body();
|
@@ -22,7 +40,7 @@ function _catch$2(body, recover) {
|
|
22
40
|
return result;
|
23
41
|
}
|
24
42
|
|
25
|
-
var fetchAsync = function fetchAsync(method, URL, body, token) {
|
43
|
+
var fetchAsync = function fetchAsync(method, URL, body, token, headers) {
|
26
44
|
if (body === void 0) {
|
27
45
|
body = null;
|
28
46
|
}
|
@@ -32,11 +50,11 @@ var fetchAsync = function fetchAsync(method, URL, body, token) {
|
|
32
50
|
var request = {
|
33
51
|
method: method,
|
34
52
|
mode: 'cors',
|
35
|
-
headers: {
|
53
|
+
headers: _extends({
|
36
54
|
"Accept": "application/json",
|
37
55
|
"Content-Type": "application/json",
|
38
56
|
"x-access-token": token
|
39
|
-
},
|
57
|
+
}, headers),
|
40
58
|
body: body
|
41
59
|
};
|
42
60
|
return Promise.resolve(_catch$2(function () {
|
@@ -84,9 +102,9 @@ var HTTPClient = function HTTPClient(domain, securityCtx) {
|
|
84
102
|
var token = securityCtx ? securityCtx.token() : null;
|
85
103
|
return fetchAsync('GET', domain + URL, undefined, token);
|
86
104
|
},
|
87
|
-
POST: function POST(URL, body) {
|
105
|
+
POST: function POST(URL, body, headers) {
|
88
106
|
var token = securityCtx ? securityCtx.token() : null;
|
89
|
-
return fetchAsync('POST', domain + URL, body, token);
|
107
|
+
return fetchAsync('POST', domain + URL, body, token, headers);
|
90
108
|
},
|
91
109
|
PUT: function PUT(URL, body) {
|
92
110
|
var token = securityCtx ? securityCtx.token() : null;
|
@@ -489,24 +507,6 @@ var Header = function Header(props) {
|
|
489
507
|
}, props.children));
|
490
508
|
};
|
491
509
|
|
492
|
-
function _extends() {
|
493
|
-
_extends = Object.assign || function (target) {
|
494
|
-
for (var i = 1; i < arguments.length; i++) {
|
495
|
-
var source = arguments[i];
|
496
|
-
|
497
|
-
for (var key in source) {
|
498
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
499
|
-
target[key] = source[key];
|
500
|
-
}
|
501
|
-
}
|
502
|
-
}
|
503
|
-
|
504
|
-
return target;
|
505
|
-
};
|
506
|
-
|
507
|
-
return _extends.apply(this, arguments);
|
508
|
-
}
|
509
|
-
|
510
510
|
/**
|
511
511
|
* List
|
512
512
|
*/
|