contentful-management 11.8.1 → 11.9.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/dist/contentful-management.browser.js +74 -11
- package/dist/contentful-management.browser.js.map +1 -1
- package/dist/contentful-management.browser.min.js +1 -1
- package/dist/contentful-management.node.js +40 -1
- package/dist/contentful-management.node.js.map +1 -1
- package/dist/contentful-management.node.min.js +1 -1
- package/dist/es-modules/adapters/REST/endpoints/role.js +5 -0
- package/dist/es-modules/contentful-management.js +1 -1
- package/dist/es-modules/create-organization-api.js +30 -0
- package/dist/es-modules/plain/plain-client.js +1 -0
- package/dist/typings/adapters/REST/endpoints/role.d.ts +1 -0
- package/dist/typings/common-types.d.ts +5 -0
- package/dist/typings/create-organization-api.d.ts +17 -0
- package/dist/typings/plain/common-types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -838,10 +838,23 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
838
838
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
839
839
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
840
840
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
841
|
-
function
|
|
842
|
-
function
|
|
841
|
+
function _callSuper(_this, derived, args) {
|
|
842
|
+
function isNativeReflectConstruct() {
|
|
843
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
844
|
+
if (Reflect.construct.sham) return false;
|
|
845
|
+
if (typeof Proxy === "function") return true;
|
|
846
|
+
try {
|
|
847
|
+
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
848
|
+
} catch (e) {
|
|
849
|
+
return false;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
derived = _getPrototypeOf(derived);
|
|
853
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
854
|
+
}
|
|
843
855
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
844
856
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
857
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
845
858
|
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
846
859
|
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
847
860
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -852,11 +865,10 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
852
865
|
var ASSET_KEY_MAX_LIFETIME = 48 * 60 * 60;
|
|
853
866
|
var ValidationError = /*#__PURE__*/function (_Error) {
|
|
854
867
|
_inherits(ValidationError, _Error);
|
|
855
|
-
var _super = _createSuper(ValidationError);
|
|
856
868
|
function ValidationError(name, message) {
|
|
857
869
|
var _this;
|
|
858
870
|
_classCallCheck(this, ValidationError);
|
|
859
|
-
_this =
|
|
871
|
+
_this = _callSuper(this, ValidationError, ["Invalid \"".concat(name, "\" provided, ") + message]);
|
|
860
872
|
_this.name = 'ValidationError';
|
|
861
873
|
return _this;
|
|
862
874
|
}
|
|
@@ -2700,6 +2712,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2700
2712
|
/* harmony export */ del: () => (/* binding */ del),
|
|
2701
2713
|
/* harmony export */ get: () => (/* binding */ get),
|
|
2702
2714
|
/* harmony export */ getMany: () => (/* binding */ getMany),
|
|
2715
|
+
/* harmony export */ getManyForOrganization: () => (/* binding */ getManyForOrganization),
|
|
2703
2716
|
/* harmony export */ update: () => (/* binding */ update)
|
|
2704
2717
|
/* harmony export */ });
|
|
2705
2718
|
/* harmony import */ var fast_copy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! fast-copy */ "../node_modules/fast-copy/dist/esm/index.mjs");
|
|
@@ -2722,6 +2735,11 @@ var getMany = function getMany(http, params) {
|
|
|
2722
2735
|
params: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.normalizeSelect)(params.query)
|
|
2723
2736
|
});
|
|
2724
2737
|
};
|
|
2738
|
+
var getManyForOrganization = function getManyForOrganization(http, params) {
|
|
2739
|
+
return _raw__WEBPACK_IMPORTED_MODULE_1__.get(http, "/organizations/".concat(params.organizationId, "/roles"), {
|
|
2740
|
+
params: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.normalizeSelect)(params.query)
|
|
2741
|
+
});
|
|
2742
|
+
};
|
|
2725
2743
|
var create = function create(http, params, data, headers) {
|
|
2726
2744
|
return _raw__WEBPACK_IMPORTED_MODULE_1__.post(http, "/spaces/".concat(params.spaceId, "/roles"), data, {
|
|
2727
2745
|
headers: headers
|
|
@@ -8874,6 +8892,7 @@ function createOrganizationApi(makeRequest) {
|
|
|
8874
8892
|
var _entities$appAction = _entities__WEBPACK_IMPORTED_MODULE_1__["default"].appAction,
|
|
8875
8893
|
wrapAppAction = _entities$appAction.wrapAppAction,
|
|
8876
8894
|
wrapAppActionCollection = _entities$appAction.wrapAppActionCollection;
|
|
8895
|
+
var wrapRoleCollection = _entities__WEBPACK_IMPORTED_MODULE_1__["default"].role.wrapRoleCollection;
|
|
8877
8896
|
return {
|
|
8878
8897
|
/**
|
|
8879
8898
|
* Gets a User
|
|
@@ -9375,6 +9394,38 @@ function createOrganizationApi(makeRequest) {
|
|
|
9375
9394
|
return wrapOrganizationInvitation(makeRequest, data);
|
|
9376
9395
|
});
|
|
9377
9396
|
},
|
|
9397
|
+
/**
|
|
9398
|
+
* Gets a collection of Roles
|
|
9399
|
+
* @return Promise for a collection of Roles
|
|
9400
|
+
* @example ```javascript
|
|
9401
|
+
* const contentful = require('contentful-management')
|
|
9402
|
+
*
|
|
9403
|
+
* const client = contentful.createClient({
|
|
9404
|
+
* accessToken: '<content_management_api_key>'
|
|
9405
|
+
* })
|
|
9406
|
+
*
|
|
9407
|
+
* client.getOrganization('<org_id>')
|
|
9408
|
+
* .then((org) => org.getRoles())
|
|
9409
|
+
* .then((response) => console.log(response.items))
|
|
9410
|
+
* .catch(console.error)
|
|
9411
|
+
* ```
|
|
9412
|
+
*/
|
|
9413
|
+
getRoles: function getRoles() {
|
|
9414
|
+
var query = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9415
|
+
var raw = this.toPlainObject();
|
|
9416
|
+
return makeRequest({
|
|
9417
|
+
entityType: 'Role',
|
|
9418
|
+
action: 'getManyForOrganization',
|
|
9419
|
+
params: {
|
|
9420
|
+
organizationId: raw.sys.id,
|
|
9421
|
+
query: (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.createRequestConfig)({
|
|
9422
|
+
query: query
|
|
9423
|
+
}).params
|
|
9424
|
+
}
|
|
9425
|
+
}).then(function (data) {
|
|
9426
|
+
return wrapRoleCollection(makeRequest, data);
|
|
9427
|
+
});
|
|
9428
|
+
},
|
|
9378
9429
|
/**
|
|
9379
9430
|
* Creates an app definition
|
|
9380
9431
|
* @param Object representation of the App Definition to be created
|
|
@@ -15885,10 +15936,23 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
|
|
|
15885
15936
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
15886
15937
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
15887
15938
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
15888
|
-
function
|
|
15889
|
-
function
|
|
15939
|
+
function _callSuper(_this, derived, args) {
|
|
15940
|
+
function isNativeReflectConstruct() {
|
|
15941
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
15942
|
+
if (Reflect.construct.sham) return false;
|
|
15943
|
+
if (typeof Proxy === "function") return true;
|
|
15944
|
+
try {
|
|
15945
|
+
return !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
15946
|
+
} catch (e) {
|
|
15947
|
+
return false;
|
|
15948
|
+
}
|
|
15949
|
+
}
|
|
15950
|
+
derived = _getPrototypeOf(derived);
|
|
15951
|
+
return _possibleConstructorReturn(_this, isNativeReflectConstruct() ? Reflect.construct(derived, args || [], _getPrototypeOf(_this).constructor) : derived.apply(_this, args));
|
|
15952
|
+
}
|
|
15890
15953
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
15891
15954
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
15955
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
15892
15956
|
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
15893
15957
|
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
15894
15958
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
@@ -15908,11 +15972,10 @@ var DEFAULT_RETRY_INTERVAL_MS = 2000;
|
|
|
15908
15972
|
|
|
15909
15973
|
var AsyncActionProcessingError = /*#__PURE__*/function (_Error) {
|
|
15910
15974
|
_inherits(AsyncActionProcessingError, _Error);
|
|
15911
|
-
var _super = _createSuper(AsyncActionProcessingError);
|
|
15912
15975
|
function AsyncActionProcessingError(message, action) {
|
|
15913
15976
|
var _this;
|
|
15914
15977
|
_classCallCheck(this, AsyncActionProcessingError);
|
|
15915
|
-
_this =
|
|
15978
|
+
_this = _callSuper(this, AsyncActionProcessingError, [message]);
|
|
15916
15979
|
_defineProperty(_assertThisInitialized(_this), "action", void 0);
|
|
15917
15980
|
_this.action = action;
|
|
15918
15981
|
_this.name = _this.constructor.name;
|
|
@@ -15922,10 +15985,9 @@ var AsyncActionProcessingError = /*#__PURE__*/function (_Error) {
|
|
|
15922
15985
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
15923
15986
|
var AsyncActionFailedError = /*#__PURE__*/function (_AsyncActionProcessin) {
|
|
15924
15987
|
_inherits(AsyncActionFailedError, _AsyncActionProcessin);
|
|
15925
|
-
var _super2 = _createSuper(AsyncActionFailedError);
|
|
15926
15988
|
function AsyncActionFailedError() {
|
|
15927
15989
|
_classCallCheck(this, AsyncActionFailedError);
|
|
15928
|
-
return
|
|
15990
|
+
return _callSuper(this, AsyncActionFailedError, arguments);
|
|
15929
15991
|
}
|
|
15930
15992
|
return _createClass(AsyncActionFailedError);
|
|
15931
15993
|
}(AsyncActionProcessingError);
|
|
@@ -16559,6 +16621,7 @@ var createPlainClient = function createPlainClient(makeRequest, defaults) {
|
|
|
16559
16621
|
role: {
|
|
16560
16622
|
get: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Role', 'get'),
|
|
16561
16623
|
getMany: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Role', 'getMany'),
|
|
16624
|
+
getManyForOrganization: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Role', 'getManyForOrganization'),
|
|
16562
16625
|
create: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Role', 'create'),
|
|
16563
16626
|
createWithId: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Role', 'createWithId'),
|
|
16564
16627
|
update: (0,_wrappers_wrap__WEBPACK_IMPORTED_MODULE_1__.wrap)(wrapParams, 'Role', 'update'),
|
|
@@ -25298,7 +25361,7 @@ function createClient(params) {
|
|
|
25298
25361
|
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
25299
25362
|
var sdkMain = opts.type === 'plain' ? 'contentful-management-plain.js' : 'contentful-management.js';
|
|
25300
25363
|
var userAgent = (0,contentful_sdk_core__WEBPACK_IMPORTED_MODULE_0__.getUserAgentHeader)( // @ts-expect-error
|
|
25301
|
-
"".concat(sdkMain, "/").concat("11.
|
|
25364
|
+
"".concat(sdkMain, "/").concat("11.9.0"), params.application, params.integration, params.feature);
|
|
25302
25365
|
var adapter = (0,_create_adapter__WEBPACK_IMPORTED_MODULE_1__.createAdapter)(params);
|
|
25303
25366
|
|
|
25304
25367
|
// Parameters<?> and ReturnType<?> only return the types of the last overload
|