@panneau/data 3.0.23 → 3.0.40
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/es/index.js +12 -8
- package/lib/index.js +12 -8
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -365,13 +365,14 @@ var Base = /*#__PURE__*/function () {
|
|
|
365
365
|
value: function requestGet(path) {
|
|
366
366
|
var _this = this;
|
|
367
367
|
var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
368
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
368
369
|
var finalQuery = query !== null ? queryString.stringify(query, {
|
|
369
370
|
arrayFormat: 'bracket'
|
|
370
371
|
}) : null;
|
|
371
|
-
return getJSON("".concat(this.getFullUrl(path)).concat(finalQuery !== null && finalQuery.length > 0 ? "?".concat(finalQuery) : ''), {
|
|
372
|
+
return getJSON("".concat(this.getFullUrl(path)).concat(finalQuery !== null && finalQuery.length > 0 ? "?".concat(finalQuery) : ''), _objectSpread({
|
|
372
373
|
credentials: 'include',
|
|
373
374
|
headers: getCSRFHeaders()
|
|
374
|
-
})["catch"](function (error) {
|
|
375
|
+
}, opts))["catch"](function (error) {
|
|
375
376
|
return _this.onError(error);
|
|
376
377
|
});
|
|
377
378
|
}
|
|
@@ -379,10 +380,11 @@ var Base = /*#__PURE__*/function () {
|
|
|
379
380
|
key: "requestPost",
|
|
380
381
|
value: function requestPost(path, data) {
|
|
381
382
|
var _this2 = this;
|
|
382
|
-
|
|
383
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
384
|
+
return postJSON(this.getFullUrl(path), data, _objectSpread({
|
|
383
385
|
credentials: 'include',
|
|
384
386
|
headers: getCSRFHeaders()
|
|
385
|
-
})["catch"](function (error) {
|
|
387
|
+
}, opts))["catch"](function (error) {
|
|
386
388
|
return _this2.onError(error);
|
|
387
389
|
});
|
|
388
390
|
}
|
|
@@ -390,12 +392,13 @@ var Base = /*#__PURE__*/function () {
|
|
|
390
392
|
key: "requestPut",
|
|
391
393
|
value: function requestPut(path, data) {
|
|
392
394
|
var _this3 = this;
|
|
395
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
393
396
|
return postJSON(this.getFullUrl(path), _objectSpread({
|
|
394
397
|
_method: 'PUT'
|
|
395
|
-
}, data), {
|
|
398
|
+
}, data), _objectSpread({
|
|
396
399
|
credentials: 'include',
|
|
397
400
|
headers: getCSRFHeaders()
|
|
398
|
-
})["catch"](function (error) {
|
|
401
|
+
}, opts))["catch"](function (error) {
|
|
399
402
|
return _this3.onError(error);
|
|
400
403
|
});
|
|
401
404
|
}
|
|
@@ -403,12 +406,13 @@ var Base = /*#__PURE__*/function () {
|
|
|
403
406
|
key: "requestPatch",
|
|
404
407
|
value: function requestPatch(path, data) {
|
|
405
408
|
var _this4 = this;
|
|
409
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
406
410
|
return postJSON(this.getFullUrl(path), _objectSpread({
|
|
407
411
|
_method: 'PATCH'
|
|
408
|
-
}, data), {
|
|
412
|
+
}, data), _objectSpread({
|
|
409
413
|
credentials: 'include',
|
|
410
414
|
headers: getCSRFHeaders()
|
|
411
|
-
})["catch"](function (error) {
|
|
415
|
+
}, opts))["catch"](function (error) {
|
|
412
416
|
return _this4.onError(error);
|
|
413
417
|
});
|
|
414
418
|
}
|
package/lib/index.js
CHANGED
|
@@ -384,13 +384,14 @@ var Base = /*#__PURE__*/function () {
|
|
|
384
384
|
value: function requestGet(path) {
|
|
385
385
|
var _this = this;
|
|
386
386
|
var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
387
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
387
388
|
var finalQuery = query !== null ? queryString__default["default"].stringify(query, {
|
|
388
389
|
arrayFormat: 'bracket'
|
|
389
390
|
}) : null;
|
|
390
|
-
return fetch$1.getJSON("".concat(this.getFullUrl(path)).concat(finalQuery !== null && finalQuery.length > 0 ? "?".concat(finalQuery) : ''), {
|
|
391
|
+
return fetch$1.getJSON("".concat(this.getFullUrl(path)).concat(finalQuery !== null && finalQuery.length > 0 ? "?".concat(finalQuery) : ''), _objectSpread__default["default"]({
|
|
391
392
|
credentials: 'include',
|
|
392
393
|
headers: fetch$1.getCSRFHeaders()
|
|
393
|
-
})["catch"](function (error) {
|
|
394
|
+
}, opts))["catch"](function (error) {
|
|
394
395
|
return _this.onError(error);
|
|
395
396
|
});
|
|
396
397
|
}
|
|
@@ -398,10 +399,11 @@ var Base = /*#__PURE__*/function () {
|
|
|
398
399
|
key: "requestPost",
|
|
399
400
|
value: function requestPost(path, data) {
|
|
400
401
|
var _this2 = this;
|
|
401
|
-
|
|
402
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
403
|
+
return fetch$1.postJSON(this.getFullUrl(path), data, _objectSpread__default["default"]({
|
|
402
404
|
credentials: 'include',
|
|
403
405
|
headers: fetch$1.getCSRFHeaders()
|
|
404
|
-
})["catch"](function (error) {
|
|
406
|
+
}, opts))["catch"](function (error) {
|
|
405
407
|
return _this2.onError(error);
|
|
406
408
|
});
|
|
407
409
|
}
|
|
@@ -409,12 +411,13 @@ var Base = /*#__PURE__*/function () {
|
|
|
409
411
|
key: "requestPut",
|
|
410
412
|
value: function requestPut(path, data) {
|
|
411
413
|
var _this3 = this;
|
|
414
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
412
415
|
return fetch$1.postJSON(this.getFullUrl(path), _objectSpread__default["default"]({
|
|
413
416
|
_method: 'PUT'
|
|
414
|
-
}, data), {
|
|
417
|
+
}, data), _objectSpread__default["default"]({
|
|
415
418
|
credentials: 'include',
|
|
416
419
|
headers: fetch$1.getCSRFHeaders()
|
|
417
|
-
})["catch"](function (error) {
|
|
420
|
+
}, opts))["catch"](function (error) {
|
|
418
421
|
return _this3.onError(error);
|
|
419
422
|
});
|
|
420
423
|
}
|
|
@@ -422,12 +425,13 @@ var Base = /*#__PURE__*/function () {
|
|
|
422
425
|
key: "requestPatch",
|
|
423
426
|
value: function requestPatch(path, data) {
|
|
424
427
|
var _this4 = this;
|
|
428
|
+
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
425
429
|
return fetch$1.postJSON(this.getFullUrl(path), _objectSpread__default["default"]({
|
|
426
430
|
_method: 'PATCH'
|
|
427
|
-
}, data), {
|
|
431
|
+
}, data), _objectSpread__default["default"]({
|
|
428
432
|
credentials: 'include',
|
|
429
433
|
headers: fetch$1.getCSRFHeaders()
|
|
430
|
-
})["catch"](function (error) {
|
|
434
|
+
}, opts))["catch"](function (error) {
|
|
431
435
|
return _this4.onError(error);
|
|
432
436
|
});
|
|
433
437
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@panneau/data",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.40",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@babel/runtime": "^7.12.5",
|
|
56
56
|
"@folklore/fetch": "^0.1.16",
|
|
57
57
|
"@folklore/routes": "^0.2.6",
|
|
58
|
-
"@panneau/core": "^3.0.
|
|
58
|
+
"@panneau/core": "^3.0.40",
|
|
59
59
|
"prop-types": "^15.7.2",
|
|
60
60
|
"query-string": "^8.1.0",
|
|
61
61
|
"wouter": "^2.11.0"
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "b5e21c4c2f1e455c3bb627e987968e3ab148961b"
|
|
67
67
|
}
|