contentful-management 7.5.2 → 7.7.0
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/CHANGELOG.md +3 -3
- package/dist/contentful-management.browser.js +59 -10
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.legacy.js +59 -10
- package/dist/contentful-management.legacy.js.map +1 -1
- package/dist/contentful-management.legacy.min.js +1 -1
- package/dist/contentful-management.node.js +92 -27
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/create-cma-http-client.js +1 -1
- package/dist/es-modules/create-contentful-api.js +2 -2
- package/dist/es-modules/plain/endpoints/user.js +4 -2
- package/dist/es-modules/plain/plain-client.js +21 -3
- package/dist/typings/create-contentful-api.d.ts +5 -1
- package/dist/typings/create-organization-api.d.ts +6 -2
- package/dist/typings/create-space-api.d.ts +6 -2
- package/dist/typings/entities/user.d.ts +6 -2
- package/dist/typings/plain/endpoints/raw.d.ts +1 -1
- package/dist/typings/plain/endpoints/user.d.ts +1 -1
- package/dist/typings/plain/plain-client.d.ts +27 -27
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# [7.7.0](https://github.com/contentful/contentful-management.js/compare/v7.6.0...v7.7.0) (2021-02-03)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Features
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* optional params for user.getCurrent() ([#669](https://github.com/contentful/contentful-management.js/issues/669)) ([77dffd0](https://github.com/contentful/contentful-management.js/commit/77dffd069849422bdec855b25b485b1129ff1df4))
|
|
@@ -355,6 +355,9 @@ axios.all = function all(promises) {
|
|
|
355
355
|
};
|
|
356
356
|
axios.spread = __webpack_require__(/*! ./helpers/spread */ "../node_modules/axios/lib/helpers/spread.js");
|
|
357
357
|
|
|
358
|
+
// Expose isAxiosError
|
|
359
|
+
axios.isAxiosError = __webpack_require__(/*! ./helpers/isAxiosError */ "../node_modules/axios/lib/helpers/isAxiosError.js");
|
|
360
|
+
|
|
358
361
|
module.exports = axios;
|
|
359
362
|
|
|
360
363
|
// Allow use of default import syntax in TypeScript
|
|
@@ -1357,6 +1360,29 @@ module.exports = function isAbsoluteURL(url) {
|
|
|
1357
1360
|
};
|
|
1358
1361
|
|
|
1359
1362
|
|
|
1363
|
+
/***/ }),
|
|
1364
|
+
|
|
1365
|
+
/***/ "../node_modules/axios/lib/helpers/isAxiosError.js":
|
|
1366
|
+
/*!*********************************************************!*\
|
|
1367
|
+
!*** ../node_modules/axios/lib/helpers/isAxiosError.js ***!
|
|
1368
|
+
\*********************************************************/
|
|
1369
|
+
/*! no static exports found */
|
|
1370
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1371
|
+
|
|
1372
|
+
"use strict";
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* Determines whether the payload is an error thrown by Axios
|
|
1377
|
+
*
|
|
1378
|
+
* @param {*} payload The value to test
|
|
1379
|
+
* @returns {boolean} True if the payload is an error thrown by Axios, otherwise false
|
|
1380
|
+
*/
|
|
1381
|
+
module.exports = function isAxiosError(payload) {
|
|
1382
|
+
return (typeof payload === 'object') && (payload.isAxiosError === true);
|
|
1383
|
+
};
|
|
1384
|
+
|
|
1385
|
+
|
|
1360
1386
|
/***/ }),
|
|
1361
1387
|
|
|
1362
1388
|
/***/ "../node_modules/axios/lib/helpers/isURLSameOrigin.js":
|
|
@@ -2885,8 +2911,7 @@ function toPlainObject(data) {
|
|
|
2885
2911
|
}
|
|
2886
2912
|
// blobs
|
|
2887
2913
|
if (realm.Blob && object instanceof realm.Blob) {
|
|
2888
|
-
|
|
2889
|
-
return clone;
|
|
2914
|
+
return object.slice(0, object.size, object.type);
|
|
2890
2915
|
}
|
|
2891
2916
|
// buffers (node-only)
|
|
2892
2917
|
if (realm.Buffer && realm.Buffer.isBuffer(object)) {
|
|
@@ -2929,6 +2954,10 @@ function toPlainObject(data) {
|
|
|
2929
2954
|
};
|
|
2930
2955
|
return handleCopy(object, createCache());
|
|
2931
2956
|
}
|
|
2957
|
+
// Adding reference to allow usage in CommonJS libraries compiled using TSC, which
|
|
2958
|
+
// expects there to be a default property on the exported object. See
|
|
2959
|
+
// [#37](https://github.com/planttheidea/fast-copy/issues/37) for details.
|
|
2960
|
+
copy.default = copy;
|
|
2932
2961
|
/**
|
|
2933
2962
|
* @function strictCopy
|
|
2934
2963
|
*
|
|
@@ -4335,7 +4364,7 @@ function createCMAHttpClient(params) {
|
|
|
4335
4364
|
var plainClient = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
4336
4365
|
var sdkMain = plainClient ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
4337
4366
|
var userAgentHeader = Object(contentful_sdk_core__WEBPACK_IMPORTED_MODULE_1__["getUserAgentHeader"])( // @ts-expect-error
|
|
4338
|
-
"".concat(sdkMain, "/").concat("7.
|
|
4367
|
+
"".concat(sdkMain, "/").concat("7.7.0"), params.application, params.integration, params.feature);
|
|
4339
4368
|
var requiredHeaders = {
|
|
4340
4369
|
'Content-Type': 'application/vnd.contentful.management.v1+json',
|
|
4341
4370
|
'X-Contentful-User-Agent': userAgentHeader
|
|
@@ -4521,8 +4550,8 @@ function createClientApi(_ref) {
|
|
|
4521
4550
|
* .catch(console.error)
|
|
4522
4551
|
* ```
|
|
4523
4552
|
*/
|
|
4524
|
-
getCurrentUser: function getCurrentUser() {
|
|
4525
|
-
return _plain_endpoints__WEBPACK_IMPORTED_MODULE_3__["user"].getCurrent(http).then(function (data) {
|
|
4553
|
+
getCurrentUser: function getCurrentUser(params) {
|
|
4554
|
+
return _plain_endpoints__WEBPACK_IMPORTED_MODULE_3__["user"].getCurrent(http, params).then(function (data) {
|
|
4526
4555
|
return wrapUser(http, data);
|
|
4527
4556
|
});
|
|
4528
4557
|
},
|
|
@@ -12013,8 +12042,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12013
12042
|
var getForSpace = function getForSpace(http, params) {
|
|
12014
12043
|
return _raw__WEBPACK_IMPORTED_MODULE_0__["get"](http, "/spaces/".concat(params.spaceId, "/users/").concat(params.userId));
|
|
12015
12044
|
};
|
|
12016
|
-
var getCurrent = function getCurrent(http) {
|
|
12017
|
-
return _raw__WEBPACK_IMPORTED_MODULE_0__["get"](http, "/users/me"
|
|
12045
|
+
var getCurrent = function getCurrent(http, params) {
|
|
12046
|
+
return _raw__WEBPACK_IMPORTED_MODULE_0__["get"](http, "/users/me", {
|
|
12047
|
+
params: params === null || params === void 0 ? void 0 : params.query
|
|
12048
|
+
});
|
|
12018
12049
|
};
|
|
12019
12050
|
var getManyForSpace = function getManyForSpace(http, params) {
|
|
12020
12051
|
return _raw__WEBPACK_IMPORTED_MODULE_0__["get"](http, "/spaces/".concat(params.spaceId, "/users"), {
|
|
@@ -12329,7 +12360,25 @@ var createPlainClient = function createPlainClient(params, defaults) {
|
|
|
12329
12360
|
user: {
|
|
12330
12361
|
getManyForSpace: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, _endpoints__WEBPACK_IMPORTED_MODULE_1__["user"].getManyForSpace),
|
|
12331
12362
|
getForSpace: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, _endpoints__WEBPACK_IMPORTED_MODULE_1__["user"].getForSpace),
|
|
12332
|
-
getCurrent:
|
|
12363
|
+
getCurrent: function (_getCurrent) {
|
|
12364
|
+
function getCurrent() {
|
|
12365
|
+
return _getCurrent.apply(this, arguments);
|
|
12366
|
+
}
|
|
12367
|
+
|
|
12368
|
+
getCurrent.toString = function () {
|
|
12369
|
+
return _getCurrent.toString();
|
|
12370
|
+
};
|
|
12371
|
+
|
|
12372
|
+
return getCurrent;
|
|
12373
|
+
}(function () {
|
|
12374
|
+
var _endpoints$user;
|
|
12375
|
+
|
|
12376
|
+
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
12377
|
+
args[_key6] = arguments[_key6];
|
|
12378
|
+
}
|
|
12379
|
+
|
|
12380
|
+
return (_endpoints$user = _endpoints__WEBPACK_IMPORTED_MODULE_1__["user"]).getCurrent.apply(_endpoints$user, [_http].concat(args));
|
|
12381
|
+
}),
|
|
12333
12382
|
getForOrganization: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, _endpoints__WEBPACK_IMPORTED_MODULE_1__["user"].getForOrganization),
|
|
12334
12383
|
getManyForOrganization: Object(_wrappers_wrap__WEBPACK_IMPORTED_MODULE_2__["wrap"])(wrapParams, _endpoints__WEBPACK_IMPORTED_MODULE_1__["user"].getManyForOrganization)
|
|
12335
12384
|
},
|
|
@@ -12388,8 +12437,8 @@ var createPlainClient = function createPlainClient(params, defaults) {
|
|
|
12388
12437
|
}(function () {
|
|
12389
12438
|
var _endpoints$personalAc;
|
|
12390
12439
|
|
|
12391
|
-
for (var
|
|
12392
|
-
args[
|
|
12440
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
12441
|
+
args[_key7] = arguments[_key7];
|
|
12393
12442
|
}
|
|
12394
12443
|
|
|
12395
12444
|
return (_endpoints$personalAc = _endpoints__WEBPACK_IMPORTED_MODULE_1__["personalAccessToken"]).create.apply(_endpoints$personalAc, [_http].concat(args));
|